File tree Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Expand file tree Collapse file tree 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,25 @@ describe('resolveType', () => {
615615 expect ( deps && [ ...deps ] ) . toStrictEqual ( Object . keys ( files ) )
616616 } )
617617
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+
618637 test ( 'relative (dynamic import)' , ( ) => {
619638 const files = {
620639 '/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(
11171117 const exported = getId ( spec . exported )
11181118 if ( stmt . source ) {
11191119 // re-export, register an import + export as a type reference
1120- imports [ local ] = {
1120+ imports [ exported ] = {
11211121 source : stmt . source . value ,
11221122 imported : local
11231123 }
You can’t perform that action at this time.
0 commit comments