kinotto / geonames.js

Nodejs and Browser client for Geonames.org REST API :earth_africa:
http://www.geonames.org/export/client-libraries.html
MIT License
88 stars 17 forks source link

docs: potentially a note about importing into a TSX app? #8

Closed piperchester closed 5 years ago

piperchester commented 5 years ago

Using a freshly installed TSX app through create-react-app, I tried importing the lib with

import Geonames from 'geonames.js';

but I get the dreaded

Could not find a declaration file for module 'geonames.js'. ... implicitly has an 'any' type.

Maybe we could add to the Readme about this to warn users?

kinotto commented 5 years ago

Hi @piperchester , i cannot reproduce the error now cause i don't have a working environment to test it, try just adding in your index.ts the module declaration

declare module "geonames.js";

and let me know if the warning disappear.

Thanks

piperchester commented 5 years ago

Warning disappeared :) is this something we may want to add to the Readme?

kinotto commented 5 years ago

@piperchester yes fine, add a comment in the README suggesting that instruction in a typscript environment. You can use the same PR that you've already opened, then i'll merge it :)

piperchester commented 5 years ago

Done; added to #7