@vue/compat 3.6.0-rc.5 → 3.6.0-rc.7
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 +686 -685
- package/dist/vue.cjs.js +974 -769
- package/dist/vue.cjs.prod.js +797 -653
- package/dist/vue.esm-browser.js +876 -688
- package/dist/vue.esm-browser.prod.js +7 -7
- package/dist/vue.esm-bundler.js +901 -705
- package/dist/vue.global.js +877 -689
- package/dist/vue.global.prod.js +7 -7
- package/dist/vue.runtime.esm-browser.js +876 -688
- package/dist/vue.runtime.esm-browser.prod.js +7 -7
- package/dist/vue.runtime.esm-bundler.js +901 -705
- package/dist/vue.runtime.global.js +877 -689
- package/dist/vue.runtime.global.prod.js +7 -7
- package/package.json +2 -2
package/dist/vue-compat.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
//#region packages/shared/src/slotFlags.d.ts
|
|
2
2
|
declare enum SlotFlags {
|
|
3
3
|
/**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
8
|
STABLE = 1,
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
14
|
DYNAMIC = 2,
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
21
|
FORWARDED = 3
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region packages/shared/src/typeUtils.d.ts
|
|
25
|
-
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
25
|
+
type Prettify<T> = { [K in keyof T]: T[K]; } & {};
|
|
26
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] };
|
|
27
|
+
type LooseRequired<T> = { [P in keyof (T & Required<T>)]: T[P]; };
|
|
28
28
|
type IfAny<T, Y, N> = 0 extends 1 & T ? Y : N;
|
|
29
29
|
//#endregion
|
|
30
30
|
//#region packages/reactivity/src/constants.d.ts
|
|
@@ -56,25 +56,25 @@ declare class EffectScope implements ReactiveNode {
|
|
|
56
56
|
subsTail: Link | undefined;
|
|
57
57
|
flags: number;
|
|
58
58
|
/**
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
61
|
cleanups: (() => void)[];
|
|
62
62
|
/**
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
65
|
cleanupsLength: number;
|
|
66
66
|
constructor(detached?: boolean);
|
|
67
67
|
get active(): boolean;
|
|
68
68
|
pause(): void;
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
* Resumes the effect scope, including all child scopes and effects.
|
|
71
|
+
*/
|
|
72
72
|
resume(): void;
|
|
73
73
|
run<T>(fn: () => T): T | undefined;
|
|
74
74
|
stop(): void;
|
|
75
75
|
/**
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
78
|
reset(): void;
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
@@ -133,12 +133,12 @@ declare class ReactiveEffect<T = any> implements ReactiveEffectOptions, Reactive
|
|
|
133
133
|
subsTail: Link | undefined;
|
|
134
134
|
flags: number;
|
|
135
135
|
/**
|
|
136
|
-
|
|
137
|
-
|
|
136
|
+
* @internal
|
|
137
|
+
*/
|
|
138
138
|
cleanups: (() => void)[];
|
|
139
139
|
/**
|
|
140
|
-
|
|
141
|
-
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
142
|
cleanupsLength: number;
|
|
143
143
|
onTrack?: (event: DebuggerEvent) => void;
|
|
144
144
|
onTrigger?: (event: DebuggerEvent) => void;
|
|
@@ -161,15 +161,15 @@ interface WritableComputedOptions<T, S = T> {
|
|
|
161
161
|
set: ComputedSetter<S>;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
|
-
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
165
|
-
* the main vue package
|
|
166
|
-
*/
|
|
164
|
+
* @private exported by @vue/reactivity for Vue core use, but not exported from
|
|
165
|
+
* the main vue package
|
|
166
|
+
*/
|
|
167
167
|
declare class ComputedRefImpl<T = any> implements ReactiveNode {
|
|
168
168
|
fn: ComputedGetter<T>;
|
|
169
169
|
private readonly setter;
|
|
170
170
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
171
|
+
* @internal
|
|
172
|
+
*/
|
|
173
173
|
_value: T | undefined;
|
|
174
174
|
subs: Link | undefined;
|
|
175
175
|
subsTail: Link | undefined;
|
|
@@ -177,24 +177,24 @@ declare class ComputedRefImpl<T = any> implements ReactiveNode {
|
|
|
177
177
|
depsTail: Link | undefined;
|
|
178
178
|
flags: ReactiveFlags;
|
|
179
179
|
/**
|
|
180
|
-
|
|
181
|
-
|
|
180
|
+
* @internal
|
|
181
|
+
*/
|
|
182
182
|
readonly __v_isRef = true;
|
|
183
183
|
/**
|
|
184
|
-
|
|
185
|
-
|
|
184
|
+
* @internal
|
|
185
|
+
*/
|
|
186
186
|
readonly __v_isReadonly: boolean;
|
|
187
187
|
get effect(): this;
|
|
188
188
|
get dep(): ReactiveNode;
|
|
189
189
|
/**
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
190
|
+
* @internal
|
|
191
|
+
* for backwards compat
|
|
192
|
+
*/
|
|
193
193
|
get _dirty(): boolean;
|
|
194
194
|
/**
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
* @internal
|
|
196
|
+
* for backwards compat
|
|
197
|
+
*/
|
|
198
198
|
set _dirty(v: boolean);
|
|
199
199
|
onTrack?: (event: DebuggerEvent) => void;
|
|
200
200
|
onTrigger?: (event: DebuggerEvent) => void;
|
|
@@ -212,20 +212,20 @@ interface ReactiveMarker {
|
|
|
212
212
|
}
|
|
213
213
|
type Reactive<T> = UnwrapNestedRefs<T> & (T extends readonly any[] ? ReactiveMarker : {});
|
|
214
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
|
-
*/
|
|
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
229
|
declare function reactive<T extends object>(target: T): Reactive<T>;
|
|
230
230
|
declare class ShallowReactiveBrandClass {
|
|
231
231
|
private __shallowReactiveBrand?;
|
|
@@ -241,10 +241,10 @@ interface Ref<T = any, S = T> {
|
|
|
241
241
|
get value(): T;
|
|
242
242
|
set value(_: S);
|
|
243
243
|
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
* Type differentiator only.
|
|
245
|
+
* We need this to be in public d.ts but don't want it to show up in IDE
|
|
246
|
+
* autocomplete, so we use a private Symbol instead.
|
|
247
|
+
*/
|
|
248
248
|
[RefSymbol]: true;
|
|
249
249
|
}
|
|
250
250
|
declare const ShallowRefMarker: unique symbol;
|
|
@@ -252,25 +252,25 @@ type ShallowRef<T = any, S = T> = Ref<T, S> & {
|
|
|
252
252
|
[ShallowRefMarker]?: true;
|
|
253
253
|
};
|
|
254
254
|
/**
|
|
255
|
-
* This is a special exported interface for other packages to declare
|
|
256
|
-
* additional types that should bail out for ref unwrapping. For example
|
|
257
|
-
* \@vue/runtime-dom can declare it like so in its d.ts:
|
|
258
|
-
*
|
|
259
|
-
* ``` ts
|
|
260
|
-
* declare module '@vue/reactivity' {
|
|
261
|
-
* export interface RefUnwrapBailTypes {
|
|
262
|
-
* runtimeDOMBailTypes: Node | Window
|
|
263
|
-
* }
|
|
264
|
-
* }
|
|
265
|
-
* ```
|
|
266
|
-
*/
|
|
255
|
+
* This is a special exported interface for other packages to declare
|
|
256
|
+
* additional types that should bail out for ref unwrapping. For example
|
|
257
|
+
* \@vue/runtime-dom can declare it like so in its d.ts:
|
|
258
|
+
*
|
|
259
|
+
* ``` ts
|
|
260
|
+
* declare module '@vue/reactivity' {
|
|
261
|
+
* export interface RefUnwrapBailTypes {
|
|
262
|
+
* runtimeDOMBailTypes: Node | Window
|
|
263
|
+
* }
|
|
264
|
+
* }
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
267
|
interface RefUnwrapBailTypes {}
|
|
268
|
-
type ShallowUnwrapRef<T> = T extends ShallowReactiveBrand ? T : { [K in keyof T]: DistributeRef<T[K]
|
|
268
|
+
type ShallowUnwrapRef<T> = T extends ShallowReactiveBrand ? T : { [K in keyof T]: DistributeRef<T[K]>; };
|
|
269
269
|
type DistributeRef<T> = T extends Ref<infer V, unknown> ? V : T;
|
|
270
270
|
type UnwrapRef<T> = T extends ShallowRef<infer V, unknown> ? V : T extends Ref<infer V, unknown> ? UnwrapRefSimple<V> : UnwrapRefSimple<T>;
|
|
271
271
|
type UnwrapRefSimple<T> = T extends Builtin | Ref | RefUnwrapBailTypes[keyof RefUnwrapBailTypes] | {
|
|
272
272
|
[RawSymbol]?: true;
|
|
273
|
-
} ? T : T extends ShallowReactiveBrand ? 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]
|
|
273
|
+
} ? T : T extends ShallowReactiveBrand ? 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 ? { [P in keyof T]: P extends symbol ? T[P] : UnwrapRef<T[P]>; } : T;
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region packages/reactivity/src/watch.d.ts
|
|
276
276
|
type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
|
|
@@ -287,24 +287,24 @@ declare const SlotSymbol: unique symbol;
|
|
|
287
287
|
type SlotsType<T extends Record<string, any> = Record<string, any>> = {
|
|
288
288
|
[SlotSymbol]?: T;
|
|
289
289
|
};
|
|
290
|
-
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 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]>; }>>;
|
|
291
291
|
type RawSlots = {
|
|
292
292
|
[name: string]: unknown;
|
|
293
293
|
$stable?: boolean;
|
|
294
294
|
/**
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
295
|
+
* for tracking slot owner instance. This is attached during
|
|
296
|
+
* normalizeChildren when the component vnode is created.
|
|
297
|
+
* @internal
|
|
298
|
+
*/
|
|
299
299
|
_ctx?: ComponentInternalInstance | null;
|
|
300
300
|
/**
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
301
|
+
* indicates compiler generated slots
|
|
302
|
+
* we use a reserved property instead of a vnode patchFlag because the slots
|
|
303
|
+
* object may be directly passed down to a child component in a manual
|
|
304
|
+
* render function, and the optimization hint need to be on the slot object
|
|
305
|
+
* itself to be preserved.
|
|
306
|
+
* @internal
|
|
307
|
+
*/
|
|
308
308
|
_?: SlotFlags;
|
|
309
309
|
};
|
|
310
310
|
//#endregion
|
|
@@ -312,39 +312,39 @@ type RawSlots = {
|
|
|
312
312
|
declare enum SchedulerJobFlags {
|
|
313
313
|
QUEUED = 1,
|
|
314
314
|
/**
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
315
|
+
* Indicates whether the effect is allowed to recursively trigger itself
|
|
316
|
+
* when managed by the scheduler.
|
|
317
|
+
*
|
|
318
|
+
* By default, a job cannot trigger itself because some built-in method calls,
|
|
319
|
+
* e.g. Array.prototype.push actually performs reads as well (#1740) which
|
|
320
|
+
* can lead to confusing infinite loops.
|
|
321
|
+
* The allowed cases are component update functions and watch callbacks.
|
|
322
|
+
* Component update functions may update child component props, which in turn
|
|
323
|
+
* trigger flush: "pre" watch callbacks that mutates state that the parent
|
|
324
|
+
* relies on (#1801). Watch callbacks doesn't track its dependencies so if it
|
|
325
|
+
* triggers itself again, it's likely intentional and it is the user's
|
|
326
|
+
* responsibility to perform recursive state mutation that eventually
|
|
327
|
+
* stabilizes (#1727).
|
|
328
|
+
*/
|
|
329
329
|
ALLOW_RECURSE = 2,
|
|
330
330
|
DISPOSED = 4,
|
|
331
331
|
/**
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
332
|
+
* Requeue a Suspense effect if its pending branch is discarded.
|
|
333
|
+
* @internal
|
|
334
|
+
*/
|
|
335
335
|
REQUEUE_ON_SUSPENSE_DISCARD = 8
|
|
336
336
|
}
|
|
337
337
|
interface SchedulerJob extends Function {
|
|
338
338
|
order?: number;
|
|
339
339
|
/**
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
340
|
+
* flags can technically be undefined, but it can still be used in bitwise
|
|
341
|
+
* operations just like 0.
|
|
342
|
+
*/
|
|
343
343
|
flags?: SchedulerJobFlags;
|
|
344
344
|
/**
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
345
|
+
* Attached by renderer.ts when setting up a component's render effect
|
|
346
|
+
* Used to obtain component information when reporting max recursive updates.
|
|
347
|
+
*/
|
|
348
348
|
i?: GenericComponentInstance;
|
|
349
349
|
}
|
|
350
350
|
declare function nextTick(): Promise<void>;
|
|
@@ -352,7 +352,7 @@ declare function nextTick<T, R>(this: T, fn: (this: T) => R | Promise<R>): Promi
|
|
|
352
352
|
//#endregion
|
|
353
353
|
//#region packages/runtime-core/src/componentProps.d.ts
|
|
354
354
|
type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
|
355
|
-
type ComponentObjectPropsOptions<P = Data> = { [K in keyof P]: Prop<P[K]> | null };
|
|
355
|
+
type ComponentObjectPropsOptions<P = Data> = { [K in keyof P]: Prop<P[K]> | null; };
|
|
356
356
|
type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
|
357
357
|
type DefaultFactory<T> = (props: Data) => T | null | undefined;
|
|
358
358
|
interface PropOptions<T = any, D = T> {
|
|
@@ -361,12 +361,12 @@ interface PropOptions<T = any, D = T> {
|
|
|
361
361
|
default?: D | DefaultFactory<D> | null | undefined | object;
|
|
362
362
|
validator?(value: unknown, props: Data): boolean;
|
|
363
363
|
/**
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
* @internal
|
|
365
|
+
*/
|
|
366
366
|
skipCheck?: boolean;
|
|
367
367
|
/**
|
|
368
|
-
|
|
369
|
-
|
|
368
|
+
* @internal
|
|
369
|
+
*/
|
|
370
370
|
skipFactory?: boolean;
|
|
371
371
|
}
|
|
372
372
|
type PropType<T> = PropConstructor<T> | (PropConstructor<T> | null)[];
|
|
@@ -388,7 +388,7 @@ type RequiredKeys<T> = { [K in keyof T]: T[K] extends {
|
|
|
388
388
|
type: BooleanConstructor;
|
|
389
389
|
} ? T[K] extends {
|
|
390
390
|
default: undefined | (() => undefined);
|
|
391
|
-
} ? never : K : never }[keyof T];
|
|
391
|
+
} ? never : K : never; }[keyof T];
|
|
392
392
|
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
393
393
|
type DefaultKeys<T> = { [K in keyof T]: T[K] extends {
|
|
394
394
|
default: any;
|
|
@@ -397,7 +397,7 @@ type DefaultKeys<T> = { [K in keyof T]: T[K] extends {
|
|
|
397
397
|
} ? T[K] extends {
|
|
398
398
|
type: BooleanConstructor;
|
|
399
399
|
required: true;
|
|
400
|
-
} ? never : K : never }[keyof T];
|
|
400
|
+
} ? never : K : never; }[keyof T];
|
|
401
401
|
type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends true ? any : null : [T] extends [{
|
|
402
402
|
type: null | true;
|
|
403
403
|
}] ? any : [T] extends [ObjectConstructor | {
|
|
@@ -410,30 +410,30 @@ type InferPropType<T, NullAsAny = true> = [T] extends [null] ? NullAsAny extends
|
|
|
410
410
|
type: (infer U)[];
|
|
411
411
|
}] ? 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;
|
|
412
412
|
/**
|
|
413
|
-
* Extract prop types from a runtime props options object.
|
|
414
|
-
* The extracted types are **internal** - i.e. the resolved props received by
|
|
415
|
-
* the component.
|
|
416
|
-
* - Boolean props are always present
|
|
417
|
-
* - Props with default values are always present
|
|
418
|
-
*
|
|
419
|
-
* To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
|
|
420
|
-
*/
|
|
413
|
+
* Extract prop types from a runtime props options object.
|
|
414
|
+
* The extracted types are **internal** - i.e. the resolved props received by
|
|
415
|
+
* the component.
|
|
416
|
+
* - Boolean props are always present
|
|
417
|
+
* - Props with default values are always present
|
|
418
|
+
*
|
|
419
|
+
* To extract accepted props from the parent, use {@link ExtractPublicPropTypes}.
|
|
420
|
+
*/
|
|
421
421
|
type ExtractPropTypes<O> = { [K in keyof Pick<O, RequiredKeys<O>>]: O[K] extends {
|
|
422
422
|
default: any;
|
|
423
|
-
} ? Exclude<InferPropType<O[K]>, undefined> : InferPropType<O[K]
|
|
423
|
+
} ? Exclude<InferPropType<O[K]>, undefined> : InferPropType<O[K]>; } & { [K in keyof Pick<O, OptionalKeys<O>>]?: InferPropType<O[K]>; };
|
|
424
424
|
declare enum BooleanFlags {
|
|
425
425
|
shouldCast = 0,
|
|
426
426
|
shouldCastTrue = 1
|
|
427
427
|
}
|
|
428
|
-
type ExtractDefaultPropTypes<O> = O extends object ? { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]
|
|
428
|
+
type ExtractDefaultPropTypes<O> = O extends object ? { [K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>; } : {};
|
|
429
429
|
type NormalizedProp = PropOptions & {
|
|
430
430
|
[BooleanFlags.shouldCast]?: boolean;
|
|
431
431
|
[BooleanFlags.shouldCastTrue]?: boolean;
|
|
432
432
|
};
|
|
433
433
|
/**
|
|
434
|
-
* normalized value is a tuple of the actual normalized options
|
|
435
|
-
* and an array of prop keys that need value casting (booleans and defaults)
|
|
436
|
-
*/
|
|
434
|
+
* normalized value is a tuple of the actual normalized options
|
|
435
|
+
* and an array of prop keys that need value casting (booleans and defaults)
|
|
436
|
+
*/
|
|
437
437
|
type NormalizedProps = Record<string, NormalizedProp>;
|
|
438
438
|
type NormalizedPropsOptions = [NormalizedProps, string[]] | [];
|
|
439
439
|
//#endregion
|
|
@@ -443,9 +443,9 @@ type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
|
|
|
443
443
|
//#region packages/runtime-core/src/componentEmits.d.ts
|
|
444
444
|
type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null | any[]>;
|
|
445
445
|
type EmitsOptions = ObjectEmitsOptions | string[];
|
|
446
|
-
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[] : T[K] extends any[] ? T[K] : never) => any } : {};
|
|
447
|
-
type ShortEmitsToObject<E> = E extends Record<string, any[]> ? { [K in keyof E]: (...args: E[K]) => any } : E;
|
|
448
|
-
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]>;
|
|
446
|
+
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[] : T[K] extends any[] ? T[K] : never) => any; } : {};
|
|
447
|
+
type ShortEmitsToObject<E> = E extends Record<string, any[]> ? { [K in keyof E]: (...args: E[K]) => any; } : E;
|
|
448
|
+
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]>;
|
|
449
449
|
//#endregion
|
|
450
450
|
//#region packages/runtime-core/src/directives.d.ts
|
|
451
451
|
interface DirectiveBinding<Value = any, Modifiers extends string = string, Arg = any> {
|
|
@@ -460,10 +460,10 @@ type DirectiveHook<HostElement = any, Prev = VNode<any, HostElement> | null, Val
|
|
|
460
460
|
type SSRDirectiveHook<Value = any, Modifiers extends string = string, Arg = any> = (binding: DirectiveBinding<Value, Modifiers, Arg>, vnode: VNode) => Data | undefined;
|
|
461
461
|
interface ObjectDirective<HostElement = any, Value = any, Modifiers extends string = string, Arg = any> {
|
|
462
462
|
/**
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
463
|
+
* @internal without this, ts-expect-error in directives.test-d.ts somehow
|
|
464
|
+
* fails when running tsc, but passes in IDE and when testing against built
|
|
465
|
+
* dts. Could be a TS bug.
|
|
466
|
+
*/
|
|
467
467
|
__mod?: Modifiers;
|
|
468
468
|
created?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
469
469
|
beforeMount?: DirectiveHook<HostElement, null, Value, Modifiers, Arg>;
|
|
@@ -481,30 +481,30 @@ type DirectiveModifiers<K extends string = string> = Partial<Record<K, boolean>>
|
|
|
481
481
|
//#endregion
|
|
482
482
|
//#region packages/runtime-core/src/componentPublicInstance.d.ts
|
|
483
483
|
/**
|
|
484
|
-
* Custom properties added to component instances in any way and can be accessed through `this`
|
|
485
|
-
*
|
|
486
|
-
* @example
|
|
487
|
-
* Here is an example of adding a property `$router` to every component instance:
|
|
488
|
-
* ```ts
|
|
489
|
-
* import { createApp } from 'vue'
|
|
490
|
-
* import { Router, createRouter } from 'vue-router'
|
|
491
|
-
*
|
|
492
|
-
* declare module 'vue' {
|
|
493
|
-
* interface ComponentCustomProperties {
|
|
494
|
-
* $router: Router
|
|
495
|
-
* }
|
|
496
|
-
* }
|
|
497
|
-
*
|
|
498
|
-
* // effectively adding the router to every component instance
|
|
499
|
-
* const app = createApp({})
|
|
500
|
-
* const router = createRouter()
|
|
501
|
-
* app.config.globalProperties.$router = router
|
|
502
|
-
*
|
|
503
|
-
* const vm = app.mount('#app')
|
|
504
|
-
* // we can access the router from the instance
|
|
505
|
-
* vm.$router.push('/')
|
|
506
|
-
* ```
|
|
507
|
-
*/
|
|
484
|
+
* Custom properties added to component instances in any way and can be accessed through `this`
|
|
485
|
+
*
|
|
486
|
+
* @example
|
|
487
|
+
* Here is an example of adding a property `$router` to every component instance:
|
|
488
|
+
* ```ts
|
|
489
|
+
* import { createApp } from 'vue'
|
|
490
|
+
* import { Router, createRouter } from 'vue-router'
|
|
491
|
+
*
|
|
492
|
+
* declare module 'vue' {
|
|
493
|
+
* interface ComponentCustomProperties {
|
|
494
|
+
* $router: Router
|
|
495
|
+
* }
|
|
496
|
+
* }
|
|
497
|
+
*
|
|
498
|
+
* // effectively adding the router to every component instance
|
|
499
|
+
* const app = createApp({})
|
|
500
|
+
* const router = createRouter()
|
|
501
|
+
* app.config.globalProperties.$router = router
|
|
502
|
+
*
|
|
503
|
+
* const vm = app.mount('#app')
|
|
504
|
+
* // we can access the router from the instance
|
|
505
|
+
* vm.$router.push('/')
|
|
506
|
+
* ```
|
|
507
|
+
*/
|
|
508
508
|
interface ComponentCustomProperties {}
|
|
509
509
|
type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
|
|
510
510
|
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;
|
|
@@ -521,12 +521,12 @@ type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props,
|
|
|
521
521
|
new (...args: any[]): T;
|
|
522
522
|
};
|
|
523
523
|
/**
|
|
524
|
-
* This is the same as `CreateComponentPublicInstance` but adds local components,
|
|
525
|
-
* global directives, exposed, and provide inference.
|
|
526
|
-
* It changes the arguments order so that we don't need to repeat mixin
|
|
527
|
-
* inference everywhere internally, but it has to be a new type to avoid
|
|
528
|
-
* breaking types that relies on previous arguments order (#10842)
|
|
529
|
-
*/
|
|
524
|
+
* This is the same as `CreateComponentPublicInstance` but adds local components,
|
|
525
|
+
* global directives, exposed, and provide inference.
|
|
526
|
+
* It changes the arguments order so that we don't need to repeat mixin
|
|
527
|
+
* inference everywhere internally, but it has to be a new type to avoid
|
|
528
|
+
* breaking types that relies on previous arguments order (#10842)
|
|
529
|
+
*/
|
|
530
530
|
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 = 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>;
|
|
531
531
|
type ExposedKeys<T, Exposed extends string & keyof T> = "" extends Exposed ? T : Pick<T, Exposed>;
|
|
532
532
|
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 = any> = {
|
|
@@ -571,15 +571,15 @@ interface SuspenseProps {
|
|
|
571
571
|
onPending?: () => void;
|
|
572
572
|
onFallback?: () => void;
|
|
573
573
|
/**
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
574
|
+
* Switch to fallback content if it takes longer than `timeout` milliseconds to render the new default content.
|
|
575
|
+
* A `timeout` value of `0` will cause the fallback content to be displayed immediately when default content is replaced.
|
|
576
|
+
*/
|
|
577
577
|
timeout?: string | number;
|
|
578
578
|
/**
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
579
|
+
* Allow suspense to be captured by parent suspense
|
|
580
|
+
*
|
|
581
|
+
* @default false
|
|
582
|
+
*/
|
|
583
583
|
suspensible?: boolean;
|
|
584
584
|
}
|
|
585
585
|
declare const SuspenseImpl: {
|
|
@@ -774,36 +774,36 @@ declare function configureCompat(config: CompatConfig): void;
|
|
|
774
774
|
//#endregion
|
|
775
775
|
//#region packages/runtime-core/src/componentOptions.d.ts
|
|
776
776
|
/**
|
|
777
|
-
* Interface for declaring custom options.
|
|
778
|
-
*
|
|
779
|
-
* @example
|
|
780
|
-
* ```ts
|
|
781
|
-
* declare module 'vue' {
|
|
782
|
-
* interface ComponentCustomOptions {
|
|
783
|
-
* beforeRouteUpdate?(
|
|
784
|
-
* to: Route,
|
|
785
|
-
* from: Route,
|
|
786
|
-
* next: () => void
|
|
787
|
-
* ): void
|
|
788
|
-
* }
|
|
789
|
-
* }
|
|
790
|
-
* ```
|
|
791
|
-
*/
|
|
777
|
+
* Interface for declaring custom options.
|
|
778
|
+
*
|
|
779
|
+
* @example
|
|
780
|
+
* ```ts
|
|
781
|
+
* declare module 'vue' {
|
|
782
|
+
* interface ComponentCustomOptions {
|
|
783
|
+
* beforeRouteUpdate?(
|
|
784
|
+
* to: Route,
|
|
785
|
+
* from: Route,
|
|
786
|
+
* next: () => void
|
|
787
|
+
* ): void
|
|
788
|
+
* }
|
|
789
|
+
* }
|
|
790
|
+
* ```
|
|
791
|
+
*/
|
|
792
792
|
interface ComponentCustomOptions {}
|
|
793
793
|
/**
|
|
794
|
-
* Registry for additional render result types.
|
|
795
|
-
*
|
|
796
|
-
* @example
|
|
797
|
-
* ```ts
|
|
798
|
-
* import type { VaporRenderResult } from 'vue'
|
|
799
|
-
*
|
|
800
|
-
* declare module 'vue' {
|
|
801
|
-
* interface RenderResultExtensions {
|
|
802
|
-
* vapor: VaporRenderResult
|
|
803
|
-
* }
|
|
804
|
-
* }
|
|
805
|
-
* ```
|
|
806
|
-
*/
|
|
794
|
+
* Registry for additional render result types.
|
|
795
|
+
*
|
|
796
|
+
* @example
|
|
797
|
+
* ```ts
|
|
798
|
+
* import type { VaporRenderResult } from 'vue'
|
|
799
|
+
*
|
|
800
|
+
* declare module 'vue' {
|
|
801
|
+
* interface RenderResultExtensions {
|
|
802
|
+
* vapor: VaporRenderResult
|
|
803
|
+
* }
|
|
804
|
+
* }
|
|
805
|
+
* ```
|
|
806
|
+
*/
|
|
807
807
|
interface RenderResultExtensions {}
|
|
808
808
|
type RenderResult = VNodeChild | RenderResultExtensions[keyof RenderResultExtensions] | RenderResult[];
|
|
809
809
|
type RenderFunction = () => RenderResult;
|
|
@@ -821,16 +821,16 @@ interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions,
|
|
|
821
821
|
serverPrefetch?(): void | Promise<any>;
|
|
822
822
|
compilerOptions?: RuntimeCompilerOptions;
|
|
823
823
|
/**
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
824
|
+
* SSR only. This is produced by compiler-ssr and attached in compiler-sfc
|
|
825
|
+
* not user facing, so the typing is lax and for test only.
|
|
826
|
+
* @internal
|
|
827
|
+
*/
|
|
828
828
|
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;
|
|
829
829
|
/**
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
830
|
+
* Only generated by compiler-sfc to mark a ssr render function inlined and
|
|
831
|
+
* returned from setup()
|
|
832
|
+
* @internal
|
|
833
|
+
*/
|
|
834
834
|
__ssrInlineRender?: boolean;
|
|
835
835
|
call?: (this: unknown, ...args: unknown[]) => never;
|
|
836
836
|
__isFragment?: never;
|
|
@@ -839,8 +839,8 @@ interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions,
|
|
|
839
839
|
__defaults?: Defaults;
|
|
840
840
|
}
|
|
841
841
|
/**
|
|
842
|
-
* Subset of compiler options that makes sense for the runtime.
|
|
843
|
-
*/
|
|
842
|
+
* Subset of compiler options that makes sense for the runtime.
|
|
843
|
+
*/
|
|
844
844
|
interface RuntimeCompilerOptions {
|
|
845
845
|
isCustomElement?: (tag: string) => boolean;
|
|
846
846
|
whitespace?: "preserve" | "condense";
|
|
@@ -855,7 +855,7 @@ interface MethodOptions {
|
|
|
855
855
|
}
|
|
856
856
|
type ExtractComputedReturns<T extends any> = { [key in keyof T]: T[key] extends {
|
|
857
857
|
get: (...args: any[]) => infer TReturn;
|
|
858
|
-
} ? TReturn : T[key] extends ((...args: any[]) => infer TReturn) ? TReturn : never };
|
|
858
|
+
} ? TReturn : T[key] extends ((...args: any[]) => infer TReturn) ? TReturn : never; };
|
|
859
859
|
type ObjectWatchOptionItem = {
|
|
860
860
|
handler: WatchCallback | string;
|
|
861
861
|
} & WatchOptions;
|
|
@@ -869,7 +869,7 @@ type ObjectInjectOptions = Record<string | symbol, string | symbol | {
|
|
|
869
869
|
from?: string | symbol;
|
|
870
870
|
default?: unknown;
|
|
871
871
|
}>;
|
|
872
|
-
type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? { [K in T[number]]?: unknown } : T extends ObjectInjectOptions ? { [K in keyof T]?: unknown } : never;
|
|
872
|
+
type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? { [K in T[number]]?: unknown; } : T extends ObjectInjectOptions ? { [K in keyof T]?: unknown; } : never;
|
|
873
873
|
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> {
|
|
874
874
|
compatConfig?: CompatConfig;
|
|
875
875
|
[key: string]: any;
|
|
@@ -900,18 +900,18 @@ interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOpt
|
|
|
900
900
|
renderTriggered?: DebuggerHook;
|
|
901
901
|
errorCaptured?: ErrorCapturedHook;
|
|
902
902
|
/**
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
903
|
+
* runtime compile only
|
|
904
|
+
* @deprecated use `compilerOptions.delimiters` instead.
|
|
905
|
+
*/
|
|
906
906
|
delimiters?: [string, string];
|
|
907
907
|
/**
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
908
|
+
* #3468
|
|
909
|
+
*
|
|
910
|
+
* type-only, used to assist Mixin's type inference,
|
|
911
|
+
* TypeScript will try to simplify the inferred `Mixin` type,
|
|
912
|
+
* with the `__differentiator`, TypeScript won't be able to combine different mixins,
|
|
913
|
+
* because the `__differentiator` will be different
|
|
914
|
+
*/
|
|
915
915
|
__differentiator?: keyof D | keyof C | keyof M;
|
|
916
916
|
}
|
|
917
917
|
type MergedHook<T = () => void> = T | T[];
|
|
@@ -924,9 +924,11 @@ type MergedComponentOptionsOverride = {
|
|
|
924
924
|
beforeUpdate?: MergedHook;
|
|
925
925
|
updated?: MergedHook;
|
|
926
926
|
activated?: MergedHook;
|
|
927
|
-
deactivated?: MergedHook;
|
|
927
|
+
deactivated?: MergedHook;
|
|
928
|
+
/** @deprecated use `beforeUnmount` instead */
|
|
928
929
|
beforeDestroy?: MergedHook;
|
|
929
|
-
beforeUnmount?: MergedHook;
|
|
930
|
+
beforeUnmount?: MergedHook;
|
|
931
|
+
/** @deprecated use `unmounted` instead */
|
|
930
932
|
destroyed?: MergedHook;
|
|
931
933
|
unmounted?: MergedHook;
|
|
932
934
|
renderTracked?: MergedHook<DebuggerHook>;
|
|
@@ -969,11 +971,11 @@ interface App<HostElement = any> {
|
|
|
969
971
|
onUnmount(cb: () => void): void;
|
|
970
972
|
provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
|
|
971
973
|
/**
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
974
|
+
* Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
|
|
975
|
+
* to variables provided via `app.provide()`.
|
|
976
|
+
*
|
|
977
|
+
* @param fn - function to run with the app as active instance
|
|
978
|
+
*/
|
|
977
979
|
runWithContext<T>(fn: () => T): T;
|
|
978
980
|
_uid: number;
|
|
979
981
|
_component: GenericComponent;
|
|
@@ -982,40 +984,40 @@ interface App<HostElement = any> {
|
|
|
982
984
|
_context: AppContext;
|
|
983
985
|
_instance: GenericComponentInstance | null;
|
|
984
986
|
/**
|
|
985
|
-
|
|
986
|
-
|
|
987
|
+
* @internal custom element vnode
|
|
988
|
+
*/
|
|
987
989
|
_ceVNode?: VNode;
|
|
988
990
|
/**
|
|
989
|
-
|
|
990
|
-
|
|
991
|
+
* @internal vapor custom element instance
|
|
992
|
+
*/
|
|
991
993
|
_ceComponent?: GenericComponentInstance | null;
|
|
992
994
|
/**
|
|
993
|
-
|
|
994
|
-
|
|
995
|
+
* v2 compat only
|
|
996
|
+
*/
|
|
995
997
|
filter?(name: string): Function | undefined;
|
|
996
998
|
filter?(name: string, filter: Function): this;
|
|
997
999
|
/**
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
+
* @internal v3 compat only
|
|
1001
|
+
*/
|
|
1000
1002
|
_createRoot?(options: ComponentOptions): ComponentPublicInstance;
|
|
1001
1003
|
}
|
|
1002
1004
|
type OptionMergeFunction = (to: unknown, from: unknown) => any;
|
|
1003
1005
|
/**
|
|
1004
|
-
* Shared app config between vdom and vapor
|
|
1005
|
-
*/
|
|
1006
|
+
* Shared app config between vdom and vapor
|
|
1007
|
+
*/
|
|
1006
1008
|
interface GenericAppConfig {
|
|
1007
1009
|
performance?: boolean;
|
|
1008
1010
|
errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
|
|
1009
1011
|
warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
|
|
1010
1012
|
/**
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1013
|
+
* Whether to throw unhandled errors in production.
|
|
1014
|
+
* Default is `false` to avoid crashing on any error (and only logs it)
|
|
1015
|
+
* But in some cases, e.g. SSR, throwing might be more desirable.
|
|
1016
|
+
*/
|
|
1015
1017
|
throwUnhandledErrorInProduction?: boolean;
|
|
1016
1018
|
/**
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
+
* Prefix for all useId() calls within this app
|
|
1020
|
+
*/
|
|
1019
1021
|
idPrefix?: string;
|
|
1020
1022
|
}
|
|
1021
1023
|
interface AppConfig extends GenericAppConfig {
|
|
@@ -1023,41 +1025,51 @@ interface AppConfig extends GenericAppConfig {
|
|
|
1023
1025
|
optionMergeStrategies: Record<string, OptionMergeFunction>;
|
|
1024
1026
|
globalProperties: ComponentCustomProperties & Record<string, any>;
|
|
1025
1027
|
/**
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1028
|
+
* Options to pass to `@vue/compiler-dom`.
|
|
1029
|
+
* Only supported in runtime compiler build.
|
|
1030
|
+
*/
|
|
1029
1031
|
compilerOptions: RuntimeCompilerOptions;
|
|
1030
1032
|
/**
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
+
* @deprecated use config.compilerOptions.isCustomElement
|
|
1034
|
+
*/
|
|
1033
1035
|
isCustomElement?: (tag: string) => boolean;
|
|
1034
1036
|
}
|
|
1035
1037
|
/**
|
|
1036
|
-
* The vapor in vdom implementation is in runtime-vapor/src/vdomInterop.ts
|
|
1037
|
-
*/
|
|
1038
|
+
* The vapor in vdom implementation is in runtime-vapor/src/vdomInterop.ts
|
|
1039
|
+
*/
|
|
1038
1040
|
interface VaporInVdomInterface {
|
|
1039
|
-
mount(vnode: VNode, container:
|
|
1041
|
+
mount(vnode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, onBeforeMount?: () => void, onVnodeBeforeMount?: () => void): GenericComponentInstance;
|
|
1040
1042
|
update(n1: VNode, n2: VNode, shouldUpdate: boolean, onBeforeUpdate?: () => void, onVnodeBeforeUpdate?: () => void): void;
|
|
1041
1043
|
unmount(vnode: VNode, doRemove: boolean | undefined, parentSuspense: SuspenseBoundary | null): void;
|
|
1042
|
-
move(vnode: VNode, container:
|
|
1043
|
-
slot(n1: VNode | null, n2: VNode, container:
|
|
1044
|
-
hydrate(vnode: VNode, node:
|
|
1045
|
-
hydrateSlot(vnode: VNode, node:
|
|
1046
|
-
activate(vnode: VNode, container:
|
|
1047
|
-
deactivate(vnode: VNode, container:
|
|
1044
|
+
move(vnode: VNode, container: RendererElement, anchor: RendererNode | null, moveType: MoveType, parentSuspense: SuspenseBoundary | null): void;
|
|
1045
|
+
slot(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null): void;
|
|
1046
|
+
hydrate(vnode: VNode, node: Node, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, onBeforeMount?: () => void, onVnodeBeforeMount?: () => void): Node | null;
|
|
1047
|
+
hydrateSlot(vnode: VNode, node: Node, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null): Node | null;
|
|
1048
|
+
activate(vnode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance, parentSuspense: SuspenseBoundary | null): void;
|
|
1049
|
+
deactivate(vnode: VNode, container: RendererElement, parentSuspense: SuspenseBoundary | null): void;
|
|
1048
1050
|
setTransitionHooks(component: ComponentInternalInstance, transition: TransitionHooks): void;
|
|
1049
1051
|
}
|
|
1050
1052
|
/**
|
|
1051
|
-
*
|
|
1052
|
-
|
|
1053
|
+
* Options for rendering a VDOM slot inside vapor. `flags` carries the
|
|
1054
|
+
* outlet's VaporSlotFlags describing its position in the fallback chain;
|
|
1055
|
+
* see renderVDOMSlot.
|
|
1056
|
+
*/
|
|
1057
|
+
interface VdomSlotOptions {
|
|
1058
|
+
fallback?: (...args: any[]) => any;
|
|
1059
|
+
flags?: number;
|
|
1060
|
+
adoptAnchor?: Node;
|
|
1061
|
+
}
|
|
1062
|
+
/**
|
|
1063
|
+
* The vdom in vapor implementation is in runtime-vapor/src/vdomInterop.ts
|
|
1064
|
+
*/
|
|
1053
1065
|
interface VdomInVaporInterface {
|
|
1054
1066
|
mount: (component: ConcreteComponent, parentComponent: any, props?: any, slots?: any, once?: boolean) => any;
|
|
1055
|
-
slot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any,
|
|
1067
|
+
slot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, options?: VdomSlotOptions) => any;
|
|
1056
1068
|
mountVNode: (vnode: VNode, parentComponent: any, getFallthroughAttrs?: () => Record<string, any>) => any;
|
|
1057
1069
|
}
|
|
1058
1070
|
/**
|
|
1059
|
-
* Minimal app context shared between vdom and vapor
|
|
1060
|
-
*/
|
|
1071
|
+
* Minimal app context shared between vdom and vapor
|
|
1072
|
+
*/
|
|
1061
1073
|
interface GenericAppContext {
|
|
1062
1074
|
app: App;
|
|
1063
1075
|
config: GenericAppConfig;
|
|
@@ -1065,17 +1077,17 @@ interface GenericAppContext {
|
|
|
1065
1077
|
components?: Record<string, Component>;
|
|
1066
1078
|
directives?: Record<string, Directive>;
|
|
1067
1079
|
/**
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1080
|
+
* HMR only
|
|
1081
|
+
* @internal
|
|
1082
|
+
*/
|
|
1071
1083
|
reload?: () => void;
|
|
1072
1084
|
/**
|
|
1073
|
-
|
|
1074
|
-
|
|
1085
|
+
* @internal vapor interop only
|
|
1086
|
+
*/
|
|
1075
1087
|
vapor?: VaporInVdomInterface;
|
|
1076
1088
|
/**
|
|
1077
|
-
|
|
1078
|
-
|
|
1089
|
+
* @internal vdom interop only
|
|
1090
|
+
*/
|
|
1079
1091
|
vdom?: VdomInVaporInterface;
|
|
1080
1092
|
}
|
|
1081
1093
|
interface AppContext extends GenericAppContext {
|
|
@@ -1084,26 +1096,26 @@ interface AppContext extends GenericAppContext {
|
|
|
1084
1096
|
directives: Record<string, Directive>;
|
|
1085
1097
|
mixins: ComponentOptions[];
|
|
1086
1098
|
/**
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1099
|
+
* Cache for merged/normalized component options
|
|
1100
|
+
* Each app instance has its own cache because app-level global mixins and
|
|
1101
|
+
* optionMergeStrategies can affect merge behavior.
|
|
1102
|
+
* @internal
|
|
1103
|
+
*/
|
|
1092
1104
|
optionsCache: WeakMap<ComponentOptions, MergedComponentOptions>;
|
|
1093
1105
|
/**
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1106
|
+
* Cache for normalized props options
|
|
1107
|
+
* @internal
|
|
1108
|
+
*/
|
|
1097
1109
|
propsCache: WeakMap<ConcreteComponent, NormalizedPropsOptions>;
|
|
1098
1110
|
/**
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1111
|
+
* Cache for normalized emits options
|
|
1112
|
+
* @internal
|
|
1113
|
+
*/
|
|
1102
1114
|
emitsCache: WeakMap<ConcreteComponent, ObjectEmitsOptions | null>;
|
|
1103
1115
|
/**
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1116
|
+
* v2 compat only
|
|
1117
|
+
* @internal
|
|
1118
|
+
*/
|
|
1107
1119
|
filters?: Record<string, Function>;
|
|
1108
1120
|
}
|
|
1109
1121
|
type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
@@ -1111,7 +1123,7 @@ type ObjectPlugin<Options = any[]> = {
|
|
|
1111
1123
|
install: PluginInstallFunction<Options>;
|
|
1112
1124
|
};
|
|
1113
1125
|
type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>;
|
|
1114
|
-
type Plugin<Options = any[], P extends unknown[] =
|
|
1126
|
+
type Plugin<Options = any[], P extends unknown[] = Options extends unknown[] ? Options : [Options]> = FunctionPlugin<P> | ObjectPlugin<P>;
|
|
1115
1127
|
//#endregion
|
|
1116
1128
|
//#region packages/runtime-core/src/components/Teleport.d.ts
|
|
1117
1129
|
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
@@ -1124,12 +1136,7 @@ declare const TeleportImpl: {
|
|
|
1124
1136
|
name: string;
|
|
1125
1137
|
__isTeleport: boolean;
|
|
1126
1138
|
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;
|
|
1127
|
-
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, {
|
|
1128
|
-
um: unmount,
|
|
1129
|
-
o: {
|
|
1130
|
-
remove: hostRemove
|
|
1131
|
-
}
|
|
1132
|
-
}: RendererInternals, doRemove: boolean): void;
|
|
1139
|
+
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
|
|
1133
1140
|
move: typeof moveTeleport;
|
|
1134
1141
|
hydrate: typeof hydrateTeleport;
|
|
1135
1142
|
};
|
|
@@ -1138,21 +1145,8 @@ declare enum TeleportMoveTypes {
|
|
|
1138
1145
|
TOGGLE = 1,
|
|
1139
1146
|
REORDER = 2
|
|
1140
1147
|
}
|
|
1141
|
-
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, {
|
|
1142
|
-
|
|
1143
|
-
insert
|
|
1144
|
-
},
|
|
1145
|
-
m: move
|
|
1146
|
-
}: RendererInternals, parentComponent: ComponentInternalInstance | null, moveType?: TeleportMoveTypes): void;
|
|
1147
|
-
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, {
|
|
1148
|
-
o: {
|
|
1149
|
-
nextSibling,
|
|
1150
|
-
parentNode,
|
|
1151
|
-
querySelector,
|
|
1152
|
-
insert,
|
|
1153
|
-
createText
|
|
1154
|
-
}
|
|
1155
|
-
}: 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;
|
|
1148
|
+
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, parentComponent: ComponentInternalInstance | null, moveType?: TeleportMoveTypes): void;
|
|
1149
|
+
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector, insert, createText } }: 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;
|
|
1156
1150
|
declare const Teleport: {
|
|
1157
1151
|
__isTeleport: true;
|
|
1158
1152
|
new (): {
|
|
@@ -1178,20 +1172,20 @@ type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typ
|
|
|
1178
1172
|
type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
|
1179
1173
|
type VNodeNormalizedRefAtom = {
|
|
1180
1174
|
/**
|
|
1181
|
-
|
|
1182
|
-
|
|
1175
|
+
* component instance
|
|
1176
|
+
*/
|
|
1183
1177
|
i: ComponentInternalInstance;
|
|
1184
1178
|
/**
|
|
1185
|
-
|
|
1186
|
-
|
|
1179
|
+
* Actual ref
|
|
1180
|
+
*/
|
|
1187
1181
|
r: VNodeRef;
|
|
1188
1182
|
/**
|
|
1189
|
-
|
|
1190
|
-
|
|
1183
|
+
* setup ref key
|
|
1184
|
+
*/
|
|
1191
1185
|
k?: string;
|
|
1192
1186
|
/**
|
|
1193
|
-
|
|
1194
|
-
|
|
1187
|
+
* refInFor marker
|
|
1188
|
+
*/
|
|
1195
1189
|
f?: boolean;
|
|
1196
1190
|
};
|
|
1197
1191
|
type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
|
|
@@ -1217,36 +1211,36 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
|
|
|
1217
1211
|
[key: string]: any;
|
|
1218
1212
|
}> {
|
|
1219
1213
|
/**
|
|
1220
|
-
|
|
1221
|
-
|
|
1214
|
+
* @internal
|
|
1215
|
+
*/
|
|
1222
1216
|
__v_isVNode: true;
|
|
1223
1217
|
/**
|
|
1224
|
-
|
|
1225
|
-
|
|
1218
|
+
* @internal
|
|
1219
|
+
*/
|
|
1226
1220
|
[ReactiveFlags$1.SKIP]: true;
|
|
1227
1221
|
type: VNodeTypes;
|
|
1228
1222
|
props: (VNodeProps & ExtraProps) | null;
|
|
1229
1223
|
key: PropertyKey | null;
|
|
1230
1224
|
ref: VNodeNormalizedRef | null;
|
|
1231
1225
|
/**
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1226
|
+
* SFC only. This is assigned on vnode creation using currentScopeId
|
|
1227
|
+
* which is set alongside currentRenderingInstance.
|
|
1228
|
+
*/
|
|
1235
1229
|
scopeId: string | null;
|
|
1236
1230
|
/**
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1231
|
+
* SFC only. This is assigned to:
|
|
1232
|
+
* - Slot fragment vnodes with :slotted SFC styles.
|
|
1233
|
+
* - Component vnodes (during patch/hydration) so that its root node can
|
|
1234
|
+
* inherit the component's slotScopeIds
|
|
1235
|
+
* @internal
|
|
1236
|
+
*/
|
|
1243
1237
|
slotScopeIds: string[] | null;
|
|
1244
1238
|
/**
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1239
|
+
* Root-only scope ids published by the vapor interop onto vnodes serving
|
|
1240
|
+
* as a vapor component's effective root; consumed by getInheritedScopeIds
|
|
1241
|
+
* where the effective-root chain tops out (before insertion).
|
|
1242
|
+
* @internal
|
|
1243
|
+
*/
|
|
1250
1244
|
vaporScopeIds?: string[];
|
|
1251
1245
|
children: VNodeNormalizedChildren;
|
|
1252
1246
|
component: ComponentInternalInstance | null;
|
|
@@ -1259,59 +1253,59 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
|
|
|
1259
1253
|
targetStart: HostNode | null;
|
|
1260
1254
|
targetAnchor: HostNode | null;
|
|
1261
1255
|
/**
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1256
|
+
* number of elements contained in a static vnode
|
|
1257
|
+
* @internal
|
|
1258
|
+
*/
|
|
1265
1259
|
staticCount: number;
|
|
1266
1260
|
suspense: SuspenseBoundary | null;
|
|
1267
1261
|
/**
|
|
1268
|
-
|
|
1269
|
-
|
|
1262
|
+
* @internal
|
|
1263
|
+
*/
|
|
1270
1264
|
ssContent: VNode | null;
|
|
1271
1265
|
/**
|
|
1272
|
-
|
|
1273
|
-
|
|
1266
|
+
* @internal
|
|
1267
|
+
*/
|
|
1274
1268
|
ssFallback: VNode | null;
|
|
1275
1269
|
shapeFlag: number;
|
|
1276
1270
|
patchFlag: number;
|
|
1277
1271
|
/**
|
|
1278
|
-
|
|
1279
|
-
|
|
1272
|
+
* @internal
|
|
1273
|
+
*/
|
|
1280
1274
|
dynamicProps: string[] | null;
|
|
1281
1275
|
/**
|
|
1282
|
-
|
|
1283
|
-
|
|
1276
|
+
* @internal
|
|
1277
|
+
*/
|
|
1284
1278
|
dynamicChildren: (VNode[] & {
|
|
1285
1279
|
hasOnce?: boolean;
|
|
1286
1280
|
}) | null;
|
|
1287
1281
|
appContext: AppContext | null;
|
|
1288
1282
|
/**
|
|
1289
|
-
|
|
1290
|
-
|
|
1283
|
+
* @internal lexical scope owner instance
|
|
1284
|
+
*/
|
|
1291
1285
|
ctx: ComponentInternalInstance | null;
|
|
1292
1286
|
/**
|
|
1293
|
-
|
|
1294
|
-
|
|
1287
|
+
* @internal attached by v-memo
|
|
1288
|
+
*/
|
|
1295
1289
|
memo?: any[];
|
|
1296
1290
|
/**
|
|
1297
|
-
|
|
1298
|
-
|
|
1291
|
+
* @internal index for cleaning v-memo cache
|
|
1292
|
+
*/
|
|
1299
1293
|
cacheIndex?: number;
|
|
1300
1294
|
/**
|
|
1301
|
-
|
|
1302
|
-
|
|
1295
|
+
* @internal __COMPAT__ only
|
|
1296
|
+
*/
|
|
1303
1297
|
isCompatRoot?: true;
|
|
1304
1298
|
/**
|
|
1305
|
-
|
|
1306
|
-
|
|
1299
|
+
* @internal custom element interception hook
|
|
1300
|
+
*/
|
|
1307
1301
|
ce?: (instance: ComponentInternalInstance) => void;
|
|
1308
1302
|
/**
|
|
1309
|
-
|
|
1310
|
-
|
|
1303
|
+
* @internal VDOM in Vapor interop hook
|
|
1304
|
+
*/
|
|
1311
1305
|
vi?: (instance: ComponentInternalInstance) => void;
|
|
1312
1306
|
/**
|
|
1313
|
-
|
|
1314
|
-
|
|
1307
|
+
* @internal Vapor slot in VDOM metadata
|
|
1308
|
+
*/
|
|
1315
1309
|
vs?: {
|
|
1316
1310
|
slot: (props: any) => any;
|
|
1317
1311
|
fallback: (() => VNodeArrayChildren) | undefined;
|
|
@@ -1321,53 +1315,66 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
|
|
|
1321
1315
|
scope?: EffectScope;
|
|
1322
1316
|
};
|
|
1323
1317
|
/**
|
|
1324
|
-
|
|
1325
|
-
|
|
1318
|
+
* @internal Vapor slot Block
|
|
1319
|
+
*/
|
|
1326
1320
|
vb?: any;
|
|
1321
|
+
/**
|
|
1322
|
+
* @internal vapor interop only — internal before-update notification, fired
|
|
1323
|
+
* before this vnode is patched (alongside onVnodeBeforeUpdate). Single-owner:
|
|
1324
|
+
* the interop layer assigns (never appends) so re-tracking replaces the
|
|
1325
|
+
* previous callback.
|
|
1326
|
+
*/
|
|
1327
|
+
ibu?: () => void;
|
|
1328
|
+
/**
|
|
1329
|
+
* @internal vapor interop only — internal updated notification, fired after
|
|
1330
|
+
* this vnode is patched (alongside onVnodeUpdated) so the interop layer can
|
|
1331
|
+
* refresh its snapshot of the DOM range. Single-owner; see `ibu`.
|
|
1332
|
+
*/
|
|
1333
|
+
iu?: () => void;
|
|
1327
1334
|
}
|
|
1328
1335
|
//#endregion
|
|
1329
1336
|
//#region packages/runtime-core/src/component.d.ts
|
|
1330
1337
|
type Data = Record<string, unknown>;
|
|
1331
1338
|
/**
|
|
1332
|
-
* For extending allowed non-declared attrs on components in TSX
|
|
1333
|
-
*/
|
|
1339
|
+
* For extending allowed non-declared attrs on components in TSX
|
|
1340
|
+
*/
|
|
1334
1341
|
interface AllowedAttrs {}
|
|
1335
1342
|
type Attrs = Data & AllowedAttrs;
|
|
1336
1343
|
/**
|
|
1337
|
-
* For extending allowed non-declared props on components in TSX
|
|
1338
|
-
*/
|
|
1344
|
+
* For extending allowed non-declared props on components in TSX
|
|
1345
|
+
*/
|
|
1339
1346
|
interface ComponentCustomProps {}
|
|
1340
1347
|
/**
|
|
1341
|
-
* For globally defined Directives
|
|
1342
|
-
* Here is an example of adding a directive `VTooltip` as global directive:
|
|
1343
|
-
*
|
|
1344
|
-
* @example
|
|
1345
|
-
* ```ts
|
|
1346
|
-
* import VTooltip from 'v-tooltip'
|
|
1347
|
-
*
|
|
1348
|
-
* declare module '@vue/runtime-core' {
|
|
1349
|
-
* interface GlobalDirectives {
|
|
1350
|
-
* VTooltip
|
|
1351
|
-
* }
|
|
1352
|
-
* }
|
|
1353
|
-
* ```
|
|
1354
|
-
*/
|
|
1348
|
+
* For globally defined Directives
|
|
1349
|
+
* Here is an example of adding a directive `VTooltip` as global directive:
|
|
1350
|
+
*
|
|
1351
|
+
* @example
|
|
1352
|
+
* ```ts
|
|
1353
|
+
* import VTooltip from 'v-tooltip'
|
|
1354
|
+
*
|
|
1355
|
+
* declare module '@vue/runtime-core' {
|
|
1356
|
+
* interface GlobalDirectives {
|
|
1357
|
+
* VTooltip
|
|
1358
|
+
* }
|
|
1359
|
+
* }
|
|
1360
|
+
* ```
|
|
1361
|
+
*/
|
|
1355
1362
|
interface GlobalDirectives {}
|
|
1356
1363
|
/**
|
|
1357
|
-
* For globally defined Components
|
|
1358
|
-
* Here is an example of adding a component `RouterView` as global component:
|
|
1359
|
-
*
|
|
1360
|
-
* @example
|
|
1361
|
-
* ```ts
|
|
1362
|
-
* import { RouterView } from 'vue-router'
|
|
1363
|
-
*
|
|
1364
|
-
* declare module '@vue/runtime-core' {
|
|
1365
|
-
* interface GlobalComponents {
|
|
1366
|
-
* RouterView
|
|
1367
|
-
* }
|
|
1368
|
-
* }
|
|
1369
|
-
* ```
|
|
1370
|
-
*/
|
|
1364
|
+
* For globally defined Components
|
|
1365
|
+
* Here is an example of adding a component `RouterView` as global component:
|
|
1366
|
+
*
|
|
1367
|
+
* @example
|
|
1368
|
+
* ```ts
|
|
1369
|
+
* import { RouterView } from 'vue-router'
|
|
1370
|
+
*
|
|
1371
|
+
* declare module '@vue/runtime-core' {
|
|
1372
|
+
* interface GlobalComponents {
|
|
1373
|
+
* RouterView
|
|
1374
|
+
* }
|
|
1375
|
+
* }
|
|
1376
|
+
* ```
|
|
1377
|
+
*/
|
|
1371
1378
|
interface GlobalComponents {
|
|
1372
1379
|
Teleport: DefineComponent<TeleportProps>;
|
|
1373
1380
|
Suspense: DefineComponent<SuspenseProps>;
|
|
@@ -1375,65 +1382,65 @@ interface GlobalComponents {
|
|
|
1375
1382
|
BaseTransition: DefineComponent<BaseTransitionProps>;
|
|
1376
1383
|
}
|
|
1377
1384
|
/**
|
|
1378
|
-
* Default allowed non-declared props on component in TSX
|
|
1379
|
-
*/
|
|
1385
|
+
* Default allowed non-declared props on component in TSX
|
|
1386
|
+
*/
|
|
1380
1387
|
interface AllowedComponentProps {
|
|
1381
1388
|
class?: unknown;
|
|
1382
1389
|
style?: unknown;
|
|
1383
1390
|
}
|
|
1384
1391
|
interface ComponentInternalOptions {
|
|
1385
1392
|
/**
|
|
1386
|
-
|
|
1387
|
-
|
|
1393
|
+
* indicates vapor component
|
|
1394
|
+
*/
|
|
1388
1395
|
__vapor?: boolean;
|
|
1389
1396
|
/**
|
|
1390
|
-
|
|
1391
|
-
|
|
1397
|
+
* whether this vapor component has multiple root nodes
|
|
1398
|
+
*/
|
|
1392
1399
|
__multiRoot?: boolean;
|
|
1393
1400
|
/**
|
|
1394
|
-
|
|
1395
|
-
|
|
1401
|
+
* indicates keep-alive component
|
|
1402
|
+
*/
|
|
1396
1403
|
__isKeepAlive?: boolean;
|
|
1397
1404
|
/**
|
|
1398
|
-
|
|
1399
|
-
|
|
1405
|
+
* @internal
|
|
1406
|
+
*/
|
|
1400
1407
|
__scopeId?: string;
|
|
1401
1408
|
/**
|
|
1402
|
-
|
|
1403
|
-
|
|
1409
|
+
* @internal
|
|
1410
|
+
*/
|
|
1404
1411
|
__cssModules?: Data;
|
|
1405
1412
|
/**
|
|
1406
|
-
|
|
1407
|
-
|
|
1413
|
+
* @internal
|
|
1414
|
+
*/
|
|
1408
1415
|
__hmrId?: string;
|
|
1409
1416
|
/**
|
|
1410
|
-
|
|
1411
|
-
|
|
1417
|
+
* Compat build only, for bailing out of certain compatibility behavior
|
|
1418
|
+
*/
|
|
1412
1419
|
__isBuiltIn?: boolean;
|
|
1413
1420
|
/**
|
|
1414
|
-
|
|
1415
|
-
|
|
1421
|
+
* This one should be exposed so that devtools can make use of it
|
|
1422
|
+
*/
|
|
1416
1423
|
__file?: string;
|
|
1417
1424
|
/**
|
|
1418
|
-
|
|
1419
|
-
|
|
1425
|
+
* name inferred from filename
|
|
1426
|
+
*/
|
|
1420
1427
|
__name?: string;
|
|
1421
1428
|
}
|
|
1422
1429
|
interface AsyncComponentInternalOptions<R = ConcreteComponent, I = ComponentInternalInstance> {
|
|
1423
1430
|
/**
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1431
|
+
* marker for AsyncComponentWrapper
|
|
1432
|
+
* @internal
|
|
1433
|
+
*/
|
|
1427
1434
|
__asyncLoader?: () => Promise<R>;
|
|
1428
1435
|
/**
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1436
|
+
* the inner component resolved by the AsyncComponentWrapper
|
|
1437
|
+
* @internal
|
|
1438
|
+
*/
|
|
1432
1439
|
__asyncResolved?: R;
|
|
1433
1440
|
/**
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1441
|
+
* Exposed for lazy hydration
|
|
1442
|
+
* @internal
|
|
1443
|
+
*/
|
|
1437
1444
|
__asyncHydrate?: (el: Element, instance: I, hydrate: () => void) => void;
|
|
1438
1445
|
}
|
|
1439
1446
|
interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions {
|
|
@@ -1446,24 +1453,24 @@ interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, an
|
|
|
1446
1453
|
compatConfig?: CompatConfig;
|
|
1447
1454
|
}
|
|
1448
1455
|
/**
|
|
1449
|
-
* Type used where a function accepts both vdom and vapor components.
|
|
1450
|
-
*/
|
|
1456
|
+
* Type used where a function accepts both vdom and vapor components.
|
|
1457
|
+
*/
|
|
1451
1458
|
type GenericComponent = ({
|
|
1452
1459
|
name?: string;
|
|
1453
1460
|
} | ((() => any) & {
|
|
1454
1461
|
displayName?: string;
|
|
1455
1462
|
})) & ComponentInternalOptions;
|
|
1456
1463
|
/**
|
|
1457
|
-
* Concrete component type matches its actual value: it's either an options
|
|
1458
|
-
* object, or a function. Use this where the code expects to work with actual
|
|
1459
|
-
* values, e.g. checking if its a function or not. This is mostly for internal
|
|
1460
|
-
* implementation code.
|
|
1461
|
-
*/
|
|
1464
|
+
* Concrete component type matches its actual value: it's either an options
|
|
1465
|
+
* object, or a function. Use this where the code expects to work with actual
|
|
1466
|
+
* values, e.g. checking if its a function or not. This is mostly for internal
|
|
1467
|
+
* implementation code.
|
|
1468
|
+
*/
|
|
1462
1469
|
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>;
|
|
1463
1470
|
/**
|
|
1464
|
-
* A type used in public APIs where a component type is expected.
|
|
1465
|
-
* The constructor type is an artificial type returned by defineComponent().
|
|
1466
|
-
*/
|
|
1471
|
+
* A type used in public APIs where a component type is expected.
|
|
1472
|
+
* The constructor type is an artificial type returned by defineComponent().
|
|
1473
|
+
*/
|
|
1467
1474
|
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>;
|
|
1468
1475
|
type LifecycleHook<TFn = Function> = (TFn & SchedulerJob)[] | null;
|
|
1469
1476
|
type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
@@ -1473,8 +1480,8 @@ type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ?
|
|
|
1473
1480
|
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
|
1474
1481
|
} : never;
|
|
1475
1482
|
/**
|
|
1476
|
-
* @internal
|
|
1477
|
-
*/
|
|
1483
|
+
* @internal
|
|
1484
|
+
*/
|
|
1478
1485
|
type InternalRenderFunction = {
|
|
1479
1486
|
(ctx: ComponentPublicInstance, cache: ComponentInternalInstance["renderCache"], $props: ComponentInternalInstance["props"], $setup: ComponentInternalInstance["setupState"], $data: ComponentInternalInstance["data"], $options: ComponentInternalInstance["ctx"]): VNodeChild;
|
|
1480
1487
|
_rc?: boolean;
|
|
@@ -1482,10 +1489,10 @@ type InternalRenderFunction = {
|
|
|
1482
1489
|
_compatWrapped?: boolean;
|
|
1483
1490
|
};
|
|
1484
1491
|
/**
|
|
1485
|
-
* Base component instance interface that is shared between vdom mode and vapor
|
|
1486
|
-
* mode, so that we can have a mixed instance tree and reuse core logic that
|
|
1487
|
-
* operate on both.
|
|
1488
|
-
*/
|
|
1492
|
+
* Base component instance interface that is shared between vdom mode and vapor
|
|
1493
|
+
* mode, so that we can have a mixed instance tree and reuse core logic that
|
|
1494
|
+
* operate on both.
|
|
1495
|
+
*/
|
|
1489
1496
|
interface GenericComponentInstance {
|
|
1490
1497
|
vapor?: boolean;
|
|
1491
1498
|
uid: number;
|
|
@@ -1494,202 +1501,202 @@ interface GenericComponentInstance {
|
|
|
1494
1501
|
parent: GenericComponentInstance | null;
|
|
1495
1502
|
appContext: GenericAppContext;
|
|
1496
1503
|
/**
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1504
|
+
* Object containing values this component provides for its descendants
|
|
1505
|
+
* @internal
|
|
1506
|
+
*/
|
|
1500
1507
|
provides: Data;
|
|
1501
1508
|
/**
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1509
|
+
* Tracking reactive effects (e.g. watchers) associated with this component
|
|
1510
|
+
* so that they can be automatically stopped on component unmount
|
|
1511
|
+
* @internal
|
|
1512
|
+
*/
|
|
1506
1513
|
scope: EffectScope;
|
|
1507
1514
|
/**
|
|
1508
|
-
|
|
1509
|
-
|
|
1515
|
+
* render function will have different types between vdom and vapor
|
|
1516
|
+
*/
|
|
1510
1517
|
render?: Function | null;
|
|
1511
1518
|
/**
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1519
|
+
* SSR render function
|
|
1520
|
+
* (they are the same between vdom and vapor components.)
|
|
1521
|
+
* @internal
|
|
1522
|
+
*/
|
|
1516
1523
|
ssrRender?: Function | null;
|
|
1517
1524
|
props: Data;
|
|
1518
1525
|
attrs: Data;
|
|
1519
1526
|
refs: Data;
|
|
1520
1527
|
emit: EmitFn;
|
|
1521
1528
|
/**
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1529
|
+
* used for keeping track of .once event handlers on components
|
|
1530
|
+
* @internal
|
|
1531
|
+
*/
|
|
1525
1532
|
emitted: Record<string, boolean> | null;
|
|
1526
1533
|
/**
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1534
|
+
* used for caching the value returned from props default factory functions to
|
|
1535
|
+
* avoid unnecessary watcher trigger
|
|
1536
|
+
* @internal
|
|
1537
|
+
*/
|
|
1531
1538
|
propsDefaults: Data | null;
|
|
1532
1539
|
/**
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1540
|
+
* used for getting the keys of a component's raw props, vapor only
|
|
1541
|
+
* @internal
|
|
1542
|
+
*/
|
|
1536
1543
|
rawKeys?: () => string[];
|
|
1537
1544
|
exposed: Record<string, any> | null;
|
|
1538
1545
|
exposeProxy: Record<string, any> | null;
|
|
1539
1546
|
/**
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1547
|
+
* setup related
|
|
1548
|
+
* @internal
|
|
1549
|
+
*/
|
|
1543
1550
|
setupState?: Data;
|
|
1544
1551
|
/**
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1552
|
+
* devtools access to additional info
|
|
1553
|
+
* @internal
|
|
1554
|
+
*/
|
|
1548
1555
|
devtoolsRawSetupState?: any;
|
|
1549
1556
|
isMounted: boolean;
|
|
1550
1557
|
isUnmounted: boolean;
|
|
1551
1558
|
isDeactivated: boolean;
|
|
1552
1559
|
/**
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1560
|
+
* for tracking useId()
|
|
1561
|
+
* first element is the current boundary prefix
|
|
1562
|
+
* second number is the index of the useId call within that boundary
|
|
1563
|
+
* @internal
|
|
1564
|
+
*/
|
|
1558
1565
|
ids: [string, number, number];
|
|
1559
1566
|
/**
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1567
|
+
* resolved props options
|
|
1568
|
+
* @internal
|
|
1569
|
+
*/
|
|
1563
1570
|
propsOptions?: NormalizedPropsOptions;
|
|
1564
1571
|
/**
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1572
|
+
* resolved emits options
|
|
1573
|
+
* @internal
|
|
1574
|
+
*/
|
|
1568
1575
|
emitsOptions?: ObjectEmitsOptions | null;
|
|
1569
1576
|
/**
|
|
1570
|
-
|
|
1571
|
-
|
|
1577
|
+
* Public instance proxy, vdom only
|
|
1578
|
+
*/
|
|
1572
1579
|
proxy?: any;
|
|
1573
1580
|
/**
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1581
|
+
* suspense related
|
|
1582
|
+
* @internal
|
|
1583
|
+
*/
|
|
1577
1584
|
suspense: SuspenseBoundary | null;
|
|
1578
1585
|
/**
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1586
|
+
* suspense pending batch id
|
|
1587
|
+
* @internal
|
|
1588
|
+
*/
|
|
1582
1589
|
suspenseId: number;
|
|
1583
1590
|
/**
|
|
1584
|
-
|
|
1585
|
-
|
|
1591
|
+
* @internal
|
|
1592
|
+
*/
|
|
1586
1593
|
asyncDep: Promise<any> | null;
|
|
1587
1594
|
/**
|
|
1588
|
-
|
|
1589
|
-
|
|
1595
|
+
* @internal
|
|
1596
|
+
*/
|
|
1590
1597
|
asyncResolved: boolean;
|
|
1591
1598
|
/**
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1599
|
+
* restore renderer-specific async context after `withAsyncContext()`
|
|
1600
|
+
* @internal
|
|
1601
|
+
*/
|
|
1595
1602
|
restoreAsyncContext?: () => void | (() => void);
|
|
1596
1603
|
/**
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1604
|
+
* `updateTeleportCssVars`
|
|
1605
|
+
* For updating css vars on contained teleports
|
|
1606
|
+
* @internal
|
|
1607
|
+
*/
|
|
1601
1608
|
ut?: (vars?: Record<string, string>) => void;
|
|
1602
1609
|
/**
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1610
|
+
* dev only. For style v-bind hydration mismatch checks
|
|
1611
|
+
* @internal
|
|
1612
|
+
*/
|
|
1606
1613
|
getCssVars?: () => Record<string, string>;
|
|
1607
1614
|
/**
|
|
1608
|
-
|
|
1609
|
-
|
|
1615
|
+
* @internal
|
|
1616
|
+
*/
|
|
1610
1617
|
[LifecycleHooks.BEFORE_CREATE]?: LifecycleHook;
|
|
1611
1618
|
/**
|
|
1612
|
-
|
|
1613
|
-
|
|
1619
|
+
* @internal
|
|
1620
|
+
*/
|
|
1614
1621
|
[LifecycleHooks.CREATED]?: LifecycleHook;
|
|
1615
1622
|
/**
|
|
1616
|
-
|
|
1617
|
-
|
|
1623
|
+
* @internal
|
|
1624
|
+
*/
|
|
1618
1625
|
[LifecycleHooks.BEFORE_MOUNT]?: LifecycleHook;
|
|
1619
1626
|
/**
|
|
1620
|
-
|
|
1621
|
-
|
|
1627
|
+
* @internal
|
|
1628
|
+
*/
|
|
1622
1629
|
[LifecycleHooks.MOUNTED]?: LifecycleHook;
|
|
1623
1630
|
/**
|
|
1624
|
-
|
|
1625
|
-
|
|
1631
|
+
* @internal
|
|
1632
|
+
*/
|
|
1626
1633
|
[LifecycleHooks.BEFORE_UPDATE]?: LifecycleHook;
|
|
1627
1634
|
/**
|
|
1628
|
-
|
|
1629
|
-
|
|
1635
|
+
* @internal
|
|
1636
|
+
*/
|
|
1630
1637
|
[LifecycleHooks.UPDATED]?: LifecycleHook;
|
|
1631
1638
|
/**
|
|
1632
|
-
|
|
1633
|
-
|
|
1639
|
+
* @internal
|
|
1640
|
+
*/
|
|
1634
1641
|
[LifecycleHooks.BEFORE_UNMOUNT]?: LifecycleHook;
|
|
1635
1642
|
/**
|
|
1636
|
-
|
|
1637
|
-
|
|
1643
|
+
* @internal
|
|
1644
|
+
*/
|
|
1638
1645
|
[LifecycleHooks.UNMOUNTED]?: LifecycleHook;
|
|
1639
1646
|
/**
|
|
1640
|
-
|
|
1641
|
-
|
|
1647
|
+
* @internal
|
|
1648
|
+
*/
|
|
1642
1649
|
[LifecycleHooks.RENDER_TRACKED]?: LifecycleHook;
|
|
1643
1650
|
/**
|
|
1644
|
-
|
|
1645
|
-
|
|
1651
|
+
* @internal
|
|
1652
|
+
*/
|
|
1646
1653
|
[LifecycleHooks.RENDER_TRIGGERED]?: LifecycleHook;
|
|
1647
1654
|
/**
|
|
1648
|
-
|
|
1649
|
-
|
|
1655
|
+
* @internal
|
|
1656
|
+
*/
|
|
1650
1657
|
[LifecycleHooks.ACTIVATED]?: LifecycleHook;
|
|
1651
1658
|
/**
|
|
1652
|
-
|
|
1653
|
-
|
|
1659
|
+
* @internal
|
|
1660
|
+
*/
|
|
1654
1661
|
[LifecycleHooks.DEACTIVATED]?: LifecycleHook;
|
|
1655
1662
|
/**
|
|
1656
|
-
|
|
1657
|
-
|
|
1663
|
+
* @internal
|
|
1664
|
+
*/
|
|
1658
1665
|
[LifecycleHooks.ERROR_CAPTURED]?: LifecycleHook;
|
|
1659
1666
|
/**
|
|
1660
|
-
|
|
1661
|
-
|
|
1667
|
+
* @internal
|
|
1668
|
+
*/
|
|
1662
1669
|
[LifecycleHooks.SERVER_PREFETCH]?: LifecycleHook<() => Promise<unknown>>;
|
|
1663
1670
|
/**
|
|
1664
|
-
|
|
1665
|
-
|
|
1671
|
+
* @internal vapor only
|
|
1672
|
+
*/
|
|
1666
1673
|
hmrRerender?: () => void;
|
|
1667
1674
|
/**
|
|
1668
|
-
|
|
1669
|
-
|
|
1675
|
+
* @internal vapor only
|
|
1676
|
+
*/
|
|
1670
1677
|
hmrReload?: (newComp: any) => void;
|
|
1671
1678
|
vnode?: VNode;
|
|
1672
1679
|
subTree?: VNode;
|
|
1673
1680
|
/**
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1681
|
+
* Custom Element instance (if component is created by defineCustomElement)
|
|
1682
|
+
* @internal
|
|
1683
|
+
*/
|
|
1677
1684
|
ce?: ComponentCustomElementInterface;
|
|
1678
1685
|
/**
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1686
|
+
* is custom element? (kept only for compatibility)
|
|
1687
|
+
* @internal
|
|
1688
|
+
*/
|
|
1682
1689
|
isCE?: boolean;
|
|
1683
1690
|
/**
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1691
|
+
* custom element specific HMR method
|
|
1692
|
+
* @internal
|
|
1693
|
+
*/
|
|
1687
1694
|
ceReload?: (newStyles?: string[]) => void;
|
|
1688
1695
|
}
|
|
1689
1696
|
/**
|
|
1690
|
-
* We expose a subset of properties on the internal instance as they are
|
|
1691
|
-
* useful for advanced external libraries and tools.
|
|
1692
|
-
*/
|
|
1697
|
+
* We expose a subset of properties on the internal instance as they are
|
|
1698
|
+
* useful for advanced external libraries and tools.
|
|
1699
|
+
*/
|
|
1693
1700
|
interface ComponentInternalInstance extends GenericComponentInstance {
|
|
1694
1701
|
vapor?: never;
|
|
1695
1702
|
uid: number;
|
|
@@ -1698,84 +1705,84 @@ interface ComponentInternalInstance extends GenericComponentInstance {
|
|
|
1698
1705
|
root: GenericComponentInstance;
|
|
1699
1706
|
appContext: AppContext;
|
|
1700
1707
|
/**
|
|
1701
|
-
|
|
1702
|
-
|
|
1708
|
+
* Vnode representing this component in its parent's vdom tree
|
|
1709
|
+
*/
|
|
1703
1710
|
vnode: VNode;
|
|
1704
1711
|
/**
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1712
|
+
* The pending new vnode from parent updates
|
|
1713
|
+
* @internal
|
|
1714
|
+
*/
|
|
1708
1715
|
next: VNode | null;
|
|
1709
1716
|
/**
|
|
1710
|
-
|
|
1711
|
-
|
|
1717
|
+
* Root vnode of this component's own vdom tree
|
|
1718
|
+
*/
|
|
1712
1719
|
subTree: VNode;
|
|
1713
1720
|
/**
|
|
1714
|
-
|
|
1715
|
-
|
|
1721
|
+
* Render effect instance
|
|
1722
|
+
*/
|
|
1716
1723
|
effect: ReactiveEffect;
|
|
1717
1724
|
/**
|
|
1718
|
-
|
|
1719
|
-
|
|
1725
|
+
* Force update render effect
|
|
1726
|
+
*/
|
|
1720
1727
|
update: () => void;
|
|
1721
1728
|
/**
|
|
1722
|
-
|
|
1723
|
-
|
|
1729
|
+
* Render effect job to be passed to scheduler (checks if dirty)
|
|
1730
|
+
*/
|
|
1724
1731
|
job: SchedulerJob;
|
|
1725
1732
|
/**
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1733
|
+
* The render function that returns vdom tree.
|
|
1734
|
+
* @internal
|
|
1735
|
+
*/
|
|
1729
1736
|
render: InternalRenderFunction | null;
|
|
1730
1737
|
/**
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1738
|
+
* cache for proxy access type to avoid hasOwnProperty calls
|
|
1739
|
+
* @internal
|
|
1740
|
+
*/
|
|
1734
1741
|
accessCache: Data | null;
|
|
1735
1742
|
/**
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1743
|
+
* cache for render function values that rely on _ctx but won't need updates
|
|
1744
|
+
* after initialized (e.g. inline handlers)
|
|
1745
|
+
* @internal
|
|
1746
|
+
*/
|
|
1740
1747
|
renderCache: (Function | VNode | undefined)[];
|
|
1741
1748
|
/**
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1749
|
+
* Resolved component registry, only for components with mixins or extends
|
|
1750
|
+
* @internal
|
|
1751
|
+
*/
|
|
1745
1752
|
components: Record<string, ConcreteComponent> | null;
|
|
1746
1753
|
/**
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1754
|
+
* Resolved directive registry, only for components with mixins or extends
|
|
1755
|
+
* @internal
|
|
1756
|
+
*/
|
|
1750
1757
|
directives: Record<string, Directive> | null;
|
|
1751
1758
|
/**
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1759
|
+
* Resolved filters registry, v2 compat only
|
|
1760
|
+
* @internal
|
|
1761
|
+
*/
|
|
1755
1762
|
filters?: Record<string, Function>;
|
|
1756
1763
|
/**
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1764
|
+
* resolved props options
|
|
1765
|
+
* @internal
|
|
1766
|
+
*/
|
|
1760
1767
|
propsOptions: NormalizedPropsOptions;
|
|
1761
1768
|
/**
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1769
|
+
* resolved emits options
|
|
1770
|
+
* @internal
|
|
1771
|
+
*/
|
|
1765
1772
|
emitsOptions: ObjectEmitsOptions | null;
|
|
1766
1773
|
/**
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1774
|
+
* resolved inheritAttrs options
|
|
1775
|
+
* @internal
|
|
1776
|
+
*/
|
|
1770
1777
|
inheritAttrs?: boolean;
|
|
1771
1778
|
/**
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1779
|
+
* setup related
|
|
1780
|
+
* @internal
|
|
1781
|
+
*/
|
|
1775
1782
|
setupState: Data;
|
|
1776
1783
|
/**
|
|
1777
|
-
|
|
1778
|
-
|
|
1784
|
+
* @internal
|
|
1785
|
+
*/
|
|
1779
1786
|
setupContext?: SetupContext | null;
|
|
1780
1787
|
proxy: ComponentPublicInstance | null;
|
|
1781
1788
|
data: Data;
|
|
@@ -1783,79 +1790,79 @@ interface ComponentInternalInstance extends GenericComponentInstance {
|
|
|
1783
1790
|
slots: InternalSlots;
|
|
1784
1791
|
exposeProxy: Record<string, any> | null;
|
|
1785
1792
|
/**
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1793
|
+
* alternative proxy used only for runtime-compiled render functions using
|
|
1794
|
+
* `with` block
|
|
1795
|
+
* @internal
|
|
1796
|
+
*/
|
|
1790
1797
|
withProxy: ComponentPublicInstance | null;
|
|
1791
1798
|
/**
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1799
|
+
* This is the target for the public instance proxy. It also holds properties
|
|
1800
|
+
* injected by user options (computed, methods etc.) and user-attached
|
|
1801
|
+
* custom properties (via `this.x = ...`)
|
|
1802
|
+
* @internal
|
|
1803
|
+
*/
|
|
1797
1804
|
ctx: Data;
|
|
1798
1805
|
/**
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1806
|
+
* suspense pending batch id
|
|
1807
|
+
* @internal
|
|
1808
|
+
*/
|
|
1802
1809
|
suspenseId: number;
|
|
1803
1810
|
/**
|
|
1804
|
-
|
|
1805
|
-
|
|
1811
|
+
* @internal
|
|
1812
|
+
*/
|
|
1806
1813
|
asyncDep: Promise<any> | null;
|
|
1807
1814
|
/**
|
|
1808
|
-
|
|
1809
|
-
|
|
1815
|
+
* @internal
|
|
1816
|
+
*/
|
|
1810
1817
|
asyncResolved: boolean;
|
|
1811
1818
|
/**
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1819
|
+
* For caching bound $forceUpdate on public proxy access
|
|
1820
|
+
* @internal
|
|
1821
|
+
*/
|
|
1815
1822
|
f?: () => void;
|
|
1816
1823
|
/**
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1824
|
+
* For caching bound $nextTick on public proxy access
|
|
1825
|
+
* @internal
|
|
1826
|
+
*/
|
|
1820
1827
|
n?: () => Promise<void>;
|
|
1821
1828
|
/**
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1829
|
+
* v2 compat only, for caching mutated $options
|
|
1830
|
+
* @internal
|
|
1831
|
+
*/
|
|
1825
1832
|
resolvedOptions?: MergedComponentOptions;
|
|
1826
1833
|
}
|
|
1827
1834
|
interface ComponentCustomElementInterface {
|
|
1828
1835
|
/**
|
|
1829
|
-
|
|
1830
|
-
|
|
1836
|
+
* @internal
|
|
1837
|
+
*/
|
|
1831
1838
|
_isVueCE: boolean;
|
|
1832
1839
|
/**
|
|
1833
|
-
|
|
1834
|
-
|
|
1840
|
+
* @internal
|
|
1841
|
+
*/
|
|
1835
1842
|
_injectChildStyle(type: ConcreteComponent, parent?: ConcreteComponent): void;
|
|
1836
1843
|
/**
|
|
1837
|
-
|
|
1838
|
-
|
|
1844
|
+
* @internal
|
|
1845
|
+
*/
|
|
1839
1846
|
_removeChildStyle(type: ConcreteComponent): void;
|
|
1840
1847
|
/**
|
|
1841
|
-
|
|
1842
|
-
|
|
1848
|
+
* @internal
|
|
1849
|
+
*/
|
|
1843
1850
|
_setProp(key: string, val: any, shouldReflect?: boolean, shouldUpdate?: boolean): void;
|
|
1844
1851
|
/**
|
|
1845
|
-
|
|
1846
|
-
|
|
1852
|
+
* @internal
|
|
1853
|
+
*/
|
|
1847
1854
|
_beginPatch(): void;
|
|
1848
1855
|
/**
|
|
1849
|
-
|
|
1850
|
-
|
|
1856
|
+
* @internal
|
|
1857
|
+
*/
|
|
1851
1858
|
_endPatch(): void;
|
|
1852
1859
|
/**
|
|
1853
|
-
|
|
1854
|
-
|
|
1860
|
+
* @internal attached by the nested Teleport when shadowRoot is false.
|
|
1861
|
+
*/
|
|
1855
1862
|
_teleportTargets?: Set<RendererElement>;
|
|
1856
1863
|
/**
|
|
1857
|
-
|
|
1858
|
-
|
|
1864
|
+
* @internal check if shadow root is enabled
|
|
1865
|
+
*/
|
|
1859
1866
|
_hasShadowRoot(): boolean;
|
|
1860
1867
|
}
|
|
1861
1868
|
//#endregion
|
|
@@ -1872,28 +1879,28 @@ interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
|
|
|
1872
1879
|
//#region packages/runtime-core/src/compat/globalConfig.d.ts
|
|
1873
1880
|
type LegacyConfig = {
|
|
1874
1881
|
/**
|
|
1875
|
-
|
|
1876
|
-
|
|
1882
|
+
* @deprecated `config.silent` option has been removed
|
|
1883
|
+
*/
|
|
1877
1884
|
silent?: boolean;
|
|
1878
1885
|
/**
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1886
|
+
* @deprecated use __VUE_PROD_DEVTOOLS__ compile-time feature flag instead
|
|
1887
|
+
* https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags
|
|
1888
|
+
*/
|
|
1882
1889
|
devtools?: boolean;
|
|
1883
1890
|
/**
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1891
|
+
* @deprecated use `config.isCustomElement` instead
|
|
1892
|
+
* https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement
|
|
1893
|
+
*/
|
|
1887
1894
|
ignoredElements?: (string | RegExp)[];
|
|
1888
1895
|
/**
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1896
|
+
* @deprecated
|
|
1897
|
+
* https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html
|
|
1898
|
+
*/
|
|
1892
1899
|
keyCodes?: Record<string, number | number[]>;
|
|
1893
1900
|
/**
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1901
|
+
* @deprecated
|
|
1902
|
+
* https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed
|
|
1903
|
+
*/
|
|
1897
1904
|
productionTip?: boolean;
|
|
1898
1905
|
};
|
|
1899
1906
|
//#endregion
|
|
@@ -1914,10 +1921,10 @@ interface LegacyPublicProperties {
|
|
|
1914
1921
|
//#endregion
|
|
1915
1922
|
//#region packages/runtime-core/src/compat/global.d.ts
|
|
1916
1923
|
/**
|
|
1917
|
-
* @deprecated the default `Vue` export has been removed in Vue 3. The type for
|
|
1918
|
-
* the default export is provided only for migration purposes. Please use
|
|
1919
|
-
* named imports instead - e.g. `import { createApp } from 'vue'`.
|
|
1920
|
-
*/
|
|
1924
|
+
* @deprecated the default `Vue` export has been removed in Vue 3. The type for
|
|
1925
|
+
* the default export is provided only for migration purposes. Please use
|
|
1926
|
+
* named imports instead - e.g. `import { createApp } from 'vue'`.
|
|
1927
|
+
*/
|
|
1921
1928
|
type CompatVue = Pick<App, "version" | "component" | "directive"> & {
|
|
1922
1929
|
configureCompat: typeof configureCompat;
|
|
1923
1930
|
new (options?: ComponentOptions): LegacyPublicInstance;
|
|
@@ -1933,40 +1940,40 @@ type CompatVue = Pick<App, "version" | "component" | "directive"> & {
|
|
|
1933
1940
|
directive<T = any, V = any>(name: string, directive: Directive<T, V>): CompatVue;
|
|
1934
1941
|
compile(template: string): RenderFunction;
|
|
1935
1942
|
/**
|
|
1936
|
-
|
|
1937
|
-
|
|
1943
|
+
* @deprecated Vue 3 no longer supports extending constructors.
|
|
1944
|
+
*/
|
|
1938
1945
|
extend: (options?: ComponentOptions) => CompatVue;
|
|
1939
1946
|
/**
|
|
1940
|
-
|
|
1941
|
-
|
|
1947
|
+
* @deprecated Vue 3 no longer needs set() for adding new properties.
|
|
1948
|
+
*/
|
|
1942
1949
|
set(target: any, key: PropertyKey, value: any): void;
|
|
1943
1950
|
/**
|
|
1944
|
-
|
|
1945
|
-
|
|
1951
|
+
* @deprecated Vue 3 no longer needs delete() for property deletions.
|
|
1952
|
+
*/
|
|
1946
1953
|
delete(target: any, key: PropertyKey): void;
|
|
1947
1954
|
/**
|
|
1948
|
-
|
|
1949
|
-
|
|
1955
|
+
* @deprecated use `reactive` instead.
|
|
1956
|
+
*/
|
|
1950
1957
|
observable: typeof reactive;
|
|
1951
1958
|
/**
|
|
1952
|
-
|
|
1953
|
-
|
|
1959
|
+
* @deprecated filters have been removed from Vue 3.
|
|
1960
|
+
*/
|
|
1954
1961
|
filter(name: string, arg?: any): null;
|
|
1955
1962
|
/**
|
|
1956
|
-
|
|
1957
|
-
|
|
1963
|
+
* @internal
|
|
1964
|
+
*/
|
|
1958
1965
|
cid: number;
|
|
1959
1966
|
/**
|
|
1960
|
-
|
|
1961
|
-
|
|
1967
|
+
* @internal
|
|
1968
|
+
*/
|
|
1962
1969
|
options: ComponentOptions;
|
|
1963
1970
|
/**
|
|
1964
|
-
|
|
1965
|
-
|
|
1971
|
+
* @internal
|
|
1972
|
+
*/
|
|
1966
1973
|
util: any;
|
|
1967
1974
|
/**
|
|
1968
|
-
|
|
1969
|
-
|
|
1975
|
+
* @internal
|
|
1976
|
+
*/
|
|
1970
1977
|
super: CompatVue;
|
|
1971
1978
|
};
|
|
1972
1979
|
//#endregion
|
|
@@ -2025,13 +2032,7 @@ type SystemModifiers = (typeof systemModifiers)[number];
|
|
|
2025
2032
|
type CompatModifiers = keyof typeof keyNames;
|
|
2026
2033
|
type VOnModifiers = SystemModifiers | ModifierGuards | CompatModifiers;
|
|
2027
2034
|
type ModifierGuards = "shift" | "ctrl" | "alt" | "meta" | "left" | "right" | "stop" | "prevent" | "self" | "middle" | "exact";
|
|
2028
|
-
/**
|
|
2029
|
-
* @private
|
|
2030
|
-
*/
|
|
2031
2035
|
declare const keyNames: Record<"esc" | "space" | "up" | "left" | "right" | "down" | "delete", string>;
|
|
2032
|
-
/**
|
|
2033
|
-
* @private
|
|
2034
|
-
*/
|
|
2035
2036
|
type VOnDirective = Directive<any, any, VOnModifiers>;
|
|
2036
2037
|
//#endregion
|
|
2037
2038
|
//#region packages/runtime-dom/src/directives/vModel.d.ts
|
|
@@ -2041,7 +2042,7 @@ declare const initialValueKey: unique symbol;
|
|
|
2041
2042
|
type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & {
|
|
2042
2043
|
[assignKey]: AssignerFn;
|
|
2043
2044
|
[initialValueKey]?: string;
|
|
2044
|
-
|
|
2045
|
+
_pendingValue?: [multiple: boolean, value: any];
|
|
2045
2046
|
}, any, Modifiers>;
|
|
2046
2047
|
declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, "trim" | "number" | "lazy">;
|
|
2047
2048
|
declare const vModelCheckbox: ModelDirective<HTMLInputElement>;
|
|
@@ -22224,13 +22225,13 @@ declare namespace DataType {
|
|
|
22224
22225
|
//#region packages/runtime-dom/src/jsx.d.ts
|
|
22225
22226
|
interface CSSProperties extends Properties<string | number>, PropertiesHyphen<string | number> {
|
|
22226
22227
|
/**
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
22232
|
-
|
|
22233
|
-
|
|
22228
|
+
* The index signature was removed to enable closed typing for style
|
|
22229
|
+
* using CSSType. You're able to use type assertion or module augmentation
|
|
22230
|
+
* to add properties or an index signature of your own.
|
|
22231
|
+
*
|
|
22232
|
+
* For examples and more information, visit:
|
|
22233
|
+
* https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
|
|
22234
|
+
*/
|
|
22234
22235
|
[v: `--${string}`]: string | number | undefined;
|
|
22235
22236
|
}
|
|
22236
22237
|
type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>;
|
|
@@ -22238,10 +22239,10 @@ type ClassValue = false | null | undefined | string | Record<string, any> | Arra
|
|
|
22238
22239
|
//#endregion
|
|
22239
22240
|
//#region packages/runtime-dom/src/index.d.ts
|
|
22240
22241
|
/**
|
|
22241
|
-
* This is a stub implementation to prevent the need to use dom types.
|
|
22242
|
-
*
|
|
22243
|
-
* To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`.
|
|
22244
|
-
*/
|
|
22242
|
+
* This is a stub implementation to prevent the need to use dom types.
|
|
22243
|
+
*
|
|
22244
|
+
* To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`.
|
|
22245
|
+
*/
|
|
22245
22246
|
type DomType<T> = typeof globalThis extends {
|
|
22246
22247
|
window: unknown;
|
|
22247
22248
|
} ? T : never;
|