Open falsandtru opened 4 years ago
Now the errors always appear on the latest VSCode. The following different error is simpler but this second error appears only after the first error is caused. Of course all the errors don't appear in compilation.
HTML('custom-tag')
Argument of type '"custom-tag"' is not assignable to parameter of type '"object" | "article" | "aside" | "blockquote" | "body" | "div" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "main" | "nav" | "p" | "section" | "span" | "a" | "abbr" | ... 98 more ... | "custom"'.ts(2345)
Looks like the errors come from the wrong conflict between the following definitions:
// index.ts
declare global {
interface ShadowHostElementTagNameMap extends ShadowHostElementTagNameMap_ {
}
interface HTMLElementTagNameMap extends ShadowHostElementTagNameMap {
}
}
// test\integration\package.ts
declare global {
interface ShadowHostElementTagNameMap {
'custom-tag': HTMLElement;
}
interface HTMLElementTagNameMap {
'custom': HTMLElement;
}
}
@rbuckton @sheetalkamat
TypeScript Version: 3.7.x-dev.20200505
Search Terms:
Code
API(html, shadow)
Expected behavior: no error Actual behavior:
Playground Link:
Related Issues: