@vue/runtime-core 3.5.0-alpha.4 → 3.5.0-beta.1
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/README.md +1 -1
- package/dist/runtime-core.cjs.js +2784 -2615
- package/dist/runtime-core.cjs.prod.js +2177 -2017
- package/dist/runtime-core.d.ts +86 -63
- package/dist/runtime-core.esm-bundler.js +2798 -2633
- package/package.json +3 -3
package/dist/runtime-core.d.ts
CHANGED
|
@@ -334,7 +334,7 @@ type InferDefaults<T> = {
|
|
|
334
334
|
type NativeType = null | number | string | boolean | symbol | Function;
|
|
335
335
|
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
336
336
|
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<MappedOmit<T, keyof Defaults>> & {
|
|
337
|
-
readonly [K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
|
|
337
|
+
readonly [K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
|
|
338
338
|
} & {
|
|
339
339
|
readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
|
|
340
340
|
};
|
|
@@ -419,7 +419,7 @@ export interface ObjectDirective<HostElement = any, Value = any, Modifiers exten
|
|
|
419
419
|
export type FunctionDirective<HostElement = any, V = any, Modifiers extends string = string, Arg extends string = string> = DirectiveHook<HostElement, any, V, Modifiers, Arg>;
|
|
420
420
|
export type Directive<HostElement = any, Value = any, Modifiers extends string = string, Arg extends string = string> = ObjectDirective<HostElement, Value, Modifiers, Arg> | FunctionDirective<HostElement, Value, Modifiers, Arg>;
|
|
421
421
|
type DirectiveModifiers<K extends string = string> = Record<K, boolean>;
|
|
422
|
-
export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string, DirectiveModifiers]>;
|
|
422
|
+
export type DirectiveArguments = Array<[Directive | undefined] | [Directive | undefined, any] | [Directive | undefined, any, string] | [Directive | undefined, any, string | undefined, DirectiveModifiers]>;
|
|
423
423
|
/**
|
|
424
424
|
* Adds directives to a VNode.
|
|
425
425
|
*/
|
|
@@ -478,20 +478,21 @@ export type CreateComponentPublicInstance<P = {}, B = {}, D = {}, C extends Comp
|
|
|
478
478
|
* inference everywhere internally, but it has to be a new type to avoid
|
|
479
479
|
* breaking types that relies on previous arguments order (#10842)
|
|
480
480
|
*/
|
|
481
|
-
export type CreateComponentPublicInstanceWithMixins<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S, LC, Directives, Exposed, Provide>, I, S, Exposed>;
|
|
481
|
+
export type CreateComponentPublicInstanceWithMixins<P = {}, B = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, PublicProps = P, Defaults = {}, MakeDefaultsOptional extends boolean = false, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, TypeRefs extends Data = {}, Provide extends ComponentProvideOptions = ComponentProvideOptions, PublicMixin = IntersectionMixin<Mixin> & IntersectionMixin<Extends>, PublicP = UnwrapMixinsType<PublicMixin, 'P'> & EnsureNonVoid<P>, PublicB = UnwrapMixinsType<PublicMixin, 'B'> & EnsureNonVoid<B>, PublicD = UnwrapMixinsType<PublicMixin, 'D'> & EnsureNonVoid<D>, PublicC extends ComputedOptions = UnwrapMixinsType<PublicMixin, 'C'> & EnsureNonVoid<C>, PublicM extends MethodOptions = UnwrapMixinsType<PublicMixin, 'M'> & EnsureNonVoid<M>, PublicDefaults = UnwrapMixinsType<PublicMixin, 'Defaults'> & EnsureNonVoid<Defaults>> = ComponentPublicInstance<PublicP, PublicB, PublicD, PublicC, PublicM, E, PublicProps, PublicDefaults, MakeDefaultsOptional, ComponentOptionsBase<P, B, D, C, M, Mixin, Extends, E, string, Defaults, {}, string, S, LC, Directives, Exposed, Provide>, I, S, Exposed, TypeRefs>;
|
|
482
482
|
type ExposedKeys<T, Exposed extends string & keyof T> = '' extends Exposed ? T : Pick<T, Exposed>;
|
|
483
483
|
export type ComponentPublicInstance<P = {}, // props type extracted from props option
|
|
484
484
|
B = {}, // raw bindings returned from setup()
|
|
485
485
|
D = {}, // return from data()
|
|
486
|
-
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = {}, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, Exposed extends string = ''> = {
|
|
486
|
+
C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOptions = {}, PublicProps = {}, Defaults = {}, MakeDefaultsOptional extends boolean = false, Options = ComponentOptionsBase<any, any, any, any, any, any, any, any, any>, I extends ComponentInjectOptions = {}, S extends SlotsType = {}, Exposed extends string = '', TypeRefs extends Data = {}> = {
|
|
487
487
|
$: ComponentInternalInstance;
|
|
488
488
|
$data: D;
|
|
489
489
|
$props: MakeDefaultsOptional extends true ? Partial<Defaults> & Omit<Prettify<P> & PublicProps, keyof Defaults> : Prettify<P> & PublicProps;
|
|
490
490
|
$attrs: Data;
|
|
491
|
-
$refs: Data;
|
|
491
|
+
$refs: Data & TypeRefs;
|
|
492
492
|
$slots: UnwrapSlotsType<S>;
|
|
493
493
|
$root: ComponentPublicInstance | null;
|
|
494
494
|
$parent: ComponentPublicInstance | null;
|
|
495
|
+
$host: Element | null;
|
|
495
496
|
$emit: EmitFn<E>;
|
|
496
497
|
$el: any;
|
|
497
498
|
$options: Options & MergedComponentOptionsOverride;
|
|
@@ -537,6 +538,7 @@ declare const SuspenseImpl: {
|
|
|
537
538
|
normalize: typeof normalizeSuspenseChildren;
|
|
538
539
|
};
|
|
539
540
|
export declare const Suspense: {
|
|
541
|
+
__isSuspense: true;
|
|
540
542
|
new (): {
|
|
541
543
|
$props: VNodeProps & SuspenseProps;
|
|
542
544
|
$slots: {
|
|
@@ -544,7 +546,6 @@ export declare const Suspense: {
|
|
|
544
546
|
fallback(): VNode[];
|
|
545
547
|
};
|
|
546
548
|
};
|
|
547
|
-
__isSuspense: true;
|
|
548
549
|
};
|
|
549
550
|
export interface SuspenseBoundary {
|
|
550
551
|
vnode: VNode<RendererNode, RendererElement, SuspenseProps>;
|
|
@@ -612,27 +613,13 @@ export interface TransitionState {
|
|
|
612
613
|
leavingVNodes: Map<any, Record<string, VNode>>;
|
|
613
614
|
}
|
|
614
615
|
export declare function useTransitionState(): TransitionState;
|
|
615
|
-
export declare const BaseTransitionPropsValidators:
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
onEnterCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
623
|
-
onBeforeLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
624
|
-
onLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
625
|
-
onAfterLeave: (ArrayConstructor | FunctionConstructor)[];
|
|
626
|
-
onLeaveCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
627
|
-
onBeforeAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
628
|
-
onAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
629
|
-
onAfterAppear: (ArrayConstructor | FunctionConstructor)[];
|
|
630
|
-
onAppearCancelled: (ArrayConstructor | FunctionConstructor)[];
|
|
631
|
-
};
|
|
632
|
-
export declare const BaseTransition: new () => {
|
|
633
|
-
$props: BaseTransitionProps<any>;
|
|
634
|
-
$slots: {
|
|
635
|
-
default(): VNode[];
|
|
616
|
+
export declare const BaseTransitionPropsValidators: Record<string, any>;
|
|
617
|
+
export declare const BaseTransition: {
|
|
618
|
+
new (): {
|
|
619
|
+
$props: BaseTransitionProps<any>;
|
|
620
|
+
$slots: {
|
|
621
|
+
default(): VNode[];
|
|
622
|
+
};
|
|
636
623
|
};
|
|
637
624
|
};
|
|
638
625
|
export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance, postClone?: (hooks: TransitionHooks) => void): TransitionHooks;
|
|
@@ -724,27 +711,28 @@ export interface KeepAliveProps {
|
|
|
724
711
|
max?: number | string;
|
|
725
712
|
}
|
|
726
713
|
export declare const KeepAlive: {
|
|
714
|
+
__isKeepAlive: true;
|
|
727
715
|
new (): {
|
|
728
716
|
$props: VNodeProps & KeepAliveProps;
|
|
729
717
|
$slots: {
|
|
730
718
|
default(): VNode[];
|
|
731
719
|
};
|
|
732
720
|
};
|
|
733
|
-
__isKeepAlive: true;
|
|
734
721
|
};
|
|
735
722
|
export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
736
723
|
export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
|
|
737
724
|
|
|
738
|
-
|
|
739
|
-
export declare const
|
|
740
|
-
export declare const
|
|
741
|
-
export declare const
|
|
742
|
-
export declare const
|
|
743
|
-
export declare const
|
|
744
|
-
export declare const
|
|
725
|
+
type CreateHook<T = any> = (hook: T, target?: ComponentInternalInstance | null) => void;
|
|
726
|
+
export declare const onBeforeMount: CreateHook;
|
|
727
|
+
export declare const onMounted: CreateHook;
|
|
728
|
+
export declare const onBeforeUpdate: CreateHook;
|
|
729
|
+
export declare const onUpdated: CreateHook;
|
|
730
|
+
export declare const onBeforeUnmount: CreateHook;
|
|
731
|
+
export declare const onUnmounted: CreateHook;
|
|
732
|
+
export declare const onServerPrefetch: CreateHook;
|
|
745
733
|
type DebuggerHook = (e: DebuggerEvent) => void;
|
|
746
|
-
export declare const onRenderTriggered:
|
|
747
|
-
export declare const onRenderTracked:
|
|
734
|
+
export declare const onRenderTriggered: CreateHook<DebuggerHook>;
|
|
735
|
+
export declare const onRenderTracked: CreateHook<DebuggerHook>;
|
|
748
736
|
type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
|
|
749
737
|
export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;
|
|
750
738
|
|
|
@@ -975,8 +963,9 @@ export type ComponentOptionsWithObjectProps<PropsOptions = ComponentObjectPropsO
|
|
|
975
963
|
props: PropsOptions & ThisType<void>;
|
|
976
964
|
} & ThisType<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, Props, Defaults, false, I, S, LC, Directives>>;
|
|
977
965
|
|
|
978
|
-
|
|
966
|
+
interface InjectionConstraint<T> {
|
|
979
967
|
}
|
|
968
|
+
export type InjectionKey<T> = symbol & InjectionConstraint<T>;
|
|
980
969
|
export declare function provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): void;
|
|
981
970
|
export declare function inject<T>(key: InjectionKey<T> | string): T | undefined;
|
|
982
971
|
export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T, treatDefaultAsFactory?: false): T;
|
|
@@ -990,7 +979,7 @@ export declare function hasInjectionContext(): boolean;
|
|
|
990
979
|
|
|
991
980
|
export type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
992
981
|
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
993
|
-
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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
982
|
+
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 = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
994
983
|
export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
|
995
984
|
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'> & {
|
|
996
985
|
props?: (keyof Props)[];
|
|
@@ -1004,7 +993,7 @@ export declare function defineComponent<Props extends Record<string, any>, E ext
|
|
|
1004
993
|
}): DefineSetupFnComponent<Props, E, S>;
|
|
1005
994
|
export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = unknown extends TypeProps ? string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
1006
995
|
[key in RuntimePropsKeys]?: any;
|
|
1007
|
-
} : TypeProps, ResolvedProps = Readonly<InferredProps & EmitsToProps<ResolvedEmits
|
|
996
|
+
} : TypeProps, ResolvedProps = Readonly<InferredProps & EmitsToProps<ResolvedEmits>>, TypeRefs extends Record<string, unknown> = {}>(options: {
|
|
1008
997
|
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
1009
998
|
/**
|
|
1010
999
|
* @private for language-tools use only
|
|
@@ -1014,8 +1003,12 @@ export declare function defineComponent<TypeProps, RuntimePropsOptions extends C
|
|
|
1014
1003
|
* @private for language-tools use only
|
|
1015
1004
|
*/
|
|
1016
1005
|
__typeEmits?: TypeEmits;
|
|
1006
|
+
/**
|
|
1007
|
+
* @private for language-tools use only
|
|
1008
|
+
*/
|
|
1009
|
+
__typeRefs?: TypeRefs;
|
|
1017
1010
|
} & ComponentOptionsBase<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
1018
|
-
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ResolvedProps, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false>;
|
|
1011
|
+
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ResolvedProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ResolvedProps, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs>;
|
|
1019
1012
|
|
|
1020
1013
|
export interface App<HostElement = any> {
|
|
1021
1014
|
version: string;
|
|
@@ -1027,7 +1020,19 @@ export interface App<HostElement = any> {
|
|
|
1027
1020
|
component<T extends Component | DefineComponent>(name: string, component: T): this;
|
|
1028
1021
|
directive<T = any, V = any>(name: string): Directive<T, V> | undefined;
|
|
1029
1022
|
directive<T = any, V = any>(name: string, directive: Directive<T, V>): this;
|
|
1030
|
-
mount(rootContainer: HostElement | string,
|
|
1023
|
+
mount(rootContainer: HostElement | string,
|
|
1024
|
+
/**
|
|
1025
|
+
* @internal
|
|
1026
|
+
*/
|
|
1027
|
+
isHydrate?: boolean,
|
|
1028
|
+
/**
|
|
1029
|
+
* @internal
|
|
1030
|
+
*/
|
|
1031
|
+
namespace?: boolean | ElementNamespace,
|
|
1032
|
+
/**
|
|
1033
|
+
* @internal
|
|
1034
|
+
*/
|
|
1035
|
+
vnode?: VNode): ComponentPublicInstance;
|
|
1031
1036
|
unmount(): void;
|
|
1032
1037
|
onUnmount(cb: () => void): void;
|
|
1033
1038
|
provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
|
|
@@ -1119,15 +1124,15 @@ declare enum TeleportMoveTypes {
|
|
|
1119
1124
|
REORDER = 2
|
|
1120
1125
|
}
|
|
1121
1126
|
declare function moveTeleport(vnode: VNode, container: RendererElement, parentAnchor: RendererNode | null, { o: { insert }, m: move }: RendererInternals, moveType?: TeleportMoveTypes): void;
|
|
1122
|
-
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;
|
|
1127
|
+
declare function hydrateTeleport(node: Node, vnode: TeleportVNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean, { o: { nextSibling, parentNode, querySelector, insert, createText }, }: RendererInternals<Node, Element>, hydrateChildren: (node: Node | null, vnode: VNode, container: Element, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
|
|
1123
1128
|
export declare const Teleport: {
|
|
1129
|
+
__isTeleport: true;
|
|
1124
1130
|
new (): {
|
|
1125
1131
|
$props: VNodeProps & TeleportProps;
|
|
1126
1132
|
$slots: {
|
|
1127
1133
|
default(): VNode[];
|
|
1128
1134
|
};
|
|
1129
1135
|
};
|
|
1130
|
-
__isTeleport: true;
|
|
1131
1136
|
};
|
|
1132
1137
|
|
|
1133
1138
|
/**
|
|
@@ -1145,10 +1150,10 @@ export declare function resolveDynamicComponent(component: unknown): VNodeTypes;
|
|
|
1145
1150
|
export declare function resolveDirective(name: string): Directive | undefined;
|
|
1146
1151
|
|
|
1147
1152
|
export declare const Fragment: {
|
|
1153
|
+
__isFragment: true;
|
|
1148
1154
|
new (): {
|
|
1149
1155
|
$props: VNodeProps;
|
|
1150
1156
|
};
|
|
1151
|
-
__isFragment: true;
|
|
1152
1157
|
};
|
|
1153
1158
|
export declare const Text: unique symbol;
|
|
1154
1159
|
export declare const Comment: unique symbol;
|
|
@@ -1255,9 +1260,7 @@ export declare function setBlockTracking(value: number): void;
|
|
|
1255
1260
|
/**
|
|
1256
1261
|
* @private
|
|
1257
1262
|
*/
|
|
1258
|
-
export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode
|
|
1259
|
-
[key: string]: any;
|
|
1260
|
-
}>;
|
|
1263
|
+
export declare function createElementBlock(type: string | typeof Fragment, props?: Record<string, any> | null, children?: any, patchFlag?: number, dynamicProps?: string[], shapeFlag?: number): VNode;
|
|
1261
1264
|
/**
|
|
1262
1265
|
* Create a block root vnode. Takes the same exact arguments as `createVNode`.
|
|
1263
1266
|
* A block root keeps track of dynamic nodes within the block in the
|
|
@@ -1275,9 +1278,7 @@ declare let vnodeArgsTransformer: ((args: Parameters<typeof _createVNode>, insta
|
|
|
1275
1278
|
* typings
|
|
1276
1279
|
*/
|
|
1277
1280
|
export declare function transformVNodeArgs(transformer?: typeof vnodeArgsTransformer): void;
|
|
1278
|
-
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
|
|
1279
|
-
[key: string]: any;
|
|
1280
|
-
}>;
|
|
1281
|
+
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;
|
|
1281
1282
|
|
|
1282
1283
|
export declare const createVNode: typeof _createVNode;
|
|
1283
1284
|
declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props?: (Data & VNodeProps) | null, children?: unknown, patchFlag?: number, dynamicProps?: string[] | null, isBlockNode?: boolean): VNode;
|
|
@@ -1459,9 +1460,11 @@ export declare const getCurrentInstance: () => ComponentInternalInstance | null;
|
|
|
1459
1460
|
*/
|
|
1460
1461
|
export declare function registerRuntimeCompiler(_compile: any): void;
|
|
1461
1462
|
export declare const isRuntimeOnly: () => boolean;
|
|
1463
|
+
export interface ComponentCustomElementInterface {
|
|
1464
|
+
}
|
|
1462
1465
|
|
|
1463
1466
|
export type WatchEffect = (onCleanup: OnCleanup) => void;
|
|
1464
|
-
export type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
|
|
1467
|
+
export type WatchSource<T = any> = Ref<T, any> | ComputedRef<T> | (() => T);
|
|
1465
1468
|
export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
|
|
1466
1469
|
type MaybeUndefined<T, I> = I extends true ? T | undefined : T;
|
|
1467
1470
|
type MapSources<T, Immediate> = {
|
|
@@ -1473,18 +1476,39 @@ export interface WatchOptionsBase extends DebuggerOptions {
|
|
|
1473
1476
|
}
|
|
1474
1477
|
export interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
|
|
1475
1478
|
immediate?: Immediate;
|
|
1476
|
-
deep?: boolean;
|
|
1479
|
+
deep?: boolean | number;
|
|
1477
1480
|
once?: boolean;
|
|
1478
1481
|
}
|
|
1479
1482
|
export type WatchStopHandle = () => void;
|
|
1480
|
-
export
|
|
1483
|
+
export interface WatchHandle extends WatchStopHandle {
|
|
1484
|
+
pause: () => void;
|
|
1485
|
+
resume: () => void;
|
|
1486
|
+
stop: () => void;
|
|
1487
|
+
}
|
|
1488
|
+
export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchHandle;
|
|
1481
1489
|
export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
1482
1490
|
export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
|
|
1483
|
-
type MultiWatchSources = (WatchSource<unknown> | object)[];
|
|
1484
|
-
export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>):
|
|
1485
|
-
export declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: readonly [...T] | T, cb: [T] extends [ReactiveMarker] ? WatchCallback<T, MaybeUndefined<T, Immediate>> : WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>):
|
|
1486
|
-
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>):
|
|
1487
|
-
export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>):
|
|
1491
|
+
export type MultiWatchSources = (WatchSource<unknown> | object)[];
|
|
1492
|
+
export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
1493
|
+
export declare function watch<T extends Readonly<MultiWatchSources>, Immediate extends Readonly<boolean> = false>(sources: readonly [...T] | T, cb: [T] extends [ReactiveMarker] ? WatchCallback<T, MaybeUndefined<T, Immediate>> : WatchCallback<MapSources<T, false>, MapSources<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
1494
|
+
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>): WatchHandle;
|
|
1495
|
+
export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
|
|
1496
|
+
|
|
1497
|
+
/**
|
|
1498
|
+
* A lazy hydration strategy for async components.
|
|
1499
|
+
* @param hydrate - call this to perform the actual hydration.
|
|
1500
|
+
* @param forEachElement - iterate through the root elements of the component's
|
|
1501
|
+
* non-hydrated DOM, accounting for possible fragments.
|
|
1502
|
+
* @returns a teardown function to be called if the async component is unmounted
|
|
1503
|
+
* before it is hydrated. This can be used to e.g. remove DOM event
|
|
1504
|
+
* listeners.
|
|
1505
|
+
*/
|
|
1506
|
+
export type HydrationStrategy = (hydrate: () => void, forEachElement: (cb: (el: Element) => any) => void) => (() => void) | void;
|
|
1507
|
+
export type HydrationStrategyFactory<Options> = (options?: Options) => HydrationStrategy;
|
|
1508
|
+
export declare const hydrateOnIdle: HydrationStrategyFactory<number>;
|
|
1509
|
+
export declare const hydrateOnVisible: HydrationStrategyFactory<IntersectionObserverInit>;
|
|
1510
|
+
export declare const hydrateOnMediaQuery: HydrationStrategyFactory<string>;
|
|
1511
|
+
export declare const hydrateOnInteraction: HydrationStrategyFactory<keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap>>;
|
|
1488
1512
|
|
|
1489
1513
|
type AsyncComponentResolveResult<T = Component> = T | {
|
|
1490
1514
|
default: T;
|
|
@@ -1497,6 +1521,7 @@ export interface AsyncComponentOptions<T = any> {
|
|
|
1497
1521
|
delay?: number;
|
|
1498
1522
|
timeout?: number;
|
|
1499
1523
|
suspensible?: boolean;
|
|
1524
|
+
hydrate?: HydrationStrategy;
|
|
1500
1525
|
onError?: (error: Error, retry: () => void, fail: () => void, attempts: number) => any;
|
|
1501
1526
|
}
|
|
1502
1527
|
/*! #__NO_SIDE_EFFECTS__ */
|
|
@@ -1506,7 +1531,7 @@ export declare function defineAsyncComponent<T extends Component = {
|
|
|
1506
1531
|
|
|
1507
1532
|
export declare function useModel<M extends PropertyKey, T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: DefineModelOptions<T[K]>): ModelRef<T[K], M>;
|
|
1508
1533
|
|
|
1509
|
-
export declare function useTemplateRef<T = unknown>(key:
|
|
1534
|
+
export declare function useTemplateRef<T = unknown, Keys extends string = string>(key: Keys): Readonly<ShallowRef<T | null>>;
|
|
1510
1535
|
|
|
1511
1536
|
export declare function useId(): string | undefined;
|
|
1512
1537
|
|
|
@@ -1680,9 +1705,7 @@ interface CompiledSlotDescriptor {
|
|
|
1680
1705
|
*/
|
|
1681
1706
|
export declare function createSlots(slots: Record<string, SSRSlot>, dynamicSlots: (CompiledSlotDescriptor | CompiledSlotDescriptor[] | undefined)[]): Record<string, SSRSlot>;
|
|
1682
1707
|
|
|
1683
|
-
export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any
|
|
1684
|
-
[key: string]: any;
|
|
1685
|
-
}>;
|
|
1708
|
+
export declare function withMemo(memo: any[], render: () => VNode<any, any>, cache: any[], index: number): VNode<any, any>;
|
|
1686
1709
|
export declare function isMemoSame(cached: VNode, memo: any[]): boolean;
|
|
1687
1710
|
|
|
1688
1711
|
export type LegacyConfig = {
|