@@ -18,19 +18,58 @@ export function resolveCtxMap(
1818) :Map < import ( 'typescript' ) . Node , string > {
1919if ( ctxNodeMap . size ) {
2020options . codes . push ( `
21- // @ts-ignore
2221type __VLS_IsAny<T> = 0 extends 1 & T ? true : false; type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
23- type __VLS_Element = globalThis.JSX.Element;
24- declare function __VLS_asFunctionalComponent<T, K = T extends new (...args: any) => any ? InstanceType<T> : unknown>(t: T, instance?: K):
25- T extends new (...args: any) => any
26- ? (props: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>, ctx?: any) => __VLS_Element & { __ctx?: {
27- attrs?: any,
28- slots?: K extends { $scopedSlots: infer Slots } ? Slots : K extends { $slots: infer Slots } ? Slots : any,
29- emit?: K extends { $emit: infer Emit } ? Emit : any
30- } & { props?: (K extends { $props: infer Props } ? Props : any) & Record<string, unknown>; expose?(exposed: K): void; } }
31- : T extends () => any ? (props: {}, ctx?: any) => ReturnType<T>
32- : T extends (...args: any) => any ? T
33- : (_: {} & Record<string, unknown>, ctx?: any) => { __ctx?: { attrs?: any, expose?: any, slots?: any, emit?: any, props?: {} & Record<string, unknown> } };
22+ declare function __VLS_asFunctionalComponent<
23+ T,
24+ K = T extends new (...args: any) => any ? InstanceType<T> : unknown,
25+ >(
26+ t: T,
27+ instance?: K,
28+ ): T extends new (...args: any) => any
29+ ? (
30+ props: (K extends { $props: infer Props }
31+ ? Props
32+ : K extends { props: infer Props }
33+ ? Props
34+ : any),
35+ ctx?: any,
36+ ) => JSX.Element & {
37+ __ctx: {
38+ attrs?: Record<string, any>,
39+ props: (K extends { $props: infer Props }
40+ ? Props
41+ : K extends { props: infer Props }
42+ ? Props
43+ : any),
44+ slots?: K extends { $slots: infer Slots }
45+ ? Slots
46+ : K extends { slots: infer Slots }
47+ ? Slots
48+ : any
49+ emit?: K extends { $emit: infer Emit }
50+ ? Emit
51+ : K extends { emit: infer Emit }
52+ ? Emit
53+ : any
54+ expose?: (exposed: K extends { exposeProxy: infer Exposed }
55+ ? keyof Exposed extends never
56+ ? K
57+ : Exposed
58+ : K) => void
59+ }
60+ }
61+ : T extends () => any
62+ ? (props: {}, ctx?: any) => ReturnType<T>
63+ : T extends (...args: any) => any
64+ ? T
65+ : (_: {}, ctx?: any) => {
66+ __ctx: {
67+ attrs?: any
68+ expose?: any
69+ slots?: any
70+ emit?: any
71+ }
72+ };
3473const __VLS_nativeElements = {
3574 ...{} as SVGElementTagNameMap,
3675 ...{} as HTMLElementTagNameMap,
@@ -41,8 +80,7 @@ declare function __VLS_getFunctionalComponentCtx<T, K, const S>(
4180 s: S,
4281): S extends keyof typeof __VLS_nativeElements
4382 ? { expose: (exposed: (typeof __VLS_nativeElements)[S]) => any }
44- : T extends { setup: (props: infer P, ctx: infer Ctx) => any } ? { props: P } & Ctx :
45- '__ctx' extends keyof __VLS_PickNotAny<K, {}>
83+ : '__ctx' extends keyof __VLS_PickNotAny<K, {}>
4684 ? K extends { __ctx?: infer Ctx } ? Ctx : never
4785 : T extends (props: infer P, ctx: infer Ctx) => any ? { props: P } & Ctx
4886 : {};\n` )