javascript - Writing NPM modules in Typescript -
i working on first npm module. briefly worked typescript before , big problem many modules there no definition files available. thought idea write module in typescript.
however, can't find information on best way that. found related question "can write npm package in coffeescript?" people suggest publishing javascript files. in contrast coffeescript files, typescript files might useful if used within typescript application.
should include typescript files when publishing npm module, or should publish javascript files , provide generated .d.ts files definitelytyped?
here sample node module written in typescript : https://github.com/basarat/ts-npm-module
here sample typescript project uses sample module https://github.com/basarat/ts-npm-module-consume
basically need :
- compile
commonjs
,declaration:true
- generate
.d.ts
file
and then
- have ide read generated
.d.ts
.
atom-typescript provides nice workflow around : https://github.com/typestrong/atom-typescript#packagejson-support
Comments
Post a Comment