Closed Bug 1999068 Opened 6 months ago Closed 6 months ago

TS interface for CustomElementConstructor doesn't match HTMLElement

Categories

(Developer Infrastructure :: Lint and Formatting, task)

Tracking

(firefox147 fixed)

RESOLVED FIXED
147 Branch
Tracking Status
firefox147 --- fixed

People

(Reporter: mstriemer, Assigned: mstriemer)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Our generated type definition for CustomElementConstructor doesn't match elements that extend HTMLElement

customElements.define("my-element", class extends HTMLElement {});
// Argument of type 'typeof (Anonymous class)' is not assignable to parameter of type 'CustomElementConstructor'.
//   Type 'typeof (Anonymous class)' provides no match for the signature '(): any'. [2345]

Our interface doesn't match TypeScript's generated types (search for interface CustomElementConstructor)

// Our lib.gecko.dom.d.ts
interface CustomElementConstructor {
    (): any;
}

// TypeScript dom.generated.d.ts
interface CustomElementConstructor {
    new (...params: any[]): HTMLElement;
}

It looks like the TypeScript lib we use to parse webidl files has an override for CustomElementConstructor

Assignee: nobody → mstriemer
Status: NEW → ASSIGNED

Backed out for causing mochites failure on browser_HCM_telemetry.js

Backout link: https://hg-edge.mozilla.org/integration/autoland/rev/98a6999ddf335a8e40f72e6d0f421e619629a806
Log link: https://treeherder.mozilla.org/logviewer?job_id=535794608&repo=autoland&task=DDXK8n8tSyyhZ_GQDqYIOA.0&lineNumber=2366

There were also:

failures on browser_defaultbrowser_alwayscheck.js
failures on test_preferencesBindings_setting.html
failures on sanitize/browser_sanitizeDialog_v2.js
failures on test_preferencesBindings_setting.html
failures on test_setting_control.html
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 147 Branch → ---
Status: REOPENED → RESOLVED
Closed: 6 months ago6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 147 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: