Skip to content

Commit

Permalink
fix: default exports
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 25, 2021
1 parent cf56931 commit 0a54e54
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
24 changes: 12 additions & 12 deletions examples/vue3/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

declare module 'vue' {
export interface GlobalComponents {
CarbonSvg: typeof import('./src/components/CarbonSvg.svg')
ComponentA: typeof import('./src/components/ComponentA.vue')
ComponentB: typeof import('./src/components/ComponentB.vue')
ComponentD: typeof import('./src/components/ComponentD.vue')
MarkdownA: typeof import('./src/components/MarkdownA.md')
MarkdownB: typeof import('./src/components/MarkdownB.md')
Recursive: typeof import('./src/components/Recursive.vue')
ComponentC: typeof import('./src/components/component-c.vue')
Book: typeof import('./src/components/book/index.vue')
Avatar: typeof import('./src/components/global/avatar.vue')
UiButton: typeof import('./src/components/ui/button.vue')
UiNestedCheckbox: typeof import('./src/components/ui/nested/checkbox.vue')
CarbonSvg: typeof import('./src/components/CarbonSvg.svg')['default']
ComponentA: typeof import('./src/components/ComponentA.vue')['default']
ComponentB: typeof import('./src/components/ComponentB.vue')['default']
ComponentD: typeof import('./src/components/ComponentD.vue')['default']
MarkdownA: typeof import('./src/components/MarkdownA.md')['default']
MarkdownB: typeof import('./src/components/MarkdownB.md')['default']
Recursive: typeof import('./src/components/Recursive.vue')['default']
ComponentC: typeof import('./src/components/component-c.vue')['default']
Book: typeof import('./src/components/book/index.vue')['default']
Avatar: typeof import('./src/components/global/avatar.vue')['default']
UiButton: typeof import('./src/components/ui/button.vue')['default']
UiNestedCheckbox: typeof import('./src/components/ui/nested/checkbox.vue')['default']
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/declaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export async function generateDeclaration(ctx: Context, root: string, filepath:
let entry = `${name}: typeof import('${related}')`
if (importName)
entry += `['${importName}']`
else
entry += '[\'default\']'
return entry
})

Expand Down

0 comments on commit 0a54e54

Please sign in to comment.