Some other compile-to-JS languages will define top-level JS types in a
package, like js.html.HTMLElement instead of HTMLElement. Then, they'll
have metadata to tell the compiler that it should emit plain HTMLElement
when generating the final JS code. I've always kind of wished we had that
in Royale. It would be a pretty big breaking change at this stage, though.

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


On Wed, Feb 18, 2026 at 9:27 AM Harbs <[email protected]> wrote:

> I’m actually not sure how smart it is to pollute the global objects with
> types that will never be used.
>
> It seems like interfaces are not so useful in typedefs.
>
> Mayeb manually editing the files is the best way to go...
>
> > On Feb 18, 2026, at 7:13 PM, Josh Tynjala <[email protected]>
> wrote:
> >
> > As I understand it, the commented out externs are ones that we couldn't
> > properly parse successfully. I would consider it a bug in externc because
> > the externs should generally be considered correct.
> >
> > I think I can fix the bodyUsed issue. It seems to be ignoring the
> @override
> > tag and defaulting to Object because no type is specified. It appears
> that
> > we may have resolved this already for methods, but not getters/setters.
> >
> > After fixing that one, I'll investigate any other issues that you add to
> > this thread.
> >
> > --
> > Josh Tynjala
> > Bowler Hat LLC
> > https://bowlerhat.dev/
> >
> >
> > On Wed, Feb 18, 2026 at 2:13 AM Harbs <[email protected]> wrote:
> >
> >> I’m trying to add more js typedefs and I’m running into issues.
> >>
> >> One issue I just ran into is:
> >>
> >> /** @type {boolean} */
> >> Body.prototype.bodyUsed;
> >>
> >>
> >> /** @override */
> >> Request.prototype.bodyUsed;
> >>
> >> /** @override */
> >> Response.prototype.bodyUsed;
> >>
> >>
> >> Request and Response both:
> >> * @implements {Body}
> >>
> >> When compiling, we get an error because the Request and Response
> >> setters/getters are typed to “Object”, while the Body ones are correctly
> >> types as Booleans.
> >>
> >> It seems like externc does not find the inherited types using
> @implements.
> >>
> >> Is this a bug? Something not implemented? Is it easy to fix?
> >>
> >> We can add more files to the list we maintain in royale-extras, but I’d
> >> like to reduce that rather than increase it.
> >>
> >> Thoughts?
> >>
> >> Harbs
>
>

Reply via email to