Skip to content

Commit

Permalink
fix: also update the migrator for vue 3 typescript shim
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Oct 19, 2020
1 parent 29c9fc6 commit 0db188e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
declare module '*.vue' {
import { DefineComponent } from 'vue';
const component: DefineComponent;
const component: DefineComponent<{}, {}, any>;
export default component;
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ module.exports = function migrateComponentType (file, api) {
// update the component type
componentDecl.forEach(({ node }) => {
node.id.typeAnnotation = j.tsTypeAnnotation(
j.tsTypeReference(j.identifier('DefineComponent'))
j.tsTypeReference(
j.identifier('DefineComponent'),
j.tsTypeParameterInstantiation([
j.tsTypeLiteral([]),
j.tsTypeLiteral([]),
j.tsAnyKeyword()
])
)
)
})

Expand Down

0 comments on commit 0db188e

Please sign in to comment.