@vue/runtime-core 3.4.26 → 3.4.28

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.
@@ -1,5 +1,5 @@
1
- import { computed as computed$1, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, Ref, ReactiveEffect, ComputedRef, DebuggerOptions, reactive } from '@vue/reactivity';
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';
1
+ import { computed as computed$1, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, Ref, ReactiveEffect, ComputedRef, DebuggerOptions, ReactiveMarker, reactive } from '@vue/reactivity';
2
+ export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, Reactive, 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
3
  import { IfAny, Prettify, Awaited, UnionToIntersection, LooseRequired } from '@vue/shared';
4
4
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
5
5
 
@@ -128,7 +128,7 @@ C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOpt
128
128
  $options: Options & MergedComponentOptionsOverride;
129
129
  $forceUpdate: () => void;
130
130
  $nextTick: typeof nextTick;
131
- $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R]) => any : (...args: any) => any, options?: WatchOptions): WatchStopHandle;
131
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
132
132
  } & IfAny<P, P, Omit<P, keyof ShallowUnwrapRef<B>>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
133
133
 
134
134
  declare enum LifecycleHooks {
@@ -198,7 +198,7 @@ export interface SuspenseBoundary {
198
198
  fallback(fallbackVNode: VNode): void;
199
199
  move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
200
200
  next(): RendererNode | null;
201
- registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn): void;
201
+ registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
202
202
  unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
203
203
  }
204
204
  declare function createSuspenseBoundary(vnode: VNode, parentSuspense: SuspenseBoundary | null, parentComponent: ComponentInternalInstance | null, container: RendererElement, hiddenContainer: RendererElement, anchor: RendererNode | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, isHydrating?: boolean): SuspenseBoundary;
@@ -268,7 +268,7 @@ export declare const BaseTransition: new () => {
268
268
  default(): VNode[];
269
269
  };
270
270
  };
271
- export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
271
+ export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance, postClone?: (hooks: TransitionHooks) => void): TransitionHooks;
272
272
  export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
273
273
  export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
274
274
 
