@mc-markets/ui 1.0.34 → 1.0.37

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.
Files changed (84) hide show
  1. package/README.md +0 -614
  2. package/dist/{packages/index.d.ts → index.d.ts} +2 -1
  3. package/dist/index.js +4 -3
  4. package/dist/node_modules/@babel/parser/typings/babel-parser.d.ts +235 -0
  5. package/dist/node_modules/@babel/types/lib/index.d.ts +3308 -0
  6. package/dist/node_modules/@ctrl/tinycolor/dist/conversion.d.ts +61 -0
  7. package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.d.ts +4 -0
  8. package/dist/node_modules/@ctrl/tinycolor/dist/format-input.d.ts +37 -0
  9. package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.d.ts +14 -0
  10. package/dist/node_modules/@ctrl/tinycolor/dist/index.d.ts +207 -0
  11. package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.d.ts +46 -0
  12. package/dist/node_modules/@ctrl/tinycolor/dist/public_api.d.ts +11 -0
  13. package/dist/node_modules/@ctrl/tinycolor/dist/random.d.ts +24 -0
  14. package/dist/node_modules/@ctrl/tinycolor/dist/readability.d.ts +46 -0
  15. package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.d.ts +5 -0
  16. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +514 -0
  17. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts +327 -0
  18. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +103 -0
  19. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +47 -0
  20. package/dist/node_modules/@types/lodash/common/array.d.ts +2137 -0
  21. package/dist/node_modules/@types/lodash/common/collection.d.ts +1938 -0
  22. package/dist/node_modules/@types/lodash/common/common.d.ts +287 -0
  23. package/dist/node_modules/@types/lodash/common/date.d.ts +23 -0
  24. package/dist/node_modules/@types/lodash/common/function.d.ts +1455 -0
  25. package/dist/node_modules/@types/lodash/common/lang.d.ts +1700 -0
  26. package/dist/node_modules/@types/lodash/common/math.d.ts +405 -0
  27. package/dist/node_modules/@types/lodash/common/number.d.ts +131 -0
  28. package/dist/node_modules/@types/lodash/common/object.d.ts +2643 -0
  29. package/dist/node_modules/@types/lodash/common/seq.d.ts +210 -0
  30. package/dist/node_modules/@types/lodash/common/string.d.ts +788 -0
  31. package/dist/node_modules/@types/lodash/common/util.d.ts +1220 -0
  32. package/dist/node_modules/@types/lodash/index.d.ts +21 -0
  33. package/dist/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +1093 -0
  34. package/dist/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +45 -0
  35. package/dist/node_modules/@vue/reactivity/dist/reactivity.d.ts +756 -0
  36. package/dist/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +1839 -0
  37. package/dist/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +1397 -0
  38. package/dist/node_modules/@vue/shared/dist/shared.d.ts +335 -0
  39. package/dist/node_modules/@vueuse/core/index.d.ts +4536 -0
  40. package/dist/node_modules/@vueuse/core/node_modules/vue-demi/lib/index.d.ts +22 -0
  41. package/dist/node_modules/@vueuse/shared/index.d.ts +1072 -0
  42. package/dist/node_modules/@vueuse/shared/node_modules/vue-demi/lib/index.d.ts +22 -0
  43. package/dist/node_modules/async-validator/dist-types/index.d.ts +43 -0
  44. package/dist/node_modules/async-validator/dist-types/interface.d.ts +135 -0
  45. package/dist/node_modules/csstype/index.d.ts +21297 -0
  46. package/dist/node_modules/dayjs/index.d.ts +429 -0
  47. package/dist/node_modules/dayjs/locale/index.d.ts +11 -0
  48. package/dist/node_modules/dayjs/locale/types.d.ts +33 -0
  49. package/dist/node_modules/element-plus/es/index.d.ts +26960 -0
  50. package/dist/node_modules/element-plus/es/utils/vue3.3.polyfill.d.ts +34 -0
  51. package/dist/node_modules/memoize-one/dist/memoize-one.d.ts +7 -0
  52. package/dist/node_modules/vue/dist/vue.d.mts +7 -0
  53. package/dist/style.css +1 -1
  54. package/dist/{packages/styles → styles}/theme-config.d.ts +0 -2
  55. package/dist/types/auto-imports.d.ts +84 -0
  56. package/dist/types/components.d.ts +55 -0
  57. package/package.json +5 -2
  58. package/packages/styles/element/form.scss +27 -0
  59. package/packages/styles/index.scss +5 -4
  60. package/packages/styles/theme-config.ts +0 -24
  61. package/packages/styles/variables.scss +130 -137
  62. package/USAGE.md +0 -383
  63. package/dist/src/main.d.ts +0 -0
  64. package/dist/src/utils/theme.d.ts +0 -66
  65. package/dist/vite.config.d.ts +0 -2
  66. /package/dist/{packages/components → components}/Alert/Alert.vue.d.ts +0 -0
  67. /package/dist/{packages/components → components}/Alert/index.d.ts +0 -0
  68. /package/dist/{packages/components → components}/Banner/Banner.vue.d.ts +0 -0
  69. /package/dist/{packages/components → components}/Banner/index.d.ts +0 -0
  70. /package/dist/{packages/components → components}/DatePicker/DatePicker.vue.d.ts +0 -0
  71. /package/dist/{packages/components → components}/DatePicker/index.d.ts +0 -0
  72. /package/dist/{packages/components → components}/Dialog/index.vue.d.ts +0 -0
  73. /package/dist/{packages/components → components}/Empty/Empty.vue.d.ts +0 -0
  74. /package/dist/{packages/components → components}/Empty/index.d.ts +0 -0
  75. /package/dist/{packages/components → components}/Icon/index.d.ts +0 -0
  76. /package/dist/{packages/components → components}/Icon/types.d.ts +0 -0
  77. /package/dist/{packages/components → components}/Notification/Notification.vue.d.ts +0 -0
  78. /package/dist/{packages/components → components}/Notification/index.d.ts +0 -0
  79. /package/dist/{packages/components → components}/Pagination/Pagination.vue.d.ts +0 -0
  80. /package/dist/{packages/components → components}/Pagination/index.d.ts +0 -0
  81. /package/dist/{packages/components → components}/Tab/Tab.vue.d.ts +0 -0
  82. /package/dist/{packages/components → components}/Tab/TabPane.vue.d.ts +0 -0
  83. /package/dist/{packages/components → components}/Tooltips/Tooltips.vue.d.ts +0 -0
  84. /package/dist/{packages/components → components}/Tooltips/index.d.ts +0 -0
@@ -0,0 +1,1072 @@
1
+ import { WatchOptionsBase, Ref, ComputedRef, WritableComputedRef, WatchSource, ComputedGetter, WritableComputedOptions, ShallowUnwrapRef as ShallowUnwrapRef$1, WatchOptions, UnwrapRef, ToRefs, WatchCallback, WatchStopHandle } from 'vue-demi';
2
+ import * as vue_demi from 'vue-demi';
3
+
4
+ declare function computedEager<T>(fn: () => T, options?: WatchOptionsBase): Readonly<Ref<T>>;
5
+
6
+ interface ComputedWithControlRefExtra {
7
+ /**
8
+ * Force update the computed value.
9
+ */
10
+ trigger(): void;
11
+ }
12
+ interface ComputedRefWithControl<T> extends ComputedRef<T>, ComputedWithControlRefExtra {
13
+ }
14
+ interface WritableComputedRefWithControl<T> extends WritableComputedRef<T>, ComputedWithControlRefExtra {
15
+ }
16
+ declare function computedWithControl<T, S>(source: WatchSource<S> | WatchSource<S>[], fn: ComputedGetter<T>): ComputedRefWithControl<T>;
17
+ declare function computedWithControl<T, S>(source: WatchSource<S> | WatchSource<S>[], fn: WritableComputedOptions<T>): WritableComputedRefWithControl<T>;
18
+
19
+ type EventHookOn<T = any> = (fn: (param: T) => void) => {
20
+ off: () => void;
21
+ };
22
+ type EventHookOff<T = any> = (fn: (param: T) => void) => void;
23
+ type EventHookTrigger<T = any> = (param: T) => void;
24
+ interface EventHook<T = any> {
25
+ on: EventHookOn<T>;
26
+ off: EventHookOff<T>;
27
+ trigger: EventHookTrigger<T>;
28
+ }
29
+ /**
30
+ * Utility for creating event hooks
31
+ *
32
+ * @see https://vueuse.org/createEventHook
33
+ */
34
+ declare function createEventHook<T = any>(): EventHook<T>;
35
+
36
+ type CreateGlobalStateReturn<T> = () => T;
37
+ /**
38
+ * Keep states in the global scope to be reusable across Vue instances.
39
+ *
40
+ * @see https://vueuse.org/createGlobalState
41
+ * @param stateFactory A factory function to create the state
42
+ */
43
+ declare function createGlobalState<T>(stateFactory: () => T): CreateGlobalStateReturn<T>;
44
+
45
+ /**
46
+ * Create global state that can be injected into components.
47
+ *
48
+ * @see https://vueuse.org/createInjectionState
49
+ *
50
+ */
51
+ declare function createInjectionState<Arguments extends Array<any>, Return>(composable: (...args: Arguments) => Return): readonly [useProvidingState: (...args: Arguments) => Return, useInjectedState: () => Return | undefined];
52
+
53
+ /**
54
+ * Make a composable function usable with multiple Vue instances.
55
+ *
56
+ * @see https://vueuse.org/createSharedComposable
57
+ */
58
+ declare function createSharedComposable<Fn extends ((...args: any[]) => any)>(composable: Fn): Fn;
59
+
60
+ interface ExtendRefOptions<Unwrap extends boolean = boolean> {
61
+ /**
62
+ * Is the extends properties enumerable
63
+ *
64
+ * @default false
65
+ */
66
+ enumerable?: boolean;
67
+ /**
68
+ * Unwrap for Ref properties
69
+ *
70
+ * @default true
71
+ */
72
+ unwrap?: Unwrap;
73
+ }
74
+ /**
75
+ * Overload 1: Unwrap set to false
76
+ */
77
+ declare function extendRef<R extends Ref<any>, Extend extends object, Options extends ExtendRefOptions<false>>(ref: R, extend: Extend, options?: Options): ShallowUnwrapRef$1<Extend> & R;
78
+ /**
79
+ * Overload 2: Unwrap unset or set to true
80
+ */
81
+ declare function extendRef<R extends Ref<any>, Extend extends object, Options extends ExtendRefOptions>(ref: R, extend: Extend, options?: Options): Extend & R;
82
+
83
+ declare const isClient: boolean;
84
+ declare const isDef: <T = any>(val?: T | undefined) => val is T;
85
+ declare const assert: (condition: boolean, ...infos: any[]) => void;
86
+ declare const isBoolean: (val: any) => val is boolean;
87
+ declare const isFunction: <T extends Function>(val: any) => val is T;
88
+ declare const isNumber: (val: any) => val is number;
89
+ declare const isString: (val: unknown) => val is string;
90
+ declare const isObject: (val: any) => val is object;
91
+ declare const isWindow: (val: any) => val is Window;
92
+ declare const now: () => number;
93
+ declare const timestamp: () => number;
94
+ declare const clamp: (n: number, min: number, max: number) => number;
95
+ declare const noop: () => void;
96
+ declare const rand: (min: number, max: number) => number;
97
+ declare const isIOS: boolean | "";
98
+ declare const hasOwn: <T extends object, K extends keyof T>(val: T, key: K) => key is K;
99
+
100
+ /**
101
+ * Void function
102
+ */
103
+ type Fn = () => void;
104
+ /**
105
+ * Any function
106
+ */
107
+ type AnyFn = (...args: any[]) => any;
108
+ /**
109
+ * A ref that allow to set null or undefined
110
+ */
111
+ type RemovableRef<T> = Omit<Ref<T>, 'value'> & {
112
+ get value(): T;
113
+ set value(value: T | null | undefined);
114
+ };
115
+ /**
116
+ * @deprecated Use `RemovableRef`
117
+ */
118
+ type RemoveableRef<T> = RemovableRef<T>;
119
+ /**
120
+ * Maybe it's a ref, or a plain value
121
+ *
122
+ * ```ts
123
+ * type MaybeRef<T> = T | Ref<T>
124
+ * ```
125
+ */
126
+ type MaybeRef<T> = T | Ref<T>;
127
+ /**
128
+ * Maybe it's a ref, or a plain value, or a getter function
129
+ *
130
+ * ```ts
131
+ * type MaybeComputedRef<T> = (() => T) | T | Ref<T> | ComputedRef<T>
132
+ * ```
133
+ */
134
+ type MaybeComputedRef<T> = MaybeReadonlyRef<T> | MaybeRef<T>;
135
+ /**
136
+ * Maybe it's a computed ref, or a getter function
137
+ *
138
+ * ```ts
139
+ * type MaybeReadonlyRef<T> = (() => T) | ComputedRef<T>
140
+ * ```
141
+ */
142
+ type MaybeReadonlyRef<T> = (() => T) | ComputedRef<T>;
143
+ /**
144
+ * Make all the nested attributes of an object or array to MaybeRef<T>
145
+ *
146
+ * Good for accepting options that will be wrapped with `reactive` or `ref`
147
+ *
148
+ * ```ts
149
+ * UnwrapRef<DeepMaybeRef<T>> === T
150
+ * ```
151
+ */
152
+ type DeepMaybeRef<T> = T extends Ref<infer V> ? MaybeRef<V> : T extends Array<any> | object ? {
153
+ [K in keyof T]: DeepMaybeRef<T[K]>;
154
+ } : MaybeRef<T>;
155
+ type Arrayable<T> = T[] | T;
156
+ /**
157
+ * Infers the element type of an array
158
+ */
159
+ type ElementOf<T> = T extends (infer E)[] ? E : never;
160
+ type ShallowUnwrapRef<T> = T extends Ref<infer P> ? P : T;
161
+ type Awaitable<T> = Promise<T> | T;
162
+ type ArgumentsType<T> = T extends (...args: infer U) => any ? U : never;
163
+ type PromisifyFn<T extends AnyFn> = (...args: ArgumentsType<T>) => Promise<ReturnType<T>>;
164
+ interface Pausable {
165
+ /**
166
+ * A ref indicate whether a pausable instance is active
167
+ */
168
+ isActive: Readonly<Ref<boolean>>;
169
+ /**
170
+ * Temporary pause the effect from executing
171
+ */
172
+ pause: Fn;
173
+ /**
174
+ * Resume the effects
175
+ */
176
+ resume: Fn;
177
+ }
178
+ interface Stoppable<StartFnArgs extends any[] = any[]> {
179
+ /**
180
+ * A ref indicate whether a stoppable instance is executing
181
+ */
182
+ isPending: Readonly<Ref<boolean>>;
183
+ /**
184
+ * Stop the effect from executing
185
+ */
186
+ stop: Fn;
187
+ /**
188
+ * Start the effects
189
+ */
190
+ start: (...args: StartFnArgs) => void;
191
+ }
192
+ /**
193
+ * @deprecated Use `Stoppable`
194
+ */
195
+ type Stopable = Stoppable;
196
+ interface ConfigurableFlush {
197
+ /**
198
+ * Timing for monitoring changes, refer to WatchOptions for more details
199
+ *
200
+ * @default 'pre'
201
+ */
202
+ flush?: WatchOptions['flush'];
203
+ }
204
+ interface ConfigurableFlushSync {
205
+ /**
206
+ * Timing for monitoring changes, refer to WatchOptions for more details.
207
+ * Unlike `watch()`, the default is set to `sync`
208
+ *
209
+ * @default 'sync'
210
+ */
211
+ flush?: WatchOptions['flush'];
212
+ }
213
+ type MapSources<T> = {
214
+ [K in keyof T]: T[K] extends WatchSource<infer V> ? V : never;
215
+ };
216
+ type MapOldSources<T, Immediate> = {
217
+ [K in keyof T]: T[K] extends WatchSource<infer V> ? Immediate extends true ? V | undefined : V : never;
218
+ };
219
+
220
+ type FunctionArgs<Args extends any[] = any[], Return = void> = (...args: Args) => Return;
221
+ interface FunctionWrapperOptions<Args extends any[] = any[], This = any> {
222
+ fn: FunctionArgs<Args, This>;
223
+ args: Args;
224
+ thisArg: This;
225
+ }
226
+ type EventFilter<Args extends any[] = any[], This = any, Invoke extends AnyFn = AnyFn> = (invoke: Invoke, options: FunctionWrapperOptions<Args, This>) => ReturnType<Invoke> | Promise<ReturnType<Invoke>>;
227
+ interface ConfigurableEventFilter {
228
+ /**
229
+ * Filter for if events should to be received.
230
+ *
231
+ * @see https://vueuse.org/guide/config.html#event-filters
232
+ */
233
+ eventFilter?: EventFilter;
234
+ }
235
+ interface DebounceFilterOptions {
236
+ /**
237
+ * The maximum time allowed to be delayed before it's invoked.
238
+ * In milliseconds.
239
+ */
240
+ maxWait?: MaybeComputedRef<number>;
241
+ /**
242
+ * Whether to reject the last call if it's been cancel.
243
+ *
244
+ * @default false
245
+ */
246
+ rejectOnCancel?: boolean;
247
+ }
248
+ /**
249
+ * @internal
250
+ */
251
+ declare function createFilterWrapper<T extends AnyFn>(filter: EventFilter, fn: T): (this: any, ...args: ArgumentsType<T>) => Promise<ReturnType<T>>;
252
+ declare const bypassFilter: EventFilter;
253
+ /**
254
+ * Create an EventFilter that debounce the events
255
+ *
256
+ * @param ms
257
+ * @param options
258
+ */
259
+ declare function debounceFilter(ms: MaybeComputedRef<number>, options?: DebounceFilterOptions): EventFilter<any[], any, AnyFn>;
260
+ /**
261
+ * Create an EventFilter that throttle the events
262
+ *
263
+ * @param ms
264
+ * @param [trailing=true]
265
+ * @param [leading=true]
266
+ * @param [rejectOnCancel=false]
267
+ */
268
+ declare function throttleFilter(ms: MaybeComputedRef<number>, trailing?: boolean, leading?: boolean, rejectOnCancel?: boolean): EventFilter<any[], any, AnyFn>;
269
+ /**
270
+ * EventFilter that gives extra controls to pause and resume the filter
271
+ *
272
+ * @param extendFilter Extra filter to apply when the PausableFilter is active, default to none
273
+ *
274
+ */
275
+ declare function pausableFilter(extendFilter?: EventFilter): Pausable & {
276
+ eventFilter: EventFilter;
277
+ };
278
+
279
+ declare function __onlyVue3(name?: string): void;
280
+ declare function __onlyVue27Plus(name?: string): void;
281
+ declare const directiveHooks: {
282
+ mounted: "mounted";
283
+ updated: "updated";
284
+ unmounted: "unmounted";
285
+ };
286
+
287
+ declare function promiseTimeout(ms: number, throwOnTimeout?: boolean, reason?: string): Promise<void>;
288
+ declare function identity<T>(arg: T): T;
289
+ interface SingletonPromiseReturn<T> {
290
+ (): Promise<T>;
291
+ /**
292
+ * Reset current staled promise.
293
+ * await it to have proper shutdown.
294
+ */
295
+ reset: () => Promise<void>;
296
+ }
297
+ /**
298
+ * Create singleton promise function
299
+ *
300
+ * @example
301
+ * ```
302
+ * const promise = createSingletonPromise(async () => { ... })
303
+ *
304
+ * await promise()
305
+ * await promise() // all of them will be bind to a single promise instance
306
+ * await promise() // and be resolved together
307
+ * ```
308
+ */
309
+ declare function createSingletonPromise<T>(fn: () => Promise<T>): SingletonPromiseReturn<T>;
310
+ declare function invoke<T>(fn: () => T): T;
311
+ declare function containsProp(obj: object, ...props: string[]): boolean;
312
+ /**
313
+ * Increase string a value with unit
314
+ *
315
+ * @example '2px' + 1 = '3px'
316
+ * @example '15em' + (-2) = '13em'
317
+ */
318
+ declare function increaseWithUnit(target: number, delta: number): number;
319
+ declare function increaseWithUnit(target: string, delta: number): string;
320
+ declare function increaseWithUnit(target: string | number, delta: number): string | number;
321
+ /**
322
+ * Create a new subset object by giving keys
323
+ *
324
+ * @category Object
325
+ */
326
+ declare function objectPick<O extends object, T extends keyof O>(obj: O, keys: T[], omitUndefined?: boolean): Pick<O, T>;
327
+
328
+ /**
329
+ * Shorthand for accessing `ref.value`
330
+ */
331
+ declare function get<T>(ref: MaybeRef<T>): T;
332
+ declare function get<T, K extends keyof T>(ref: MaybeRef<T>, key: K): T[K];
333
+
334
+ declare function isDefined<T>(v: Ref<T>): v is Ref<Exclude<T, null | undefined>>;
335
+ declare function isDefined<T>(v: ComputedRef<T>): v is ComputedRef<Exclude<T, null | undefined>>;
336
+ declare function isDefined<T>(v: T): v is Exclude<T, null | undefined>;
337
+
338
+ declare function makeDestructurable<T extends Record<string, unknown>, A extends readonly any[]>(obj: T, arr: A): T & A;
339
+
340
+ type Reactified<T, Computed extends boolean> = T extends (...args: infer A) => infer R ? (...args: {
341
+ [K in keyof A]: Computed extends true ? MaybeComputedRef<A[K]> : MaybeRef<A[K]>;
342
+ }) => ComputedRef<R> : never;
343
+ interface ReactifyOptions<T extends boolean> {
344
+ /**
345
+ * Accept passing a function as a reactive getter
346
+ *
347
+ * @default true
348
+ */
349
+ computedGetter?: T;
350
+ }
351
+ /**
352
+ * Converts plain function into a reactive function.
353
+ * The converted function accepts refs as it's arguments
354
+ * and returns a ComputedRef, with proper typing.
355
+ *
356
+ * @param fn - Source function
357
+ */
358
+ declare function reactify<T extends Function, K extends boolean = true>(fn: T, options?: ReactifyOptions<K>): Reactified<T, K>;
359
+
360
+ type ReactifyNested<T, Keys extends keyof T = keyof T, S extends boolean = true> = {
361
+ [K in Keys]: T[K] extends (...args: any[]) => any ? Reactified<T[K], S> : T[K];
362
+ };
363
+ interface ReactifyObjectOptions<T extends boolean> extends ReactifyOptions<T> {
364
+ /**
365
+ * Includes names from Object.getOwnPropertyNames
366
+ *
367
+ * @default true
368
+ */
369
+ includeOwnProperties?: boolean;
370
+ }
371
+ /**
372
+ * Apply `reactify` to an object
373
+ */
374
+ declare function reactifyObject<T extends object, Keys extends keyof T>(obj: T, keys?: (keyof T)[]): ReactifyNested<T, Keys, true>;
375
+ declare function reactifyObject<T extends object, S extends boolean = true>(obj: T, options?: ReactifyObjectOptions<S>): ReactifyNested<T, keyof T, S>;
376
+
377
+ /**
378
+ * Computed reactive object.
379
+ */
380
+ declare function reactiveComputed<T extends {}>(fn: () => T): T;
381
+
382
+ /**
383
+ * Reactively omit fields from a reactive object
384
+ *
385
+ * @see https://vueuse.org/reactiveOmit
386
+ */
387
+ declare function reactiveOmit<T extends object, K extends keyof T>(obj: T, ...keys: (K | K[])[]): Omit<T, K>;
388
+
389
+ /**
390
+ * Reactively pick fields from a reactive object
391
+ *
392
+ * @see https://vueuse.org/reactivePick
393
+ */
394
+ declare function reactivePick<T extends object, K extends keyof T>(obj: T, ...keys: (K | K[])[]): {
395
+ [S in K]: UnwrapRef<T[S]>;
396
+ };
397
+
398
+ /**
399
+ * Create a ref which will be reset to the default value after some time.
400
+ *
401
+ * @see https://vueuse.org/refAutoReset
402
+ * @param defaultValue The value which will be set.
403
+ * @param afterMs A zero-or-greater delay in milliseconds.
404
+ */
405
+ declare function refAutoReset<T>(defaultValue: T, afterMs?: MaybeComputedRef<number>): Ref<T>;
406
+
407
+ /**
408
+ * Debounce updates of a ref.
409
+ *
410
+ * @return A new debounced ref.
411
+ */
412
+ declare function refDebounced<T>(value: Ref<T>, ms?: MaybeComputedRef<number>, options?: DebounceFilterOptions): Readonly<Ref<T>>;
413
+
414
+ /**
415
+ * Apply default value to a ref.
416
+ *
417
+ * @param source source ref
418
+ * @param targets
419
+ */
420
+ declare function refDefault<T>(source: Ref<T | undefined | null>, defaultValue: T): Ref<T>;
421
+
422
+ /**
423
+ * Throttle execution of a function. Especially useful for rate limiting
424
+ * execution of handlers on events like resize and scroll.
425
+ *
426
+ * @param value Ref value to be watched with throttle effect
427
+ * @param delay A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
428
+ * @param [trailing=true] if true, update the value again after the delay time is up
429
+ * @param [leading=true] if true, update the value on the leading edge of the ms timeout
430
+ */
431
+ declare function refThrottled<T>(value: Ref<T>, delay?: number, trailing?: boolean, leading?: boolean): Ref<T>;
432
+
433
+ interface ControlledRefOptions<T> {
434
+ /**
435
+ * Callback function before the ref changing.
436
+ *
437
+ * Returning `false` to dismiss the change.
438
+ */
439
+ onBeforeChange?: (value: T, oldValue: T) => void | boolean;
440
+ /**
441
+ * Callback function after the ref changed
442
+ *
443
+ * This happens synchronously, with less overhead compare to `watch`
444
+ */
445
+ onChanged?: (value: T, oldValue: T) => void;
446
+ }
447
+ /**
448
+ * Explicitly define the deps of computed.
449
+ *
450
+ * @param source
451
+ * @param fn
452
+ */
453
+ declare function refWithControl<T>(initial: T, options?: ControlledRefOptions<T>): vue_demi.ShallowUnwrapRef<{
454
+ get: (tracking?: boolean) => T;
455
+ set: (value: T, triggering?: boolean) => void;
456
+ untrackedGet: () => T;
457
+ silentSet: (v: T) => void;
458
+ peek: () => T;
459
+ lay: (v: T) => void;
460
+ }> & vue_demi.Ref<T>;
461
+ /**
462
+ * Alias for `refWithControl`
463
+ */
464
+ declare const controlledRef: typeof refWithControl;
465
+
466
+ /**
467
+ * Normalize value/ref/getter to `ref` or `computed`.
468
+ */
469
+ declare function resolveRef<T>(r: MaybeComputedRef<T>): ComputedRef<T>;
470
+ declare function resolveRef<T>(r: MaybeRef<T>): Ref<T>;
471
+ declare function resolveRef<T>(r: T): Ref<T>;
472
+
473
+ /**
474
+ * Get the value of value/ref/getter.
475
+ */
476
+ declare function resolveUnref<T>(r: MaybeComputedRef<T>): T;
477
+
478
+ declare function set<T>(ref: Ref<T>, value: T): void;
479
+ declare function set<O extends object, K extends keyof O>(target: O, key: K, value: O[K]): void;
480
+
481
+ interface SyncRefOptions<L, R = L> extends ConfigurableFlushSync {
482
+ /**
483
+ * Watch deeply
484
+ *
485
+ * @default false
486
+ */
487
+ deep?: boolean;
488
+ /**
489
+ * Sync values immediately
490
+ *
491
+ * @default true
492
+ */
493
+ immediate?: boolean;
494
+ /**
495
+ * Direction of syncing. Value will be redefined if you define syncConvertors
496
+ *
497
+ * @default 'both'
498
+ */
499
+ direction?: 'ltr' | 'rtl' | 'both';
500
+ /**
501
+ * Custom transform function
502
+ */
503
+ transform?: {
504
+ ltr?: (left: L) => R;
505
+ rtl?: (right: R) => L;
506
+ };
507
+ }
508
+ /**
509
+ * Two-way refs synchronization.
510
+ *
511
+ * @param left
512
+ * @param right
513
+ */
514
+ declare function syncRef<L, R = L>(left: Ref<L>, right: Ref<R>, options?: SyncRefOptions<L, R>): () => void;
515
+
516
+ interface SyncRefsOptions extends ConfigurableFlushSync {
517
+ /**
518
+ * Watch deeply
519
+ *
520
+ * @default false
521
+ */
522
+ deep?: boolean;
523
+ /**
524
+ * Sync values immediately
525
+ *
526
+ * @default true
527
+ */
528
+ immediate?: boolean;
529
+ }
530
+ /**
531
+ * Keep target ref(s) in sync with the source ref
532
+ *
533
+ * @param source source ref
534
+ * @param targets
535
+ */
536
+ declare function syncRefs<T>(source: WatchSource<T>, targets: Ref<T> | Ref<T>[], options?: SyncRefsOptions): vue_demi.WatchStopHandle;
537
+
538
+ /**
539
+ * Converts ref to reactive.
540
+ *
541
+ * @see https://vueuse.org/toReactive
542
+ * @param objectRef A ref of object
543
+ */
544
+ declare function toReactive<T extends object>(objectRef: MaybeRef<T>): T;
545
+
546
+ /**
547
+ * Extended `toRefs` that also accepts refs of an object.
548
+ *
549
+ * @see https://vueuse.org/toRefs
550
+ * @param objectRef A ref or normal object or array.
551
+ */
552
+ declare function toRefs<T extends object>(objectRef: MaybeRef<T>): ToRefs<T>;
553
+
554
+ /**
555
+ * Call onBeforeMount() if it's inside a component lifecycle, if not, just call the function
556
+ *
557
+ * @param fn
558
+ * @param sync if set to false, it will run in the nextTick() of Vue
559
+ */
560
+ declare function tryOnBeforeMount(fn: Fn, sync?: boolean): void;
561
+
562
+ /**
563
+ * Call onBeforeUnmount() if it's inside a component lifecycle, if not, do nothing
564
+ *
565
+ * @param fn
566
+ */
567
+ declare function tryOnBeforeUnmount(fn: Fn): void;
568
+
569
+ /**
570
+ * Call onMounted() if it's inside a component lifecycle, if not, just call the function
571
+ *
572
+ * @param fn
573
+ * @param sync if set to false, it will run in the nextTick() of Vue
574
+ */
575
+ declare function tryOnMounted(fn: Fn, sync?: boolean): void;
576
+
577
+ /**
578
+ * Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
579
+ *
580
+ * @param fn
581
+ */
582
+ declare function tryOnScopeDispose(fn: Fn): boolean;
583
+
584
+ /**
585
+ * Call onUnmounted() if it's inside a component lifecycle, if not, do nothing
586
+ *
587
+ * @param fn
588
+ */
589
+ declare function tryOnUnmounted(fn: Fn): void;
590
+
591
+ interface UntilToMatchOptions {
592
+ /**
593
+ * Milliseconds timeout for promise to resolve/reject if the when condition does not meet.
594
+ * 0 for never timed out
595
+ *
596
+ * @default 0
597
+ */
598
+ timeout?: number;
599
+ /**
600
+ * Reject the promise when timeout
601
+ *
602
+ * @default false
603
+ */
604
+ throwOnTimeout?: boolean;
605
+ /**
606
+ * `flush` option for internal watch
607
+ *
608
+ * @default 'sync'
609
+ */
610
+ flush?: WatchOptions['flush'];
611
+ /**
612
+ * `deep` option for internal watch
613
+ *
614
+ * @default 'false'
615
+ */
616
+ deep?: WatchOptions['deep'];
617
+ }
618
+ interface UntilBaseInstance<T, Not extends boolean = false> {
619
+ toMatch<U extends T = T>(condition: (v: T) => v is U, options?: UntilToMatchOptions): Not extends true ? Promise<Exclude<T, U>> : Promise<U>;
620
+ toMatch(condition: (v: T) => boolean, options?: UntilToMatchOptions): Promise<T>;
621
+ changed(options?: UntilToMatchOptions): Promise<T>;
622
+ changedTimes(n?: number, options?: UntilToMatchOptions): Promise<T>;
623
+ }
624
+ type Falsy = false | void | null | undefined | 0 | 0n | '';
625
+ interface UntilValueInstance<T, Not extends boolean = false> extends UntilBaseInstance<T, Not> {
626
+ readonly not: UntilValueInstance<T, Not extends true ? false : true>;
627
+ toBe<P = T>(value: MaybeComputedRef<P>, options?: UntilToMatchOptions): Not extends true ? Promise<T> : Promise<P>;
628
+ toBeTruthy(options?: UntilToMatchOptions): Not extends true ? Promise<T & Falsy> : Promise<Exclude<T, Falsy>>;
629
+ toBeNull(options?: UntilToMatchOptions): Not extends true ? Promise<Exclude<T, null>> : Promise<null>;
630
+ toBeUndefined(options?: UntilToMatchOptions): Not extends true ? Promise<Exclude<T, undefined>> : Promise<undefined>;
631
+ toBeNaN(options?: UntilToMatchOptions): Promise<T>;
632
+ }
633
+ interface UntilArrayInstance<T> extends UntilBaseInstance<T> {
634
+ readonly not: UntilArrayInstance<T>;
635
+ toContains(value: MaybeComputedRef<ElementOf<ShallowUnwrapRef<T>>>, options?: UntilToMatchOptions): Promise<T>;
636
+ }
637
+ /**
638
+ * Promised one-time watch for changes
639
+ *
640
+ * @see https://vueuse.org/until
641
+ * @example
642
+ * ```
643
+ * const { count } = useCounter()
644
+ *
645
+ * await until(count).toMatch(v => v > 7)
646
+ *
647
+ * alert('Counter is now larger than 7!')
648
+ * ```
649
+ */
650
+ declare function until<T extends unknown[]>(r: WatchSource<T> | MaybeComputedRef<T>): UntilArrayInstance<T>;
651
+ declare function until<T>(r: WatchSource<T> | MaybeComputedRef<T>): UntilValueInstance<T>;
652
+
653
+ /**
654
+ * Reactive `Array.every`
655
+ *
656
+ * @see https://vueuse.org/useArrayEvery
657
+ * @param {Array} list - the array was called upon.
658
+ * @param fn - a function to test each element.
659
+ *
660
+ * @returns {boolean} **true** if the `fn` function returns a **truthy** value for every element from the array. Otherwise, **false**.
661
+ */
662
+ declare function useArrayEvery<T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef<T>[]) => unknown): ComputedRef<boolean>;
663
+
664
+ /**
665
+ * Reactive `Array.filter`
666
+ *
667
+ * @see https://vueuse.org/useArrayFilter
668
+ * @param {Array} list - the array was called upon.
669
+ * @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.
670
+ *
671
+ * @returns {Array} 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.
672
+ */
673
+ declare function useArrayFilter<T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, fn: (element: T, index: number, array: T[]) => boolean): ComputedRef<T[]>;
674
+
675
+ /**
676
+ * Reactive `Array.find`
677
+ *
678
+ * @see https://vueuse.org/useArrayFind
679
+ * @param {Array} list - the array was called upon.
680
+ * @param fn - a function to test each element.
681
+ *
682
+ * @returns the first element in the array that satisfies the provided testing function. Otherwise, undefined is returned.
683
+ */
684
+ declare function useArrayFind<T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef<T>[]) => boolean): ComputedRef<T | undefined>;
685
+
686
+ /**
687
+ * Reactive `Array.findIndex`
688
+ *
689
+ * @see https://vueuse.org/useArrayFindIndex
690
+ * @param {Array} list - the array was called upon.
691
+ * @param fn - a function to test each element.
692
+ *
693
+ * @returns {number} the index of the first element in the array that passes the test. Otherwise, "-1".
694
+ */
695
+ declare function useArrayFindIndex<T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef<T>[]) => unknown): ComputedRef<number>;
696
+
697
+ /**
698
+ * Reactive `Array.findLast`
699
+ *
700
+ * @see https://vueuse.org/useArrayFindLast
701
+ * @param {Array} list - the array was called upon.
702
+ * @param fn - a function to test each element.
703
+ *
704
+ * @returns the last element in the array that satisfies the provided testing function. Otherwise, undefined is returned.
705
+ */
706
+ declare function useArrayFindLast<T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef<T>[]) => boolean): ComputedRef<T | undefined>;
707
+
708
+ /**
709
+ * Reactive `Array.join`
710
+ *
711
+ * @see https://vueuse.org/useArrayJoin
712
+ * @param {Array} list - the array was called upon.
713
+ * @param {string} separator - a string to separate each pair of adjacent elements of the array. If omitted, the array elements are separated with a comma (",").
714
+ *
715
+ * @returns {string} a string with all array elements joined. If arr.length is 0, the empty string is returned.
716
+ */
717
+ declare function useArrayJoin(list: MaybeComputedRef<MaybeComputedRef<any>[]>, separator?: MaybeComputedRef<string>): ComputedRef<string>;
718
+
719
+ /**
720
+ * Reactive `Array.map`
721
+ *
722
+ * @see https://vueuse.org/useArrayMap
723
+ * @param {Array} list - the array was called upon.
724
+ * @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.
725
+ *
726
+ * @returns {Array} a new array with each element being the result of the callback function.
727
+ */
728
+ declare function useArrayMap<T, U = T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, fn: (element: T, index: number, array: T[]) => U): ComputedRef<U[]>;
729
+
730
+ type UseArrayReducer<PV, CV, R> = (previousValue: PV, currentValue: CV, currentIndex: number) => R;
731
+ /**
732
+ * Reactive `Array.reduce`
733
+ *
734
+ * @see https://vueuse.org/useArrayReduce
735
+ * @param {Array} list - the array was called upon.
736
+ * @param reducer - a "reducer" function.
737
+ *
738
+ * @returns the value that results from running the "reducer" callback function to completion over the entire array.
739
+ */
740
+ declare function useArrayReduce<T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, reducer: UseArrayReducer<T, T, T>): ComputedRef<T>;
741
+ /**
742
+ * Reactive `Array.reduce`
743
+ *
744
+ * @see https://vueuse.org/useArrayReduce
745
+ * @param {Array} list - the array was called upon.
746
+ * @param reducer - a "reducer" function.
747
+ * @param initialValue - a value to be initialized the first time when the callback is called.
748
+ *
749
+ * @returns the value that results from running the "reducer" callback function to completion over the entire array.
750
+ */
751
+ declare function useArrayReduce<T, U>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, reducer: UseArrayReducer<U, T, U>, initialValue: MaybeComputedRef<U>): ComputedRef<U>;
752
+
753
+ /**
754
+ * Reactive `Array.some`
755
+ *
756
+ * @see https://vueuse.org/useArraySome
757
+ * @param {Array} list - the array was called upon.
758
+ * @param fn - a function to test each element.
759
+ *
760
+ * @returns {boolean} **true** if the `fn` function returns a **truthy** value for any element from the array. Otherwise, **false**.
761
+ */
762
+ declare function useArraySome<T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>, fn: (element: T, index: number, array: MaybeComputedRef<T>[]) => unknown): ComputedRef<boolean>;
763
+
764
+ /**
765
+ * reactive unique array
766
+ * @see https://vueuse.org/useArrayUnique
767
+ * @param {Array} list - the array was called upon.
768
+ * @returns {Array} A computed ref that returns a unique array of items.
769
+ */
770
+ declare function useArrayUnique<T>(list: MaybeComputedRef<MaybeComputedRef<T>[]>): ComputedRef<T[]>;
771
+
772
+ interface UseCounterOptions {
773
+ min?: number;
774
+ max?: number;
775
+ }
776
+ /**
777
+ * Basic counter with utility functions.
778
+ *
779
+ * @see https://vueuse.org/useCounter
780
+ * @param [initialValue=0]
781
+ * @param {Object} options
782
+ */
783
+ declare function useCounter(initialValue?: number, options?: UseCounterOptions): {
784
+ count: vue_demi.Ref<number>;
785
+ inc: (delta?: number) => number;
786
+ dec: (delta?: number) => number;
787
+ get: () => number;
788
+ set: (val: number) => number;
789
+ reset: (val?: number) => number;
790
+ };
791
+
792
+ type DateLike = Date | number | string | undefined;
793
+ interface UseDateFormatOptions {
794
+ /**
795
+ * The locale(s) to used for dd/ddd/dddd/MMM/MMMM format
796
+ *
797
+ * [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
798
+ */
799
+ locales?: Intl.LocalesArgument;
800
+ /**
801
+ * A custom function to re-modify the way to display meridiem
802
+ *
803
+ */
804
+ customMeridiem?: (hours: number, minutes: number, isLowercase?: boolean, hasPeriod?: boolean) => string;
805
+ }
806
+ declare const formatDate: (date: Date, formatStr: string, options?: UseDateFormatOptions) => string;
807
+ declare const normalizeDate: (date: DateLike) => Date;
808
+ /**
809
+ * Get the formatted date according to the string of tokens passed in.
810
+ *
811
+ * @see https://vueuse.org/useDateFormat
812
+ * @param date - The date to format, can either be a `Date` object, a timestamp, or a string
813
+ * @param formatStr - The combination of tokens to format the date
814
+ * @param options - UseDateFormatOptions
815
+ */
816
+ declare function useDateFormat(date: MaybeComputedRef<DateLike>, formatStr?: MaybeComputedRef<string>, options?: UseDateFormatOptions): vue_demi.ComputedRef<string>;
817
+ type UseDateFormatReturn = ReturnType<typeof useDateFormat>;
818
+
819
+ /**
820
+ * Debounce execution of a function.
821
+ *
822
+ * @see https://vueuse.org/useDebounceFn
823
+ * @param fn A function to be executed after delay milliseconds debounced.
824
+ * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
825
+ * @param opts options
826
+ *
827
+ * @return A new, debounce, function.
828
+ */
829
+ declare function useDebounceFn<T extends FunctionArgs>(fn: T, ms?: MaybeComputedRef<number>, options?: DebounceFilterOptions): PromisifyFn<T>;
830
+
831
+ interface UseIntervalOptions<Controls extends boolean> {
832
+ /**
833
+ * Expose more controls
834
+ *
835
+ * @default false
836
+ */
837
+ controls?: Controls;
838
+ /**
839
+ * Execute the update immediately on calling
840
+ *
841
+ * @default true
842
+ */
843
+ immediate?: boolean;
844
+ /**
845
+ * Callback on every interval
846
+ */
847
+ callback?: (count: number) => void;
848
+ }
849
+ interface UseIntervalControls {
850
+ counter: Ref<number>;
851
+ reset: () => void;
852
+ }
853
+ /**
854
+ * Reactive counter increases on every interval
855
+ *
856
+ * @see https://vueuse.org/useInterval
857
+ * @param interval
858
+ * @param options
859
+ */
860
+ declare function useInterval(interval?: MaybeComputedRef<number>, options?: UseIntervalOptions<false>): Ref<number>;
861
+ declare function useInterval(interval: MaybeComputedRef<number>, options: UseIntervalOptions<true>): UseIntervalControls & Pausable;
862
+
863
+ interface UseIntervalFnOptions {
864
+ /**
865
+ * Start the timer immediately
866
+ *
867
+ * @default true
868
+ */
869
+ immediate?: boolean;
870
+ /**
871
+ * Execute the callback immediate after calling this function
872
+ *
873
+ * @default false
874
+ */
875
+ immediateCallback?: boolean;
876
+ }
877
+ /**
878
+ * Wrapper for `setInterval` with controls
879
+ *
880
+ * @param cb
881
+ * @param interval
882
+ * @param options
883
+ */
884
+ declare function useIntervalFn(cb: Fn, interval?: MaybeComputedRef<number>, options?: UseIntervalFnOptions): Pausable;
885
+
886
+ interface UseLastChangedOptions<Immediate extends boolean, InitialValue extends number | null | undefined = undefined> extends WatchOptions<Immediate> {
887
+ initialValue?: InitialValue;
888
+ }
889
+ /**
890
+ * Records the timestamp of the last change
891
+ *
892
+ * @see https://vueuse.org/useLastChanged
893
+ */
894
+ declare function useLastChanged(source: WatchSource, options?: UseLastChangedOptions<false>): Ref<number | null>;
895
+ declare function useLastChanged(source: WatchSource, options: UseLastChangedOptions<true>): Ref<number>;
896
+ declare function useLastChanged(source: WatchSource, options: UseLastChangedOptions<boolean, number>): Ref<number>;
897
+
898
+ /**
899
+ * Throttle execution of a function. Especially useful for rate limiting
900
+ * execution of handlers on events like resize and scroll.
901
+ *
902
+ * @param fn A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
903
+ * to `callback` when the throttled-function is executed.
904
+ * @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
905
+ *
906
+ * @param [trailing=false] if true, call fn again after the time is up
907
+ *
908
+ * @param [leading=true] if true, call fn on the leading edge of the ms timeout
909
+ *
910
+ * @param [rejectOnCancel=false] if true, reject the last call if it's been cancel
911
+ *
912
+ * @return A new, throttled, function.
913
+ */
914
+ declare function useThrottleFn<T extends FunctionArgs>(fn: T, ms?: MaybeComputedRef<number>, trailing?: boolean, leading?: boolean, rejectOnCancel?: boolean): PromisifyFn<T>;
915
+
916
+ interface UseTimeoutFnOptions {
917
+ /**
918
+ * Start the timer immediate after calling this function
919
+ *
920
+ * @default true
921
+ */
922
+ immediate?: boolean;
923
+ }
924
+ /**
925
+ * Wrapper for `setTimeout` with controls.
926
+ *
927
+ * @param cb
928
+ * @param interval
929
+ * @param options
930
+ */
931
+ declare function useTimeoutFn<CallbackFn extends (...args: any[]) => any>(cb: CallbackFn, interval: MaybeComputedRef<number>, options?: UseTimeoutFnOptions): Stoppable<Parameters<CallbackFn> | []>;
932
+
933
+ interface UseTimeoutOptions<Controls extends boolean> extends UseTimeoutFnOptions {
934
+ /**
935
+ * Expose more controls
936
+ *
937
+ * @default false
938
+ */
939
+ controls?: Controls;
940
+ /**
941
+ * Callback on timeout
942
+ */
943
+ callback?: Fn;
944
+ }
945
+ /**
946
+ * Update value after a given time with controls.
947
+ *
948
+ * @see {@link https://vueuse.org/useTimeout}
949
+ * @param interval
950
+ * @param options
951
+ */
952
+ declare function useTimeout(interval?: number, options?: UseTimeoutOptions<false>): ComputedRef<boolean>;
953
+ declare function useTimeout(interval: number, options: UseTimeoutOptions<true>): {
954
+ ready: ComputedRef<boolean>;
955
+ } & Stoppable;
956
+
957
+ interface UseToNumberOptions {
958
+ /**
959
+ * Method to use to convert the value to a number.
960
+ *
961
+ * @default 'parseFloat'
962
+ */
963
+ method?: 'parseFloat' | 'parseInt';
964
+ /**
965
+ * The base in mathematical numeral systems passed to `parseInt`.
966
+ * Only works with `method: 'parseInt'`
967
+ */
968
+ radix?: number;
969
+ /**
970
+ * Replace NaN with zero
971
+ *
972
+ * @default false
973
+ */
974
+ nanToZero?: boolean;
975
+ }
976
+ /**
977
+ * Computed reactive object.
978
+ */
979
+ declare function useToNumber(value: MaybeComputedRef<number | string>, options?: UseToNumberOptions): ComputedRef<number>;
980
+
981
+ /**
982
+ * Reactively convert a ref to string.
983
+ *
984
+ * @see https://vueuse.org/useToString
985
+ */
986
+ declare function useToString(value: MaybeComputedRef<unknown>): ComputedRef<string>;
987
+
988
+ interface UseToggleOptions<Truthy, Falsy> {
989
+ truthyValue?: MaybeComputedRef<Truthy>;
990
+ falsyValue?: MaybeComputedRef<Falsy>;
991
+ }
992
+ declare function useToggle<Truthy, Falsy, T = Truthy | Falsy>(initialValue: Ref<T>, options?: UseToggleOptions<Truthy, Falsy>): (value?: T) => T;
993
+ declare function useToggle<Truthy = true, Falsy = false, T = Truthy | Falsy>(initialValue?: T, options?: UseToggleOptions<Truthy, Falsy>): [Ref<T>, (value?: T) => T];
994
+
995
+ declare type WatchArrayCallback<V = any, OV = any> = (value: V, oldValue: OV, added: V, removed: OV, onCleanup: (cleanupFn: () => void) => void) => any;
996
+ /**
997
+ * Watch for an array with additions and removals.
998
+ *
999
+ * @see https://vueuse.org/watchArray
1000
+ */
1001
+ 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_demi.WatchStopHandle;
1002
+
1003
+ interface WatchWithFilterOptions<Immediate> extends WatchOptions<Immediate>, ConfigurableEventFilter {
1004
+ }
1005
+ declare function watchWithFilter<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchWithFilterOptions<Immediate>): WatchStopHandle;
1006
+ declare function watchWithFilter<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchWithFilterOptions<Immediate>): WatchStopHandle;
1007
+ 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>): WatchStopHandle;
1008
+
1009
+ interface WatchAtMostOptions<Immediate> extends WatchWithFilterOptions<Immediate> {
1010
+ count: MaybeComputedRef<number>;
1011
+ }
1012
+ interface WatchAtMostReturn {
1013
+ stop: WatchStopHandle;
1014
+ count: Ref<number>;
1015
+ }
1016
+ declare function watchAtMost<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options: WatchAtMostOptions<Immediate>): WatchAtMostReturn;
1017
+ 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;
1018
+
1019
+ interface WatchDebouncedOptions<Immediate> extends WatchOptions<Immediate>, DebounceFilterOptions {
1020
+ debounce?: MaybeComputedRef<number>;
1021
+ }
1022
+ declare function watchDebounced<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchDebouncedOptions<Immediate>): WatchStopHandle;
1023
+ declare function watchDebounced<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchDebouncedOptions<Immediate>): WatchStopHandle;
1024
+ 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>): WatchStopHandle;
1025
+
1026
+ type IgnoredUpdater = (updater: () => void) => void;
1027
+ interface WatchIgnorableReturn {
1028
+ ignoreUpdates: IgnoredUpdater;
1029
+ ignorePrevAsyncUpdates: () => void;
1030
+ stop: WatchStopHandle;
1031
+ }
1032
+ declare function watchIgnorable<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchWithFilterOptions<Immediate>): WatchIgnorableReturn;
1033
+ 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;
1034
+ 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;
1035
+
1036
+ 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;
1037
+ 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;
1038
+
1039
+ interface WatchPausableReturn extends Pausable {
1040
+ stop: WatchStopHandle;
1041
+ }
1042
+ 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;
1043
+ 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;
1044
+ 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;
1045
+
1046
+ interface WatchThrottledOptions<Immediate> extends WatchOptions<Immediate> {
1047
+ throttle?: MaybeComputedRef<number>;
1048
+ trailing?: boolean;
1049
+ leading?: boolean;
1050
+ }
1051
+ declare function watchThrottled<T extends Readonly<WatchSource<unknown>[]>, Immediate extends Readonly<boolean> = false>(sources: [...T], cb: WatchCallback<MapSources<T>, MapOldSources<T, Immediate>>, options?: WatchThrottledOptions<Immediate>): WatchStopHandle;
1052
+ declare function watchThrottled<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchThrottledOptions<Immediate>): WatchStopHandle;
1053
+ 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>): WatchStopHandle;
1054
+
1055
+ interface WatchTriggerableReturn<FnReturnT = void> extends WatchIgnorableReturn {
1056
+ /** Execute `WatchCallback` immediately */
1057
+ trigger: () => FnReturnT;
1058
+ }
1059
+ type OnCleanup = (cleanupFn: () => void) => void;
1060
+ type WatchTriggerableCallback<V = any, OV = any, R = void> = (value: V, oldValue: OV, onCleanup: OnCleanup) => R;
1061
+ declare function watchTriggerable<T extends Readonly<WatchSource<unknown>[]>, FnReturnT>(sources: [...T], cb: WatchTriggerableCallback<MapSources<T>, MapOldSources<T, true>, FnReturnT>, options?: WatchWithFilterOptions<boolean>): WatchTriggerableReturn<FnReturnT>;
1062
+ declare function watchTriggerable<T, FnReturnT>(source: WatchSource<T>, cb: WatchTriggerableCallback<T, T | undefined, FnReturnT>, options?: WatchWithFilterOptions<boolean>): WatchTriggerableReturn<FnReturnT>;
1063
+ declare function watchTriggerable<T extends object, FnReturnT>(source: T, cb: WatchTriggerableCallback<T, T | undefined, FnReturnT>, options?: WatchWithFilterOptions<boolean>): WatchTriggerableReturn<FnReturnT>;
1064
+
1065
+ /**
1066
+ * Shorthand for watching value to be truthy
1067
+ *
1068
+ * @see https://vueuse.org/whenever
1069
+ */
1070
+ declare function whenever<T>(source: WatchSource<T | false | null | undefined>, cb: WatchCallback<T>, options?: WatchOptions): vue_demi.WatchStopHandle;
1071
+
1072
+ export { AnyFn, ArgumentsType, Arrayable, Awaitable, ComputedRefWithControl, ComputedWithControlRefExtra, ConfigurableEventFilter, ConfigurableFlush, ConfigurableFlushSync, ControlledRefOptions, CreateGlobalStateReturn, DateLike, DebounceFilterOptions, DeepMaybeRef, ElementOf, EventFilter, EventHook, EventHookOff, EventHookOn, EventHookTrigger, ExtendRefOptions, Fn, FunctionArgs, FunctionWrapperOptions, IgnoredUpdater, MapOldSources, MapSources, MaybeComputedRef, MaybeReadonlyRef, MaybeRef, Pausable, PromisifyFn, Reactified, ReactifyNested, ReactifyObjectOptions, ReactifyOptions, RemovableRef, RemoveableRef, ShallowUnwrapRef, SingletonPromiseReturn, Stopable, Stoppable, SyncRefOptions, SyncRefsOptions, UntilArrayInstance, UntilBaseInstance, UntilToMatchOptions, UntilValueInstance, UseArrayReducer, UseCounterOptions, UseDateFormatOptions, UseDateFormatReturn, UseIntervalControls, UseIntervalFnOptions, UseIntervalOptions, UseLastChangedOptions, UseTimeoutFnOptions, UseTimeoutOptions, UseToNumberOptions, UseToggleOptions, WatchArrayCallback, WatchAtMostOptions, WatchAtMostReturn, WatchDebouncedOptions, WatchIgnorableReturn, WatchPausableReturn, WatchThrottledOptions, WatchTriggerableCallback, WatchTriggerableReturn, WatchWithFilterOptions, WritableComputedRefWithControl, __onlyVue27Plus, __onlyVue3, assert, refAutoReset as autoResetRef, bypassFilter, clamp, computedEager, computedWithControl, containsProp, computedWithControl as controlledComputed, controlledRef, createEventHook, createFilterWrapper, createGlobalState, createInjectionState, reactify as createReactiveFn, createSharedComposable, createSingletonPromise, debounceFilter, refDebounced as debouncedRef, watchDebounced as debouncedWatch, directiveHooks, computedEager as eagerComputed, extendRef, formatDate, get, hasOwn, identity, watchIgnorable as ignorableWatch, increaseWithUnit, invoke, isBoolean, isClient, isDef, isDefined, isFunction, isIOS, isNumber, isObject, isString, isWindow, makeDestructurable, noop, normalizeDate, now, objectPick, pausableFilter, watchPausable as pausableWatch, promiseTimeout, rand, reactify, reactifyObject, reactiveComputed, reactiveOmit, reactivePick, refAutoReset, refDebounced, refDefault, refThrottled, refWithControl, resolveRef, resolveUnref, set, syncRef, syncRefs, throttleFilter, refThrottled as throttledRef, watchThrottled as throttledWatch, timestamp, toReactive, toRefs, tryOnBeforeMount, tryOnBeforeUnmount, tryOnMounted, tryOnScopeDispose, tryOnUnmounted, until, useArrayEvery, useArrayFilter, useArrayFind, useArrayFindIndex, useArrayFindLast, 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, watchIgnorable, watchOnce, watchPausable, watchThrottled, watchTriggerable, watchWithFilter, whenever };