@celldl/viewer 0.20260807.0 → 0.20260822.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.
@@ -0,0 +1,1503 @@
1
+ import { ComponentInternalInstance, ComputedGetter, ComputedRef, FunctionDirective, InjectionKey, MaybeRef, MaybeRefOrGetter, MultiWatchSources, MultiWatchSources as MultiWatchSources$1, ObjectDirective, Ref, ShallowRef, ShallowUnwrapRef as ShallowUnwrapRef$1, ToRef, ToRefs, UnwrapNestedRefs, UnwrapRef, WatchCallback, WatchHandle, WatchOptions, WatchOptionsBase, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, getCurrentInstance, inject } from 'vue';
2
+ import * as _$vue from "vue";
3
+
4
+ //#region computedEager/index.d.ts
5
+ type ComputedEagerOptions = WatchOptionsBase;
6
+ type ComputedEagerReturn<T = any> = Readonly<ShallowRef<T>>;
7
+ /**
8
+ *
9
+ * @deprecated This function will be removed in future version.
10
+ *
11
+ * Note: If you are using Vue 3.4+, you can straight use computed instead.
12
+ * Because in Vue 3.4+, if computed new value does not change,
13
+ * computed, effect, watch, watchEffect, render dependencies will not be triggered.
14
+ * refer: https://github.com/vuejs/core/pull/5912
15
+ *
16
+ * @param fn effect function
17
+ * @param options WatchOptionsBase
18
+ * @returns readonly shallowRef
19
+ */
20
+ declare function computedEager<T>(fn: () => T, options?: ComputedEagerOptions): ComputedEagerReturn<T>;
21
+ /** @deprecated use `computedEager` instead */
22
+ declare const eagerComputed: typeof computedEager;
23
+ //#endregion
24
+ //#region computedWithControl/index.d.ts
25
+ interface ComputedWithControlRefExtra {
26
+ /**
27
+ * Force update the computed value.
28
+ */
29
+ trigger: () => void;
30
+ }
31
+ interface ComputedRefWithControl<T> extends ComputedRef<T>, ComputedWithControlRefExtra {}
32
+ interface WritableComputedRefWithControl<T> extends WritableComputedRef<T>, ComputedWithControlRefExtra {}
33
+ type ComputedWithControlRef<T = any> = ComputedRefWithControl<T> | WritableComputedRefWithControl<T>;
34
+ declare function computedWithControl<T>(source: WatchSource | MultiWatchSources$1, fn: ComputedGetter<T>, options?: WatchOptions): ComputedRefWithControl<T>;
35
+ declare function computedWithControl<T>(source: WatchSource | MultiWatchSources$1, fn: WritableComputedOptions<T>, options?: WatchOptions): WritableComputedRefWithControl<T>;
36
+ /** @deprecated use `computedWithControl` instead */
37
+ declare const controlledComputed: typeof computedWithControl;
38
+ //#endregion
39
+ //#region createDisposableDirective/index.d.ts
40
+ type originDirective<H, V, A> = FunctionDirective<H, V, string, A> | ObjectDirective<H, V, string, A>;
41
+ /**
42
+ * Utility for authoring disposable directives. Reactive effects created within `mounted` directive hook will be tracked and automatically disposed when directive is unmounted.
43
+ *
44
+ * @see https://vueuse.org/createDisposableDirective
45
+ *
46
+ * @__NO_SIDE_EFFECTS__
47
+ */
48
+ declare function createDisposableDirective<H extends HTMLElement, V, A = any>(origin?: originDirective<H, V, A>): originDirective<H, V, A>;
49
+ //#endregion
50
+ //#region utils/types.d.ts
51
+ /**
52
+ * Void function
53
+ */
54
+ type Fn = () => void;
55
+ /**
56
+ * Any function
57
+ */
58
+ type AnyFn = (...args: any[]) => any;
59
+ /**
60
+ * A ref that allow to set null or undefined
61
+ */
62
+ type RemovableRef<T> = Ref<T, T | null | undefined>;
63
+ /**
64
+ * Maybe it's a computed ref, or a readonly value, or a getter function
65
+ */
66
+ type ReadonlyRefOrGetter<T> = ComputedRef<T> | (() => T);
67
+ /**
68
+ * Make all the nested attributes of an object or array to MaybeRef<T>
69
+ *
70
+ * Good for accepting options that will be wrapped with `reactive` or `ref`
71
+ *
72
+ * ```ts
73
+ * UnwrapRef<DeepMaybeRef<T>> === T
74
+ * ```
75
+ */
76
+ type DeepMaybeRef<T> = T extends Ref<infer V> ? MaybeRef<V> : T extends Array<any> | object ? { [K in keyof T]: DeepMaybeRef<T[K]> } : MaybeRef<T>;
77
+ type Arrayable<T> = T[] | T;
78
+ /**
79
+ * Infers the element type of an array
80
+ */
81
+ type ElementOf<T> = T extends (infer E)[] ? E : never;
82
+ type ShallowUnwrapRef<T> = T extends Ref<infer P> ? P : T;
83
+ type Awaitable<T> = Promise<T> | T;
84
+ type ArgumentsType<T> = T extends ((...args: infer U) => any) ? U : never;
85
+ /**
86
+ * Compatible with versions below TypeScript 4.5 Awaited
87
+ */
88
+ type Awaited<T> = T extends null | undefined ? T : T extends object & {
89
+ then: (onfulfilled: infer F, ...args: infer _) => any;
90
+ } ? F extends ((value: infer V, ...args: infer _) => any) ? Awaited<V> : never : T;
91
+ type Promisify<T> = Promise<Awaited<T>>;
92
+ type PromisifyFn<T extends AnyFn> = (...args: ArgumentsType<T>) => Promisify<ReturnType<T>>;
93
+ interface Pausable {
94
+ /**
95
+ * A ref indicate whether a pausable instance is active
96
+ */
97
+ readonly isActive: Readonly<ShallowRef<boolean>>;
98
+ /**
99
+ * Temporary pause the effect from executing
100
+ */
101
+ pause: Fn;
102
+ /**
103
+ * Resume the effects
104
+ */
105
+ resume: Fn;
106
+ }
107
+ interface Stoppable<StartFnArgs extends any[] = any[]> {
108
+ /**
109
+ * A ref indicate whether a stoppable instance is executing
110
+ */
111
+ readonly isPending: Readonly<Ref<boolean>>;
112
+ /**
113
+ * Stop the effect from executing
114
+ */
115
+ stop: Fn;
116
+ /**
117
+ * Start the effects
118
+ */
119
+ start: (...args: StartFnArgs) => void;
120
+ }
121
+ type WatchOptionFlush = WatchOptions['flush'];
122
+ interface ConfigurableFlush {
123
+ /**
124
+ * Timing for monitoring changes, refer to WatchOptions for more details
125
+ *
126
+ * @default 'pre'
127
+ */
128
+ flush?: WatchOptionFlush;
129
+ }
130
+ interface ConfigurableFlushSync {
131
+ /**
132
+ * Timing for monitoring changes, refer to WatchOptions for more details.
133
+ * Unlike `watch()`, the default is set to `sync`
134
+ *
135
+ * @default 'sync'
136
+ */
137
+ flush?: WatchOptionFlush;
138
+ }
139
+ type MapSources<T> = { [K in keyof T]: T[K] extends WatchSource<infer V> ? V : never };
140
+ type MapOldSources<T, Immediate> = { [K in keyof T]: T[K] extends WatchSource<infer V> ? Immediate extends true ? V | undefined : V : never };
141
+ type Mutable<T> = { -readonly [P in keyof T]: T[P] };
142
+ type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
143
+ /**
144
+ * will return `true` if `T` is `any`, or `false` otherwise
145
+ */
146
+ type IsAny<T> = IfAny<T, true, false>;
147
+ /**
148
+ * Universal timer handle that works in both browser and Node.js environments
149
+ */
150
+ type TimerHandle = ReturnType<typeof setTimeout> | undefined;
151
+ type InstanceProxy = NonNullable<NonNullable<ReturnType<typeof getCurrentInstance>>['proxy']>;
152
+ //#endregion
153
+ //#region createEventHook/index.d.ts
154
+ type Callback<T> = IsAny<T> extends true ? (...param: any) => void : ([T] extends [void] ? (...param: unknown[]) => void : [T] extends [any[]] ? (...param: T) => void : (...param: [T, ...unknown[]]) => void);
155
+ type EventHookOn<T = any> = (fn: Callback<T>) => {
156
+ off: () => void;
157
+ };
158
+ type EventHookOff<T = any> = (fn: Callback<T>) => void;
159
+ type EventHookTrigger<T = any> = (...param: Parameters<Callback<T>>) => Promise<unknown[]>;
160
+ interface EventHook<T = any> {
161
+ on: EventHookOn<T>;
162
+ off: EventHookOff<T>;
163
+ trigger: EventHookTrigger<T>;
164
+ clear: () => void;
165
+ }
166
+ type EventHookReturn<T> = EventHook<T>;
167
+ /**
168
+ * Utility for creating event hooks
169
+ *
170
+ * @see https://vueuse.org/createEventHook
171
+ *
172
+ * @__NO_SIDE_EFFECTS__
173
+ */
174
+ declare function createEventHook<T = any>(): EventHookReturn<T>;
175
+ //#endregion
176
+ //#region utils/filters.d.ts
177
+ type FunctionArgs<Args extends any[] = any[], Return = unknown> = (...args: Args) => Return;
178
+ interface FunctionWrapperOptions<Args extends any[] = any[], This = any> {
179
+ fn: FunctionArgs<Args, This>;
180
+ args: Args;
181
+ thisArg: This;
182
+ }
183
+ type EventFilter<Args extends any[] = any[], This = any, Invoke extends AnyFn = AnyFn> = (invoke: Invoke, options: FunctionWrapperOptions<Args, This>) => ReturnType<Invoke> | Promisify<ReturnType<Invoke>>;
184
+ interface ConfigurableEventFilter {
185
+ /**
186
+ * Filter for if events should to be received.
187
+ *
188
+ * @see https://vueuse.org/guide/config.html#event-filters
189
+ */
190
+ eventFilter?: EventFilter;
191
+ }
192
+ interface DebounceFilterOptions {
193
+ /**
194
+ * The maximum time allowed to be delayed before it's invoked.
195
+ * In milliseconds.
196
+ */
197
+ maxWait?: MaybeRefOrGetter<number>;
198
+ /**
199
+ * Whether to reject the last call if it's been cancel.
200
+ *
201
+ * @default false
202
+ */
203
+ rejectOnCancel?: boolean;
204
+ }
205
+ /**
206
+ * @internal
207
+ */
208
+ declare function createFilterWrapper<T extends AnyFn>(filter: EventFilter, fn: T): (this: any, ...args: ArgumentsType<T>) => Promise<Awaited<ReturnType<T>>>;
209
+ declare const bypassFilter: EventFilter;
210
+ /**
211
+ * Create an EventFilter that debounce the events
212
+ */
213
+ declare function debounceFilter(ms: MaybeRefOrGetter<number>, options?: DebounceFilterOptions): EventFilter<any[], any, AnyFn>;
214
+ interface ThrottleFilterOptions {
215
+ /**
216
+ * The maximum time allowed to be delayed before it's invoked.
217
+ */
218
+ delay: MaybeRefOrGetter<number>;
219
+ /**
220
+ * Whether to invoke on the trailing edge of the timeout.
221
+ */
222
+ trailing?: boolean;
223
+ /**
224
+ * Whether to invoke on the leading edge of the timeout.
225
+ */
226
+ leading?: boolean;
227
+ /**
228
+ * Whether to reject the last call if it's been cancel.
229
+ */
230
+ rejectOnCancel?: boolean;
231
+ }
232
+ /**
233
+ * Create an EventFilter that throttle the events
234
+ */
235
+ declare function throttleFilter(ms: MaybeRefOrGetter<number>, trailing?: boolean, leading?: boolean, rejectOnCancel?: boolean): EventFilter;
236
+ declare function throttleFilter(options: ThrottleFilterOptions): EventFilter;
237
+ interface PausableFilterOptions {
238
+ /**
239
+ * The initial state
240
+ *
241
+ * @default 'active'
242
+ */
243
+ initialState?: 'active' | 'paused';
244
+ }
245
+ /**
246
+ * EventFilter that gives extra controls to pause and resume the filter
247
+ *
248
+ * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
249
+ * @param options Options to configure the filter
250
+ */
251
+ declare function pausableFilter(extendFilter?: EventFilter, options?: PausableFilterOptions): Pausable & {
252
+ eventFilter: EventFilter;
253
+ };
254
+ //#endregion
255
+ //#region utils/general.d.ts
256
+ declare function promiseTimeout(ms: number, throwOnTimeout?: boolean, reason?: string): Promise<void>;
257
+ declare function identity<T>(arg: T): T;
258
+ interface SingletonPromiseReturn<T> {
259
+ (): Promise<T>;
260
+ /**
261
+ * Reset current staled promise.
262
+ * await it to have proper shutdown.
263
+ */
264
+ reset: () => Promise<void>;
265
+ }
266
+ /**
267
+ * Create singleton promise function
268
+ *
269
+ * @example
270
+ * ```
271
+ * const promise = createSingletonPromise(async () => { ... })
272
+ *
273
+ * await promise()
274
+ * await promise() // all of them will be bind to a single promise instance
275
+ * await promise() // and be resolved together
276
+ * ```
277
+ */
278
+ declare function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromiseReturn<T>;
279
+ declare function invoke<T>(fn: () => T): T;
280
+ declare function containsProp(obj: object, ...props: string[]): boolean;
281
+ /**
282
+ * Increase string a value with unit
283
+ *
284
+ * @example '2px' + 1 = '3px'
285
+ * @example '15em' + (-2) = '13em'
286
+ */
287
+ declare function increaseWithUnit(target: number, delta: number): number;
288
+ declare function increaseWithUnit(target: string, delta: number): string;
289
+ declare function increaseWithUnit(target: string | number, delta: number): string | number;
290
+ /**
291
+ * Get a px value for SSR use, do not rely on this method outside of SSR as REM unit is assumed at 16px, which might not be the case on the client
292
+ */
293
+ declare function pxValue(px: string): number;
294
+ /**
295
+ * Create a new subset object by giving keys
296
+ */
297
+ declare function objectPick<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined?: boolean): Pick<O, T>;
298
+ /**
299
+ * Create a new subset object by omit giving keys
300
+ */
301
+ declare function objectOmit<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined?: boolean): Omit<O, T>;
302
+ declare function objectEntries<T extends object>(obj: T): Array<[keyof T, T[keyof T]]>;
303
+ declare function toArray<T>(value: T | readonly T[]): readonly T[];
304
+ declare function toArray<T>(value: T | T[]): T[];
305
+ //#endregion
306
+ //#region utils/is.d.ts
307
+ declare const isClient: boolean;
308
+ declare const isWorker: boolean;
309
+ declare const isDef: <T = any>(val?: T) => val is T;
310
+ declare const notNullish: <T = any>(val?: T | null | undefined) => val is T;
311
+ declare const assert: (condition: boolean, ...infos: any[]) => void;
312
+ declare const isObject: (val: any) => val is object;
313
+ declare const now: () => number;
314
+ declare const timestamp: () => number;
315
+ declare const clamp: (n: number, min: number, max: number) => number;
316
+ declare const noop: () => void;
317
+ declare const rand: (min: number, max: number) => number;
318
+ declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
319
+ declare const isIOS: boolean;
320
+ //#endregion
321
+ //#region utils/port.d.ts
322
+ declare const hyphenate: (str: string) => string;
323
+ declare const camelize: (str: string) => string;
324
+ //#endregion
325
+ //#region utils/vue.d.ts
326
+ declare function getLifeCycleTarget(target?: ComponentInternalInstance | null): ComponentInternalInstance | null;
327
+ //#endregion
328
+ //#region createGlobalState/index.d.ts
329
+ type CreateGlobalStateReturn<Fn extends AnyFn = AnyFn> = Fn;
330
+ /**
331
+ * Keep states in the global scope to be reusable across Vue instances.
332
+ *
333
+ * @see https://vueuse.org/createGlobalState
334
+ * @param stateFactory A factory function to create the state
335
+ *
336
+ * @__NO_SIDE_EFFECTS__
337
+ */
338
+ declare function createGlobalState<Fn extends AnyFn>(stateFactory: Fn): CreateGlobalStateReturn<Fn>;
339
+ //#endregion
340
+ //#region createInjectionState/index.d.ts
341
+ type CreateInjectionStateReturn<Arguments extends Array<any>, ProvideReturn, InjectReturn> = Readonly<[
342
+ /**
343
+ * Call this function in a provider component to create and provide the state.
344
+ *
345
+ * @param args Arguments passed to the composable
346
+ * @returns The state returned by the composable
347
+ */
348
+ useProvidingState: (...args: Arguments) => ProvideReturn,
349
+ /**
350
+ * Call this function in a consumer component to inject the state.
351
+ *
352
+ * @returns The injected state, or `undefined` if not provided and no default value was set.
353
+ */
354
+ useInjectedState: () => InjectReturn]>;
355
+ interface CreateInjectionStateOptions<Return> {
356
+ /**
357
+ * Custom injectionKey for InjectionState
358
+ */
359
+ injectionKey?: string | InjectionKey<Return>;
360
+ /**
361
+ * Default value for the InjectionState
362
+ */
363
+ defaultValue?: Return;
364
+ }
365
+ /**
366
+ * Create global state that can be injected into components.
367
+ *
368
+ * @see https://vueuse.org/createInjectionState
369
+ *
370
+ * @__NO_SIDE_EFFECTS__
371
+ */
372
+ declare function createInjectionState<Arguments extends Array<any>, Return>(composable: (...args: Arguments) => Return, options: {
373
+ defaultValue: Return;
374
+ } & CreateInjectionStateOptions<Return>): CreateInjectionStateReturn<Arguments, Return, Return>;
375
+ declare function createInjectionState<Arguments extends Array<any>, Return>(composable: (...args: Arguments) => Return, options?: CreateInjectionStateOptions<Return>): CreateInjectionStateReturn<Arguments, Return, Return | undefined>;
376
+ //#endregion
377
+ //#region createRef/index.d.ts
378
+ type CreateRefReturn<T = any, D extends boolean = false> = ShallowOrDeepRef<T, D>;
379
+ type ShallowOrDeepRef<T = any, D extends boolean = false> = D extends true ? Ref<T> : ShallowRef<T>;
380
+ /**
381
+ * Returns a `deepRef` or `shallowRef` depending on the `deep` param.
382
+ *
383
+ * @example createRef(1) // ShallowRef<number>
384
+ * @example createRef(1, false) // ShallowRef<number>
385
+ * @example createRef(1, true) // Ref<number>
386
+ * @example createRef("string") // ShallowRef<string>
387
+ * @example createRef<"A"|"B">("A", true) // Ref<"A"|"B">
388
+ *
389
+ * @param value
390
+ * @param deep
391
+ * @returns the `deepRef` or `shallowRef`
392
+ *
393
+ * @__NO_SIDE_EFFECTS__
394
+ */
395
+ declare function createRef<T = any, D extends boolean = false>(value: T, deep?: D): CreateRefReturn<T, D>;
396
+ //#endregion
397
+ //#region createSharedComposable/index.d.ts
398
+ type SharedComposableReturn<T extends AnyFn = AnyFn> = T;
399
+ /**
400
+ * Make a composable function usable with multiple Vue instances.
401
+ *
402
+ * @see https://vueuse.org/createSharedComposable
403
+ *
404
+ * @__NO_SIDE_EFFECTS__
405
+ */
406
+ declare function createSharedComposable<Fn extends AnyFn>(composable: Fn): SharedComposableReturn<Fn>;
407
+ //#endregion
408
+ //#region extendRef/index.d.ts
409
+ type ExtendRefReturn<T = any> = Ref<T>;
410
+ interface ExtendRefOptions<Unwrap extends boolean = boolean> {
411
+ /**
412
+ * Is the extends properties enumerable
413
+ *
414
+ * @default false
415
+ */
416
+ enumerable?: boolean;
417
+ /**
418
+ * Unwrap for Ref properties
419
+ *
420
+ * @default true
421
+ */
422
+ unwrap?: Unwrap;
423
+ }
424
+ /**
425
+ * Overload 1: Unwrap set to false
426
+ */
427
+ declare function extendRef<R extends Ref<any>, Extend extends object, Options extends ExtendRefOptions<false>>(ref: R, extend: Extend, options?: Options): ShallowUnwrapRef$1<Extend> & R;
428
+ /**
429
+ * Overload 2: Unwrap unset or set to true
430
+ */
431
+ declare function extendRef<R extends Ref<any>, Extend extends object, Options extends ExtendRefOptions>(ref: R, extend: Extend, options?: Options): Extend & R;
432
+ //#endregion
433
+ //#region get/index.d.ts
434
+ /**
435
+ * Shorthand for accessing `ref.value`
436
+ */
437
+ declare function get<T>(ref: MaybeRef<T>): T;
438
+ declare function get<T, K extends keyof T>(ref: MaybeRef<T>, key: K): T[K];
439
+ //#endregion
440
+ //#region injectLocal/index.d.ts
441
+ /**
442
+ * On the basis of `inject`, it is allowed to directly call inject to obtain the value after call provide in the same component.
443
+ *
444
+ * @example
445
+ * ```ts
446
+ * injectLocal('MyInjectionKey', 1)
447
+ * const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
448
+ * ```
449
+ *
450
+ * @__NO_SIDE_EFFECTS__
451
+ */
452
+ declare const injectLocal: typeof inject;
453
+ //#endregion
454
+ //#region isDefined/index.d.ts
455
+ type IsDefinedReturn = boolean;
456
+ declare function isDefined<T>(v: ComputedRef<T>): v is ComputedRef<Exclude<T, null | undefined>>;
457
+ declare function isDefined<T>(v: Ref<T>): v is Ref<Exclude<T, null | undefined>>;
458
+ declare function isDefined<T>(v: T): v is Exclude<T, null | undefined>;
459
+ //#endregion
460
+ //#region makeDestructurable/index.d.ts
461
+ declare function makeDestructurable<T extends Record<string, unknown>, A extends readonly any[]>(obj: T, arr: A): T & A;
462
+ //#endregion
463
+ //#region provideLocal/map.d.ts
464
+ type LocalProvidedKey<T> = InjectionKey<T> | string | number;
465
+ //#endregion
466
+ //#region provideLocal/index.d.ts
467
+ type ProvideLocalReturn = void;
468
+ /**
469
+ * On the basis of `provide`, it is allowed to directly call inject to obtain the value after call provide in the same component.
470
+ *
471
+ * @example
472
+ * ```ts
473
+ * provideLocal('MyInjectionKey', 1)
474
+ * const injectedValue = injectLocal('MyInjectionKey') // injectedValue === 1
475
+ * ```
476
+ */
477
+ declare function provideLocal<T, K = LocalProvidedKey<T>>(key: K, value: K extends InjectionKey<infer V> ? V : T): ProvideLocalReturn;
478
+ //#endregion
479
+ //#region reactify/index.d.ts
480
+ type Reactified<T, Computed extends boolean> = T extends ((...args: infer A) => infer R) ? (...args: { [K in keyof A]: Computed extends true ? MaybeRefOrGetter<A[K]> : MaybeRef<A[K]> }) => ComputedRef<R> : never;
481
+ type ReactifyReturn<T extends AnyFn = AnyFn, K extends boolean = true> = Reactified<T, K>;
482
+ interface ReactifyOptions<T extends boolean> {
483
+ /**
484
+ * Accept passing a function as a reactive getter
485
+ *
486
+ * @default true
487
+ */
488
+ computedGetter?: T;
489
+ }
490
+ /**
491
+ * Converts plain function into a reactive function.
492
+ * The converted function accepts refs as it's arguments
493
+ * and returns a ComputedRef, with proper typing.
494
+ *
495
+ * @param fn - Source function
496
+ * @param options - Options
497
+ *
498
+ * @__NO_SIDE_EFFECTS__
499
+ */
500
+ declare function reactify<T extends AnyFn, K extends boolean = true>(fn: T, options?: ReactifyOptions<K>): ReactifyReturn<T, K>;
501
+ /** @deprecated use `reactify` instead */
502
+ declare const createReactiveFn: typeof reactify;
503
+ //#endregion
504
+ //#region reactifyObject/index.d.ts
505
+ type ReactifyNested<T, Keys extends keyof T = keyof T, S extends boolean = true> = { [K in Keys]: T[K] extends AnyFn ? Reactified<T[K], S> : T[K] };
506
+ type ReactifyObjectReturn<T, Keys extends keyof T, S extends boolean = true> = ReactifyNested<T, Keys, S>;
507
+ interface ReactifyObjectOptions<T extends boolean> extends ReactifyOptions<T> {
508
+ /**
509
+ * Includes names from Object.getOwnPropertyNames
510
+ *
511
+ * @default true
512
+ */
513
+ includeOwnProperties?: boolean;
514
+ }
515
+ /**
516
+ * Apply `reactify` to an object
517
+ *
518
+ * @__NO_SIDE_EFFECTS__
519
+ */
520
+ declare function reactifyObject<T extends object, Keys extends keyof T>(obj: T, keys?: (keyof T)[]): ReactifyObjectReturn<T, Keys, true>;
521
+ declare function reactifyObject<T extends object, S extends boolean = true>(obj: T, options?: ReactifyObjectOptions<S>): ReactifyObjectReturn<T, keyof T, S>;
522
+ //#endregion
523
+ //#region reactiveComputed/index.d.ts
524
+ type ReactiveComputedReturn<T extends object> = UnwrapNestedRefs<T>;
525
+ /**
526
+ * Computed reactive object.
527
+ */
528
+ declare function reactiveComputed<T extends object>(fn: ComputedGetter<T>): ReactiveComputedReturn<T>;
529
+ //#endregion
530
+ //#region reactiveOmit/index.d.ts
531
+ type ReactiveOmitReturn<T extends object, K extends keyof T | undefined = undefined> = [K] extends [undefined] ? Partial<T> : Omit<T, Extract<K, keyof T>>;
532
+ type ReactiveOmitPredicate<T> = (value: T[keyof T], key: keyof T) => boolean;
533
+ declare function reactiveOmit<T extends object, K extends keyof T>(obj: T, ...keys: (K | K[])[]): ReactiveOmitReturn<T, K>;
534
+ declare function reactiveOmit<T extends object>(obj: T, predicate: ReactiveOmitPredicate<T>): ReactiveOmitReturn<T>;
535
+ //#endregion
536
+ //#region reactivePick/index.d.ts
537
+ type ReactivePickReturn<T extends object, K extends keyof T> = { [S in K]: UnwrapRef<T[S]> };
538
+ type ReactivePickPredicate<T> = (value: T[keyof T], key: keyof T) => boolean;
539
+ declare function reactivePick<T extends object, K extends keyof T>(obj: T, ...keys: (K | K[])[]): ReactivePickReturn<T, K>;
540
+ declare function reactivePick<T extends object>(obj: T, predicate: ReactivePickPredicate<T>): ReactivePickReturn<T, keyof T>;
541
+ //#endregion
542
+ //#region refAutoReset/index.d.ts
543
+ type RefAutoResetReturn<T = any> = Ref<T>;
544
+ /**
545
+ * Create a ref which will be reset to the default value after some time.
546
+ *
547
+ * @see https://vueuse.org/refAutoReset
548
+ * @param defaultValue The value which will be set.
549
+ * @param afterMs A zero-or-greater delay in milliseconds.
550
+ */
551
+ declare function refAutoReset<T>(defaultValue: MaybeRefOrGetter<T>, afterMs?: MaybeRefOrGetter<number>): RefAutoResetReturn<T>;
552
+ /** @deprecated use `refAutoReset` instead */
553
+ declare const autoResetRef: typeof refAutoReset;
554
+ //#endregion
555
+ //#region refDebounced/index.d.ts
556
+ type RefDebouncedReturn<T = any> = Readonly<Ref<T>>;
557
+ /**
558
+ * Debounce updates of a ref.
559
+ *
560
+ * @return A new debounced ref.
561
+ */
562
+ declare function refDebounced<T>(value: Ref<T>, ms?: MaybeRefOrGetter<number>, options?: DebounceFilterOptions): RefDebouncedReturn<T>;
563
+ /** @deprecated use `refDebounced` instead */
564
+ declare const debouncedRef: typeof refDebounced;
565
+ /** @deprecated use `refDebounced` instead */
566
+ declare const useDebounce: typeof refDebounced;
567
+ //#endregion
568
+ //#region refDefault/index.d.ts
569
+ /**
570
+ * Apply default value to a ref.
571
+ *
572
+ * @__NO_SIDE_EFFECTS__
573
+ */
574
+ declare function refDefault<T>(source: Ref<T | undefined | null>, defaultValue: T): Ref<T>;
575
+ //#endregion
576
+ //#region refManualReset/index.d.ts
577
+ /**
578
+ * Define the shape of a ref that supports manual reset functionality.
579
+ *
580
+ * This interface extends the standard `Ref` type from Vue and adds a `reset` method.
581
+ * The `reset` method allows the ref to be manually reset to its default value.
582
+ */
583
+ interface ManualResetRefReturn<T> extends Ref<T> {
584
+ reset: Fn;
585
+ }
586
+ /**
587
+ * Create a ref with manual reset functionality.
588
+ *
589
+ * @see https://vueuse.org/refManualReset
590
+ * @param defaultValue The value which will be set.
591
+ */
592
+ declare function refManualReset<T>(defaultValue: MaybeRefOrGetter<T>): ManualResetRefReturn<T>;
593
+ //#endregion
594
+ //#region refThrottled/index.d.ts
595
+ type RefThrottledReturn<T = any> = Ref<T>;
596
+ /**
597
+ * Throttle execution of a function. Especially useful for rate limiting
598
+ * execution of handlers on events like resize and scroll.
599
+ *
600
+ * @param value Ref value to be watched with throttle effect
601
+ * @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
602
+ * @param trailing if true, update the value again after the delay time is up
603
+ * @param leading if true, update the value on the leading edge of the ms timeout
604
+ */
605
+ declare function refThrottled<T = any>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): RefThrottledReturn<T>;
606
+ /** @deprecated use `refThrottled` instead */
607
+ declare const throttledRef: typeof refThrottled;
608
+ /** @deprecated use `refThrottled` instead */
609
+ declare const useThrottle: typeof refThrottled;
610
+ //#endregion
611
+ //#region refWithControl/index.d.ts
612
+ interface ControlledRefOptions<T> {
613
+ /**
614
+ * Callback function before the ref changing.
615
+ *
616
+ * Returning `false` to dismiss the change.
617
+ */
618
+ onBeforeChange?: (value: T, oldValue: T) => void | boolean;
619
+ /**
620
+ * Callback function after the ref changed
621
+ *
622
+ * This happens synchronously, with less overhead compare to `watch`
623
+ */
624
+ onChanged?: (value: T, oldValue: T) => void;
625
+ }
626
+ /**
627
+ * Fine-grained controls over ref and its reactivity.
628
+ *
629
+ * @__NO_SIDE_EFFECTS__
630
+ */
631
+ declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): {
632
+ get: (tracking?: boolean) => T;
633
+ set: (value: T, triggering?: boolean) => void;
634
+ untrackedGet: () => T;
635
+ silentSet: (v: T) => void;
636
+ peek: () => T;
637
+ lay: (v: T) => void;
638
+ } & _$vue.Ref<T, T>;
639
+ /** @deprecated use `refWithControl` instead */
640
+ declare const controlledRef: typeof refWithControl;
641
+ //#endregion
642
+ //#region set/index.d.ts
643
+ declare function set<T>(ref: Ref<T>, value: T): void;
644
+ declare function set<O extends object, K extends keyof O>(target: O, key: K, value: O[K]): void;
645
+ //#endregion
646
+ //#region syncRef/index.d.ts
647
+ type Direction = 'ltr' | 'rtl' | 'both';
648
+ type SpecificFieldPartial<T, K extends keyof T> = Partial<Pick<T, K>> & Omit<T, K>;
649
+ /**
650
+ * A = B
651
+ */
652
+ type Equal<A, B> = [A] extends [B] ? ([B] extends [A] ? true : false) : false;
653
+ /**
654
+ * A ∩ B ≠ ∅
655
+ */
656
+ type IntersectButNotEqual<A, B> = Equal<A, B> extends true ? false : A & B extends never ? false : true;
657
+ /**
658
+ * A ⊆ B
659
+ */
660
+ type IncludeButNotEqual<A, B> = Equal<A, B> extends true ? false : A extends B ? true : false;
661
+ /**
662
+ * A ∩ B = ∅
663
+ */
664
+ type NotIntersect<A, B> = Equal<A, B> extends true ? false : A & B extends never ? true : false;
665
+ interface EqualType<D extends Direction, L, R, O extends keyof Transform<L, R> = (D extends 'both' ? 'ltr' | 'rtl' : D)> {
666
+ transform?: SpecificFieldPartial<Pick<Transform<L, R>, O>, O>;
667
+ }
668
+ type StrictIncludeMap<IncludeType extends 'LR' | 'RL', D extends Exclude<Direction, 'both'>, L, R> = (Equal<[IncludeType, D], ['LR', 'ltr']> & Equal<[IncludeType, D], ['RL', 'rtl']>) extends true ? {
669
+ transform?: SpecificFieldPartial<Pick<Transform<L, R>, D>, D>;
670
+ } : {
671
+ transform: Pick<Transform<L, R>, D>;
672
+ };
673
+ type StrictIncludeType<IncludeType extends 'LR' | 'RL', D extends Direction, L, R> = D extends 'both' ? {
674
+ transform: SpecificFieldPartial<Transform<L, R>, IncludeType extends 'LR' ? 'ltr' : 'rtl'>;
675
+ } : D extends Exclude<Direction, 'both'> ? StrictIncludeMap<IncludeType, D, L, R> : never;
676
+ type IntersectButNotEqualType<D extends Direction, L, R> = D extends 'both' ? {
677
+ transform: Transform<L, R>;
678
+ } : D extends Exclude<Direction, 'both'> ? {
679
+ transform: Pick<Transform<L, R>, D>;
680
+ } : never;
681
+ type NotIntersectType<D extends Direction, L, R> = IntersectButNotEqualType<D, L, R>;
682
+ interface Transform<L, R> {
683
+ ltr: (left: L) => R;
684
+ rtl: (right: R) => L;
685
+ }
686
+ type TransformType<D extends Direction, L, R> = Equal<L, R> extends true ? EqualType<D, L, R> : IncludeButNotEqual<L, R> extends true ? StrictIncludeType<'LR', D, L, R> : IncludeButNotEqual<R, L> extends true ? StrictIncludeType<'RL', D, L, R> : IntersectButNotEqual<L, R> extends true ? IntersectButNotEqualType<D, L, R> : NotIntersect<L, R> extends true ? NotIntersectType<D, L, R> : never;
687
+ type SyncRefOptions<L, R, D extends Direction> = ConfigurableFlushSync & {
688
+ /**
689
+ * Watch deeply
690
+ *
691
+ * @default false
692
+ */
693
+ deep?: boolean;
694
+ /**
695
+ * Sync values immediately
696
+ *
697
+ * @default true
698
+ */
699
+ immediate?: boolean;
700
+ /**
701
+ * Direction of syncing. Value will be redefined if you define syncConvertors
702
+ *
703
+ * @default 'both'
704
+ */
705
+ direction?: D;
706
+ } & TransformType<D, L, R>;
707
+ /**
708
+ * Two-way refs synchronization.
709
+ * From the set theory perspective to restrict the option's type
710
+ * Check in the following order:
711
+ * 1. L = R
712
+ * 2. L ∩ R ≠ ∅
713
+ * 3. L ⊆ R
714
+ * 4. L ∩ R = ∅
715
+ */
716
+ declare function syncRef<L, R, D extends Direction = 'both'>(left: Ref<L>, right: Ref<R>, ...[options]: Equal<L, R> extends true ? [options?: SyncRefOptions<L, R, D>] : [options: SyncRefOptions<L, R, D>]): () => void;
717
+ //#endregion
718
+ //#region syncRefs/index.d.ts
719
+ interface SyncRefsOptions extends ConfigurableFlushSync {
720
+ /**
721
+ * Watch deeply
722
+ *
723
+ * @default false
724
+ */
725
+ deep?: boolean;
726
+ /**
727
+ * Sync values immediately
728
+ *
729
+ * @default true
730
+ */
731
+ immediate?: boolean;
732
+ }
733
+ /**
734
+ * Keep target ref(s) in sync with the source ref
735
+ *
736
+ * @param source source ref
737
+ * @param targets
738
+ */
739
+ declare function syncRefs<T>(source: WatchSource<T>, targets: Ref<T> | Ref<T>[], options?: SyncRefsOptions): _$vue.WatchHandle;
740
+ //#endregion
741
+ //#region toReactive/index.d.ts
742
+ /**
743
+ * Converts ref to reactive.
744
+ *
745
+ * @see https://vueuse.org/toReactive
746
+ * @param objectRef A ref of object
747
+ */
748
+ declare function toReactive<T extends object>(objectRef: MaybeRef<T>): UnwrapNestedRefs<T>;
749
+ //#endregion
750
+ //#region toRef/index.d.ts
751
+ /**
752
+ * Normalize value/ref/getter to `ref` or `computed`.
753
+ */
754
+ declare function toRef<T>(r: () => T): Readonly<Ref<T>>;
755
+ declare function toRef<T>(r: ComputedRef<T>): ComputedRef<T>;
756
+ declare function toRef<T>(r: MaybeRefOrGetter<T>): Ref<T>;
757
+ declare function toRef<T>(r: T): Ref<T>;
758
+ declare function toRef<T extends object, K extends keyof T>(object: T, key: K): ToRef<T[K]>;
759
+ declare function toRef<T extends object, K extends keyof T>(object: T, key: K, defaultValue: T[K]): ToRef<Exclude<T[K], undefined>>;
760
+ //#endregion
761
+ //#region toRefs/index.d.ts
762
+ interface ToRefsOptions {
763
+ /**
764
+ * Replace the original ref with a copy on property update.
765
+ *
766
+ * @default true
767
+ */
768
+ replaceRef?: MaybeRefOrGetter<boolean>;
769
+ }
770
+ /**
771
+ * Extended `toRefs` that also accepts refs of an object.
772
+ *
773
+ * @see https://vueuse.org/toRefs
774
+ * @param objectRef A ref or normal object or array.
775
+ * @param options Options
776
+ */
777
+ declare function toRefs<T extends object>(objectRef: MaybeRef<T>, options?: ToRefsOptions): ToRefs<T>;
778
+ //#endregion
779
+ //#region tryOnBeforeMount/index.d.ts
780
+ /**
781
+ * Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function
782
+ *
783
+ * @param fn
784
+ * @param sync if set to false, it will run in the nextTick() of Vue
785
+ * @param target
786
+ */
787
+ declare function tryOnBeforeMount(fn: Fn, sync?: boolean, target?: ComponentInternalInstance | null): void;
788
+ //#endregion
789
+ //#region tryOnBeforeUnmount/index.d.ts
790
+ /**
791
+ * Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing
792
+ *
793
+ * @param fn
794
+ * @param target
795
+ */
796
+ declare function tryOnBeforeUnmount(fn: Fn, target?: ComponentInternalInstance | null): void;
797
+ //#endregion
798
+ //#region tryOnMounted/index.d.ts
799
+ /**
800
+ * Call onMounted() if it's inside a component lifecycle, if not, just call the function
801
+ *
802
+ * @param fn
803
+ * @param sync if set to false, it will run in the nextTick() of Vue
804
+ * @param target
805
+ */
806
+ declare function tryOnMounted(fn: Fn, sync?: boolean, target?: ComponentInternalInstance | null): void;
807
+ //#endregion
808
+ //#region tryOnScopeDispose/index.d.ts
809
+ /**
810
+ * Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
811
+ *
812
+ * @param fn
813
+ */
814
+ declare function tryOnScopeDispose(fn: Fn, failSilently?: boolean): boolean;
815
+ //#endregion
816
+ //#region tryOnUnmounted/index.d.ts
817
+ /**
818
+ * Call onUnmounted() if it's inside a component lifecycle, if not, do nothing
819
+ *
820
+ * @param fn
821
+ * @param target
822
+ */
823
+ declare function tryOnUnmounted(fn: Fn, target?: ComponentInternalInstance | null): void;
824
+ //#endregion
825
+ //#region until/index.d.ts
826
+ interface UntilToMatchOptions extends ConfigurableFlushSync {
827
+ /**
828
+ * Milliseconds timeout for promise to resolve/reject if the when condition does not meet.
829
+ * 0 for never timed out
830
+ *
831
+ * @default 0
832
+ */
833
+ timeout?: number;
834
+ /**
835
+ * Reject the promise when timeout
836
+ *
837
+ * @default false
838
+ */
839
+ throwOnTimeout?: boolean;
840
+ /**
841
+ * `deep` option for internal watch
842
+ *
843
+ * @default 'false'
844
+ */
845
+ deep?: WatchOptions['deep'];
846
+ }
847
+ interface UntilBaseInstance<T, Not extends boolean = false> {
848
+ toMatch: (<U extends T = T>(condition: (v: T) => v is U, options?: UntilToMatchOptions) => Not extends true ? Promise<Exclude<T, U>> : Promise<U>) & ((condition: (v: T) => boolean, options?: UntilToMatchOptions) => Promise<T>);
849
+ changed: (options?: UntilToMatchOptions) => Promise<T>;
850
+ changedTimes: (n?: number, options?: UntilToMatchOptions) => Promise<T>;
851
+ }
852
+ type Falsy = false | void | null | undefined | 0 | 0n | '';
853
+ interface UntilValueInstance<T, Not extends boolean = false> extends UntilBaseInstance<T, Not> {
854
+ readonly not: UntilValueInstance<T, Not extends true ? false : true>;
855
+ toBe: <P = T>(value: MaybeRefOrGetter<P>, options?: UntilToMatchOptions) => Not extends true ? Promise<T> : Promise<P>;
856
+ toBeTruthy: (options?: UntilToMatchOptions) => Not extends true ? Promise<T & Falsy> : Promise<Exclude<T, Falsy>>;
857
+ toBeNull: (options?: UntilToMatchOptions) => Not extends true ? Promise<Exclude<T, null>> : Promise<null>;
858
+ toBeUndefined: (options?: UntilToMatchOptions) => Not extends true ? Promise<Exclude<T, undefined>> : Promise<undefined>;
859
+ toBeNaN: (options?: UntilToMatchOptions) => Promise<T>;
860
+ }
861
+ interface UntilArrayInstance<T> extends UntilBaseInstance<T> {
862
+ readonly not: UntilArrayInstance<T>;
863
+ toContains: (value: MaybeRefOrGetter<ElementOf<ShallowUnwrapRef<T>>>, options?: UntilToMatchOptions) => Promise<T>;
864
+ }
865
+ /**
866
+ * Promised one-time watch for changes
867
+ *
868
+ * @see https://vueuse.org/until
869
+ * @example
870
+ * ```
871
+ * const { count } = useCounter()
872
+ *
873
+ * await until(count).toMatch(v => v > 7)
874
+ *
875
+ * alert('Counter is now larger than 7!')
876
+ * ```
877
+ */
878
+ declare function until<T extends unknown[]>(r: WatchSource<T> | MaybeRefOrGetter<T>): UntilArrayInstance<T>;
879
+ declare function until<T>(r: WatchSource<T> | MaybeRefOrGetter<T>): UntilValueInstance<T>;
880
+ //#endregion
881
+ //#region useArrayDifference/index.d.ts
882
+ interface UseArrayDifferenceOptions {
883
+ /**
884
+ * Returns asymmetric difference
885
+ *
886
+ * @see https://en.wikipedia.org/wiki/Symmetric_difference
887
+ * @default false
888
+ */
889
+ symmetric?: boolean;
890
+ }
891
+ type UseArrayDifferenceReturn<T = any> = ComputedRef<T[]>;
892
+ declare function useArrayDifference<T>(list: MaybeRefOrGetter<T[]>, values: MaybeRefOrGetter<T[]>, key?: keyof T, options?: UseArrayDifferenceOptions): UseArrayDifferenceReturn<T>;
893
+ declare function useArrayDifference<T>(list: MaybeRefOrGetter<T[]>, values: MaybeRefOrGetter<T[]>, compareFn?: (value: T, othVal: T) => boolean, options?: UseArrayDifferenceOptions): UseArrayDifferenceReturn<T>;
894
+ //#endregion
895
+ //#region useArrayEvery/index.d.ts
896
+ type UseArrayEveryReturn = ComputedRef<boolean>;
897
+ /**
898
+ * Reactive `Array.every`
899
+ *
900
+ * @see https://vueuse.org/useArrayEvery
901
+ * @param list - the array was called upon.
902
+ * @param fn - a function to test each element.
903
+ *
904
+ * @returns **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**.
905
+ *
906
+ * @__NO_SIDE_EFFECTS__
907
+ */
908
+ declare function useArrayEvery<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => unknown): UseArrayEveryReturn;
909
+ //#endregion
910
+ //#region useArrayFilter/index.d.ts
911
+ type UseArrayFilterReturn<T = any> = ComputedRef<T[]>;
912
+ /**
913
+ * Reactive `Array.filter`
914
+ *
915
+ * @see https://vueuse.org/useArrayFilter
916
+ * @param list - the array was called upon.
917
+ * @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.
918
+ *
919
+ * @returns a shallow copy of a portion of the given array, filtered down to just the elements from the given array that pass the test implemented by the provided function. If no elements pass the test, an empty array will be returned.
920
+ *
921
+ * @__NO_SIDE_EFFECTS__
922
+ */
923
+ declare function useArrayFilter<T, S extends T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => element is S): UseArrayFilterReturn<S>;
924
+ declare function useArrayFilter<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => unknown): UseArrayFilterReturn<T>;
925
+ //#endregion
926
+ //#region useArrayFind/index.d.ts
927
+ type UseArrayFindReturn<T = any> = ComputedRef<T | undefined>;
928
+ /**
929
+ * Reactive `Array.find`
930
+ *
931
+ * @see https://vueuse.org/useArrayFind
932
+ * @param list - the array was called upon.
933
+ * @param fn - a function to test each element.
934
+ *
935
+ * @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned.
936
+ *
937
+ * @__NO_SIDE_EFFECTS__
938
+ */
939
+ declare function useArrayFind<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => boolean): UseArrayFindReturn<T>;
940
+ //#endregion
941
+ //#region useArrayFindIndex/index.d.ts
942
+ type UseArrayFindIndexReturn = ComputedRef<number>;
943
+ /**
944
+ * Reactive `Array.findIndex`
945
+ *
946
+ * @see https://vueuse.org/useArrayFindIndex
947
+ * @param list - the array was called upon.
948
+ * @param fn - a function to test each element.
949
+ *
950
+ * @returns the index of the first element in the array that passes the test. Otherwise, "-1".
951
+ *
952
+ * @__NO_SIDE_EFFECTS__
953
+ */
954
+ declare function useArrayFindIndex<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => unknown): UseArrayFindIndexReturn;
955
+ //#endregion
956
+ //#region useArrayFindLast/index.d.ts
957
+ type UseArrayFindLastReturn<T = any> = ComputedRef<T | undefined>;
958
+ /**
959
+ * Reactive `Array.findLast`
960
+ *
961
+ * @see https://vueuse.org/useArrayFindLast
962
+ * @param list - the array was called upon.
963
+ * @param fn - a function to test each element.
964
+ *
965
+ * @returns the last element in the array that satisfies the provided testing function. Otherwise, undefined is returned.
966
+ *
967
+ * @__NO_SIDE_EFFECTS__
968
+ */
969
+ declare function useArrayFindLast<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => boolean): UseArrayFindLastReturn<T>;
970
+ //#endregion
971
+ //#region useArrayIncludes/index.d.ts
972
+ type UseArrayIncludesComparatorFn<T, V> = ((element: T, value: V, index: number, array: MaybeRefOrGetter<T>[]) => boolean);
973
+ interface UseArrayIncludesOptions<T, V> {
974
+ fromIndex?: number;
975
+ comparator?: UseArrayIncludesComparatorFn<T, V> | keyof T;
976
+ }
977
+ type UseArrayIncludesReturn = ComputedRef<boolean>;
978
+ /**
979
+ * Reactive `Array.includes`
980
+ *
981
+ * @see https://vueuse.org/useArrayIncludes
982
+ *
983
+ * @returns true if the `value` is found in the array. Otherwise, false.
984
+ *
985
+ * @__NO_SIDE_EFFECTS__
986
+ */
987
+ declare function useArrayIncludes<T, V = any>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, value: MaybeRefOrGetter<V>, comparator?: UseArrayIncludesComparatorFn<T, V>): UseArrayIncludesReturn;
988
+ declare function useArrayIncludes<T, V = any>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, value: MaybeRefOrGetter<V>, comparator?: keyof T): UseArrayIncludesReturn;
989
+ declare function useArrayIncludes<T, V = any>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, value: MaybeRefOrGetter<V>, options?: UseArrayIncludesOptions<T, V>): UseArrayIncludesReturn;
990
+ //#endregion
991
+ //#region useArrayJoin/index.d.ts
992
+ type UseArrayJoinReturn = ComputedRef<string>;
993
+ /**
994
+ * Reactive `Array.join`
995
+ *
996
+ * @see https://vueuse.org/useArrayJoin
997
+ * @param list - the array was called upon.
998
+ * @param separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (",").
999
+ *
1000
+ * @returns a string with all array elements joined. If arr.length is 0, the empty string is returned.
1001
+ *
1002
+ * @__NO_SIDE_EFFECTS__
1003
+ */
1004
+ declare function useArrayJoin(list: MaybeRefOrGetter<MaybeRefOrGetter<any>[]>, separator?: MaybeRefOrGetter<string>): UseArrayJoinReturn;
1005
+ //#endregion
1006
+ //#region useArrayMap/index.d.ts
1007
+ type UseArrayMapReturn<T = any> = ComputedRef<T[]>;
1008
+ /**
1009
+ * Reactive `Array.map`
1010
+ *
1011
+ * @see https://vueuse.org/useArrayMap
1012
+ * @param list - the array was called upon.
1013
+ * @param fn - a function that is called for every element of the given `list`. Each time `fn` executes, the returned value is added to the new array.
1014
+ *
1015
+ * @returns a new array with each element being the result of the callback function.
1016
+ *
1017
+ * @__NO_SIDE_EFFECTS__
1018
+ */
1019
+ declare function useArrayMap<T, U = T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: T[]) => U): UseArrayMapReturn<U>;
1020
+ //#endregion
1021
+ //#region useArrayReduce/index.d.ts
1022
+ type UseArrayReducer<PV, CV, R> = (previousValue: PV, currentValue: CV, currentIndex: number) => R;
1023
+ type UseArrayReduceReturn<T = any> = ComputedRef<T>;
1024
+ /**
1025
+ * Reactive `Array.reduce`
1026
+ *
1027
+ * @see https://vueuse.org/useArrayReduce
1028
+ * @param list - the array was called upon.
1029
+ * @param reducer - a "reducer" function.
1030
+ *
1031
+ * @returns the value that results from running the "reducer" callback function to completion over the entire array.
1032
+ *
1033
+ * @__NO_SIDE_EFFECTS__
1034
+ */
1035
+ declare function useArrayReduce<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, reducer: UseArrayReducer<T, T, T>): UseArrayReduceReturn<T>;
1036
+ /**
1037
+ * Reactive `Array.reduce`
1038
+ *
1039
+ * @see https://vueuse.org/useArrayReduce
1040
+ * @param list - the array was called upon.
1041
+ * @param reducer - a "reducer" function.
1042
+ * @param initialValue - a value to be initialized the first time when the callback is called.
1043
+ *
1044
+ * @returns the value that results from running the "reducer" callback function to completion over the entire array.
1045
+ *
1046
+ * @__NO_SIDE_EFFECTS__
1047
+ */
1048
+ declare function useArrayReduce<T, U>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, reducer: UseArrayReducer<U, T, U>, initialValue: MaybeRefOrGetter<U>): UseArrayReduceReturn<U>;
1049
+ //#endregion
1050
+ //#region useArraySome/index.d.ts
1051
+ type UseArraySomeReturn = ComputedRef<boolean>;
1052
+ /**
1053
+ * Reactive `Array.some`
1054
+ *
1055
+ * @see https://vueuse.org/useArraySome
1056
+ * @param list - the array was called upon.
1057
+ * @param fn - a function to test each element.
1058
+ *
1059
+ * @returns **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**.
1060
+ *
1061
+ * @__NO_SIDE_EFFECTS__
1062
+ */
1063
+ declare function useArraySome<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, fn: (element: T, index: number, array: MaybeRefOrGetter<T>[]) => unknown): UseArraySomeReturn;
1064
+ //#endregion
1065
+ //#region useArrayUnique/index.d.ts
1066
+ type UseArrayUniqueReturn<T = any> = ComputedRef<T[]>;
1067
+ /**
1068
+ * reactive unique array
1069
+ * @see https://vueuse.org/useArrayUnique
1070
+ * @param list - the array was called upon.
1071
+ * @param compareFn
1072
+ * @returns A computed ref that returns a unique array of items.
1073
+ *
1074
+ * @__NO_SIDE_EFFECTS__
1075
+ */
1076
+ declare function useArrayUnique<T>(list: MaybeRefOrGetter<MaybeRefOrGetter<T>[]>, compareFn?: (a: T, b: T, array: T[]) => boolean): UseArrayUniqueReturn<T>;
1077
+ //#endregion
1078
+ //#region useCounter/index.d.ts
1079
+ interface UseCounterOptions {
1080
+ min?: number;
1081
+ max?: number;
1082
+ }
1083
+ interface UseCounterReturn {
1084
+ /**
1085
+ * The current value of the counter.
1086
+ */
1087
+ readonly count: Readonly<Ref<number>>;
1088
+ /**
1089
+ * Increment the counter.
1090
+ *
1091
+ * @param {number} [delta=1] The number to increment.
1092
+ */
1093
+ inc: (delta?: number) => void;
1094
+ /**
1095
+ * Decrement the counter.
1096
+ *
1097
+ * @param {number} [delta=1] The number to decrement.
1098
+ */
1099
+ dec: (delta?: number) => void;
1100
+ /**
1101
+ * Get the current value of the counter.
1102
+ */
1103
+ get: () => number;
1104
+ /**
1105
+ * Set the counter to a new value.
1106
+ *
1107
+ * @param val The new value of the counter.
1108
+ */
1109
+ set: (val: number) => void;
1110
+ /**
1111
+ * Reset the counter to an initial value.
1112
+ */
1113
+ reset: (val?: number) => number;
1114
+ }
1115
+ /**
1116
+ * Basic counter with utility functions.
1117
+ *
1118
+ * @see https://vueuse.org/useCounter
1119
+ * @param [initialValue]
1120
+ * @param options
1121
+ */
1122
+ declare function useCounter(initialValue?: MaybeRef<number>, options?: UseCounterOptions): {
1123
+ count: Readonly<Ref<number, number> | _$vue.ShallowRef<number, number> | _$vue.WritableComputedRef<number, number>>;
1124
+ inc: (delta?: number) => number;
1125
+ dec: (delta?: number) => number;
1126
+ get: () => number;
1127
+ set: (val: number) => number;
1128
+ reset: (val?: number) => number;
1129
+ };
1130
+ //#endregion
1131
+ //#region useDateFormat/index.d.ts
1132
+ type DateLike = Date | number | string | undefined;
1133
+ interface UseDateFormatOptions {
1134
+ /**
1135
+ * The locale(s) to used for dd/ddd/dddd/MMM/MMMM format
1136
+ *
1137
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
1138
+ */
1139
+ locales?: MaybeRefOrGetter<Intl.LocalesArgument>;
1140
+ /**
1141
+ * A custom function to re-modify the way to display meridiem
1142
+ *
1143
+ */
1144
+ customMeridiem?: (hours: number, minutes: number, isLowercase?: boolean, hasPeriod?: boolean) => string;
1145
+ }
1146
+ declare function formatDate(date: Date, formatStr: string, options?: UseDateFormatOptions): string;
1147
+ declare function normalizeDate(date: DateLike): Date;
1148
+ type UseDateFormatReturn = ComputedRef<string>;
1149
+ /**
1150
+ * Get the formatted date according to the string of tokens passed in.
1151
+ *
1152
+ * @see https://vueuse.org/useDateFormat
1153
+ * @param date - The date to format, can either be a `Date` object, a timestamp, or a string
1154
+ * @param formatStr - The combination of tokens to format the date
1155
+ * @param options - UseDateFormatOptions
1156
+ *
1157
+ * @__NO_SIDE_EFFECTS__
1158
+ */
1159
+ declare function useDateFormat(date: MaybeRefOrGetter<DateLike>, formatStr?: MaybeRefOrGetter<string>, options?: UseDateFormatOptions): UseDateFormatReturn;
1160
+ //#endregion
1161
+ //#region useDebounceFn/index.d.ts
1162
+ type UseDebounceFnReturn<T extends FunctionArgs> = PromisifyFn<T>;
1163
+ /**
1164
+ * Debounce execution of a function.
1165
+ *
1166
+ * @see https://vueuse.org/useDebounceFn
1167
+ * @param fn A function to be executed after delay milliseconds debounced.
1168
+ * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
1169
+ * @param options Options
1170
+ *
1171
+ * @return A new, debounce, function.
1172
+ *
1173
+ * @__NO_SIDE_EFFECTS__
1174
+ */
1175
+ declare function useDebounceFn<T extends FunctionArgs>(fn: T, ms?: MaybeRefOrGetter<number>, options?: DebounceFilterOptions): UseDebounceFnReturn<T>;
1176
+ //#endregion
1177
+ //#region useInterval/index.d.ts
1178
+ interface UseIntervalOptions<Controls extends boolean> {
1179
+ /**
1180
+ * Expose more controls
1181
+ *
1182
+ * @default false
1183
+ */
1184
+ controls?: Controls;
1185
+ /**
1186
+ * Execute the update immediately on calling
1187
+ *
1188
+ * @default true
1189
+ */
1190
+ immediate?: boolean;
1191
+ /**
1192
+ * Callback on every interval
1193
+ */
1194
+ callback?: (count: number) => void;
1195
+ }
1196
+ interface UseIntervalControls {
1197
+ counter: ShallowRef<number>;
1198
+ reset: () => void;
1199
+ }
1200
+ type UseIntervalReturn = Readonly<ShallowRef<number>> | Readonly<UseIntervalControls & Pausable>;
1201
+ /**
1202
+ * Reactive counter increases on every interval
1203
+ *
1204
+ * @see https://vueuse.org/useInterval
1205
+ * @param interval
1206
+ * @param options
1207
+ */
1208
+ declare function useInterval(interval?: MaybeRefOrGetter<number>, options?: UseIntervalOptions<false>): Readonly<ShallowRef<number>>;
1209
+ declare function useInterval(interval: MaybeRefOrGetter<number>, options: UseIntervalOptions<true>): Readonly<UseIntervalControls & Pausable>;
1210
+ //#endregion
1211
+ //#region useIntervalFn/index.d.ts
1212
+ interface UseIntervalFnOptions {
1213
+ /**
1214
+ * Start the timer immediately
1215
+ *
1216
+ * @default true
1217
+ */
1218
+ immediate?: boolean;
1219
+ /**
1220
+ * Execute the callback immediately after calling `resume`
1221
+ *
1222
+ * @default false
1223
+ */
1224
+ immediateCallback?: boolean;
1225
+ }
1226
+ type UseIntervalFnReturn = Pausable;
1227
+ /**
1228
+ * Wrapper for `setInterval` with controls
1229
+ *
1230
+ * @see https://vueuse.org/useIntervalFn
1231
+ * @param cb
1232
+ * @param interval
1233
+ * @param options
1234
+ */
1235
+ declare function useIntervalFn(cb: Fn, interval?: MaybeRefOrGetter<number>, options?: UseIntervalFnOptions): UseIntervalFnReturn;
1236
+ //#endregion
1237
+ //#region useLastChanged/index.d.ts
1238
+ interface UseLastChangedOptions<Immediate extends boolean, InitialValue extends number | null | undefined = undefined> extends WatchOptions<Immediate> {
1239
+ initialValue?: InitialValue;
1240
+ }
1241
+ type UseLastChangedReturn = Readonly<ShallowRef<number | null>> | Readonly<ShallowRef<number>>;
1242
+ /**
1243
+ * Records the timestamp of the last change
1244
+ *
1245
+ * @see https://vueuse.org/useLastChanged
1246
+ */
1247
+ declare function useLastChanged(source: WatchSource, options?: UseLastChangedOptions<false>): Readonly<ShallowRef<number | null>>;
1248
+ declare function useLastChanged(source: WatchSource, options: UseLastChangedOptions<true> | UseLastChangedOptions<boolean, number>): Readonly<ShallowRef<number>>;
1249
+ //#endregion
1250
+ //#region useThrottleFn/index.d.ts
1251
+ /**
1252
+ * Throttle execution of a function. Especially useful for rate limiting
1253
+ * execution of handlers on events like resize and scroll.
1254
+ *
1255
+ * @param fn A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
1256
+ * to `callback` when the throttled-function is executed.
1257
+ * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
1258
+ * (default value: 200)
1259
+ *
1260
+ * @param [trailing] if true, call fn again after the time is up (default value: false)
1261
+ *
1262
+ * @param [leading] if true, call fn on the leading edge of the ms timeout (default value: true)
1263
+ *
1264
+ * @param [rejectOnCancel] if true, reject the last call if it's been cancel (default value: false)
1265
+ *
1266
+ * @return A new, throttled, function.
1267
+ *
1268
+ * @__NO_SIDE_EFFECTS__
1269
+ */
1270
+ declare function useThrottleFn<T extends FunctionArgs>(fn: T, ms?: MaybeRefOrGetter<number>, trailing?: boolean, leading?: boolean, rejectOnCancel?: boolean): PromisifyFn<T>;
1271
+ //#endregion
1272
+ //#region useTimeoutFn/index.d.ts
1273
+ interface UseTimeoutFnOptions {
1274
+ /**
1275
+ * Start the timer immediately
1276
+ *
1277
+ * @default true
1278
+ */
1279
+ immediate?: boolean;
1280
+ /**
1281
+ * Execute the callback immediately after calling `start`
1282
+ *
1283
+ * @default false
1284
+ */
1285
+ immediateCallback?: boolean;
1286
+ }
1287
+ type UseTimeoutFnReturn<CallbackFn extends AnyFn> = Stoppable<Parameters<CallbackFn> | []>;
1288
+ /**
1289
+ * Wrapper for `setTimeout` with controls.
1290
+ *
1291
+ * @param cb
1292
+ * @param interval
1293
+ * @param options
1294
+ */
1295
+ declare function useTimeoutFn<CallbackFn extends AnyFn>(cb: CallbackFn, interval: MaybeRefOrGetter<number>, options?: UseTimeoutFnOptions): UseTimeoutFnReturn<CallbackFn>;
1296
+ //#endregion
1297
+ //#region useTimeout/index.d.ts
1298
+ interface UseTimeoutOptions<Controls extends boolean> extends UseTimeoutFnOptions {
1299
+ /**
1300
+ * Expose more controls
1301
+ *
1302
+ * @default false
1303
+ */
1304
+ controls?: Controls;
1305
+ /**
1306
+ * Callback on timeout
1307
+ */
1308
+ callback?: Fn;
1309
+ }
1310
+ type UseTimeoutReturn = ComputedRef<boolean> | {
1311
+ readonly ready: ComputedRef<boolean>;
1312
+ } & Stoppable;
1313
+ /**
1314
+ * @deprecated use UseTimeoutReturn instead
1315
+ */
1316
+ type UseTimoutReturn = UseTimeoutReturn;
1317
+ /**
1318
+ * Update value after a given time with controls.
1319
+ *
1320
+ * @see {@link https://vueuse.org/useTimeout}
1321
+ * @param interval
1322
+ * @param options
1323
+ */
1324
+ declare function useTimeout(interval?: MaybeRefOrGetter<number>, options?: UseTimeoutOptions<false>): ComputedRef<boolean>;
1325
+ declare function useTimeout(interval: MaybeRefOrGetter<number>, options: UseTimeoutOptions<true>): {
1326
+ ready: ComputedRef<boolean>;
1327
+ } & Stoppable;
1328
+ //#endregion
1329
+ //#region useToNumber/index.d.ts
1330
+ interface UseToNumberOptions {
1331
+ /**
1332
+ * Method to use to convert the value to a number.
1333
+ *
1334
+ * Or a custom function for the conversion.
1335
+ *
1336
+ * @default 'parseFloat'
1337
+ */
1338
+ method?: 'parseFloat' | 'parseInt' | ((value: string | number) => number);
1339
+ /**
1340
+ * The base in mathematical numeral systems passed to `parseInt`.
1341
+ * Only works with `method: 'parseInt'`
1342
+ */
1343
+ radix?: number;
1344
+ /**
1345
+ * Replace NaN with zero
1346
+ *
1347
+ * @default false
1348
+ */
1349
+ nanToZero?: boolean;
1350
+ }
1351
+ /**
1352
+ * Reactively convert a string ref to number.
1353
+ *
1354
+ * @__NO_SIDE_EFFECTS__
1355
+ */
1356
+ declare function useToNumber(value: MaybeRefOrGetter<number | string>, options?: UseToNumberOptions): ComputedRef<number>;
1357
+ //#endregion
1358
+ //#region useToString/index.d.ts
1359
+ /**
1360
+ * Reactively convert a ref to string.
1361
+ *
1362
+ * @see https://vueuse.org/useToString
1363
+ *
1364
+ * @__NO_SIDE_EFFECTS__
1365
+ */
1366
+ declare function useToString(value: MaybeRefOrGetter<unknown>): ComputedRef<string>;
1367
+ //#endregion
1368
+ //#region useToggle/index.d.ts
1369
+ type ToggleFn = (value?: boolean) => void;
1370
+ type UseToggleReturn = [ShallowRef<boolean>, ToggleFn] | ToggleFn;
1371
+ interface UseToggleOptions<Truthy, Falsy> {
1372
+ truthyValue?: MaybeRefOrGetter<Truthy>;
1373
+ falsyValue?: MaybeRefOrGetter<Falsy>;
1374
+ }
1375
+ declare function useToggle<Truthy, Falsy, T = Truthy | Falsy>(initialValue: Ref<T>, options?: UseToggleOptions<Truthy, Falsy>): (value?: T) => T;
1376
+ declare function useToggle<Truthy = true, Falsy = false, T = Truthy | Falsy>(initialValue?: T, options?: UseToggleOptions<Truthy, Falsy>): [ShallowRef<T>, (value?: T) => T];
1377
+ //#endregion
1378
+ //#region watchArray/index.d.ts
1379
+ declare type WatchArrayCallback<V = any, OV = any> = (value: V, oldValue: OV, added: V, removed: OV, onCleanup: (cleanupFn: () => void) => void) => any;
1380
+ /**
1381
+ * Watch for an array with additions and removals.
1382
+ *
1383
+ * @see https://vueuse.org/watchArray
1384
+ */
1385
+ declare function watchArray<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T[]> | T[], cb: WatchArrayCallback<T[], Immediate extends true ? T[] | undefined : T[]>, options?: WatchOptions<Immediate>): _$vue.WatchHandle;
1386
+ //#endregion
1387
+ //#region watchWithFilter/index.d.ts
1388
+ interface WatchWithFilterOptions<Immediate> extends WatchOptions<Immediate>, ConfigurableEventFilter {}
1389
+ declare function watchWithFilter<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchHandle;
1390
+ declare function watchWithFilter<T extends Readonly<MultiWatchSources$1>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchWithFilterOptions<Immediate>): WatchHandle;
1391
+ declare function watchWithFilter<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchHandle;
1392
+ //#endregion
1393
+ //#region watchAtMost/index.d.ts
1394
+ interface WatchAtMostOptions<Immediate> extends WatchWithFilterOptions<Immediate> {
1395
+ count: MaybeRefOrGetter<number>;
1396
+ }
1397
+ interface WatchAtMostReturn {
1398
+ stop: WatchStopHandle;
1399
+ pause: () => void;
1400
+ resume: () => void;
1401
+ count: ShallowRef<number>;
1402
+ }
1403
+ 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;
1404
+ declare function watchAtMost<T extends Readonly<MultiWatchSources$1>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options: WatchAtMostOptions<Immediate>): WatchAtMostReturn;
1405
+ declare function watchAtMost<T extends object, Immediate extends Readonly<boolean> = false>(sources: T, cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options: WatchAtMostOptions<Immediate>): WatchAtMostReturn;
1406
+ //#endregion
1407
+ //#region watchDebounced/index.d.ts
1408
+ interface WatchDebouncedOptions<Immediate> extends WatchOptions<Immediate>, DebounceFilterOptions {
1409
+ debounce?: MaybeRefOrGetter<number>;
1410
+ }
1411
+ declare function watchDebounced<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchDebouncedOptions<Immediate>): WatchHandle;
1412
+ declare function watchDebounced<T extends Readonly<MultiWatchSources$1>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchDebouncedOptions<Immediate>): WatchHandle;
1413
+ declare function watchDebounced<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchDebouncedOptions<Immediate>): WatchHandle;
1414
+ /** @deprecated use `watchDebounced` instead */
1415
+ declare const debouncedWatch: typeof watchDebounced;
1416
+ //#endregion
1417
+ //#region watchDeep/index.d.ts
1418
+ declare function watchDeep<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: Omit<WatchOptions<Immediate>, 'deep'>): WatchHandle;
1419
+ declare function watchDeep<T extends Readonly<MultiWatchSources$1>, Immediate extends Readonly<boolean> = false>(source: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: Omit<WatchOptions<Immediate>, 'deep'>): WatchHandle;
1420
+ declare function watchDeep<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: Omit<WatchOptions<Immediate>, 'deep'>): WatchHandle;
1421
+ //#endregion
1422
+ //#region watchIgnorable/index.d.ts
1423
+ type IgnoredUpdater = (updater: () => void) => void;
1424
+ type IgnoredPrevAsyncUpdates = () => void;
1425
+ interface WatchIgnorableReturn {
1426
+ ignoreUpdates: IgnoredUpdater;
1427
+ ignorePrevAsyncUpdates: IgnoredPrevAsyncUpdates;
1428
+ stop: WatchStopHandle;
1429
+ }
1430
+ declare function watchIgnorable<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchIgnorableReturn;
1431
+ declare function watchIgnorable<T extends Readonly<MultiWatchSources$1>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchWithFilterOptions<Immediate>): WatchIgnorableReturn;
1432
+ declare function watchIgnorable<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchIgnorableReturn;
1433
+ /** @deprecated use `watchIgnorable` instead */
1434
+ declare const ignorableWatch: typeof watchIgnorable;
1435
+ //#endregion
1436
+ //#region watchImmediate/index.d.ts
1437
+ declare function watchImmediate<T>(source: WatchSource<T>, cb: WatchCallback<T, T | undefined>, options?: Omit<WatchOptions<true>, 'immediate'>): WatchHandle;
1438
+ declare function watchImmediate<T extends Readonly<MultiWatchSources$1>>(source: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, true>>, options?: Omit<WatchOptions<true>, 'immediate'>): WatchHandle;
1439
+ declare function watchImmediate<T extends object>(source: T, cb: WatchCallback<T, T | undefined>, options?: Omit<WatchOptions<true>, 'immediate'>): WatchHandle;
1440
+ //#endregion
1441
+ //#region watchOnce/index.d.ts
1442
+ declare function watchOnce<T>(source: WatchSource<T>, cb: WatchCallback<T, T | undefined>, options?: Omit<WatchOptions<true>, 'once'>): WatchHandle;
1443
+ declare function watchOnce<T extends Readonly<MultiWatchSources$1>>(source: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, true>>, options?: Omit<WatchOptions<true>, 'once'>): WatchHandle;
1444
+ declare function watchOnce<T extends object>(source: T, cb: WatchCallback<T, T | undefined>, options?: Omit<WatchOptions<true>, 'once'>): WatchHandle;
1445
+ //#endregion
1446
+ //#region watchPausable/index.d.ts
1447
+ interface WatchPausableReturn extends Pausable {
1448
+ stop: WatchStopHandle;
1449
+ }
1450
+ type WatchPausableOptions<Immediate> = WatchWithFilterOptions<Immediate> & PausableFilterOptions;
1451
+ /** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */
1452
+ 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;
1453
+ /** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */
1454
+ declare function watchPausable<T extends Readonly<MultiWatchSources$1>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchPausableOptions<Immediate>): WatchPausableReturn;
1455
+ /** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */
1456
+ 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;
1457
+ /** @deprecated Use Vue's built-in `watch` instead. This function will be removed in future version. */
1458
+ declare const pausableWatch: typeof watchPausable;
1459
+ //#endregion
1460
+ //#region watchThrottled/index.d.ts
1461
+ interface WatchThrottledOptions<Immediate> extends WatchOptions<Immediate> {
1462
+ throttle?: MaybeRefOrGetter<number>;
1463
+ trailing?: boolean;
1464
+ leading?: boolean;
1465
+ }
1466
+ declare function watchThrottled<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchThrottledOptions<Immediate>): WatchHandle;
1467
+ declare function watchThrottled<T extends Readonly<MultiWatchSources$1>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchThrottledOptions<Immediate>): WatchHandle;
1468
+ declare function watchThrottled<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchThrottledOptions<Immediate>): WatchHandle;
1469
+ /** @deprecated use `watchThrottled` instead */
1470
+ declare const throttledWatch: typeof watchThrottled;
1471
+ //#endregion
1472
+ //#region watchTriggerable/index.d.ts
1473
+ interface WatchTriggerableReturn<FnReturnT = void> extends WatchIgnorableReturn {
1474
+ /** Execute `WatchCallback` immediately */
1475
+ trigger: () => FnReturnT;
1476
+ }
1477
+ type OnCleanup = (cleanupFn: () => void) => void;
1478
+ type WatchTriggerableCallback<V = any, OV = any, R = void> = (value: V, oldValue: OV, onCleanup: OnCleanup) => R;
1479
+ declare function watchTriggerable<T, FnReturnT>(source: WatchSource<T>, cb: WatchTriggerableCallback<T, T | undefined, FnReturnT>, options?: WatchWithFilterOptions<boolean>): WatchTriggerableReturn<FnReturnT>;
1480
+ declare function watchTriggerable<T extends Readonly<MultiWatchSources$1>, FnReturnT>(sources: [...T], cb: WatchTriggerableCallback<MapSources<T>, MapOldSources<T, true>, FnReturnT>, options?: WatchWithFilterOptions<boolean>): WatchTriggerableReturn<FnReturnT>;
1481
+ declare function watchTriggerable<T extends object, FnReturnT>(source: T, cb: WatchTriggerableCallback<T, T | undefined, FnReturnT>, options?: WatchWithFilterOptions<boolean>): WatchTriggerableReturn<FnReturnT>;
1482
+ //#endregion
1483
+ //#region whenever/index.d.ts
1484
+ type Truthy<T> = T extends false | null | undefined ? never : T;
1485
+ interface WheneverOptions<Immediate = boolean> extends WatchOptions<Immediate> {
1486
+ /**
1487
+ * Only trigger once when the condition is met
1488
+ *
1489
+ * Override the `once` option in `WatchOptions`
1490
+ *
1491
+ * @default false
1492
+ */
1493
+ once?: boolean;
1494
+ }
1495
+ /**
1496
+ * Shorthand for watching value to be truthy
1497
+ *
1498
+ * @see https://vueuse.org/whenever
1499
+ */
1500
+ declare function whenever<T>(source: WatchSource<T>, cb: WatchCallback<Truthy<T>, T | undefined>, options?: WheneverOptions<true>): WatchHandle;
1501
+ declare function whenever<T>(source: WatchSource<T>, cb: WatchCallback<Truthy<T>, T>, options?: WheneverOptions<false>): WatchHandle;
1502
+ //#endregion
1503
+ export { AnyFn, ArgumentsType, Arrayable, Awaitable, Awaited, ComputedEagerOptions, ComputedEagerReturn, ComputedRefWithControl, ComputedWithControlRef, ComputedWithControlRefExtra, ConfigurableEventFilter, ConfigurableFlush, ConfigurableFlushSync, ControlledRefOptions, CreateGlobalStateReturn, CreateInjectionStateOptions, CreateInjectionStateReturn, CreateRefReturn, DateLike, DebounceFilterOptions, DeepMaybeRef, ElementOf, EventFilter, EventHook, EventHookOff, EventHookOn, EventHookReturn, EventHookTrigger, ExtendRefOptions, ExtendRefReturn, Fn, FunctionArgs, FunctionWrapperOptions, IfAny, IgnoredPrevAsyncUpdates, IgnoredUpdater, InstanceProxy, IsAny, IsDefinedReturn, ManualResetRefReturn, MapOldSources, MapSources, type MultiWatchSources, Mutable, Pausable, PausableFilterOptions, Promisify, PromisifyFn, ProvideLocalReturn, Reactified, ReactifyNested, ReactifyObjectOptions, ReactifyObjectReturn, ReactifyOptions, ReactifyReturn, ReactiveComputedReturn, ReactiveOmitPredicate, ReactiveOmitReturn, ReactivePickPredicate, ReactivePickReturn, ReadonlyRefOrGetter, RefAutoResetReturn, RefDebouncedReturn, RefThrottledReturn, RemovableRef, ShallowOrDeepRef, ShallowUnwrapRef, SharedComposableReturn, SingletonPromiseReturn, Stoppable, SyncRefOptions, SyncRefsOptions, ThrottleFilterOptions, TimerHandle, ToRefsOptions, ToggleFn, UntilArrayInstance, UntilBaseInstance, UntilToMatchOptions, UntilValueInstance, UseArrayDifferenceOptions, UseArrayDifferenceReturn, UseArrayEveryReturn, UseArrayFilterReturn, UseArrayFindIndexReturn, UseArrayFindLastReturn, UseArrayFindReturn, UseArrayIncludesComparatorFn, UseArrayIncludesOptions, UseArrayIncludesReturn, UseArrayJoinReturn, UseArrayMapReturn, UseArrayReduceReturn, UseArrayReducer, UseArraySomeReturn, UseArrayUniqueReturn, UseCounterOptions, UseCounterReturn, UseDateFormatOptions, UseDateFormatReturn, UseDebounceFnReturn, UseIntervalControls, UseIntervalFnOptions, UseIntervalFnReturn, UseIntervalOptions, UseIntervalReturn, UseLastChangedOptions, UseLastChangedReturn, UseTimeoutFnOptions, UseTimeoutFnReturn, UseTimeoutOptions, UseTimeoutReturn, UseTimoutReturn, UseToNumberOptions, UseToggleOptions, UseToggleReturn, WatchArrayCallback, WatchAtMostOptions, WatchAtMostReturn, WatchDebouncedOptions, WatchIgnorableReturn, WatchOptionFlush, WatchPausableOptions, WatchPausableReturn, WatchThrottledOptions, WatchTriggerableCallback, WatchTriggerableReturn, WatchWithFilterOptions, WheneverOptions, WritableComputedRefWithControl, assert, autoResetRef, bypassFilter, camelize, clamp, computedEager, computedWithControl, containsProp, controlledComputed, controlledRef, createDisposableDirective, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, createReactiveFn, createRef, createSharedComposable, createSingletonPromise, debounceFilter, debouncedRef, debouncedWatch, eagerComputed, extendRef, formatDate, get, getLifeCycleTarget, hasOwn, hyphenate, identity, ignorableWatch, increaseWithUnit, injectLocal, invoke, isClient, isDef, isDefined, isIOS, isObject, isWorker, makeDestructurable, noop, normalizeDate, notNullish, now, objectEntries, objectOmit, objectPick, pausableFilter, pausableWatch, promiseTimeout, provideLocal, pxValue, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refManualReset, refThrottled, refWithControl, set, syncRef, syncRefs, throttleFilter, throttledRef, throttledWatch, timestamp, toArray, toReactive, toRef, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayDifference, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, useArrayIncludes, useArrayJoin, useArrayMap, useArrayReduce, useArraySome, useArrayUnique, useCounter, useDateFormat, useDebounce, useDebounceFn, useInterval, useIntervalFn, useLastChanged, useThrottle, useThrottleFn, useTimeout, useTimeoutFn, useToNumber, useToString, useToggle, watchArray, watchAtMost, watchDebounced, watchDeep, watchIgnorable, watchImmediate, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };