dimanche 8 mars 2015

Typescript: Import Class from another npm module

I'm working on node.js with npm. I've written a TS library and I want to use it in another project by doing npm install. I'm not sure what will should be the contents in my npm package: should it be only .js, only .ts, or .js with additional declaration files (d.ts)?


Furthermore if I'm using the third option, what exactly am I writing in the definition file? how exactly am I using it?I'm not sure what's the connection between d.ts and the actual javascript. I see a lot of different answers but most them didn't help me.


Thanks, Omer


Aucun commentaire:

Enregistrer un commentaire