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