Yeah, dts2as is no longer maintained. Even trying to get a small set of
popular libraries consistently converting correctly was too difficult.
TypeScript is constantly evolving, and definitions in the DefinitelyTyped
repo tend to quickly use the latest syntax. The latest syntax is usually to
support more advanced/convoluted JavaScript patterns, so they don't tend to
map very well to the much simpler type system of AS3. Even falling back to
Object/* to bypass the more complex stuff had its own set of pitfalls,
which was most frustrating of all. I just couldn't keep up.

Closure externs being designed specifically for JS makes them more
compatible with TypeScript's type system, so a .d.ts to externs converter
is probably a bit easier for a developer to maintain. The question is, will
.d.ts converted to externs and then converted to .as work better than .d.ts
converted directly to .as? Hard to say.

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>


On Thu, Nov 11, 2021 at 1:24 AM Harbs <harbs.li...@gmail.com> wrote:

> Josh created a tool some time ago, but I don’t think it still works.
>
> https://github.com/BowlerHatLLC/dts2as
>
> > On Nov 11, 2021, at 10:59 AM, Yishay Weiss <yishayj...@hotmail.com>
> wrote:
> >
> > I’m wondering if there’s an easy way to convert d.ts files to externs,
> and then to typedefs using our compiler.
> >
> > Tsickle [1] says it “generates externs.js from TypeScript d.ts (and
> declare, see below)”
> > DefinitelyTyped [2] has d.ts files for almost anything, including
> office-js [3].
> >
> > If I have some time I’ll see if I can figure out a way to do this.
> >
> > [1] angular/tsickle: Tsickle — TypeScript to Closure Translator (
> github.com)<https://github.com/angular/tsickle>
> > [2] DefinitelyTyped/DefinitelyTyped: The repository for high quality
> TypeScript type definitions. (github.com)<
> https://github.com/DefinitelyTyped/DefinitelyTyped>
> > [3] DefinitelyTyped/types/office-js at master ·
> DefinitelyTyped/DefinitelyTyped (github.com)<
> https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/office-js
> >
> >
> >
> >
> > From: Harbs<mailto:harbs.li...@gmail.com>
> > Sent: Thursday, November 11, 2021 10:00 AM
> > To: Apache Royale Development<mailto:dev@royale.apache.org>
> > Subject: Re: Royale Office Add-In avaliable on github
> >
> > Hi Hugo,
> >
> > I’m going to be starting on an Office Addin really soon.
> >
> > I’mm thinking of adding externs for office types to royale-extras.
> >
> > Have you done any work on that?
> >
> >> On Oct 24, 2021, at 6:04 PM, Hugo Ferreira <hferreira...@gmail.com>
> wrote:
> >>
> >> Hi,
> >>
> >> I just finished my Royale Office Add-In and put it available on github:
> >> https://github.com/SolidSoft-Lda/Royale-OfficeAddIn
> >>
> >> Regards,
> >> Hugo.
> >
>
>

Reply via email to