1-1、ts2js&&dts
tsc --declaration xxx.ts
注意:openSrc的,如果有TS可以下载TS看,their一般是通过Ts编译成js库的
1-2、ts2js - asLib
tsc yourfile.ts
2、js2tsD
- 使用dts-gen工具
- example(可能有误):dts-gen yourfile.js -o yourfile.d.ts
- dtsmake
3、js2ts
- 网址
- TypeScript Playground【https://www.typescriptlang.org/play/】
- Babel REPL【https://babeljs.io/repl/】
- Online Convert【https://www.onlineconverter.com/javascript-to-typescript】
- TypeScript declaration files generator
- 工具
- JSToTS
- TypeScriptify
- Babel
- TypeScript Compiler API
- TSD