global.d.ts
7.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
// @ts-nocheck
export {};
declare module 'vue' {
export interface GlobalComponents {}
export interface GlobalDirectives {}
}
declare global {
const __VLS_directiveBindingRestFields: {
dir: any;
instance: null;
modifiers: any;
oldValue: null;
};
const __VLS_unref: typeof import('vue').unref;
const __VLS_placeholder: any;
const __VLS_intrinsics: globalThis.JSX.IntrinsicElements;
type __VLS_Elements = __VLS_SpreadMerge<
SVGElementTagNameMap,
HTMLElementTagNameMap
>;
type __VLS_GlobalComponents = import('vue').GlobalComponents &
Pick<
typeof import('vue'),
'KeepAlive' | 'Suspense' | 'Teleport' | 'Transition' | 'TransitionGroup'
>;
type __VLS_GlobalDirectives = import('vue').GlobalDirectives;
type __VLS_IsAny<T> = 0 extends 1 & T ? true : false;
type __VLS_PickNotAny<A, B> = __VLS_IsAny<A> extends true ? B : A;
type __VLS_SpreadMerge<A, B> = B & Omit<A, keyof B>;
type __VLS_WithComponent<
N0 extends string,
LocalComponents,
Self,
N1 extends string,
N2 extends string,
N3 extends string,
> = N1 extends keyof LocalComponents
? { [K in N0]: LocalComponents[N1] }
: N2 extends keyof LocalComponents
? { [K in N0]: LocalComponents[N2] }
: N3 extends keyof LocalComponents
? { [K in N0]: LocalComponents[N3] }
: Self extends object
? { [K in N0]: Self }
: N1 extends keyof __VLS_GlobalComponents
? { [K in N0]: __VLS_GlobalComponents[N1] }
: N2 extends keyof __VLS_GlobalComponents
? { [K in N0]: __VLS_GlobalComponents[N2] }
: N3 extends keyof __VLS_GlobalComponents
? { [K in N0]: __VLS_GlobalComponents[N3] }
: {};
type __VLS_FunctionalComponentCtx<T, K> = __VLS_PickNotAny<
'__ctx' extends keyof __VLS_PickNotAny<K, {}>
? K extends { __ctx?: infer Ctx }
? NonNullable<Ctx>
: never
: any,
T extends (props: any, ctx: infer Ctx) => any ? Ctx : any
>;
type __VLS_FunctionalComponentProps<T, K> =
'__ctx' extends keyof __VLS_PickNotAny<K, {}>
? K extends { __ctx?: { props?: infer P } }
? NonNullable<P>
: never
: T extends (props: infer P, ...args: any) => any
? P
: {};
type __VLS_FunctionalComponent<T> = (
props: Record<string, unknown> &
(T extends { $props: infer Props } ? Props : {}),
ctx?: any,
) => globalThis.JSX.Element & {
__ctx?: {
attrs?: any;
emit?: T extends { $emit: infer Emit } ? Emit : {};
expose?: (exposed: T) => void;
props?: Record<string, unknown> &
(T extends { $props: infer Props } ? Props : {});
slots?: T extends { $slots: infer Slots } ? Slots : Record<string, any>;
};
};
type __VLS_IsFunction<T, K> = K extends keyof T
? __VLS_IsAny<T[K]> extends false
? unknown extends T[K]
? false
: true
: false
: false;
type __VLS_NormalizeComponentEvent<
Props,
Emits,
onEvent extends keyof Props,
Event extends keyof Emits,
CamelizedEvent extends keyof Emits,
> =
__VLS_IsFunction<Props, onEvent> extends true
? Props
: __VLS_IsFunction<Emits, Event> extends true
? { [K in onEvent]?: Emits[Event] }
: __VLS_IsFunction<Emits, CamelizedEvent> extends true
? { [K in onEvent]?: Emits[CamelizedEvent] }
: Props;
// fix https://github.com/vuejs/language-tools/issues/926
type __VLS_UnionToIntersection<U> = (
U extends unknown ? (arg: U) => unknown : never
) extends (arg: infer P) => unknown
? P
: never;
type __VLS_OverloadUnionInner<T, U = unknown> = T & U extends (
...args: infer A
) => infer R
? U extends T
? never
:
| ((...args: A) => R)
| __VLS_OverloadUnionInner<
T,
((...args: A) => R) & Pick<T, keyof T> & U
>
: never;
type __VLS_OverloadUnion<T> = Exclude<
__VLS_OverloadUnionInner<(() => never) & T>,
T extends () => never ? never : () => never
>;
type __VLS_ConstructorOverloads<T> =
__VLS_OverloadUnion<T> extends infer F
? F extends (event: infer E, ...args: infer A) => any
? { [K in E & string]: (...args: A) => void }
: never
: never;
type __VLS_NormalizeEmits<T> = __VLS_PrettifyGlobal<
__VLS_UnionToIntersection<
__VLS_ConstructorOverloads<T> & {
[K in keyof T]: T[K] extends any[] ? { (...args: T[K]): void } : never;
}
>
>;
type __VLS_EmitsToProps<T> = __VLS_PrettifyGlobal<{
[K in keyof T & string as `on${Capitalize<K>}`]?: (
...args: T[K] extends (...args: infer P) => any
? P
: T[K] extends null
? any[]
: never
) => any;
}>;
type __VLS_ResolveEmits<
Comp,
Emits,
TypeEmits = {},
NormalizedEmits = __VLS_NormalizeEmits<Emits> extends infer E
? string extends keyof E
? {}
: E
: never,
> = __VLS_SpreadMerge<NormalizedEmits, TypeEmits>;
type __VLS_ResolveDirectives<T> = {
[K in keyof T & string as `v${Capitalize<K>}`]: T[K];
};
type __VLS_PrettifyGlobal<T> = { [K in keyof T as K]: T[K] } & {};
type __VLS_WithDefaultsGlobal<P, D> = {
[K in keyof P as K extends keyof D ? K : never]-?: P[K];
} & {
[K in keyof P as K extends keyof D ? never : K]: P[K];
};
type __VLS_UseTemplateRef<T> = Readonly<import('vue').ShallowRef<null | T>>;
type __VLS_ProxyRefs<T> = import('vue').ShallowUnwrapRef<T>;
function __VLS_getVForSourceType<
T extends any[] | Iterable<any> | number | string,
>(
source: T,
): [
item: T extends number
? number
: T extends string
? string
: T extends any[]
? T[number]
: T extends Iterable<infer T1>
? T1
: any,
index: number,
][];
function __VLS_getVForSourceType<T>(
source: T,
): [item: T[keyof T], key: keyof T, index: number][];
function __VLS_getSlotParameters<S, D extends S>(
slot: S,
decl?: D,
): D extends (...args: infer P) => any ? P : any[];
function __VLS_asFunctionalDirective<T>(
dir: T,
): T extends import('vue').ObjectDirective
? NonNullable<
T[
| 'beforeMount'
| 'beforeUnmount'
| 'beforeUpdate'
| 'created'
| 'mounted'
| 'unmounted'
| 'updated']
>
: T extends (...args: any) => any
? T
: (arg1: unknown, arg2: unknown, arg3: unknown, arg4: unknown) => void;
function __VLS_asFunctionalComponent<
T,
K = T extends new (...args: any) => any ? InstanceType<T> : unknown,
>(
t: T,
instance?: K,
): T extends new (...args: any) => any
? __VLS_FunctionalComponent<K>
: T extends () => any
? (props: {}, ctx?: any) => ReturnType<T>
: T extends (...args: any) => any
? T
: __VLS_FunctionalComponent<{}>;
function __VLS_functionalComponentArgsRest<T extends (...args: any) => any>(
t: T,
): 2 extends Parameters<T>['length'] ? [any] : [];
function __VLS_asFunctionalElement<T>(
tag: T,
endTag?: T,
): (attrs: Record<string, unknown> & T) => void;
function __VLS_asFunctionalSlot<S>(
slot: S,
): S extends () => infer R ? (props: {}) => R : NonNullable<S>;
function __VLS_tryAsConstant<const T>(t: T): T;
}