Open jmesserly opened 8 years ago
Would a full TypeScript output even be needed? Maybe ES5/Closure output plus the TypeScript definition files for it would be enough.
good point. .d.ts files definitely would cover some of the use cases.
Definition files and JS would be better than actual TS files as TS misses a good module system for importing out of project TS files but do have infrastructure for using JS modules with definition files.
@Pajn I don't think this would be an issue. TypeScript now has ES6 modules. The old module system is deprecated, so TypeScript modules are basically ES6 modules with types. I successfully imported some pure third-party modules in my app.
I think the problem with TypeScript in general is the different type system. I have no idea how someone would, for example, represent named constructors in TypeScript.
Importing the files is possible yes, but you will have to provide all dependencies (or type definitions) for the modules you are importing as all files that is necessary for compilation needs to be listed in the files array.
This has been on our radar for a while, but I don't see an issue to discuss it, so here it is.
The goal would be to have a TypeScript output mode, in addition to the current ES6 (and work-in-progress Closure Compiler).
CC @ochafik who is working on the Closure Compiler backend.