Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Jun 26, 2023
1 parent 20ef362 commit 5e01852
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vue-language-core/src/generators/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ export function generate(
`const ${var_originalComponentDefineComponent} = defineComponent(${var_originalComponentInterpolation});\n`,
);
codes.push(
`const ${var_originalComponent} = {} as __VLS_IsDefineComponentOrConstructor<typeof ${var_originalComponentInterpolation}> extends true ? typeof ${var_originalComponentInterpolation} : typeof ${var_originalComponentDefineComponent};\n`,
`const ${var_originalComponent} = {} as __VLS_EnsureDefineComponent<typeof ${var_originalComponentInterpolation}, typeof ${var_originalComponentDefineComponent}>;\n`,
);
}
else if (componentVars[tag]) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type __VLS_IsDefineComponentOrConstructor<T> = T extends {
__isTeleport?: any;
__isSuspense?: any;
} | (new (...args: any) => any) ? true : false;
type __VLS_EnsureDefineComponent<I, D> = __VLS_IsDefineComponentOrConstructor<I> extends true ? I : D;
type __VLS_FillingEventArg_ParametersLength<E extends (...args: any) => any> = __VLS_IsAny<Parameters<E>> extends true ? -1 : Parameters<E>['length'];
type __VLS_FillingEventArg<E> = E extends (...args: any) => any ? __VLS_FillingEventArg_ParametersLength<E> extends 0 ? ($event?: undefined) => ReturnType<E> : E : E;
Expand Down

0 comments on commit 5e01852

Please sign in to comment.