@vue/compat 3.6.0-rc.4 → 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 +691 -681
- package/dist/vue.cjs.js +999 -753
- package/dist/vue.cjs.prod.js +822 -637
- package/dist/vue.esm-browser.js +901 -672
- package/dist/vue.esm-browser.prod.js +7 -7
- package/dist/vue.esm-bundler.js +928 -689
- package/dist/vue.global.js +901 -672
- package/dist/vue.global.prod.js +7 -7
- package/dist/vue.runtime.esm-browser.js +901 -672
- package/dist/vue.runtime.esm-browser.prod.js +7 -7
- package/dist/vue.runtime.esm-bundler.js +928 -689
- package/dist/vue.runtime.global.js +901 -672
- 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,
|
|
1056
|
-
mountVNode: (vnode: VNode, parentComponent: any) => any;
|
|
1069
|
+
slot: (slots: any, name: string | (() => string), props: Record<string, any>, parentComponent: any, options?: VdomSlotOptions) => any;
|
|
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,30 +1213,37 @@ 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;
|
|
1240
|
+
/**
|
|
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
|
+
*/
|
|
1246
|
+
vaporScopeIds?: string[];
|
|
1244
1247
|
children: VNodeNormalizedChildren;
|
|
1245
1248
|
component: ComponentInternalInstance | null;
|
|
1246
1249
|
dirs: DirectiveBinding[] | null;
|
|
@@ -1252,59 +1255,59 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
|
|
|
1252
1255
|
targetStart: HostNode | null;
|
|
1253
1256
|
targetAnchor: HostNode | null;
|
|
1254
1257
|
/**
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
+
* number of elements contained in a static vnode
|
|
1259
|
+
* @internal
|
|
1260
|
+
*/
|
|
1258
1261
|
staticCount: number;
|
|
1259
1262
|
suspense: SuspenseBoundary | null;
|
|
1260
1263
|
/**
|
|
1261
|
-
|
|
1262
|
-
|
|
1264
|
+
* @internal
|
|
1265
|
+
*/
|
|
1263
1266
|
ssContent: VNode | null;
|
|
1264
1267
|
/**
|
|
1265
|
-
|
|
1266
|
-
|
|
1268
|
+
* @internal
|
|
1269
|
+
*/
|
|
1267
1270
|
ssFallback: VNode | null;
|
|
1268
1271
|
shapeFlag: number;
|
|
1269
1272
|
patchFlag: number;
|
|
1270
1273
|
/**
|
|
1271
|
-
|
|
1272
|
-
|
|
1274
|
+
* @internal
|
|
1275
|
+
*/
|
|
1273
1276
|
dynamicProps: string[] | null;
|
|
1274
1277
|
/**
|
|
1275
|
-
|
|
1276
|
-
|
|
1278
|
+
* @internal
|
|
1279
|
+
*/
|
|
1277
1280
|
dynamicChildren: (VNode[] & {
|
|
1278
1281
|
hasOnce?: boolean;
|
|
1279
1282
|
}) | null;
|
|
1280
1283
|
appContext: AppContext | null;
|
|
1281
1284
|
/**
|
|
1282
|
-
|
|
1283
|
-
|
|
1285
|
+
* @internal lexical scope owner instance
|
|
1286
|
+
*/
|
|
1284
1287
|
ctx: ComponentInternalInstance | null;
|
|
1285
1288
|
/**
|
|
1286
|
-
|
|
1287
|
-
|
|
1289
|
+
* @internal attached by v-memo
|
|
1290
|
+
*/
|
|
1288
1291
|
memo?: any[];
|
|
1289
1292
|
/**
|
|
1290
|
-
|
|
1291
|
-
|
|
1293
|
+
* @internal index for cleaning v-memo cache
|
|
1294
|
+
*/
|
|
1292
1295
|
cacheIndex?: number;
|
|
1293
1296
|
/**
|
|
1294
|
-
|
|
1295
|
-
|
|
1297
|
+
* @internal __COMPAT__ only
|
|
1298
|
+
*/
|
|
1296
1299
|
isCompatRoot?: true;
|
|
1297
1300
|
/**
|
|
1298
|
-
|
|
1299
|
-
|
|
1301
|
+
* @internal custom element interception hook
|
|
1302
|
+
*/
|
|
1300
1303
|
ce?: (instance: ComponentInternalInstance) => void;
|
|
1301
1304
|
/**
|
|
1302
|
-
|
|
1303
|
-
|
|
1305
|
+
* @internal VDOM in Vapor interop hook
|
|
1306
|
+
*/
|
|
1304
1307
|
vi?: (instance: ComponentInternalInstance) => void;
|
|
1305
1308
|
/**
|
|
1306
|
-
|
|
1307
|
-
|
|
1309
|
+
* @internal Vapor slot in VDOM metadata
|
|
1310
|
+
*/
|
|
1308
1311
|
vs?: {
|
|
1309
1312
|
slot: (props: any) => any;
|
|
1310
1313
|
fallback: (() => VNodeArrayChildren) | undefined;
|
|
@@ -1314,53 +1317,66 @@ interface VNode<HostNode = RendererNode, HostElement = RendererElement, ExtraPro
|
|
|
1314
1317
|
scope?: EffectScope;
|
|
1315
1318
|
};
|
|
1316
1319
|
/**
|
|
1317
|
-
|
|
1318
|
-
|
|
1320
|
+
* @internal Vapor slot Block
|
|
1321
|
+
*/
|
|
1319
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;
|
|
1320
1336
|
}
|
|
1321
1337
|
//#endregion
|
|
1322
1338
|
//#region packages/runtime-core/src/component.d.ts
|
|
1323
1339
|
type Data = Record<string, unknown>;
|
|
1324
1340
|
/**
|
|
1325
|
-
* For extending allowed non-declared attrs on components in TSX
|
|
1326
|
-
*/
|
|
1341
|
+
* For extending allowed non-declared attrs on components in TSX
|
|
1342
|
+
*/
|
|
1327
1343
|
interface AllowedAttrs {}
|
|
1328
1344
|
type Attrs = Data & AllowedAttrs;
|
|
1329
1345
|
/**
|
|
1330
|
-
* For extending allowed non-declared props on components in TSX
|
|
1331
|
-
*/
|
|
1346
|
+
* For extending allowed non-declared props on components in TSX
|
|
1347
|
+
*/
|
|
1332
1348
|
interface ComponentCustomProps {}
|
|
1333
1349
|
/**
|
|
1334
|
-
* For globally defined Directives
|
|
1335
|
-
* Here is an example of adding a directive `VTooltip` as global directive:
|
|
1336
|
-
*
|
|
1337
|
-
* @example
|
|
1338
|
-
* ```ts
|
|
1339
|
-
* import VTooltip from 'v-tooltip'
|
|
1340
|
-
*
|
|
1341
|
-
* declare module '@vue/runtime-core' {
|
|
1342
|
-
* interface GlobalDirectives {
|
|
1343
|
-
* VTooltip
|
|
1344
|
-
* }
|
|
1345
|
-
* }
|
|
1346
|
-
* ```
|
|
1347
|
-
*/
|
|
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
|
+
*/
|
|
1348
1364
|
interface GlobalDirectives {}
|
|
1349
1365
|
/**
|
|
1350
|
-
* For globally defined Components
|
|
1351
|
-
* Here is an example of adding a component `RouterView` as global component:
|
|
1352
|
-
*
|
|
1353
|
-
* @example
|
|
1354
|
-
* ```ts
|
|
1355
|
-
* import { RouterView } from 'vue-router'
|
|
1356
|
-
*
|
|
1357
|
-
* declare module '@vue/runtime-core' {
|
|
1358
|
-
* interface GlobalComponents {
|
|
1359
|
-
* RouterView
|
|
1360
|
-
* }
|
|
1361
|
-
* }
|
|
1362
|
-
* ```
|
|
1363
|
-
*/
|
|
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
|
+
*/
|
|
1364
1380
|
interface GlobalComponents {
|
|
1365
1381
|
Teleport: DefineComponent<TeleportProps>;
|
|
1366
1382
|
Suspense: DefineComponent<SuspenseProps>;
|
|
@@ -1368,65 +1384,65 @@ interface GlobalComponents {
|
|
|
1368
1384
|
BaseTransition: DefineComponent<BaseTransitionProps>;
|
|
1369
1385
|
}
|
|
1370
1386
|
/**
|
|
1371
|
-
* Default allowed non-declared props on component in TSX
|
|
1372
|
-
*/
|
|
1387
|
+
* Default allowed non-declared props on component in TSX
|
|
1388
|
+
*/
|
|
1373
1389
|
interface AllowedComponentProps {
|
|
1374
1390
|
class?: unknown;
|
|
1375
1391
|
style?: unknown;
|
|
1376
1392
|
}
|
|
1377
1393
|
interface ComponentInternalOptions {
|
|
1378
1394
|
/**
|
|
1379
|
-
|
|
1380
|
-
|
|
1395
|
+
* indicates vapor component
|
|
1396
|
+
*/
|
|
1381
1397
|
__vapor?: boolean;
|
|
1382
1398
|
/**
|
|
1383
|
-
|
|
1384
|
-
|
|
1399
|
+
* whether this vapor component has multiple root nodes
|
|
1400
|
+
*/
|
|
1385
1401
|
__multiRoot?: boolean;
|
|
1386
1402
|
/**
|
|
1387
|
-
|
|
1388
|
-
|
|
1403
|
+
* indicates keep-alive component
|
|
1404
|
+
*/
|
|
1389
1405
|
__isKeepAlive?: boolean;
|
|
1390
1406
|
/**
|
|
1391
|
-
|
|
1392
|
-
|
|
1407
|
+
* @internal
|
|
1408
|
+
*/
|
|
1393
1409
|
__scopeId?: string;
|
|
1394
1410
|
/**
|
|
1395
|
-
|
|
1396
|
-
|
|
1411
|
+
* @internal
|
|
1412
|
+
*/
|
|
1397
1413
|
__cssModules?: Data;
|
|
1398
1414
|
/**
|
|
1399
|
-
|
|
1400
|
-
|
|
1415
|
+
* @internal
|
|
1416
|
+
*/
|
|
1401
1417
|
__hmrId?: string;
|
|
1402
1418
|
/**
|
|
1403
|
-
|
|
1404
|
-
|
|
1419
|
+
* Compat build only, for bailing out of certain compatibility behavior
|
|
1420
|
+
*/
|
|
1405
1421
|
__isBuiltIn?: boolean;
|
|
1406
1422
|
/**
|
|
1407
|
-
|
|
1408
|
-
|
|
1423
|
+
* This one should be exposed so that devtools can make use of it
|
|
1424
|
+
*/
|
|
1409
1425
|
__file?: string;
|
|
1410
1426
|
/**
|
|
1411
|
-
|
|
1412
|
-
|
|
1427
|
+
* name inferred from filename
|
|
1428
|
+
*/
|
|
1413
1429
|
__name?: string;
|
|
1414
1430
|
}
|
|
1415
1431
|
interface AsyncComponentInternalOptions<R = ConcreteComponent, I = ComponentInternalInstance> {
|
|
1416
1432
|
/**
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1433
|
+
* marker for AsyncComponentWrapper
|
|
1434
|
+
* @internal
|
|
1435
|
+
*/
|
|
1420
1436
|
__asyncLoader?: () => Promise<R>;
|
|
1421
1437
|
/**
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1438
|
+
* the inner component resolved by the AsyncComponentWrapper
|
|
1439
|
+
* @internal
|
|
1440
|
+
*/
|
|
1425
1441
|
__asyncResolved?: R;
|
|
1426
1442
|
/**
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1443
|
+
* Exposed for lazy hydration
|
|
1444
|
+
* @internal
|
|
1445
|
+
*/
|
|
1430
1446
|
__asyncHydrate?: (el: Element, instance: I, hydrate: () => void) => void;
|
|
1431
1447
|
}
|
|
1432
1448
|
interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, any[]> = {}, S extends Record<string, any> = any, EE extends EmitsOptions = ShortEmitsToObject<E>> extends ComponentInternalOptions {
|
|
@@ -1439,24 +1455,24 @@ interface FunctionalComponent<P = {}, E extends EmitsOptions | Record<string, an
|
|
|
1439
1455
|
compatConfig?: CompatConfig;
|
|
1440
1456
|
}
|
|
1441
1457
|
/**
|
|
1442
|
-
* Type used where a function accepts both vdom and vapor components.
|
|
1443
|
-
*/
|
|
1458
|
+
* Type used where a function accepts both vdom and vapor components.
|
|
1459
|
+
*/
|
|
1444
1460
|
type GenericComponent = ({
|
|
1445
1461
|
name?: string;
|
|
1446
1462
|
} | ((() => any) & {
|
|
1447
1463
|
displayName?: string;
|
|
1448
1464
|
})) & ComponentInternalOptions;
|
|
1449
1465
|
/**
|
|
1450
|
-
* Concrete component type matches its actual value: it's either an options
|
|
1451
|
-
* object, or a function. Use this where the code expects to work with actual
|
|
1452
|
-
* values, e.g. checking if its a function or not. This is mostly for internal
|
|
1453
|
-
* implementation code.
|
|
1454
|
-
*/
|
|
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
|
+
*/
|
|
1455
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>;
|
|
1456
1472
|
/**
|
|
1457
|
-
* A type used in public APIs where a component type is expected.
|
|
1458
|
-
* The constructor type is an artificial type returned by defineComponent().
|
|
1459
|
-
*/
|
|
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
|
+
*/
|
|
1460
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>;
|
|
1461
1477
|
type LifecycleHook<TFn = Function> = (TFn & SchedulerJob)[] | null;
|
|
1462
1478
|
type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
@@ -1466,8 +1482,8 @@ type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ?
|
|
|
1466
1482
|
expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
|
|
1467
1483
|
} : never;
|
|
1468
1484
|
/**
|
|
1469
|
-
* @internal
|
|
1470
|
-
*/
|
|
1485
|
+
* @internal
|
|
1486
|
+
*/
|
|
1471
1487
|
type InternalRenderFunction = {
|
|
1472
1488
|
(ctx: ComponentPublicInstance, cache: ComponentInternalInstance["renderCache"], $props: ComponentInternalInstance["props"], $setup: ComponentInternalInstance["setupState"], $data: ComponentInternalInstance["data"], $options: ComponentInternalInstance["ctx"]): VNodeChild;
|
|
1473
1489
|
_rc?: boolean;
|
|
@@ -1475,10 +1491,10 @@ type InternalRenderFunction = {
|
|
|
1475
1491
|
_compatWrapped?: boolean;
|
|
1476
1492
|
};
|
|
1477
1493
|
/**
|
|
1478
|
-
* Base component instance interface that is shared between vdom mode and vapor
|
|
1479
|
-
* mode, so that we can have a mixed instance tree and reuse core logic that
|
|
1480
|
-
* operate on both.
|
|
1481
|
-
*/
|
|
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
|
+
*/
|
|
1482
1498
|
interface GenericComponentInstance {
|
|
1483
1499
|
vapor?: boolean;
|
|
1484
1500
|
uid: number;
|
|
@@ -1487,202 +1503,202 @@ interface GenericComponentInstance {
|
|
|
1487
1503
|
parent: GenericComponentInstance | null;
|
|
1488
1504
|
appContext: GenericAppContext;
|
|
1489
1505
|
/**
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1506
|
+
* Object containing values this component provides for its descendants
|
|
1507
|
+
* @internal
|
|
1508
|
+
*/
|
|
1493
1509
|
provides: Data;
|
|
1494
1510
|
/**
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
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
|
+
*/
|
|
1499
1515
|
scope: EffectScope;
|
|
1500
1516
|
/**
|
|
1501
|
-
|
|
1502
|
-
|
|
1517
|
+
* render function will have different types between vdom and vapor
|
|
1518
|
+
*/
|
|
1503
1519
|
render?: Function | null;
|
|
1504
1520
|
/**
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1521
|
+
* SSR render function
|
|
1522
|
+
* (they are the same between vdom and vapor components.)
|
|
1523
|
+
* @internal
|
|
1524
|
+
*/
|
|
1509
1525
|
ssrRender?: Function | null;
|
|
1510
1526
|
props: Data;
|
|
1511
1527
|
attrs: Data;
|
|
1512
1528
|
refs: Data;
|
|
1513
1529
|
emit: EmitFn;
|
|
1514
1530
|
/**
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1531
|
+
* used for keeping track of .once event handlers on components
|
|
1532
|
+
* @internal
|
|
1533
|
+
*/
|
|
1518
1534
|
emitted: Record<string, boolean> | null;
|
|
1519
1535
|
/**
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1536
|
+
* used for caching the value returned from props default factory functions to
|
|
1537
|
+
* avoid unnecessary watcher trigger
|
|
1538
|
+
* @internal
|
|
1539
|
+
*/
|
|
1524
1540
|
propsDefaults: Data | null;
|
|
1525
1541
|
/**
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1542
|
+
* used for getting the keys of a component's raw props, vapor only
|
|
1543
|
+
* @internal
|
|
1544
|
+
*/
|
|
1529
1545
|
rawKeys?: () => string[];
|
|
1530
1546
|
exposed: Record<string, any> | null;
|
|
1531
1547
|
exposeProxy: Record<string, any> | null;
|
|
1532
1548
|
/**
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1549
|
+
* setup related
|
|
1550
|
+
* @internal
|
|
1551
|
+
*/
|
|
1536
1552
|
setupState?: Data;
|
|
1537
1553
|
/**
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1554
|
+
* devtools access to additional info
|
|
1555
|
+
* @internal
|
|
1556
|
+
*/
|
|
1541
1557
|
devtoolsRawSetupState?: any;
|
|
1542
1558
|
isMounted: boolean;
|
|
1543
1559
|
isUnmounted: boolean;
|
|
1544
1560
|
isDeactivated: boolean;
|
|
1545
1561
|
/**
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
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
|
+
*/
|
|
1551
1567
|
ids: [string, number, number];
|
|
1552
1568
|
/**
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1569
|
+
* resolved props options
|
|
1570
|
+
* @internal
|
|
1571
|
+
*/
|
|
1556
1572
|
propsOptions?: NormalizedPropsOptions;
|
|
1557
1573
|
/**
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1574
|
+
* resolved emits options
|
|
1575
|
+
* @internal
|
|
1576
|
+
*/
|
|
1561
1577
|
emitsOptions?: ObjectEmitsOptions | null;
|
|
1562
1578
|
/**
|
|
1563
|
-
|
|
1564
|
-
|
|
1579
|
+
* Public instance proxy, vdom only
|
|
1580
|
+
*/
|
|
1565
1581
|
proxy?: any;
|
|
1566
1582
|
/**
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1583
|
+
* suspense related
|
|
1584
|
+
* @internal
|
|
1585
|
+
*/
|
|
1570
1586
|
suspense: SuspenseBoundary | null;
|
|
1571
1587
|
/**
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1588
|
+
* suspense pending batch id
|
|
1589
|
+
* @internal
|
|
1590
|
+
*/
|
|
1575
1591
|
suspenseId: number;
|
|
1576
1592
|
/**
|
|
1577
|
-
|
|
1578
|
-
|
|
1593
|
+
* @internal
|
|
1594
|
+
*/
|
|
1579
1595
|
asyncDep: Promise<any> | null;
|
|
1580
1596
|
/**
|
|
1581
|
-
|
|
1582
|
-
|
|
1597
|
+
* @internal
|
|
1598
|
+
*/
|
|
1583
1599
|
asyncResolved: boolean;
|
|
1584
1600
|
/**
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1601
|
+
* restore renderer-specific async context after `withAsyncContext()`
|
|
1602
|
+
* @internal
|
|
1603
|
+
*/
|
|
1588
1604
|
restoreAsyncContext?: () => void | (() => void);
|
|
1589
1605
|
/**
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1606
|
+
* `updateTeleportCssVars`
|
|
1607
|
+
* For updating css vars on contained teleports
|
|
1608
|
+
* @internal
|
|
1609
|
+
*/
|
|
1594
1610
|
ut?: (vars?: Record<string, string>) => void;
|
|
1595
1611
|
/**
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1612
|
+
* dev only. For style v-bind hydration mismatch checks
|
|
1613
|
+
* @internal
|
|
1614
|
+
*/
|
|
1599
1615
|
getCssVars?: () => Record<string, string>;
|
|
1600
1616
|
/**
|
|
1601
|
-
|
|
1602
|
-
|
|
1617
|
+
* @internal
|
|
1618
|
+
*/
|
|
1603
1619
|
[LifecycleHooks.BEFORE_CREATE]?: LifecycleHook;
|
|
1604
1620
|
/**
|
|
1605
|
-
|
|
1606
|
-
|
|
1621
|
+
* @internal
|
|
1622
|
+
*/
|
|
1607
1623
|
[LifecycleHooks.CREATED]?: LifecycleHook;
|
|
1608
1624
|
/**
|
|
1609
|
-
|
|
1610
|
-
|
|
1625
|
+
* @internal
|
|
1626
|
+
*/
|
|
1611
1627
|
[LifecycleHooks.BEFORE_MOUNT]?: LifecycleHook;
|
|
1612
1628
|
/**
|
|
1613
|
-
|
|
1614
|
-
|
|
1629
|
+
* @internal
|
|
1630
|
+
*/
|
|
1615
1631
|
[LifecycleHooks.MOUNTED]?: LifecycleHook;
|
|
1616
1632
|
/**
|
|
1617
|
-
|
|
1618
|
-
|
|
1633
|
+
* @internal
|
|
1634
|
+
*/
|
|
1619
1635
|
[LifecycleHooks.BEFORE_UPDATE]?: LifecycleHook;
|
|
1620
1636
|
/**
|
|
1621
|
-
|
|
1622
|
-
|
|
1637
|
+
* @internal
|
|
1638
|
+
*/
|
|
1623
1639
|
[LifecycleHooks.UPDATED]?: LifecycleHook;
|
|
1624
1640
|
/**
|
|
1625
|
-
|
|
1626
|
-
|
|
1641
|
+
* @internal
|
|
1642
|
+
*/
|
|
1627
1643
|
[LifecycleHooks.BEFORE_UNMOUNT]?: LifecycleHook;
|
|
1628
1644
|
/**
|
|
1629
|
-
|
|
1630
|
-
|
|
1645
|
+
* @internal
|
|
1646
|
+
*/
|
|
1631
1647
|
[LifecycleHooks.UNMOUNTED]?: LifecycleHook;
|
|
1632
1648
|
/**
|
|
1633
|
-
|
|
1634
|
-
|
|
1649
|
+
* @internal
|
|
1650
|
+
*/
|
|
1635
1651
|
[LifecycleHooks.RENDER_TRACKED]?: LifecycleHook;
|
|
1636
1652
|
/**
|
|
1637
|
-
|
|
1638
|
-
|
|
1653
|
+
* @internal
|
|
1654
|
+
*/
|
|
1639
1655
|
[LifecycleHooks.RENDER_TRIGGERED]?: LifecycleHook;
|
|
1640
1656
|
/**
|
|
1641
|
-
|
|
1642
|
-
|
|
1657
|
+
* @internal
|
|
1658
|
+
*/
|
|
1643
1659
|
[LifecycleHooks.ACTIVATED]?: LifecycleHook;
|
|
1644
1660
|
/**
|
|
1645
|
-
|
|
1646
|
-
|
|
1661
|
+
* @internal
|
|
1662
|
+
*/
|
|
1647
1663
|
[LifecycleHooks.DEACTIVATED]?: LifecycleHook;
|
|
1648
1664
|
/**
|
|
1649
|
-
|
|
1650
|
-
|
|
1665
|
+
* @internal
|
|
1666
|
+
*/
|
|
1651
1667
|
[LifecycleHooks.ERROR_CAPTURED]?: LifecycleHook;
|
|
1652
1668
|
/**
|
|
1653
|
-
|
|
1654
|
-
|
|
1669
|
+
* @internal
|
|
1670
|
+
*/
|
|
1655
1671
|
[LifecycleHooks.SERVER_PREFETCH]?: LifecycleHook<() => Promise<unknown>>;
|
|
1656
1672
|
/**
|
|
1657
|
-
|
|
1658
|
-
|
|
1673
|
+
* @internal vapor only
|
|
1674
|
+
*/
|
|
1659
1675
|
hmrRerender?: () => void;
|
|
1660
1676
|
/**
|
|
1661
|
-
|
|
1662
|
-
|
|
1677
|
+
* @internal vapor only
|
|
1678
|
+
*/
|
|
1663
1679
|
hmrReload?: (newComp: any) => void;
|
|
1664
1680
|
vnode?: VNode;
|
|
1665
1681
|
subTree?: VNode;
|
|
1666
1682
|
/**
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1683
|
+
* Custom Element instance (if component is created by defineCustomElement)
|
|
1684
|
+
* @internal
|
|
1685
|
+
*/
|
|
1670
1686
|
ce?: ComponentCustomElementInterface;
|
|
1671
1687
|
/**
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1688
|
+
* is custom element? (kept only for compatibility)
|
|
1689
|
+
* @internal
|
|
1690
|
+
*/
|
|
1675
1691
|
isCE?: boolean;
|
|
1676
1692
|
/**
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1693
|
+
* custom element specific HMR method
|
|
1694
|
+
* @internal
|
|
1695
|
+
*/
|
|
1680
1696
|
ceReload?: (newStyles?: string[]) => void;
|
|
1681
1697
|
}
|
|
1682
1698
|
/**
|
|
1683
|
-
* We expose a subset of properties on the internal instance as they are
|
|
1684
|
-
* useful for advanced external libraries and tools.
|
|
1685
|
-
*/
|
|
1699
|
+
* We expose a subset of properties on the internal instance as they are
|
|
1700
|
+
* useful for advanced external libraries and tools.
|
|
1701
|
+
*/
|
|
1686
1702
|
interface ComponentInternalInstance extends GenericComponentInstance {
|
|
1687
1703
|
vapor?: never;
|
|
1688
1704
|
uid: number;
|
|
@@ -1691,84 +1707,84 @@ interface ComponentInternalInstance extends GenericComponentInstance {
|
|
|
1691
1707
|
root: GenericComponentInstance;
|
|
1692
1708
|
appContext: AppContext;
|
|
1693
1709
|
/**
|
|
1694
|
-
|
|
1695
|
-
|
|
1710
|
+
* Vnode representing this component in its parent's vdom tree
|
|
1711
|
+
*/
|
|
1696
1712
|
vnode: VNode;
|
|
1697
1713
|
/**
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1714
|
+
* The pending new vnode from parent updates
|
|
1715
|
+
* @internal
|
|
1716
|
+
*/
|
|
1701
1717
|
next: VNode | null;
|
|
1702
1718
|
/**
|
|
1703
|
-
|
|
1704
|
-
|
|
1719
|
+
* Root vnode of this component's own vdom tree
|
|
1720
|
+
*/
|
|
1705
1721
|
subTree: VNode;
|
|
1706
1722
|
/**
|
|
1707
|
-
|
|
1708
|
-
|
|
1723
|
+
* Render effect instance
|
|
1724
|
+
*/
|
|
1709
1725
|
effect: ReactiveEffect;
|
|
1710
1726
|
/**
|
|
1711
|
-
|
|
1712
|
-
|
|
1727
|
+
* Force update render effect
|
|
1728
|
+
*/
|
|
1713
1729
|
update: () => void;
|
|
1714
1730
|
/**
|
|
1715
|
-
|
|
1716
|
-
|
|
1731
|
+
* Render effect job to be passed to scheduler (checks if dirty)
|
|
1732
|
+
*/
|
|
1717
1733
|
job: SchedulerJob;
|
|
1718
1734
|
/**
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1735
|
+
* The render function that returns vdom tree.
|
|
1736
|
+
* @internal
|
|
1737
|
+
*/
|
|
1722
1738
|
render: InternalRenderFunction | null;
|
|
1723
1739
|
/**
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1740
|
+
* cache for proxy access type to avoid hasOwnProperty calls
|
|
1741
|
+
* @internal
|
|
1742
|
+
*/
|
|
1727
1743
|
accessCache: Data | null;
|
|
1728
1744
|
/**
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
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
|
+
*/
|
|
1733
1749
|
renderCache: (Function | VNode | undefined)[];
|
|
1734
1750
|
/**
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1751
|
+
* Resolved component registry, only for components with mixins or extends
|
|
1752
|
+
* @internal
|
|
1753
|
+
*/
|
|
1738
1754
|
components: Record<string, ConcreteComponent> | null;
|
|
1739
1755
|
/**
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1756
|
+
* Resolved directive registry, only for components with mixins or extends
|
|
1757
|
+
* @internal
|
|
1758
|
+
*/
|
|
1743
1759
|
directives: Record<string, Directive> | null;
|
|
1744
1760
|
/**
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1761
|
+
* Resolved filters registry, v2 compat only
|
|
1762
|
+
* @internal
|
|
1763
|
+
*/
|
|
1748
1764
|
filters?: Record<string, Function>;
|
|
1749
1765
|
/**
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1766
|
+
* resolved props options
|
|
1767
|
+
* @internal
|
|
1768
|
+
*/
|
|
1753
1769
|
propsOptions: NormalizedPropsOptions;
|
|
1754
1770
|
/**
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1771
|
+
* resolved emits options
|
|
1772
|
+
* @internal
|
|
1773
|
+
*/
|
|
1758
1774
|
emitsOptions: ObjectEmitsOptions | null;
|
|
1759
1775
|
/**
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1776
|
+
* resolved inheritAttrs options
|
|
1777
|
+
* @internal
|
|
1778
|
+
*/
|
|
1763
1779
|
inheritAttrs?: boolean;
|
|
1764
1780
|
/**
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1781
|
+
* setup related
|
|
1782
|
+
* @internal
|
|
1783
|
+
*/
|
|
1768
1784
|
setupState: Data;
|
|
1769
1785
|
/**
|
|
1770
|
-
|
|
1771
|
-
|
|
1786
|
+
* @internal
|
|
1787
|
+
*/
|
|
1772
1788
|
setupContext?: SetupContext | null;
|
|
1773
1789
|
proxy: ComponentPublicInstance | null;
|
|
1774
1790
|
data: Data;
|
|
@@ -1776,79 +1792,79 @@ interface ComponentInternalInstance extends GenericComponentInstance {
|
|
|
1776
1792
|
slots: InternalSlots;
|
|
1777
1793
|
exposeProxy: Record<string, any> | null;
|
|
1778
1794
|
/**
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1795
|
+
* alternative proxy used only for runtime-compiled render functions using
|
|
1796
|
+
* `with` block
|
|
1797
|
+
* @internal
|
|
1798
|
+
*/
|
|
1783
1799
|
withProxy: ComponentPublicInstance | null;
|
|
1784
1800
|
/**
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
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
|
+
*/
|
|
1790
1806
|
ctx: Data;
|
|
1791
1807
|
/**
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1808
|
+
* suspense pending batch id
|
|
1809
|
+
* @internal
|
|
1810
|
+
*/
|
|
1795
1811
|
suspenseId: number;
|
|
1796
1812
|
/**
|
|
1797
|
-
|
|
1798
|
-
|
|
1813
|
+
* @internal
|
|
1814
|
+
*/
|
|
1799
1815
|
asyncDep: Promise<any> | null;
|
|
1800
1816
|
/**
|
|
1801
|
-
|
|
1802
|
-
|
|
1817
|
+
* @internal
|
|
1818
|
+
*/
|
|
1803
1819
|
asyncResolved: boolean;
|
|
1804
1820
|
/**
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1821
|
+
* For caching bound $forceUpdate on public proxy access
|
|
1822
|
+
* @internal
|
|
1823
|
+
*/
|
|
1808
1824
|
f?: () => void;
|
|
1809
1825
|
/**
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1826
|
+
* For caching bound $nextTick on public proxy access
|
|
1827
|
+
* @internal
|
|
1828
|
+
*/
|
|
1813
1829
|
n?: () => Promise<void>;
|
|
1814
1830
|
/**
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1831
|
+
* v2 compat only, for caching mutated $options
|
|
1832
|
+
* @internal
|
|
1833
|
+
*/
|
|
1818
1834
|
resolvedOptions?: MergedComponentOptions;
|
|
1819
1835
|
}
|
|
1820
1836
|
interface ComponentCustomElementInterface {
|
|
1821
1837
|
/**
|
|
1822
|
-
|
|
1823
|
-
|
|
1838
|
+
* @internal
|
|
1839
|
+
*/
|
|
1824
1840
|
_isVueCE: boolean;
|
|
1825
1841
|
/**
|
|
1826
|
-
|
|
1827
|
-
|
|
1842
|
+
* @internal
|
|
1843
|
+
*/
|
|
1828
1844
|
_injectChildStyle(type: ConcreteComponent, parent?: ConcreteComponent): void;
|
|
1829
1845
|
/**
|
|
1830
|
-
|
|
1831
|
-
|
|
1846
|
+
* @internal
|
|
1847
|
+
*/
|
|
1832
1848
|
_removeChildStyle(type: ConcreteComponent): void;
|
|
1833
1849
|
/**
|
|
1834
|
-
|
|
1835
|
-
|
|
1850
|
+
* @internal
|
|
1851
|
+
*/
|
|
1836
1852
|
_setProp(key: string, val: any, shouldReflect?: boolean, shouldUpdate?: boolean): void;
|
|
1837
1853
|
/**
|
|
1838
|
-
|
|
1839
|
-
|
|
1854
|
+
* @internal
|
|
1855
|
+
*/
|
|
1840
1856
|
_beginPatch(): void;
|
|
1841
1857
|
/**
|
|
1842
|
-
|
|
1843
|
-
|
|
1858
|
+
* @internal
|
|
1859
|
+
*/
|
|
1844
1860
|
_endPatch(): void;
|
|
1845
1861
|
/**
|
|
1846
|
-
|
|
1847
|
-
|
|
1862
|
+
* @internal attached by the nested Teleport when shadowRoot is false.
|
|
1863
|
+
*/
|
|
1848
1864
|
_teleportTargets?: Set<RendererElement>;
|
|
1849
1865
|
/**
|
|
1850
|
-
|
|
1851
|
-
|
|
1866
|
+
* @internal check if shadow root is enabled
|
|
1867
|
+
*/
|
|
1852
1868
|
_hasShadowRoot(): boolean;
|
|
1853
1869
|
}
|
|
1854
1870
|
//#endregion
|
|
@@ -1865,28 +1881,28 @@ interface WatchOptions<Immediate = boolean> extends WatchEffectOptions {
|
|
|
1865
1881
|
//#region packages/runtime-core/src/compat/globalConfig.d.ts
|
|
1866
1882
|
type LegacyConfig = {
|
|
1867
1883
|
/**
|
|
1868
|
-
|
|
1869
|
-
|
|
1884
|
+
* @deprecated `config.silent` option has been removed
|
|
1885
|
+
*/
|
|
1870
1886
|
silent?: boolean;
|
|
1871
1887
|
/**
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
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
|
+
*/
|
|
1875
1891
|
devtools?: boolean;
|
|
1876
1892
|
/**
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1893
|
+
* @deprecated use `config.isCustomElement` instead
|
|
1894
|
+
* https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-ignoredelements-is-now-config-iscustomelement
|
|
1895
|
+
*/
|
|
1880
1896
|
ignoredElements?: (string | RegExp)[];
|
|
1881
1897
|
/**
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1898
|
+
* @deprecated
|
|
1899
|
+
* https://v3-migration.vuejs.org/breaking-changes/keycode-modifiers.html
|
|
1900
|
+
*/
|
|
1885
1901
|
keyCodes?: Record<string, number | number[]>;
|
|
1886
1902
|
/**
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1903
|
+
* @deprecated
|
|
1904
|
+
* https://v3-migration.vuejs.org/breaking-changes/global-api.html#config-productiontip-removed
|
|
1905
|
+
*/
|
|
1890
1906
|
productionTip?: boolean;
|
|
1891
1907
|
};
|
|
1892
1908
|
//#endregion
|
|
@@ -1907,10 +1923,10 @@ interface LegacyPublicProperties {
|
|
|
1907
1923
|
//#endregion
|
|
1908
1924
|
//#region packages/runtime-core/src/compat/global.d.ts
|
|
1909
1925
|
/**
|
|
1910
|
-
* @deprecated the default `Vue` export has been removed in Vue 3. The type for
|
|
1911
|
-
* the default export is provided only for migration purposes. Please use
|
|
1912
|
-
* named imports instead - e.g. `import { createApp } from 'vue'`.
|
|
1913
|
-
*/
|
|
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
|
+
*/
|
|
1914
1930
|
type CompatVue = Pick<App, "version" | "component" | "directive"> & {
|
|
1915
1931
|
configureCompat: typeof configureCompat;
|
|
1916
1932
|
new (options?: ComponentOptions): LegacyPublicInstance;
|
|
@@ -1926,40 +1942,40 @@ type CompatVue = Pick<App, "version" | "component" | "directive"> & {
|
|
|
1926
1942
|
directive<T = any, V = any>(name: string, directive: Directive<T, V>): CompatVue;
|
|
1927
1943
|
compile(template: string): RenderFunction;
|
|
1928
1944
|
/**
|
|
1929
|
-
|
|
1930
|
-
|
|
1945
|
+
* @deprecated Vue 3 no longer supports extending constructors.
|
|
1946
|
+
*/
|
|
1931
1947
|
extend: (options?: ComponentOptions) => CompatVue;
|
|
1932
1948
|
/**
|
|
1933
|
-
|
|
1934
|
-
|
|
1949
|
+
* @deprecated Vue 3 no longer needs set() for adding new properties.
|
|
1950
|
+
*/
|
|
1935
1951
|
set(target: any, key: PropertyKey, value: any): void;
|
|
1936
1952
|
/**
|
|
1937
|
-
|
|
1938
|
-
|
|
1953
|
+
* @deprecated Vue 3 no longer needs delete() for property deletions.
|
|
1954
|
+
*/
|
|
1939
1955
|
delete(target: any, key: PropertyKey): void;
|
|
1940
1956
|
/**
|
|
1941
|
-
|
|
1942
|
-
|
|
1957
|
+
* @deprecated use `reactive` instead.
|
|
1958
|
+
*/
|
|
1943
1959
|
observable: typeof reactive;
|
|
1944
1960
|
/**
|
|
1945
|
-
|
|
1946
|
-
|
|
1961
|
+
* @deprecated filters have been removed from Vue 3.
|
|
1962
|
+
*/
|
|
1947
1963
|
filter(name: string, arg?: any): null;
|
|
1948
1964
|
/**
|
|
1949
|
-
|
|
1950
|
-
|
|
1965
|
+
* @internal
|
|
1966
|
+
*/
|
|
1951
1967
|
cid: number;
|
|
1952
1968
|
/**
|
|
1953
|
-
|
|
1954
|
-
|
|
1969
|
+
* @internal
|
|
1970
|
+
*/
|
|
1955
1971
|
options: ComponentOptions;
|
|
1956
1972
|
/**
|
|
1957
|
-
|
|
1958
|
-
|
|
1973
|
+
* @internal
|
|
1974
|
+
*/
|
|
1959
1975
|
util: any;
|
|
1960
1976
|
/**
|
|
1961
|
-
|
|
1962
|
-
|
|
1977
|
+
* @internal
|
|
1978
|
+
*/
|
|
1963
1979
|
super: CompatVue;
|
|
1964
1980
|
};
|
|
1965
1981
|
//#endregion
|
|
@@ -2018,13 +2034,7 @@ type SystemModifiers = (typeof systemModifiers)[number];
|
|
|
2018
2034
|
type CompatModifiers = keyof typeof keyNames;
|
|
2019
2035
|
type VOnModifiers = SystemModifiers | ModifierGuards | CompatModifiers;
|
|
2020
2036
|
type ModifierGuards = "shift" | "ctrl" | "alt" | "meta" | "left" | "right" | "stop" | "prevent" | "self" | "middle" | "exact";
|
|
2021
|
-
/**
|
|
2022
|
-
* @private
|
|
2023
|
-
*/
|
|
2024
2037
|
declare const keyNames: Record<"esc" | "space" | "up" | "left" | "right" | "down" | "delete", string>;
|
|
2025
|
-
/**
|
|
2026
|
-
* @private
|
|
2027
|
-
*/
|
|
2028
2038
|
type VOnDirective = Directive<any, any, VOnModifiers>;
|
|
2029
2039
|
//#endregion
|
|
2030
2040
|
//#region packages/runtime-dom/src/directives/vModel.d.ts
|
|
@@ -2034,7 +2044,7 @@ declare const initialValueKey: unique symbol;
|
|
|
2034
2044
|
type ModelDirective<T, Modifiers extends string = string> = ObjectDirective<T & {
|
|
2035
2045
|
[assignKey]: AssignerFn;
|
|
2036
2046
|
[initialValueKey]?: string;
|
|
2037
|
-
|
|
2047
|
+
_pendingValue?: [multiple: boolean, value: any];
|
|
2038
2048
|
}, any, Modifiers>;
|
|
2039
2049
|
declare const vModelText: ModelDirective<HTMLInputElement | HTMLTextAreaElement, "trim" | "number" | "lazy">;
|
|
2040
2050
|
declare const vModelCheckbox: ModelDirective<HTMLInputElement>;
|
|
@@ -22217,13 +22227,13 @@ declare namespace DataType {
|
|
|
22217
22227
|
//#region packages/runtime-dom/src/jsx.d.ts
|
|
22218
22228
|
interface CSSProperties extends Properties<string | number>, PropertiesHyphen<string | number> {
|
|
22219
22229
|
/**
|
|
22220
|
-
|
|
22221
|
-
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22225
|
-
|
|
22226
|
-
|
|
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
|
+
*/
|
|
22227
22237
|
[v: `--${string}`]: string | number | undefined;
|
|
22228
22238
|
}
|
|
22229
22239
|
type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>;
|
|
@@ -22231,10 +22241,10 @@ type ClassValue = false | null | undefined | string | Record<string, any> | Arra
|
|
|
22231
22241
|
//#endregion
|
|
22232
22242
|
//#region packages/runtime-dom/src/index.d.ts
|
|
22233
22243
|
/**
|
|
22234
|
-
* This is a stub implementation to prevent the need to use dom types.
|
|
22235
|
-
*
|
|
22236
|
-
* To enable proper types, add `"dom"` to `"lib"` in your `tsconfig.json`.
|
|
22237
|
-
*/
|
|
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
|
+
*/
|
|
22238
22248
|
type DomType<T> = typeof globalThis extends {
|
|
22239
22249
|
window: unknown;
|
|
22240
22250
|
} ? T : never;
|