@vue/compat 3.6.0-beta.4 → 3.6.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue-compat.d.ts +2023 -4
- package/dist/vue.cjs.js +15372 -21003
- package/dist/vue.cjs.prod.js +13517 -18314
- package/dist/vue.esm-browser.js +14274 -19989
- package/dist/vue.esm-browser.prod.js +10 -12
- package/dist/vue.esm-bundler.js +14543 -20166
- package/dist/vue.global.js +15891 -21507
- package/dist/vue.global.prod.js +10 -12
- package/dist/vue.runtime.esm-browser.js +14274 -19989
- package/dist/vue.runtime.esm-browser.prod.js +10 -12
- package/dist/vue.runtime.esm-bundler.js +14543 -20166
- package/dist/vue.runtime.global.js +15891 -21507
- package/dist/vue.runtime.global.prod.js +10 -12
- package/package.json +3 -3
package/dist/vue-compat.d.ts
CHANGED
|
@@ -1,5 +1,2024 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region packages/shared/src/slotFlags.d.ts
|
|
2
|
+
declare enum SlotFlags {
|
|
3
|
+
/**
|
|
4
|
+
* Stable slots that only reference slot props or context state. The slot
|
|
5
|
+
* can fully capture its own dependencies so when passed down the parent won't
|
|
6
|
+
* need to force the child to update.
|
|
7
|
+
*/
|
|
8
|
+
STABLE = 1,
|
|
9
|
+
/**
|
|
10
|
+
* Slots that reference scope variables (v-for or an outer slot prop), or
|
|
11
|
+
* has conditional structure (v-if, v-for). The parent will need to force
|
|
12
|
+
* the child to update because the slot does not fully capture its dependencies.
|
|
13
|
+
*/
|
|
14
|
+
DYNAMIC = 2,
|
|
15
|
+
/**
|
|
16
|
+
* `<slot/>` being forwarded into a child component. Whether the parent needs
|
|
17
|
+
* to update the child is dependent on what kind of slots the parent itself
|
|
18
|
+
* received. This has to be refined at runtime, when the child's vnode
|
|
19
|
+
* is being created (in `normalizeChildren`)
|
|
20
|
+
*/
|
|
21
|
+
FORWARDED = 3
|
|
22
|
+
}
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region packages/shared/src/typeUtils.d.ts
|
|
25
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
26
|
+
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
27
|
+
type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P] };
|
|
28
|
+
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region packages/reactivity/src/constants.d.ts
|
|
31
|
+
declare enum TrackOpTypes {
|
|
32
|
+
GET = "get",
|
|
33
|
+
HAS = "has",
|
|
34
|
+
ITERATE = "iterate"
|
|
35
|
+
}
|
|
36
|
+
declare enum TriggerOpTypes {
|
|
37
|
+
SET = "set",
|
|
38
|
+
ADD = "add",
|
|
39
|
+
DELETE = "delete",
|
|
40
|
+
CLEAR = "clear"
|
|
41
|
+
}
|
|
42
|
+
declare enum ReactiveFlags$1 {
|
|
43
|
+
SKIP = "__v_skip",
|
|
44
|
+
IS_REACTIVE = "__v_isReactive",
|
|
45
|
+
IS_READONLY = "__v_isReadonly",
|
|
46
|
+
IS_SHALLOW = "__v_isShallow",
|
|
47
|
+
RAW = "__v_raw",
|
|
48
|
+
IS_REF = "__v_isRef"
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region packages/reactivity/src/effectScope.d.ts
|
|
52
|
+
declare class EffectScope implements ReactiveNode {
|
|
53
|
+
deps: Link | undefined;
|
|
54
|
+
depsTail: Link | undefined;
|
|
55
|
+
subs: Link | undefined;
|
|
56
|
+
subsTail: Link | undefined;
|
|
57
|
+
flags: number;
|
|
58
|
+
/**
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
cleanups: (() => void)[];
|
|
62
|
+
/**
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
cleanupsLength: number;
|
|
66
|
+
constructor(detached?: boolean);
|
|
67
|
+
get active(): boolean;
|
|
68
|
+
pause(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Resumes the effect scope, including all child scopes and effects.
|
|
71
|
+
*/
|
|
72
|
+
resume(): void;
|
|
73
|
+
run<T>(fn: () => T): T | undefined;
|
|
74
|
+
stop(): void;
|
|
75
|
+
/**
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
reset(): void;
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region packages/reactivity/src/system.d.ts
|
|
82
|
+
interface ReactiveNode {
|
|
83
|
+
deps?: Link;
|
|
84
|
+
depsTail?: Link;
|
|
85
|
+
subs?: Link;
|
|
86
|
+
subsTail?: Link;
|
|
87
|
+
flags: ReactiveFlags;
|
|
88
|
+
}
|
|
89
|
+
interface Link {
|
|
90
|
+
version: number;
|
|
91
|
+
dep: ReactiveNode | ComputedRefImpl | ReactiveEffect | EffectScope;
|
|
92
|
+
sub: ReactiveNode | ComputedRefImpl | ReactiveEffect | EffectScope;
|
|
93
|
+
prevSub: Link | undefined;
|
|
94
|
+
nextSub: Link | undefined;
|
|
95
|
+
prevDep: Link | undefined;
|
|
96
|
+
nextDep: Link | undefined;
|
|
97
|
+
}
|
|
98
|
+
declare const enum ReactiveFlags {
|
|
99
|
+
None = 0,
|
|
100
|
+
Mutable = 1,
|
|
101
|
+
Watching = 2,
|
|
102
|
+
RecursedCheck = 4,
|
|
103
|
+
Recursed = 8,
|
|
104
|
+
Dirty = 16,
|
|
105
|
+
Pending = 32
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region packages/reactivity/src/effect.d.ts
|
|
109
|
+
type EffectScheduler = (...args: any[]) => any;
|
|
110
|
+
type DebuggerEvent = {
|
|
111
|
+
effect: ReactiveNode;
|
|
112
|
+
} & DebuggerEventExtraInfo;
|
|
113
|
+
type DebuggerEventExtraInfo = {
|
|
114
|
+
target: object;
|
|
115
|
+
type: TrackOpTypes | TriggerOpTypes;
|
|
116
|
+
key: any;
|
|
117
|
+
newValue?: any;
|
|
118
|
+
oldValue?: any;
|
|
119
|
+
oldTarget?: Map<any, any> | Set<any>;
|
|
120
|
+
};
|
|
121
|
+
interface DebuggerOptions {
|
|
122
|
+
onTrack?: (event: DebuggerEvent) => void;
|
|
123
|
+
onTrigger?: (event: DebuggerEvent) => void;
|
|
124
|
+
}
|
|
125
|
+
interface ReactiveEffectOptions extends DebuggerOptions {
|
|
126
|
+
scheduler?: EffectScheduler;
|
|
127
|
+
onStop?: () => void;
|
|
128
|
+
}
|
|
129
|
+
declare class ReactiveEffect<T = any> implements ReactiveEffectOptions, ReactiveNode {
|
|
130
|
+
deps: Link | undefined;
|
|
131
|
+
depsTail: Link | undefined;
|
|
132
|
+
subs: Link | undefined;
|
|
133
|
+
subsTail: Link | undefined;
|
|
134
|
+
flags: number;
|
|
135
|
+
/**
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
|
+
cleanups: (() => void)[];
|
|
139
|
+
/**
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
cleanupsLength: number;
|
|
143
|
+
onTrack?: (event: DebuggerEvent) => void;
|
|
144
|
+
onTrigger?: (event: DebuggerEvent) => void;
|
|
145
|
+
fn(): T;
|
|
146
|
+
constructor(fn?: () => T);
|
|
147
|
+
get active(): boolean;
|
|
148
|
+
pause(): void;
|
|
149
|
+
resume(): void;
|
|
150
|
+
notify(): void;
|
|
151
|
+
run(): T;
|
|
152
|
+
stop(): void;
|
|
153
|
+
get dirty(): boolean;
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region packages/reactivity/src/computed.d.ts
|
|
157
|
+
type ComputedGetter<T> = (oldValue?: T) => T;
|
|
158
|
+
type ComputedSetter<T> = (newValue: T) => void;
|
|
159
|
+
interface WritableComputedOptions<T, S = T> {
|
|
160
|
+
get: ComputedGetter<T>;
|
|
161
|
+
set: ComputedSetter<S>;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
165
|
+
* the main vue package
|
|
166
|
+
*/
|
|
167
|
+
declare class ComputedRefImpl<T = any> implements ReactiveNode {
|
|
168
|
+
fn: ComputedGetter<T>;
|
|
169
|
+
private readonly setter;
|
|
170
|
+
/**
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
|
+
_value: T | undefined;
|
|
174
|
+
subs: Link | undefined;
|
|
175
|
+
subsTail: Link | undefined;
|
|
176
|
+
deps: Link | undefined;
|
|
177
|
+
depsTail: Link | undefined;
|
|
178
|
+
flags: ReactiveFlags;
|
|
179
|
+
/**
|
|
180
|
+
* @internal
|
|
181
|
+
*/
|
|
182
|
+
readonly __v_isRef: true;
|
|
183
|
+
/**
|
|
184
|
+
* @internal
|
|
185
|
+
*/
|
|
186
|
+
readonly __v_isReadonly: boolean;
|
|
187
|
+
get effect(): this;
|
|
188
|
+
get dep(): ReactiveNode;
|
|
189
|
+
/**
|
|
190
|
+
* @internal
|
|
191
|
+
* for backwards compat
|
|
192
|
+
*/
|
|
193
|
+
get _dirty(): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* @internal
|
|
196
|
+
* for backwards compat
|
|
197
|
+
*/
|
|
198
|
+
set _dirty(v: boolean);
|
|
199
|
+
onTrack?: (event: DebuggerEvent) => void;
|
|
200
|
+
onTrigger?: (event: DebuggerEvent) => void;
|
|
201
|
+
constructor(fn: ComputedGetter<T>, setter: ComputedSetter<T> | undefined);
|
|
202
|
+
get value(): T;
|
|
203
|
+
set value(newValue: T);
|
|
204
|
+
update(): boolean;
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region packages/reactivity/src/reactive.d.ts
|
|
208
|
+
type UnwrapNestedRefs<T> = T extends Ref ? T : UnwrapRefSimple<T>;
|
|
209
|
+
declare const ReactiveMarkerSymbol: unique symbol;
|
|
210
|
+
interface ReactiveMarker {
|
|
211
|
+
[ReactiveMarkerSymbol]?: void;
|
|
212
|
+
}
|
|
213
|
+
type Reactive<T> = UnwrapNestedRefs<T> & (T extends readonly any[] ? ReactiveMarker : {});
|
|
214
|
+
/**
|
|
215
|
+
* Returns a reactive proxy of the object.
|
|
216
|
+
*
|
|
217
|
+
* The reactive conversion is "deep": it affects all nested properties. A
|
|
218
|
+
* reactive object also deeply unwraps any properties that are refs while
|
|
219
|
+
* maintaining reactivity.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```js
|
|
223
|
+
* const obj = reactive({ count: 0 })
|
|
224
|
+
* ```
|
|
225
|
+
*
|
|
226
|
+
* @param target - The source object.
|
|
227
|
+
* @see {@link https://vuejs.org/api/reactivity-core.html#reactive}
|
|
228
|
+
*/
|
|
229
|
+
declare function reactive<T extends object>(target: T): Reactive<T>;
|
|
230
|
+
declare const ShallowReactiveMarker: unique symbol;
|
|
231
|
+
type Primitive = string | number | boolean | bigint | symbol | undefined | null;
|
|
232
|
+
type Builtin = Primitive | Function | Date | Error | RegExp;
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region packages/reactivity/src/ref.d.ts
|
|
235
|
+
declare const RefSymbol: unique symbol;
|
|
236
|
+
declare const RawSymbol: unique symbol;
|
|
237
|
+
interface Ref<T = any, S = T> {
|
|
238
|
+
get value(): T;
|
|
239
|
+
set value(_: S);
|
|
240
|
+
/**
|
|
241
|
+
* Type differentiator only.
|
|
242
|
+
* We need this to be in public d.ts but don't want it to show up in IDE
|
|
243
|
+
* autocomplete, so we use a private Symbol instead.
|
|
244
|
+
*/
|
|
245
|
+
[RefSymbol]: true;
|
|
246
|
+
}
|
|
247
|
+
declare const ShallowRefMarker: unique symbol;
|
|
248
|
+
type ShallowRef<T = any, S = T> = Ref<T, S> & {
|
|
249
|
+
[ShallowRefMarker]?: true;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* This is a special exported interface for other packages to declare
|
|
253
|
+
* additional types that should bail out for ref unwrapping. For example
|
|
254
|
+
* \@vue/runtime-dom can declare it like so in its d.ts:
|
|
255
|
+
*
|
|
256
|
+
* ``` ts
|
|
257
|
+
* declare module '@vue/reactivity' {
|
|
258
|
+
* export interface RefUnwrapBailTypes {
|
|
259
|
+
* runtimeDOMBailTypes: Node | Window
|
|
260
|
+
* }
|
|
261
|
+
* }
|
|
262
|
+
* ```
|
|
263
|
+
*/
|
|
264
|
+
interface RefUnwrapBailTypes {}
|
|
265
|
+
type ShallowUnwrapRef<T> = { [K in keyof T]: DistributeRef<T[K]> };
|
|
266
|
+
type DistributeRef<T> = T extends Ref<infer V, unknown> ? V : T;
|
|
267
|
+
type UnwrapRef<T> = T extends ShallowRef<infer V, unknown> ? V : T extends Ref<infer V, unknown> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
|
|
268
|
+
type UnwrapRefSimple<T> = T extends Builtin | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] | {
|
|
269
|
+
[RawSymbol]?: true;
|
|
270
|
+
} ? T : T extends Map<infer K, infer V> ? Map<K, UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof Map<any, any>>> : T extends WeakMap<infer K, infer V> ? WeakMap<K, UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof WeakMap<any, any>>> : T extends Set<infer V> ? Set<UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof Set<any>>> : T extends WeakSet<infer V> ? WeakSet<UnwrapRefSimple<V>> & UnwrapRef<Omit<T, keyof WeakSet<any>>> : T extends ReadonlyArray<any> ? { [K in keyof T]: UnwrapRefSimple<T[K]> } : T extends object & {
|
|
271
|
+
[ShallowReactiveMarker]?: never;
|
|
272
|
+
} ? { [P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]> } : T;
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region packages/reactivity/src/watch.d.ts
|
|
275
|
+
type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
|
|
276
|
+
type OnCleanup = (cleanupFn: () => void) => void;
|
|
277
|
+
type WatchStopHandle = () => void;
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region packages/runtime-core/src/componentSlots.d.ts
|
|
280
|
+
type Slot<T extends any = any> = (...args: IfAny<T, any[], [T] | (T extends undefined ? [] : never)>) => VNode[];
|
|
281
|
+
type InternalSlots = {
|
|
282
|
+
[name: string]: Slot | undefined;
|
|
283
|
+
};
|
|
284
|
+
type Slots = Readonly<InternalSlots>;
|
|
285
|
+
declare const SlotSymbol: unique symbol;
|
|
286
|
+
type SlotsType<T extends Record<string, any> = Record<string, any>> = {
|
|
287
|
+
[SlotSymbol]?: T;
|
|
288
|
+
};
|
|
289
|
+
type UnwrapSlotsType<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<Prettify<{ [K in keyof T]: NonNullable<T[K]> extends ((...args: any[]) => any) ? T[K] : Slot<T[K]> }>>;
|
|
290
|
+
type RawSlots = {
|
|
291
|
+
[name: string]: unknown;
|
|
292
|
+
$stable?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* for tracking slot owner instance. This is attached during
|
|
295
|
+
* normalizeChildren when the component vnode is created.
|
|
296
|
+
* @internal
|
|
297
|
+
*/
|
|
298
|
+
_ctx?: ComponentInternalInstance | null;
|
|
299
|
+
/**
|
|
300
|
+
* indicates compiler generated slots
|
|
301
|
+
* we use a reserved property instead of a vnode patchFlag because the slots
|
|
302
|
+
* object may be directly passed down to a child component in a manual
|
|
303
|
+
* render function, and the optimization hint need to be on the slot object
|
|
304
|
+
* itself to be preserved.
|
|
305
|
+
* @internal
|
|
306
|
+
*/
|
|
307
|
+
_?: SlotFlags;
|
|
308
|
+
};
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region packages/runtime-core/src/scheduler.d.ts
|
|
311
|
+
declare enum SchedulerJobFlags {
|
|
312
|
+
QUEUED = 1,
|
|
313
|
+
/**
|
|
314
|
+
* Indicates whether the effect is allowed to recursively trigger itself
|
|
315
|
+
* when managed by the scheduler.
|
|
316
|
+
*
|
|
317
|
+
* By default, a job cannot trigger itself because some built-in method calls,
|
|
318
|
+
* e.g. Array.prototype.push actually performs reads as well (#1740) which
|
|
319
|
+
* can lead to confusing infinite loops.
|
|
320
|
+
* The allowed cases are component update functions and watch callbacks.
|
|
321
|
+
* Component update functions may update child component props, which in turn
|
|
322
|
+
* trigger flush: "pre" watch callbacks that mutates state that the parent
|
|
323
|
+
* relies on (#1801). Watch callbacks doesn't track its dependencies so if it
|
|
324
|
+
* triggers itself again, it's likely intentional and it is the user's
|
|
325
|
+
* responsibility to perform recursive state mutation that eventually
|
|
326
|
+
* stabilizes (#1727).
|
|
327
|
+
*/
|
|
328
|
+
ALLOW_RECURSE = 2,
|
|
329
|
+
DISPOSED = 4
|
|
330
|
+
}
|
|
331
|
+
interface SchedulerJob extends Function {
|
|
332
|
+
order?: number;
|
|
333
|
+
/**
|
|
334
|
+
* flags can technically be undefined, but it can still be used in bitwise
|
|
335
|
+
* operations just like 0.
|
|
336
|
+
*/
|
|
337
|
+
flags?: SchedulerJobFlags;
|
|
338
|
+
/**
|
|
339
|
+
* Attached by renderer.ts when setting up a component's render effect
|
|
340
|
+
* Used to obtain component information when reporting max recursive updates.
|
|
341
|
+
*/
|
|
342
|
+
i?: GenericComponentInstance;
|
|
343
|
+
}
|
|
344
|
+
declare function nextTick(): Promise<void>;
|
|
345
|
+
declare function nextTick<T, R>(this: T, fn: (this: T) => R | Promise<R>): Promise<R>;
|
|
346
|
+
//#endregion
|
|
347
|
+
//#region packages/runtime-core/src/componentProps.d.ts
|
|
348
|
+
type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
|
349
|
+
type ComponentObjectPropsOptions<P = Data> = { [K in keyof P]: Prop<P[K]> | null };
|
|
350
|
+
type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
|
351
|
+
type DefaultFactory<T> = (props: Data) => T | null | undefined;
|
|
352
|
+
interface PropOptions<T = any, D = T> {
|
|
353
|
+
type?: PropType<T> | true | null;
|
|
354
|
+
required?: boolean;
|
|
355
|
+
default?: D | DefaultFactory<D> | null | undefined | object;
|
|
356
|
+
validator?(value: unknown, props: Data): boolean;
|
|
357
|
+
/**
|
|
358
|
+
* @internal
|
|
359
|
+
*/
|
|
360
|
+
skipCheck?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* @internal
|
|
363
|
+
*/
|
|
364
|
+
skipFactory?: boolean;
|
|
365
|
+
}
|
|
366
|
+
type PropType<T> = PropConstructor<T> | (PropConstructor<T> | null)[];
|
|
367
|
+
type PropConstructor<T = any> = {
|
|
368
|
+
new (...args: any[]): T & {};
|
|
369
|
+
} | {
|
|
370
|
+
(): T;
|
|
371
|
+
} | PropMethod<T>;
|
|
372
|
+
type PropMethod<T, TConstructor = any> = [T] extends [((...args: any) => any) | undefined] ? {
|
|
373
|
+
new (): TConstructor;
|
|
374
|
+
(): T;
|
|
375
|
+
readonly prototype: TConstructor;
|
|
376
|
+
} : never;
|
|
377
|
+
type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
|
|
378
|
+
required: true;
|
|
379
|
+
} | {
|
|
380
|
+
default: any;
|
|
381
|
+
} | BooleanConstructor | {
|
|
382
|
+
type: BooleanConstructor;
|
|
383
|
+
} ? T[K] extends {
|
|
384
|
+
default: undefined | (() => undefined);
|
|
385
|
+
} ? never : K : never }[keyof T];
|
|
386
|
+
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
387
|
+
type DefaultKeys<T> = { [K in keyof T]: T[K] extends {
|
|
388
|
+
default: any;
|
|
389
|
+
} | BooleanConstructor | {
|
|
390
|
+
type: BooleanConstructor;
|
|
391
|
+
} ? T[K] extends {
|
|
392
|
+
type: BooleanConstructor;
|
|
393
|
+
required: true;
|
|
394
|
+
} ? never : K : never }[keyof T];
|
|
395
|
+
type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends true ? any : null : [T] extends [{
|
|
396
|
+
type: null | true;
|
|
397
|
+
}] ? any : [T] extends [ObjectConstructor | {
|
|
398
|
+
type: ObjectConstructor;
|
|
399
|
+
}] ? Record<string, any> : [T] extends [BooleanConstructor | {
|
|
400
|
+
type: BooleanConstructor;
|
|
401
|
+
}] ? boolean : [T] extends [DateConstructor | {
|
|
402
|
+
type: DateConstructor;
|
|
403
|
+
}] ? Date : [T] extends [(infer U)[] | {
|
|
404
|
+
type: (infer U)[];
|
|
405
|
+
}] ? U extends DateConstructor ? Date | InferPropType<U, false> : InferPropType<U, false> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? keyof V extends never ? IfAny<V, V, D> : V : V : T;
|
|
406
|
+
/**
|
|
407
|
+
* Extract prop types from a runtime props options object.
|
|
408
|
+
* The extracted types are **internal** - i.e. the resolved props received by
|
|
409
|
+
* the component.
|
|
410
|
+
* - Boolean props are always present
|
|
411
|
+
* - Props with default values are always present
|
|
412
|
+
*
|
|
413
|
+
* To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
|
|
414
|
+
*/
|
|
415
|
+
type ExtractPropTypes<O> = { [K in keyof Pick<O, RequiredKeys<O>>]: O[K] extends {
|
|
416
|
+
default: any;
|
|
417
|
+
} ? Exclude<InferPropType<O[K]>, undefined> : InferPropType<O[K]> } & { [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]> };
|
|
418
|
+
declare enum BooleanFlags {
|
|
419
|
+
shouldCast = 0,
|
|
420
|
+
shouldCastTrue = 1
|
|
421
|
+
}
|
|
422
|
+
type ExtractDefaultPropTypes<O> = O extends object ? { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]> } : {};
|
|
423
|
+
type NormalizedProp = PropOptions & {
|
|
424
|
+
[BooleanFlags.shouldCast]?: boolean;
|
|
425
|
+
[BooleanFlags.shouldCastTrue]?: boolean;
|
|
426
|
+
};
|
|
427
|
+
/**
|
|
428
|
+
* normalized value is a tuple of the actual normalized options
|
|
429
|
+
* and an array of prop keys that need value casting (booleans and defaults)
|
|
430
|
+
*/
|
|
431
|
+
type NormalizedProps = Record<string, NormalizedProp>;
|
|
432
|
+
type NormalizedPropsOptions = [NormalizedProps, string[]] | [];
|
|
433
|
+
//#endregion
|
|
434
|
+
//#region packages/runtime-core/src/apiSetupHelpers.d.ts
|
|
435
|
+
type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
|
|
436
|
+
//#endregion
|
|
437
|
+
//#region packages/runtime-core/src/componentEmits.d.ts
|
|
438
|
+
type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
|
439
|
+
type EmitsOptions = ObjectEmitsOptions | string[];
|
|
440
|
+
type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> = T extends string[] ? { [K in `on${Capitalize<T[number]>}`]?: (...args: any[]) => any } : T extends ObjectEmitsOptions ? { [K in string & keyof T as `on${Capitalize<K>}`]?: (...args: T[K] extends ((...args: infer P) => any) ? P : T[K] extends null ? any[] : never) => any } : {};
|
|
441
|
+
type ShortEmitsToObject<E> = E extends Record<string, any[]> ? { [K in keyof E]: (...args: E[K]) => any } : E;
|
|
442
|
+
type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = keyof Options> = Options extends Array<infer V> ? (event: V, ...args: any[]) => void : {} extends Options ? (event: string, ...args: any[]) => void : UnionToIntersection<{ [key in Event]: Options[key] extends ((...args: infer Args) => any) ? (event: key, ...args: Args) => void : Options[key] extends any[] ? (event: key, ...args: Options[key]) => void : (event: key, ...args: any[]) => void }[Event]>;
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region packages/runtime-core/src/directives.d.ts
|
|
445
|
+
interface DirectiveBinding<Value = any, Modifiers extends string = string, Arg = any> {
|
|
446
|
+
instance: ComponentPublicInstance | Record<string, any> | null;
|
|
447
|
+
value: Value;
|
|
448
|
+
oldValue: Value | null;
|
|
449
|
+
arg?: Arg;
|
|
450
|
+
modifiers: DirectiveModifiers<Modifiers>;
|
|
451
|
+
dir: ObjectDirective<any, Value, Modifiers, Arg>;
|
|
452
|
+
}
|
|
453
|
+
type DirectiveHook<HostElement = any, Prev = VNode<any, HostElement> | null, Value = any, Modifiers extends string = string, Arg = any> = (el: HostElement, binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode<any, HostElement>, prevVNode: Prev) => void;
|
|
454
|
+
type SSRDirectiveHook<Value = any, Modifiers extends string = string, Arg = any> = (binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode) => Data | undefined;
|
|
455
|
+
interface ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> {
|
|
456
|
+
/**
|
|
457
|
+
* @internal without this, ts-expect-error in directives.test-d.ts somehow
|
|
458
|
+
* fails when running tsc, but passes in IDE and when testing against built
|
|
459
|
+
* dts. Could be a TS bug.
|
|
460
|
+
*/
|
|
461
|
+
__mod?: Modifiers;
|
|
462
|
+
created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
463
|
+
beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
464
|
+
mounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
465
|
+
beforeUpdate?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
|
|
466
|
+
updated?: DirectiveHook<HostElement, VNode<any, HostElement>, Value, Modifiers, Arg>;
|
|
467
|
+
beforeUnmount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
468
|
+
unmounted?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
469
|
+
getSSRProps?: SSRDirectiveHook<Value, Modifiers, Arg>;
|
|
470
|
+
deep?: boolean;
|
|
471
|
+
}
|
|
472
|
+
type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg = any> = DirectiveHook<HostElement, any, V, Modifiers, Arg>;
|
|
473
|
+
type Directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> = ObjectDirective<HostElement, Value, Modifiers, Arg> | FunctionDirective<HostElement, Value, Modifiers, Arg>;
|
|
474
|
+
type DirectiveModifiers<K extends string = string> = Partial<Record<K, boolean>>;
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region packages/runtime-core/src/componentPublicInstance.d.ts
|
|
477
|
+
/**
|
|
478
|
+
* Custom properties added to component instances in any way and can be accessed through `this`
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* Here is an example of adding a property `$router` to every component instance:
|
|
482
|
+
* ```ts
|
|
483
|
+
* import { createApp } from 'vue'
|
|
484
|
+
* import { Router, createRouter } from 'vue-router'
|
|
485
|
+
*
|
|
486
|
+
* declare module 'vue' {
|
|
487
|
+
* interface ComponentCustomProperties {
|
|
488
|
+
* $router: Router
|
|
489
|
+
* }
|
|
490
|
+
* }
|
|
491
|
+
*
|
|
492
|
+
* // effectively adding the router to every component instance
|
|
493
|
+
* const app = createApp({})
|
|
494
|
+
* const router = createRouter()
|
|
495
|
+
* app.config.globalProperties.$router = router
|
|
496
|
+
*
|
|
497
|
+
* const vm = app.mount('#app')
|
|
498
|
+
* // we can access the router from the instance
|
|
499
|
+
* vm.$router.push('/')
|
|
500
|
+
* ```
|
|
501
|
+
*/
|
|
502
|
+
interface ComponentCustomProperties {}
|
|
503
|
+
type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
|
|
504
|
+
type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any, any, infer Defaults, any, any, any, any, any, any, any> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never;
|
|
505
|
+
type ExtractMixin<T> = {
|
|
506
|
+
Mixin: MixinToOptionTypes<T>;
|
|
507
|
+
}[T extends ComponentOptionsMixin ? "Mixin" : never];
|
|
508
|
+
type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType : UnionToIntersection<ExtractMixin<T>>;
|
|
509
|
+
type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
|
|
510
|
+
type EnsureNonVoid<T> = T extends void ? {} : T;
|
|
511
|
+
type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
|
|
512
|
+
__isFragment?: never;
|
|
513
|
+
__isTeleport?: never;
|
|
514
|
+
__isSuspense?: never;
|
|
515
|
+
new (...args: any[]): T;
|
|
516
|
+
};
|
|
517
|
+
/**
|
|
518
|
+
* This is the same as `CreateComponentPublicInstance` but adds local components,
|
|
519
|
+
* global directives, exposed, and provide inference.
|
|
520
|
+
* It changes the arguments order so that we don't need to repeat mixin
|
|
521
|
+
* inference everywhere internally, but it has to be a new type to avoid
|
|
522
|
+
* breaking types that relies on previous arguments order (#10842)
|
|
523
|
+
*/
|
|
524
|
+
type CreateComponentPublicInstanceWithMixins<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, TypeRefs extends Data = {}, TypeEl extends Element = any, Provide extends ComponentProvideOptions = ComponentProvideOptions, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, "P"> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, "B"> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, "D"> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, "C"> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, "M"> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, "Defaults"> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S, LC, Directives, Exposed, Provide>, I, S, Exposed, TypeRefs, TypeEl>;
|
|
525
|
+
type ExposedKeys<T, Exposed extends string & keyof T> = "" extends Exposed ? T : Pick<T, Exposed>;
|
|
526
|
+
type ComponentPublicInstance<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = {}, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, Exposed extends string = "", TypeRefs extends Data = {}, TypeEl extends Element = any> = {
|
|
527
|
+
$: ComponentInternalInstance;
|
|
528
|
+
$data: D;
|
|
529
|
+
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
|
530
|
+
$attrs: Data;
|
|
531
|
+
$refs: Data & TypeRefs;
|
|
532
|
+
$slots: UnwrapSlotsType<S>;
|
|
533
|
+
$root: ComponentPublicInstance | null;
|
|
534
|
+
$parent: ComponentPublicInstance | null;
|
|
535
|
+
$host: Element | null;
|
|
536
|
+
$emit: EmitFn<E>;
|
|
537
|
+
$el: TypeEl;
|
|
538
|
+
$options: Options & MergedComponentOptionsOverride;
|
|
539
|
+
$forceUpdate: () => void;
|
|
540
|
+
$nextTick: typeof nextTick;
|
|
541
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends ((...args: any) => infer R) ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
|
|
542
|
+
} & ExposedKeys<IfAny<P, P, Readonly<Defaults> & Omit<P, keyof ShallowUnwrapRef<B> | keyof Defaults>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>, Exposed>;
|
|
543
|
+
//#endregion
|
|
544
|
+
//#region packages/runtime-core/src/enums.d.ts
|
|
545
|
+
declare enum LifecycleHooks {
|
|
546
|
+
BEFORE_CREATE = "bc",
|
|
547
|
+
CREATED = "c",
|
|
548
|
+
BEFORE_MOUNT = "bm",
|
|
549
|
+
MOUNTED = "m",
|
|
550
|
+
BEFORE_UPDATE = "bu",
|
|
551
|
+
UPDATED = "u",
|
|
552
|
+
BEFORE_UNMOUNT = "bum",
|
|
553
|
+
UNMOUNTED = "um",
|
|
554
|
+
DEACTIVATED = "da",
|
|
555
|
+
ACTIVATED = "a",
|
|
556
|
+
RENDER_TRIGGERED = "rtg",
|
|
557
|
+
RENDER_TRACKED = "rtc",
|
|
558
|
+
ERROR_CAPTURED = "ec",
|
|
559
|
+
SERVER_PREFETCH = "sp"
|
|
560
|
+
}
|
|
561
|
+
//#endregion
|
|
562
|
+
//#region packages/runtime-core/src/components/Suspense.d.ts
|
|
563
|
+
interface SuspenseProps {
|
|
564
|
+
onResolve?: () => void;
|
|
565
|
+
onPending?: () => void;
|
|
566
|
+
onFallback?: () => void;
|
|
567
|
+
timeout?: string | number;
|
|
568
|
+
/**
|
|
569
|
+
* Allow suspense to be captured by parent suspense
|
|
570
|
+
*
|
|
571
|
+
* @default false
|
|
572
|
+
*/
|
|
573
|
+
suspensible?: boolean;
|
|
574
|
+
}
|
|
575
|
+
declare const SuspenseImpl: {
|
|
576
|
+
name: string;
|
|
577
|
+
__isSuspense: boolean;
|
|
578
|
+
process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals): void;
|
|
579
|
+
hydrate: typeof hydrateSuspense;
|
|
580
|
+
normalize: typeof normalizeSuspenseChildren;
|
|
581
|
+
};
|
|
582
|
+
declare const Suspense: {
|
|
583
|
+
__isSuspense: true;
|
|
584
|
+
new (): {
|
|
585
|
+
$props: VNodeProps & SuspenseProps;
|
|
586
|
+
$slots: {
|
|
587
|
+
default(): VNode[];
|
|
588
|
+
fallback(): VNode[];
|
|
589
|
+
};
|
|
590
|
+
};
|
|
591
|
+
};
|
|
592
|
+
interface SuspenseBoundary {
|
|
593
|
+
vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
|
|
594
|
+
parent: SuspenseBoundary | null;
|
|
595
|
+
parentComponent: ComponentInternalInstance | null;
|
|
596
|
+
namespace: ElementNamespace;
|
|
597
|
+
container: RendererElement;
|
|
598
|
+
hiddenContainer: RendererElement;
|
|
599
|
+
activeBranch: VNode | null;
|
|
600
|
+
pendingBranch: VNode | null;
|
|
601
|
+
deps: number;
|
|
602
|
+
pendingId: number;
|
|
603
|
+
timeout: number;
|
|
604
|
+
isInFallback: boolean;
|
|
605
|
+
isHydrating: boolean;
|
|
606
|
+
isUnmounted: boolean;
|
|
607
|
+
effects: Function[];
|
|
608
|
+
resolve(force?: boolean, sync?: boolean): void;
|
|
609
|
+
fallback(fallbackVNode: VNode): void;
|
|
610
|
+
move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
|
|
611
|
+
next(): RendererNode | null;
|
|
612
|
+
registerDep(instance: GenericComponentInstance, onResolve: (setupResult: unknown) => void): void;
|
|
613
|
+
unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
|
|
614
|
+
}
|
|
615
|
+
declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
|
|
616
|
+
declare function normalizeSuspenseChildren(vnode: VNode): void;
|
|
617
|
+
//#endregion
|
|
618
|
+
//#region packages/runtime-core/src/components/BaseTransition.d.ts
|
|
619
|
+
type Hook<T = () => void> = T | T[];
|
|
620
|
+
interface BaseTransitionProps<HostElement = RendererElement> {
|
|
621
|
+
mode?: "in-out" | "out-in" | "default";
|
|
622
|
+
appear?: boolean;
|
|
623
|
+
persisted?: boolean;
|
|
624
|
+
onBeforeEnter?: Hook<(el: HostElement) => void>;
|
|
625
|
+
onEnter?: Hook<(el: HostElement, done: () => void) => void>;
|
|
626
|
+
onAfterEnter?: Hook<(el: HostElement) => void>;
|
|
627
|
+
onEnterCancelled?: Hook<(el: HostElement) => void>;
|
|
628
|
+
onBeforeLeave?: Hook<(el: HostElement) => void>;
|
|
629
|
+
onLeave?: Hook<(el: HostElement, done: () => void) => void>;
|
|
630
|
+
onAfterLeave?: Hook<(el: HostElement) => void>;
|
|
631
|
+
onLeaveCancelled?: Hook<(el: HostElement) => void>;
|
|
632
|
+
onBeforeAppear?: Hook<(el: HostElement) => void>;
|
|
633
|
+
onAppear?: Hook<(el: HostElement, done: () => void) => void>;
|
|
634
|
+
onAfterAppear?: Hook<(el: HostElement) => void>;
|
|
635
|
+
onAppearCancelled?: Hook<(el: HostElement) => void>;
|
|
636
|
+
}
|
|
637
|
+
interface TransitionHooks<HostElement = RendererElement> {
|
|
638
|
+
mode: BaseTransitionProps["mode"];
|
|
639
|
+
persisted: boolean;
|
|
640
|
+
beforeEnter(el: HostElement): void;
|
|
641
|
+
enter(el: HostElement): void;
|
|
642
|
+
leave(el: HostElement, remove: () => void): void;
|
|
643
|
+
clone(vnode: VNode): TransitionHooks<HostElement>;
|
|
644
|
+
afterLeave?(): void;
|
|
645
|
+
delayLeave?(el: HostElement, earlyRemove: () => void, delayedLeave: () => void): void;
|
|
646
|
+
delayedLeave?(): void;
|
|
647
|
+
}
|
|
648
|
+
//#endregion
|
|
649
|
+
//#region packages/runtime-core/src/renderer.d.ts
|
|
650
|
+
type ElementNamespace = "svg" | "mathml" | undefined;
|
|
651
|
+
interface RendererOptions<HostNode = RendererNode, HostElement = RendererElement> {
|
|
652
|
+
patchProp(el: HostElement, key: string, prevValue: any, nextValue: any, namespace?: ElementNamespace, parentComponent?: ComponentInternalInstance | null): void;
|
|
653
|
+
insert(el: HostNode, parent: HostElement, anchor?: HostNode | null): void;
|
|
654
|
+
remove(el: HostNode): void;
|
|
655
|
+
createElement(type: string, namespace?: ElementNamespace, isCustomizedBuiltIn?: string, vnodeProps?: (VNodeProps & {
|
|
656
|
+
[key: string]: any;
|
|
657
|
+
}) | null): HostElement;
|
|
658
|
+
createText(text: string): HostNode;
|
|
659
|
+
createComment(text: string): HostNode;
|
|
660
|
+
setText(node: HostNode, text: string): void;
|
|
661
|
+
setElementText(node: HostElement, text: string): void;
|
|
662
|
+
parentNode(node: HostNode): HostElement | null;
|
|
663
|
+
nextSibling(node: HostNode): HostNode | null;
|
|
664
|
+
querySelector?(selector: string): HostElement | null;
|
|
665
|
+
setScopeId?(el: HostElement, id: string): void;
|
|
666
|
+
cloneNode?(node: HostNode): HostNode;
|
|
667
|
+
insertStaticContent?(content: string, parent: HostElement, anchor: HostNode | null, namespace: ElementNamespace, start?: HostNode | null, end?: HostNode | null): [HostNode, HostNode];
|
|
668
|
+
}
|
|
669
|
+
interface RendererNode {
|
|
670
|
+
[key: string | symbol]: any;
|
|
671
|
+
}
|
|
672
|
+
interface RendererElement extends RendererNode {}
|
|
673
|
+
interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
|
|
674
|
+
p: PatchFn;
|
|
675
|
+
um: UnmountFn;
|
|
676
|
+
r: RemoveFn;
|
|
677
|
+
m: MoveFn;
|
|
678
|
+
mt: MountComponentFn;
|
|
679
|
+
umt: UnmountComponentFn;
|
|
680
|
+
mc: MountChildrenFn;
|
|
681
|
+
pc: PatchChildrenFn;
|
|
682
|
+
pbc: PatchBlockChildrenFn;
|
|
683
|
+
n: NextFn;
|
|
684
|
+
o: RendererOptions<HostNode, HostElement>;
|
|
685
|
+
}
|
|
686
|
+
type PatchFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, namespace?: ElementNamespace, slotScopeIds?: string[] | null, optimized?: boolean) => void;
|
|
687
|
+
type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, start?: number) => void;
|
|
688
|
+
type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean) => void;
|
|
689
|
+
type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null) => void;
|
|
690
|
+
type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentComponent: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null) => void;
|
|
691
|
+
type NextFn = (vnode: VNode) => RendererNode | null;
|
|
692
|
+
type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
|
|
693
|
+
type RemoveFn = (vnode: VNode) => void;
|
|
694
|
+
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, optimized: boolean) => void;
|
|
695
|
+
type UnmountComponentFn = (instance: ComponentInternalInstance, parentSuspense: SuspenseBoundary | null, doRemove?: boolean) => void;
|
|
696
|
+
declare enum MoveType {
|
|
697
|
+
ENTER = 0,
|
|
698
|
+
LEAVE = 1,
|
|
699
|
+
REORDER = 2
|
|
700
|
+
}
|
|
701
|
+
//#endregion
|
|
702
|
+
//#region packages/runtime-core/src/components/KeepAlive.d.ts
|
|
703
|
+
type MatchPattern = string | RegExp | (string | RegExp)[];
|
|
704
|
+
interface KeepAliveProps {
|
|
705
|
+
include?: MatchPattern;
|
|
706
|
+
exclude?: MatchPattern;
|
|
707
|
+
max?: number | string;
|
|
708
|
+
}
|
|
709
|
+
//#endregion
|
|
710
|
+
//#region packages/runtime-core/src/apiLifecycle.d.ts
|
|
711
|
+
type DebuggerHook = (e: DebuggerEvent) => void;
|
|
712
|
+
type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
713
|
+
//#endregion
|
|
714
|
+
//#region packages/runtime-core/src/compat/compatConfig.d.ts
|
|
715
|
+
declare enum DeprecationTypes {
|
|
716
|
+
GLOBAL_MOUNT = "GLOBAL_MOUNT",
|
|
717
|
+
GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
|
|
718
|
+
GLOBAL_EXTEND = "GLOBAL_EXTEND",
|
|
719
|
+
GLOBAL_PROTOTYPE = "GLOBAL_PROTOTYPE",
|
|
720
|
+
GLOBAL_SET = "GLOBAL_SET",
|
|
721
|
+
GLOBAL_DELETE = "GLOBAL_DELETE",
|
|
722
|
+
GLOBAL_OBSERVABLE = "GLOBAL_OBSERVABLE",
|
|
723
|
+
GLOBAL_PRIVATE_UTIL = "GLOBAL_PRIVATE_UTIL",
|
|
724
|
+
CONFIG_SILENT = "CONFIG_SILENT",
|
|
725
|
+
CONFIG_DEVTOOLS = "CONFIG_DEVTOOLS",
|
|
726
|
+
CONFIG_KEY_CODES = "CONFIG_KEY_CODES",
|
|
727
|
+
CONFIG_PRODUCTION_TIP = "CONFIG_PRODUCTION_TIP",
|
|
728
|
+
CONFIG_IGNORED_ELEMENTS = "CONFIG_IGNORED_ELEMENTS",
|
|
729
|
+
CONFIG_WHITESPACE = "CONFIG_WHITESPACE",
|
|
730
|
+
CONFIG_OPTION_MERGE_STRATS = "CONFIG_OPTION_MERGE_STRATS",
|
|
731
|
+
INSTANCE_SET = "INSTANCE_SET",
|
|
732
|
+
INSTANCE_DELETE = "INSTANCE_DELETE",
|
|
733
|
+
INSTANCE_DESTROY = "INSTANCE_DESTROY",
|
|
734
|
+
INSTANCE_EVENT_EMITTER = "INSTANCE_EVENT_EMITTER",
|
|
735
|
+
INSTANCE_EVENT_HOOKS = "INSTANCE_EVENT_HOOKS",
|
|
736
|
+
INSTANCE_CHILDREN = "INSTANCE_CHILDREN",
|
|
737
|
+
INSTANCE_LISTENERS = "INSTANCE_LISTENERS",
|
|
738
|
+
INSTANCE_SCOPED_SLOTS = "INSTANCE_SCOPED_SLOTS",
|
|
739
|
+
INSTANCE_ATTRS_CLASS_STYLE = "INSTANCE_ATTRS_CLASS_STYLE",
|
|
740
|
+
OPTIONS_DATA_FN = "OPTIONS_DATA_FN",
|
|
741
|
+
OPTIONS_DATA_MERGE = "OPTIONS_DATA_MERGE",
|
|
742
|
+
OPTIONS_BEFORE_DESTROY = "OPTIONS_BEFORE_DESTROY",
|
|
743
|
+
OPTIONS_DESTROYED = "OPTIONS_DESTROYED",
|
|
744
|
+
WATCH_ARRAY = "WATCH_ARRAY",
|
|
745
|
+
PROPS_DEFAULT_THIS = "PROPS_DEFAULT_THIS",
|
|
746
|
+
V_ON_KEYCODE_MODIFIER = "V_ON_KEYCODE_MODIFIER",
|
|
747
|
+
CUSTOM_DIR = "CUSTOM_DIR",
|
|
748
|
+
ATTR_FALSE_VALUE = "ATTR_FALSE_VALUE",
|
|
749
|
+
ATTR_ENUMERATED_COERCION = "ATTR_ENUMERATED_COERCION",
|
|
750
|
+
TRANSITION_CLASSES = "TRANSITION_CLASSES",
|
|
751
|
+
TRANSITION_GROUP_ROOT = "TRANSITION_GROUP_ROOT",
|
|
752
|
+
COMPONENT_ASYNC = "COMPONENT_ASYNC",
|
|
753
|
+
COMPONENT_FUNCTIONAL = "COMPONENT_FUNCTIONAL",
|
|
754
|
+
COMPONENT_V_MODEL = "COMPONENT_V_MODEL",
|
|
755
|
+
RENDER_FUNCTION = "RENDER_FUNCTION",
|
|
756
|
+
FILTERS = "FILTERS",
|
|
757
|
+
PRIVATE_APIS = "PRIVATE_APIS"
|
|
758
|
+
}
|
|
759
|
+
type CompatConfig = Partial<Record<DeprecationTypes, boolean | "suppress-warning">> & {
|
|
760
|
+
MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
|
|
761
|
+
};
|
|
762
|
+
declare function configureCompat(config: CompatConfig): void;
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region packages/runtime-core/src/componentOptions.d.ts
|
|
765
|
+
/**
|
|
766
|
+
* Interface for declaring custom options.
|
|
767
|
+
*
|
|
768
|
+
* @example
|
|
769
|
+
* ```ts
|
|
770
|
+
* declare module 'vue' {
|
|
771
|
+
* interface ComponentCustomOptions {
|
|
772
|
+
* beforeRouteUpdate?(
|
|
773
|
+
* to: Route,
|
|
774
|
+
* from: Route,
|
|
775
|
+
* next: () => void
|
|
776
|
+
* ): void
|
|
777
|
+
* }
|
|
778
|
+
* }
|
|
779
|
+
* ```
|
|
780
|
+
*/
|
|
781
|
+
interface ComponentCustomOptions {}
|
|
782
|
+
type RenderFunction = () => VNodeChild;
|
|
783
|
+
interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II, Provide>, ComponentInternalOptions, AsyncComponentInternalOptions, ComponentCustomOptions {
|
|
784
|
+
setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, "P">>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
|
785
|
+
name?: string;
|
|
786
|
+
template?: string | object;
|
|
787
|
+
render?: Function;
|
|
788
|
+
components?: LC & Record<string, Component>;
|
|
789
|
+
directives?: Directives & Record<string, Directive>;
|
|
790
|
+
inheritAttrs?: boolean;
|
|
791
|
+
emits?: (E | EE[]) & ThisType<void>;
|
|
792
|
+
slots?: S;
|
|
793
|
+
expose?: Exposed[];
|
|
794
|
+
serverPrefetch?(): void | Promise<any>;
|
|
795
|
+
compilerOptions?: RuntimeCompilerOptions;
|
|
796
|
+
/**
|
|
797
|
+
* SSR only. This is produced by compiler-ssr and attached in compiler-sfc
|
|
798
|
+
* not user facing, so the typing is lax and for test only.
|
|
799
|
+
* @internal
|
|
800
|
+
*/
|
|
801
|
+
ssrRender?: (ctx: any, push: (item: any) => void, parentInstance: ComponentInternalInstance, attrs: Data | undefined, $props: ComponentInternalInstance["props"], $setup: ComponentInternalInstance["setupState"], $data: ComponentInternalInstance["data"], $options: ComponentInternalInstance["ctx"]) => void;
|
|
802
|
+
/**
|
|
803
|
+
* Only generated by compiler-sfc to mark a ssr render function inlined and
|
|
804
|
+
* returned from setup()
|
|
805
|
+
* @internal
|
|
806
|
+
*/
|
|
807
|
+
__ssrInlineRender?: boolean;
|
|
808
|
+
call?: (this: unknown, ...args: unknown[]) => never;
|
|
809
|
+
__isFragment?: never;
|
|
810
|
+
__isTeleport?: never;
|
|
811
|
+
__isSuspense?: never;
|
|
812
|
+
__defaults?: Defaults;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Subset of compiler options that makes sense for the runtime.
|
|
816
|
+
*/
|
|
817
|
+
interface RuntimeCompilerOptions {
|
|
818
|
+
isCustomElement?: (tag: string) => boolean;
|
|
819
|
+
whitespace?: "preserve" | "condense";
|
|
820
|
+
comments?: boolean;
|
|
821
|
+
delimiters?: [string, string];
|
|
822
|
+
}
|
|
823
|
+
type ComponentOptions<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = any, M extends MethodOptions = any, Mixin extends ComponentOptionsMixin = any, Extends extends ComponentOptionsMixin = any, E extends EmitsOptions = any, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S, LC, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>, Defaults, false, I, S, LC, Directives>>;
|
|
824
|
+
type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>;
|
|
825
|
+
type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
826
|
+
interface MethodOptions {
|
|
827
|
+
[key: string]: Function;
|
|
828
|
+
}
|
|
829
|
+
type ExtractComputedReturns<T extends any> = { [key in keyof T]: T[key] extends {
|
|
830
|
+
get: (...args: any[]) => infer TReturn;
|
|
831
|
+
} ? TReturn : T[key] extends ((...args: any[]) => infer TReturn) ? TReturn : never };
|
|
832
|
+
type ObjectWatchOptionItem = {
|
|
833
|
+
handler: WatchCallback | string;
|
|
834
|
+
} & WatchOptions;
|
|
835
|
+
type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem;
|
|
836
|
+
type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
|
|
837
|
+
type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
|
|
838
|
+
type ComponentProvideOptions = ObjectProvideOptions | Function;
|
|
839
|
+
type ObjectProvideOptions = Record<string | symbol, unknown>;
|
|
840
|
+
type ComponentInjectOptions = string[] | ObjectInjectOptions;
|
|
841
|
+
type ObjectInjectOptions = Record<string | symbol, string | symbol | {
|
|
842
|
+
from?: string | symbol;
|
|
843
|
+
default?: unknown;
|
|
844
|
+
}>;
|
|
845
|
+
type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? { [K in T[number]]?: unknown } : T extends ObjectInjectOptions ? { [K in keyof T]?: unknown } : never;
|
|
846
|
+
interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string, Provide extends ComponentProvideOptions = ComponentProvideOptions> {
|
|
847
|
+
compatConfig?: CompatConfig;
|
|
848
|
+
[key: string]: any;
|
|
849
|
+
data?: (this: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
|
|
850
|
+
computed?: C;
|
|
851
|
+
methods?: M;
|
|
852
|
+
watch?: ComponentWatchOptions;
|
|
853
|
+
provide?: Provide;
|
|
854
|
+
inject?: I | II[];
|
|
855
|
+
filters?: Record<string, Function>;
|
|
856
|
+
mixins?: Mixin[];
|
|
857
|
+
extends?: Extends;
|
|
858
|
+
beforeCreate?(): any;
|
|
859
|
+
created?(): any;
|
|
860
|
+
beforeMount?(): any;
|
|
861
|
+
mounted?(): any;
|
|
862
|
+
beforeUpdate?(): any;
|
|
863
|
+
updated?(): any;
|
|
864
|
+
activated?(): any;
|
|
865
|
+
deactivated?(): any;
|
|
866
|
+
/** @deprecated use `beforeUnmount` instead */
|
|
867
|
+
beforeDestroy?(): any;
|
|
868
|
+
beforeUnmount?(): any;
|
|
869
|
+
/** @deprecated use `unmounted` instead */
|
|
870
|
+
destroyed?(): any;
|
|
871
|
+
unmounted?(): any;
|
|
872
|
+
renderTracked?: DebuggerHook;
|
|
873
|
+
renderTriggered?: DebuggerHook;
|
|
874
|
+
errorCaptured?: ErrorCapturedHook;
|
|
875
|
+
/**
|
|
876
|
+
* runtime compile only
|
|
877
|
+
* @deprecated use `compilerOptions.delimiters` instead.
|
|
878
|
+
*/
|
|
879
|
+
delimiters?: [string, string];
|
|
880
|
+
/**
|
|
881
|
+
* #3468
|
|
882
|
+
*
|
|
883
|
+
* type-only, used to assist Mixin's type inference,
|
|
884
|
+
* TypeScript will try to simplify the inferred `Mixin` type,
|
|
885
|
+
* with the `__differentiator`, TypeScript won't be able to combine different mixins,
|
|
886
|
+
* because the `__differentiator` will be different
|
|
887
|
+
*/
|
|
888
|
+
__differentiator?: keyof D | keyof C | keyof M;
|
|
889
|
+
}
|
|
890
|
+
type MergedHook<T = () => void> = T | T[];
|
|
891
|
+
type MergedComponentOptions = ComponentOptions & MergedComponentOptionsOverride;
|
|
892
|
+
type MergedComponentOptionsOverride = {
|
|
893
|
+
beforeCreate?: MergedHook;
|
|
894
|
+
created?: MergedHook;
|
|
895
|
+
beforeMount?: MergedHook;
|
|
896
|
+
mounted?: MergedHook;
|
|
897
|
+
beforeUpdate?: MergedHook;
|
|
898
|
+
updated?: MergedHook;
|
|
899
|
+
activated?: MergedHook;
|
|
900
|
+
deactivated?: MergedHook; /** @deprecated use `beforeUnmount` instead */
|
|
901
|
+
beforeDestroy?: MergedHook;
|
|
902
|
+
beforeUnmount?: MergedHook; /** @deprecated use `unmounted` instead */
|
|
903
|
+
destroyed?: MergedHook;
|
|
904
|
+
unmounted?: MergedHook;
|
|
905
|
+
renderTracked?: MergedHook<DebuggerHook>;
|
|
906
|
+
renderTriggered?: MergedHook<DebuggerHook>;
|
|
907
|
+
errorCaptured?: MergedHook<ErrorCapturedHook>;
|
|
908
|
+
};
|
|
909
|
+
type OptionTypesKeys = "P" | "B" | "D" | "C" | "M" | "Defaults";
|
|
910
|
+
type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
|
|
911
|
+
P: P;
|
|
912
|
+
B: B;
|
|
913
|
+
D: D;
|
|
914
|
+
C: C;
|
|
915
|
+
M: M;
|
|
916
|
+
Defaults: Defaults;
|
|
917
|
+
};
|
|
918
|
+
//#endregion
|
|
919
|
+
//#region packages/runtime-core/src/apiInject.d.ts
|
|
920
|
+
interface InjectionConstraint<T> {}
|
|
921
|
+
type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
|
922
|
+
//#endregion
|
|
923
|
+
//#region packages/runtime-core/src/apiDefineComponent.d.ts
|
|
924
|
+
type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
925
|
+
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
926
|
+
type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
927
|
+
//#endregion
|
|
928
|
+
//#region packages/runtime-core/src/apiCreateApp.d.ts
|
|
929
|
+
interface App<HostElement = any> {
|
|
930
|
+
vapor?: boolean;
|
|
931
|
+
version: string;
|
|
932
|
+
config: AppConfig;
|
|
933
|
+
use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: NoInfer<Options>): this;
|
|
934
|
+
use<Options>(plugin: Plugin<Options>, options: NoInfer<Options>): this;
|
|
935
|
+
mixin(mixin: ComponentOptions): this;
|
|
936
|
+
component(name: string): Component | undefined;
|
|
937
|
+
component<T extends Component | DefineComponent>(name: string, component: T): this;
|
|
938
|
+
directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any>(name: string): Directive<HostElement, Value, Modifiers, Arg> | undefined;
|
|
939
|
+
directive<HostElement = any, Value = any, Modifiers extends string = string, Arg = any>(name: string, directive: Directive<HostElement, Value, Modifiers, Arg>): this;
|
|
940
|
+
mount(rootContainer: HostElement | string, isHydrate?: boolean, namespace?: boolean | ElementNamespace, vnode?: VNode): ComponentPublicInstance;
|
|
941
|
+
unmount(): void;
|
|
942
|
+
onUnmount(cb: () => void): void;
|
|
943
|
+
provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
|
|
944
|
+
/**
|
|
945
|
+
* Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
|
|
946
|
+
* to variables provided via `app.provide()`.
|
|
947
|
+
*
|
|
948
|
+
* @param fn - function to run with the app as active instance
|
|
949
|
+
*/
|
|
950
|
+
runWithContext<T>(fn: () => T): T;
|
|
951
|
+
_uid: number;
|
|
952
|
+
_component: GenericComponent;
|
|
953
|
+
_props: Data | null;
|
|
954
|
+
_container: HostElement | null;
|
|
955
|
+
_context: AppContext;
|
|
956
|
+
_instance: GenericComponentInstance | null;
|
|
957
|
+
/**
|
|
958
|
+
* @internal custom element vnode
|
|
959
|
+
*/
|
|
960
|
+
_ceVNode?: VNode;
|
|
961
|
+
/**
|
|
962
|
+
* @internal vapor custom element instance
|
|
963
|
+
*/
|
|
964
|
+
_ceComponent?: GenericComponentInstance | null;
|
|
965
|
+
/**
|
|
966
|
+
* v2 compat only
|
|
967
|
+
*/
|
|
968
|
+
filter?(name: string): Function | undefined;
|
|
969
|
+
filter?(name: string, filter: Function): this;
|
|
970
|
+
/**
|
|
971
|
+
* @internal v3 compat only
|
|
972
|
+
*/
|
|
973
|
+
_createRoot?(options: ComponentOptions): ComponentPublicInstance;
|
|
974
|
+
}
|
|
975
|
+
type OptionMergeFunction = (to: unknown, from: unknown) => any;
|
|
976
|
+
/**
|
|
977
|
+
* Shared app config between vdom and vapor
|
|
978
|
+
*/
|
|
979
|
+
interface GenericAppConfig {
|
|
980
|
+
performance?: boolean;
|
|
981
|
+
errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
|
|
982
|
+
warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
|
|
983
|
+
/**
|
|
984
|
+
* Whether to throw unhandled errors in production.
|
|
985
|
+
* Default is `false` to avoid crashing on any error (and only logs it)
|
|
986
|
+
* But in some cases, e.g. SSR, throwing might be more desirable.
|
|
987
|
+
*/
|
|
988
|
+
throwUnhandledErrorInProduction?: boolean;
|
|
989
|
+
/**
|
|
990
|
+
* Prefix for all useId() calls within this app
|
|
991
|
+
*/
|
|
992
|
+
idPrefix?: string;
|
|
993
|
+
}
|
|
994
|
+
interface AppConfig extends GenericAppConfig {
|
|
995
|
+
readonly isNativeTag: (tag: string) => boolean;
|
|
996
|
+
optionMergeStrategies: Record<string, OptionMergeFunction>;
|
|
997
|
+
globalProperties: ComponentCustomProperties & Record<string, any>;
|
|
998
|
+
/**
|
|
999
|
+
* Options to pass to `@vue/compiler-dom`.
|
|
1000
|
+
* Only supported in runtime compiler build.
|
|
1001
|
+
*/
|
|
1002
|
+
compilerOptions: RuntimeCompilerOptions;
|
|
1003
|
+
/**
|
|
1004
|
+
* @deprecated use config.compilerOptions.isCustomElement
|
|
1005
|
+
*/
|
|
1006
|
+
isCustomElement?: (tag: string) => boolean;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* The vapor in vdom implementation is in runtime-vapor/src/vdomInterop.ts
|
|
1010
|
+
*/
|
|
1011
|
+
interface VaporInteropInterface {
|
|
1012
|
+
mount(vnode: VNode, container: any, anchor: any, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, onBeforeMount?: () => void): GenericComponentInstance;
|
|
1013
|
+
update(n1: VNode, n2: VNode, shouldUpdate: boolean, onBeforeUpdate?: () => void): void;
|
|
1014
|
+
unmount(vnode: VNode, doRemove?: boolean): void;
|
|
1015
|
+
move(vnode: VNode, container: any, anchor: any, moveType: MoveType): void;
|
|
1016
|
+
slot(n1: VNode | null, n2: VNode, container: any, anchor: any, parentComponent: ComponentInternalInstance | null): void;
|
|
1017
|
+
hydrate(vnode: VNode, node: any, container: any, anchor: any, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null): Node;
|
|
1018
|
+
hydrateSlot(vnode: VNode, node: any): Node;
|
|
1019
|
+
activate(vnode: VNode, container: any, anchor: any, parentComponent: ComponentInternalInstance): void;
|
|
1020
|
+
deactivate(vnode: VNode, container: any): void;
|
|
1021
|
+
setTransitionHooks(component: ComponentInternalInstance, transition: TransitionHooks): void;
|
|
1022
|
+
vdomMount: (component: ConcreteComponent, parentComponent: any, props?: any, slots?: any, isSingleRoot?: boolean) => any;
|
|
1023
|
+
vdomUnmount: UnmountComponentFn;
|
|
1024
|
+
vdomSlot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, fallback?: any) => any;
|
|
1025
|
+
vdomMountVNode: (vnode: VNode, parentComponent: any) => any;
|
|
1026
|
+
}
|
|
1027
|
+
/**
|
|
1028
|
+
* Minimal app context shared between vdom and vapor
|
|
1029
|
+
*/
|
|
1030
|
+
interface GenericAppContext {
|
|
1031
|
+
app: App;
|
|
1032
|
+
config: GenericAppConfig;
|
|
1033
|
+
provides: Record<string | symbol, any>;
|
|
1034
|
+
components?: Record<string, Component>;
|
|
1035
|
+
directives?: Record<string, Directive>;
|
|
1036
|
+
/**
|
|
1037
|
+
* HMR only
|
|
1038
|
+
* @internal
|
|
1039
|
+
*/
|
|
1040
|
+
reload?: () => void;
|
|
1041
|
+
/**
|
|
1042
|
+
* @internal vapor interop only
|
|
1043
|
+
*/
|
|
1044
|
+
vapor?: VaporInteropInterface;
|
|
1045
|
+
}
|
|
1046
|
+
interface AppContext extends GenericAppContext {
|
|
1047
|
+
config: AppConfig;
|
|
1048
|
+
components: Record<string, Component>;
|
|
1049
|
+
directives: Record<string, Directive>;
|
|
1050
|
+
mixins: ComponentOptions[];
|
|
1051
|
+
/**
|
|
1052
|
+
* Cache for merged/normalized component options
|
|
1053
|
+
* Each app instance has its own cache because app-level global mixins and
|
|
1054
|
+
* optionMergeStrategies can affect merge behavior.
|
|
1055
|
+
* @internal
|
|
1056
|
+
*/
|
|
1057
|
+
optionsCache: WeakMap<ComponentOptions, MergedComponentOptions>;
|
|
1058
|
+
/**
|
|
1059
|
+
* Cache for normalized props options
|
|
1060
|
+
* @internal
|
|
1061
|
+
*/
|
|
1062
|
+
propsCache: WeakMap<ConcreteComponent, NormalizedPropsOptions>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Cache for normalized emits options
|
|
1065
|
+
* @internal
|
|
1066
|
+
*/
|
|
1067
|
+
emitsCache: WeakMap<ConcreteComponent, ObjectEmitsOptions | null>;
|
|
1068
|
+
/**
|
|
1069
|
+
* v2 compat only
|
|
1070
|
+
* @internal
|
|
1071
|
+
*/
|
|
1072
|
+
filters?: Record<string, Function>;
|
|
1073
|
+
}
|
|
1074
|
+
type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
1075
|
+
type ObjectPlugin<Options = any[]> = {
|
|
1076
|
+
install: PluginInstallFunction<Options>;
|
|
1077
|
+
};
|
|
1078
|
+
type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>;
|
|
1079
|
+
type Plugin<Options = any[], P extends unknown[] = (Options extends unknown[] ? Options : [Options])> = FunctionPlugin<P> | ObjectPlugin<P>;
|
|
1080
|
+
//#endregion
|
|
1081
|
+
//#region packages/runtime-core/src/components/Teleport.d.ts
|
|
1082
|
+
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
1083
|
+
interface TeleportProps {
|
|
1084
|
+
to: string | RendererElement | null | undefined;
|
|
1085
|
+
disabled?: boolean;
|
|
1086
|
+
defer?: boolean;
|
|
1087
|
+
}
|
|
1088
|
+
declare const TeleportImpl: {
|
|
1089
|
+
name: string;
|
|
1090
|
+
__isTeleport: boolean;
|
|
1091
|
+
process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
|
|
1092
|
+
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, {
|
|
1093
|
+
um: unmount,
|
|
1094
|
+
o: {
|
|
1095
|
+
remove: hostRemove
|
|
1096
|
+
}
|
|
1097
|
+
}: RendererInternals, doRemove: boolean): void;
|
|
1098
|
+
move: typeof moveTeleport;
|
|
1099
|
+
hydrate: typeof hydrateTeleport;
|
|
1100
|
+
};
|
|
1101
|
+
declare enum TeleportMoveTypes {
|
|
1102
|
+
TARGET_CHANGE = 0,
|
|
1103
|
+
TOGGLE = 1,
|
|
1104
|
+
REORDER = 2
|
|
1105
|
+
}
|
|
1106
|
+
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, {
|
|
1107
|
+
o: {
|
|
1108
|
+
insert
|
|
1109
|
+
},
|
|
1110
|
+
m: move
|
|
1111
|
+
}: RendererInternals, parentComponent: ComponentInternalInstance | null, moveType?: TeleportMoveTypes): void;
|
|
1112
|
+
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, {
|
|
1113
|
+
o: {
|
|
1114
|
+
nextSibling,
|
|
1115
|
+
parentNode,
|
|
1116
|
+
querySelector,
|
|
1117
|
+
insert,
|
|
1118
|
+
createText
|
|
1119
|
+
}
|
|
1120
|
+
}: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
|
|
1121
|
+
declare const Teleport: {
|
|
1122
|
+
__isTeleport: true;
|
|
1123
|
+
new (): {
|
|
1124
|
+
$props: VNodeProps & TeleportProps;
|
|
1125
|
+
$slots: {
|
|
1126
|
+
default(): VNode[];
|
|
1127
|
+
};
|
|
1128
|
+
};
|
|
1129
|
+
};
|
|
1130
|
+
//#endregion
|
|
1131
|
+
//#region packages/runtime-core/src/vnode.d.ts
|
|
1132
|
+
declare const Fragment: {
|
|
1133
|
+
__isFragment: true;
|
|
1134
|
+
new (): {
|
|
1135
|
+
$props: VNodeProps;
|
|
1136
|
+
};
|
|
1137
|
+
};
|
|
1138
|
+
declare const Text: unique symbol;
|
|
1139
|
+
declare const Comment: unique symbol;
|
|
1140
|
+
declare const Static: unique symbol;
|
|
1141
|
+
declare const VaporSlot: unique symbol;
|
|
1142
|
+
type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl | typeof VaporSlot;
|
|
1143
|
+
type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
|
1144
|
+
type VNodeNormalizedRefAtom = {
|
|
1145
|
+
/**
|
|
1146
|
+
* component instance
|
|
1147
|
+
*/
|
|
1148
|
+
i: ComponentInternalInstance;
|
|
1149
|
+
/**
|
|
1150
|
+
* Actual ref
|
|
1151
|
+
*/
|
|
1152
|
+
r: VNodeRef;
|
|
1153
|
+
/**
|
|
1154
|
+
* setup ref key
|
|
1155
|
+
*/
|
|
1156
|
+
k?: string;
|
|
1157
|
+
/**
|
|
1158
|
+
* refInFor marker
|
|
1159
|
+
*/
|
|
1160
|
+
f?: boolean;
|
|
1161
|
+
};
|
|
1162
|
+
type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
|
|
1163
|
+
type VNodeMountHook = (vnode: VNode) => void;
|
|
1164
|
+
type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
|
|
1165
|
+
type VNodeProps = {
|
|
1166
|
+
key?: PropertyKey;
|
|
1167
|
+
ref?: VNodeRef;
|
|
1168
|
+
ref_for?: boolean;
|
|
1169
|
+
ref_key?: string;
|
|
1170
|
+
onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[];
|
|
1171
|
+
onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
|
|
1172
|
+
onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[];
|
|
1173
|
+
onVnodeUpdated?: VNodeUpdateHook | VNodeUpdateHook[];
|
|
1174
|
+
onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
|
|
1175
|
+
onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
|
|
1176
|
+
};
|
|
1177
|
+
type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
|
|
1178
|
+
type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
|
|
1179
|
+
type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
|
|
1180
|
+
type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
|
|
1181
|
+
interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraProps = {
|
|
1182
|
+
[key: string]: any;
|
|
1183
|
+
}> {
|
|
1184
|
+
/**
|
|
1185
|
+
* @internal
|
|
1186
|
+
*/
|
|
1187
|
+
__v_isVNode: true;
|
|
1188
|
+
/**
|
|
1189
|
+
* @internal
|
|
1190
|
+
*/
|
|
1191
|
+
[ReactiveFlags$1.SKIP]: true;
|
|
1192
|
+
type: VNodeTypes;
|
|
1193
|
+
props: (VNodeProps & ExtraProps) | null;
|
|
1194
|
+
key: PropertyKey | null;
|
|
1195
|
+
ref: VNodeNormalizedRef | null;
|
|
1196
|
+
/**
|
|
1197
|
+
* SFC only. This is assigned on vnode creation using currentScopeId
|
|
1198
|
+
* which is set alongside currentRenderingInstance.
|
|
1199
|
+
*/
|
|
1200
|
+
scopeId: string | null;
|
|
1201
|
+
/**
|
|
1202
|
+
* SFC only. This is assigned to:
|
|
1203
|
+
* - Slot fragment vnodes with :slotted SFC styles.
|
|
1204
|
+
* - Component vnodes (during patch/hydration) so that its root node can
|
|
1205
|
+
* inherit the component's slotScopeIds
|
|
1206
|
+
* @internal
|
|
1207
|
+
*/
|
|
1208
|
+
slotScopeIds: string[] | null;
|
|
1209
|
+
children: VNodeNormalizedChildren;
|
|
1210
|
+
component: ComponentInternalInstance | null;
|
|
1211
|
+
dirs: DirectiveBinding[] | null;
|
|
1212
|
+
transition: TransitionHooks<HostElement> | null;
|
|
1213
|
+
el: HostNode | null;
|
|
1214
|
+
placeholder: HostNode | null;
|
|
1215
|
+
anchor: HostNode | null;
|
|
1216
|
+
target: HostElement | null;
|
|
1217
|
+
targetStart: HostNode | null;
|
|
1218
|
+
targetAnchor: HostNode | null;
|
|
1219
|
+
/**
|
|
1220
|
+
* number of elements contained in a static vnode
|
|
1221
|
+
* @internal
|
|
1222
|
+
*/
|
|
1223
|
+
staticCount: number;
|
|
1224
|
+
suspense: SuspenseBoundary | null;
|
|
1225
|
+
/**
|
|
1226
|
+
* @internal
|
|
1227
|
+
*/
|
|
1228
|
+
ssContent: VNode | null;
|
|
1229
|
+
/**
|
|
1230
|
+
* @internal
|
|
1231
|
+
*/
|
|
1232
|
+
ssFallback: VNode | null;
|
|
1233
|
+
shapeFlag: number;
|
|
1234
|
+
patchFlag: number;
|
|
1235
|
+
/**
|
|
1236
|
+
* @internal
|
|
1237
|
+
*/
|
|
1238
|
+
dynamicProps: string[] | null;
|
|
1239
|
+
/**
|
|
1240
|
+
* @internal
|
|
1241
|
+
*/
|
|
1242
|
+
dynamicChildren: (VNode[] & {
|
|
1243
|
+
hasOnce?: boolean;
|
|
1244
|
+
}) | null;
|
|
1245
|
+
appContext: AppContext | null;
|
|
1246
|
+
/**
|
|
1247
|
+
* @internal lexical scope owner instance
|
|
1248
|
+
*/
|
|
1249
|
+
ctx: ComponentInternalInstance | null;
|
|
1250
|
+
/**
|
|
1251
|
+
* @internal attached by v-memo
|
|
1252
|
+
*/
|
|
1253
|
+
memo?: any[];
|
|
1254
|
+
/**
|
|
1255
|
+
* @internal index for cleaning v-memo cache
|
|
1256
|
+
*/
|
|
1257
|
+
cacheIndex?: number;
|
|
1258
|
+
/**
|
|
1259
|
+
* @internal __COMPAT__ only
|
|
1260
|
+
*/
|
|
1261
|
+
isCompatRoot?: true;
|
|
1262
|
+
/**
|
|
1263
|
+
* @internal custom element interception hook
|
|
1264
|
+
*/
|
|
1265
|
+
ce?: (instance: ComponentInternalInstance) => void;
|
|
1266
|
+
/**
|
|
1267
|
+
* @internal VDOM in Vapor interop hook
|
|
1268
|
+
*/
|
|
1269
|
+
vi?: (instance: ComponentInternalInstance) => void;
|
|
1270
|
+
/**
|
|
1271
|
+
* @internal Vapor slot in VDOM metadata
|
|
1272
|
+
*/
|
|
1273
|
+
vs?: {
|
|
1274
|
+
slot: (props: any) => any;
|
|
1275
|
+
fallback: (() => VNodeArrayChildren) | undefined;
|
|
1276
|
+
ref?: ShallowRef<any>;
|
|
1277
|
+
};
|
|
1278
|
+
/**
|
|
1279
|
+
* @internal Vapor slot Block
|
|
1280
|
+
*/
|
|
1281
|
+
vb?: any;
|
|
1282
|
+
}
|
|
1283
|
+
//#endregion
|
|
1284
|
+
//#region packages/runtime-core/src/component.d.ts
|
|
1285
|
+
type Data = Record<string, unknown>;
|
|
1286
|
+
/**
|
|
1287
|
+
* For extending allowed non-declared props on components in TSX
|
|
1288
|
+
*/
|
|
1289
|
+
interface ComponentCustomProps {}
|
|
1290
|
+
/**
|
|
1291
|
+
* For globally defined Directives
|
|
1292
|
+
* Here is an example of adding a directive `VTooltip` as global directive:
|
|
1293
|
+
*
|
|
1294
|
+
* @example
|
|
1295
|
+
* ```ts
|
|
1296
|
+
* import VTooltip from 'v-tooltip'
|
|
1297
|
+
*
|
|
1298
|
+
* declare module '@vue/runtime-core' {
|
|
1299
|
+
* interface GlobalDirectives {
|
|
1300
|
+
* VTooltip
|
|
1301
|
+
* }
|
|
1302
|
+
* }
|
|
1303
|
+
* ```
|
|
1304
|
+
*/
|
|
1305
|
+
interface GlobalDirectives {}
|
|
1306
|
+
/**
|
|
1307
|
+
* For globally defined Components
|
|
1308
|
+
* Here is an example of adding a component `RouterView` as global component:
|
|
1309
|
+
*
|
|
1310
|
+
* @example
|
|
1311
|
+
* ```ts
|
|
1312
|
+
* import { RouterView } from 'vue-router'
|
|
1313
|
+
*
|
|
1314
|
+
* declare module '@vue/runtime-core' {
|
|
1315
|
+
* interface GlobalComponents {
|
|
1316
|
+
* RouterView
|
|
1317
|
+
* }
|
|
1318
|
+
* }
|
|
1319
|
+
* ```
|
|
1320
|
+
*/
|
|
1321
|
+
interface GlobalComponents {
|
|
1322
|
+
Teleport: DefineComponent<TeleportProps>;
|
|
1323
|
+
Suspense: DefineComponent<SuspenseProps>;
|
|
1324
|
+
KeepAlive: DefineComponent<KeepAliveProps>;
|
|
1325
|
+
BaseTransition: DefineComponent<BaseTransitionProps>;
|
|
1326
|
+
}
|
|
1327
|
+
/**
|
|
1328
|
+
* Default allowed non-declared props on component in TSX
|
|
1329
|
+
*/
|
|
1330
|
+
interface AllowedComponentProps {
|
|
1331
|
+
class?: unknown;
|
|
1332
|
+
style?: unknown;
|
|
1333
|
+
}
|
|
1334
|
+
interface ComponentInternalOptions {
|
|
1335
|
+
/**
|
|
1336
|
+
* indicates vapor component
|
|
1337
|
+
*/
|
|
1338
|
+
__vapor?: boolean;
|
|
1339
|
+
/**
|
|
1340
|
+
* indicates keep-alive component
|
|
1341
|
+
*/
|
|
1342
|
+
__isKeepAlive?: boolean;
|
|
1343
|
+
/**
|
|
1344
|
+
* @internal
|
|
1345
|
+
*/
|
|
1346
|
+
__scopeId?: string;
|
|
1347
|
+
/**
|
|
1348
|
+
* @internal
|
|
1349
|
+
*/
|
|
1350
|
+
__cssModules?: Data;
|
|
1351
|
+
/**
|
|
1352
|
+
* @internal
|
|
1353
|
+
*/
|
|
1354
|
+
__hmrId?: string;
|
|
1355
|
+
/**
|
|
1356
|
+
* Compat build only, for bailing out of certain compatibility behavior
|
|
1357
|
+
*/
|
|
1358
|
+
__isBuiltIn?: boolean;
|
|
1359
|
+
/**
|
|
1360
|
+
* This one should be exposed so that devtools can make use of it
|
|
1361
|
+
*/
|
|
1362
|
+
__file?: string;
|
|
1363
|
+
/**
|
|
1364
|
+
* name inferred from filename
|
|
1365
|
+
*/
|
|
1366
|
+
__name?: string;
|
|
1367
|
+
}
|
|
1368
|
+
interface AsyncComponentInternalOptions<R = ConcreteComponent, I = ComponentInternalInstance> {
|
|
1369
|
+
/**
|
|
1370
|
+
* marker for AsyncComponentWrapper
|
|
1371
|
+
* @internal
|
|
1372
|
+
*/
|
|
1373
|
+
__asyncLoader?: () => Promise<R>;
|
|
1374
|
+
/**
|
|
1375
|
+
* the inner component resolved by the AsyncComponentWrapper
|
|
1376
|
+
* @internal
|
|
1377
|
+
*/
|
|
1378
|
+
__asyncResolved?: R;
|
|
1379
|
+
/**
|
|
1380
|
+
* Exposed for lazy hydration
|
|
1381
|
+
* @internal
|
|
1382
|
+
*/
|
|
1383
|
+
__asyncHydrate?: (el: Element, instance: I, hydrate: () => void) => void;
|
|
1384
|
+
}
|
|
1385
|
+
interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions {
|
|
1386
|
+
(props: P & EmitsToProps<EE>, ctx: Omit<SetupContext<EE, IfAny<S, {}, SlotsType<S>>>, "expose">): any;
|
|
1387
|
+
props?: ComponentPropsOptions<P>;
|
|
1388
|
+
emits?: EE | (keyof EE)[];
|
|
1389
|
+
slots?: IfAny<S, Slots, SlotsType<S>>;
|
|
1390
|
+
inheritAttrs?: boolean;
|
|
1391
|
+
displayName?: string;
|
|
1392
|
+
compatConfig?: CompatConfig;
|
|
1393
|
+
}
|
|
1394
|
+
/**
|
|
1395
|
+
* Type used where a function accepts both vdom and vapor components.
|
|
1396
|
+
*/
|
|
1397
|
+
type GenericComponent = ({
|
|
1398
|
+
name?: string;
|
|
1399
|
+
} | ((() => any) & {
|
|
1400
|
+
displayName?: string;
|
|
1401
|
+
})) & ComponentInternalOptions;
|
|
1402
|
+
/**
|
|
1403
|
+
* Concrete component type matches its actual value: it's either an options
|
|
1404
|
+
* object, or a function. Use this where the code expects to work with actual
|
|
1405
|
+
* values, e.g. checking if its a function or not. This is mostly for internal
|
|
1406
|
+
* implementation code.
|
|
1407
|
+
*/
|
|
1408
|
+
type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, E, S>;
|
|
1409
|
+
/**
|
|
1410
|
+
* A type used in public APIs where a component type is expected.
|
|
1411
|
+
* The constructor type is an artificial type returned by defineComponent().
|
|
1412
|
+
*/
|
|
1413
|
+
type Component<PropsOrInstance = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any> = ConcreteComponent<PropsOrInstance, RawBindings, D, C, M, E, S> | ComponentPublicInstanceConstructor<PropsOrInstance>;
|
|
1414
|
+
type LifecycleHook<TFn = Function> = (TFn & SchedulerJob)[] | null;
|
|
1415
|
+
type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
1416
|
+
attrs: Data;
|
|
1417
|
+
slots: UnwrapSlotsType<S>;
|
|
1418
|
+
emit: EmitFn<E>;
|
|
1419
|
+
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
|
1420
|
+
} : never;
|
|
1421
|
+
/**
|
|
1422
|
+
* @internal
|
|
1423
|
+
*/
|
|
1424
|
+
type InternalRenderFunction = {
|
|
1425
|
+
(ctx: ComponentPublicInstance, cache: ComponentInternalInstance["renderCache"], $props: ComponentInternalInstance["props"], $setup: ComponentInternalInstance["setupState"], $data: ComponentInternalInstance["data"], $options: ComponentInternalInstance["ctx"]): VNodeChild;
|
|
1426
|
+
_rc?: boolean;
|
|
1427
|
+
_compatChecked?: boolean;
|
|
1428
|
+
_compatWrapped?: boolean;
|
|
1429
|
+
};
|
|
1430
|
+
/**
|
|
1431
|
+
* Base component instance interface that is shared between vdom mode and vapor
|
|
1432
|
+
* mode, so that we can have a mixed instance tree and reuse core logic that
|
|
1433
|
+
* operate on both.
|
|
1434
|
+
*/
|
|
1435
|
+
interface GenericComponentInstance {
|
|
1436
|
+
vapor?: boolean;
|
|
1437
|
+
uid: number;
|
|
1438
|
+
type: GenericComponent;
|
|
1439
|
+
root: GenericComponentInstance | null;
|
|
1440
|
+
parent: GenericComponentInstance | null;
|
|
1441
|
+
appContext: GenericAppContext;
|
|
1442
|
+
/**
|
|
1443
|
+
* Object containing values this component provides for its descendants
|
|
1444
|
+
* @internal
|
|
1445
|
+
*/
|
|
1446
|
+
provides: Data;
|
|
1447
|
+
/**
|
|
1448
|
+
* Tracking reactive effects (e.g. watchers) associated with this component
|
|
1449
|
+
* so that they can be automatically stopped on component unmount
|
|
1450
|
+
* @internal
|
|
1451
|
+
*/
|
|
1452
|
+
scope: EffectScope;
|
|
1453
|
+
/**
|
|
1454
|
+
* render function will have different types between vdom and vapor
|
|
1455
|
+
*/
|
|
1456
|
+
render?: Function | null;
|
|
1457
|
+
/**
|
|
1458
|
+
* SSR render function
|
|
1459
|
+
* (they are the same between vdom and vapor components.)
|
|
1460
|
+
* @internal
|
|
1461
|
+
*/
|
|
1462
|
+
ssrRender?: Function | null;
|
|
1463
|
+
props: Data;
|
|
1464
|
+
attrs: Data;
|
|
1465
|
+
refs: Data;
|
|
1466
|
+
emit: EmitFn;
|
|
1467
|
+
/**
|
|
1468
|
+
* used for keeping track of .once event handlers on components
|
|
1469
|
+
* @internal
|
|
1470
|
+
*/
|
|
1471
|
+
emitted: Record<string, boolean> | null;
|
|
1472
|
+
/**
|
|
1473
|
+
* used for caching the value returned from props default factory functions to
|
|
1474
|
+
* avoid unnecessary watcher trigger
|
|
1475
|
+
* @internal
|
|
1476
|
+
*/
|
|
1477
|
+
propsDefaults: Data | null;
|
|
1478
|
+
/**
|
|
1479
|
+
* used for getting the keys of a component's raw props, vapor only
|
|
1480
|
+
* @internal
|
|
1481
|
+
*/
|
|
1482
|
+
rawKeys?: () => string[];
|
|
1483
|
+
exposed: Record<string, any> | null;
|
|
1484
|
+
exposeProxy: Record<string, any> | null;
|
|
1485
|
+
/**
|
|
1486
|
+
* setup related
|
|
1487
|
+
* @internal
|
|
1488
|
+
*/
|
|
1489
|
+
setupState?: Data;
|
|
1490
|
+
/**
|
|
1491
|
+
* devtools access to additional info
|
|
1492
|
+
* @internal
|
|
1493
|
+
*/
|
|
1494
|
+
devtoolsRawSetupState?: any;
|
|
1495
|
+
isMounted: boolean;
|
|
1496
|
+
isUnmounted: boolean;
|
|
1497
|
+
isDeactivated: boolean;
|
|
1498
|
+
/**
|
|
1499
|
+
* for tracking useId()
|
|
1500
|
+
* first element is the current boundary prefix
|
|
1501
|
+
* second number is the index of the useId call within that boundary
|
|
1502
|
+
* @internal
|
|
1503
|
+
*/
|
|
1504
|
+
ids: [string, number, number];
|
|
1505
|
+
/**
|
|
1506
|
+
* resolved props options
|
|
1507
|
+
* @internal
|
|
1508
|
+
*/
|
|
1509
|
+
propsOptions?: NormalizedPropsOptions;
|
|
1510
|
+
/**
|
|
1511
|
+
* resolved emits options
|
|
1512
|
+
* @internal
|
|
1513
|
+
*/
|
|
1514
|
+
emitsOptions?: ObjectEmitsOptions | null;
|
|
1515
|
+
/**
|
|
1516
|
+
* Public instance proxy, vdom only
|
|
1517
|
+
*/
|
|
1518
|
+
proxy?: any;
|
|
1519
|
+
/**
|
|
1520
|
+
* suspense related
|
|
1521
|
+
* @internal
|
|
1522
|
+
*/
|
|
1523
|
+
suspense: SuspenseBoundary | null;
|
|
1524
|
+
/**
|
|
1525
|
+
* suspense pending batch id
|
|
1526
|
+
* @internal
|
|
1527
|
+
*/
|
|
1528
|
+
suspenseId: number;
|
|
1529
|
+
/**
|
|
1530
|
+
* @internal
|
|
1531
|
+
*/
|
|
1532
|
+
asyncDep: Promise<any> | null;
|
|
1533
|
+
/**
|
|
1534
|
+
* @internal
|
|
1535
|
+
*/
|
|
1536
|
+
asyncResolved: boolean;
|
|
1537
|
+
/**
|
|
1538
|
+
* `updateTeleportCssVars`
|
|
1539
|
+
* For updating css vars on contained teleports
|
|
1540
|
+
* @internal
|
|
1541
|
+
*/
|
|
1542
|
+
ut?: (vars?: Record<string, string>) => void;
|
|
1543
|
+
/**
|
|
1544
|
+
* dev only. For style v-bind hydration mismatch checks
|
|
1545
|
+
* @internal
|
|
1546
|
+
*/
|
|
1547
|
+
getCssVars?: () => Record<string, string>;
|
|
1548
|
+
/**
|
|
1549
|
+
* @internal
|
|
1550
|
+
*/
|
|
1551
|
+
[LifecycleHooks.BEFORE_CREATE]?: LifecycleHook;
|
|
1552
|
+
/**
|
|
1553
|
+
* @internal
|
|
1554
|
+
*/
|
|
1555
|
+
[LifecycleHooks.CREATED]?: LifecycleHook;
|
|
1556
|
+
/**
|
|
1557
|
+
* @internal
|
|
1558
|
+
*/
|
|
1559
|
+
[LifecycleHooks.BEFORE_MOUNT]?: LifecycleHook;
|
|
1560
|
+
/**
|
|
1561
|
+
* @internal
|
|
1562
|
+
*/
|
|
1563
|
+
[LifecycleHooks.MOUNTED]?: LifecycleHook;
|
|
1564
|
+
/**
|
|
1565
|
+
* @internal
|
|
1566
|
+
*/
|
|
1567
|
+
[LifecycleHooks.BEFORE_UPDATE]?: LifecycleHook;
|
|
1568
|
+
/**
|
|
1569
|
+
* @internal
|
|
1570
|
+
*/
|
|
1571
|
+
[LifecycleHooks.UPDATED]?: LifecycleHook;
|
|
1572
|
+
/**
|
|
1573
|
+
* @internal
|
|
1574
|
+
*/
|
|
1575
|
+
[LifecycleHooks.BEFORE_UNMOUNT]?: LifecycleHook;
|
|
1576
|
+
/**
|
|
1577
|
+
* @internal
|
|
1578
|
+
*/
|
|
1579
|
+
[LifecycleHooks.UNMOUNTED]?: LifecycleHook;
|
|
1580
|
+
/**
|
|
1581
|
+
* @internal
|
|
1582
|
+
*/
|
|
1583
|
+
[LifecycleHooks.RENDER_TRACKED]?: LifecycleHook;
|
|
1584
|
+
/**
|
|
1585
|
+
* @internal
|
|
1586
|
+
*/
|
|
1587
|
+
[LifecycleHooks.RENDER_TRIGGERED]?: LifecycleHook;
|
|
1588
|
+
/**
|
|
1589
|
+
* @internal
|
|
1590
|
+
*/
|
|
1591
|
+
[LifecycleHooks.ACTIVATED]?: LifecycleHook;
|
|
1592
|
+
/**
|
|
1593
|
+
* @internal
|
|
1594
|
+
*/
|
|
1595
|
+
[LifecycleHooks.DEACTIVATED]?: LifecycleHook;
|
|
1596
|
+
/**
|
|
1597
|
+
* @internal
|
|
1598
|
+
*/
|
|
1599
|
+
[LifecycleHooks.ERROR_CAPTURED]?: LifecycleHook;
|
|
1600
|
+
/**
|
|
1601
|
+
* @internal
|
|
1602
|
+
*/
|
|
1603
|
+
[LifecycleHooks.SERVER_PREFETCH]?: LifecycleHook<() => Promise<unknown>>;
|
|
1604
|
+
/**
|
|
1605
|
+
* @internal vapor only
|
|
1606
|
+
*/
|
|
1607
|
+
hmrRerender?: () => void;
|
|
1608
|
+
/**
|
|
1609
|
+
* @internal vapor only
|
|
1610
|
+
*/
|
|
1611
|
+
hmrReload?: (newComp: any) => void;
|
|
1612
|
+
vnode?: VNode;
|
|
1613
|
+
subTree?: VNode;
|
|
1614
|
+
/**
|
|
1615
|
+
* Custom Element instance (if component is created by defineCustomElement)
|
|
1616
|
+
* @internal
|
|
1617
|
+
*/
|
|
1618
|
+
ce?: ComponentCustomElementInterface;
|
|
1619
|
+
/**
|
|
1620
|
+
* is custom element? (kept only for compatibility)
|
|
1621
|
+
* @internal
|
|
1622
|
+
*/
|
|
1623
|
+
isCE?: boolean;
|
|
1624
|
+
/**
|
|
1625
|
+
* custom element specific HMR method
|
|
1626
|
+
* @internal
|
|
1627
|
+
*/
|
|
1628
|
+
ceReload?: (newStyles?: string[]) => void;
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* We expose a subset of properties on the internal instance as they are
|
|
1632
|
+
* useful for advanced external libraries and tools.
|
|
1633
|
+
*/
|
|
1634
|
+
interface ComponentInternalInstance extends GenericComponentInstance {
|
|
1635
|
+
vapor?: never;
|
|
1636
|
+
uid: number;
|
|
1637
|
+
type: ConcreteComponent;
|
|
1638
|
+
parent: GenericComponentInstance | null;
|
|
1639
|
+
root: GenericComponentInstance;
|
|
1640
|
+
appContext: AppContext;
|
|
1641
|
+
/**
|
|
1642
|
+
* Vnode representing this component in its parent's vdom tree
|
|
1643
|
+
*/
|
|
1644
|
+
vnode: VNode;
|
|
1645
|
+
/**
|
|
1646
|
+
* The pending new vnode from parent updates
|
|
1647
|
+
* @internal
|
|
1648
|
+
*/
|
|
1649
|
+
next: VNode | null;
|
|
1650
|
+
/**
|
|
1651
|
+
* Root vnode of this component's own vdom tree
|
|
1652
|
+
*/
|
|
1653
|
+
subTree: VNode;
|
|
1654
|
+
/**
|
|
1655
|
+
* Render effect instance
|
|
1656
|
+
*/
|
|
1657
|
+
effect: ReactiveEffect;
|
|
1658
|
+
/**
|
|
1659
|
+
* Force update render effect
|
|
1660
|
+
*/
|
|
1661
|
+
update: () => void;
|
|
1662
|
+
/**
|
|
1663
|
+
* Render effect job to be passed to scheduler (checks if dirty)
|
|
1664
|
+
*/
|
|
1665
|
+
job: SchedulerJob;
|
|
1666
|
+
/**
|
|
1667
|
+
* The render function that returns vdom tree.
|
|
1668
|
+
* @internal
|
|
1669
|
+
*/
|
|
1670
|
+
render: InternalRenderFunction | null;
|
|
1671
|
+
/**
|
|
1672
|
+
* cache for proxy access type to avoid hasOwnProperty calls
|
|
1673
|
+
* @internal
|
|
1674
|
+
*/
|
|
1675
|
+
accessCache: Data | null;
|
|
1676
|
+
/**
|
|
1677
|
+
* cache for render function values that rely on _ctx but won't need updates
|
|
1678
|
+
* after initialized (e.g. inline handlers)
|
|
1679
|
+
* @internal
|
|
1680
|
+
*/
|
|
1681
|
+
renderCache: (Function | VNode | undefined)[];
|
|
1682
|
+
/**
|
|
1683
|
+
* Resolved component registry, only for components with mixins or extends
|
|
1684
|
+
* @internal
|
|
1685
|
+
*/
|
|
1686
|
+
components: Record<string, ConcreteComponent> | null;
|
|
1687
|
+
/**
|
|
1688
|
+
* Resolved directive registry, only for components with mixins or extends
|
|
1689
|
+
* @internal
|
|
1690
|
+
*/
|
|
1691
|
+
directives: Record<string, Directive> | null;
|
|
1692
|
+
/**
|
|
1693
|
+
* Resolved filters registry, v2 compat only
|
|
1694
|
+
* @internal
|
|
1695
|
+
*/
|
|
1696
|
+
filters?: Record<string, Function>;
|
|
1697
|
+
/**
|
|
1698
|
+
* resolved props options
|
|
1699
|
+
* @internal
|
|
1700
|
+
*/
|
|
1701
|
+
propsOptions: NormalizedPropsOptions;
|
|
1702
|
+
/**
|
|
1703
|
+
* resolved emits options
|
|
1704
|
+
* @internal
|
|
1705
|
+
*/
|
|
1706
|
+
emitsOptions: ObjectEmitsOptions | null;
|
|
1707
|
+
/**
|
|
1708
|
+
* resolved inheritAttrs options
|
|
1709
|
+
* @internal
|
|
1710
|
+
*/
|
|
1711
|
+
inheritAttrs?: boolean;
|
|
1712
|
+
/**
|
|
1713
|
+
* setup related
|
|
1714
|
+
* @internal
|
|
1715
|
+
*/
|
|
1716
|
+
setupState: Data;
|
|
1717
|
+
/**
|
|
1718
|
+
* @internal
|
|
1719
|
+
*/
|
|
1720
|
+
setupContext?: SetupContext | null;
|
|
1721
|
+
proxy: ComponentPublicInstance | null;
|
|
1722
|
+
data: Data;
|
|
1723
|
+
emit: EmitFn;
|
|
1724
|
+
slots: InternalSlots;
|
|
1725
|
+
exposeProxy: Record<string, any> | null;
|
|
1726
|
+
/**
|
|
1727
|
+
* alternative proxy used only for runtime-compiled render functions using
|
|
1728
|
+
* `with` block
|
|
1729
|
+
* @internal
|
|
1730
|
+
*/
|
|
1731
|
+
withProxy: ComponentPublicInstance | null;
|
|
1732
|
+
/**
|
|
1733
|
+
* This is the target for the public instance proxy. It also holds properties
|
|
1734
|
+
* injected by user options (computed, methods etc.) and user-attached
|
|
1735
|
+
* custom properties (via `this.x = ...`)
|
|
1736
|
+
* @internal
|
|
1737
|
+
*/
|
|
1738
|
+
ctx: Data;
|
|
1739
|
+
/**
|
|
1740
|
+
* suspense pending batch id
|
|
1741
|
+
* @internal
|
|
1742
|
+
*/
|
|
1743
|
+
suspenseId: number;
|
|
1744
|
+
/**
|
|
1745
|
+
* @internal
|
|
1746
|
+
*/
|
|
1747
|
+
asyncDep: Promise<any> | null;
|
|
1748
|
+
/**
|
|
1749
|
+
* @internal
|
|
1750
|
+
*/
|
|
1751
|
+
asyncResolved: boolean;
|
|
1752
|
+
/**
|
|
1753
|
+
* For caching bound $forceUpdate on public proxy access
|
|
1754
|
+
* @internal
|
|
1755
|
+
*/
|
|
1756
|
+
f?: () => void;
|
|
1757
|
+
/**
|
|
1758
|
+
* For caching bound $nextTick on public proxy access
|
|
1759
|
+
* @internal
|
|
1760
|
+
*/
|
|
1761
|
+
n?: () => Promise<void>;
|
|
1762
|
+
/**
|
|
1763
|
+
* v2 compat only, for caching mutated $options
|
|
1764
|
+
* @internal
|
|
1765
|
+
*/
|
|
1766
|
+
resolvedOptions?: MergedComponentOptions;
|
|
1767
|
+
}
|
|
1768
|
+
interface ComponentCustomElementInterface {
|
|
1769
|
+
/**
|
|
1770
|
+
* @internal
|
|
1771
|
+
*/
|
|
1772
|
+
_isVueCE: boolean;
|
|
1773
|
+
/**
|
|
1774
|
+
* @internal
|
|
1775
|
+
*/
|
|
1776
|
+
_injectChildStyle(type: ConcreteComponent): void;
|
|
1777
|
+
/**
|
|
1778
|
+
* @internal
|
|
1779
|
+
*/
|
|
1780
|
+
_removeChildStyle(type: ConcreteComponent): void;
|
|
1781
|
+
/**
|
|
1782
|
+
* @internal
|
|
1783
|
+
*/
|
|
1784
|
+
_setProp(key: string, val: any, shouldReflect?: boolean, shouldUpdate?: boolean): void;
|
|
1785
|
+
/**
|
|
1786
|
+
* @internal
|
|
1787
|
+
*/
|
|
1788
|
+
_beginPatch(): void;
|
|
1789
|
+
/**
|
|
1790
|
+
* @internal
|
|
1791
|
+
*/
|
|
1792
|
+
_endPatch(): void;
|
|
1793
|
+
/**
|
|
1794
|
+
* @internal attached by the nested Teleport when shadowRoot is false.
|
|
1795
|
+
*/
|
|
1796
|
+
_teleportTargets?: Set<RendererElement>;
|
|
1797
|
+
/**
|
|
1798
|
+
* @internal check if shadow root is enabled
|
|
1799
|
+
*/
|
|
1800
|
+
_hasShadowRoot(): boolean;
|
|
1801
|
+
}
|
|
1802
|
+
//#endregion
|
|
1803
|
+
//#region packages/runtime-core/src/apiWatch.d.ts
|
|
1804
|
+
interface WatchEffectOptions extends DebuggerOptions {
|
|
1805
|
+
flush?: "pre" | "post" | "sync";
|
|
1806
|
+
}
|
|
1807
|
+
interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
|
|
1808
|
+
immediate?: Immediate;
|
|
1809
|
+
deep?: boolean | number;
|
|
1810
|
+
once?: boolean;
|
|
1811
|
+
}
|
|
1812
|
+
//#endregion
|
|
1813
|
+
//#region packages/runtime-core/src/compat/globalConfig.d.ts
|
|
1814
|
+
type LegacyConfig = {
|
|
1815
|
+
/**
|
|
1816
|
+
* @deprecated `config.silent` option has been removed
|
|
1817
|
+
*/
|
|
1818
|
+
silent?: boolean;
|
|
1819
|
+
/**
|
|
1820
|
+
* @deprecated use __VUE_PROD_DEVTOOLS__ compile-time feature flag instead
|
|
1821
|
+
* https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags
|
|
1822
|
+
*/
|
|
1823
|
+
devtools?: boolean;
|
|
1824
|
+
/**
|
|
1825
|
+
* @deprecated use `config.isCustomElement` instead
|
|
1826
|
+
* https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement
|
|
1827
|
+
*/
|
|
1828
|
+
ignoredElements?: (string | RegExp)[];
|
|
1829
|
+
/**
|
|
1830
|
+
* @deprecated
|
|
1831
|
+
* https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html
|
|
1832
|
+
*/
|
|
1833
|
+
keyCodes?: Record<string, number | number[]>;
|
|
1834
|
+
/**
|
|
1835
|
+
* @deprecated
|
|
1836
|
+
* https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed
|
|
1837
|
+
*/
|
|
1838
|
+
productionTip?: boolean;
|
|
1839
|
+
};
|
|
1840
|
+
//#endregion
|
|
1841
|
+
//#region packages/runtime-core/src/compat/instance.d.ts
|
|
1842
|
+
type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties;
|
|
1843
|
+
interface LegacyPublicProperties {
|
|
1844
|
+
$set<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K, value: T[K]): void;
|
|
1845
|
+
$delete<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K): void;
|
|
1846
|
+
$mount(el?: string | Element): this;
|
|
1847
|
+
$destroy(): void;
|
|
1848
|
+
$scopedSlots: Slots;
|
|
1849
|
+
$on(event: string | string[], fn: Function): this;
|
|
1850
|
+
$once(event: string, fn: Function): this;
|
|
1851
|
+
$off(event?: string | string[], fn?: Function): this;
|
|
1852
|
+
$children: LegacyPublicProperties[];
|
|
1853
|
+
$listeners: Record<string, Function | Function[]>;
|
|
1854
|
+
}
|
|
1855
|
+
//#endregion
|
|
1856
|
+
//#region packages/runtime-core/src/compat/global.d.ts
|
|
1857
|
+
/**
|
|
1858
|
+
* @deprecated the default `Vue` export has been removed in Vue 3. The type for
|
|
1859
|
+
* the default export is provided only for migration purposes. Please use
|
|
1860
|
+
* named imports instead - e.g. `import { createApp } from 'vue'`.
|
|
1861
|
+
*/
|
|
1862
|
+
type CompatVue = Pick<App, "version" | "component" | "directive"> & {
|
|
1863
|
+
configureCompat: typeof configureCompat;
|
|
1864
|
+
new (options?: ComponentOptions): LegacyPublicInstance;
|
|
1865
|
+
version: string;
|
|
1866
|
+
config: AppConfig & LegacyConfig;
|
|
1867
|
+
nextTick: typeof nextTick;
|
|
1868
|
+
use<Options extends unknown[]>(plugin: Plugin<Options>, ...options: Options): CompatVue;
|
|
1869
|
+
use<Options>(plugin: Plugin<Options>, options: Options): CompatVue;
|
|
1870
|
+
mixin(mixin: ComponentOptions): CompatVue;
|
|
1871
|
+
component(name: string): Component | undefined;
|
|
1872
|
+
component(name: string, component: Component): CompatVue;
|
|
1873
|
+
directive<T = any, V = any>(name: string): Directive<T, V> | undefined;
|
|
1874
|
+
directive<T = any, V = any>(name: string, directive: Directive<T, V>): CompatVue;
|
|
1875
|
+
compile(template: string): RenderFunction;
|
|
1876
|
+
/**
|
|
1877
|
+
* @deprecated Vue 3 no longer supports extending constructors.
|
|
1878
|
+
*/
|
|
1879
|
+
extend: (options?: ComponentOptions) => CompatVue;
|
|
1880
|
+
/**
|
|
1881
|
+
* @deprecated Vue 3 no longer needs set() for adding new properties.
|
|
1882
|
+
*/
|
|
1883
|
+
set(target: any, key: PropertyKey, value: any): void;
|
|
1884
|
+
/**
|
|
1885
|
+
* @deprecated Vue 3 no longer needs delete() for property deletions.
|
|
1886
|
+
*/
|
|
1887
|
+
delete(target: any, key: PropertyKey): void;
|
|
1888
|
+
/**
|
|
1889
|
+
* @deprecated use `reactive` instead.
|
|
1890
|
+
*/
|
|
1891
|
+
observable: typeof reactive;
|
|
1892
|
+
/**
|
|
1893
|
+
* @deprecated filters have been removed from Vue 3.
|
|
1894
|
+
*/
|
|
1895
|
+
filter(name: string, arg?: any): null;
|
|
1896
|
+
/**
|
|
1897
|
+
* @internal
|
|
1898
|
+
*/
|
|
1899
|
+
cid: number;
|
|
1900
|
+
/**
|
|
1901
|
+
* @internal
|
|
1902
|
+
*/
|
|
1903
|
+
options: ComponentOptions;
|
|
1904
|
+
/**
|
|
1905
|
+
* @internal
|
|
1906
|
+
*/
|
|
1907
|
+
util: any;
|
|
1908
|
+
/**
|
|
1909
|
+
* @internal
|
|
1910
|
+
*/
|
|
1911
|
+
super: CompatVue;
|
|
1912
|
+
};
|
|
1913
|
+
//#endregion
|
|
1914
|
+
//#region packages/runtime-core/src/index.d.ts
|
|
1915
|
+
declare module "@vue/reactivity" {
|
|
1916
|
+
interface RefUnwrapBailTypes {
|
|
1917
|
+
runtimeCoreBailTypes: VNode | {
|
|
1918
|
+
$: ComponentInternalInstance;
|
|
1919
|
+
};
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1922
|
+
//#endregion
|
|
1923
|
+
//#region packages/runtime-dom/src/components/Transition.d.ts
|
|
1924
|
+
declare const TRANSITION = "transition";
|
|
1925
|
+
declare const ANIMATION = "animation";
|
|
1926
|
+
type AnimationTypes = typeof TRANSITION | typeof ANIMATION;
|
|
1927
|
+
interface TransitionProps extends BaseTransitionProps<Element> {
|
|
1928
|
+
name?: string;
|
|
1929
|
+
type?: AnimationTypes;
|
|
1930
|
+
css?: boolean;
|
|
1931
|
+
duration?: number | {
|
|
1932
|
+
enter: number;
|
|
1933
|
+
leave: number;
|
|
1934
|
+
};
|
|
1935
|
+
enterFromClass?: string;
|
|
1936
|
+
enterActiveClass?: string;
|
|
1937
|
+
enterToClass?: string;
|
|
1938
|
+
appearFromClass?: string;
|
|
1939
|
+
appearActiveClass?: string;
|
|
1940
|
+
appearToClass?: string;
|
|
1941
|
+
leaveFromClass?: string;
|
|
1942
|
+
leaveActiveClass?: string;
|
|
1943
|
+
leaveToClass?: string;
|
|
1944
|
+
}
|
|
1945
|
+
//#endregion
|
|
1946
|
+
//#region packages/runtime-dom/src/components/TransitionGroup.d.ts
|
|
1947
|
+
type TransitionGroupProps = Omit<TransitionProps, "mode"> & {
|
|
1948
|
+
tag?: string;
|
|
1949
|
+
moveClass?: string;
|
|
1950
|
+
};
|
|
1951
|
+
//#endregion
|
|
1952
|
+
//#region packages/runtime-dom/src/directives/vShow.d.ts
|
|
1953
|
+
declare const vShowOriginalDisplay: unique symbol;
|
|
1954
|
+
declare const vShowHidden: unique symbol;
|
|
1955
|
+
interface VShowElement extends HTMLElement {
|
|
1956
|
+
[vShowOriginalDisplay]?: string;
|
|
1957
|
+
[vShowHidden]?: boolean;
|
|
1958
|
+
}
|
|
1959
|
+
declare const vShow: ObjectDirective<VShowElement> & {
|
|
1960
|
+
name: "show";
|
|
1961
|
+
};
|
|
1962
|
+
//#endregion
|
|
1963
|
+
//#region packages/runtime-dom/src/directives/vOn.d.ts
|
|
1964
|
+
declare const systemModifiers: readonly ["ctrl", "shift", "alt", "meta"];
|
|
1965
|
+
type SystemModifiers = (typeof systemModifiers)[number];
|
|
1966
|
+
type CompatModifiers = keyof typeof keyNames;
|
|
1967
|
+
type VOnModifiers = SystemModifiers | ModifierGuards | CompatModifiers;
|
|
1968
|
+
type ModifierGuards = "shift" | "ctrl" | "alt" | "meta" | "left" | "right" | "stop" | "prevent" | "self" | "middle" | "exact";
|
|
1969
|
+
/**
|
|
1970
|
+
* @private
|
|
1971
|
+
*/
|
|
1972
|
+
declare const keyNames: Record<"esc" | "space" | "up" | "left" | "right" | "down" | "delete", string>;
|
|
1973
|
+
/**
|
|
1974
|
+
* @private
|
|
1975
|
+
*/
|
|
1976
|
+
type VOnDirective = Directive<any, any, VOnModifiers>;
|
|
1977
|
+
//#endregion
|
|
1978
|
+
//#region packages/runtime-dom/src/directives/vModel.d.ts
|
|
1979
|
+
type AssignerFn = (value: any) => void;
|
|
1980
|
+
declare const assignKey: unique symbol;
|
|
1981
|
+
type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & {
|
|
1982
|
+
[assignKey]: AssignerFn;
|
|
1983
|
+
_assigning?: boolean;
|
|
1984
|
+
}, any, Modifiers>;
|
|
1985
|
+
declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, "trim" | "number" | "lazy">;
|
|
1986
|
+
declare const vModelCheckbox: ModelDirective<HTMLInputElement>;
|
|
1987
|
+
declare const vModelRadio: ModelDirective<HTMLInputElement>;
|
|
1988
|
+
declare const vModelSelect: ModelDirective<HTMLSelectElement, "number">;
|
|
1989
|
+
declare const vModelDynamic: ObjectDirective<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>;
|
|
1990
|
+
type VModelDirective = typeof vModelText | typeof vModelCheckbox | typeof vModelSelect | typeof vModelRadio | typeof vModelDynamic;
|
|
1991
|
+
//#endregion
|
|
1992
|
+
//#region packages/runtime-dom/src/index.d.ts
|
|
1993
|
+
/**
|
|
1994
|
+
* This is a stub implementation to prevent the need to use dom types.
|
|
1995
|
+
*
|
|
1996
|
+
* To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`.
|
|
1997
|
+
*/
|
|
1998
|
+
type DomType<T> = typeof globalThis extends {
|
|
1999
|
+
window: unknown;
|
|
2000
|
+
} ? T : never;
|
|
2001
|
+
declare module "@vue/reactivity" {
|
|
2002
|
+
interface RefUnwrapBailTypes {
|
|
2003
|
+
runtimeDOMBailTypes: DomType<Node | Window>;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
declare module "@vue/runtime-core" {
|
|
2007
|
+
interface GlobalComponents {
|
|
2008
|
+
Transition: DefineComponent<TransitionProps>;
|
|
2009
|
+
TransitionGroup: DefineComponent<TransitionGroupProps>;
|
|
2010
|
+
}
|
|
2011
|
+
interface GlobalDirectives {
|
|
2012
|
+
vShow: typeof vShow;
|
|
2013
|
+
vOn: VOnDirective;
|
|
2014
|
+
vBind: VModelDirective;
|
|
2015
|
+
vIf: Directive<any, boolean>;
|
|
2016
|
+
vOnce: Directive;
|
|
2017
|
+
vSlot: Directive;
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
//#endregion
|
|
2021
|
+
//#region temp/packages/vue-compat/src/index.d.ts
|
|
3
2022
|
export declare const Vue: CompatVue;
|
|
4
|
-
|
|
5
|
-
export { Vue as default };
|
|
2023
|
+
//#endregion
|
|
2024
|
+
export { Vue as default };
|