File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,16 @@ export namespace Components {
6666 ${ modules . map ( m => `${ m . component } ` ) . join ( '\n' ) . trim ( ) }
6767}
6868
69+ declare global {
70+ ${ jsxElementGlobal }
71+ ${ modules . map ( m => m . element ) . join ( '\n' ) }
72+ interface HTMLElementTagNameMap {
73+ ${ modules . map ( m => `'${ m . tagName } ': ${ m . htmlElementName } ;` ) . join ( '\n' ) }
74+ }
75+
76+ interface ElementTagNameMap extends HTMLElementTagNameMap {}
77+ }
78+
6979declare namespace LocalJSX {
7080 ${ modules . map ( m => `${ m . jsx } ` ) . join ( '\n' ) . trim ( ) }
7181
@@ -77,18 +87,6 @@ declare namespace LocalJSX {
7787export { LocalJSX as JSX };
7888
7989${ jsxAugmentation }
80-
81- declare global {
82- ${ jsxElementGlobal }
83-
84- ${ modules . map ( m => m . element ) . join ( '\n' ) }
85-
86- interface HTMLElementTagNameMap {
87- ${ modules . map ( m => `'${ m . tagName } ': ${ m . htmlElementName } ;` ) . join ( '\n' ) }
88- }
89-
90- interface ElementTagNameMap extends HTMLElementTagNameMap {}
91- }
9290` ;
9391
9492 const typeImportString = Object . keys ( typeImportData ) . reduce ( ( finalString : string , filePath : string ) => {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ export function generateComponentTypes(cmp: d.ComponentCompilerMeta): d.TypesMod
3535 tagNameAsPascal,
3636 htmlElementName,
3737 component : `interface ${ tagNameAsPascal } {${ stencilComponentAttributes } }` ,
38- jsx : `interface ${ tagNameAsPascal } extends JSXBase.HTMLAttributes {${ stencilComponentJSXAttributes } }` ,
38+ jsx : `interface ${ tagNameAsPascal } extends JSXBase.HTMLAttributes< ${ htmlElementName } > {${ stencilComponentJSXAttributes } }` ,
3939 element : `
4040interface ${ htmlElementName } extends Components.${ tagNameAsPascal } , HTMLStencilElement {}
4141var ${ htmlElementName } : {
You can’t perform that action at this time.
0 commit comments