@vue/runtime-core 3.3.0-alpha.4 → 3.3.0-alpha.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/runtime-core.cjs.js +44 -17
- package/dist/runtime-core.cjs.prod.js +39 -15
- package/dist/runtime-core.d.ts +239 -229
- package/dist/runtime-core.esm-bundler.js +44 -18
- package/package.json +3 -3
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { computed as computed$1, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, Ref, ReactiveFlags, ReactiveEffect, EffectScope, ComputedRef, DebuggerOptions, reactive } from '@vue/reactivity';
|
|
2
2
|
export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, Raw, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WritableComputedOptions, WritableComputedRef, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
|
|
3
|
-
import { SlotFlags, UnionToIntersection, IfAny, LooseRequired
|
|
3
|
+
import { SlotFlags, UnionToIntersection, Prettify, IfAny, LooseRequired } from '@vue/shared';
|
|
4
4
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
5
5
|
|
|
6
|
-
declare const computed: typeof computed$1;
|
|
6
|
+
export declare const computed: typeof computed$1;
|
|
7
7
|
|
|
8
8
|
export type Slot = (...args: any[]) => VNode[];
|
|
9
|
-
|
|
9
|
+
type InternalSlots = {
|
|
10
10
|
[name: string]: Slot | undefined;
|
|
11
11
|
};
|
|
12
12
|
export type Slots = Readonly<InternalSlots>;
|
|
13
|
-
|
|
13
|
+
type RawSlots = {
|
|
14
14
|
[name: string]: unknown;
|
|
15
15
|
$stable?: boolean;
|
|
16
16
|
/* removed internal: _ctx */
|
|
17
17
|
/* removed internal: _ */
|
|
18
18
|
};
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
interface SchedulerJob extends Function {
|
|
21
21
|
id?: number;
|
|
22
22
|
pre?: boolean;
|
|
23
23
|
active?: boolean;
|
|
@@ -45,18 +45,18 @@ export interface SchedulerJob extends Function {
|
|
|
45
45
|
*/
|
|
46
46
|
ownerInstance?: ComponentInternalInstance;
|
|
47
47
|
}
|
|
48
|
-
|
|
49
|
-
declare function nextTick<T = void>(this: T, fn?: (this: T) => void): Promise<void>;
|
|
50
|
-
declare function queuePostFlushCb(cb: SchedulerJobs): void;
|
|
48
|
+
type SchedulerJobs = SchedulerJob | SchedulerJob[];
|
|
49
|
+
export declare function nextTick<T = void>(this: T, fn?: (this: T) => void): Promise<void>;
|
|
50
|
+
export declare function queuePostFlushCb(cb: SchedulerJobs): void;
|
|
51
51
|
|
|
52
52
|
export type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
|
53
53
|
export type EmitsOptions = ObjectEmitsOptions | string[];
|
|
54
|
-
|
|
54
|
+
type EmitsToProps<T extends EmitsOptions> = T extends string[] ? {
|
|
55
55
|
[K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
|
|
56
56
|
} : T extends ObjectEmitsOptions ? {
|
|
57
57
|
[K in string & `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}` ? T[Uncapitalize<C>] extends null ? (...args: any[]) => any : (...args: T[Uncapitalize<C>] extends (...args: infer P) => any ? P : never) => any : never;
|
|
58
58
|
} : {};
|
|
59
|
-
|
|
59
|
+
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<{
|
|
60
60
|
[key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => void : (event: key, ...args: any[]) => void;
|
|
61
61
|
}[Event]>;
|
|
62
62
|
|
|
@@ -87,15 +87,15 @@ export type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = k
|
|
|
87
87
|
*/
|
|
88
88
|
export interface ComponentCustomProperties {
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
|
|
91
|
+
type MixinToOptionTypes<T> = T extends ComponentOptionsBase<infer P, infer B, infer D, infer C, infer M, infer Mixin, infer Extends, any, any, infer Defaults> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never;
|
|
92
|
+
type ExtractMixin<T> = {
|
|
93
93
|
Mixin: MixinToOptionTypes<T>;
|
|
94
94
|
}[T extends ComponentOptionsMixin ? 'Mixin' : never];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType<{}, {}, {}, {}, {}> : UnionToIntersection<ExtractMixin<T>>;
|
|
96
|
+
type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
|
|
97
|
+
type EnsureNonVoid<T> = T extends void ? {} : T;
|
|
98
|
+
type ComponentPublicInstanceConstructor<T extends ComponentPublicInstance<Props, RawBindings, D, C, M> = ComponentPublicInstance<any>, Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = {
|
|
99
99
|
__isFragment?: never;
|
|
100
100
|
__isTeleport?: never;
|
|
101
101
|
__isSuspense?: never;
|
|
@@ -108,7 +108,7 @@ D = {}, // return from data()
|
|
|
108
108
|
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}> = {
|
|
109
109
|
$: ComponentInternalInstance;
|
|
110
110
|
$data: D;
|
|
111
|
-
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps
|
|
111
|
+
$props: Prettify<MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps>;
|
|
112
112
|
$attrs: Data;
|
|
113
113
|
$refs: Data;
|
|
114
114
|
$slots: Slots;
|
|
@@ -153,7 +153,7 @@ declare const SuspenseImpl: {
|
|
|
153
153
|
create: typeof createSuspenseBoundary;
|
|
154
154
|
normalize: typeof normalizeSuspenseChildren;
|
|
155
155
|
};
|
|
156
|
-
declare const Suspense: {
|
|
156
|
+
export declare const Suspense: {
|
|
157
157
|
new (): {
|
|
158
158
|
$props: VNodeProps & SuspenseProps;
|
|
159
159
|
};
|
|
@@ -222,7 +222,7 @@ export interface RendererNode {
|
|
|
222
222
|
}
|
|
223
223
|
export interface RendererElement extends RendererNode {
|
|
224
224
|
}
|
|
225
|
-
|
|
225
|
+
interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
|
|
226
226
|
p: PatchFn;
|
|
227
227
|
um: UnmountFn;
|
|
228
228
|
r: RemoveFn;
|
|
@@ -234,18 +234,18 @@ export interface RendererInternals<HostNode = RendererNode, HostElement = Render
|
|
|
234
234
|
n: NextFn;
|
|
235
235
|
o: RendererOptions<HostNode, HostElement>;
|
|
236
236
|
}
|
|
237
|
-
|
|
237
|
+
type PatchFn = (n1: VNode | null, // null means this is a mount
|
|
238
238
|
n2: VNode, container: RendererElement, anchor?: RendererNode | null, parentComponent?: ComponentInternalInstance | null, parentSuspense?: SuspenseBoundary | null, isSVG?: boolean, slotScopeIds?: string[] | null, optimized?: boolean) => void;
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
239
|
+
type MountChildrenFn = (children: VNodeArrayChildren, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, start?: number) => void;
|
|
240
|
+
type PatchChildrenFn = (n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean) => void;
|
|
241
|
+
type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null) => void;
|
|
242
|
+
type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
|
|
243
|
+
type NextFn = (vnode: VNode) => RendererNode | null;
|
|
244
|
+
type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
|
|
245
|
+
type RemoveFn = (vnode: VNode) => void;
|
|
246
|
+
type UnmountChildrenFn = (children: VNode[], parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean, start?: number) => void;
|
|
247
|
+
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
|
|
248
|
+
type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
|
|
249
249
|
declare const enum MoveType {
|
|
250
250
|
ENTER = 0,
|
|
251
251
|
LEAVE = 1,
|
|
@@ -266,63 +266,65 @@ declare const enum MoveType {
|
|
|
266
266
|
* })
|
|
267
267
|
* ```
|
|
268
268
|
*/
|
|
269
|
-
declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>;
|
|
270
|
-
declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer;
|
|
269
|
+
export declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>;
|
|
270
|
+
export declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer;
|
|
271
271
|
|
|
272
|
-
|
|
272
|
+
type MatchPattern = string | RegExp | (string | RegExp)[];
|
|
273
273
|
export interface KeepAliveProps {
|
|
274
274
|
include?: MatchPattern;
|
|
275
275
|
exclude?: MatchPattern;
|
|
276
276
|
max?: number | string;
|
|
277
277
|
}
|
|
278
|
-
declare const KeepAlive: {
|
|
278
|
+
export declare const KeepAlive: {
|
|
279
279
|
new (): {
|
|
280
280
|
$props: VNodeProps & KeepAliveProps;
|
|
281
281
|
};
|
|
282
282
|
__isKeepAlive: true;
|
|
283
283
|
};
|
|
284
|
-
declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
285
|
-
declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
284
|
+
export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
285
|
+
export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
286
286
|
|
|
287
|
-
declare const onBeforeMount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
288
|
-
declare const onMounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
289
|
-
declare const onBeforeUpdate: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
290
|
-
declare const onUpdated: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
291
|
-
declare const onBeforeUnmount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
292
|
-
declare const onUnmounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
293
|
-
declare const onServerPrefetch: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
294
|
-
|
|
295
|
-
declare const onRenderTriggered: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
296
|
-
declare const onRenderTracked: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
297
|
-
|
|
298
|
-
declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;
|
|
287
|
+
export declare const onBeforeMount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
288
|
+
export declare const onMounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
289
|
+
export declare const onBeforeUpdate: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
290
|
+
export declare const onUpdated: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
291
|
+
export declare const onBeforeUnmount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
292
|
+
export declare const onUnmounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
293
|
+
export declare const onServerPrefetch: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
294
|
+
type DebuggerHook = (e: DebuggerEvent) => void;
|
|
295
|
+
export declare const onRenderTriggered: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
296
|
+
export declare const onRenderTracked: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
297
|
+
type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
298
|
+
export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;
|
|
299
299
|
|
|
300
300
|
export type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
|
301
301
|
export type ComponentObjectPropsOptions<P = Data> = {
|
|
302
302
|
[K in keyof P]: Prop<P[K]> | null;
|
|
303
303
|
};
|
|
304
304
|
export type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
|
305
|
-
|
|
306
|
-
|
|
305
|
+
type DefaultFactory<T> = (props: Data) => T | null | undefined;
|
|
306
|
+
interface PropOptions<T = any, D = T> {
|
|
307
307
|
type?: PropType<T> | true | null;
|
|
308
308
|
required?: boolean;
|
|
309
309
|
default?: D | DefaultFactory<D> | null | undefined | object;
|
|
310
310
|
validator?(value: unknown): boolean;
|
|
311
|
+
/* removed internal: skipCheck */
|
|
312
|
+
/* removed internal: skipFactory */
|
|
311
313
|
}
|
|
312
314
|
export type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
|
|
313
|
-
|
|
315
|
+
type PropConstructor<T = any> = {
|
|
314
316
|
new (...args: any[]): T & {};
|
|
315
317
|
} | {
|
|
316
318
|
(): T;
|
|
317
319
|
} | PropMethod<T>;
|
|
318
|
-
|
|
320
|
+
type PropMethod<T, TConstructor = any> = [T] extends [
|
|
319
321
|
((...args: any) => any) | undefined
|
|
320
322
|
] ? {
|
|
321
323
|
new (): TConstructor;
|
|
322
324
|
(): T;
|
|
323
325
|
readonly prototype: TConstructor;
|
|
324
326
|
} : never;
|
|
325
|
-
|
|
327
|
+
type RequiredKeys<T> = {
|
|
326
328
|
[K in keyof T]: T[K] extends {
|
|
327
329
|
required: true;
|
|
328
330
|
} | {
|
|
@@ -333,8 +335,8 @@ export type RequiredKeys<T> = {
|
|
|
333
335
|
default: undefined | (() => undefined);
|
|
334
336
|
} ? never : K : never;
|
|
335
337
|
}[keyof T];
|
|
336
|
-
|
|
337
|
-
|
|
338
|
+
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
339
|
+
type DefaultKeys<T> = {
|
|
338
340
|
[K in keyof T]: T[K] extends {
|
|
339
341
|
default: any;
|
|
340
342
|
} | BooleanConstructor | {
|
|
@@ -344,7 +346,7 @@ export type DefaultKeys<T> = {
|
|
|
344
346
|
required: true;
|
|
345
347
|
} ? never : K : never;
|
|
346
348
|
}[keyof T];
|
|
347
|
-
|
|
349
|
+
type InferPropType<T> = [T] extends [null] ? any : [T] extends [{
|
|
348
350
|
type: null | true;
|
|
349
351
|
}] ? any : [T] extends [ObjectConstructor | {
|
|
350
352
|
type: ObjectConstructor;
|
|
@@ -367,12 +369,12 @@ declare const enum BooleanFlags {
|
|
|
367
369
|
export type ExtractDefaultPropTypes<O> = O extends object ? {
|
|
368
370
|
[K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
|
|
369
371
|
} : {};
|
|
370
|
-
|
|
372
|
+
type NormalizedProp = null | (PropOptions & {
|
|
371
373
|
[BooleanFlags.shouldCast]?: boolean;
|
|
372
374
|
[BooleanFlags.shouldCastTrue]?: boolean;
|
|
373
375
|
});
|
|
374
|
-
|
|
375
|
-
|
|
376
|
+
type NormalizedProps = Record<string, NormalizedProp>;
|
|
377
|
+
type NormalizedPropsOptions = [NormalizedProps, string[]] | [];
|
|
376
378
|
|
|
377
379
|
/**
|
|
378
380
|
Runtime helper for applying directives to a vnode. Example usage:
|
|
@@ -396,7 +398,7 @@ export interface DirectiveBinding<V = any> {
|
|
|
396
398
|
dir: ObjectDirective<any, V>;
|
|
397
399
|
}
|
|
398
400
|
export type DirectiveHook<T = any, Prev = VNode<any, T> | null, V = any> = (el: T, binding: DirectiveBinding<V>, vnode: VNode<any, T>, prevVNode: Prev) => void;
|
|
399
|
-
|
|
401
|
+
type SSRDirectiveHook = (binding: DirectiveBinding, vnode: VNode) => Data | undefined;
|
|
400
402
|
export interface ObjectDirective<T = any, V = any> {
|
|
401
403
|
created?: DirectiveHook<T, null, V>;
|
|
402
404
|
beforeMount?: DirectiveHook<T, null, V>;
|
|
@@ -410,14 +412,14 @@ export interface ObjectDirective<T = any, V = any> {
|
|
|
410
412
|
}
|
|
411
413
|
export type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
|
|
412
414
|
export type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
|
|
413
|
-
|
|
415
|
+
type DirectiveModifiers = Record<string, boolean>;
|
|
414
416
|
export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string, DirectiveModifiers]>;
|
|
415
417
|
/**
|
|
416
418
|
* Adds directives to a VNode.
|
|
417
419
|
*/
|
|
418
|
-
declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
|
|
420
|
+
export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
|
|
419
421
|
|
|
420
|
-
declare const enum DeprecationTypes {
|
|
422
|
+
export declare const enum DeprecationTypes {
|
|
421
423
|
GLOBAL_MOUNT = "GLOBAL_MOUNT",
|
|
422
424
|
GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
|
|
423
425
|
GLOBAL_EXTEND = "GLOBAL_EXTEND",
|
|
@@ -462,7 +464,7 @@ declare const enum DeprecationTypes {
|
|
|
462
464
|
PRIVATE_APIS = "PRIVATE_APIS"
|
|
463
465
|
}
|
|
464
466
|
declare function warnDeprecation(key: DeprecationTypes, instance: ComponentInternalInstance | null, ...args: any[]): void;
|
|
465
|
-
|
|
467
|
+
type CompatConfig = Partial<Record<DeprecationTypes, boolean | 'suppress-warning'>> & {
|
|
466
468
|
MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
|
|
467
469
|
};
|
|
468
470
|
declare function configureCompat(config: CompatConfig): void;
|
|
@@ -498,16 +500,8 @@ declare function checkCompatEnabled(key: DeprecationTypes, instance: ComponentIn
|
|
|
498
500
|
export interface ComponentCustomOptions {
|
|
499
501
|
}
|
|
500
502
|
export type RenderFunction = () => VNodeChild;
|
|
501
|
-
export type ExtractOptionProp<T> = T extends ComponentOptionsBase<infer P, // Props
|
|
502
|
-
any, // RawBindings
|
|
503
|
-
any, // D
|
|
504
|
-
any, // C
|
|
505
|
-
any, // M
|
|
506
|
-
any, // Mixin
|
|
507
|
-
any, // Extends
|
|
508
|
-
any> ? unknown extends P ? {} : P : {};
|
|
509
503
|
export interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, E extends EmitsOptions, EE extends string = string, Defaults = {}, I extends ComponentInjectOptions = {}, II extends string = string> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II>, ComponentInternalOptions, ComponentCustomOptions {
|
|
510
|
-
setup?: (this: void, props:
|
|
504
|
+
setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
|
511
505
|
name?: string;
|
|
512
506
|
template?: string | object;
|
|
513
507
|
render?: Function;
|
|
@@ -540,12 +534,12 @@ export interface RuntimeCompilerOptions {
|
|
|
540
534
|
export type ComponentOptionsWithoutProps<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, PE = Props & EmitsToProps<E>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II> & {
|
|
541
535
|
props?: undefined;
|
|
542
536
|
} & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E, PE, {}, false, I>>;
|
|
543
|
-
export type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<{
|
|
537
|
+
export type ComponentOptionsWithArrayProps<PropNames extends string = string, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, Props = Prettify<Readonly<{
|
|
544
538
|
[key in PropNames]?: any;
|
|
545
|
-
}
|
|
539
|
+
} & EmitsToProps<E>>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II> & {
|
|
546
540
|
props: PropNames[];
|
|
547
541
|
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I>>;
|
|
548
|
-
export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<ExtractPropTypes<PropsOptions
|
|
542
|
+
export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsOptions, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions> & EmitsToProps<E>>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II> & {
|
|
549
543
|
props: PropsOptions & ThisType<void>;
|
|
550
544
|
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I>>;
|
|
551
545
|
export type ComponentOptions<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = any, M extends MethodOptions = any, Mixin extends ComponentOptionsMixin = any, Extends extends ComponentOptionsMixin = any, E extends EmitsOptions = any> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E> & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>>>;
|
|
@@ -554,30 +548,30 @@ export type ComputedOptions = Record<string, ComputedGetter<any> | WritableCompu
|
|
|
554
548
|
export interface MethodOptions {
|
|
555
549
|
[key: string]: Function;
|
|
556
550
|
}
|
|
557
|
-
|
|
551
|
+
type ExtractComputedReturns<T extends any> = {
|
|
558
552
|
[key in keyof T]: T[key] extends {
|
|
559
553
|
get: (...args: any[]) => infer TReturn;
|
|
560
554
|
} ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never;
|
|
561
555
|
};
|
|
562
|
-
|
|
556
|
+
type ObjectWatchOptionItem = {
|
|
563
557
|
handler: WatchCallback | string;
|
|
564
558
|
} & WatchOptions;
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
559
|
+
type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem;
|
|
560
|
+
type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
|
|
561
|
+
type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
|
|
568
562
|
export type ComponentProvideOptions = ObjectProvideOptions | Function;
|
|
569
|
-
|
|
563
|
+
type ObjectProvideOptions = Record<string | symbol, unknown>;
|
|
570
564
|
export type ComponentInjectOptions = string[] | ObjectInjectOptions;
|
|
571
|
-
|
|
565
|
+
type ObjectInjectOptions = Record<string | symbol, string | symbol | {
|
|
572
566
|
from?: string | symbol;
|
|
573
567
|
default?: unknown;
|
|
574
568
|
}>;
|
|
575
|
-
|
|
569
|
+
type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? {
|
|
576
570
|
[K in T[number]]?: unknown;
|
|
577
571
|
} : T extends ObjectInjectOptions ? {
|
|
578
572
|
[K in keyof T]?: unknown;
|
|
579
573
|
} : never;
|
|
580
|
-
|
|
574
|
+
interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string> {
|
|
581
575
|
compatConfig?: CompatConfig;
|
|
582
576
|
[key: string]: any;
|
|
583
577
|
data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
|
|
@@ -621,9 +615,9 @@ export interface LegacyOptions<Props, D, C extends ComputedOptions, M extends Me
|
|
|
621
615
|
*/
|
|
622
616
|
__differentiator?: keyof D | keyof C | keyof M;
|
|
623
617
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
618
|
+
type MergedHook<T = () => void> = T | T[];
|
|
619
|
+
type MergedComponentOptions = ComponentOptions & MergedComponentOptionsOverride;
|
|
620
|
+
type MergedComponentOptionsOverride = {
|
|
627
621
|
beforeCreate?: MergedHook;
|
|
628
622
|
created?: MergedHook;
|
|
629
623
|
beforeMount?: MergedHook;
|
|
@@ -642,8 +636,8 @@ export type MergedComponentOptionsOverride = {
|
|
|
642
636
|
renderTriggered?: MergedHook<DebuggerHook>;
|
|
643
637
|
errorCaptured?: MergedHook<ErrorCapturedHook>;
|
|
644
638
|
};
|
|
645
|
-
|
|
646
|
-
|
|
639
|
+
type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults';
|
|
640
|
+
type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
|
|
647
641
|
P: P;
|
|
648
642
|
B: B;
|
|
649
643
|
D: D;
|
|
@@ -654,10 +648,10 @@ export type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions =
|
|
|
654
648
|
|
|
655
649
|
export interface InjectionKey<T> extends Symbol {
|
|
656
650
|
}
|
|
657
|
-
declare function provide<T>(key: InjectionKey<T> | string | number, value: T): void;
|
|
658
|
-
declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
|
659
|
-
declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
|
660
|
-
declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory: true): T;
|
|
651
|
+
export declare function provide<T>(key: InjectionKey<T> | string | number, value: T): void;
|
|
652
|
+
export declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
|
653
|
+
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
|
654
|
+
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory: true): T;
|
|
661
655
|
|
|
662
656
|
export interface App<HostElement = any> {
|
|
663
657
|
version: string;
|
|
@@ -721,7 +715,7 @@ export interface AppContext {
|
|
|
721
715
|
/* removed internal: reload */
|
|
722
716
|
/* removed internal: filters */
|
|
723
717
|
}
|
|
724
|
-
|
|
718
|
+
type PluginInstallFunction<Options> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
725
719
|
export type Plugin<Options = any[]> = (PluginInstallFunction<Options> & {
|
|
726
720
|
install?: PluginInstallFunction<Options>;
|
|
727
721
|
}) | {
|
|
@@ -729,7 +723,7 @@ export type Plugin<Options = any[]> = (PluginInstallFunction<Options> & {
|
|
|
729
723
|
};
|
|
730
724
|
export type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
|
|
731
725
|
|
|
732
|
-
|
|
726
|
+
type Hook<T = () => void> = T | T[];
|
|
733
727
|
export interface BaseTransitionProps<HostElement = RendererElement> {
|
|
734
728
|
mode?: 'in-out' | 'out-in' | 'default';
|
|
735
729
|
appear?: boolean;
|
|
@@ -764,8 +758,8 @@ export interface TransitionState {
|
|
|
764
758
|
isUnmounting: boolean;
|
|
765
759
|
leavingVNodes: Map<any, Record<string, VNode>>;
|
|
766
760
|
}
|
|
767
|
-
declare function useTransitionState(): TransitionState;
|
|
768
|
-
declare const BaseTransitionPropsValidators: {
|
|
761
|
+
export declare function useTransitionState(): TransitionState;
|
|
762
|
+
export declare const BaseTransitionPropsValidators: {
|
|
769
763
|
mode: StringConstructor;
|
|
770
764
|
appear: BooleanConstructor;
|
|
771
765
|
persisted: BooleanConstructor;
|
|
@@ -782,14 +776,14 @@ declare const BaseTransitionPropsValidators: {
|
|
|
782
776
|
onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
783
777
|
onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
784
778
|
};
|
|
785
|
-
declare const BaseTransition: new () => {
|
|
779
|
+
export declare const BaseTransition: new () => {
|
|
786
780
|
$props: BaseTransitionProps<any>;
|
|
787
781
|
};
|
|
788
|
-
declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
|
|
789
|
-
declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
|
|
790
|
-
declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
|
|
782
|
+
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
|
|
783
|
+
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
|
|
784
|
+
export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
|
|
791
785
|
|
|
792
|
-
|
|
786
|
+
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
793
787
|
export interface TeleportProps {
|
|
794
788
|
to: string | RendererElement | null | undefined;
|
|
795
789
|
disabled?: boolean;
|
|
@@ -808,7 +802,7 @@ declare const enum TeleportMoveTypes {
|
|
|
808
802
|
}
|
|
809
803
|
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
|
|
810
804
|
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector } }: 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;
|
|
811
|
-
declare const Teleport: {
|
|
805
|
+
export declare const Teleport: {
|
|
812
806
|
new (): {
|
|
813
807
|
$props: VNodeProps & TeleportProps;
|
|
814
808
|
};
|
|
@@ -818,38 +812,38 @@ declare const Teleport: {
|
|
|
818
812
|
/**
|
|
819
813
|
* @private
|
|
820
814
|
*/
|
|
821
|
-
declare function resolveComponent(name: string, maybeSelfReference?: boolean): ConcreteComponent | string;
|
|
815
|
+
export declare function resolveComponent(name: string, maybeSelfReference?: boolean): ConcreteComponent | string;
|
|
822
816
|
declare const NULL_DYNAMIC_COMPONENT: unique symbol;
|
|
823
817
|
/**
|
|
824
818
|
* @private
|
|
825
819
|
*/
|
|
826
|
-
declare function resolveDynamicComponent(component: unknown): VNodeTypes;
|
|
820
|
+
export declare function resolveDynamicComponent(component: unknown): VNodeTypes;
|
|
827
821
|
/**
|
|
828
822
|
* @private
|
|
829
823
|
*/
|
|
830
|
-
declare function resolveDirective(name: string): Directive | undefined;
|
|
824
|
+
export declare function resolveDirective(name: string): Directive | undefined;
|
|
831
825
|
/* removed internal: resolveFilter$1 */
|
|
832
826
|
|
|
833
|
-
declare const Fragment: {
|
|
827
|
+
export declare const Fragment: {
|
|
834
828
|
new (): {
|
|
835
829
|
$props: VNodeProps;
|
|
836
830
|
};
|
|
837
831
|
__isFragment: true;
|
|
838
832
|
};
|
|
839
|
-
declare const Text: unique symbol;
|
|
840
|
-
declare const Comment: unique symbol;
|
|
841
|
-
declare const Static: unique symbol;
|
|
833
|
+
export declare const Text: unique symbol;
|
|
834
|
+
export declare const Comment: unique symbol;
|
|
835
|
+
export declare const Static: unique symbol;
|
|
842
836
|
export type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
|
|
843
837
|
export type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
|
844
|
-
|
|
838
|
+
type VNodeNormalizedRefAtom = {
|
|
845
839
|
i: ComponentInternalInstance;
|
|
846
840
|
r: VNodeRef;
|
|
847
841
|
k?: string;
|
|
848
842
|
f?: boolean;
|
|
849
843
|
};
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
844
|
+
type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
|
|
845
|
+
type VNodeMountHook = (vnode: VNode) => void;
|
|
846
|
+
type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
|
|
853
847
|
export type VNodeProps = {
|
|
854
848
|
key?: string | number | symbol;
|
|
855
849
|
ref?: VNodeRef;
|
|
@@ -862,7 +856,7 @@ export type VNodeProps = {
|
|
|
862
856
|
onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
|
|
863
857
|
onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
|
|
864
858
|
};
|
|
865
|
-
|
|
859
|
+
type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
|
|
866
860
|
export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
|
|
867
861
|
export type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
|
|
868
862
|
export type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
|
|
@@ -919,7 +913,7 @@ export interface VNode<HostNode = RendererNode, HostElement = RendererElement, E
|
|
|
919
913
|
*
|
|
920
914
|
* @private
|
|
921
915
|
*/
|
|
922
|
-
declare function openBlock(disableTracking?: boolean): void;
|
|
916
|
+
export declare function openBlock(disableTracking?: boolean): void;
|
|
923
917
|
/**
|
|
924
918
|
* Block tracking sometimes needs to be disabled, for example during the
|
|
925
919
|
* creation of a tree that needs to be cached by v-once. The compiler generates
|
|
@@ -936,11 +930,11 @@ declare function openBlock(disableTracking?: boolean): void;
|
|
|
936
930
|
*
|
|
937
931
|
* @private
|
|
938
932
|
*/
|
|
939
|
-
declare function setBlockTracking(value: number): void;
|
|
933
|
+
export declare function setBlockTracking(value: number): void;
|
|
940
934
|
/**
|
|
941
935
|
* @private
|
|
942
936
|
*/
|
|
943
|
-
declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode<RendererNode, RendererElement, {
|
|
937
|
+
export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode<RendererNode, RendererElement, {
|
|
944
938
|
[key: string]: any;
|
|
945
939
|
}>;
|
|
946
940
|
/**
|
|
@@ -950,8 +944,8 @@ declare function createElementBlock(type: string | typeof Fragment, props?: Reco
|
|
|
950
944
|
*
|
|
951
945
|
* @private
|
|
952
946
|
*/
|
|
953
|
-
declare function createBlock(type: VNodeTypes | ClassComponent, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[]): VNode;
|
|
954
|
-
declare function isVNode(value: any): value is VNode;
|
|
947
|
+
export declare function createBlock(type: VNodeTypes | ClassComponent, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[]): VNode;
|
|
948
|
+
export declare function isVNode(value: any): value is VNode;
|
|
955
949
|
declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, instance: ComponentInternalInstance | null) => Parameters<typeof _createVNode>) | undefined;
|
|
956
950
|
/**
|
|
957
951
|
* Internal API for registering an arguments transform for createVNode
|
|
@@ -959,31 +953,31 @@ declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, insta
|
|
|
959
953
|
* It is *internal* but needs to be exposed for test-utils to pick up proper
|
|
960
954
|
* typings
|
|
961
955
|
*/
|
|
962
|
-
declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;
|
|
963
|
-
declare function createBaseVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, shapeFlag?: number
|
|
956
|
+
export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;
|
|
957
|
+
export declare function createBaseVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, shapeFlag?: number, isBlockNode?: boolean, needFullChildrenNormalization?: boolean): VNode<RendererNode, RendererElement, {
|
|
964
958
|
[key: string]: any;
|
|
965
959
|
}>;
|
|
966
960
|
|
|
967
|
-
declare const createVNode: typeof _createVNode;
|
|
961
|
+
export declare const createVNode: typeof _createVNode;
|
|
968
962
|
declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, isBlockNode?: boolean): VNode;
|
|
969
|
-
declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null;
|
|
970
|
-
declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean): VNode<T, U>;
|
|
963
|
+
export declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null;
|
|
964
|
+
export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean): VNode<T, U>;
|
|
971
965
|
/**
|
|
972
966
|
* @private
|
|
973
967
|
*/
|
|
974
|
-
declare function createTextVNode(text?: string, flag?: number): VNode;
|
|
968
|
+
export declare function createTextVNode(text?: string, flag?: number): VNode;
|
|
975
969
|
/**
|
|
976
970
|
* @private
|
|
977
971
|
*/
|
|
978
|
-
declare function createStaticVNode(content: string, numberOfNodes: number): VNode;
|
|
972
|
+
export declare function createStaticVNode(content: string, numberOfNodes: number): VNode;
|
|
979
973
|
/**
|
|
980
974
|
* @private
|
|
981
975
|
*/
|
|
982
|
-
declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;
|
|
976
|
+
export declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;
|
|
983
977
|
declare function normalizeVNode(child: VNodeChild): VNode;
|
|
984
|
-
declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
|
|
978
|
+
export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
|
|
985
979
|
|
|
986
|
-
|
|
980
|
+
type Data = Record<string, unknown>;
|
|
987
981
|
/**
|
|
988
982
|
* For extending allowed non-declared props on components in TSX
|
|
989
983
|
*/
|
|
@@ -996,7 +990,7 @@ export interface AllowedComponentProps {
|
|
|
996
990
|
class?: unknown;
|
|
997
991
|
style?: unknown;
|
|
998
992
|
}
|
|
999
|
-
|
|
993
|
+
interface ComponentInternalOptions {
|
|
1000
994
|
/* removed internal: __scopeId */
|
|
1001
995
|
/* removed internal: __cssModules */
|
|
1002
996
|
/* removed internal: __hmrId */
|
|
@@ -1021,7 +1015,7 @@ export interface FunctionalComponent<P = {}, E extends EmitsOptions = {}> extend
|
|
|
1021
1015
|
displayName?: string;
|
|
1022
1016
|
compatConfig?: CompatConfig;
|
|
1023
1017
|
}
|
|
1024
|
-
|
|
1018
|
+
interface ClassComponent {
|
|
1025
1019
|
new (...args: any[]): ComponentPublicInstance<any, any, any, any, any>;
|
|
1026
1020
|
__vccOpts: ComponentOptions;
|
|
1027
1021
|
}
|
|
@@ -1038,7 +1032,7 @@ export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends
|
|
|
1038
1032
|
*/
|
|
1039
1033
|
export type Component<Props = any, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ConcreteComponent<Props, RawBindings, D, C, M> | ComponentPublicInstanceConstructor<Props>;
|
|
1040
1034
|
|
|
1041
|
-
|
|
1035
|
+
type LifecycleHook<TFn = Function> = TFn[] | null;
|
|
1042
1036
|
export type SetupContext<E = EmitsOptions> = E extends any ? {
|
|
1043
1037
|
attrs: Data;
|
|
1044
1038
|
slots: Slots;
|
|
@@ -1129,22 +1123,22 @@ export interface ComponentInternalInstance {
|
|
|
1129
1123
|
/* removed internal: ut */
|
|
1130
1124
|
}
|
|
1131
1125
|
declare function createComponentInstance(vnode: VNode, parent: ComponentInternalInstance | null, suspense: SuspenseBoundary | null): ComponentInternalInstance;
|
|
1132
|
-
declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
1126
|
+
export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
1133
1127
|
declare function setupComponent(instance: ComponentInternalInstance, isSSR?: boolean): Promise<void> | undefined;
|
|
1134
1128
|
/**
|
|
1135
1129
|
* For runtime-dom to register the compiler.
|
|
1136
1130
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
1137
1131
|
*/
|
|
1138
|
-
declare function registerRuntimeCompiler(_compile: any): void;
|
|
1139
|
-
declare const isRuntimeOnly: () => boolean;
|
|
1132
|
+
export declare function registerRuntimeCompiler(_compile: any): void;
|
|
1133
|
+
export declare const isRuntimeOnly: () => boolean;
|
|
1140
1134
|
|
|
1141
1135
|
export type WatchEffect = (onCleanup: OnCleanup) => void;
|
|
1142
1136
|
export type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
|
1143
1137
|
export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
|
|
1144
|
-
|
|
1138
|
+
type MapSources<T, Immediate> = {
|
|
1145
1139
|
[K in keyof T]: T[K] extends WatchSource<infer V> ? Immediate extends true ? V | undefined : V : T[K] extends object ? Immediate extends true ? T[K] | undefined : T[K] : never;
|
|
1146
1140
|
};
|
|
1147
|
-
|
|
1141
|
+
type OnCleanup = (cleanupFn: () => void) => void;
|
|
1148
1142
|
export interface WatchOptionsBase extends DebuggerOptions {
|
|
1149
1143
|
flush?: 'pre' | 'post' | 'sync';
|
|
1150
1144
|
}
|
|
@@ -1153,25 +1147,32 @@ export interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
|
|
|
1153
1147
|
deep?: boolean;
|
|
1154
1148
|
}
|
|
1155
1149
|
export type WatchStopHandle = () => void;
|
|
1156
|
-
declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchStopHandle;
|
|
1157
|
-
declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
1158
|
-
declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
1159
|
-
|
|
1160
|
-
declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1161
|
-
declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1162
|
-
declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1163
|
-
declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1150
|
+
export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchStopHandle;
|
|
1151
|
+
export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
1152
|
+
export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
1153
|
+
type MultiWatchSources = (WatchSource<unknown> | object)[];
|
|
1154
|
+
export declare function watch<T extends MultiWatchSources, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1155
|
+
export declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1156
|
+
export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1157
|
+
export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1164
1158
|
|
|
1165
|
-
|
|
1159
|
+
type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1166
1160
|
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>), Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true> & Props> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults> & PP;
|
|
1167
|
-
declare function defineComponent<Props,
|
|
1168
|
-
|
|
1169
|
-
|
|
1161
|
+
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string>(setup: (props: Props, ctx: SetupContext<E>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
1162
|
+
props?: (keyof Props)[];
|
|
1163
|
+
emits?: E | EE[];
|
|
1164
|
+
}): (props: Props & EmitsToProps<E>) => any;
|
|
1165
|
+
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string>(setup: (props: Props, ctx: SetupContext<E>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
1166
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
1167
|
+
emits?: E | EE[];
|
|
1168
|
+
}): (props: Props & EmitsToProps<E>) => any;
|
|
1169
|
+
export declare function defineComponent<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE>;
|
|
1170
|
+
export declare function defineComponent<PropNames extends string, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II>): DefineComponent<Readonly<{
|
|
1170
1171
|
[key in PropNames]?: any;
|
|
1171
1172
|
}>, RawBindings, D, C, M, Mixin, Extends, E, EE>;
|
|
1172
|
-
declare function defineComponent<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>;
|
|
1173
|
+
export declare function defineComponent<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE>;
|
|
1173
1174
|
|
|
1174
|
-
|
|
1175
|
+
type AsyncComponentResolveResult<T = Component> = T | {
|
|
1175
1176
|
default: T;
|
|
1176
1177
|
};
|
|
1177
1178
|
export type AsyncComponentLoader<T = any> = () => Promise<AsyncComponentResolveResult<T>>;
|
|
@@ -1184,7 +1185,7 @@ export interface AsyncComponentOptions<T = any> {
|
|
|
1184
1185
|
suspensible?: boolean;
|
|
1185
1186
|
onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
|
|
1186
1187
|
}
|
|
1187
|
-
declare function defineAsyncComponent<T extends Component = {
|
|
1188
|
+
export declare function defineAsyncComponent<T extends Component = {
|
|
1188
1189
|
new (): ComponentPublicInstance;
|
|
1189
1190
|
}>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
|
1190
1191
|
|
|
@@ -1218,13 +1219,15 @@ declare function defineAsyncComponent<T extends Component = {
|
|
|
1218
1219
|
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1219
1220
|
* output and should **not** be actually called at runtime.
|
|
1220
1221
|
*/
|
|
1221
|
-
declare function defineProps<PropNames extends string = string>(props: PropNames[]): Readonly<{
|
|
1222
|
+
export declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{
|
|
1222
1223
|
[key in PropNames]?: any;
|
|
1223
|
-
}
|
|
1224
|
-
declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Readonly<ExtractPropTypes<PP
|
|
1225
|
-
declare function defineProps<TypeProps>():
|
|
1226
|
-
|
|
1227
|
-
|
|
1224
|
+
}>>;
|
|
1225
|
+
export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
|
|
1226
|
+
export declare function defineProps<TypeProps>(): ResolveProps<TypeProps>;
|
|
1227
|
+
type ResolveProps<T, BooleanKeys extends keyof T = BooleanKey<T>> = Prettify<Readonly<T & {
|
|
1228
|
+
[K in BooleanKeys]-?: boolean;
|
|
1229
|
+
}>>;
|
|
1230
|
+
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
|
|
1228
1231
|
/**
|
|
1229
1232
|
* Vue `<script setup>` compiler macro for declaring a component's emitted
|
|
1230
1233
|
* events. The expected argument is the same as the component `emits` option.
|
|
@@ -1248,9 +1251,9 @@ declare function defineProps<TypeProps>(): Readonly<Omit<TypeProps, BooleanKey<T
|
|
|
1248
1251
|
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1249
1252
|
* output and should **not** be actually called at runtime.
|
|
1250
1253
|
*/
|
|
1251
|
-
declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
|
1252
|
-
declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
|
1253
|
-
declare function defineEmits<TypeEmit>(): TypeEmit;
|
|
1254
|
+
export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
|
1255
|
+
export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
|
1256
|
+
export declare function defineEmits<TypeEmit>(): TypeEmit;
|
|
1254
1257
|
/**
|
|
1255
1258
|
* Vue `<script setup>` compiler macro for declaring a component's exposed
|
|
1256
1259
|
* instance properties when it is accessed by a parent component via template
|
|
@@ -1263,14 +1266,17 @@ declare function defineEmits<TypeEmit>(): TypeEmit;
|
|
|
1263
1266
|
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1264
1267
|
* output and should **not** be actually called at runtime.
|
|
1265
1268
|
*/
|
|
1266
|
-
declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
|
1267
|
-
export
|
|
1268
|
-
|
|
1269
|
-
|
|
1269
|
+
export declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
|
1270
|
+
export declare function defineOptions<RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = EmitsOptions, EE extends string = string>(options?: ComponentOptionsWithoutProps<{}, RawBindings, D, C, M, Mixin, Extends, E, EE> & {
|
|
1271
|
+
emits?: undefined;
|
|
1272
|
+
expose?: undefined;
|
|
1273
|
+
}): void;
|
|
1274
|
+
type NotUndefined<T> = T extends undefined ? never : T;
|
|
1275
|
+
type InferDefaults<T> = {
|
|
1270
1276
|
[K in keyof T]?: InferDefault<T, NotUndefined<T[K]>>;
|
|
1271
1277
|
};
|
|
1272
|
-
|
|
1273
|
-
|
|
1278
|
+
type InferDefault<P, T> = T extends null | number | string | boolean | symbol | Function ? T | ((props: P) => T) : (props: P) => T;
|
|
1279
|
+
type PropsWithDefaults<Base, Defaults> = Base & {
|
|
1274
1280
|
[K in keyof Defaults]: K extends keyof Base ? Defaults[K] extends undefined ? Base[K] : NotUndefined<Base[K]> : never;
|
|
1275
1281
|
};
|
|
1276
1282
|
/**
|
|
@@ -1290,20 +1296,22 @@ export type PropsWithDefaults<Base, Defaults> = Base & {
|
|
|
1290
1296
|
*
|
|
1291
1297
|
* This is only usable inside `<script setup>`, is compiled away in the output
|
|
1292
1298
|
* and should **not** be actually called at runtime.
|
|
1299
|
+
*
|
|
1300
|
+
* @deprecated use reactive props destructure instead.
|
|
1293
1301
|
*/
|
|
1294
|
-
declare function withDefaults<Props, Defaults extends InferDefaults<Props>>(props: Props, defaults: Defaults): PropsWithDefaults<Props, Defaults>;
|
|
1295
|
-
declare function useSlots(): SetupContext['slots'];
|
|
1296
|
-
declare function useAttrs(): SetupContext['attrs'];
|
|
1302
|
+
export declare function withDefaults<Props, Defaults extends InferDefaults<Props>>(props: Props, defaults: Defaults): PropsWithDefaults<Props, Defaults>;
|
|
1303
|
+
export declare function useSlots(): SetupContext['slots'];
|
|
1304
|
+
export declare function useAttrs(): SetupContext['attrs'];
|
|
1297
1305
|
/* removed internal: mergeDefaults */
|
|
1298
1306
|
/* removed internal: createPropsRestProxy */
|
|
1299
1307
|
/* removed internal: withAsyncContext */
|
|
1300
1308
|
|
|
1301
|
-
|
|
1309
|
+
type RawProps = VNodeProps & {
|
|
1302
1310
|
__v_isVNode?: never;
|
|
1303
1311
|
[Symbol.iterator]?: never;
|
|
1304
1312
|
} & Record<string, any>;
|
|
1305
|
-
|
|
1306
|
-
|
|
1313
|
+
type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
|
1314
|
+
interface Constructor<P = any> {
|
|
1307
1315
|
__isFragment?: never;
|
|
1308
1316
|
__isTeleport?: never;
|
|
1309
1317
|
__isSuspense?: never;
|
|
@@ -1311,33 +1319,33 @@ export interface Constructor<P = any> {
|
|
|
1311
1319
|
$props: P;
|
|
1312
1320
|
};
|
|
1313
1321
|
}
|
|
1314
|
-
declare function h(type: string, children?: RawChildren): VNode;
|
|
1315
|
-
declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode;
|
|
1316
|
-
declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): VNode;
|
|
1317
|
-
declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): VNode;
|
|
1318
|
-
declare function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode;
|
|
1319
|
-
declare function h(type: typeof Fragment, props?: RawProps | null, children?: VNodeArrayChildren): VNode;
|
|
1320
|
-
declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): VNode;
|
|
1321
|
-
declare function h(type: typeof Suspense, children?: RawChildren): VNode;
|
|
1322
|
-
declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;
|
|
1323
|
-
declare function h<P, E extends EmitsOptions = {}>(type: FunctionalComponent<P, E>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1324
|
-
declare function h(type: Component, children?: RawChildren): VNode;
|
|
1325
|
-
declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;
|
|
1326
|
-
declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
|
|
1327
|
-
declare function h<P>(type: Component<P>, props?: (RawProps & P) | null, children?: RawChildren | RawSlots): VNode;
|
|
1328
|
-
declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1329
|
-
declare function h(type: Constructor, children?: RawChildren): VNode;
|
|
1330
|
-
declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1331
|
-
declare function h(type: DefineComponent, children?: RawChildren): VNode;
|
|
1332
|
-
declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1322
|
+
export declare function h(type: string, children?: RawChildren): VNode;
|
|
1323
|
+
export declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode;
|
|
1324
|
+
export declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): VNode;
|
|
1325
|
+
export declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): VNode;
|
|
1326
|
+
export declare function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode;
|
|
1327
|
+
export declare function h(type: typeof Fragment, props?: RawProps | null, children?: VNodeArrayChildren): VNode;
|
|
1328
|
+
export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): VNode;
|
|
1329
|
+
export declare function h(type: typeof Suspense, children?: RawChildren): VNode;
|
|
1330
|
+
export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;
|
|
1331
|
+
export declare function h<P, E extends EmitsOptions = {}>(type: FunctionalComponent<P, E>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1332
|
+
export declare function h(type: Component, children?: RawChildren): VNode;
|
|
1333
|
+
export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;
|
|
1334
|
+
export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
|
|
1335
|
+
export declare function h<P>(type: Component<P>, props?: (RawProps & P) | null, children?: RawChildren | RawSlots): VNode;
|
|
1336
|
+
export declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1337
|
+
export declare function h(type: Constructor, children?: RawChildren): VNode;
|
|
1338
|
+
export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1339
|
+
export declare function h(type: DefineComponent, children?: RawChildren): VNode;
|
|
1340
|
+
export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1333
1341
|
|
|
1334
|
-
declare const ssrContextKey: unique symbol;
|
|
1335
|
-
declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
|
|
1342
|
+
export declare const ssrContextKey: unique symbol;
|
|
1343
|
+
export declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
|
|
1336
1344
|
|
|
1337
|
-
declare function warn(msg: string, ...args: any[]): void;
|
|
1345
|
+
export declare function warn(msg: string, ...args: any[]): void;
|
|
1338
1346
|
/* removed internal: assertNumber */
|
|
1339
1347
|
|
|
1340
|
-
declare const enum ErrorCodes {
|
|
1348
|
+
export declare const enum ErrorCodes {
|
|
1341
1349
|
SETUP_FUNCTION = 0,
|
|
1342
1350
|
RENDER_FUNCTION = 1,
|
|
1343
1351
|
WATCH_GETTER = 2,
|
|
@@ -1354,20 +1362,20 @@ declare const enum ErrorCodes {
|
|
|
1354
1362
|
ASYNC_COMPONENT_LOADER = 13,
|
|
1355
1363
|
SCHEDULER = 14
|
|
1356
1364
|
}
|
|
1357
|
-
|
|
1358
|
-
declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
|
|
1359
|
-
declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any[];
|
|
1360
|
-
declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes, throwInDev?: boolean): void;
|
|
1365
|
+
type ErrorTypes = LifecycleHooks | ErrorCodes;
|
|
1366
|
+
export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
|
|
1367
|
+
export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any[];
|
|
1368
|
+
export declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes, throwInDev?: boolean): void;
|
|
1361
1369
|
|
|
1362
|
-
declare function initCustomFormatter(): void;
|
|
1370
|
+
export declare function initCustomFormatter(): void;
|
|
1363
1371
|
|
|
1364
|
-
|
|
1372
|
+
interface AppRecord {
|
|
1365
1373
|
id: number;
|
|
1366
1374
|
app: App;
|
|
1367
1375
|
version: string;
|
|
1368
1376
|
types: Record<string, string | Symbol>;
|
|
1369
1377
|
}
|
|
1370
|
-
|
|
1378
|
+
interface DevtoolsHook {
|
|
1371
1379
|
enabled?: boolean;
|
|
1372
1380
|
emit: (event: string, ...payload: any[]) => void;
|
|
1373
1381
|
on: (event: string, handler: Function) => void;
|
|
@@ -1380,10 +1388,10 @@ export interface DevtoolsHook {
|
|
|
1380
1388
|
*/
|
|
1381
1389
|
cleanupBuffer?: (matchArg: unknown) => boolean;
|
|
1382
1390
|
}
|
|
1383
|
-
declare let devtools: DevtoolsHook;
|
|
1384
|
-
declare function setDevtoolsHook(hook: DevtoolsHook, target: any): void;
|
|
1391
|
+
export declare let devtools: DevtoolsHook;
|
|
1392
|
+
export declare function setDevtoolsHook(hook: DevtoolsHook, target: any): void;
|
|
1385
1393
|
|
|
1386
|
-
|
|
1394
|
+
type HMRComponent = ComponentOptions | ClassComponent;
|
|
1387
1395
|
export interface HMRRuntime {
|
|
1388
1396
|
createRecord: typeof createRecord;
|
|
1389
1397
|
rerender: typeof rerender;
|
|
@@ -1408,60 +1416,60 @@ declare function setCurrentRenderingInstance(instance: ComponentInternalInstance
|
|
|
1408
1416
|
* Set scope id when creating hoisted vnodes.
|
|
1409
1417
|
* @private compiler helper
|
|
1410
1418
|
*/
|
|
1411
|
-
declare function pushScopeId(id: string | null): void;
|
|
1419
|
+
export declare function pushScopeId(id: string | null): void;
|
|
1412
1420
|
/**
|
|
1413
1421
|
* Technically we no longer need this after 3.0.8 but we need to keep the same
|
|
1414
1422
|
* API for backwards compat w/ code generated by compilers.
|
|
1415
1423
|
* @private
|
|
1416
1424
|
*/
|
|
1417
|
-
declare function popScopeId(): void;
|
|
1425
|
+
export declare function popScopeId(): void;
|
|
1418
1426
|
/**
|
|
1419
1427
|
* Only for backwards compat
|
|
1420
1428
|
* @private
|
|
1421
1429
|
*/
|
|
1422
|
-
declare const withScopeId: (_id: string) => typeof withCtx;
|
|
1430
|
+
export declare const withScopeId: (_id: string) => typeof withCtx;
|
|
1423
1431
|
/**
|
|
1424
1432
|
* Wrap a slot function to memoize current rendering instance
|
|
1425
1433
|
* @private compiler helper
|
|
1426
1434
|
*/
|
|
1427
|
-
declare function withCtx(fn: Function, ctx?: ComponentInternalInstance | null, isNonScopedSlot?: boolean): Function;
|
|
1435
|
+
export declare function withCtx(fn: Function, ctx?: ComponentInternalInstance | null, isNonScopedSlot?: boolean): Function;
|
|
1428
1436
|
|
|
1429
1437
|
/**
|
|
1430
1438
|
* v-for string
|
|
1431
1439
|
* @private
|
|
1432
1440
|
*/
|
|
1433
|
-
declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[];
|
|
1441
|
+
export declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[];
|
|
1434
1442
|
/**
|
|
1435
1443
|
* v-for number
|
|
1436
1444
|
*/
|
|
1437
|
-
declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[];
|
|
1445
|
+
export declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[];
|
|
1438
1446
|
/**
|
|
1439
1447
|
* v-for array
|
|
1440
1448
|
*/
|
|
1441
|
-
declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
|
1449
|
+
export declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
|
1442
1450
|
/**
|
|
1443
1451
|
* v-for iterable
|
|
1444
1452
|
*/
|
|
1445
|
-
declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
|
1453
|
+
export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
|
1446
1454
|
/**
|
|
1447
1455
|
* v-for object
|
|
1448
1456
|
*/
|
|
1449
|
-
declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild): VNodeChild[];
|
|
1457
|
+
export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild): VNodeChild[];
|
|
1450
1458
|
|
|
1451
1459
|
/**
|
|
1452
1460
|
* For prefixing keys in v-on="obj" with "on"
|
|
1453
1461
|
* @private
|
|
1454
1462
|
*/
|
|
1455
|
-
declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
|
|
1463
|
+
export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
|
|
1456
1464
|
|
|
1457
1465
|
/**
|
|
1458
1466
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1459
1467
|
* @private
|
|
1460
1468
|
*/
|
|
1461
|
-
declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode;
|
|
1469
|
+
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode;
|
|
1462
1470
|
|
|
1463
|
-
|
|
1464
|
-
|
|
1471
|
+
type SSRSlot = (...args: any[]) => VNode[] | undefined;
|
|
1472
|
+
interface CompiledSlotDescriptor {
|
|
1465
1473
|
name: string;
|
|
1466
1474
|
fn: SSRSlot;
|
|
1467
1475
|
key?: string;
|
|
@@ -1470,12 +1478,12 @@ export interface CompiledSlotDescriptor {
|
|
|
1470
1478
|
* Compiler runtime helper for creating dynamic slots object
|
|
1471
1479
|
* @private
|
|
1472
1480
|
*/
|
|
1473
|
-
declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>;
|
|
1481
|
+
export declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>;
|
|
1474
1482
|
|
|
1475
|
-
declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any, {
|
|
1483
|
+
export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any, {
|
|
1476
1484
|
[key: string]: any;
|
|
1477
1485
|
}>;
|
|
1478
|
-
declare function isMemoSame(cached: VNode, memo: any[]): boolean;
|
|
1486
|
+
export declare function isMemoSame(cached: VNode, memo: any[]): boolean;
|
|
1479
1487
|
|
|
1480
1488
|
declare function renderComponentRoot(instance: ComponentInternalInstance): VNode;
|
|
1481
1489
|
|
|
@@ -1506,8 +1514,8 @@ export type LegacyConfig = {
|
|
|
1506
1514
|
productionTip?: boolean;
|
|
1507
1515
|
};
|
|
1508
1516
|
|
|
1509
|
-
|
|
1510
|
-
|
|
1517
|
+
type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties;
|
|
1518
|
+
interface LegacyPublicProperties {
|
|
1511
1519
|
$set(target: object, key: string, value: any): void;
|
|
1512
1520
|
$delete(target: object, key: string): void;
|
|
1513
1521
|
$mount(el?: string | Element): this;
|
|
@@ -1565,7 +1573,7 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
|
|
|
1565
1573
|
};
|
|
1566
1574
|
declare function createCompatVue(createApp: CreateAppFunction<Element>, createSingletonApp: CreateAppFunction<Element>): CompatVue;
|
|
1567
1575
|
|
|
1568
|
-
declare const version: string;
|
|
1576
|
+
export declare const version: string;
|
|
1569
1577
|
|
|
1570
1578
|
declare module '@vue/reactivity' {
|
|
1571
1579
|
interface RefUnwrapBailTypes {
|
|
@@ -1580,17 +1588,19 @@ declare module '@vue/reactivity' {
|
|
|
1580
1588
|
|
|
1581
1589
|
|
|
1582
1590
|
|
|
1583
|
-
export {
|
|
1591
|
+
export { createBaseVNode as createElementVNode, };
|
|
1584
1592
|
// Note: this file is auto concatenated to the end of the bundled d.ts during
|
|
1585
1593
|
// build.
|
|
1586
1594
|
type _defineProps = typeof defineProps
|
|
1587
1595
|
type _defineEmits = typeof defineEmits
|
|
1588
1596
|
type _defineExpose = typeof defineExpose
|
|
1597
|
+
type _defineOptions = typeof defineOptions
|
|
1589
1598
|
type _withDefaults = typeof withDefaults
|
|
1590
1599
|
|
|
1591
1600
|
declare global {
|
|
1592
1601
|
const defineProps: _defineProps
|
|
1593
1602
|
const defineEmits: _defineEmits
|
|
1594
1603
|
const defineExpose: _defineExpose
|
|
1604
|
+
const defineOptions: _defineOptions
|
|
1595
1605
|
const withDefaults: _withDefaults
|
|
1596
1606
|
}
|