@vue/compat 3.6.0-rc.5 → 3.6.0-rc.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 +688 -685
- package/dist/vue.cjs.js +980 -747
- package/dist/vue.cjs.prod.js +803 -631
- package/dist/vue.esm-browser.js +882 -666
- package/dist/vue.esm-browser.prod.js +7 -7
- package/dist/vue.esm-bundler.js +907 -683
- package/dist/vue.global.js +882 -666
- package/dist/vue.global.prod.js +7 -7
- package/dist/vue.runtime.esm-browser.js +882 -666
- package/dist/vue.runtime.esm-browser.prod.js +7 -7
- package/dist/vue.runtime.esm-bundler.js +907 -683
- package/dist/vue.runtime.global.js +882 -666
- 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,53 @@ 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. The booleans describe the
|
|
1054
|
+
* outlet's position in the fallback chain; see renderVDOMSlot.
|
|
1055
|
+
*/
|
|
1056
|
+
interface VdomSlotOptions {
|
|
1057
|
+
fallback?: (...args: any[]) => any;
|
|
1058
|
+
once?: boolean;
|
|
1059
|
+
slotRoot?: boolean;
|
|
1060
|
+
sharedFallback?: boolean;
|
|
1061
|
+
inheritFallback?: boolean;
|
|
1062
|
+
adoptAnchor?: Node;
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* The vdom in vapor implementation is in runtime-vapor/src/vdomInterop.ts
|
|
1066
|
+
*/
|
|
1053
1067
|
interface VdomInVaporInterface {
|
|
1054
1068
|
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,
|
|
1069
|
+
slot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, options?: VdomSlotOptions) => any;
|
|
1056
1070
|
mountVNode: (vnode: VNode, parentComponent: any, getFallthroughAttrs?: () => Record<string, any>) => any;
|
|
1057
1071
|
}
|
|
1058
1072
|
/**
|
|
1059
|
-
* Minimal app context shared between vdom and vapor
|
|
1060
|
-
*/
|
|
1073
|
+
* Minimal app context shared between vdom and vapor
|
|
1074
|
+
*/
|
|
1061
1075
|
interface GenericAppContext {
|
|
1062
1076
|
app: App;
|
|
1063
1077
|
config: GenericAppConfig;
|
|
@@ -1065,17 +1079,17 @@ interface GenericAppContext {
|
|
|
1065
1079
|
components?: Record<string, Component>;
|
|
1066
1080
|
directives?: Record<string, Directive>;
|
|
1067
1081
|
/**
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1082
|
+
* HMR only
|
|
1083
|
+
* @internal
|
|
1084
|
+
*/
|
|
1071
1085
|
reload?: () => void;
|
|
1072
1086
|
/**
|
|
1073
|
-
|
|
1074
|
-
|
|
1087
|
+
* @internal vapor interop only
|
|
1088
|
+
*/
|
|
1075
1089
|
vapor?: VaporInVdomInterface;
|
|
1076
1090
|
/**
|
|
1077
|
-
|
|
1078
|
-
|
|
1091
|
+
* @internal vdom interop only
|
|
1092
|
+
*/
|
|
1079
1093
|
vdom?: VdomInVaporInterface;
|
|
1080
1094
|
}
|
|
1081
1095
|
interface AppContext extends GenericAppContext {
|
|
@@ -1084,26 +1098,26 @@ interface AppContext extends GenericAppContext {
|
|
|
1084
1098
|
directives: Record<string, Directive>;
|
|
1085
1099
|
mixins: ComponentOptions[];
|
|
1086
1100
|
/**
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1101
|
+
* Cache for merged/normalized component options
|
|
1102
|
+
* Each app instance has its own cache because app-level global mixins and
|
|
1103
|
+
* optionMergeStrategies can affect merge behavior.
|
|
1104
|
+
* @internal
|
|
1105
|
+
*/
|
|
1092
1106
|
optionsCache: WeakMap<ComponentOptions, MergedComponentOptions>;
|
|
1093
1107
|
/**
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1108
|
+
* Cache for normalized props options
|
|
1109
|
+
* @internal
|
|
1110
|
+
*/
|
|
1097
1111
|
propsCache: WeakMap<ConcreteComponent, NormalizedPropsOptions>;
|
|
1098
1112
|
/**
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1113
|
+
* Cache for normalized emits options
|
|
1114
|
+
* @internal
|
|
1115
|
+
*/
|
|
1102
1116
|
emitsCache: WeakMap<ConcreteComponent, ObjectEmitsOptions | null>;
|
|
1103
1117
|
/**
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1118
|
+
* v2 compat only
|
|
1119
|
+
* @internal
|
|
1120
|
+
*/
|
|
1107
1121
|
filters?: Record<string, Function>;
|
|
1108
1122
|
}
|
|
1109
1123
|
type PluginInstallFunction<Options = any[]> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
@@ -1111,7 +1125,7 @@ type ObjectPlugin<Options = any[]> = {
|
|
|
1111
1125
|
install: PluginInstallFunction<Options>;
|
|
1112
1126
|
};
|
|
1113
1127
|
type FunctionPlugin<Options = any[]> = PluginInstallFunction<Options> & Partial<ObjectPlugin<Options>>;
|
|
1114
|
-
type Plugin<Options = any[], P extends unknown[] =
|
|
1128
|
+
type Plugin<Options = any[], P extends unknown[] = Options extends unknown[] ? Options : [Options]> = FunctionPlugin<P> | ObjectPlugin<P>;
|
|
1115
1129
|
//#endregion
|
|
1116
1130
|
//#region packages/runtime-core/src/components/Teleport.d.ts
|
|
1117
1131
|
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
@@ -1124,12 +1138,7 @@ declare const TeleportImpl: {
|
|
|
1124
1138
|
name: string;
|
|
1125
1139
|
__isTeleport: boolean;
|
|
1126
1140
|
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;
|
|
1141
|
+
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
|
|
1133
1142
|
move: typeof moveTeleport;
|
|
1134
1143
|
hydrate: typeof hydrateTeleport;
|
|
1135
1144
|
};
|
|
@@ -1138,21 +1147,8 @@ declare enum TeleportMoveTypes {
|
|
|
1138
1147
|
TOGGLE = 1,
|
|
1139
1148
|
REORDER = 2
|
|
1140
1149
|
}
|
|
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;
|
|
1150
|
+
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, parentComponent: ComponentInternalInstance | null, moveType?: TeleportMoveTypes): void;
|
|
1151
|
+
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
1152
|
declare const Teleport: {
|
|
1157
1153
|
__isTeleport: true;
|
|
1158
1154
|
new (): {
|
|
@@ -1178,20 +1174,20 @@ type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typ
|
|
|
1178
1174
|
type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
|
1179
1175
|
type VNodeNormalizedRefAtom = {
|
|
1180
1176
|
/**
|
|
1181
|
-
|
|
1182
|
-
|
|
1177
|
+
* component instance
|
|
1178
|
+
*/
|
|
1183
1179
|
i: ComponentInternalInstance;
|
|
1184
1180
|
/**
|
|
1185
|
-
|
|
1186
|
-
|
|
1181
|
+
* Actual ref
|
|
1182
|
+
*/
|
|
1187
1183
|
r: VNodeRef;
|
|
1188
1184
|
/**
|
|
1189
|
-
|
|
1190
|
-
|
|
1185
|
+
* setup ref key
|
|
1186
|
+
*/
|
|
1191
1187
|
k?: string;
|
|
1192
1188
|
/**
|
|
1193
|
-
|
|
1194
|
-
|
|
1189
|
+
* refInFor marker
|
|
1190
|
+
*/
|
|
1195
1191
|
f?: boolean;
|
|
1196
1192
|
};
|
|
1197
1193
|
type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
|
|
@@ -1217,36 +1213,36 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
|
|
|
1217
1213
|
[key: string]: any;
|
|
1218
1214
|
}> {
|
|
1219
1215
|
/**
|
|
1220
|
-
|
|
1221
|
-
|
|
1216
|
+
* @internal
|
|
1217
|
+
*/
|
|
1222
1218
|
__v_isVNode: true;
|
|
1223
1219
|
/**
|
|
1224
|
-
|
|
1225
|
-
|
|
1220
|
+
* @internal
|
|
1221
|
+
*/
|
|
1226
1222
|
[ReactiveFlags$1.SKIP]: true;
|
|
1227
1223
|
type: VNodeTypes;
|
|
1228
1224
|
props: (VNodeProps & ExtraProps) | null;
|
|
1229
1225
|
key: PropertyKey | null;
|
|
1230
1226
|
ref: VNodeNormalizedRef | null;
|
|
1231
1227
|
/**
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1228
|
+
* SFC only. This is assigned on vnode creation using currentScopeId
|
|
1229
|
+
* which is set alongside currentRenderingInstance.
|
|
1230
|
+
*/
|
|
1235
1231
|
scopeId: string | null;
|
|
1236
1232
|
/**
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1233
|
+
* SFC only. This is assigned to:
|
|
1234
|
+
* - Slot fragment vnodes with :slotted SFC styles.
|
|
1235
|
+
* - Component vnodes (during patch/hydration) so that its root node can
|
|
1236
|
+
* inherit the component's slotScopeIds
|
|
1237
|
+
* @internal
|
|
1238
|
+
*/
|
|
1243
1239
|
slotScopeIds: string[] | null;
|
|
1244
1240
|
/**
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1241
|
+
* Root-only scope ids published by the vapor interop onto vnodes serving
|
|
1242
|
+
* as a vapor component's effective root; consumed by getInheritedScopeIds
|
|
1243
|
+
* where the effective-root chain tops out (before insertion).
|
|
1244
|
+
* @internal
|
|
1245
|
+
*/
|
|
1250
1246
|
vaporScopeIds?: string[];
|
|
1251
1247
|
children: VNodeNormalizedChildren;
|
|
1252
1248
|
component: ComponentInternalInstance | null;
|
|
@@ -1259,59 +1255,59 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
|
|
|
1259
1255
|
targetStart: HostNode | null;
|
|
1260
1256
|
targetAnchor: HostNode | null;
|
|
1261
1257
|
/**
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1258
|
+
* number of elements contained in a static vnode
|
|
1259
|
+
* @internal
|
|
1260
|
+
*/
|
|
1265
1261
|
staticCount: number;
|
|
1266
1262
|
suspense: SuspenseBoundary | null;
|
|
1267
1263
|
/**
|
|
1268
|
-
|
|
1269
|
-
|
|
1264
|
+
* @internal
|
|
1265
|
+
*/
|
|
1270
1266
|
ssContent: VNode | null;
|
|
1271
1267
|
/**
|
|
1272
|
-
|
|
1273
|
-
|
|
1268
|
+
* @internal
|
|
1269
|
+
*/
|
|
1274
1270
|
ssFallback: VNode | null;
|
|
1275
1271
|
shapeFlag: number;
|
|
1276
1272
|
patchFlag: number;
|
|
1277
1273
|
/**
|
|
1278
|
-
|
|
1279
|
-
|
|
1274
|
+
* @internal
|
|
1275
|
+
*/
|
|
1280
1276
|
dynamicProps: string[] | null;
|
|
1281
1277
|
/**
|
|
1282
|
-
|
|
1283
|
-
|
|
1278
|
+
* @internal
|
|
1279
|
+
*/
|
|
1284
1280
|
dynamicChildren: (VNode[] & {
|
|
1285
1281
|
hasOnce?: boolean;
|
|
1286
1282
|
}) | null;
|
|
1287
1283
|
appContext: AppContext | null;
|
|
1288
1284
|
/**
|
|
1289
|
-
|
|
1290
|
-
|
|
1285
|
+
* @internal lexical scope owner instance
|
|
1286
|
+
*/
|
|
1291
1287
|
ctx: ComponentInternalInstance | null;
|
|
1292
1288
|
/**
|
|
1293
|
-
|
|
1294
|
-
|
|
1289
|
+
* @internal attached by v-memo
|
|
1290
|
+
*/
|
|
1295
1291
|
memo?: any[];
|
|
1296
1292
|
/**
|
|
1297
|
-
|
|
1298
|
-
|
|
1293
|
+
* @internal index for cleaning v-memo cache
|
|
1294
|
+
*/
|
|
1299
1295
|
cacheIndex?: number;
|
|
1300
1296
|
/**
|
|
1301
|
-
|
|
1302
|
-
|
|
1297
|
+
* @internal __COMPAT__ only
|
|
1298
|
+
*/
|
|
1303
1299
|
isCompatRoot?: true;
|
|
1304
1300
|
/**
|
|
1305
|
-
|
|
1306
|
-
|
|
1301
|
+
* @internal custom element interception hook
|
|
1302
|
+
*/
|
|
1307
1303
|
ce?: (instance: ComponentInternalInstance) => void;
|
|
1308
1304
|
/**
|
|
1309
|
-
|
|
1310
|
-
|
|
1305
|
+
* @internal VDOM in Vapor interop hook
|
|
1306
|
+
*/
|
|
1311
1307
|
vi?: (instance: ComponentInternalInstance) => void;
|
|
1312
1308
|
/**
|
|
1313
|
-
|
|
1314
|
-
|
|
1309
|
+
* @internal Vapor slot in VDOM metadata
|
|
1310
|
+
*/
|
|
1315
1311
|
vs?: {
|
|
1316
1312
|
slot: (props: any) => any;
|
|
1317
1313
|
fallback: (() => VNodeArrayChildren) | undefined;
|
|
@@ -1321,53 +1317,66 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
|
|
|
1321
1317
|
scope?: EffectScope;
|
|
1322
1318
|
};
|
|
1323
1319
|
/**
|
|
1324
|
-
|
|
1325
|
-
|
|
1320
|
+
* @internal Vapor slot Block
|
|
1321
|
+
*/
|
|
1326
1322
|
vb?: any;
|
|
1323
|
+
/**
|
|
1324
|
+
* @internal vapor interop only — internal before-update notification, fired
|
|
1325
|
+
* before this vnode is patched (alongside onVnodeBeforeUpdate). Single-owner:
|
|
1326
|
+
* the interop layer assigns (never appends) so re-tracking replaces the
|
|
1327
|
+
* previous callback.
|
|
1328
|
+
*/
|
|
1329
|
+
ibu?: () => void;
|
|
1330
|
+
/**
|
|
1331
|
+
* @internal vapor interop only — internal updated notification, fired after
|
|
1332
|
+
* this vnode is patched (alongside onVnodeUpdated) so the interop layer can
|
|
1333
|
+
* refresh its snapshot of the DOM range. Single-owner; see `ibu`.
|
|
1334
|
+
*/
|
|
1335
|
+
iu?: () => void;
|
|
1327
1336
|
}
|
|
1328
1337
|
//#endregion
|
|
1329
1338
|
//#region packages/runtime-core/src/component.d.ts
|
|
1330
1339
|
type Data = Record<string, unknown>;
|
|
1331
1340
|
/**
|
|
1332
|
-
* For extending allowed non-declared attrs on components in TSX
|
|
1333
|
-
*/
|
|
1341
|
+
* For extending allowed non-declared attrs on components in TSX
|
|
1342
|
+
*/
|
|
1334
1343
|
interface AllowedAttrs {}
|
|
1335
1344
|
type Attrs = Data & AllowedAttrs;
|
|
1336
1345
|
/**
|
|
1337
|
-
* For extending allowed non-declared props on components in TSX
|
|
1338
|
-
*/
|
|
1346
|
+
* For extending allowed non-declared props on components in TSX
|
|
1347
|
+
*/
|
|
1339
1348
|
interface ComponentCustomProps {}
|
|
1340
1349
|
/**
|
|
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
|
-
*/
|
|
1350
|
+
* For globally defined Directives
|
|
1351
|
+
* Here is an example of adding a directive `VTooltip` as global directive:
|
|
1352
|
+
*
|
|
1353
|
+
* @example
|
|
1354
|
+
* ```ts
|
|
1355
|
+
* import VTooltip from 'v-tooltip'
|
|
1356
|
+
*
|
|
1357
|
+
* declare module '@vue/runtime-core' {
|
|
1358
|
+
* interface GlobalDirectives {
|
|
1359
|
+
* VTooltip
|
|
1360
|
+
* }
|
|
1361
|
+
* }
|
|
1362
|
+
* ```
|
|
1363
|
+
*/
|
|
1355
1364
|
interface GlobalDirectives {}
|
|
1356
1365
|
/**
|
|
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
|
-
*/
|
|
1366
|
+
* For globally defined Components
|
|
1367
|
+
* Here is an example of adding a component `RouterView` as global component:
|
|
1368
|
+
*
|
|
1369
|
+
* @example
|
|
1370
|
+
* ```ts
|
|
1371
|
+
* import { RouterView } from 'vue-router'
|
|
1372
|
+
*
|
|
1373
|
+
* declare module '@vue/runtime-core' {
|
|
1374
|
+
* interface GlobalComponents {
|
|
1375
|
+
* RouterView
|
|
1376
|
+
* }
|
|
1377
|
+
* }
|
|
1378
|
+
* ```
|
|
1379
|
+
*/
|
|
1371
1380
|
interface GlobalComponents {
|
|
1372
1381
|
Teleport: DefineComponent<TeleportProps>;
|
|
1373
1382
|
Suspense: DefineComponent<SuspenseProps>;
|
|
@@ -1375,65 +1384,65 @@ interface GlobalComponents {
|
|
|
1375
1384
|
BaseTransition: DefineComponent<BaseTransitionProps>;
|
|
1376
1385
|
}
|
|
1377
1386
|
/**
|
|
1378
|
-
* Default allowed non-declared props on component in TSX
|
|
1379
|
-
*/
|
|
1387
|
+
* Default allowed non-declared props on component in TSX
|
|
1388
|
+
*/
|
|
1380
1389
|
interface AllowedComponentProps {
|
|
1381
1390
|
class?: unknown;
|
|
1382
1391
|
style?: unknown;
|
|
1383
1392
|
}
|
|
1384
1393
|
interface ComponentInternalOptions {
|
|
1385
1394
|
/**
|
|
1386
|
-
|
|
1387
|
-
|
|
1395
|
+
* indicates vapor component
|
|
1396
|
+
*/
|
|
1388
1397
|
__vapor?: boolean;
|
|
1389
1398
|
/**
|
|
1390
|
-
|
|
1391
|
-
|
|
1399
|
+
* whether this vapor component has multiple root nodes
|
|
1400
|
+
*/
|
|
1392
1401
|
__multiRoot?: boolean;
|
|
1393
1402
|
/**
|
|
1394
|
-
|
|
1395
|
-
|
|
1403
|
+
* indicates keep-alive component
|
|
1404
|
+
*/
|
|
1396
1405
|
__isKeepAlive?: boolean;
|
|
1397
1406
|
/**
|
|
1398
|
-
|
|
1399
|
-
|
|
1407
|
+
* @internal
|
|
1408
|
+
*/
|
|
1400
1409
|
__scopeId?: string;
|
|
1401
1410
|
/**
|
|
1402
|
-
|
|
1403
|
-
|
|
1411
|
+
* @internal
|
|
1412
|
+
*/
|
|
1404
1413
|
__cssModules?: Data;
|
|
1405
1414
|
/**
|
|
1406
|
-
|
|
1407
|
-
|
|
1415
|
+
* @internal
|
|
1416
|
+
*/
|
|
1408
1417
|
__hmrId?: string;
|
|
1409
1418
|
/**
|
|
1410
|
-
|
|
1411
|
-
|
|
1419
|
+
* Compat build only, for bailing out of certain compatibility behavior
|
|
1420
|
+
*/
|
|
1412
1421
|
__isBuiltIn?: boolean;
|
|
1413
1422
|
/**
|
|
1414
|
-
|
|
1415
|
-
|
|
1423
|
+
* This one should be exposed so that devtools can make use of it
|
|
1424
|
+
*/
|
|
1416
1425
|
__file?: string;
|
|
1417
1426
|
/**
|
|
1418
|
-
|
|
1419
|
-
|
|
1427
|
+
* name inferred from filename
|
|
1428
|
+
*/
|
|
1420
1429
|
__name?: string;
|
|
1421
1430
|
}
|
|
1422
1431
|
interface AsyncComponentInternalOptions<R = ConcreteComponent, I = ComponentInternalInstance> {
|
|
1423
1432
|
/**
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1433
|
+
* marker for AsyncComponentWrapper
|
|
1434
|
+
* @internal
|
|
1435
|
+
*/
|
|
1427
1436
|
__asyncLoader?: () => Promise<R>;
|
|
1428
1437
|
/**
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1438
|
+
* the inner component resolved by the AsyncComponentWrapper
|
|
1439
|
+
* @internal
|
|
1440
|
+
*/
|
|
1432
1441
|
__asyncResolved?: R;
|
|
1433
1442
|
/**
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1443
|
+
* Exposed for lazy hydration
|
|
1444
|
+
* @internal
|
|
1445
|
+
*/
|
|
1437
1446
|
__asyncHydrate?: (el: Element, instance: I, hydrate: () => void) => void;
|
|
1438
1447
|
}
|
|
1439
1448
|
interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions {
|
|
@@ -1446,24 +1455,24 @@ interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, an
|
|
|
1446
1455
|
compatConfig?: CompatConfig;
|
|
1447
1456
|
}
|
|
1448
1457
|
/**
|
|
1449
|
-
* Type used where a function accepts both vdom and vapor components.
|
|
1450
|
-
*/
|
|
1458
|
+
* Type used where a function accepts both vdom and vapor components.
|
|
1459
|
+
*/
|
|
1451
1460
|
type GenericComponent = ({
|
|
1452
1461
|
name?: string;
|
|
1453
1462
|
} | ((() => any) & {
|
|
1454
1463
|
displayName?: string;
|
|
1455
1464
|
})) & ComponentInternalOptions;
|
|
1456
1465
|
/**
|
|
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
|
-
*/
|
|
1466
|
+
* Concrete component type matches its actual value: it's either an options
|
|
1467
|
+
* object, or a function. Use this where the code expects to work with actual
|
|
1468
|
+
* values, e.g. checking if its a function or not. This is mostly for internal
|
|
1469
|
+
* implementation code.
|
|
1470
|
+
*/
|
|
1462
1471
|
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
1472
|
/**
|
|
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
|
-
*/
|
|
1473
|
+
* A type used in public APIs where a component type is expected.
|
|
1474
|
+
* The constructor type is an artificial type returned by defineComponent().
|
|
1475
|
+
*/
|
|
1467
1476
|
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
1477
|
type LifecycleHook<TFn = Function> = (TFn & SchedulerJob)[] | null;
|
|
1469
1478
|
type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
@@ -1473,8 +1482,8 @@ type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ?
|
|
|
1473
1482
|
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
|
1474
1483
|
} : never;
|
|
1475
1484
|
/**
|
|
1476
|
-
* @internal
|
|
1477
|
-
*/
|
|
1485
|
+
* @internal
|
|
1486
|
+
*/
|
|
1478
1487
|
type InternalRenderFunction = {
|
|
1479
1488
|
(ctx: ComponentPublicInstance, cache: ComponentInternalInstance["renderCache"], $props: ComponentInternalInstance["props"], $setup: ComponentInternalInstance["setupState"], $data: ComponentInternalInstance["data"], $options: ComponentInternalInstance["ctx"]): VNodeChild;
|
|
1480
1489
|
_rc?: boolean;
|
|
@@ -1482,10 +1491,10 @@ type InternalRenderFunction = {
|
|
|
1482
1491
|
_compatWrapped?: boolean;
|
|
1483
1492
|
};
|
|
1484
1493
|
/**
|
|
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
|
-
*/
|
|
1494
|
+
* Base component instance interface that is shared between vdom mode and vapor
|
|
1495
|
+
* mode, so that we can have a mixed instance tree and reuse core logic that
|
|
1496
|
+
* operate on both.
|
|
1497
|
+
*/
|
|
1489
1498
|
interface GenericComponentInstance {
|
|
1490
1499
|
vapor?: boolean;
|
|
1491
1500
|
uid: number;
|
|
@@ -1494,202 +1503,202 @@ interface GenericComponentInstance {
|
|
|
1494
1503
|
parent: GenericComponentInstance | null;
|
|
1495
1504
|
appContext: GenericAppContext;
|
|
1496
1505
|
/**
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1506
|
+
* Object containing values this component provides for its descendants
|
|
1507
|
+
* @internal
|
|
1508
|
+
*/
|
|
1500
1509
|
provides: Data;
|
|
1501
1510
|
/**
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1511
|
+
* Tracking reactive effects (e.g. watchers) associated with this component
|
|
1512
|
+
* so that they can be automatically stopped on component unmount
|
|
1513
|
+
* @internal
|
|
1514
|
+
*/
|
|
1506
1515
|
scope: EffectScope;
|
|
1507
1516
|
/**
|
|
1508
|
-
|
|
1509
|
-
|
|
1517
|
+
* render function will have different types between vdom and vapor
|
|
1518
|
+
*/
|
|
1510
1519
|
render?: Function | null;
|
|
1511
1520
|
/**
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1521
|
+
* SSR render function
|
|
1522
|
+
* (they are the same between vdom and vapor components.)
|
|
1523
|
+
* @internal
|
|
1524
|
+
*/
|
|
1516
1525
|
ssrRender?: Function | null;
|
|
1517
1526
|
props: Data;
|
|
1518
1527
|
attrs: Data;
|
|
1519
1528
|
refs: Data;
|
|
1520
1529
|
emit: EmitFn;
|
|
1521
1530
|
/**
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1531
|
+
* used for keeping track of .once event handlers on components
|
|
1532
|
+
* @internal
|
|
1533
|
+
*/
|
|
1525
1534
|
emitted: Record<string, boolean> | null;
|
|
1526
1535
|
/**
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1536
|
+
* used for caching the value returned from props default factory functions to
|
|
1537
|
+
* avoid unnecessary watcher trigger
|
|
1538
|
+
* @internal
|
|
1539
|
+
*/
|
|
1531
1540
|
propsDefaults: Data | null;
|
|
1532
1541
|
/**
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1542
|
+
* used for getting the keys of a component's raw props, vapor only
|
|
1543
|
+
* @internal
|
|
1544
|
+
*/
|
|
1536
1545
|
rawKeys?: () => string[];
|
|
1537
1546
|
exposed: Record<string, any> | null;
|
|
1538
1547
|
exposeProxy: Record<string, any> | null;
|
|
1539
1548
|
/**
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1549
|
+
* setup related
|
|
1550
|
+
* @internal
|
|
1551
|
+
*/
|
|
1543
1552
|
setupState?: Data;
|
|
1544
1553
|
/**
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1554
|
+
* devtools access to additional info
|
|
1555
|
+
* @internal
|
|
1556
|
+
*/
|
|
1548
1557
|
devtoolsRawSetupState?: any;
|
|
1549
1558
|
isMounted: boolean;
|
|
1550
1559
|
isUnmounted: boolean;
|
|
1551
1560
|
isDeactivated: boolean;
|
|
1552
1561
|
/**
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1562
|
+
* for tracking useId()
|
|
1563
|
+
* first element is the current boundary prefix
|
|
1564
|
+
* second number is the index of the useId call within that boundary
|
|
1565
|
+
* @internal
|
|
1566
|
+
*/
|
|
1558
1567
|
ids: [string, number, number];
|
|
1559
1568
|
/**
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1569
|
+
* resolved props options
|
|
1570
|
+
* @internal
|
|
1571
|
+
*/
|
|
1563
1572
|
propsOptions?: NormalizedPropsOptions;
|
|
1564
1573
|
/**
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1574
|
+
* resolved emits options
|
|
1575
|
+
* @internal
|
|
1576
|
+
*/
|
|
1568
1577
|
emitsOptions?: ObjectEmitsOptions | null;
|
|
1569
1578
|
/**
|
|
1570
|
-
|
|
1571
|
-
|
|
1579
|
+
* Public instance proxy, vdom only
|
|
1580
|
+
*/
|
|
1572
1581
|
proxy?: any;
|
|
1573
1582
|
/**
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1583
|
+
* suspense related
|
|
1584
|
+
* @internal
|
|
1585
|
+
*/
|
|
1577
1586
|
suspense: SuspenseBoundary | null;
|
|
1578
1587
|
/**
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1588
|
+
* suspense pending batch id
|
|
1589
|
+
* @internal
|
|
1590
|
+
*/
|
|
1582
1591
|
suspenseId: number;
|
|
1583
1592
|
/**
|
|
1584
|
-
|
|
1585
|
-
|
|
1593
|
+
* @internal
|
|
1594
|
+
*/
|
|
1586
1595
|
asyncDep: Promise<any> | null;
|
|
1587
1596
|
/**
|
|
1588
|
-
|
|
1589
|
-
|
|
1597
|
+
* @internal
|
|
1598
|
+
*/
|
|
1590
1599
|
asyncResolved: boolean;
|
|
1591
1600
|
/**
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1601
|
+
* restore renderer-specific async context after `withAsyncContext()`
|
|
1602
|
+
* @internal
|
|
1603
|
+
*/
|
|
1595
1604
|
restoreAsyncContext?: () => void | (() => void);
|
|
1596
1605
|
/**
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1606
|
+
* `updateTeleportCssVars`
|
|
1607
|
+
* For updating css vars on contained teleports
|
|
1608
|
+
* @internal
|
|
1609
|
+
*/
|
|
1601
1610
|
ut?: (vars?: Record<string, string>) => void;
|
|
1602
1611
|
/**
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1612
|
+
* dev only. For style v-bind hydration mismatch checks
|
|
1613
|
+
* @internal
|
|
1614
|
+
*/
|
|
1606
1615
|
getCssVars?: () => Record<string, string>;
|
|
1607
1616
|
/**
|
|
1608
|
-
|
|
1609
|
-
|
|
1617
|
+
* @internal
|
|
1618
|
+
*/
|
|
1610
1619
|
[LifecycleHooks.BEFORE_CREATE]?: LifecycleHook;
|
|
1611
1620
|
/**
|
|
1612
|
-
|
|
1613
|
-
|
|
1621
|
+
* @internal
|
|
1622
|
+
*/
|
|
1614
1623
|
[LifecycleHooks.CREATED]?: LifecycleHook;
|
|
1615
1624
|
/**
|
|
1616
|
-
|
|
1617
|
-
|
|
1625
|
+
* @internal
|
|
1626
|
+
*/
|
|
1618
1627
|
[LifecycleHooks.BEFORE_MOUNT]?: LifecycleHook;
|
|
1619
1628
|
/**
|
|
1620
|
-
|
|
1621
|
-
|
|
1629
|
+
* @internal
|
|
1630
|
+
*/
|
|
1622
1631
|
[LifecycleHooks.MOUNTED]?: LifecycleHook;
|
|
1623
1632
|
/**
|
|
1624
|
-
|
|
1625
|
-
|
|
1633
|
+
* @internal
|
|
1634
|
+
*/
|
|
1626
1635
|
[LifecycleHooks.BEFORE_UPDATE]?: LifecycleHook;
|
|
1627
1636
|
/**
|
|
1628
|
-
|
|
1629
|
-
|
|
1637
|
+
* @internal
|
|
1638
|
+
*/
|
|
1630
1639
|
[LifecycleHooks.UPDATED]?: LifecycleHook;
|
|
1631
1640
|
/**
|
|
1632
|
-
|
|
1633
|
-
|
|
1641
|
+
* @internal
|
|
1642
|
+
*/
|
|
1634
1643
|
[LifecycleHooks.BEFORE_UNMOUNT]?: LifecycleHook;
|
|
1635
1644
|
/**
|
|
1636
|
-
|
|
1637
|
-
|
|
1645
|
+
* @internal
|
|
1646
|
+
*/
|
|
1638
1647
|
[LifecycleHooks.UNMOUNTED]?: LifecycleHook;
|
|
1639
1648
|
/**
|
|
1640
|
-
|
|
1641
|
-
|
|
1649
|
+
* @internal
|
|
1650
|
+
*/
|
|
1642
1651
|
[LifecycleHooks.RENDER_TRACKED]?: LifecycleHook;
|
|
1643
1652
|
/**
|
|
1644
|
-
|
|
1645
|
-
|
|
1653
|
+
* @internal
|
|
1654
|
+
*/
|
|
1646
1655
|
[LifecycleHooks.RENDER_TRIGGERED]?: LifecycleHook;
|
|
1647
1656
|
/**
|
|
1648
|
-
|
|
1649
|
-
|
|
1657
|
+
* @internal
|
|
1658
|
+
*/
|
|
1650
1659
|
[LifecycleHooks.ACTIVATED]?: LifecycleHook;
|
|
1651
1660
|
/**
|
|
1652
|
-
|
|
1653
|
-
|
|
1661
|
+
* @internal
|
|
1662
|
+
*/
|
|
1654
1663
|
[LifecycleHooks.DEACTIVATED]?: LifecycleHook;
|
|
1655
1664
|
/**
|
|
1656
|
-
|
|
1657
|
-
|
|
1665
|
+
* @internal
|
|
1666
|
+
*/
|
|
1658
1667
|
[LifecycleHooks.ERROR_CAPTURED]?: LifecycleHook;
|
|
1659
1668
|
/**
|
|
1660
|
-
|
|
1661
|
-
|
|
1669
|
+
* @internal
|
|
1670
|
+
*/
|
|
1662
1671
|
[LifecycleHooks.SERVER_PREFETCH]?: LifecycleHook<() => Promise<unknown>>;
|
|
1663
1672
|
/**
|
|
1664
|
-
|
|
1665
|
-
|
|
1673
|
+
* @internal vapor only
|
|
1674
|
+
*/
|
|
1666
1675
|
hmrRerender?: () => void;
|
|
1667
1676
|
/**
|
|
1668
|
-
|
|
1669
|
-
|
|
1677
|
+
* @internal vapor only
|
|
1678
|
+
*/
|
|
1670
1679
|
hmrReload?: (newComp: any) => void;
|
|
1671
1680
|
vnode?: VNode;
|
|
1672
1681
|
subTree?: VNode;
|
|
1673
1682
|
/**
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1683
|
+
* Custom Element instance (if component is created by defineCustomElement)
|
|
1684
|
+
* @internal
|
|
1685
|
+
*/
|
|
1677
1686
|
ce?: ComponentCustomElementInterface;
|
|
1678
1687
|
/**
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1688
|
+
* is custom element? (kept only for compatibility)
|
|
1689
|
+
* @internal
|
|
1690
|
+
*/
|
|
1682
1691
|
isCE?: boolean;
|
|
1683
1692
|
/**
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1693
|
+
* custom element specific HMR method
|
|
1694
|
+
* @internal
|
|
1695
|
+
*/
|
|
1687
1696
|
ceReload?: (newStyles?: string[]) => void;
|
|
1688
1697
|
}
|
|
1689
1698
|
/**
|
|
1690
|
-
* We expose a subset of properties on the internal instance as they are
|
|
1691
|
-
* useful for advanced external libraries and tools.
|
|
1692
|
-
*/
|
|
1699
|
+
* We expose a subset of properties on the internal instance as they are
|
|
1700
|
+
* useful for advanced external libraries and tools.
|
|
1701
|
+
*/
|
|
1693
1702
|
interface ComponentInternalInstance extends GenericComponentInstance {
|
|
1694
1703
|
vapor?: never;
|
|
1695
1704
|
uid: number;
|
|
@@ -1698,84 +1707,84 @@ interface ComponentInternalInstance extends GenericComponentInstance {
|
|
|
1698
1707
|
root: GenericComponentInstance;
|
|
1699
1708
|
appContext: AppContext;
|
|
1700
1709
|
/**
|
|
1701
|
-
|
|
1702
|
-
|
|
1710
|
+
* Vnode representing this component in its parent's vdom tree
|
|
1711
|
+
*/
|
|
1703
1712
|
vnode: VNode;
|
|
1704
1713
|
/**
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1714
|
+
* The pending new vnode from parent updates
|
|
1715
|
+
* @internal
|
|
1716
|
+
*/
|
|
1708
1717
|
next: VNode | null;
|
|
1709
1718
|
/**
|
|
1710
|
-
|
|
1711
|
-
|
|
1719
|
+
* Root vnode of this component's own vdom tree
|
|
1720
|
+
*/
|
|
1712
1721
|
subTree: VNode;
|
|
1713
1722
|
/**
|
|
1714
|
-
|
|
1715
|
-
|
|
1723
|
+
* Render effect instance
|
|
1724
|
+
*/
|
|
1716
1725
|
effect: ReactiveEffect;
|
|
1717
1726
|
/**
|
|
1718
|
-
|
|
1719
|
-
|
|
1727
|
+
* Force update render effect
|
|
1728
|
+
*/
|
|
1720
1729
|
update: () => void;
|
|
1721
1730
|
/**
|
|
1722
|
-
|
|
1723
|
-
|
|
1731
|
+
* Render effect job to be passed to scheduler (checks if dirty)
|
|
1732
|
+
*/
|
|
1724
1733
|
job: SchedulerJob;
|
|
1725
1734
|
/**
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1735
|
+
* The render function that returns vdom tree.
|
|
1736
|
+
* @internal
|
|
1737
|
+
*/
|
|
1729
1738
|
render: InternalRenderFunction | null;
|
|
1730
1739
|
/**
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1740
|
+
* cache for proxy access type to avoid hasOwnProperty calls
|
|
1741
|
+
* @internal
|
|
1742
|
+
*/
|
|
1734
1743
|
accessCache: Data | null;
|
|
1735
1744
|
/**
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1745
|
+
* cache for render function values that rely on _ctx but won't need updates
|
|
1746
|
+
* after initialized (e.g. inline handlers)
|
|
1747
|
+
* @internal
|
|
1748
|
+
*/
|
|
1740
1749
|
renderCache: (Function | VNode | undefined)[];
|
|
1741
1750
|
/**
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1751
|
+
* Resolved component registry, only for components with mixins or extends
|
|
1752
|
+
* @internal
|
|
1753
|
+
*/
|
|
1745
1754
|
components: Record<string, ConcreteComponent> | null;
|
|
1746
1755
|
/**
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1756
|
+
* Resolved directive registry, only for components with mixins or extends
|
|
1757
|
+
* @internal
|
|
1758
|
+
*/
|
|
1750
1759
|
directives: Record<string, Directive> | null;
|
|
1751
1760
|
/**
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1761
|
+
* Resolved filters registry, v2 compat only
|
|
1762
|
+
* @internal
|
|
1763
|
+
*/
|
|
1755
1764
|
filters?: Record<string, Function>;
|
|
1756
1765
|
/**
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1766
|
+
* resolved props options
|
|
1767
|
+
* @internal
|
|
1768
|
+
*/
|
|
1760
1769
|
propsOptions: NormalizedPropsOptions;
|
|
1761
1770
|
/**
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1771
|
+
* resolved emits options
|
|
1772
|
+
* @internal
|
|
1773
|
+
*/
|
|
1765
1774
|
emitsOptions: ObjectEmitsOptions | null;
|
|
1766
1775
|
/**
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1776
|
+
* resolved inheritAttrs options
|
|
1777
|
+
* @internal
|
|
1778
|
+
*/
|
|
1770
1779
|
inheritAttrs?: boolean;
|
|
1771
1780
|
/**
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1781
|
+
* setup related
|
|
1782
|
+
* @internal
|
|
1783
|
+
*/
|
|
1775
1784
|
setupState: Data;
|
|
1776
1785
|
/**
|
|
1777
|
-
|
|
1778
|
-
|
|
1786
|
+
* @internal
|
|
1787
|
+
*/
|
|
1779
1788
|
setupContext?: SetupContext | null;
|
|
1780
1789
|
proxy: ComponentPublicInstance | null;
|
|
1781
1790
|
data: Data;
|
|
@@ -1783,79 +1792,79 @@ interface ComponentInternalInstance extends GenericComponentInstance {
|
|
|
1783
1792
|
slots: InternalSlots;
|
|
1784
1793
|
exposeProxy: Record<string, any> | null;
|
|
1785
1794
|
/**
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1795
|
+
* alternative proxy used only for runtime-compiled render functions using
|
|
1796
|
+
* `with` block
|
|
1797
|
+
* @internal
|
|
1798
|
+
*/
|
|
1790
1799
|
withProxy: ComponentPublicInstance | null;
|
|
1791
1800
|
/**
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1801
|
+
* This is the target for the public instance proxy. It also holds properties
|
|
1802
|
+
* injected by user options (computed, methods etc.) and user-attached
|
|
1803
|
+
* custom properties (via `this.x = ...`)
|
|
1804
|
+
* @internal
|
|
1805
|
+
*/
|
|
1797
1806
|
ctx: Data;
|
|
1798
1807
|
/**
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1808
|
+
* suspense pending batch id
|
|
1809
|
+
* @internal
|
|
1810
|
+
*/
|
|
1802
1811
|
suspenseId: number;
|
|
1803
1812
|
/**
|
|
1804
|
-
|
|
1805
|
-
|
|
1813
|
+
* @internal
|
|
1814
|
+
*/
|
|
1806
1815
|
asyncDep: Promise<any> | null;
|
|
1807
1816
|
/**
|
|
1808
|
-
|
|
1809
|
-
|
|
1817
|
+
* @internal
|
|
1818
|
+
*/
|
|
1810
1819
|
asyncResolved: boolean;
|
|
1811
1820
|
/**
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1821
|
+
* For caching bound $forceUpdate on public proxy access
|
|
1822
|
+
* @internal
|
|
1823
|
+
*/
|
|
1815
1824
|
f?: () => void;
|
|
1816
1825
|
/**
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1826
|
+
* For caching bound $nextTick on public proxy access
|
|
1827
|
+
* @internal
|
|
1828
|
+
*/
|
|
1820
1829
|
n?: () => Promise<void>;
|
|
1821
1830
|
/**
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1831
|
+
* v2 compat only, for caching mutated $options
|
|
1832
|
+
* @internal
|
|
1833
|
+
*/
|
|
1825
1834
|
resolvedOptions?: MergedComponentOptions;
|
|
1826
1835
|
}
|
|
1827
1836
|
interface ComponentCustomElementInterface {
|
|
1828
1837
|
/**
|
|
1829
|
-
|
|
1830
|
-
|
|
1838
|
+
* @internal
|
|
1839
|
+
*/
|
|
1831
1840
|
_isVueCE: boolean;
|
|
1832
1841
|
/**
|
|
1833
|
-
|
|
1834
|
-
|
|
1842
|
+
* @internal
|
|
1843
|
+
*/
|
|
1835
1844
|
_injectChildStyle(type: ConcreteComponent, parent?: ConcreteComponent): void;
|
|
1836
1845
|
/**
|
|
1837
|
-
|
|
1838
|
-
|
|
1846
|
+
* @internal
|
|
1847
|
+
*/
|
|
1839
1848
|
_removeChildStyle(type: ConcreteComponent): void;
|
|
1840
1849
|
/**
|
|
1841
|
-
|
|
1842
|
-
|
|
1850
|
+
* @internal
|
|
1851
|
+
*/
|
|
1843
1852
|
_setProp(key: string, val: any, shouldReflect?: boolean, shouldUpdate?: boolean): void;
|
|
1844
1853
|
/**
|
|
1845
|
-
|
|
1846
|
-
|
|
1854
|
+
* @internal
|
|
1855
|
+
*/
|
|
1847
1856
|
_beginPatch(): void;
|
|
1848
1857
|
/**
|
|
1849
|
-
|
|
1850
|
-
|
|
1858
|
+
* @internal
|
|
1859
|
+
*/
|
|
1851
1860
|
_endPatch(): void;
|
|
1852
1861
|
/**
|
|
1853
|
-
|
|
1854
|
-
|
|
1862
|
+
* @internal attached by the nested Teleport when shadowRoot is false.
|
|
1863
|
+
*/
|
|
1855
1864
|
_teleportTargets?: Set<RendererElement>;
|
|
1856
1865
|
/**
|
|
1857
|
-
|
|
1858
|
-
|
|
1866
|
+
* @internal check if shadow root is enabled
|
|
1867
|
+
*/
|
|
1859
1868
|
_hasShadowRoot(): boolean;
|
|
1860
1869
|
}
|
|
1861
1870
|
//#endregion
|
|
@@ -1872,28 +1881,28 @@ interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
|
|
|
1872
1881
|
//#region packages/runtime-core/src/compat/globalConfig.d.ts
|
|
1873
1882
|
type LegacyConfig = {
|
|
1874
1883
|
/**
|
|
1875
|
-
|
|
1876
|
-
|
|
1884
|
+
* @deprecated `config.silent` option has been removed
|
|
1885
|
+
*/
|
|
1877
1886
|
silent?: boolean;
|
|
1878
1887
|
/**
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1888
|
+
* @deprecated use __VUE_PROD_DEVTOOLS__ compile-time feature flag instead
|
|
1889
|
+
* https://github.com/vuejs/core/tree/main/packages/vue#bundler-build-feature-flags
|
|
1890
|
+
*/
|
|
1882
1891
|
devtools?: boolean;
|
|
1883
1892
|
/**
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1893
|
+
* @deprecated use `config.isCustomElement` instead
|
|
1894
|
+
* https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement
|
|
1895
|
+
*/
|
|
1887
1896
|
ignoredElements?: (string | RegExp)[];
|
|
1888
1897
|
/**
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1898
|
+
* @deprecated
|
|
1899
|
+
* https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html
|
|
1900
|
+
*/
|
|
1892
1901
|
keyCodes?: Record<string, number | number[]>;
|
|
1893
1902
|
/**
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1903
|
+
* @deprecated
|
|
1904
|
+
* https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed
|
|
1905
|
+
*/
|
|
1897
1906
|
productionTip?: boolean;
|
|
1898
1907
|
};
|
|
1899
1908
|
//#endregion
|
|
@@ -1914,10 +1923,10 @@ interface LegacyPublicProperties {
|
|
|
1914
1923
|
//#endregion
|
|
1915
1924
|
//#region packages/runtime-core/src/compat/global.d.ts
|
|
1916
1925
|
/**
|
|
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
|
-
*/
|
|
1926
|
+
* @deprecated the default `Vue` export has been removed in Vue 3. The type for
|
|
1927
|
+
* the default export is provided only for migration purposes. Please use
|
|
1928
|
+
* named imports instead - e.g. `import { createApp } from 'vue'`.
|
|
1929
|
+
*/
|
|
1921
1930
|
type CompatVue = Pick<App, "version" | "component" | "directive"> & {
|
|
1922
1931
|
configureCompat: typeof configureCompat;
|
|
1923
1932
|
new (options?: ComponentOptions): LegacyPublicInstance;
|
|
@@ -1933,40 +1942,40 @@ type CompatVue = Pick<App, "version" | "component" | "directive"> & {
|
|
|
1933
1942
|
directive<T = any, V = any>(name: string, directive: Directive<T, V>): CompatVue;
|
|
1934
1943
|
compile(template: string): RenderFunction;
|
|
1935
1944
|
/**
|
|
1936
|
-
|
|
1937
|
-
|
|
1945
|
+
* @deprecated Vue 3 no longer supports extending constructors.
|
|
1946
|
+
*/
|
|
1938
1947
|
extend: (options?: ComponentOptions) => CompatVue;
|
|
1939
1948
|
/**
|
|
1940
|
-
|
|
1941
|
-
|
|
1949
|
+
* @deprecated Vue 3 no longer needs set() for adding new properties.
|
|
1950
|
+
*/
|
|
1942
1951
|
set(target: any, key: PropertyKey, value: any): void;
|
|
1943
1952
|
/**
|
|
1944
|
-
|
|
1945
|
-
|
|
1953
|
+
* @deprecated Vue 3 no longer needs delete() for property deletions.
|
|
1954
|
+
*/
|
|
1946
1955
|
delete(target: any, key: PropertyKey): void;
|
|
1947
1956
|
/**
|
|
1948
|
-
|
|
1949
|
-
|
|
1957
|
+
* @deprecated use `reactive` instead.
|
|
1958
|
+
*/
|
|
1950
1959
|
observable: typeof reactive;
|
|
1951
1960
|
/**
|
|
1952
|
-
|
|
1953
|
-
|
|
1961
|
+
* @deprecated filters have been removed from Vue 3.
|
|
1962
|
+
*/
|
|
1954
1963
|
filter(name: string, arg?: any): null;
|
|
1955
1964
|
/**
|
|
1956
|
-
|
|
1957
|
-
|
|
1965
|
+
* @internal
|
|
1966
|
+
*/
|
|
1958
1967
|
cid: number;
|
|
1959
1968
|
/**
|
|
1960
|
-
|
|
1961
|
-
|
|
1969
|
+
* @internal
|
|
1970
|
+
*/
|
|
1962
1971
|
options: ComponentOptions;
|
|
1963
1972
|
/**
|
|
1964
|
-
|
|
1965
|
-
|
|
1973
|
+
* @internal
|
|
1974
|
+
*/
|
|
1966
1975
|
util: any;
|
|
1967
1976
|
/**
|
|
1968
|
-
|
|
1969
|
-
|
|
1977
|
+
* @internal
|
|
1978
|
+
*/
|
|
1970
1979
|
super: CompatVue;
|
|
1971
1980
|
};
|
|
1972
1981
|
//#endregion
|
|
@@ -2025,13 +2034,7 @@ type SystemModifiers = (typeof systemModifiers)[number];
|
|
|
2025
2034
|
type CompatModifiers = keyof typeof keyNames;
|
|
2026
2035
|
type VOnModifiers = SystemModifiers | ModifierGuards | CompatModifiers;
|
|
2027
2036
|
type ModifierGuards = "shift" | "ctrl" | "alt" | "meta" | "left" | "right" | "stop" | "prevent" | "self" | "middle" | "exact";
|
|
2028
|
-
/**
|
|
2029
|
-
* @private
|
|
2030
|
-
*/
|
|
2031
2037
|
declare const keyNames: Record<"esc" | "space" | "up" | "left" | "right" | "down" | "delete", string>;
|
|
2032
|
-
/**
|
|
2033
|
-
* @private
|
|
2034
|
-
*/
|
|
2035
2038
|
type VOnDirective = Directive<any, any, VOnModifiers>;
|
|
2036
2039
|
//#endregion
|
|
2037
2040
|
//#region packages/runtime-dom/src/directives/vModel.d.ts
|
|
@@ -2041,7 +2044,7 @@ declare const initialValueKey: unique symbol;
|
|
|
2041
2044
|
type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & {
|
|
2042
2045
|
[assignKey]: AssignerFn;
|
|
2043
2046
|
[initialValueKey]?: string;
|
|
2044
|
-
|
|
2047
|
+
_pendingValue?: [multiple: boolean, value: any];
|
|
2045
2048
|
}, any, Modifiers>;
|
|
2046
2049
|
declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, "trim" | "number" | "lazy">;
|
|
2047
2050
|
declare const vModelCheckbox: ModelDirective<HTMLInputElement>;
|
|
@@ -22224,13 +22227,13 @@ declare namespace DataType {
|
|
|
22224
22227
|
//#region packages/runtime-dom/src/jsx.d.ts
|
|
22225
22228
|
interface CSSProperties extends Properties<string | number>, PropertiesHyphen<string | number> {
|
|
22226
22229
|
/**
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22230
|
-
|
|
22231
|
-
|
|
22232
|
-
|
|
22233
|
-
|
|
22230
|
+
* The index signature was removed to enable closed typing for style
|
|
22231
|
+
* using CSSType. You're able to use type assertion or module augmentation
|
|
22232
|
+
* to add properties or an index signature of your own.
|
|
22233
|
+
*
|
|
22234
|
+
* For examples and more information, visit:
|
|
22235
|
+
* https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
|
|
22236
|
+
*/
|
|
22234
22237
|
[v: `--${string}`]: string | number | undefined;
|
|
22235
22238
|
}
|
|
22236
22239
|
type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>;
|
|
@@ -22238,10 +22241,10 @@ type ClassValue = false | null | undefined | string | Record<string, any> | Arra
|
|
|
22238
22241
|
//#endregion
|
|
22239
22242
|
//#region packages/runtime-dom/src/index.d.ts
|
|
22240
22243
|
/**
|
|
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
|
-
*/
|
|
22244
|
+
* This is a stub implementation to prevent the need to use dom types.
|
|
22245
|
+
*
|
|
22246
|
+
* To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`.
|
|
22247
|
+
*/
|
|
22245
22248
|
type DomType<T> = typeof globalThis extends {
|
|
22246
22249
|
window: unknown;
|
|
22247
22250
|
} ? T : never;
|