@vue/runtime-core 3.3.0-alpha.1 → 3.3.0-alpha.11
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 +773 -663
- package/dist/runtime-core.cjs.prod.js +383 -292
- package/dist/runtime-core.d.ts +356 -248
- package/dist/runtime-core.esm-bundler.js +786 -677
- package/package.json +3 -3
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1,23 +1,30 @@
|
|
|
1
1
|
import { computed as computed$1, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, Ref, ReactiveFlags, ReactiveEffect, EffectScope, ComputedRef, DebuggerOptions, reactive } from '@vue/reactivity';
|
|
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 {
|
|
2
|
+
export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, 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, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
3
|
+
import { IfAny, Prettify, SlotFlags, UnionToIntersection, 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
|
-
export type Slot = (...args: any[]) => VNode[];
|
|
9
|
-
|
|
8
|
+
export type Slot<T extends any = any> = (...args: IfAny<T, any[], [T] | (T extends undefined ? [] : never)>) => VNode[];
|
|
9
|
+
type InternalSlots = {
|
|
10
10
|
[name: string]: Slot | undefined;
|
|
11
11
|
};
|
|
12
12
|
export type Slots = Readonly<InternalSlots>;
|
|
13
|
-
|
|
13
|
+
declare const SlotSymbol: unique symbol;
|
|
14
|
+
export type SlotsType<T extends Record<string, any> = Record<string, any>> = {
|
|
15
|
+
[SlotSymbol]?: T;
|
|
16
|
+
};
|
|
17
|
+
type TypedSlots<S extends SlotsType, T = NonNullable<S[typeof SlotSymbol]>> = [keyof S] extends [never] ? Slots : Readonly<Prettify<{
|
|
18
|
+
[K in keyof T]: NonNullable<T[K]> extends (...args: any[]) => any ? T[K] : Slot<T[K]>;
|
|
19
|
+
}>>;
|
|
20
|
+
type RawSlots = {
|
|
14
21
|
[name: string]: unknown;
|
|
15
22
|
$stable?: boolean;
|
|
16
23
|
/* removed internal: _ctx */
|
|
17
24
|
/* removed internal: _ */
|
|
18
25
|
};
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
interface SchedulerJob extends Function {
|
|
21
28
|
id?: number;
|
|
22
29
|
pre?: boolean;
|
|
23
30
|
active?: boolean;
|
|
@@ -45,18 +52,18 @@ export interface SchedulerJob extends Function {
|
|
|
45
52
|
*/
|
|
46
53
|
ownerInstance?: ComponentInternalInstance;
|
|
47
54
|
}
|
|
48
|
-
|
|
49
|
-
declare function nextTick<T = void>(this: T, fn?: (this: T) => void): Promise<void>;
|
|
50
|
-
declare function queuePostFlushCb(cb: SchedulerJobs): void;
|
|
55
|
+
type SchedulerJobs = SchedulerJob | SchedulerJob[];
|
|
56
|
+
export declare function nextTick<T = void>(this: T, fn?: (this: T) => void): Promise<void>;
|
|
57
|
+
export declare function queuePostFlushCb(cb: SchedulerJobs): void;
|
|
51
58
|
|
|
52
59
|
export type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
|
|
53
60
|
export type EmitsOptions = ObjectEmitsOptions | string[];
|
|
54
|
-
|
|
61
|
+
type EmitsToProps<T extends EmitsOptions> = T extends string[] ? {
|
|
55
62
|
[K in string & `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
|
|
56
63
|
} : T extends ObjectEmitsOptions ? {
|
|
57
64
|
[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
65
|
} : {};
|
|
59
|
-
|
|
66
|
+
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
67
|
[key in Event]: Options[key] extends (...args: infer Args) => any ? (event: key, ...args: Args) => void : (event: key, ...args: any[]) => void;
|
|
61
68
|
}[Event]>;
|
|
62
69
|
|
|
@@ -87,31 +94,31 @@ export type EmitFn<Options = ObjectEmitsOptions, Event extends keyof Options = k
|
|
|
87
94
|
*/
|
|
88
95
|
export interface ComponentCustomProperties {
|
|
89
96
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
type IsDefaultMixinComponent<T> = T extends ComponentOptionsMixin ? ComponentOptionsMixin extends T ? true : false : false;
|
|
98
|
+
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> ? OptionTypesType<P & {}, B & {}, D & {}, C & {}, M & {}, Defaults & {}> & IntersectionMixin<Mixin> & IntersectionMixin<Extends> : never;
|
|
99
|
+
type ExtractMixin<T> = {
|
|
93
100
|
Mixin: MixinToOptionTypes<T>;
|
|
94
101
|
}[T extends ComponentOptionsMixin ? 'Mixin' : never];
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
102
|
+
type IntersectionMixin<T> = IsDefaultMixinComponent<T> extends true ? OptionTypesType<{}, {}, {}, {}, {}> : UnionToIntersection<ExtractMixin<T>>;
|
|
103
|
+
type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
|
|
104
|
+
type EnsureNonVoid<T> = T extends void ? {} : T;
|
|
105
|
+
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
106
|
__isFragment?: never;
|
|
100
107
|
__isTeleport?: never;
|
|
101
108
|
__isSuspense?: never;
|
|
102
109
|
new (...args: any[]): T;
|
|
103
110
|
};
|
|
104
|
-
export type CreateComponentPublicInstance<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 = {}, 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>, I>;
|
|
111
|
+
export type CreateComponentPublicInstance<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 = {}, 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>, I, S>;
|
|
105
112
|
export type ComponentPublicInstance<P = {}, // props type extracted from props option
|
|
106
113
|
B = {}, // raw bindings returned from setup()
|
|
107
114
|
D = {}, // return from data()
|
|
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 = {}> = {
|
|
115
|
+
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 = {}, S extends SlotsType = {}> = {
|
|
109
116
|
$: ComponentInternalInstance;
|
|
110
117
|
$data: D;
|
|
111
|
-
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps
|
|
118
|
+
$props: Prettify<MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<P & PublicProps, keyof Defaults> : P & PublicProps>;
|
|
112
119
|
$attrs: Data;
|
|
113
120
|
$refs: Data;
|
|
114
|
-
$slots:
|
|
121
|
+
$slots: TypedSlots<S>;
|
|
115
122
|
$root: ComponentPublicInstance | null;
|
|
116
123
|
$parent: ComponentPublicInstance | null;
|
|
117
124
|
$emit: EmitFn<E>;
|
|
@@ -153,7 +160,7 @@ declare const SuspenseImpl: {
|
|
|
153
160
|
create: typeof createSuspenseBoundary;
|
|
154
161
|
normalize: typeof normalizeSuspenseChildren;
|
|
155
162
|
};
|
|
156
|
-
declare const Suspense: {
|
|
163
|
+
export declare const Suspense: {
|
|
157
164
|
new (): {
|
|
158
165
|
$props: VNodeProps & SuspenseProps;
|
|
159
166
|
};
|
|
@@ -222,7 +229,7 @@ export interface RendererNode {
|
|
|
222
229
|
}
|
|
223
230
|
export interface RendererElement extends RendererNode {
|
|
224
231
|
}
|
|
225
|
-
|
|
232
|
+
interface RendererInternals<HostNode = RendererNode, HostElement = RendererElement> {
|
|
226
233
|
p: PatchFn;
|
|
227
234
|
um: UnmountFn;
|
|
228
235
|
r: RemoveFn;
|
|
@@ -234,18 +241,18 @@ export interface RendererInternals<HostNode = RendererNode, HostElement = Render
|
|
|
234
241
|
n: NextFn;
|
|
235
242
|
o: RendererOptions<HostNode, HostElement>;
|
|
236
243
|
}
|
|
237
|
-
|
|
244
|
+
type PatchFn = (n1: VNode | null, // null means this is a mount
|
|
238
245
|
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
|
-
|
|
246
|
+
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;
|
|
247
|
+
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;
|
|
248
|
+
type PatchBlockChildrenFn = (oldChildren: VNode[], newChildren: VNode[], fallbackContainer: RendererElement, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null) => void;
|
|
249
|
+
type MoveFn = (vnode: VNode, container: RendererElement, anchor: RendererNode | null, type: MoveType, parentSuspense?: SuspenseBoundary | null) => void;
|
|
250
|
+
type NextFn = (vnode: VNode) => RendererNode | null;
|
|
251
|
+
type UnmountFn = (vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean) => void;
|
|
252
|
+
type RemoveFn = (vnode: VNode) => void;
|
|
253
|
+
type UnmountChildrenFn = (children: VNode[], parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, doRemove?: boolean, optimized?: boolean, start?: number) => void;
|
|
254
|
+
type MountComponentFn = (initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
|
|
255
|
+
type SetupRenderEffectFn = (instance: ComponentInternalInstance, initialVNode: VNode, container: RendererElement, anchor: RendererNode | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, optimized: boolean) => void;
|
|
249
256
|
declare const enum MoveType {
|
|
250
257
|
ENTER = 0,
|
|
251
258
|
LEAVE = 1,
|
|
@@ -266,63 +273,65 @@ declare const enum MoveType {
|
|
|
266
273
|
* })
|
|
267
274
|
* ```
|
|
268
275
|
*/
|
|
269
|
-
declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>;
|
|
270
|
-
declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer;
|
|
276
|
+
export declare function createRenderer<HostNode = RendererNode, HostElement = RendererElement>(options: RendererOptions<HostNode, HostElement>): Renderer<HostElement>;
|
|
277
|
+
export declare function createHydrationRenderer(options: RendererOptions<Node, Element>): HydrationRenderer;
|
|
271
278
|
|
|
272
|
-
|
|
279
|
+
type MatchPattern = string | RegExp | (string | RegExp)[];
|
|
273
280
|
export interface KeepAliveProps {
|
|
274
281
|
include?: MatchPattern;
|
|
275
282
|
exclude?: MatchPattern;
|
|
276
283
|
max?: number | string;
|
|
277
284
|
}
|
|
278
|
-
declare const KeepAlive: {
|
|
285
|
+
export declare const KeepAlive: {
|
|
279
286
|
new (): {
|
|
280
287
|
$props: VNodeProps & KeepAliveProps;
|
|
281
288
|
};
|
|
282
289
|
__isKeepAlive: true;
|
|
283
290
|
};
|
|
284
|
-
declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
285
|
-
declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
291
|
+
export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
292
|
+
export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
286
293
|
|
|
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;
|
|
294
|
+
export declare const onBeforeMount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
295
|
+
export declare const onMounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
296
|
+
export declare const onBeforeUpdate: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
297
|
+
export declare const onUpdated: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
298
|
+
export declare const onBeforeUnmount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
299
|
+
export declare const onUnmounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
300
|
+
export declare const onServerPrefetch: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
301
|
+
type DebuggerHook = (e: DebuggerEvent) => void;
|
|
302
|
+
export declare const onRenderTriggered: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
303
|
+
export declare const onRenderTracked: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
|
|
304
|
+
type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
305
|
+
export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;
|
|
299
306
|
|
|
300
307
|
export type ComponentPropsOptions<P = Data> = ComponentObjectPropsOptions<P> | string[];
|
|
301
308
|
export type ComponentObjectPropsOptions<P = Data> = {
|
|
302
309
|
[K in keyof P]: Prop<P[K]> | null;
|
|
303
310
|
};
|
|
304
311
|
export type Prop<T, D = T> = PropOptions<T, D> | PropType<T>;
|
|
305
|
-
|
|
306
|
-
|
|
312
|
+
type DefaultFactory<T> = (props: Data) => T | null | undefined;
|
|
313
|
+
interface PropOptions<T = any, D = T> {
|
|
307
314
|
type?: PropType<T> | true | null;
|
|
308
315
|
required?: boolean;
|
|
309
316
|
default?: D | DefaultFactory<D> | null | undefined | object;
|
|
310
317
|
validator?(value: unknown): boolean;
|
|
318
|
+
/* removed internal: skipCheck */
|
|
319
|
+
/* removed internal: skipFactory */
|
|
311
320
|
}
|
|
312
321
|
export type PropType<T> = PropConstructor<T> | PropConstructor<T>[];
|
|
313
|
-
|
|
322
|
+
type PropConstructor<T = any> = {
|
|
314
323
|
new (...args: any[]): T & {};
|
|
315
324
|
} | {
|
|
316
325
|
(): T;
|
|
317
326
|
} | PropMethod<T>;
|
|
318
|
-
|
|
327
|
+
type PropMethod<T, TConstructor = any> = [T] extends [
|
|
319
328
|
((...args: any) => any) | undefined
|
|
320
329
|
] ? {
|
|
321
330
|
new (): TConstructor;
|
|
322
331
|
(): T;
|
|
323
332
|
readonly prototype: TConstructor;
|
|
324
333
|
} : never;
|
|
325
|
-
|
|
334
|
+
type RequiredKeys<T> = {
|
|
326
335
|
[K in keyof T]: T[K] extends {
|
|
327
336
|
required: true;
|
|
328
337
|
} | {
|
|
@@ -333,8 +342,8 @@ export type RequiredKeys<T> = {
|
|
|
333
342
|
default: undefined | (() => undefined);
|
|
334
343
|
} ? never : K : never;
|
|
335
344
|
}[keyof T];
|
|
336
|
-
|
|
337
|
-
|
|
345
|
+
type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;
|
|
346
|
+
type DefaultKeys<T> = {
|
|
338
347
|
[K in keyof T]: T[K] extends {
|
|
339
348
|
default: any;
|
|
340
349
|
} | BooleanConstructor | {
|
|
@@ -344,7 +353,7 @@ export type DefaultKeys<T> = {
|
|
|
344
353
|
required: true;
|
|
345
354
|
} ? never : K : never;
|
|
346
355
|
}[keyof T];
|
|
347
|
-
|
|
356
|
+
type InferPropType<T> = [T] extends [null] ? any : [T] extends [{
|
|
348
357
|
type: null | true;
|
|
349
358
|
}] ? any : [T] extends [ObjectConstructor | {
|
|
350
359
|
type: ObjectConstructor;
|
|
@@ -367,12 +376,12 @@ declare const enum BooleanFlags {
|
|
|
367
376
|
export type ExtractDefaultPropTypes<O> = O extends object ? {
|
|
368
377
|
[K in keyof Pick<O, DefaultKeys<O>>]: InferPropType<O[K]>;
|
|
369
378
|
} : {};
|
|
370
|
-
|
|
379
|
+
type NormalizedProp = null | (PropOptions & {
|
|
371
380
|
[BooleanFlags.shouldCast]?: boolean;
|
|
372
381
|
[BooleanFlags.shouldCastTrue]?: boolean;
|
|
373
382
|
});
|
|
374
|
-
|
|
375
|
-
|
|
383
|
+
type NormalizedProps = Record<string, NormalizedProp>;
|
|
384
|
+
type NormalizedPropsOptions = [NormalizedProps, string[]] | [];
|
|
376
385
|
|
|
377
386
|
/**
|
|
378
387
|
Runtime helper for applying directives to a vnode. Example usage:
|
|
@@ -396,7 +405,7 @@ export interface DirectiveBinding<V = any> {
|
|
|
396
405
|
dir: ObjectDirective<any, V>;
|
|
397
406
|
}
|
|
398
407
|
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
|
-
|
|
408
|
+
type SSRDirectiveHook = (binding: DirectiveBinding, vnode: VNode) => Data | undefined;
|
|
400
409
|
export interface ObjectDirective<T = any, V = any> {
|
|
401
410
|
created?: DirectiveHook<T, null, V>;
|
|
402
411
|
beforeMount?: DirectiveHook<T, null, V>;
|
|
@@ -410,14 +419,14 @@ export interface ObjectDirective<T = any, V = any> {
|
|
|
410
419
|
}
|
|
411
420
|
export type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
|
|
412
421
|
export type Directive<T = any, V = any> = ObjectDirective<T, V> | FunctionDirective<T, V>;
|
|
413
|
-
|
|
422
|
+
type DirectiveModifiers = Record<string, boolean>;
|
|
414
423
|
export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string, DirectiveModifiers]>;
|
|
415
424
|
/**
|
|
416
425
|
* Adds directives to a VNode.
|
|
417
426
|
*/
|
|
418
|
-
declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
|
|
427
|
+
export declare function withDirectives<T extends VNode>(vnode: T, directives: DirectiveArguments): T;
|
|
419
428
|
|
|
420
|
-
declare const enum DeprecationTypes {
|
|
429
|
+
export declare const enum DeprecationTypes {
|
|
421
430
|
GLOBAL_MOUNT = "GLOBAL_MOUNT",
|
|
422
431
|
GLOBAL_MOUNT_CONTAINER = "GLOBAL_MOUNT_CONTAINER",
|
|
423
432
|
GLOBAL_EXTEND = "GLOBAL_EXTEND",
|
|
@@ -462,7 +471,7 @@ declare const enum DeprecationTypes {
|
|
|
462
471
|
PRIVATE_APIS = "PRIVATE_APIS"
|
|
463
472
|
}
|
|
464
473
|
declare function warnDeprecation(key: DeprecationTypes, instance: ComponentInternalInstance | null, ...args: any[]): void;
|
|
465
|
-
|
|
474
|
+
type CompatConfig = Partial<Record<DeprecationTypes, boolean | 'suppress-warning'>> & {
|
|
466
475
|
MODE?: 2 | 3 | ((comp: Component | null) => 2 | 3);
|
|
467
476
|
};
|
|
468
477
|
declare function configureCompat(config: CompatConfig): void;
|
|
@@ -498,16 +507,8 @@ declare function checkCompatEnabled(key: DeprecationTypes, instance: ComponentIn
|
|
|
498
507
|
export interface ComponentCustomOptions {
|
|
499
508
|
}
|
|
500
509
|
export type RenderFunction = () => VNodeChild;
|
|
501
|
-
export
|
|
502
|
-
|
|
503
|
-
any, // D
|
|
504
|
-
any, // C
|
|
505
|
-
any, // M
|
|
506
|
-
any, // Mixin
|
|
507
|
-
any, // Extends
|
|
508
|
-
any> ? unknown extends P ? {} : P : {};
|
|
509
|
-
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: Readonly<LooseRequired<Props & UnionToIntersection<ExtractOptionProp<Mixin>> & UnionToIntersection<ExtractOptionProp<Extends>>>>, ctx: SetupContext<E>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
|
510
|
+
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, S extends SlotsType = {}> extends LegacyOptions<Props, D, C, M, Mixin, Extends, I, II>, ComponentInternalOptions, ComponentCustomOptions {
|
|
511
|
+
setup?: (this: void, props: LooseRequired<Props & Prettify<UnwrapMixinsType<IntersectionMixin<Mixin> & IntersectionMixin<Extends>, 'P'>>>, ctx: SetupContext<E, S>) => Promise<RawBindings> | RawBindings | RenderFunction | void;
|
|
511
512
|
name?: string;
|
|
512
513
|
template?: string | object;
|
|
513
514
|
render?: Function;
|
|
@@ -515,6 +516,7 @@ export interface ComponentOptionsBase<Props, RawBindings, D, C extends ComputedO
|
|
|
515
516
|
directives?: Record<string, Directive>;
|
|
516
517
|
inheritAttrs?: boolean;
|
|
517
518
|
emits?: (E | EE[]) & ThisType<void>;
|
|
519
|
+
slots?: S;
|
|
518
520
|
expose?: string[];
|
|
519
521
|
serverPrefetch?(): void | Promise<any>;
|
|
520
522
|
compilerOptions?: RuntimeCompilerOptions;
|
|
@@ -537,47 +539,47 @@ export interface RuntimeCompilerOptions {
|
|
|
537
539
|
comments?: boolean;
|
|
538
540
|
delimiters?: [string, string];
|
|
539
541
|
}
|
|
540
|
-
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> & {
|
|
542
|
+
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, S extends SlotsType = {}, PE = Props & EmitsToProps<E>> = ComponentOptionsBase<PE, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S> & {
|
|
541
543
|
props?: undefined;
|
|
542
|
-
} & 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<{
|
|
544
|
+
} & ThisType<CreateComponentPublicInstance<PE, RawBindings, D, C, M, Mixin, Extends, E, PE, {}, false, I, S>>;
|
|
545
|
+
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, S extends SlotsType = {}, Props = Prettify<Readonly<{
|
|
544
546
|
[key in PropNames]?: any;
|
|
545
|
-
}
|
|
547
|
+
} & EmitsToProps<E>>>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, {}, I, II, S> & {
|
|
546
548
|
props: PropNames[];
|
|
547
|
-
} & 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
|
|
549
|
+
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, {}, false, I, S>>;
|
|
550
|
+
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, S extends SlotsType = {}, Props = Prettify<Readonly<ExtractPropTypes<PropsOptions> & EmitsToProps<E>>>, Defaults = ExtractDefaultPropTypes<PropsOptions>> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, I, II, S> & {
|
|
549
551
|
props: PropsOptions & ThisType<void>;
|
|
550
|
-
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I>>;
|
|
551
|
-
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>>>;
|
|
552
|
-
export type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any>;
|
|
552
|
+
} & ThisType<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S>>;
|
|
553
|
+
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, S extends SlotsType = any> = ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, string, S> & ThisType<CreateComponentPublicInstance<{}, RawBindings, D, C, M, Mixin, Extends, E, Readonly<Props>>>;
|
|
554
|
+
export type ComponentOptionsMixin = ComponentOptionsBase<any, any, any, any, any, any, any, any, any, any, any>;
|
|
553
555
|
export type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
554
556
|
export interface MethodOptions {
|
|
555
557
|
[key: string]: Function;
|
|
556
558
|
}
|
|
557
|
-
|
|
559
|
+
type ExtractComputedReturns<T extends any> = {
|
|
558
560
|
[key in keyof T]: T[key] extends {
|
|
559
561
|
get: (...args: any[]) => infer TReturn;
|
|
560
562
|
} ? TReturn : T[key] extends (...args: any[]) => infer TReturn ? TReturn : never;
|
|
561
563
|
};
|
|
562
|
-
|
|
564
|
+
type ObjectWatchOptionItem = {
|
|
563
565
|
handler: WatchCallback | string;
|
|
564
566
|
} & WatchOptions;
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
567
|
+
type WatchOptionItem = string | WatchCallback | ObjectWatchOptionItem;
|
|
568
|
+
type ComponentWatchOptionItem = WatchOptionItem | WatchOptionItem[];
|
|
569
|
+
type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
|
|
568
570
|
export type ComponentProvideOptions = ObjectProvideOptions | Function;
|
|
569
|
-
|
|
571
|
+
type ObjectProvideOptions = Record<string | symbol, unknown>;
|
|
570
572
|
export type ComponentInjectOptions = string[] | ObjectInjectOptions;
|
|
571
|
-
|
|
573
|
+
type ObjectInjectOptions = Record<string | symbol, string | symbol | {
|
|
572
574
|
from?: string | symbol;
|
|
573
575
|
default?: unknown;
|
|
574
576
|
}>;
|
|
575
|
-
|
|
577
|
+
type InjectToObject<T extends ComponentInjectOptions> = T extends string[] ? {
|
|
576
578
|
[K in T[number]]?: unknown;
|
|
577
579
|
} : T extends ObjectInjectOptions ? {
|
|
578
580
|
[K in keyof T]?: unknown;
|
|
579
581
|
} : never;
|
|
580
|
-
|
|
582
|
+
interface LegacyOptions<Props, D, C extends ComputedOptions, M extends MethodOptions, Mixin extends ComponentOptionsMixin, Extends extends ComponentOptionsMixin, I extends ComponentInjectOptions, II extends string> {
|
|
581
583
|
compatConfig?: CompatConfig;
|
|
582
584
|
[key: string]: any;
|
|
583
585
|
data?: (this: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>, vm: CreateComponentPublicInstance<Props, {}, {}, {}, MethodOptions, Mixin, Extends>) => D;
|
|
@@ -621,9 +623,9 @@ export interface LegacyOptions<Props, D, C extends ComputedOptions, M extends Me
|
|
|
621
623
|
*/
|
|
622
624
|
__differentiator?: keyof D | keyof C | keyof M;
|
|
623
625
|
}
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
626
|
+
type MergedHook<T = () => void> = T | T[];
|
|
627
|
+
type MergedComponentOptions = ComponentOptions & MergedComponentOptionsOverride;
|
|
628
|
+
type MergedComponentOptionsOverride = {
|
|
627
629
|
beforeCreate?: MergedHook;
|
|
628
630
|
created?: MergedHook;
|
|
629
631
|
beforeMount?: MergedHook;
|
|
@@ -642,8 +644,8 @@ export type MergedComponentOptionsOverride = {
|
|
|
642
644
|
renderTriggered?: MergedHook<DebuggerHook>;
|
|
643
645
|
errorCaptured?: MergedHook<ErrorCapturedHook>;
|
|
644
646
|
};
|
|
645
|
-
|
|
646
|
-
|
|
647
|
+
type OptionTypesKeys = 'P' | 'B' | 'D' | 'C' | 'M' | 'Defaults';
|
|
648
|
+
type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Defaults = {}> = {
|
|
647
649
|
P: P;
|
|
648
650
|
B: B;
|
|
649
651
|
D: D;
|
|
@@ -654,10 +656,10 @@ export type OptionTypesType<P = {}, B = {}, D = {}, C extends ComputedOptions =
|
|
|
654
656
|
|
|
655
657
|
export interface InjectionKey<T> extends Symbol {
|
|
656
658
|
}
|
|
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;
|
|
659
|
+
export declare function provide<T>(key: InjectionKey<T> | string | number, value: T): void;
|
|
660
|
+
export declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
|
661
|
+
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
|
662
|
+
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T | (() => T), treatDefaultAsFactory: true): T;
|
|
661
663
|
|
|
662
664
|
export interface App<HostElement = any> {
|
|
663
665
|
version: string;
|
|
@@ -672,6 +674,13 @@ export interface App<HostElement = any> {
|
|
|
672
674
|
mount(rootContainer: HostElement | string, isHydrate?: boolean, isSVG?: boolean): ComponentPublicInstance;
|
|
673
675
|
unmount(): void;
|
|
674
676
|
provide<T>(key: InjectionKey<T> | string, value: T): this;
|
|
677
|
+
/**
|
|
678
|
+
* Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
|
|
679
|
+
* to variables provided via `app.provide()`.
|
|
680
|
+
*
|
|
681
|
+
* @param fn - function to run with the app as active instance
|
|
682
|
+
*/
|
|
683
|
+
runWithContext<T>(fn: () => T): T;
|
|
675
684
|
_uid: number;
|
|
676
685
|
_component: ConcreteComponent;
|
|
677
686
|
_props: Data | null;
|
|
@@ -721,7 +730,7 @@ export interface AppContext {
|
|
|
721
730
|
/* removed internal: reload */
|
|
722
731
|
/* removed internal: filters */
|
|
723
732
|
}
|
|
724
|
-
|
|
733
|
+
type PluginInstallFunction<Options> = Options extends unknown[] ? (app: App, ...options: Options) => any : (app: App, options: Options) => any;
|
|
725
734
|
export type Plugin<Options = any[]> = (PluginInstallFunction<Options> & {
|
|
726
735
|
install?: PluginInstallFunction<Options>;
|
|
727
736
|
}) | {
|
|
@@ -729,7 +738,7 @@ export type Plugin<Options = any[]> = (PluginInstallFunction<Options> & {
|
|
|
729
738
|
};
|
|
730
739
|
export type CreateAppFunction<HostElement> = (rootComponent: Component, rootProps?: Data | null) => App<HostElement>;
|
|
731
740
|
|
|
732
|
-
|
|
741
|
+
type Hook<T = () => void> = T | T[];
|
|
733
742
|
export interface BaseTransitionProps<HostElement = RendererElement> {
|
|
734
743
|
mode?: 'in-out' | 'out-in' | 'default';
|
|
735
744
|
appear?: boolean;
|
|
@@ -764,8 +773,8 @@ export interface TransitionState {
|
|
|
764
773
|
isUnmounting: boolean;
|
|
765
774
|
leavingVNodes: Map<any, Record<string, VNode>>;
|
|
766
775
|
}
|
|
767
|
-
declare function useTransitionState(): TransitionState;
|
|
768
|
-
declare const BaseTransitionPropsValidators: {
|
|
776
|
+
export declare function useTransitionState(): TransitionState;
|
|
777
|
+
export declare const BaseTransitionPropsValidators: {
|
|
769
778
|
mode: StringConstructor;
|
|
770
779
|
appear: BooleanConstructor;
|
|
771
780
|
persisted: BooleanConstructor;
|
|
@@ -782,14 +791,14 @@ declare const BaseTransitionPropsValidators: {
|
|
|
782
791
|
onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
783
792
|
onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
784
793
|
};
|
|
785
|
-
declare const BaseTransition: new () => {
|
|
794
|
+
export declare const BaseTransition: new () => {
|
|
786
795
|
$props: BaseTransitionProps<any>;
|
|
787
796
|
};
|
|
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[];
|
|
797
|
+
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
|
|
798
|
+
export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
|
|
799
|
+
export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
|
|
791
800
|
|
|
792
|
-
|
|
801
|
+
type TeleportVNode = VNode<RendererNode, RendererElement, TeleportProps>;
|
|
793
802
|
export interface TeleportProps {
|
|
794
803
|
to: string | RendererElement | null | undefined;
|
|
795
804
|
disabled?: boolean;
|
|
@@ -808,7 +817,7 @@ declare const enum TeleportMoveTypes {
|
|
|
808
817
|
}
|
|
809
818
|
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
|
|
810
819
|
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: {
|
|
820
|
+
export declare const Teleport: {
|
|
812
821
|
new (): {
|
|
813
822
|
$props: VNodeProps & TeleportProps;
|
|
814
823
|
};
|
|
@@ -818,38 +827,38 @@ declare const Teleport: {
|
|
|
818
827
|
/**
|
|
819
828
|
* @private
|
|
820
829
|
*/
|
|
821
|
-
declare function resolveComponent(name: string, maybeSelfReference?: boolean): ConcreteComponent | string;
|
|
830
|
+
export declare function resolveComponent(name: string, maybeSelfReference?: boolean): ConcreteComponent | string;
|
|
822
831
|
declare const NULL_DYNAMIC_COMPONENT: unique symbol;
|
|
823
832
|
/**
|
|
824
833
|
* @private
|
|
825
834
|
*/
|
|
826
|
-
declare function resolveDynamicComponent(component: unknown): VNodeTypes;
|
|
835
|
+
export declare function resolveDynamicComponent(component: unknown): VNodeTypes;
|
|
827
836
|
/**
|
|
828
837
|
* @private
|
|
829
838
|
*/
|
|
830
|
-
declare function resolveDirective(name: string): Directive | undefined;
|
|
839
|
+
export declare function resolveDirective(name: string): Directive | undefined;
|
|
831
840
|
/* removed internal: resolveFilter$1 */
|
|
832
841
|
|
|
833
|
-
declare const Fragment: {
|
|
842
|
+
export declare const Fragment: {
|
|
834
843
|
new (): {
|
|
835
844
|
$props: VNodeProps;
|
|
836
845
|
};
|
|
837
846
|
__isFragment: true;
|
|
838
847
|
};
|
|
839
|
-
declare const Text: unique symbol;
|
|
840
|
-
declare const Comment: unique symbol;
|
|
841
|
-
declare const Static: unique symbol;
|
|
848
|
+
export declare const Text: unique symbol;
|
|
849
|
+
export declare const Comment: unique symbol;
|
|
850
|
+
export declare const Static: unique symbol;
|
|
842
851
|
export type VNodeTypes = string | VNode | Component | typeof Text | typeof Static | typeof Comment | typeof Fragment | typeof Teleport | typeof TeleportImpl | typeof Suspense | typeof SuspenseImpl;
|
|
843
852
|
export type VNodeRef = string | Ref | ((ref: Element | ComponentPublicInstance | null, refs: Record<string, any>) => void);
|
|
844
|
-
|
|
853
|
+
type VNodeNormalizedRefAtom = {
|
|
845
854
|
i: ComponentInternalInstance;
|
|
846
855
|
r: VNodeRef;
|
|
847
856
|
k?: string;
|
|
848
857
|
f?: boolean;
|
|
849
858
|
};
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
859
|
+
type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
|
|
860
|
+
type VNodeMountHook = (vnode: VNode) => void;
|
|
861
|
+
type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
|
|
853
862
|
export type VNodeProps = {
|
|
854
863
|
key?: string | number | symbol;
|
|
855
864
|
ref?: VNodeRef;
|
|
@@ -862,7 +871,7 @@ export type VNodeProps = {
|
|
|
862
871
|
onVnodeBeforeUnmount?: VNodeMountHook | VNodeMountHook[];
|
|
863
872
|
onVnodeUnmounted?: VNodeMountHook | VNodeMountHook[];
|
|
864
873
|
};
|
|
865
|
-
|
|
874
|
+
type VNodeChildAtom = VNode | string | number | boolean | null | undefined | void;
|
|
866
875
|
export type VNodeArrayChildren = Array<VNodeArrayChildren | VNodeChildAtom>;
|
|
867
876
|
export type VNodeChild = VNodeChildAtom | VNodeArrayChildren;
|
|
868
877
|
export type VNodeNormalizedChildren = string | VNodeArrayChildren | RawSlots | null;
|
|
@@ -919,7 +928,7 @@ export interface VNode<HostNode = RendererNode, HostElement = RendererElement, E
|
|
|
919
928
|
*
|
|
920
929
|
* @private
|
|
921
930
|
*/
|
|
922
|
-
declare function openBlock(disableTracking?: boolean): void;
|
|
931
|
+
export declare function openBlock(disableTracking?: boolean): void;
|
|
923
932
|
/**
|
|
924
933
|
* Block tracking sometimes needs to be disabled, for example during the
|
|
925
934
|
* creation of a tree that needs to be cached by v-once. The compiler generates
|
|
@@ -936,11 +945,11 @@ declare function openBlock(disableTracking?: boolean): void;
|
|
|
936
945
|
*
|
|
937
946
|
* @private
|
|
938
947
|
*/
|
|
939
|
-
declare function setBlockTracking(value: number): void;
|
|
948
|
+
export declare function setBlockTracking(value: number): void;
|
|
940
949
|
/**
|
|
941
950
|
* @private
|
|
942
951
|
*/
|
|
943
|
-
declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode<RendererNode, RendererElement, {
|
|
952
|
+
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
953
|
[key: string]: any;
|
|
945
954
|
}>;
|
|
946
955
|
/**
|
|
@@ -950,8 +959,8 @@ declare function createElementBlock(type: string | typeof Fragment, props?: Reco
|
|
|
950
959
|
*
|
|
951
960
|
* @private
|
|
952
961
|
*/
|
|
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;
|
|
962
|
+
export declare function createBlock(type: VNodeTypes | ClassComponent, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[]): VNode;
|
|
963
|
+
export declare function isVNode(value: any): value is VNode;
|
|
955
964
|
declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, instance: ComponentInternalInstance | null) => Parameters<typeof _createVNode>) | undefined;
|
|
956
965
|
/**
|
|
957
966
|
* Internal API for registering an arguments transform for createVNode
|
|
@@ -959,31 +968,31 @@ declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, insta
|
|
|
959
968
|
* It is *internal* but needs to be exposed for test-utils to pick up proper
|
|
960
969
|
* typings
|
|
961
970
|
*/
|
|
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
|
|
971
|
+
export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;
|
|
972
|
+
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
973
|
[key: string]: any;
|
|
965
974
|
}>;
|
|
966
975
|
|
|
967
|
-
declare const createVNode: typeof _createVNode;
|
|
976
|
+
export declare const createVNode: typeof _createVNode;
|
|
968
977
|
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>;
|
|
978
|
+
export declare function guardReactiveProps(props: (Data & VNodeProps) | null): (Data & VNodeProps) | null;
|
|
979
|
+
export declare function cloneVNode<T, U>(vnode: VNode<T, U>, extraProps?: (Data & VNodeProps) | null, mergeRef?: boolean): VNode<T, U>;
|
|
971
980
|
/**
|
|
972
981
|
* @private
|
|
973
982
|
*/
|
|
974
|
-
declare function createTextVNode(text?: string, flag?: number): VNode;
|
|
983
|
+
export declare function createTextVNode(text?: string, flag?: number): VNode;
|
|
975
984
|
/**
|
|
976
985
|
* @private
|
|
977
986
|
*/
|
|
978
|
-
declare function createStaticVNode(content: string, numberOfNodes: number): VNode;
|
|
987
|
+
export declare function createStaticVNode(content: string, numberOfNodes: number): VNode;
|
|
979
988
|
/**
|
|
980
989
|
* @private
|
|
981
990
|
*/
|
|
982
|
-
declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;
|
|
991
|
+
export declare function createCommentVNode(text?: string, asBlock?: boolean): VNode;
|
|
983
992
|
declare function normalizeVNode(child: VNodeChild): VNode;
|
|
984
|
-
declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
|
|
993
|
+
export declare function mergeProps(...args: (Data & VNodeProps)[]): Data;
|
|
985
994
|
|
|
986
|
-
|
|
995
|
+
type Data = Record<string, unknown>;
|
|
987
996
|
/**
|
|
988
997
|
* For extending allowed non-declared props on components in TSX
|
|
989
998
|
*/
|
|
@@ -996,7 +1005,7 @@ export interface AllowedComponentProps {
|
|
|
996
1005
|
class?: unknown;
|
|
997
1006
|
style?: unknown;
|
|
998
1007
|
}
|
|
999
|
-
|
|
1008
|
+
interface ComponentInternalOptions {
|
|
1000
1009
|
/* removed internal: __scopeId */
|
|
1001
1010
|
/* removed internal: __cssModules */
|
|
1002
1011
|
/* removed internal: __hmrId */
|
|
@@ -1013,15 +1022,16 @@ export interface ComponentInternalOptions {
|
|
|
1013
1022
|
*/
|
|
1014
1023
|
__name?: string;
|
|
1015
1024
|
}
|
|
1016
|
-
export interface FunctionalComponent<P = {}, E extends EmitsOptions = {}> extends ComponentInternalOptions {
|
|
1017
|
-
(props: P, ctx: Omit<SetupContext<E
|
|
1025
|
+
export interface FunctionalComponent<P = {}, E extends EmitsOptions = {}, S extends Record<string, any> = any> extends ComponentInternalOptions {
|
|
1026
|
+
(props: P, ctx: Omit<SetupContext<E, IfAny<S, {}, SlotsType<S>>>, 'expose'>): any;
|
|
1018
1027
|
props?: ComponentPropsOptions<P>;
|
|
1019
1028
|
emits?: E | (keyof E)[];
|
|
1029
|
+
slots?: IfAny<S, Slots, SlotsType<S>>;
|
|
1020
1030
|
inheritAttrs?: boolean;
|
|
1021
1031
|
displayName?: string;
|
|
1022
1032
|
compatConfig?: CompatConfig;
|
|
1023
1033
|
}
|
|
1024
|
-
|
|
1034
|
+
interface ClassComponent {
|
|
1025
1035
|
new (...args: any[]): ComponentPublicInstance<any, any, any, any, any>;
|
|
1026
1036
|
__vccOpts: ComponentOptions;
|
|
1027
1037
|
}
|
|
@@ -1031,17 +1041,17 @@ export interface ClassComponent {
|
|
|
1031
1041
|
* values, e.g. checking if its a function or not. This is mostly for internal
|
|
1032
1042
|
* implementation code.
|
|
1033
1043
|
*/
|
|
1034
|
-
export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, any>;
|
|
1044
|
+
export type ConcreteComponent<Props = {}, RawBindings = any, D = any, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions> = ComponentOptions<Props, RawBindings, D, C, M> | FunctionalComponent<Props, any, any>;
|
|
1035
1045
|
/**
|
|
1036
1046
|
* A type used in public APIs where a component type is expected.
|
|
1037
1047
|
* The constructor type is an artificial type returned by defineComponent().
|
|
1038
1048
|
*/
|
|
1039
1049
|
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
1050
|
|
|
1041
|
-
|
|
1042
|
-
export type SetupContext<E = EmitsOptions> = E extends any ? {
|
|
1051
|
+
type LifecycleHook<TFn = Function> = TFn[] | null;
|
|
1052
|
+
export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends any ? {
|
|
1043
1053
|
attrs: Data;
|
|
1044
|
-
slots:
|
|
1054
|
+
slots: TypedSlots<S>;
|
|
1045
1055
|
emit: EmitFn<E>;
|
|
1046
1056
|
expose: (exposed?: Record<string, any>) => void;
|
|
1047
1057
|
} : never;
|
|
@@ -1129,22 +1139,22 @@ export interface ComponentInternalInstance {
|
|
|
1129
1139
|
/* removed internal: ut */
|
|
1130
1140
|
}
|
|
1131
1141
|
declare function createComponentInstance(vnode: VNode, parent: ComponentInternalInstance | null, suspense: SuspenseBoundary | null): ComponentInternalInstance;
|
|
1132
|
-
declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
1142
|
+
export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
1133
1143
|
declare function setupComponent(instance: ComponentInternalInstance, isSSR?: boolean): Promise<void> | undefined;
|
|
1134
1144
|
/**
|
|
1135
1145
|
* For runtime-dom to register the compiler.
|
|
1136
1146
|
* Note the exported method uses any to avoid d.ts relying on the compiler types.
|
|
1137
1147
|
*/
|
|
1138
|
-
declare function registerRuntimeCompiler(_compile: any): void;
|
|
1139
|
-
declare const isRuntimeOnly: () => boolean;
|
|
1148
|
+
export declare function registerRuntimeCompiler(_compile: any): void;
|
|
1149
|
+
export declare const isRuntimeOnly: () => boolean;
|
|
1140
1150
|
|
|
1141
1151
|
export type WatchEffect = (onCleanup: OnCleanup) => void;
|
|
1142
1152
|
export type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
|
1143
1153
|
export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
|
|
1144
|
-
|
|
1154
|
+
type MapSources<T, Immediate> = {
|
|
1145
1155
|
[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
1156
|
};
|
|
1147
|
-
|
|
1157
|
+
type OnCleanup = (cleanupFn: () => void) => void;
|
|
1148
1158
|
export interface WatchOptionsBase extends DebuggerOptions {
|
|
1149
1159
|
flush?: 'pre' | 'post' | 'sync';
|
|
1150
1160
|
}
|
|
@@ -1153,25 +1163,35 @@ export interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
|
|
|
1153
1163
|
deep?: boolean;
|
|
1154
1164
|
}
|
|
1155
1165
|
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;
|
|
1166
|
+
export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchStopHandle;
|
|
1167
|
+
export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
1168
|
+
export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
1169
|
+
type MultiWatchSources = (WatchSource<unknown> | object)[];
|
|
1170
|
+
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;
|
|
1171
|
+
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;
|
|
1172
|
+
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;
|
|
1173
|
+
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
1174
|
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
declare function defineComponent<Props
|
|
1169
|
-
|
|
1175
|
+
type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1176
|
+
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
1177
|
+
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 = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true, {}, S> & Props> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S> & PP;
|
|
1178
|
+
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
1179
|
+
props?: (keyof Props)[];
|
|
1180
|
+
emits?: E | EE[];
|
|
1181
|
+
slots?: S;
|
|
1182
|
+
}): (props: Props & EmitsToProps<E>) => any;
|
|
1183
|
+
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
1184
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
1185
|
+
emits?: E | EE[];
|
|
1186
|
+
slots?: S;
|
|
1187
|
+
}): (props: Props & EmitsToProps<E>) => any;
|
|
1188
|
+
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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
|
|
1189
|
+
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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<{
|
|
1170
1190
|
[key in PropNames]?: any;
|
|
1171
|
-
}
|
|
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>;
|
|
1191
|
+
}>>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
|
|
1192
|
+
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, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<PropsOptions, E>, ExtractDefaultPropTypes<PropsOptions>, S>;
|
|
1173
1193
|
|
|
1174
|
-
|
|
1194
|
+
type AsyncComponentResolveResult<T = Component> = T | {
|
|
1175
1195
|
default: T;
|
|
1176
1196
|
};
|
|
1177
1197
|
export type AsyncComponentLoader<T = any> = () => Promise<AsyncComponentResolveResult<T>>;
|
|
@@ -1184,7 +1204,7 @@ export interface AsyncComponentOptions<T = any> {
|
|
|
1184
1204
|
suspensible?: boolean;
|
|
1185
1205
|
onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
|
|
1186
1206
|
}
|
|
1187
|
-
declare function defineAsyncComponent<T extends Component = {
|
|
1207
|
+
export declare function defineAsyncComponent<T extends Component = {
|
|
1188
1208
|
new (): ComponentPublicInstance;
|
|
1189
1209
|
}>(source: AsyncComponentLoader<T> | AsyncComponentOptions<T>): T;
|
|
1190
1210
|
|
|
@@ -1213,18 +1233,22 @@ declare function defineAsyncComponent<T extends Component = {
|
|
|
1213
1233
|
* foo?: string
|
|
1214
1234
|
* bar: number
|
|
1215
1235
|
* }>()
|
|
1236
|
+
*
|
|
1237
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
|
1216
1238
|
* ```
|
|
1217
1239
|
*
|
|
1218
1240
|
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1219
1241
|
* output and should **not** be actually called at runtime.
|
|
1220
1242
|
*/
|
|
1221
|
-
declare function defineProps<PropNames extends string = string>(props: PropNames[]): Readonly<{
|
|
1243
|
+
export declare function defineProps<PropNames extends string = string>(props: PropNames[]): Prettify<Readonly<{
|
|
1222
1244
|
[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
|
-
|
|
1245
|
+
}>>;
|
|
1246
|
+
export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
|
|
1247
|
+
export declare function defineProps<TypeProps>(): DefineProps<TypeProps>;
|
|
1248
|
+
type DefineProps<T> = Readonly<T> & {
|
|
1249
|
+
readonly [K in BooleanKey<T>]-?: boolean;
|
|
1250
|
+
};
|
|
1251
|
+
type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends [boolean | undefined] ? K : never : never;
|
|
1228
1252
|
/**
|
|
1229
1253
|
* Vue `<script setup>` compiler macro for declaring a component's emitted
|
|
1230
1254
|
* events. The expected argument is the same as the component `emits` option.
|
|
@@ -1247,10 +1271,16 @@ declare function defineProps<TypeProps>(): Readonly<Omit<TypeProps, BooleanKey<T
|
|
|
1247
1271
|
*
|
|
1248
1272
|
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1249
1273
|
* output and should **not** be actually called at runtime.
|
|
1274
|
+
*
|
|
1275
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineprops-defineemits}
|
|
1250
1276
|
*/
|
|
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<
|
|
1277
|
+
export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
|
1278
|
+
export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
|
1279
|
+
export declare function defineEmits<T extends ((...args: any[]) => any) | Record<string, any[]>>(): T extends (...args: any[]) => any ? T : ShortEmits<T>;
|
|
1280
|
+
type RecordToUnion<T extends Record<string, any>> = T[keyof T];
|
|
1281
|
+
type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{
|
|
1282
|
+
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
1283
|
+
}>>;
|
|
1254
1284
|
/**
|
|
1255
1285
|
* Vue `<script setup>` compiler macro for declaring a component's exposed
|
|
1256
1286
|
* instance properties when it is accessed by a parent component via template
|
|
@@ -1262,15 +1292,81 @@ declare function defineEmits<TypeEmit>(): TypeEmit;
|
|
|
1262
1292
|
*
|
|
1263
1293
|
* This is only usable inside `<script setup>`, is compiled away in the
|
|
1264
1294
|
* output and should **not** be actually called at runtime.
|
|
1295
|
+
*
|
|
1296
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineexpose}
|
|
1265
1297
|
*/
|
|
1266
|
-
declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1298
|
+
export declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
|
1299
|
+
/**
|
|
1300
|
+
* Vue `<script setup>` compiler macro for declaring a component's additional
|
|
1301
|
+
* options. This should be used only for options that cannot be expressed via
|
|
1302
|
+
* Composition API - e.g. `inhertiAttrs`.
|
|
1303
|
+
*
|
|
1304
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
|
|
1305
|
+
*/
|
|
1306
|
+
export declare function defineOptions<RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin>(options?: ComponentOptionsWithoutProps<{}, RawBindings, D, C, M, Mixin, Extends> & {
|
|
1307
|
+
emits?: undefined;
|
|
1308
|
+
expose?: undefined;
|
|
1309
|
+
slots?: undefined;
|
|
1310
|
+
}): void;
|
|
1311
|
+
export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): TypedSlots<SlotsType<S>>;
|
|
1312
|
+
/**
|
|
1313
|
+
* (**Experimental**) Vue `<script setup>` compiler macro for declaring a
|
|
1314
|
+
* two-way binding prop that can be consumed via `v-model` from the parent
|
|
1315
|
+
* component. This will declare a prop with the same name and a corresponding
|
|
1316
|
+
* `update:propName` event.
|
|
1317
|
+
*
|
|
1318
|
+
* If the first argument is a string, it will be used as the prop name;
|
|
1319
|
+
* Otherwise the prop name will default to "modelValue". In both cases, you
|
|
1320
|
+
* can also pass an additional object which will be used as the prop's options.
|
|
1321
|
+
*
|
|
1322
|
+
* The options object can also specify an additional option, `local`. When set
|
|
1323
|
+
* to `true`, the ref can be locally mutated even if the parent did not pass
|
|
1324
|
+
* the matching `v-model`.
|
|
1325
|
+
*
|
|
1326
|
+
* @example
|
|
1327
|
+
* ```ts
|
|
1328
|
+
* // default model (consumed via `v-model`)
|
|
1329
|
+
* const modelValue = defineModel<string>()
|
|
1330
|
+
* modelValue.value = "hello"
|
|
1331
|
+
*
|
|
1332
|
+
* // default model with options
|
|
1333
|
+
* const modelValue = defineModel<stirng>({ required: true })
|
|
1334
|
+
*
|
|
1335
|
+
* // with specified name (consumed via `v-model:count`)
|
|
1336
|
+
* const count = defineModel<number>('count')
|
|
1337
|
+
* count.value++
|
|
1338
|
+
*
|
|
1339
|
+
* // with specified name and default value
|
|
1340
|
+
* const count = defineModel<number>('count', { default: 0 })
|
|
1341
|
+
*
|
|
1342
|
+
* // local mutable model, can be mutated locally
|
|
1343
|
+
* // even if the parent did not pass the matching `v-model`.
|
|
1344
|
+
* const count = defineModel<number>('count', { local: true, default: 0 })
|
|
1345
|
+
* ```
|
|
1346
|
+
*/
|
|
1347
|
+
export declare function defineModel<T>(options: {
|
|
1348
|
+
required: true;
|
|
1349
|
+
} & PropOptions<T> & DefineModelOptions): Ref<T>;
|
|
1350
|
+
export declare function defineModel<T>(options: {
|
|
1351
|
+
default: any;
|
|
1352
|
+
} & PropOptions<T> & DefineModelOptions): Ref<T>;
|
|
1353
|
+
export declare function defineModel<T>(options?: PropOptions<T> & DefineModelOptions): Ref<T | undefined>;
|
|
1354
|
+
export declare function defineModel<T>(name: string, options: {
|
|
1355
|
+
required: true;
|
|
1356
|
+
} & PropOptions<T> & DefineModelOptions): Ref<T>;
|
|
1357
|
+
export declare function defineModel<T>(name: string, options: {
|
|
1358
|
+
default: any;
|
|
1359
|
+
} & PropOptions<T> & DefineModelOptions): Ref<T>;
|
|
1360
|
+
export declare function defineModel<T>(name: string, options?: PropOptions<T> & DefineModelOptions): Ref<T | undefined>;
|
|
1361
|
+
interface DefineModelOptions {
|
|
1362
|
+
local?: boolean;
|
|
1363
|
+
}
|
|
1364
|
+
type NotUndefined<T> = T extends undefined ? never : T;
|
|
1365
|
+
type InferDefaults<T> = {
|
|
1270
1366
|
[K in keyof T]?: InferDefault<T, NotUndefined<T[K]>>;
|
|
1271
1367
|
};
|
|
1272
|
-
|
|
1273
|
-
|
|
1368
|
+
type InferDefault<P, T> = T extends null | number | string | boolean | symbol | Function ? T | ((props: P) => T) : (props: P) => T;
|
|
1369
|
+
type PropsWithDefaults<Base, Defaults> = Base & {
|
|
1274
1370
|
[K in keyof Defaults]: K extends keyof Base ? Defaults[K] extends undefined ? Base[K] : NotUndefined<Base[K]> : never;
|
|
1275
1371
|
};
|
|
1276
1372
|
/**
|
|
@@ -1290,20 +1386,26 @@ export type PropsWithDefaults<Base, Defaults> = Base & {
|
|
|
1290
1386
|
*
|
|
1291
1387
|
* This is only usable inside `<script setup>`, is compiled away in the output
|
|
1292
1388
|
* and should **not** be actually called at runtime.
|
|
1389
|
+
*
|
|
1390
|
+
* @see {@link https://vuejs.org/guide/typescript/composition-api.html#typing-component-props}
|
|
1293
1391
|
*/
|
|
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'];
|
|
1392
|
+
export declare function withDefaults<Props, Defaults extends InferDefaults<Props>>(props: Props, defaults: Defaults): PropsWithDefaults<Props, Defaults>;
|
|
1393
|
+
export declare function useSlots(): SetupContext['slots'];
|
|
1394
|
+
export declare function useAttrs(): SetupContext['attrs'];
|
|
1395
|
+
export declare function useModel<T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: {
|
|
1396
|
+
local?: boolean;
|
|
1397
|
+
}): Ref<T[K]>;
|
|
1297
1398
|
/* removed internal: mergeDefaults */
|
|
1399
|
+
/* removed internal: mergeModels */
|
|
1298
1400
|
/* removed internal: createPropsRestProxy */
|
|
1299
1401
|
/* removed internal: withAsyncContext */
|
|
1300
1402
|
|
|
1301
|
-
|
|
1403
|
+
type RawProps = VNodeProps & {
|
|
1302
1404
|
__v_isVNode?: never;
|
|
1303
1405
|
[Symbol.iterator]?: never;
|
|
1304
1406
|
} & Record<string, any>;
|
|
1305
|
-
|
|
1306
|
-
|
|
1407
|
+
type RawChildren = string | number | boolean | VNode | VNodeArrayChildren | (() => any);
|
|
1408
|
+
interface Constructor<P = any> {
|
|
1307
1409
|
__isFragment?: never;
|
|
1308
1410
|
__isTeleport?: never;
|
|
1309
1411
|
__isSuspense?: never;
|
|
@@ -1311,33 +1413,33 @@ export interface Constructor<P = any> {
|
|
|
1311
1413
|
$props: P;
|
|
1312
1414
|
};
|
|
1313
1415
|
}
|
|
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;
|
|
1416
|
+
export declare function h(type: string, children?: RawChildren): VNode;
|
|
1417
|
+
export declare function h(type: string, props?: RawProps | null, children?: RawChildren | RawSlots): VNode;
|
|
1418
|
+
export declare function h(type: typeof Text | typeof Comment, children?: string | number | boolean): VNode;
|
|
1419
|
+
export declare function h(type: typeof Text | typeof Comment, props?: null, children?: string | number | boolean): VNode;
|
|
1420
|
+
export declare function h(type: typeof Fragment, children?: VNodeArrayChildren): VNode;
|
|
1421
|
+
export declare function h(type: typeof Fragment, props?: RawProps | null, children?: VNodeArrayChildren): VNode;
|
|
1422
|
+
export declare function h(type: typeof Teleport, props: RawProps & TeleportProps, children: RawChildren | RawSlots): VNode;
|
|
1423
|
+
export declare function h(type: typeof Suspense, children?: RawChildren): VNode;
|
|
1424
|
+
export declare function h(type: typeof Suspense, props?: (RawProps & SuspenseProps) | null, children?: RawChildren | RawSlots): VNode;
|
|
1425
|
+
export declare function h<P, E extends EmitsOptions = {}, S extends Record<string, any> = {}>(type: FunctionalComponent<P, E, S>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1426
|
+
export declare function h(type: Component, children?: RawChildren): VNode;
|
|
1427
|
+
export declare function h<P>(type: ConcreteComponent | string, children?: RawChildren): VNode;
|
|
1428
|
+
export declare function h<P>(type: ConcreteComponent<P> | string, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren): VNode;
|
|
1429
|
+
export declare function h<P>(type: Component<P>, props?: (RawProps & P) | null, children?: RawChildren | RawSlots): VNode;
|
|
1430
|
+
export declare function h<P>(type: ComponentOptions<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1431
|
+
export declare function h(type: Constructor, children?: RawChildren): VNode;
|
|
1432
|
+
export declare function h<P>(type: Constructor<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1433
|
+
export declare function h(type: DefineComponent, children?: RawChildren): VNode;
|
|
1434
|
+
export declare function h<P>(type: DefineComponent<P>, props?: (RawProps & P) | ({} extends P ? null : never), children?: RawChildren | RawSlots): VNode;
|
|
1333
1435
|
|
|
1334
|
-
declare const ssrContextKey: unique symbol;
|
|
1335
|
-
declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
|
|
1436
|
+
export declare const ssrContextKey: unique symbol;
|
|
1437
|
+
export declare const useSSRContext: <T = Record<string, any>>() => T | undefined;
|
|
1336
1438
|
|
|
1337
|
-
declare function warn(msg: string, ...args: any[]): void;
|
|
1439
|
+
export declare function warn(msg: string, ...args: any[]): void;
|
|
1338
1440
|
/* removed internal: assertNumber */
|
|
1339
1441
|
|
|
1340
|
-
declare const enum ErrorCodes {
|
|
1442
|
+
export declare const enum ErrorCodes {
|
|
1341
1443
|
SETUP_FUNCTION = 0,
|
|
1342
1444
|
RENDER_FUNCTION = 1,
|
|
1343
1445
|
WATCH_GETTER = 2,
|
|
@@ -1354,20 +1456,20 @@ declare const enum ErrorCodes {
|
|
|
1354
1456
|
ASYNC_COMPONENT_LOADER = 13,
|
|
1355
1457
|
SCHEDULER = 14
|
|
1356
1458
|
}
|
|
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;
|
|
1459
|
+
type ErrorTypes = LifecycleHooks | ErrorCodes;
|
|
1460
|
+
export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
|
|
1461
|
+
export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any[];
|
|
1462
|
+
export declare function handleError(err: unknown, instance: ComponentInternalInstance | null, type: ErrorTypes, throwInDev?: boolean): void;
|
|
1361
1463
|
|
|
1362
|
-
declare function initCustomFormatter(): void;
|
|
1464
|
+
export declare function initCustomFormatter(): void;
|
|
1363
1465
|
|
|
1364
|
-
|
|
1466
|
+
interface AppRecord {
|
|
1365
1467
|
id: number;
|
|
1366
1468
|
app: App;
|
|
1367
1469
|
version: string;
|
|
1368
1470
|
types: Record<string, string | Symbol>;
|
|
1369
1471
|
}
|
|
1370
|
-
|
|
1472
|
+
interface DevtoolsHook {
|
|
1371
1473
|
enabled?: boolean;
|
|
1372
1474
|
emit: (event: string, ...payload: any[]) => void;
|
|
1373
1475
|
on: (event: string, handler: Function) => void;
|
|
@@ -1380,10 +1482,10 @@ export interface DevtoolsHook {
|
|
|
1380
1482
|
*/
|
|
1381
1483
|
cleanupBuffer?: (matchArg: unknown) => boolean;
|
|
1382
1484
|
}
|
|
1383
|
-
declare let devtools: DevtoolsHook;
|
|
1384
|
-
declare function setDevtoolsHook(hook: DevtoolsHook, target: any): void;
|
|
1485
|
+
export declare let devtools: DevtoolsHook;
|
|
1486
|
+
export declare function setDevtoolsHook(hook: DevtoolsHook, target: any): void;
|
|
1385
1487
|
|
|
1386
|
-
|
|
1488
|
+
type HMRComponent = ComponentOptions | ClassComponent;
|
|
1387
1489
|
export interface HMRRuntime {
|
|
1388
1490
|
createRecord: typeof createRecord;
|
|
1389
1491
|
rerender: typeof rerender;
|
|
@@ -1408,60 +1510,60 @@ declare function setCurrentRenderingInstance(instance: ComponentInternalInstance
|
|
|
1408
1510
|
* Set scope id when creating hoisted vnodes.
|
|
1409
1511
|
* @private compiler helper
|
|
1410
1512
|
*/
|
|
1411
|
-
declare function pushScopeId(id: string | null): void;
|
|
1513
|
+
export declare function pushScopeId(id: string | null): void;
|
|
1412
1514
|
/**
|
|
1413
1515
|
* Technically we no longer need this after 3.0.8 but we need to keep the same
|
|
1414
1516
|
* API for backwards compat w/ code generated by compilers.
|
|
1415
1517
|
* @private
|
|
1416
1518
|
*/
|
|
1417
|
-
declare function popScopeId(): void;
|
|
1519
|
+
export declare function popScopeId(): void;
|
|
1418
1520
|
/**
|
|
1419
1521
|
* Only for backwards compat
|
|
1420
1522
|
* @private
|
|
1421
1523
|
*/
|
|
1422
|
-
declare const withScopeId: (_id: string) => typeof withCtx;
|
|
1524
|
+
export declare const withScopeId: (_id: string) => typeof withCtx;
|
|
1423
1525
|
/**
|
|
1424
1526
|
* Wrap a slot function to memoize current rendering instance
|
|
1425
1527
|
* @private compiler helper
|
|
1426
1528
|
*/
|
|
1427
|
-
declare function withCtx(fn: Function, ctx?: ComponentInternalInstance | null, isNonScopedSlot?: boolean): Function;
|
|
1529
|
+
export declare function withCtx(fn: Function, ctx?: ComponentInternalInstance | null, isNonScopedSlot?: boolean): Function;
|
|
1428
1530
|
|
|
1429
1531
|
/**
|
|
1430
1532
|
* v-for string
|
|
1431
1533
|
* @private
|
|
1432
1534
|
*/
|
|
1433
|
-
declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[];
|
|
1535
|
+
export declare function renderList(source: string, renderItem: (value: string, index: number) => VNodeChild): VNodeChild[];
|
|
1434
1536
|
/**
|
|
1435
1537
|
* v-for number
|
|
1436
1538
|
*/
|
|
1437
|
-
declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[];
|
|
1539
|
+
export declare function renderList(source: number, renderItem: (value: number, index: number) => VNodeChild): VNodeChild[];
|
|
1438
1540
|
/**
|
|
1439
1541
|
* v-for array
|
|
1440
1542
|
*/
|
|
1441
|
-
declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
|
1543
|
+
export declare function renderList<T>(source: T[], renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
|
1442
1544
|
/**
|
|
1443
1545
|
* v-for iterable
|
|
1444
1546
|
*/
|
|
1445
|
-
declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
|
1547
|
+
export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T, index: number) => VNodeChild): VNodeChild[];
|
|
1446
1548
|
/**
|
|
1447
1549
|
* v-for object
|
|
1448
1550
|
*/
|
|
1449
|
-
declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild): VNodeChild[];
|
|
1551
|
+
export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild): VNodeChild[];
|
|
1450
1552
|
|
|
1451
1553
|
/**
|
|
1452
1554
|
* For prefixing keys in v-on="obj" with "on"
|
|
1453
1555
|
* @private
|
|
1454
1556
|
*/
|
|
1455
|
-
declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
|
|
1557
|
+
export declare function toHandlers(obj: Record<string, any>, preserveCaseIfNecessary?: boolean): Record<string, any>;
|
|
1456
1558
|
|
|
1457
1559
|
/**
|
|
1458
1560
|
* Compiler runtime helper for rendering `<slot/>`
|
|
1459
1561
|
* @private
|
|
1460
1562
|
*/
|
|
1461
|
-
declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode;
|
|
1563
|
+
export declare function renderSlot(slots: Slots, name: string, props?: Data, fallback?: () => VNodeArrayChildren, noSlotted?: boolean): VNode;
|
|
1462
1564
|
|
|
1463
|
-
|
|
1464
|
-
|
|
1565
|
+
type SSRSlot = (...args: any[]) => VNode[] | undefined;
|
|
1566
|
+
interface CompiledSlotDescriptor {
|
|
1465
1567
|
name: string;
|
|
1466
1568
|
fn: SSRSlot;
|
|
1467
1569
|
key?: string;
|
|
@@ -1470,12 +1572,12 @@ export interface CompiledSlotDescriptor {
|
|
|
1470
1572
|
* Compiler runtime helper for creating dynamic slots object
|
|
1471
1573
|
* @private
|
|
1472
1574
|
*/
|
|
1473
|
-
declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>;
|
|
1575
|
+
export declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>;
|
|
1474
1576
|
|
|
1475
|
-
declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any, {
|
|
1577
|
+
export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any, {
|
|
1476
1578
|
[key: string]: any;
|
|
1477
1579
|
}>;
|
|
1478
|
-
declare function isMemoSame(cached: VNode, memo: any[]): boolean;
|
|
1580
|
+
export declare function isMemoSame(cached: VNode, memo: any[]): boolean;
|
|
1479
1581
|
|
|
1480
1582
|
declare function renderComponentRoot(instance: ComponentInternalInstance): VNode;
|
|
1481
1583
|
|
|
@@ -1506,8 +1608,8 @@ export type LegacyConfig = {
|
|
|
1506
1608
|
productionTip?: boolean;
|
|
1507
1609
|
};
|
|
1508
1610
|
|
|
1509
|
-
|
|
1510
|
-
|
|
1611
|
+
type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties;
|
|
1612
|
+
interface LegacyPublicProperties {
|
|
1511
1613
|
$set(target: object, key: string, value: any): void;
|
|
1512
1614
|
$delete(target: object, key: string): void;
|
|
1513
1615
|
$mount(el?: string | Element): this;
|
|
@@ -1565,7 +1667,7 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
|
|
|
1565
1667
|
};
|
|
1566
1668
|
declare function createCompatVue(createApp: CreateAppFunction<Element>, createSingletonApp: CreateAppFunction<Element>): CompatVue;
|
|
1567
1669
|
|
|
1568
|
-
declare const version: string;
|
|
1670
|
+
export declare const version: string;
|
|
1569
1671
|
|
|
1570
1672
|
declare module '@vue/reactivity' {
|
|
1571
1673
|
interface RefUnwrapBailTypes {
|
|
@@ -1580,17 +1682,23 @@ declare module '@vue/reactivity' {
|
|
|
1580
1682
|
|
|
1581
1683
|
|
|
1582
1684
|
|
|
1583
|
-
export {
|
|
1685
|
+
export { createBaseVNode as createElementVNode, };
|
|
1584
1686
|
// Note: this file is auto concatenated to the end of the bundled d.ts during
|
|
1585
1687
|
// build.
|
|
1586
1688
|
type _defineProps = typeof defineProps
|
|
1587
1689
|
type _defineEmits = typeof defineEmits
|
|
1588
1690
|
type _defineExpose = typeof defineExpose
|
|
1691
|
+
type _defineOptions = typeof defineOptions
|
|
1692
|
+
type _defineSlots = typeof defineSlots
|
|
1693
|
+
type _defineModel = typeof defineModel
|
|
1589
1694
|
type _withDefaults = typeof withDefaults
|
|
1590
1695
|
|
|
1591
1696
|
declare global {
|
|
1592
1697
|
const defineProps: _defineProps
|
|
1593
1698
|
const defineEmits: _defineEmits
|
|
1594
1699
|
const defineExpose: _defineExpose
|
|
1700
|
+
const defineOptions: _defineOptions
|
|
1701
|
+
const defineSlots: _defineSlots
|
|
1702
|
+
const defineModel: _defineModel
|
|
1595
1703
|
const withDefaults: _withDefaults
|
|
1596
1704
|
}
|