@@ -57,6 +57,20 @@ export function generateGlobalTypes(lib: string, target: number, strictTemplates
5757 ? K extends { __ctx?: { props?: infer P } } ? NonNullable<P> : never
5858 : T extends (props: infer P, ...args: any) => any ? P
5959 : {};
60+ type __VLS_FunctionalGeneralComponent<T> = (props: ${ fnPropsType } , ctx?: any) => __VLS_Element & {
61+ __ctx?: {
62+ attrs?: any,
63+ slots?: T extends { ${ getSlotsPropertyName ( target ) } : infer Slots } ? Slots : any,
64+ emit?: T extends { $emit: infer Emit } ? Emit : any,
65+ props?: ${ fnPropsType } ,
66+ expose?(exposed: T): void,
67+ }
68+ };
69+ type __VLS_NormalizeSlotReturns<S, R = ReturnType<NonNullable<S>>> = R extends any[] ? {
70+ [K in keyof R]: R[K] extends { __ctx?: any } | Element
71+ ? R[K]
72+ : ReturnType<__VLS_FunctionalGeneralComponent<R[K]>>
73+ } : R;
6074 type __VLS_IsFunction<T, K> = K extends keyof T
6175 ? __VLS_IsAny<T[K]> extends false
6276 ? unknown extends T[K]
@@ -99,19 +113,6 @@ export function generateGlobalTypes(lib: string, target: number, strictTemplates
99113 type __VLS_PrettifyGlobal<T> = { [K in keyof T]: T[K]; } & {};
100114 type __VLS_UseTemplateRef<T> = Readonly<import('${ lib } ').ShallowRef<T | null>>;
101115
102- type __VLS_FunctionalGeneralComponent<T> = (props: ${ fnPropsType } , ctx?: any) => __VLS_Element & {
103- __ctx?: {
104- attrs?: any,
105- slots?: T extends { ${ getSlotsPropertyName ( target ) } : infer Slots } ? Slots : any,
106- emit?: T extends { $emit: infer Emit } ? Emit : any,
107- props?: ${ fnPropsType } ,
108- expose?(exposed: T): void,
109- }
110- };
111- type __VLS_NormalizeSlotReturns<S, R = ReturnType<NonNullable<S>>> = R extends any[] ? {
112- [K in keyof R]: R[K] extends { __ctx?: any } ? R[K] : ReturnType<__VLS_FunctionalGeneralComponent<R[K]>>
113- } : R;
114-
115116 function __VLS_getVForSourceType(source: number): [number, number, number][];
116117 function __VLS_getVForSourceType(source: string): [string, number, number][];
117118 function __VLS_getVForSourceType<T extends any[]>(source: T): [
0 commit comments