Writing npm modules in TypeScript

前端 未结 7 499
醉话见心
醉话见心 2020-11-30 16:58

I am working on my first npm module. I briefly worked with TypeScript before and a big problem was that for many modules there were no definition files available. So I thoug

7条回答
  •  温柔的废话
    2020-11-30 17:40

    You can use autodts to handle distributing and using .d.ts files from npm also without support from the Atom IDE.

    autodts generate will bundle all your own .d.ts files together for publishing on npm, and autodts link handles references to other installed packages, which may not always be directly under node_modules in a larger project split into several subpackages.

    Both commands read their settings from package.json and tsconfig.json in "convention over configuration" style.

    There's another answer on stackoverflow and a blog post with more details.

提交回复
热议问题