Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Jul 7, 2023
1 parent fb4c5ca commit 8e0ed7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vue-language-core/src/generators/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -671,9 +671,9 @@ declare function defineProp<T>(value?: T | (() => T), required?: boolean, rest?:
generateConstNameOption();

if (scriptSetupRanges?.slotsTypeArg && sfc.scriptSetup) {
codes.push(`var __VLS_slots!: `);
codes.push(`var __VLS_slots!: __VLS_NormalizeSlots<`);
addExtraReferenceVirtualCode('scriptSetup', scriptSetupRanges.slotsTypeArg.start, scriptSetupRanges.slotsTypeArg.end);
codes.push(';\n');
codes.push('>;\n');
};

codes.push(`function __VLS_template() {\n`);
Expand Down
3 changes: 3 additions & 0 deletions packages/vue-language-core/src/utils/globalTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ declare function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K
T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
>;
type __VLS_AsFunctionOrAny<F> = unknown extends F ? any : ((...args: any) => any) extends F ? F : any;
type __VLS_NormalizeSlots<T> = {
[K in keyof T]: T[K] extends () => any ? (arg: any) => ReturnType<T[K]> : T[K]
}
declare function __VLS_componentProps<T, K>(comp: T, fnReturn: K):
__VLS_PickNotAny<K, {}> extends { __ctx: { props: infer P } } ? NonNullable<P>
Expand Down

0 comments on commit 8e0ed7e

Please sign in to comment.