Skip to content

Commit 598cfad

Browse files
committed
Simplify __VLS_pickFunctionalComponentCtx usages
1 parent 77476b3 commit 598cfad

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/language-core/lib/codegen/script/globalTypes.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@ declare global {
8686
: (_: {}${vueCompilerOptions.strictTemplates ? '' : ' & Record<string, unknown>'}, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {}${vueCompilerOptions.strictTemplates ? '' : ' & Record<string, unknown>'} } };
8787
function __VLS_elementAsFunction<T>(tag: T, endTag?: T): (_: T${vueCompilerOptions.strictTemplates ? '' : ' & Record<string, unknown>'}) => void;
8888
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(t: T): Parameters<T>['length'] extends 2 ? [any] : [];
89-
function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K): __VLS_PickNotAny<
89+
function __VLS_pickFunctionalComponentCtx<T, K>(comp: T, compInstance: K): NonNullable<__VLS_PickNotAny<
9090
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: infer Ctx } ? Ctx : never : any
9191
, T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
92-
>;
92+
>>;
9393
type __VLS_FunctionalComponentProps<T, K> =
9494
'__ctx' extends keyof __VLS_PickNotAny<K, {}> ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
9595
: T extends (props: infer P, ...args: any) => any ? P :

packages/language-core/lib/codegen/template/element.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export function* generateComponent(
237237
}
238238

239239
if (ctx.usedComponentCtxVars.has(var_defineComponentCtx)) {
240-
yield `const ${var_defineComponentCtx} = __VLS_nonNullable(__VLS_pickFunctionalComponentCtx(${var_originalComponent}, ${var_componentInstance}))${endOfLine}`;
240+
yield `const ${var_defineComponentCtx} = __VLS_pickFunctionalComponentCtx(${var_originalComponent}, ${var_componentInstance})${endOfLine}`;
241241
}
242242
}
243243

0 commit comments

Comments
 (0)