File tree 2 files changed +20
-1
lines changed
2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,25 @@ describe('resolveType', () => {
615
615
expect ( deps && [ ...deps ] ) . toStrictEqual ( Object . keys ( files ) )
616
616
} )
617
617
618
+ test ( 'relative (re-export /w same source type name)' , ( ) => {
619
+ const files = {
620
+ '/foo.ts' : `export default interface P { foo: string }` ,
621
+ '/bar.ts' : `export default interface PP { bar: number }` ,
622
+ '/baz.ts' : `export { default as X } from './foo'; export { default as XX } from './bar'; `
623
+ }
624
+ const { props, deps } = resolve (
625
+ `import { X, XX } from './baz'
626
+ defineProps<X & XX>()
627
+ ` ,
628
+ files
629
+ )
630
+ expect ( props ) . toStrictEqual ( {
631
+ foo : [ 'String' ] ,
632
+ bar : [ 'Number' ]
633
+ } )
634
+ expect ( deps && [ ...deps ] ) . toStrictEqual ( [ '/baz.ts' , '/foo.ts' , '/bar.ts' ] )
635
+ } )
636
+
618
637
test ( 'relative (dynamic import)' , ( ) => {
619
638
const files = {
620
639
'/foo.ts' : `export type P = { foo: string, bar: import('./bar').N }` ,
Original file line number Diff line number Diff line change @@ -1117,7 +1117,7 @@ function recordTypes(
1117
1117
const exported = getId ( spec . exported )
1118
1118
if ( stmt . source ) {
1119
1119
// re-export, register an import + export as a type reference
1120
- imports [ local ] = {
1120
+ imports [ exported ] = {
1121
1121
source : stmt . source . value ,
1122
1122
imported : local
1123
1123
}
You can’t perform that action at this time.
0 commit comments