@@ -206,7 +206,7 @@ declare module "@stencil/core" {
206206 resolved : '"wee" | "woo"' ,
207207 references : {
208208 SecondUserImplementedEventType : {
209- id : 'placeholder ' ,
209+ id : './resources.ts::SecondUserImplementedEventType ' ,
210210 location : 'import' ,
211211 path : './resources' ,
212212 } ,
@@ -310,7 +310,7 @@ declare module "@stencil/core" {
310310 references : {
311311 UserImplementedEventType : {
312312 location : 'import' ,
313- id : 'placeholder ' ,
313+ id : './resources.ts::UserImplementedEventType ' ,
314314 path : './resources' ,
315315 } ,
316316 } ,
@@ -479,7 +479,7 @@ declare module "@stencil/core" {
479479 UserImplementedEventType : {
480480 location : 'import' ,
481481 path : './resources' ,
482- id : 'placeholder ' ,
482+ id : './resources::UserImplementedEventType ' ,
483483 } ,
484484 } ,
485485 } ,
@@ -502,7 +502,7 @@ declare module "@stencil/core" {
502502 UserImplementedEventType : {
503503 location : 'import' ,
504504 path : './resources' ,
505- id : 'placeholder ' ,
505+ id : './resources::UserImplementedEventType ' ,
506506 } ,
507507 } ,
508508 } ,
@@ -649,7 +649,7 @@ declare module "@stencil/core" {
649649 UserImplementedEventType : {
650650 location : 'local' ,
651651 path : '/some/stubbed/path/a/my-component.tsx' ,
652- id : 'placeholder ' ,
652+ id : '/some/stubbed/path/a/my-component.tsx::UserImplementedEventType ' ,
653653 } ,
654654 } ,
655655 } ,
@@ -671,7 +671,7 @@ declare module "@stencil/core" {
671671 references : {
672672 UserImplementedEventType : {
673673 location : 'local' ,
674- id : 'placeholder ' ,
674+ id : '/some/stubbed/path/b/my-new-component.tsx::UserImplementedEventType ' ,
675675 path : '/some/stubbed/path/b/my-new-component.tsx' ,
676676 } ,
677677 } ,
@@ -819,7 +819,7 @@ declare module "@stencil/core" {
819819 UserImplementedPropType : {
820820 location : 'import' ,
821821 path : './resources' ,
822- id : 'placeholder ' ,
822+ id : './resources::UserImplementedPropType ' ,
823823 } ,
824824 } ,
825825 } ,
@@ -907,7 +907,7 @@ declare module "@stencil/core" {
907907 UserImplementedPropType : {
908908 location : 'import' ,
909909 path : './resources' ,
910- id : 'placeholder ' ,
910+ id : './resources::UserImplementedPropType ' ,
911911 } ,
912912 } ,
913913 } ,
@@ -921,7 +921,7 @@ declare module "@stencil/core" {
921921 SecondUserImplementedPropType : {
922922 location : 'import' ,
923923 path : './resources' ,
924- id : 'placeholder ' ,
924+ id : './resources::SecondUserImplementedPropType ' ,
925925 } ,
926926 } ,
927927 } ,
@@ -1011,7 +1011,7 @@ declare module "@stencil/core" {
10111011 UserImplementedPropType : {
10121012 location : 'import' ,
10131013 path : './resources' ,
1014- id : 'placeholder ' ,
1014+ id : './resources::UserImplementedPropType ' ,
10151015 } ,
10161016 } ,
10171017 } ,
@@ -1035,7 +1035,7 @@ declare module "@stencil/core" {
10351035 UserImplementedPropType : {
10361036 location : 'import' ,
10371037 path : '../resources' ,
1038- id : 'placeholder ' ,
1038+ id : '../resources::UserImplementedPropType ' ,
10391039 } ,
10401040 } ,
10411041 } ,
@@ -1152,7 +1152,7 @@ declare module "@stencil/core" {
11521152 references : {
11531153 UserImplementedPropType : {
11541154 location : 'import' ,
1155- id : 'placeholder ' ,
1155+ id : './resources.ts::UserImplementedPropType ' ,
11561156 path : './resources' ,
11571157 } ,
11581158 } ,
@@ -1177,7 +1177,7 @@ declare module "@stencil/core" {
11771177 UserImplementedPropType : {
11781178 location : 'import' ,
11791179 path : './resources' ,
1180- id : 'placeholder ' ,
1180+ id : './resources.ts::UserImplementedPropType ' ,
11811181 } ,
11821182 } ,
11831183 } ,
@@ -1297,7 +1297,7 @@ declare module "@stencil/core" {
12971297 UserImplementedPropType : {
12981298 location : 'local' ,
12991299 path : '/some/stubbed/path/a/my-component.tsx' ,
1300- id : 'placeholder ' ,
1300+ id : '/some/stubbed/path/a/my-component.tsx::UserImplementedPropType ' ,
13011301 } ,
13021302 } ,
13031303 } ,
@@ -1321,7 +1321,7 @@ declare module "@stencil/core" {
13211321 UserImplementedPropType : {
13221322 location : 'local' ,
13231323 path : '/some/stubbed/path/b/my-new-component.tsx' ,
1324- id : 'placeholder ' ,
1324+ id : '/some/stubbed/path/b/my-new-component.tsx::UserImplementedPropType ' ,
13251325 } ,
13261326 } ,
13271327 } ,
@@ -1444,7 +1444,7 @@ declare module "@stencil/core" {
14441444 UserImplementedPropType : {
14451445 location : 'import' ,
14461446 path : './resources' ,
1447- id : 'placeholder ' ,
1447+ id : './resources.ts::UserImplementedPropType ' ,
14481448 } ,
14491449 } ,
14501450 } ,
@@ -1720,6 +1720,98 @@ declare module "@stencil/core" {
17201720 }
17211721 }
17221722}
1723+ ` ,
1724+ {
1725+ immediateWrite : true ,
1726+ } ,
1727+ ) ;
1728+ } ) ;
1729+
1730+ it ( 'should handle type import aliases' , async ( ) => {
1731+ const compilerComponentMeta = stubComponentCompilerMeta ( {
1732+ tagName : 'my-component' ,
1733+ componentClassName : 'MyComponent' ,
1734+ jsFilePath : '/some/stubbed/path/a/my-component.js' ,
1735+ sourceFilePath : '/some/stubbed/path/a/my-component.tsx' ,
1736+ sourceMapPath : '/some/stubbed/path/a/my-component.js.map' ,
1737+ hasProp : true ,
1738+ properties : [
1739+ stubComponentCompilerProperty ( {
1740+ name : 'name' ,
1741+ complexType : {
1742+ original : 'UserImplementedPropType' ,
1743+ resolved : '"foo" | "bar"' ,
1744+ references : {
1745+ UserImplementedPropType : {
1746+ id : 'some-file.ts::MyType' ,
1747+ location : 'import' ,
1748+ path : '@utils' ,
1749+ } ,
1750+ } ,
1751+ } ,
1752+ } ) ,
1753+ ] ,
1754+ } ) ;
1755+ buildCtx . components = [ compilerComponentMeta ] ;
1756+ config . tsCompilerOptions = { } ;
1757+
1758+ await generateAppTypes ( config , compilerCtx , buildCtx , 'src' ) ;
1759+
1760+ expect ( mockWriteFile ) . toHaveBeenCalledWith (
1761+ '/components.d.ts' ,
1762+ `/* eslint-disable */
1763+ /* tslint:disable */
1764+ /**
1765+ * This is an autogenerated file created by the Stencil compiler.
1766+ * It contains typing information for all components that exist in this project.
1767+ */
1768+ import { HTMLStencilElement, JSXBase } from "@stencil/core/internal";
1769+ import { MyType as UserImplementedPropType } from "@utils";
1770+ export { MyType as UserImplementedPropType } from "@utils";
1771+ export namespace Components {
1772+ /**
1773+ * docs
1774+ */
1775+ interface MyComponent {
1776+ "name": UserImplementedPropType;
1777+ }
1778+ }
1779+ declare global {
1780+ /**
1781+ * docs
1782+ */
1783+ interface HTMLMyComponentElement extends Components.MyComponent, HTMLStencilElement {
1784+ }
1785+ var HTMLMyComponentElement: {
1786+ prototype: HTMLMyComponentElement;
1787+ new (): HTMLMyComponentElement;
1788+ };
1789+ interface HTMLElementTagNameMap {
1790+ "my-component": HTMLMyComponentElement;
1791+ }
1792+ }
1793+ declare namespace LocalJSX {
1794+ /**
1795+ * docs
1796+ */
1797+ interface MyComponent {
1798+ "name"?: UserImplementedPropType;
1799+ }
1800+ interface IntrinsicElements {
1801+ "my-component": MyComponent;
1802+ }
1803+ }
1804+ export { LocalJSX as JSX };
1805+ declare module "@stencil/core" {
1806+ export namespace JSX {
1807+ interface IntrinsicElements {
1808+ /**
1809+ * docs
1810+ */
1811+ "my-component": LocalJSX.MyComponent & JSXBase.HTMLAttributes<HTMLMyComponentElement>;
1812+ }
1813+ }
1814+ }
17231815` ,
17241816 {
17251817 immediateWrite : true ,
0 commit comments