js生成对应的tsd文件

一、使用npm包

① 安装dtsmake:

1、安装nodejs

2、npm i dtsmake -g

3、npm i tern --save-dev

4、dtsmake -s fileame.js


② 使用dtsmake:

simple case:

dtsmake -s ./path/to/sourcefile.js


other case:

dtsmake -s ./path/to/src/target.js --dist ./path/to/dist/mydefinition -n "mydefinition" -p node -e -S "legacy" -M "MyDefinition" -x "./path/to/extrafile1.js,./path/to/extrafile2.js" -N --def ./path/to/def/ecma6 -A -i -a -g


二、自己写

参考:http://developer.egret.com/cn/github/egret-docs/extension/threes/dts/index.html

上一篇:无

下一篇:JS控制表格的合并