这是用Typescript编写的示例Node模块:https :
//github.com/basarat/ts-npm-module
这是使用此示例模块的示例Typescript项目https://github.com/basarat/ts-npm-module-
consume
基本上,您需要:
- 用
commonjs
和编译declaration:true
- 生成
.d.ts
文件
然后
- 让您的助手阅读生成的
.d.ts
。
Atom-Typescript为此提供了一个不错的工作流程:https : //github.com/TypeStrong/atom-
typescript#packagejson-support



