简体   繁体   中英

Generate definition for other JS “compilers” from TypeScript definition file?

Given a TypeScript definition file, is there any (automated/quick/easy) way to "convert" this definition so it will work with other JavaScript compilers?

I realize there are a ton of "JavaScript compilers" out there, but the goal is to determine which are the most popular and be able to provide definition files for those frameworks.

is there any (automated/quick/easy) way to "convert" this definition so it will work with other JavaScript compilers

No. And considering the still active development in the TypeScript land it would be a non trivial task to have such a thing without active maintainence. Consider the simple case of union types (eg string | number ) which was unsupported by some custom TypeScript parsers for a few months.

Now the moving target is ES6 module syntax support

Soon : others https://github.com/Microsoft/TypeScript/wiki/Roadmap

You would have to pick one other Compile to JS language that also has TypeSafety (that rules out coffeescript) and start hacking away at it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM