On Mon, Jun 1, 2015 at 6:31 AM, Alex Harui <aha...@adobe.com> wrote: > > > On 6/1/15, 5:39 AM, "Harbs" <harbs.li...@gmail.com> wrote: > > >I believe what you say, but out of curiosity, what about the conversion > >was the deal-breaker? > > I suspect the 10% where TS doesn’t map cleanly to AS. > > FWIW, it was never clear to me that the SWCs to represent popular JS > frameworks could be completely auto-generated. It would always depend on > whether everything in their API surface was truly object-oriented or > whether it relied on something you could only do in JS. So even a tool > that gets you 90% there might be very helpful. >
Agreed. Getting the Typesript d.ts file for a JS library is the hard part. If I am understanding it correctly, almost every d.ts file (for a JS library) is hand-coded. If we have a tool that converts a majority portion of that d.ts to a d.as file, going in and hand-coding things to fit an AS3 paradigm should not be very hard. Also, these are one time conversions. We could do it for a few popular libraries and set the ball rolling. Hopefully, the community will start chipping in to create a bigger collection of d.as files as time goes. > > A few other ideas on this topic: > 1) Since TS is a high-level language, it may not map as cleanly to AS as > the JS it generates. I pondered whether there was a way to get the d.ts > to output to JS and work from there. > It should be possible because, typescript compiles down to javascript. And d.ts is a regular typescript file as well. Thanks, Om