@cabloy/vue-runtime-core 3.4.31 → 3.4.33

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
 
@@ -165,7 +165,6 @@ declare const SuspenseImpl: {
165
165
  __isSuspense: boolean;
166
166
  process(n1: VNode | null, n2: VNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals): void;
167
167
  hydrate: typeof hydrateSuspense;
168
- create: typeof createSuspenseBoundary;
169
168
  normalize: typeof normalizeSuspenseChildren;
170
169
  };
171
170
  export declare const Suspense: {
@@ -198,10 +197,9 @@ export interface SuspenseBoundary {
198
197
  fallback(fallbackVNode: VNode): void;
199
198
  move(container: RendererElement, anchor: RendererNode | null, type: MoveType): void;
200
199
  next(): RendererNode | null;
201
- registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn): void;
200
+ registerDep(instance: ComponentInternalInstance, setupRenderEffect: SetupRenderEffectFn, optimized: boolean): void;
202
201
  unmount(parentSuspense: SuspenseBoundary | null, doRemove?: boolean): void;
203
202
  }
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;
205
203
  declare function hydrateSuspense(node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, rendererInternals: RendererInternals, hydrateNode: (node: Node, vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, slotScopeIds: string[] | null, optimized: boolean) => Node | null): Node | null;
206
204
  declare function normalizeSuspenseChildren(vnode: VNode): void;
207
205
 
@@ -268,7 +266,7 @@ export declare const BaseTransition: new () => {
268
266
  default(): VNode[];
269
267
  };
270
268
  };
271
- export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance): TransitionHooks;
269
+ export declare function resolveTransitionHooks(vnode: VNode, props: BaseTransitionProps<any>, state: TransitionState, instance: ComponentInternalInstance, postClone?: (hooks: TransitionHooks) => void): TransitionHooks;
272
270
  export declare function setTransitionHooks(vnode: VNode, hooks: TransitionHooks): void;
273
271
  export declare function getTransitionRawChildren(children: VNode[], keepComment?: boolean, parentKey?: VNode['key']): VNode[];
274
272
 
@@ -488,7 +486,7 @@ return withDirectives(h(comp), [
488
486
  */
489
487
 
490
488
  export interface DirectiveBinding<V = any> {
491
- instance: ComponentPublicInstance | null;
489
+ instance: ComponentPublicInstance | Record<string, any> | null;
492
490
  value: V;
493
491
  oldValue: V | null;
494
492
  arg?: string;
@@ -772,7 +770,7 @@ export interface App<HostElement = any> {
772
770
  directive<T = any, V = any>(name: string, directive: Directive<T, V>): this;
773
771
  mount(rootContainer: HostElement | string, isHydrate?: boolean, namespace?: boolean | ElementNamespace): ComponentPublicInstance;
774
772
  unmount(): void;
775
- provide<T>(key: InjectionKey<T> | string, value: T): this;
773
+ provide<T, K = InjectionKey<T> | string | number>(key: K, value: K extends InjectionKey<infer V> ? V : T): this;
776
774
  /**
777
775
  * Runs a function with the app as active instance. This allows using of `inject()` within the function to get access
778
776
  * to variables provided via `app.provide()`.
@@ -840,7 +838,7 @@ declare const TeleportImpl: {
840
838
  name: string;
841
839
  __isTeleport: boolean;
842
840
  process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, namespace: ElementNamespace, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
843
- remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
841
+ remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
844
842
  move: typeof moveTeleport;
845
843
  hydrate: typeof hydrateTeleport;
846
844
  };
@@ -896,7 +894,7 @@ type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAtom[];
896
894
  type VNodeMountHook = (vnode: VNode) => void;
897
895
  type VNodeUpdateHook = (vnode: VNode, oldVNode: VNode) => void;
898
896
  export type VNodeProps = {
899
- key?: string | number | symbol;
897
+ key?: PropertyKey;
900
898
  ref?: VNodeRef;
901
899
  ref_for?: boolean;
902
900
  ref_key?: string;
@@ -916,7 +914,7 @@ export interface VNode<HostNode = RendererNode, HostElement = RendererElement, E
916
914
  }> {
917
915
  type: VNodeTypes;
918
916
  props: (VNodeProps & ExtraProps) | null;
919
- key: string | number | symbol | null;
917
+ key: PropertyKey | null;
920
918
  ref: VNodeNormalizedRef | null;
921
919
  /**
922
920
  * SFC only. This is assigned on vnode creation using currentScopeId
@@ -1022,7 +1020,7 @@ type Data = Record<string, unknown>;
1022
1020
  * the usage of `InstanceType<typeof Comp>` which only works for
1023
1021
  * constructor-based component definition types.
1024
1022
  *
1025
- * Exmaple:
1023
+ * @example
1026
1024
  * ```ts
1027
1025
  * const MyComp = { ... }
1028
1026
  * declare const instance: ComponentInstance<typeof MyComp>
@@ -1087,7 +1085,7 @@ export type SetupContext<E = EmitsOptions, S extends SlotsType = {}> = E extends
1087
1085
  attrs: Data;
1088
1086
  slots: UnwrapSlotsType<S>;
1089
1087
  emit: EmitFn<E>;
1090
- expose: (exposed?: Record<string, any>) => void;
1088
+ expose: <Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed) => void;
1091
1089
  } : never;
1092
1090
  /**
1093
1091
  * We expose a subset of properties on the internal instance as they are
@@ -1142,8 +1140,9 @@ export declare const isRuntimeOnly: () => boolean;
1142
1140
  export type WatchEffect = (onCleanup: OnCleanup) => void;
1143
1141
  export type WatchSource<T = any> = Ref<T> | ComputedRef<T> | (() => T);
1144
1142
  export type WatchCallback<V = any, OV = any> = (value: V, oldValue: OV, onCleanup: OnCleanup) => any;
1143
+ type MaybeUndefined<T, I> = I extends true ? T | undefined : T;
1145
1144
  type MapSources<T, Immediate> = {
1146
- [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;
1145
+ [K in keyof T]: T[K] extends WatchSource<infer V> ? MaybeUndefined<V, Immediate> : T[K] extends object ? MaybeUndefined<T[K], Immediate> : never;
1147
1146
  };
1148
1147
  type OnCleanup = (cleanupFn: () => void) => void;
1149
1148
  export interface WatchOptionsBase extends DebuggerOptions {
@@ -1159,10 +1158,10 @@ export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsB
1159
1158
  export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
1160
1159
  export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
1161
1160
  type MultiWatchSources = (WatchSource<unknown> | object)[];
1162
- 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;
1161
+ export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
1162
+ 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;
1163
1163
  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;
1164
- 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;
1165
- 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
+ export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchStopHandle;
1166
1165
 
1167
1166
  type AsyncComponentResolveResult<T = Component> = T | {
1168
1167
  default: T;
@@ -1237,7 +1236,7 @@ type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends
1237
1236
  * const emit = defineEmits<{
1238
1237
  * // <eventName>: <expected arguments>
1239
1238
  * change: []
1240
- * update: [value: string] // named tuple syntax
1239
+ * update: [value: number] // named tuple syntax
1241
1240
  * }>()
1242
1241
  *
1243
1242
  * emit('change')
@@ -1284,7 +1283,7 @@ export declare function defineOptions<RawBindings = {}, D = {}, C extends Comput
1284
1283
  slots?: undefined;
1285
1284
  }): void;
1286
1285
  export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
1287
- export type ModelRef<T, M extends string | number | symbol = string> = Ref<T> & [
1286
+ export type ModelRef<T, M extends PropertyKey = string> = Ref<T> & [
1288
1287
  ModelRef<T, M>,
1289
1288
  Record<M, true | undefined>
1290
1289
  ];
@@ -1325,20 +1324,20 @@ type DefineModelOptions<T = any> = {
1325
1324
  * const count = defineModel<number>('count', { default: 0 })
1326
1325
  * ```
1327
1326
  */
1328
- export declare function defineModel<T, M extends string | number | symbol = string>(options: {
1327
+ export declare function defineModel<T, M extends PropertyKey = string>(options: {
1329
1328
  required: true;
1330
1329
  } & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
1331
- export declare function defineModel<T, M extends string | number | symbol = string>(options: {
1330
+ export declare function defineModel<T, M extends PropertyKey = string>(options: {
1332
1331
  default: any;
1333
1332
  } & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
1334
- export declare function defineModel<T, M extends string | number | symbol = string>(options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
1335
- export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options: {
1333
+ export declare function defineModel<T, M extends PropertyKey = string>(options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
1334
+ export declare function defineModel<T, M extends PropertyKey = string>(name: string, options: {
1336
1335
  required: true;
1337
1336
  } & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
1338
- export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options: {
1337
+ export declare function defineModel<T, M extends PropertyKey = string>(name: string, options: {
1339
1338
  default: any;
1340
1339
  } & PropOptions<T> & DefineModelOptions<T>): ModelRef<T, M>;
1341
- export declare function defineModel<T, M extends string | number | symbol = string>(name: string, options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
1340
+ export declare function defineModel<T, M extends PropertyKey = string>(name: string, options?: PropOptions<T> & DefineModelOptions<T>): ModelRef<T | undefined, M>;
1342
1341
  type NotUndefined<T> = T extends undefined ? never : T;
1343
1342
  type MappedOmit<T, K extends keyof any> = {
1344
1343
  [P in keyof T as P extends K ? never : P]: T[P];
@@ -1377,7 +1376,7 @@ export declare function withDefaults<T, BKeys extends keyof T, Defaults extends
1377
1376
  export declare function useSlots(): SetupContext['slots'];
1378
1377
  export declare function useAttrs(): SetupContext['attrs'];
1379
1378
 
1380
- 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>;
1379
+ 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>;
1381
1380
 
1382
1381
  type RawProps = VNodeProps & {
1383
1382
  __v_isVNode?: never;
@@ -1581,8 +1580,8 @@ export type LegacyConfig = {
1581
1580
 
1582
1581
  type LegacyPublicInstance = ComponentPublicInstance & LegacyPublicProperties;
1583
1582
  interface LegacyPublicProperties {
1584
- $set(target: object, key: string, value: any): void;
1585
- $delete(target: object, key: string): void;
1583
+ $set<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K, value: T[K]): void;
1584
+ $delete<T extends Record<keyof any, any>, K extends keyof T>(target: T, key: K): void;
1586
1585
  $mount(el?: string | Element): this;
1587
1586
  $destroy(): void;
1588
1587
  $scopedSlots: Slots;
@@ -1619,11 +1618,11 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
1619
1618
  /**
1620
1619
  * @deprecated Vue 3 no longer needs set() for adding new properties.
1621
1620
  */
1622
- set(target: any, key: string | number | symbol, value: any): void;
1621
+ set(target: any, key: PropertyKey, value: any): void;
1623
1622
  /**
1624
1623
  * @deprecated Vue 3 no longer needs delete() for property deletions.
1625
1624
  */
1626
- delete(target: any, key: string | number | symbol): void;
1625
+ delete(target: any, key: PropertyKey): void;
1627
1626
  /**
1628
1627
  * @deprecated use `reactive` instead.
1629
1628
  */