@vueuse/shared 12.5.0 → 12.6.0

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/index.cjs CHANGED
@@ -9,13 +9,13 @@ function computedEager(fn, options) {
9
9
  result.value = fn();
10
10
  }, {
11
11
  ...options,
12
- flush: (_a = options == null ? undefined : options.flush) != null ? _a : "sync"
12
+ flush: (_a = options == null ? void 0 : options.flush) != null ? _a : "sync"
13
13
  });
14
14
  return vue.readonly(result);
15
15
  }
16
16
 
17
17
  function computedWithControl(source, fn) {
18
- let v = undefined;
18
+ let v = void 0;
19
19
  let track;
20
20
  let trigger;
21
21
  const dirty = vue.ref(true);
@@ -25,7 +25,7 @@ function computedWithControl(source, fn) {
25
25
  };
26
26
  vue.watch(source, update, { flush: "sync" });
27
27
  const get = typeof fn === "function" ? fn : fn.get;
28
- const set = typeof fn === "function" ? undefined : fn.set;
28
+ const set = typeof fn === "function" ? void 0 : fn.set;
29
29
  const result = vue.customRef((_track, _trigger) => {
30
30
  track = _track;
31
31
  trigger = _trigger;
@@ -39,7 +39,7 @@ function computedWithControl(source, fn) {
39
39
  return v;
40
40
  },
41
41
  set(v2) {
42
- set == null ? undefined : set(v2);
42
+ set == null ? void 0 : set(v2);
43
43
  }
44
44
  };
45
45
  });
