Closed jeromeetienne closed 10 years ago
https://github.com/sinclairzx81/typescript.api for the parser
needs some work to be updated according to the author
@sinclairzx81 willing to play ? :)
the game is would be to generate all those type definitions in better.js format thus to have those check for the js world too
[05:23am] jetienne: in my case, i would case to be able to parse those long definition files and extract the data in a easy to use way
[05:24am] jetienne: something like 'this function receive this kind of type as arguments"
[05:24am] jetienne: "and return this kind of type"
[05:24am] sinclair|work: jetienne: what you probably want to do is have a go hacking the TS compiler
[05:24am] sinclair|work: its not as difficult as it sounds, (tho it is undocumented)
[05:24am] jetienne: i just want a converter of their definition files
[05:25am] sinclair|work: jetienne: yup, can get all that information from the compiler
[05:25am] jetienne: like lib.d.ts converted to json
[05:25am] jetienne: i was hoping somebody else did it for me
[05:25am] sinclair|work: jetienne: if you are used to esprima, the ts AST is similar (but quite a bit more complex),
[05:25am] sinclair|work: but still workable
[05:26am] jetienne: ok
[05:26am] sinclair|work: so, you compile source -> generate AST -> Scan AST
[05:26am] sinclair|work: the tsc command line thing Compiles -> AST -> Emits to Disk
[05:26am] jetienne: sinclair|work: but still you felt like you needed to write a helper library on top… so i isn't that easy
[05:27am] sinclair|work: jetienne: well, its complicated in the regard i had to learn all the things of the language to understand what the AST was telling me
note on the last sentence: this is a lot of time
closed. for IDL which is more standard
Provide a better.js for it
and help the whole web to debug their application