@@ -369,16 +369,16 @@ export declare const KeepAlive: {
369
369
  export declare function onActivated(hook: Function, target?: ComponentInternalInstance | null): void;
370
370
  export declare function onDeactivated(hook: Function, target?: ComponentInternalInstance | null): void;
371
371
 
372
- export declare const onBeforeMount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
373
- export declare const onMounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
374
- export declare const onBeforeUpdate: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
375
- export declare const onUpdated: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
376
- export declare const onBeforeUnmount: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
377
- export declare const onUnmounted: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
378
- export declare const onServerPrefetch: (hook: () => any, target?: ComponentInternalInstance | null) => false | Function | undefined;
372
+ export declare const onBeforeMount: (hook: () => any, target?: ComponentInternalInstance | null) => void;
373
+ export declare const onMounted: (hook: () => any, target?: ComponentInternalInstance | null) => void;
374
+ export declare const onBeforeUpdate: (hook: () => any, target?: ComponentInternalInstance | null) => void;
375
+ export declare const onUpdated: (hook: () => any, target?: ComponentInternalInstance | null) => void;
376
+ export declare const onBeforeUnmount: (hook: () => any, target?: ComponentInternalInstance | null) => void;
377
+ export declare const onUnmounted: (hook: () => any, target?: ComponentInternalInstance | null) => void;
378
+ export declare const onServerPrefetch: (hook: () => any, target?: ComponentInternalInstance | null) => void;
379
379
  type DebuggerHook = (e: DebuggerEvent) => void;
380
- export declare const onRenderTriggered: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
381
- export declare const onRenderTracked: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => false | Function | undefined;
380
+ export declare const onRenderTriggered: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => void;
381
+ export declare const onRenderTracked: (hook: DebuggerHook, target?: ComponentInternalInstance | null) => void;
382
382
  type ErrorCapturedHook<TError = unknown> = (err: TError, instance: ComponentPublicInstance | null, info: string) => boolean | void;
383
383
  export declare function onErrorCaptured<TError = Error>(hook: ErrorCapturedHook<TError>, target?: ComponentInternalInstance | null): void;
384
384
 
@@ -488,7 +488,7 @@ return withDirectives(h(comp), [
488
488
  */
489
489
 
490
490
  export interface DirectiveBinding<V = any> {
491
- instance: ComponentPublicInstance | null;
491
+ instance: ComponentPublicInstance | Record<string, any> | null;
492
492
  value: V;
493
493
  oldValue: V | null;
494
494
  arg?: string;
@@ -496,7 +496,7 @@ export interface DirectiveBinding<V = any> {
496
496
  dir: ObjectDirective<any, V>;
497
497
  }
498
498
  export type DirectiveHook<T = any, Prev = VNode<any, T> | null, V = any> = (el: T, binding: DirectiveBinding<V>, vnode: VNode<any, T>, prevVNode: Prev) => void;
499
- type SSRDirectiveHook = (binding: DirectiveBinding, vnode: VNode) => Data | undefined;
499
+ type SSRDirectiveHook<V> = (binding: DirectiveBinding<V>, vnode: VNode) => Data | undefined;
500
500
  export interface ObjectDirective<T = any, V = any> {
501
501
  created?: DirectiveHook<T, null, V>;
502
502
  beforeMount?: DirectiveHook<T, null, V>;
@@ -505,7 +505,7 @@ export interface ObjectDirective<T = any, V = any> {
505
505
  updated?: DirectiveHook<T, VNode<any, T>, V>;
506
506
  beforeUnmount?: DirectiveHook<T, null, V>;
507
507
  unmounted?: DirectiveHook<T, null, V>;
508
- getSSRProps?: SSRDirectiveHook;
508
+ getSSRProps?: SSRDirectiveHook<V>;
509
509
  deep?: boolean;
510
510
  }
511
511
  export type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
@@ -772,7 +772,7 @@ export interface App<HostElement = any> {
772
772
  directive<T = any, V = any>(name: string, directive: Directive<T, V>): this;
773
773
  mount(rootContainer: HostElement | string, isHydrate?: boolean, namespace?: boolean | ElementNamespace): ComponentPublicInstance;
774
774
  unmount(): void;
775
- provide<T>(key: InjectionKey<T> | string, value: T): this;
775
+ provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
776
776
  /**
777
777
  * Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
778
778
  * to variables provided via `app.provide()`.
@@ -896,7 +896,7 @@ type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
896
896
  type VNodeMountHook = (vnode: VNode) => void;
897
897
  type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
898
898
  export type VNodeProps = {
899
- key?: string | number | symbol;
899
+ key?: PropertyKey;
900
900
  ref?: VNodeRef;
901
901
  ref_for?: boolean;
902
902
  ref_key?: string;
@@ -916,7 +916,7 @@ export interface VNode<HostNode = RendererNode, HostElement = RendererElement, E
916
916
  }> {
917
917
  type: VNodeTypes;
918
918
  props: (VNodeProps & ExtraProps) | null;
919
- key: string | number | symbol | null;
919
+ key: PropertyKey | null;
920
920
  ref: VNodeNormalizedRef | null;
921
921
  /**
922
922
  * SFC only. This is assigned on vnode creation using currentScopeId
@@ -1087,7 +1087,7 @@ export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends
1087
1087
  attrs: Data;
1088
1088
  slots: UnwrapSlotsType<S>;
1089
1089
  emit: EmitFn<E>;
1090
- expose: (exposed?: Record<string, any>) => void;
1090
+ expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
1091
1091
  } : never;
1092
1092
  /**
1093
1093
  * We expose a subset of properties on the internal instance as they are
@@ -1141,8 +1141,9 @@ export declare const isRuntimeOnly: () => boolean;
1141
1141
  export type WatchEffect = (onCleanup: OnCleanup) => void;
1142
1142
  export type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
1143
1143
  export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
1144
+ type MaybeUndefined<T, I> = I extends true ? T | undefined : T;
1144
1145
  type MapSources<T, Immediate> = {
1145
- [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
+ [K in keyof T]: T[K] extends WatchSource<infer V> ? MaybeUndefined<V, Immediate> : T[K] extends object ? MaybeUndefined<T[K], Immediate> : never;
1146
1147
  };
1147
1148
  type OnCleanup = (cleanupFn: () => void) => void;
1148
1149
  export interface WatchOptionsBase extends DebuggerOptions {
@@ -1158,10 +1159,10 @@ export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsB
1158
1159
  export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
1159
1160
  export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
1160
1161
  type MultiWatchSources = (WatchSource<unknown> | object)[];
1161
- 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;
1162
+ export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
1163
+ 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>): WatchStopHandle;
1162
1164
  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;
1163
- 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;
1164
- 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;
1165
+ export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
1165
1166
 
1166
1167
  type AsyncComponentResolveResult<T = Component> = T | {
1167
1168
  default: T;
@@ -1236,7 +1237,7 @@ type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends
1236
1237
  * const emit = defineEmits<{
1237
1238
  * // <eventName>: <expected arguments>
1238
1239
  * change: []
1239
- * update: [value: string] // named tuple syntax
1240
+ * update: [value: number] // named tuple syntax
1240
1241
  * }>()
1241
1242
  *
1242
1243
  * emit('change')
@@ -1283,7 +1284,7 @@ export declare function defineOptions<RawBindings = {}, D = {}, C extends Comput
1283
1284
  slots?: undefined;
1284
1285
  }): void;
1285
1286
  export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
1286
- export type ModelRef<T, M extends string | number | symbol = string> = Ref<T> & [
1287
+ export type ModelRef<T, M extends PropertyKey = string> = Ref<T> & [
1287
1288
  ModelRef<T, M>,
1288
1289
  Record<M, true | undefined>
1289
1290
  ];
@@ -1324,20 +1325,20 @@ type DefineModelOptions<T = any> = {
1324
1325
  * const count = defineModel<number>('count', { default: 0 })
1325
1326
  * ```
1326
1327
  */
1327
- export declare function defineModel<T, M extends string | number | symbol = string>(options: {
1328
+ export declare function defineModel<T, M extends PropertyKey = string>(options: {
1328
1329
  required: true;
1329
1330
  } & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
1330
- export declare function defineModel<T, M extends string | number | symbol = string>(options: {
1331
+ export declare function defineModel<T, M extends PropertyKey = string>(options: {
1331
1332
  default: any;
1332
1333
  } & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
1333
- export declare function defineModel<T, M extends string | number | symbol = string>(options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
1334
- export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options: {
1334
+ export declare function defineModel<T, M extends PropertyKey = string>(options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
1335
+ export declare function defineModel<T, M extends PropertyKey = string>(name: string, options: {
1335
1336
  required: true;
1336
1337
  } & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
1337
- export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options: {
1338
+ export declare function defineModel<T, M extends PropertyKey = string>(name: string, options: {
1338
1339
  default: any;
1339
1340
  } & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
1340
- export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
1341
+ export declare function defineModel<T, M extends PropertyKey = string>(name: string, options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
1341
1342
  type NotUndefined<T> = T extends undefined ? never : T;
1342
1343
  type MappedOmit<T, K extends keyof any> = {
1343
1344
  [P in keyof T as P extends K ? never : P]: T[P];
@@ -1376,7 +1377,7 @@ export declare function withDefaults<T, BKeys extends keyof T, Defaults extends
1376
1377
  export declare function useSlots(): SetupContext['slots'];
1377
1378
  export declare function useAttrs(): SetupContext['attrs'];
1378
1379
 
1379
- export declare function useModel<M extends string | number | symbol, T extends Record<string, any>, K extends keyof T>(props: T, name: K, options?: DefineModelOptions<T[K]>): ModelRef<T[K], M>;
1380
+ 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>;
1380
1381
 
1381
1382
  type RawProps = VNodeProps & {
1382
1383
  __v_isVNode?: never;
@@ -1520,7 +1521,7 @@ export declare function renderList<T>(source: Iterable<T>, renderItem: (value: T
1520
1521
  /**
1521
1522
  * v-for object
1522
1523
  */
1523
- export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: K, index: number) => VNodeChild): VNodeChild[];
1524
+ export declare function renderList<T>(source: T, renderItem: <K extends keyof T>(value: T[K], key: string, index: number) => VNodeChild): VNodeChild[];
1524
1525
 
1525
1526
  /**
1526
1527
  * For prefixing keys in v-on="obj" with "on"
@@ -1580,8 +1581,8 @@ export type LegacyConfig = {
1580
1581
 
1581
1582
  type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties;
1582
1583
  interface LegacyPublicProperties {
1583
- $set(target: object, key: string, value: any): void;
1584
- $delete(target: object, key: string): void;
1584
+ $set<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K, value: T[K]): void;
1585
+ $delete<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K): void;
1585
1586
  $mount(el?: string | Element): this;
1586
1587
  $destroy(): void;
1587
1588
  $scopedSlots: Slots;
@@ -1618,11 +1619,11 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
1618
1619
  /**
1619
1620
  * @deprecated Vue 3 no longer needs set() for adding new properties.
1620
1621
  */
1621
- set(target: any, key: string | number | symbol, value: any): void;
1622
+ set(target: any, key: PropertyKey, value: any): void;
1622
1623
  /**
1623
1624
  * @deprecated Vue 3 no longer needs delete() for property deletions.
1624
1625
  */
1625
- delete(target: any, key: string | number | symbol): void;
1626
+ delete(target: any, key: PropertyKey): void;
1626
1627
  /**
1627
1628
  * @deprecated use `reactive` instead.
1628
1629
  */