@@ -101,7 +101,7 @@ const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
101
101
  const injectLocal = (...args) => {
102
102
  var _a;
103
103
  const key = args[0];
104
- const instance = (_a = vue.getCurrentInstance()) == null ? undefined : _a.proxy;
104
+ const instance = (_a = vue.getCurrentInstance()) == null ? void 0 : _a.proxy;
105
105
  if (instance == null && !vue.hasInjectionContext())
106
106
  throw new Error("injectLocal must be called in setup");
107
107
  if (instance && localProvidedStateMap.has(instance) && key in localProvidedStateMap.get(instance))
@@ -111,7 +111,7 @@ const injectLocal = (...args) => {
111
111
 
112
112
  const provideLocal = (key, value) => {
113
113
  var _a;
114
- const instance = (_a = vue.getCurrentInstance()) == null ? undefined : _a.proxy;
114
+ const instance = (_a = vue.getCurrentInstance()) == null ? void 0 : _a.proxy;
115
115
  if (instance == null)
116
116
  throw new Error("provideLocal must be called in setup");
117
117
  if (!localProvidedStateMap.has(instance))
@@ -122,8 +122,8 @@ const provideLocal = (key, value) => {
122
122
  };
123
123
 
124
124
  function createInjectionState(composable, options) {
125
- const key = (options == null ? undefined : options.injectionKey) || Symbol(composable.name || "InjectionState");
126
- const defaultValue = options == null ? undefined : options.defaultValue;
125
+ const key = (options == null ? void 0 : options.injectionKey) || Symbol(composable.name || "InjectionState");
126
+ const defaultValue = options == null ? void 0 : options.defaultValue;
127
127
  const useProvidingState = (...args) => {
128
128
  const state = composable(...args);
129
129
  provideLocal(key, state);
@@ -141,8 +141,8 @@ function createSharedComposable(composable) {
141
141
  subscribers -= 1;
142
142
  if (scope && subscribers <= 0) {
143
143
  scope.stop();
144
- state = undefined;
145
- scope = undefined;
144
+ state = void 0;
145
+ scope = void 0;
146
146
  }
147
147
  };
148
148
  return (...args) => {
@@ -209,7 +209,7 @@ function makeDestructurable(obj, arr) {
209
209
  }
210
210
 
211
211
  function reactify(fn, options) {
212
- const unrefFn = (options == null ? undefined : options.computedGetter) === false ? vue.unref : vue.toValue;
212
+ const unrefFn = (options == null ? void 0 : options.computedGetter) === false ? vue.unref : vue.toValue;
213
213
  return function(...args) {
214
214
  return vue.computed(() => fn.apply(this, args.map((i) => unrefFn(i))));
215
215
  };
@@ -305,7 +305,7 @@ const hasOwn = (val, key) => Object.prototype.hasOwnProperty.call(val, key);
305
305
  const isIOS = /* @__PURE__ */ getIsIOS();
306
306
  function getIsIOS() {
307
307
  var _a, _b;
308
- return isClient && ((_a = window == null ? undefined : window.navigator) == null ? undefined : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? undefined : window.navigator) == null ? undefined : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? undefined : window.navigator.userAgent));
308
+ return isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((_b = window == null ? void 0 : window.navigator) == null ? void 0 : _b.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
309
309
  }
310
310
 
311
311
  function createFilterWrapper(filter, fn) {
@@ -334,7 +334,7 @@ function debounceFilter(ms, options = {}) {
334
334
  const maxDuration = vue.toValue(options.maxWait);
335
335
  if (timer)
336
336
  _clearTimeout(timer);
337
- if (duration <= 0 || maxDuration !== undefined && maxDuration <= 0) {
337
+ if (duration <= 0 || maxDuration !== void 0 && maxDuration <= 0) {
338
338
  if (maxTimer) {
339
339
  _clearTimeout(maxTimer);
340
340
  maxTimer = null;
@@ -379,7 +379,7 @@ function throttleFilter(...args) {
379
379
  const clear = () => {
380
380
  if (timer) {
381
381
  clearTimeout(timer);
382
- timer = undefined;
382
+ timer = void 0;
383
383
  lastRejector();
384
384
  lastRejector = noop;
385
385
  }
@@ -416,8 +416,11 @@ function throttleFilter(...args) {
416
416
  };
417
417
  return filter;
418
418
  }
419
- function pausableFilter(extendFilter = bypassFilter) {
420
- const isActive = vue.ref(true);
419
+ function pausableFilter(extendFilter = bypassFilter, options = {}) {
420
+ const {
421
+ initialState = "active"
422
+ } = options;
423
+ const isActive = toRef(initialState === "active");
421
424
  function pause() {
422
425
  isActive.value = false;
423
426
  }
@@ -465,7 +468,7 @@ function createSingletonPromise(fn) {
465
468
  }
466
469
  wrapper.reset = async () => {
467
470
  const _prev = _promise;
468
- _promise = undefined;
471
+ _promise = void 0;
469
472
  if (_prev)
470
473
  await _prev;
471
474
  };
@@ -481,7 +484,7 @@ function increaseWithUnit(target, delta) {
481
484
  var _a;
482
485
  if (typeof target === "number")
483
486
  return target + delta;
484
- const value = ((_a = target.match(/^-?\d+\.?\d*/)) == null ? undefined : _a[0]) || "";
487
+ const value = ((_a = target.match(/^-?\d+\.?\d*/)) == null ? void 0 : _a[0]) || "";
485
488
  const unit = target.slice(value.length);
486
489
  const result = Number.parseFloat(value) + delta;
487
490
  if (Number.isNaN(result))
@@ -494,7 +497,7 @@ function pxValue(px) {
494
497
  function objectPick(obj, keys, omitUndefined = false) {
495
498
  return keys.reduce((n, k) => {
496
499
  if (k in obj) {
497
- if (!omitUndefined || obj[k] !== undefined)
500
+ if (!omitUndefined || obj[k] !== void 0)
498
501
  n[k] = obj[k];
499
502
  }
500
503
  return n;
@@ -502,7 +505,7 @@ function objectPick(obj, keys, omitUndefined = false) {
502
505
  }
503
506
  function objectOmit(obj, keys, omitUndefined = false) {
504
507
  return Object.fromEntries(Object.entries(obj).filter(([key, value]) => {
505
- return (!omitUndefined || value !== undefined) && !keys.includes(key);
508
+ return (!omitUndefined || value !== void 0) && !keys.includes(key);
506
509
  }));
507
510
  }
508
511
  function objectEntries(obj) {
@@ -627,10 +630,10 @@ function refWithControl(initial, options = {}) {
627
630
  if (value === source)
628
631
  return;
629
632
  const old = source;
630
- if (((_a = options.onBeforeChange) == null ? undefined : _a.call(options, value, old)) === false)
633
+ if (((_a = options.onBeforeChange) == null ? void 0 : _a.call(options, value, old)) === false)
631
634
  return;
632
635
  source = value;
633
- (_b = options.onChanged) == null ? undefined : _b.call(options, value, old);
636
+ (_b = options.onChanged) == null ? void 0 : _b.call(options, value, old);
634
637
  if (triggering)
635
638
  trigger();
636
639
  }
@@ -682,9 +685,10 @@ function watchWithFilter(source, cb, options = {}) {
682
685
  function watchPausable(source, cb, options = {}) {
683
686
  const {
684
687
  eventFilter: filter,
688
+ initialState = "active",
685
689
  ...watchOptions
686
690
  } = options;
687
- const { eventFilter, pause, resume, isActive } = pausableFilter(filter);
691
+ const { eventFilter, pause, resume, isActive } = pausableFilter(filter, { initialState });
688
692
  const stop = watchWithFilter(
689
693
  source,
690
694
  cb,
@@ -826,7 +830,7 @@ function createUntil(r, isNot = false) {
826
830
  if (stop)
827
831
  stop();
828
832
  else
829
- vue.nextTick(() => stop == null ? undefined : stop());
833
+ vue.nextTick(() => stop == null ? void 0 : stop());
830
834
  resolve(v);
831
835
  }
832
836
  },
@@ -840,7 +844,7 @@ function createUntil(r, isNot = false) {
840
844
  const promises = [watcher];
841
845
  if (timeout != null) {
842
846
  promises.push(
843
- promiseTimeout(timeout, throwOnTimeout).then(() => vue.toValue(r)).finally(() => stop == null ? undefined : stop())
847
+ promiseTimeout(timeout, throwOnTimeout).then(() => vue.toValue(r)).finally(() => stop == null ? void 0 : stop())
844
848
  );
845
849
  }
846
850
  return Promise.race(promises);
@@ -858,7 +862,7 @@ function createUntil(r, isNot = false) {
858
862
  if (stop)
859
863
  stop();
860
864
  else
861
- vue.nextTick(() => stop == null ? undefined : stop());
865
+ vue.nextTick(() => stop == null ? void 0 : stop());
862
866
  resolve(v1);
863
867
  }
864
868
  },
@@ -873,7 +877,7 @@ function createUntil(r, isNot = false) {
873
877
  if (timeout != null) {
874
878
  promises.push(
875
879
  promiseTimeout(timeout, throwOnTimeout).then(() => vue.toValue(r)).finally(() => {
876
- stop == null ? undefined : stop();
880
+ stop == null ? void 0 : stop();
877
881
  return vue.toValue(r);
878
882
  })
879
883
  );
@@ -887,7 +891,7 @@ function createUntil(r, isNot = false) {
887
891
  return toBe(null, options);
888
892
  }
889
893
  function toBeUndefined(options) {
890
- return toBe(undefined, options);
894
+ return toBe(void 0, options);
891
895
  }
892
896
  function toBeNaN(options) {
893
897
  return toMatch(Number.isNaN, options);
@@ -988,7 +992,7 @@ function findLast(arr, cb) {
988
992
  if (cb(arr[index], index, arr))
989
993
  return arr[index];
990
994
  }
991
- return undefined;
995
+ return void 0;
992
996
  }
993
997
  function useArrayFindLast(list, fn) {
994
998
  return vue.computed(() => vue.toValue(
@@ -1078,7 +1082,7 @@ function useCounter(initialValue = 0, options = {}) {
1078
1082
  }
1079
1083
 
1080
1084
  const REGEX_PARSE = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[T\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/i;
1081
- const REGEX_FORMAT = /[YMDHhms]o|\[([^\]]+)\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|SSS/g;
1085
+ const REGEX_FORMAT = /[YMDHhms]o|\[([^\]]+)\]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a{1,2}|A{1,2}|m{1,2}|s{1,2}|Z{1,2}|z{1,4}|SSS/g;
1082
1086
  function defaultMeridiem(hours, minutes, isLowercase, hasPeriod) {
1083
1087
  let m = hours < 12 ? "AM" : "PM";
1084
1088
  if (hasPeriod)
@@ -1101,6 +1105,10 @@ function formatDate(date, formatStr, options = {}) {
1101
1105
  const milliseconds = date.getMilliseconds();
1102
1106
  const day = date.getDay();
1103
1107
  const meridiem = (_a = options.customMeridiem) != null ? _a : defaultMeridiem;
1108
+ const stripTimeZone = (dateString) => {
1109
+ var _a2;
1110
+ return (_a2 = dateString.split(" ")[1]) != null ? _a2 : "";
1111
+ };
1104
1112
  const matches = {
1105
1113
  Yo: () => formatOrdinal(years),
1106
1114
  YY: () => String(years).slice(-2),
@@ -1133,17 +1141,21 @@ function formatDate(date, formatStr, options = {}) {
1133
1141
  A: () => meridiem(hours, minutes),
1134
1142
  AA: () => meridiem(hours, minutes, false, true),
1135
1143
  a: () => meridiem(hours, minutes, true),
1136
- aa: () => meridiem(hours, minutes, true, true)
1144
+ aa: () => meridiem(hours, minutes, true, true),
1145
+ z: () => stripTimeZone(date.toLocaleDateString(vue.toValue(options.locales), { timeZoneName: "shortOffset" })),
1146
+ zz: () => stripTimeZone(date.toLocaleDateString(vue.toValue(options.locales), { timeZoneName: "shortOffset" })),
1147
+ zzz: () => stripTimeZone(date.toLocaleDateString(vue.toValue(options.locales), { timeZoneName: "shortOffset" })),
1148
+ zzzz: () => stripTimeZone(date.toLocaleDateString(vue.toValue(options.locales), { timeZoneName: "longOffset" }))
1137
1149
  };
1138
1150
  return formatStr.replace(REGEX_FORMAT, (match, $1) => {
1139
1151
  var _a2, _b;
1140
- return (_b = $1 != null ? $1 : (_a2 = matches[match]) == null ? undefined : _a2.call(matches)) != null ? _b : match;
1152
+ return (_b = $1 != null ? $1 : (_a2 = matches[match]) == null ? void 0 : _a2.call(matches)) != null ? _b : match;
1141
1153
  });
1142
1154
  }
1143
1155
  function normalizeDate(date) {
1144
1156
  if (date === null)
1145
1157
  return new Date(Number.NaN);
1146
- if (date === undefined)
1158
+ if (date === void 0)
1147
1159
  return /* @__PURE__ */ new Date();
1148
1160
  if (date instanceof Date)
1149
1161
  return new Date(date);
@@ -1249,7 +1261,8 @@ function useLastChanged(source, options = {}) {
1249
1261
 
1250
1262
  function useTimeoutFn(cb, interval, options = {}) {
1251
1263
  const {
1252
- immediate = true
1264
+ immediate = true,
1265
+ immediateCallback = false
1253
1266
  } = options;
1254
1267
  const isPending = vue.ref(false);
1255
1268
  let timer = null;
@@ -1264,6 +1277,8 @@ function useTimeoutFn(cb, interval, options = {}) {
1264
1277
  clear();
1265
1278
  }
1266
1279
  function start(...args) {
1280
+ if (immediateCallback)
1281
+ cb();
1267
1282
  clear();
1268
1283
  isPending.value = true;
1269
1284
  timer = setTimeout(() => {
@@ -1352,7 +1367,7 @@ function useToggle(initialValue = false, options = {}) {
1352
1367
  }
1353
1368
 
1354
1369
  function watchArray(source, cb, options) {
1355
- let oldList = (options == null ? undefined : options.immediate) ? [] : [...source instanceof Function ? source() : Array.isArray(source) ? source : vue.toValue(source)];
1370
+ let oldList = (options == null ? void 0 : options.immediate) ? [] : [...source instanceof Function ? source() : Array.isArray(source) ? source : vue.toValue(source)];
1356
1371
  return vue.watch(source, (newList, _, onCleanup) => {
1357
1372
  const oldListRemains = Array.from({ length: oldList.length });
1358
1373
  const added = [];
@@ -1396,7 +1411,7 @@ function watchAtMost(source, cb, options) {
1396
1411
  function watchDebounced(source, cb, options = {}) {
1397
1412
  const {
1398
1413
  debounce = 0,
1399
- maxWait = undefined,
1414
+ maxWait = void 0,
1400
1415
  ...watchOptions
1401
1416
  } = options;
1402
1417
  return watchWithFilter(
@@ -1533,7 +1548,7 @@ function watchTriggerable(source, cb, options = {}) {
1533
1548
  if (!cleanupFn)
1534
1549
  return;
1535
1550
  const fn = cleanupFn;
1536
- cleanupFn = undefined;
1551
+ cleanupFn = void 0;
1537
1552
  fn();
1538
1553
  }
1539
1554
  function onCleanup(callback) {
@@ -1565,7 +1580,7 @@ function getWatchSources(sources) {
1565
1580
  return vue.toValue(sources);
1566
1581
  }
1567
1582
  function getOldValue(source) {
1568
- return Array.isArray(source) ? source.map(() => undefined) : undefined;
1583
+ return Array.isArray(source) ? source.map(() => void 0) : void 0;
1569
1584
  }
1570
1585
 
1571
1586
  function whenever(source, cb, options) {
@@ -1573,7 +1588,7 @@ function whenever(source, cb, options) {
1573
1588
  source,
1574
1589
  (v, ov, onInvalidate) => {
1575
1590
  if (v) {
1576
- if (options == null ? undefined : options.once)
1591
+ if (options == null ? void 0 : options.once)
1577
1592
  vue.nextTick(() => stop());
1578
1593
  cb(v, ov, onInvalidate);
1579
1594
  }
package/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, MaybeRef, WatchOptions, MaybeRefOrGetter, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, toValue as toValue$1, WatchCallback, WatchStopHandle } from 'vue';
2
+ import { WatchOptionsBase, Ref, WatchSource, ComputedGetter, ComputedRef, WritableComputedOptions, WritableComputedRef, WatchOptions, MaybeRef, MaybeRefOrGetter, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, toValue as toValue$1, WatchCallback, WatchStopHandle } from 'vue';
3
3
  export { MaybeRef, MaybeRefOrGetter } from 'vue';
4
4
 
5
5
  /**
@@ -142,12 +142,12 @@ type IsAny<T> = IfAny<T, true, false>;
142
142
 
143
143
  type Callback<T> = IsAny<T> extends true ? (...param: any) => void : ([
144
144
  T
145
- ] extends [void] ? (...param: unknown[]) => void : (...param: [T, ...unknown[]]) => void);
145
+ ] extends [void] ? (...param: unknown[]) => void : [T] extends [any[]] ? (...param: T) => void : (...param: [T, ...unknown[]]) => void);
146
146
  type EventHookOn<T = any> = (fn: Callback<T>) => {
147
147
  off: () => void;
148
148
  };
149
149
  type EventHookOff<T = any> = (fn: Callback<T>) => void;
150
- type EventHookTrigger<T = any> = (...param: IsAny<T> extends true ? unknown[] : [T, ...unknown[]]) => Promise<unknown[]>;
150
+ type EventHookTrigger<T = any> = (...param: Parameters<Callback<T>>) => Promise<unknown[]>;
151
151
  interface EventHook<T = any> {
152
152
  on: EventHookOn<T>;
153
153
  off: EventHookOff<T>;
@@ -226,13 +226,21 @@ interface ThrottleFilterOptions {
226
226
  */
227
227
  declare function throttleFilter(ms: MaybeRefOrGetter<number>, trailing?: boolean, leading?: boolean, rejectOnCancel?: boolean): EventFilter;
228
228
  declare function throttleFilter(options: ThrottleFilterOptions): EventFilter;
229
+ interface PausableFilterOptions {
230
+ /**
231
+ * The initial state
232
+ *
233
+ * @default 'active'
234
+ */
235
+ initialState?: 'active' | 'paused';
236
+ }
229
237
  /**
230
238
  * EventFilter that gives extra controls to pause and resume the filter
231
239
  *
232
240
  * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
233
- *
241
+ * @param options Options to configure the filter
234
242
  */
235
- declare function pausableFilter(extendFilter?: EventFilter): Pausable & {
243
+ declare function pausableFilter(extendFilter?: EventFilter, options?: PausableFilterOptions): Pausable & {
236
244
  eventFilter: EventFilter;
237
245
  };
238
246
 
@@ -433,7 +441,7 @@ declare function reactifyObject<T extends object, S extends boolean = true>(obj:
433
441
  /**
434
442
  * Computed reactive object.
435
443
  */
436
- declare function reactiveComputed<T extends object>(fn: () => T): UnwrapNestedRefs<T>;
444
+ declare function reactiveComputed<T extends object>(fn: ComputedGetter<T>): UnwrapNestedRefs<T>;
437
445
 
438
446
  type ReactiveOmitPredicate<T> = (value: T[keyof T], key: keyof T) => boolean;
439
447
  declare function reactiveOmit<T extends object, K extends keyof T>(obj: T, ...keys: (K | K[])[]): Omit<T, K>;
@@ -1051,11 +1059,17 @@ declare function useThrottleFn<T extends FunctionArgs>(fn: T, ms?: MaybeRefOrGet
1051
1059
 
1052
1060
  interface UseTimeoutFnOptions {
1053
1061
  /**
1054
- * Start the timer immediate after calling this function
1062
+ * Start the timer immediately
1055
1063
  *
1056
1064
  * @default true
1057
1065
  */
1058
1066
  immediate?: boolean;
1067
+ /**
1068
+ * Execute the callback immediately after calling `start`
1069
+ *
1070
+ * @default false
1071
+ */
1072
+ immediateCallback?: boolean;
1059
1073
  }
1060
1074
  /**
1061
1075
  * Wrapper for `setTimeout` with controls.
@@ -1185,9 +1199,10 @@ declare function watchOnce<T, Immediate extends Readonly<boolean> = false>(sourc
1185
1199
  interface WatchPausableReturn extends Pausable {
1186
1200
  stop: WatchStopHandle;
1187
1201
  }
1188
- declare function watchPausable<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchWithFilterOptions<Immediate>): WatchPausableReturn;
1189
- declare function watchPausable<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchPausableReturn;
1190
- declare function watchPausable<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchPausableReturn;
1202
+ type WatchPausableOptions<Immediate> = WatchWithFilterOptions<Immediate> & PausableFilterOptions;
1203
+ declare function watchPausable<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn;
1204
+ declare function watchPausable<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn;
1205
+ declare function watchPausable<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn;
1191
1206
 
1192
1207
  interface WatchThrottledOptions<Immediate> extends WatchOptions<Immediate> {
1193
1208
  throttle?: MaybeRefOrGetter<number>;
@@ -1225,4 +1240,4 @@ interface WheneverOptions extends WatchOptions {
1225
1240
  */
1226
1241
  declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WheneverOptions): vue.WatchHandle;
1227
1242
 
1228
- export { type AnyFn, type ArgumentsType, type Arrayable, type Awaitable, type Awaited, type ComputedRefWithControl, type ComputedWithControlRefExtra, type ConfigurableEventFilter, type ConfigurableFlush, type ConfigurableFlushSync, type ControlledRefOptions, type CreateInjectionStateOptions, type DateLike, type DebounceFilterOptions, type DeepMaybeRef, type ElementOf, type EventFilter, type EventHook, type EventHookOff, type EventHookOn, type EventHookTrigger, type ExtendRefOptions, type Fn, type FunctionArgs, type FunctionWrapperOptions, type IfAny, type IgnoredUpdater, type IsAny, type MapOldSources, type MapSources, type MultiWatchSources, type Mutable, type Pausable, type Promisify, type PromisifyFn, type Reactified, type ReactifyNested, type ReactifyObjectOptions, type ReactifyOptions, type ReactiveOmitPredicate, type ReactivePickPredicate, type ReadonlyRefOrGetter, type RemovableRef, type ShallowUnwrapRef, type SingletonPromiseReturn, type Stoppable, type SyncRefOptions, type SyncRefsOptions, type ThrottleFilterOptions, type ToRefsOptions, type UntilArrayInstance, type UntilBaseInstance, type UntilToMatchOptions, type UntilValueInstance, type UseArrayDifferenceOptions, type UseArrayIncludesComparatorFn, type UseArrayIncludesOptions, type UseArrayReducer, type UseCounterOptions, type UseDateFormatOptions, type UseDateFormatReturn, type UseIntervalControls, type UseIntervalFnOptions, type UseIntervalOptions, type UseLastChangedOptions, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseToNumberOptions, type UseToggleOptions, type WatchArrayCallback, type WatchAtMostOptions, type WatchAtMostReturn, type WatchDebouncedOptions, type WatchIgnorableReturn, type WatchPausableReturn, type WatchThrottledOptions, type WatchTriggerableCallback, type WatchTriggerableReturn, type WatchWithFilterOptions, type WheneverOptions, type WritableComputedRefWithControl, assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
1243
+ export { type AnyFn, type ArgumentsType, type Arrayable, type Awaitable, type Awaited, type ComputedRefWithControl, type ComputedWithControlRefExtra, type ConfigurableEventFilter, type ConfigurableFlush, type ConfigurableFlushSync, type ControlledRefOptions, type CreateInjectionStateOptions, type DateLike, type DebounceFilterOptions, type DeepMaybeRef, type ElementOf, type EventFilter, type EventHook, type EventHookOff, type EventHookOn, type EventHookTrigger, type ExtendRefOptions, type Fn, type FunctionArgs, type FunctionWrapperOptions, type IfAny, type IgnoredUpdater, type IsAny, type MapOldSources, type MapSources, type MultiWatchSources, type Mutable, type Pausable, type PausableFilterOptions, type Promisify, type PromisifyFn, type Reactified, type ReactifyNested, type ReactifyObjectOptions, type ReactifyOptions, type ReactiveOmitPredicate, type ReactivePickPredicate, type ReadonlyRefOrGetter, type RemovableRef, type ShallowUnwrapRef, type SingletonPromiseReturn, type Stoppable, type SyncRefOptions, type SyncRefsOptions, type ThrottleFilterOptions, type ToRefsOptions, type UntilArrayInstance, type UntilBaseInstance, type UntilToMatchOptions, type UntilValueInstance, type UseArrayDifferenceOptions, type UseArrayIncludesComparatorFn, type UseArrayIncludesOptions, type UseArrayReducer, type UseCounterOptions, type UseDateFormatOptions, type UseDateFormatReturn, type UseIntervalControls, type UseIntervalFnOptions, type UseIntervalOptions, type UseLastChangedOptions, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseToNumberOptions, type UseToggleOptions, type WatchArrayCallback, type WatchAtMostOptions, type WatchAtMostReturn, type WatchDebouncedOptions, type WatchIgnorableReturn, type WatchPausableOptions, type WatchPausableReturn, type WatchThrottledOptions, type WatchTriggerableCallback, type WatchTriggerableReturn, type WatchWithFilterOptions, type WheneverOptions, type WritableComputedRefWithControl, assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
package/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as vue from 'vue';
2
- import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, MaybeRef, WatchOptions, MaybeRefOrGetter, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, toValue as toValue$1, WatchCallback, WatchStopHandle } from 'vue';
2
+ import { WatchOptionsBase, Ref, WatchSource, ComputedGetter, ComputedRef, WritableComputedOptions, WritableComputedRef, WatchOptions, MaybeRef, MaybeRefOrGetter, InjectionKey, ShallowUnwrapRef as ShallowUnwrapRef$1, inject, provide, UnwrapNestedRefs, UnwrapRef, ToRef, ToRefs, toValue as toValue$1, WatchCallback, WatchStopHandle } from 'vue';
3
3
  export { MaybeRef, MaybeRefOrGetter } from 'vue';
4
4
 
5
5
  /**
@@ -142,12 +142,12 @@ type IsAny<T> = IfAny<T, true, false>;
142
142
 
143
143
  type Callback<T> = IsAny<T> extends true ? (...param: any) => void : ([
144
144
  T
145
- ] extends [void] ? (...param: unknown[]) => void : (...param: [T, ...unknown[]]) => void);
145
+ ] extends [void] ? (...param: unknown[]) => void : [T] extends [any[]] ? (...param: T) => void : (...param: [T, ...unknown[]]) => void);
146
146
  type EventHookOn<T = any> = (fn: Callback<T>) => {
147
147
  off: () => void;
148
148
  };
149
149
  type EventHookOff<T = any> = (fn: Callback<T>) => void;
150
- type EventHookTrigger<T = any> = (...param: IsAny<T> extends true ? unknown[] : [T, ...unknown[]]) => Promise<unknown[]>;
150
+ type EventHookTrigger<T = any> = (...param: Parameters<Callback<T>>) => Promise<unknown[]>;
151
151
  interface EventHook<T = any> {
152
152
  on: EventHookOn<T>;
153
153
  off: EventHookOff<T>;
@@ -226,13 +226,21 @@ interface ThrottleFilterOptions {
226
226
  */
227
227
  declare function throttleFilter(ms: MaybeRefOrGetter<number>, trailing?: boolean, leading?: boolean, rejectOnCancel?: boolean): EventFilter;
228
228
  declare function throttleFilter(options: ThrottleFilterOptions): EventFilter;
229
+ interface PausableFilterOptions {
230
+ /**
231
+ * The initial state
232
+ *
233
+ * @default 'active'
234
+ */
235
+ initialState?: 'active' | 'paused';
236
+ }
229
237
  /**
230
238
  * EventFilter that gives extra controls to pause and resume the filter
231
239
  *
232
240
  * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
233
- *
241
+ * @param options Options to configure the filter
234
242
  */
235
- declare function pausableFilter(extendFilter?: EventFilter): Pausable & {
243
+ declare function pausableFilter(extendFilter?: EventFilter, options?: PausableFilterOptions): Pausable & {
236
244
  eventFilter: EventFilter;
237
245
  };
238
246
 
@@ -433,7 +441,7 @@ declare function reactifyObject<T extends object, S extends boolean = true>(obj:
433
441
  /**
434
442
  * Computed reactive object.
435
443
  */
436
- declare function reactiveComputed<T extends object>(fn: () => T): UnwrapNestedRefs<T>;
444
+ declare function reactiveComputed<T extends object>(fn: ComputedGetter<T>): UnwrapNestedRefs<T>;
437
445
 
438
446
  type ReactiveOmitPredicate<T> = (value: T[keyof T], key: keyof T) => boolean;
439
447
  declare function reactiveOmit<T extends object, K extends keyof T>(obj: T, ...keys: (K | K[])[]): Omit<T, K>;
@@ -1051,11 +1059,17 @@ declare function useThrottleFn<T extends FunctionArgs>(fn: T, ms?: MaybeRefOrGet
1051
1059
 
1052
1060
  interface UseTimeoutFnOptions {
1053
1061
  /**
1054
- * Start the timer immediate after calling this function
1062
+ * Start the timer immediately
1055
1063
  *
1056
1064
  * @default true
1057
1065
  */
1058
1066
  immediate?: boolean;
1067
+ /**
1068
+ * Execute the callback immediately after calling `start`
1069
+ *
1070
+ * @default false
1071
+ */
1072
+ immediateCallback?: boolean;
1059
1073
  }
1060
1074
  /**
1061
1075
  * Wrapper for `setTimeout` with controls.
@@ -1185,9 +1199,10 @@ declare function watchOnce<T, Immediate extends Readonly<boolean> = false>(sourc
1185
1199
  interface WatchPausableReturn extends Pausable {
1186
1200
  stop: WatchStopHandle;
1187
1201
  }
1188
- declare function watchPausable<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchWithFilterOptions<Immediate>): WatchPausableReturn;
1189
- declare function watchPausable<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchPausableReturn;
1190
- declare function watchPausable<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchPausableReturn;
1202
+ type WatchPausableOptions<Immediate> = WatchWithFilterOptions<Immediate> & PausableFilterOptions;
1203
+ declare function watchPausable<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn;
1204
+ declare function watchPausable<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn;
1205
+ declare function watchPausable<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn;
1191
1206
 
1192
1207
  interface WatchThrottledOptions<Immediate> extends WatchOptions<Immediate> {
1193
1208
  throttle?: MaybeRefOrGetter<number>;
@@ -1225,4 +1240,4 @@ interface WheneverOptions extends WatchOptions {
1225
1240
  */
1226
1241
  declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WheneverOptions): vue.WatchHandle;
1227
1242
 
1228
- export { type AnyFn, type ArgumentsType, type Arrayable, type Awaitable, type Awaited, type ComputedRefWithControl, type ComputedWithControlRefExtra, type ConfigurableEventFilter, type ConfigurableFlush, type ConfigurableFlushSync, type ControlledRefOptions, type CreateInjectionStateOptions, type DateLike, type DebounceFilterOptions, type DeepMaybeRef, type ElementOf, type EventFilter, type EventHook, type EventHookOff, type EventHookOn, type EventHookTrigger, type ExtendRefOptions, type Fn, type FunctionArgs, type FunctionWrapperOptions, type IfAny, type IgnoredUpdater, type IsAny, type MapOldSources, type MapSources, type MultiWatchSources, type Mutable, type Pausable, type Promisify, type PromisifyFn, type Reactified, type ReactifyNested, type ReactifyObjectOptions, type ReactifyOptions, type ReactiveOmitPredicate, type ReactivePickPredicate, type ReadonlyRefOrGetter, type RemovableRef, type ShallowUnwrapRef, type SingletonPromiseReturn, type Stoppable, type SyncRefOptions, type SyncRefsOptions, type ThrottleFilterOptions, type ToRefsOptions, type UntilArrayInstance, type UntilBaseInstance, type UntilToMatchOptions, type UntilValueInstance, type UseArrayDifferenceOptions, type UseArrayIncludesComparatorFn, type UseArrayIncludesOptions, type UseArrayReducer, type UseCounterOptions, type UseDateFormatOptions, type UseDateFormatReturn, type UseIntervalControls, type UseIntervalFnOptions, type UseIntervalOptions, type UseLastChangedOptions, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseToNumberOptions, type UseToggleOptions, type WatchArrayCallback, type WatchAtMostOptions, type WatchAtMostReturn, type WatchDebouncedOptions, type WatchIgnorableReturn, type WatchPausableReturn, type WatchThrottledOptions, type WatchTriggerableCallback, type WatchTriggerableReturn, type WatchWithFilterOptions, type WheneverOptions, type WritableComputedRefWithControl, assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };
1243
+ export { type AnyFn, type ArgumentsType, type Arrayable, type Awaitable, type Awaited, type ComputedRefWithControl, type ComputedWithControlRefExtra, type ConfigurableEventFilter, type ConfigurableFlush, type ConfigurableFlushSync, type ControlledRefOptions, type CreateInjectionStateOptions, type DateLike, type DebounceFilterOptions, type DeepMaybeRef, type ElementOf, type EventFilter, type EventHook, type EventHookOff, type EventHookOn, type EventHookTrigger, type ExtendRefOptions, type Fn, type FunctionArgs, type FunctionWrapperOptions, type IfAny, type IgnoredUpdater, type IsAny, type MapOldSources, type MapSources, type MultiWatchSources, type Mutable, type Pausable, type PausableFilterOptions, type Promisify, type PromisifyFn, type Reactified, type ReactifyNested, type ReactifyObjectOptions, type ReactifyOptions, type ReactiveOmitPredicate, type ReactivePickPredicate, type ReadonlyRefOrGetter, type RemovableRef, type ShallowUnwrapRef, type SingletonPromiseReturn, type Stoppable, type SyncRefOptions, type SyncRefsOptions, type ThrottleFilterOptions, type ToRefsOptions, type UntilArrayInstance, type UntilBaseInstance, type UntilToMatchOptions, type UntilValueInstance, type UseArrayDifferenceOptions, type UseArrayIncludesComparatorFn, type UseArrayIncludesOptions, type UseArrayReducer, type UseCounterOptions, type UseDateFormatOptions, type UseDateFormatReturn, type UseIntervalControls, type UseIntervalFnOptions, type UseIntervalOptions, type UseLastChangedOptions, type UseTimeoutFnOptions, type UseTimeoutOptions, type UseToNumberOptions, type UseToggleOptions, type WatchArrayCallback, type WatchAtMostOptions, type WatchAtMostReturn, type WatchDebouncedOptions, type WatchIgnorableReturn, type WatchPausableOptions, type WatchPausableReturn, type WatchThrottledOptions, type WatchTriggerableCallback, type WatchTriggerableReturn, type WatchWithFilterOptions, type WheneverOptions, type WritableComputedRefWithControl, assert, refAutoReset as autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, computedEager as eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, watchIgnorable as ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, toValue, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, refDebounced as useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, refThrottled as useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };