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. 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. 2) I believe that some popular JS frameworks have an externs.js file that Google Closure uses. These may also serve as a starting point for generating an AS API. In an earlier post, Mike mentioned Jquery and some method overloading. I would think that at the JS level the methods either cleanly map to a single method with optional args or they are just doing AS overloading where the parameter type is Object and testing the type inside the method, but problems like these also need to be handled in creating the AS definition. -Alex