-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
microsoft/TypeScript-DOM-lib-generator
#838Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this
Milestone
Description
Having extra parameters in constructor of custom elements causes error in 3.8.2:
Argument of type 'typeof Foo' is not assignable to parameter of type 'CustomElementConstructor'.(2345)
works just fine in 3.7.5
TypeScript Version: 3.8-Beta
Search Terms:
Expected behavior:
Actual behavior:
Related Issues:
Code
class Foo extends HTMLElement {
constructor(a:string) {
super()
}
}
window.customElements.define('custom-tag', Foo)
class Bar extends HTMLElement {
constructor() {
super()
}
}
window.customElements.define('another-custom-tag', Bar)Output
"use strict";
class Foo extends HTMLElement {
constructor(a) {
super();
}
}
window.customElements.define('custom-tag', Foo);
class Bar extends HTMLElement {
constructor() {
super();
}
}
window.customElements.define('another-custom-tag', Bar);Compiler Options
{
"compilerOptions": {
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictPropertyInitialization": true,
"strictBindCallApply": true,
"noImplicitThis": true,
"noImplicitReturns": true,
"useDefineForClassFields": false,
"alwaysStrict": true,
"allowUnreachableCode": false,
"allowUnusedLabels": false,
"downlevelIteration": false,
"noEmitHelpers": false,
"noLib": false,
"noStrictGenericChecks": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"esModuleInterop": true,
"preserveConstEnums": false,
"removeComments": false,
"skipLibCheck": false,
"checkJs": false,
"allowJs": false,
"declaration": true,
"experimentalDecorators": false,
"emitDecoratorMetadata": false,
"target": "ES2017",
"module": "ESNext"
}
}Playground Link: Provided
lukechu10, lalo-mx, maximilianMairinger, TimvdLippe and jogibear9988
Metadata
Metadata
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this