Open mk0x9 opened 5 years ago
I think I can do it. The only things I yet noted that JSDoc doesn't support intersection types (just enumerate all possible properties and their types) and literal values (just use possible types of that values).
https://github.com/google/closure-compiler/wiki/Types-in-the-Closure-Type-System
I did basic stuff (https://github.com/mk0x9/io-ts-codegen/commit/f720056209dfe76cae1aa380224dacbfdb392582), but merging type definitions with same properties would take some time later.
@mk0x9 not sure what's the problem here (I'm not acquainted with GCC) but I think that you can disable renaming https://github.com/google/closure-compiler/pull/2707 is this related?
It kinda defeats purpose of ADVANCED optimizations. I'll attach examples later, probably at the evening, showing what it is and why I'm doing this.
Here you can find brief description about GCC's advanced optimizations: https://developers.google.com/closure/compiler/docs/compilation_levels#advanced_optimizations
And here is useful introduction to GCC: https://github.com/roman01la/closure-compiler-handbook
Google closure compiler mangles all the property names unless you either use bracket syntax to access property (
foo['bar']
instead offoo.bar
) or specify extern file with external declarations (works similar to ambient declarations in typescript).Would be extremely nice to be able to generate extern definitions for closure compiler!