@vueuse/shared 6.4.1 → 6.5.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.
- package/index.cjs +1005 -1020
- package/index.d.ts +13 -6
- package/index.iife.js +1006 -1021
- package/index.iife.min.js +1 -1
- package/index.mjs +1005 -1021
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import * as vue_demi from 'vue-demi';
|
|
2
2
|
import { Ref, WatchOptions, WatchSource, ComputedRef, WatchCallback, WatchStopHandle, ShallowUnwrapRef as ShallowUnwrapRef$1, UnwrapRef, ToRefs } from 'vue-demi';
|
|
3
|
-
import { Pausable as Pausable$1 } from '@vueuse/core';
|
|
4
3
|
|
|
5
4
|
declare const isClient: boolean;
|
|
6
5
|
declare const isDef: <T = any>(val?: T | undefined) => val is T;
|
|
@@ -136,8 +135,9 @@ declare function debounceFilter(ms: MaybeRef<number>): EventFilter<any[], any>;
|
|
|
136
135
|
*
|
|
137
136
|
* @param ms
|
|
138
137
|
* @param [trailing=true]
|
|
138
|
+
* @param [leading=true]
|
|
139
139
|
*/
|
|
140
|
-
declare function throttleFilter(ms: MaybeRef<number>, trailing?: boolean): EventFilter<any[], any>;
|
|
140
|
+
declare function throttleFilter(ms: MaybeRef<number>, trailing?: boolean, leading?: boolean): EventFilter<any[], any>;
|
|
141
141
|
/**
|
|
142
142
|
* EventFilter that gives extra controls to pause and resume the filter
|
|
143
143
|
*
|
|
@@ -574,7 +574,7 @@ interface IntervalOptions<Controls extends boolean> {
|
|
|
574
574
|
declare function useInterval(interval?: number, options?: IntervalOptions<false>): Ref<number>;
|
|
575
575
|
declare function useInterval(interval: number, options: IntervalOptions<true>): {
|
|
576
576
|
counter: Ref<number>;
|
|
577
|
-
} & Pausable
|
|
577
|
+
} & Pausable;
|
|
578
578
|
|
|
579
579
|
interface IntervalFnOptions {
|
|
580
580
|
/**
|
|
@@ -618,8 +618,9 @@ declare function useLastChanged(source: WatchSource, options: UseLastChangedOpti
|
|
|
618
618
|
* @param value Ref value to be watched with throttle effect
|
|
619
619
|
* @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
620
620
|
* @param [trailing=true] if true, update the value again after the delay time is up
|
|
621
|
+
* @param [leading=true] if true, update the value on the leading edge of the ms timeout
|
|
621
622
|
*/
|
|
622
|
-
declare function useThrottle<T>(value: Ref<T>, delay?: number, trailing?: boolean): Ref<T>;
|
|
623
|
+
declare function useThrottle<T>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): Ref<T>;
|
|
623
624
|
|
|
624
625
|
/**
|
|
625
626
|
* Throttle execution of a function. Especially useful for rate limiting
|
|
@@ -631,9 +632,11 @@ declare function useThrottle<T>(value: Ref<T>, delay?: number, trailing?: boolea
|
|
|
631
632
|
*
|
|
632
633
|
* @param [trailing=true] if true, call fn again after the time is up
|
|
633
634
|
*
|
|
635
|
+
* @param [leading=true] if true, call fn on the leading edge of the ms timeout
|
|
636
|
+
*
|
|
634
637
|
* @return A new, throttled, function.
|
|
635
638
|
*/
|
|
636
|
-
declare function useThrottleFn<T extends FunctionArgs>(fn: T, ms?: MaybeRef<number>, trailing?: boolean): T;
|
|
639
|
+
declare function useThrottleFn<T extends FunctionArgs>(fn: T, ms?: MaybeRef<number>, trailing?: boolean, leading?: boolean): T;
|
|
637
640
|
|
|
638
641
|
interface TimeoutFnOptions {
|
|
639
642
|
/**
|
|
@@ -692,6 +695,10 @@ declare function watchAtMost<T extends Readonly<WatchSource<unknown>[]>, Immedia
|
|
|
692
695
|
declare function watchAtMost<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options: WatchAtMostOptions<Immediate>): WatchAtMostReturn;
|
|
693
696
|
declare function watchAtMost<T, Immediate extends Readonly<boolean> = false>(sources: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options: WatchAtMostOptions<Immediate>): WatchAtMostReturn;
|
|
694
697
|
|
|
698
|
+
declare function watchOnce<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchOptions<Immediate>): void;
|
|
699
|
+
declare function watchOnce<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchOptions<Immediate>): void;
|
|
700
|
+
declare function watchOnce<T, Immediate extends Readonly<boolean> = false>(sources: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): void;
|
|
701
|
+
|
|
695
702
|
/**
|
|
696
703
|
* Shorthand for watching value to be truthy
|
|
697
704
|
*
|
|
@@ -699,4 +706,4 @@ declare function watchAtMost<T, Immediate extends Readonly<boolean> = false>(sou
|
|
|
699
706
|
*/
|
|
700
707
|
declare function whenever<T>(source: WatchSource<T>, cb: WatchCallback, options?: WatchOptions): vue_demi.WatchStopHandle;
|
|
701
708
|
|
|
702
|
-
export { ConfigurableEventFilter, ConfigurableFlush, ConfigurableFlushSync, ControlledRefOptions, CreateGlobalStateReturn, DebouncedWatchOptions, DeepMaybeRef, ElementOf, EventFilter, EventHook, EventHookOff, EventHookOn, EventHookTrigger, ExtendRefOptions, Fn, FunctionArgs, FunctionWrapperOptions, IgnorableWatchReturn, IgnoredUpdater, IntervalFnOptions, IntervalOptions, MapOldSources, MapSources, MaybeRef, Pausable, PausableWatchReturn, Reactify, ReactifyNested, ReactifyObjectOptions, RemoveableRef, ShallowUnwrapRef, SingletonPromiseReturn, Stopable, SyncRefOptions, ThrottledWatchOptions, TimeoutFnOptions, TimeoutOptions, UntilArrayInstance, UntilBaseInstance, UntilToMatchOptions, UntilValueInstance, UseLastChangedOptions, WatchAtMostOptions, WatchAtMostReturn, WatchWithFilterOptions, and, assert, biSyncRef, bypassFilter, clamp, containsProp, controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createSharedComposable, createSingletonPromise, debounceFilter, debouncedWatch, eagerComputed, extendRef, get, identity, ignorableWatch, increaseWithUnit, invoke, isBoolean, isClient, isDef, isFunction, isNumber, isObject, isString, isWindow, makeDestructurable, noop, not, now, objectPick, or, pausableFilter, pausableWatch, promiseTimeout, rand, reactify, reactifyObject, reactivePick, set, syncRef, throttleFilter, throttledWatch, timestamp, toReactive, toRefs, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useCounter, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToggle, watchAtMost, watchWithFilter, whenever };
|
|
709
|
+
export { ConfigurableEventFilter, ConfigurableFlush, ConfigurableFlushSync, ControlledRefOptions, CreateGlobalStateReturn, DebouncedWatchOptions, DeepMaybeRef, ElementOf, EventFilter, EventHook, EventHookOff, EventHookOn, EventHookTrigger, ExtendRefOptions, Fn, FunctionArgs, FunctionWrapperOptions, IgnorableWatchReturn, IgnoredUpdater, IntervalFnOptions, IntervalOptions, MapOldSources, MapSources, MaybeRef, Pausable, PausableWatchReturn, Reactify, ReactifyNested, ReactifyObjectOptions, RemoveableRef, ShallowUnwrapRef, SingletonPromiseReturn, Stopable, SyncRefOptions, ThrottledWatchOptions, TimeoutFnOptions, TimeoutOptions, UntilArrayInstance, UntilBaseInstance, UntilToMatchOptions, UntilValueInstance, UseLastChangedOptions, WatchAtMostOptions, WatchAtMostReturn, WatchWithFilterOptions, and, assert, biSyncRef, bypassFilter, clamp, containsProp, controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createSharedComposable, createSingletonPromise, debounceFilter, debouncedWatch, eagerComputed, extendRef, get, identity, ignorableWatch, increaseWithUnit, invoke, isBoolean, isClient, isDef, isFunction, isNumber, isObject, isString, isWindow, makeDestructurable, noop, not, now, objectPick, or, pausableFilter, pausableWatch, promiseTimeout, rand, reactify, reactifyObject, reactivePick, set, syncRef, throttleFilter, throttledWatch, timestamp, toReactive, toRefs, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useCounter, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToggle, watchAtMost, watchOnce, watchWithFilter, whenever };
|