Skip to content

[type bug] fontfaces property is missing from loadingdone event object #51885

Closed

Description

Configuration Check

My compilation target is ES2015 and my lib is ES2022 & `DOM.

Missing / Incorrect Definition

Request to replace the event type of onloadingdone handler from Event to FontFaceSetLoadEvent, which has been defined in the same module.

onloadingdone: ((this: FontFaceSet, ev: Event) => any) | null;

TypeScript/lib/lib.dom.d.ts

Lines 5548 to 5550 in eb9252e

interface FontFaceSetLoadEvent extends Event {
readonly fontfaces: ReadonlyArray<FontFace>;
}

Sample Code

interface FontFaceSet extends EventTarget {
-    onloadingdone: ((this: FontFaceSet, ev: Event) => any) | null;
+    onloadingdone: ((this: FontFaceSet, ev: FontFaceSetLoadEvent) => any) | null;
}

Documentation Link

https://w3c.github.io/csswg-drafts/css-font-loading/#FontFaceSet-events

Activity

  1. RyanCavanaugh commented on Sep 18, 2026

    @RyanCavanaugh
    Member

    Fixed by PR #60061. With --target es2015 --lib es2022,dom, TypeScript 5.7.0-dev.20240927 reports TS2339 because onloadingdone receives Event; 5.7.0-dev.20240928 and current TypeScript type the event as FontFaceSetLoadEvent, so event.fontfaces is available.

  2. TechQuery commented on Sep 19, 2026

    @TechQuery
    Author

    Fixed by PR #60061. With --target es2015 --lib es2022,dom, TypeScript 5.7.0-dev.20240927 reports TS2339 because onloadingdone receives Event; 5.7.0-dev.20240928 and current TypeScript type the event as FontFaceSetLoadEvent, so event.fontfaces is available.

    Thanks! Which version will this fixing be released in? 7.1.x, 6.x, or 5.9.x?

  3. RyanCavanaugh commented on Sep 24, 2026

    @RyanCavanaugh
    Member

    That PR shipped in 5.7 or 5.8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions