@vue/runtime-core 3.5.0-beta.1 → 3.5.0-beta.3

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
1
  /**
2
- * @vue/runtime-core v3.5.0-beta.1
2
+ * @vue/runtime-core v3.5.0-beta.3
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -19,12 +19,6 @@ const ErrorCodes = {
19
19
  "0": "SETUP_FUNCTION",
20
20
  "RENDER_FUNCTION": 1,
21
21
  "1": "RENDER_FUNCTION",
22
- "WATCH_GETTER": 2,
23
- "2": "WATCH_GETTER",
24
- "WATCH_CALLBACK": 3,
25
- "3": "WATCH_CALLBACK",
26
- "WATCH_CLEANUP": 4,
27
- "4": "WATCH_CLEANUP",
28
22
  "NATIVE_EVENT_HANDLER": 5,
29
23
  "5": "NATIVE_EVENT_HANDLER",
30
24
  "COMPONENT_EVENT_HANDLER": 6,
@@ -161,7 +155,7 @@ function nextTick(fn) {
161
155
  return fn ? p.then(this ? fn.bind(this) : fn) : p;
162
156
  }
163
157
  function findInsertionIndex(id) {
164
- let start = flushIndex + 1;
158
+ let start = isFlushing ? flushIndex + 1 : 0;
165
159
  let end = queue.length;
166
160
  while (start < end) {
167
161
  const middle = start + end >>> 1;
@@ -177,15 +171,13 @@ function findInsertionIndex(id) {
177
171
  }
178
172
  function queueJob(job) {
179
173
  if (!(job.flags & 1)) {
180
- if (job.id == null) {
181
- queue.push(job);
182
- } else if (
183
- // fast path when the job id is larger than the tail
184
- !(job.flags & 2) && job.id >= (queue[queue.length - 1] && queue[queue.length - 1].id || 0)
185
- ) {
174
+ const jobId = getId(job);
175
+ const lastJob = queue[queue.length - 1];
176
+ if (!lastJob || // fast path when the job id is larger than the tail
177
+ !(job.flags & 2) && jobId >= getId(lastJob)) {
186
178
  queue.push(job);
187
179
  } else {
188
- queue.splice(findInsertionIndex(job.id), 0, job);
180
+ queue.splice(findInsertionIndex(jobId), 0, job);
189
181
  }
190
182
  if (!(job.flags & 4)) {
191
183
  job.flags |= 1;
@@ -199,12 +191,6 @@ function queueFlush() {
199
191
  currentFlushPromise = resolvedPromise.then(flushJobs);
200
192
  }
201
193
  }
202
- function invalidateJob(job) {
203
- const i = queue.indexOf(job);
204
- if (i > flushIndex) {
205
- queue.splice(i, 1);
206
- }
207
- }
208
194
  function queuePostFlushCb(cb) {
209
195
  if (!shared.isArray(cb)) {
210
196
  if (activePostFlushCbs && cb.id === -1) {
@@ -254,21 +240,10 @@ function flushPostFlushCbs(seen) {
254
240
  postFlushIndex = 0;
255
241
  }
256
242
  }
257
- const getId = (job) => job.id == null ? Infinity : job.id;
258
- const comparator = (a, b) => {
259
- const diff = getId(a) - getId(b);
260
- if (diff === 0) {
261
- const isAPre = a.flags & 2;
262
- const isBPre = b.flags & 2;
263
- if (isAPre && !isBPre) return -1;
264
- if (isBPre && !isAPre) return 1;
265
- }
266
- return diff;
267
- };
243
+ const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
268
244
  function flushJobs(seen) {
269
245
  isFlushPending = false;
270
246
  isFlushing = true;
271
- queue.sort(comparator);
272
247
  try {
273
248
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
274
249
  const job = queue[flushIndex];
@@ -352,7 +327,7 @@ function withDirectives(vnode, directives) {
352
327
  };
353
328
  }
354
329
  if (dir.deep) {
355
- traverse(value);
330
+ reactivity.traverse(value);
356
331
  }
357
332
  bindings.push({
358
333
  dir,
@@ -1118,6 +1093,7 @@ const logMismatchError = () => {
1118
1093
  const isSVGContainer = (container) => container.namespaceURI.includes("svg") && container.tagName !== "foreignObject";
1119
1094
  const isMathMLContainer = (container) => container.namespaceURI.includes("MathML");
1120
1095
  const getContainerType = (container) => {
1096
+ if (container.nodeType !== 1) return void 0;
1121
1097
  if (isSVGContainer(container)) return "svg";
1122
1098
  if (isMathMLContainer(container)) return "mathml";
1123
1099
  return void 0;
@@ -1864,7 +1840,7 @@ const KeepAliveImpl = {
1864
1840
  function pruneCache(filter) {
1865
1841
  cache.forEach((vnode, key) => {
1866
1842
  const name = getComponentName(vnode.type);
1867
- if (name && (!filter || !filter(name))) {
1843
+ if (name && !filter(name)) {
1868
1844
  pruneCacheEntry(key);
1869
1845
  }
1870
1846
  });
@@ -1980,6 +1956,7 @@ function matches(pattern, name) {
1980
1956
  } else if (shared.isString(pattern)) {
1981
1957
  return pattern.split(",").includes(name);
1982
1958
  } else if (shared.isRegExp(pattern)) {
1959
+ pattern.lastIndex = 0;
1983
1960
  return pattern.test(name);
1984
1961
  }
1985
1962
  return false;
@@ -2640,14 +2617,18 @@ function callHook(hook, instance, type) {
2640
2617
  );
2641
2618
  }
2642
2619
  function createWatcher(raw, ctx, publicThis, key) {
2643
- const getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
2620
+ let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key];
2644
2621
  if (shared.isString(raw)) {
2645
2622
  const handler = ctx[raw];
2646
2623
  if (shared.isFunction(handler)) {
2647
- watch(getter, handler);
2624
+ {
2625
+ watch(getter, handler);
2626
+ }
2648
2627
  }
2649
2628
  } else if (shared.isFunction(raw)) {
2650
- watch(getter, raw.bind(publicThis));
2629
+ {
2630
+ watch(getter, raw.bind(publicThis));
2631
+ }
2651
2632
  } else if (shared.isObject(raw)) {
2652
2633
  if (shared.isArray(raw)) {
2653
2634
  raw.forEach((r) => createWatcher(r, ctx, publicThis, key));
@@ -3581,7 +3562,7 @@ function baseCreateRenderer(options, createHydrationFns) {
3581
3562
  }
3582
3563
  if (parentComponent) {
3583
3564
  let subTree = parentComponent.subTree;
3584
- if (vnode === subTree) {
3565
+ if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) {
3585
3566
  const parentVNode = parentComponent.vnode;
3586
3567
  setScopeId(
3587
3568
  el,
@@ -3879,7 +3860,6 @@ function baseCreateRenderer(options, createHydrationFns) {
3879
3860
  return;
3880
3861
  } else {
3881
3862
  instance.next = n2;
3882
- invalidateJob(instance.update);
3883
3863
  instance.update();
3884
3864
  }
3885
3865
  } else {
@@ -4689,169 +4669,57 @@ function watchSyncEffect(effect, options) {
4689
4669
  { flush: "sync" }
4690
4670
  );
4691
4671
  }
4692
- const INITIAL_WATCHER_VALUE = {};
4693
4672
  function watch(source, cb, options) {
4694
4673
  return doWatch(source, cb, options);
4695
4674
  }
4696
- function doWatch(source, cb, {
4697
- immediate,
4698
- deep,
4699
- flush,
4700
- once,
4701
- onTrack,
4702
- onTrigger
4703
- } = shared.EMPTY_OBJ) {
4704
- if (cb && once) {
4705
- const _cb = cb;
4706
- cb = (...args) => {
4707
- _cb(...args);
4708
- watchHandle();
4709
- };
4710
- }
4711
- const instance = currentInstance;
4712
- const reactiveGetter = (source2) => {
4713
- if (deep) return source2;
4714
- if (reactivity.isShallow(source2) || deep === false || deep === 0)
4715
- return traverse(source2, 1);
4716
- return traverse(source2);
4717
- };
4718
- let getter;
4719
- let forceTrigger = false;
4720
- let isMultiSource = false;
4721
- if (reactivity.isRef(source)) {
4722
- getter = () => source.value;
4723
- forceTrigger = reactivity.isShallow(source);
4724
- } else if (reactivity.isReactive(source)) {
4725
- getter = () => reactiveGetter(source);
4726
- forceTrigger = true;
4727
- } else if (shared.isArray(source)) {
4728
- isMultiSource = true;
4729
- forceTrigger = source.some((s) => reactivity.isReactive(s) || reactivity.isShallow(s));
4730
- getter = () => source.map((s) => {
4731
- if (reactivity.isRef(s)) {
4732
- return s.value;
4733
- } else if (reactivity.isReactive(s)) {
4734
- return reactiveGetter(s);
4735
- } else if (shared.isFunction(s)) {
4736
- return callWithErrorHandling(s, instance, 2);
4737
- } else ;
4738
- });
4739
- } else if (shared.isFunction(source)) {
4740
- if (cb) {
4741
- getter = () => callWithErrorHandling(source, instance, 2);
4742
- } else {
4743
- getter = () => {
4744
- if (cleanup) {
4745
- cleanup();
4746
- }
4747
- return callWithAsyncErrorHandling(
4748
- source,
4749
- instance,
4750
- 3,
4751
- [onCleanup]
4752
- );
4753
- };
4754
- }
4755
- } else {
4756
- getter = shared.NOOP;
4757
- }
4758
- if (cb && deep) {
4759
- const baseGetter = getter;
4760
- const depth = deep === true ? Infinity : deep;
4761
- getter = () => traverse(baseGetter(), depth);
4762
- }
4763
- let cleanup;
4764
- let onCleanup = (fn) => {
4765
- cleanup = effect.onStop = () => {
4766
- callWithErrorHandling(fn, instance, 4);
4767
- cleanup = effect.onStop = void 0;
4768
- };
4769
- };
4675
+ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
4676
+ const { immediate, deep, flush, once } = options;
4677
+ const baseWatchOptions = shared.extend({}, options);
4770
4678
  let ssrCleanup;
4771
4679
  if (isInSSRComponentSetup) {
4772
- onCleanup = shared.NOOP;
4773
- if (!cb) {
4774
- getter();
4775
- } else if (immediate) {
4776
- callWithAsyncErrorHandling(cb, instance, 3, [
4777
- getter(),
4778
- isMultiSource ? [] : void 0,
4779
- onCleanup
4780
- ]);
4781
- }
4782
4680
  if (flush === "sync") {
4783
4681
  const ctx = useSSRContext();
4784
4682
  ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4683
+ } else if (!cb || immediate) {
4684
+ baseWatchOptions.once = true;
4785
4685
  } else {
4786
- const watchHandle2 = () => {
4686
+ return {
4687
+ stop: shared.NOOP,
4688
+ resume: shared.NOOP,
4689
+ pause: shared.NOOP
4787
4690
  };
4788
- watchHandle2.stop = shared.NOOP;
4789
- watchHandle2.resume = shared.NOOP;
4790
- watchHandle2.pause = shared.NOOP;
4791
- return watchHandle2;
4792
4691
  }
4793
4692
  }
4794
- let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
4795
- const job = (immediateFirstRun) => {
4796
- if (!(effect.flags & 1) || !effect.dirty && !immediateFirstRun) {
4797
- return;
4798
- }
4799
- if (cb) {
4800
- const newValue = effect.run();
4801
- if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => shared.hasChanged(v, oldValue[i])) : shared.hasChanged(newValue, oldValue)) || false) {
4802
- if (cleanup) {
4803
- cleanup();
4804
- }
4805
- callWithAsyncErrorHandling(cb, instance, 3, [
4806
- newValue,
4807
- // pass undefined as the old value when it's changed for the first time
4808
- oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue,
4809
- onCleanup
4810
- ]);
4811
- oldValue = newValue;
4693
+ const instance = currentInstance;
4694
+ baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args);
4695
+ let isPre = false;
4696
+ if (flush === "post") {
4697
+ baseWatchOptions.scheduler = (job) => {
4698
+ queuePostRenderEffect(job, instance && instance.suspense);
4699
+ };
4700
+ } else if (flush !== "sync") {
4701
+ isPre = true;
4702
+ baseWatchOptions.scheduler = (job, isFirstRun) => {
4703
+ if (isFirstRun) {
4704
+ job();
4705
+ } else {
4706
+ queueJob(job);
4812
4707
  }
4813
- } else {
4814
- effect.run();
4815
- }
4816
- };
4817
- if (cb) job.flags |= 4;
4818
- const effect = new reactivity.ReactiveEffect(getter);
4819
- let scheduler;
4820
- if (flush === "sync") {
4821
- effect.flags |= 64;
4822
- scheduler = job;
4823
- } else if (flush === "post") {
4824
- scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
4825
- } else {
4826
- job.flags |= 2;
4827
- if (instance) job.id = instance.uid;
4828
- scheduler = () => queueJob(job);
4708
+ };
4829
4709
  }
4830
- effect.scheduler = scheduler;
4831
- const scope = reactivity.getCurrentScope();
4832
- const watchHandle = () => {
4833
- effect.stop();
4834
- if (scope) {
4835
- shared.remove(scope.effects, effect);
4710
+ baseWatchOptions.augmentJob = (job) => {
4711
+ if (cb) {
4712
+ job.flags |= 4;
4836
4713
  }
4837
- };
4838
- watchHandle.pause = effect.pause.bind(effect);
4839
- watchHandle.resume = effect.resume.bind(effect);
4840
- watchHandle.stop = watchHandle;
4841
- if (cb) {
4842
- if (immediate) {
4843
- job(true);
4844
- } else {
4845
- oldValue = effect.run();
4714
+ if (isPre) {
4715
+ job.flags |= 2;
4716
+ if (instance) {
4717
+ job.id = instance.uid;
4718
+ job.i = instance;
4719
+ }
4846
4720
  }
4847
- } else if (flush === "post") {
4848
- queuePostRenderEffect(
4849
- effect.run.bind(effect),
4850
- instance && instance.suspense
4851
- );
4852
- } else {
4853
- effect.run();
4854
- }
4721
+ };
4722
+ const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
4855
4723
  if (ssrCleanup) ssrCleanup.push(watchHandle);
4856
4724
  return watchHandle;
4857
4725
  }
@@ -4880,38 +4748,6 @@ function createPathGetter(ctx, path) {
4880
4748
  return cur;
4881
4749
  };
4882
4750
  }
4883
- function traverse(value, depth = Infinity, seen) {
4884
- if (depth <= 0 || !shared.isObject(value) || value["__v_skip"]) {
4885
- return value;
4886
- }
4887
- seen = seen || /* @__PURE__ */ new Set();
4888
- if (seen.has(value)) {
4889
- return value;
4890
- }
4891
- seen.add(value);
4892
- depth--;
4893
- if (reactivity.isRef(value)) {
4894
- traverse(value.value, depth, seen);
4895
- } else if (shared.isArray(value)) {
4896
- for (let i = 0; i < value.length; i++) {
4897
- traverse(value[i], depth, seen);
4898
- }
4899
- } else if (shared.isSet(value) || shared.isMap(value)) {
4900
- value.forEach((v) => {
4901
- traverse(v, depth, seen);
4902
- });
4903
- } else if (shared.isPlainObject(value)) {
4904
- for (const key in value) {
4905
- traverse(value[key], depth, seen);
4906
- }
4907
- for (const key of Object.getOwnPropertySymbols(value)) {
4908
- if (Object.prototype.propertyIsEnumerable.call(value, key)) {
4909
- traverse(value[key], depth, seen);
4910
- }
4911
- }
4912
- }
4913
- return value;
4914
- }
4915
4751
 
4916
4752
  function useModel(props, name, options = shared.EMPTY_OBJ) {
4917
4753
  const i = getCurrentInstance();
@@ -6539,7 +6375,7 @@ function isMemoSame(cached, memo) {
6539
6375
  return true;
6540
6376
  }
6541
6377
 
6542
- const version = "3.5.0-beta.1";
6378
+ const version = "3.5.0-beta.3";
6543
6379
  const warn$1 = shared.NOOP;
6544
6380
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
6545
6381
  const devtools = void 0;
@@ -6567,6 +6403,7 @@ exports.customRef = reactivity.customRef;
6567
6403
  exports.effect = reactivity.effect;
6568
6404
  exports.effectScope = reactivity.effectScope;
6569
6405
  exports.getCurrentScope = reactivity.getCurrentScope;
6406
+ exports.getCurrentWatcher = reactivity.getCurrentWatcher;
6570
6407
  exports.isProxy = reactivity.isProxy;
6571
6408
  exports.isReactive = reactivity.isReactive;
6572
6409
  exports.isReadonly = reactivity.isReadonly;
@@ -6574,6 +6411,7 @@ exports.isRef = reactivity.isRef;
6574
6411
  exports.isShallow = reactivity.isShallow;
6575
6412
  exports.markRaw = reactivity.markRaw;
6576
6413
  exports.onScopeDispose = reactivity.onScopeDispose;
6414
+ exports.onWatcherCleanup = reactivity.onWatcherCleanup;
6577
6415
  exports.proxyRefs = reactivity.proxyRefs;
6578
6416
  exports.reactive = reactivity.reactive;
6579
6417
  exports.readonly = reactivity.readonly;
@@ -1,5 +1,5 @@
1
- import { computed as computed$1, Ref, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, ReactiveEffect, ComputedRef, DebuggerOptions, ReactiveMarker, ShallowRef, 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';
1
+ import { computed as computed$1, Ref, WatchStopHandle, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, ReactiveEffect, ComputedRef, DebuggerOptions, WatchHandle, ReactiveMarker, ShallowRef, WatchErrorCodes, 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, WatchHandle, WatchStopHandle, WritableComputedOptions, WritableComputedRef, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
3
3
  import { IfAny, Prettify, Awaited, LooseRequired, UnionToIntersection, OverloadParameters } from '@vue/shared';
4
4
  export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
5
5
 
@@ -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 ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
337
+ readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: 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
  };
@@ -367,7 +367,7 @@ export type EmitsOptions = ObjectEmitsOptions | string[];
367
367
  export type EmitsToProps<T extends EmitsOptions | ComponentTypeEmits> = T extends string[] ? {
368
368
  [K in `on${Capitalize<T[number]>}`]?: (...args: any[]) => any;
369
369
  } : T extends ObjectEmitsOptions ? {
370
- [K in `on${Capitalize<string & keyof T>}`]?: K extends `on${infer C}` ? (...args: T[Uncapitalize<C>] extends (...args: infer P) => any ? P : T[Uncapitalize<C>] extends null ? any[] : never) => any : never;
370
+ [K in string & keyof T as `on${Capitalize<K>}`]?: (...args: T[K] extends (...args: infer P) => any ? P : T[K] extends null ? any[] : never) => any;
371
371
  } : {};
372
372
  type TypeEmitsToOptions<T extends ComponentTypeEmits> = T extends Record<string, any[]> ? {
373
373
  [K in keyof T]: T[K] extends [...args: infer Args] ? (...args: Args) => any : () => any;
@@ -434,7 +434,7 @@ export declare function withDirectives<T extends VNode>(vnode: T, directives: Di
434
434
  * import { createApp } from 'vue'
435
435
  * import { Router, createRouter } from 'vue-router'
436
436
  *
437
- * declare module '@vue/runtime-core' {
437
+ * declare module 'vue' {
438
438
  * interface ComponentCustomProperties {
439
439
  * $router: Router
440
440
  * }
@@ -790,7 +790,7 @@ declare function configureCompat(config: CompatConfig): void;
790
790
  *
791
791
  * @example
792
792
  * ```ts
793
- * declare module '@vue/runtime-core' {
793
+ * declare module 'vue' {
794
794
  * interface ComponentCustomOptions {
795
795
  * beforeRouteUpdate?(
796
796
  * to: Route,
@@ -1479,15 +1479,9 @@ export interface WatchOptions<Immediate = boolean> extends WatchOptionsBase {
1479
1479
  deep?: boolean | number;
1480
1480
  once?: boolean;
1481
1481
  }
1482
- export type WatchStopHandle = () => void;
1483
- export interface WatchHandle extends WatchStopHandle {
1484
- pause: () => void;
1485
- resume: () => void;
1486
- stop: () => void;
1487
- }
1488
1482
  export declare function watchEffect(effect: WatchEffect, options?: WatchOptionsBase): WatchHandle;
1489
- export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
1490
- export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchStopHandle;
1483
+ export declare function watchPostEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle;
1484
+ export declare function watchSyncEffect(effect: WatchEffect, options?: DebuggerOptions): WatchHandle;
1491
1485
  export type MultiWatchSources = (WatchSource<unknown> | object)[];
1492
1486
  export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, MaybeUndefined<T, Immediate>>, options?: WatchOptions<Immediate>): WatchHandle;
1493
1487
  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;
@@ -1583,9 +1577,6 @@ declare function warn$1(msg: string, ...args: any[]): void;
1583
1577
  export declare enum ErrorCodes {
1584
1578
  SETUP_FUNCTION = 0,
1585
1579
  RENDER_FUNCTION = 1,
1586
- WATCH_GETTER = 2,
1587
- WATCH_CALLBACK = 3,
1588
- WATCH_CLEANUP = 4,
1589
1580
  NATIVE_EVENT_HANDLER = 5,
1590
1581
  COMPONENT_EVENT_HANDLER = 6,
1591
1582
  VNODE_HOOK = 7,
@@ -1599,7 +1590,7 @@ export declare enum ErrorCodes {
1599
1590
  COMPONENT_UPDATE = 15,
1600
1591
  APP_UNMOUNT_CLEANUP = 16
1601
1592
  }
1602
- type ErrorTypes = LifecycleHooks | ErrorCodes;
1593
+ type ErrorTypes = LifecycleHooks | ErrorCodes | WatchErrorCodes;
1603
1594
  export declare function callWithErrorHandling(fn: Function, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, args?: unknown[]): any;
1604
1595
  export declare function callWithAsyncErrorHandling(fn: Function | Function[], instance: ComponentInternalInstance | null, type: ErrorTypes, args?: unknown[]): any;
1605
1596
  export declare function handleError(err: unknown, instance: ComponentInternalInstance | null | undefined, type: ErrorTypes, throwInDev?: boolean): void;