@mc-markets/ui 1.0.37 → 1.0.39

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 (90) hide show
  1. package/README.md +100 -0
  2. package/dist/index.js +18841 -4
  3. package/dist/index.js.css +1 -0
  4. package/package.json +28 -76
  5. package/packages/styles/README.md +0 -150
  6. package/packages/styles/index.scss +48 -5
  7. package/packages/styles/{theme-config.ts → theme-config.js} +35 -55
  8. package/packages/styles/variables/border-mode.css +6 -6
  9. package/packages/styles/variables/index.scss +5 -5
  10. package/packages/styles/variables/primitives-style.css +112 -112
  11. package/packages/styles/variables/radius-mode.css +14 -14
  12. package/packages/styles/variables/spacing-mode.css +20 -20
  13. package/packages/styles/variables/typography-desktop.css +40 -40
  14. package/packages/styles/variables/typography-mobile.css +40 -40
  15. package/packages/styles/variables.scss +17 -79
  16. package/dist/components/Alert/Alert.vue.d.ts +0 -18
  17. package/dist/components/Alert/index.d.ts +0 -3
  18. package/dist/components/Banner/Banner.vue.d.ts +0 -18
  19. package/dist/components/Banner/index.d.ts +0 -3
  20. package/dist/components/DatePicker/DatePicker.vue.d.ts +0 -17
  21. package/dist/components/DatePicker/index.d.ts +0 -3
  22. package/dist/components/Dialog/index.vue.d.ts +0 -51
  23. package/dist/components/Empty/Empty.vue.d.ts +0 -19
  24. package/dist/components/Empty/index.d.ts +0 -3
  25. package/dist/components/Icon/index.d.ts +0 -3
  26. package/dist/components/Icon/types.d.ts +0 -35
  27. package/dist/components/Notification/Notification.vue.d.ts +0 -18
  28. package/dist/components/Notification/index.d.ts +0 -3
  29. package/dist/components/Pagination/Pagination.vue.d.ts +0 -17
  30. package/dist/components/Pagination/index.d.ts +0 -3
  31. package/dist/components/Tab/Tab.vue.d.ts +0 -17
  32. package/dist/components/Tab/TabPane.vue.d.ts +0 -18
  33. package/dist/components/Tooltips/Tooltips.vue.d.ts +0 -18
  34. package/dist/components/Tooltips/index.d.ts +0 -3
  35. package/dist/index.d.ts +0 -24
  36. package/dist/node_modules/@babel/parser/typings/babel-parser.d.ts +0 -235
  37. package/dist/node_modules/@babel/types/lib/index.d.ts +0 -3308
  38. package/dist/node_modules/@ctrl/tinycolor/dist/conversion.d.ts +0 -61
  39. package/dist/node_modules/@ctrl/tinycolor/dist/css-color-names.d.ts +0 -4
  40. package/dist/node_modules/@ctrl/tinycolor/dist/format-input.d.ts +0 -37
  41. package/dist/node_modules/@ctrl/tinycolor/dist/from-ratio.d.ts +0 -14
  42. package/dist/node_modules/@ctrl/tinycolor/dist/index.d.ts +0 -207
  43. package/dist/node_modules/@ctrl/tinycolor/dist/interfaces.d.ts +0 -46
  44. package/dist/node_modules/@ctrl/tinycolor/dist/public_api.d.ts +0 -11
  45. package/dist/node_modules/@ctrl/tinycolor/dist/random.d.ts +0 -24
  46. package/dist/node_modules/@ctrl/tinycolor/dist/readability.d.ts +0 -46
  47. package/dist/node_modules/@ctrl/tinycolor/dist/to-ms-filter.d.ts +0 -5
  48. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +0 -514
  49. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts +0 -327
  50. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +0 -103
  51. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +0 -47
  52. package/dist/node_modules/@types/lodash/common/array.d.ts +0 -2137
  53. package/dist/node_modules/@types/lodash/common/collection.d.ts +0 -1938
  54. package/dist/node_modules/@types/lodash/common/common.d.ts +0 -287
  55. package/dist/node_modules/@types/lodash/common/date.d.ts +0 -23
  56. package/dist/node_modules/@types/lodash/common/function.d.ts +0 -1455
  57. package/dist/node_modules/@types/lodash/common/lang.d.ts +0 -1700
  58. package/dist/node_modules/@types/lodash/common/math.d.ts +0 -405
  59. package/dist/node_modules/@types/lodash/common/number.d.ts +0 -131
  60. package/dist/node_modules/@types/lodash/common/object.d.ts +0 -2643
  61. package/dist/node_modules/@types/lodash/common/seq.d.ts +0 -210
  62. package/dist/node_modules/@types/lodash/common/string.d.ts +0 -788
  63. package/dist/node_modules/@types/lodash/common/util.d.ts +0 -1220
  64. package/dist/node_modules/@types/lodash/index.d.ts +0 -21
  65. package/dist/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +0 -1093
  66. package/dist/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +0 -45
  67. package/dist/node_modules/@vue/reactivity/dist/reactivity.d.ts +0 -756
  68. package/dist/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +0 -1839
  69. package/dist/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +0 -1397
  70. package/dist/node_modules/@vue/shared/dist/shared.d.ts +0 -335
  71. package/dist/node_modules/@vueuse/core/index.d.ts +0 -4536
  72. package/dist/node_modules/@vueuse/core/node_modules/vue-demi/lib/index.d.ts +0 -22
  73. package/dist/node_modules/@vueuse/shared/index.d.ts +0 -1072
  74. package/dist/node_modules/@vueuse/shared/node_modules/vue-demi/lib/index.d.ts +0 -22
  75. package/dist/node_modules/async-validator/dist-types/index.d.ts +0 -43
  76. package/dist/node_modules/async-validator/dist-types/interface.d.ts +0 -135
  77. package/dist/node_modules/csstype/index.d.ts +0 -21297
  78. package/dist/node_modules/dayjs/index.d.ts +0 -429
  79. package/dist/node_modules/dayjs/locale/index.d.ts +0 -11
  80. package/dist/node_modules/dayjs/locale/types.d.ts +0 -33
  81. package/dist/node_modules/element-plus/es/index.d.ts +0 -26960
  82. package/dist/node_modules/element-plus/es/utils/vue3.3.polyfill.d.ts +0 -34
  83. package/dist/node_modules/memoize-one/dist/memoize-one.d.ts +0 -7
  84. package/dist/node_modules/vue/dist/vue.d.mts +0 -7
  85. package/dist/style.css +0 -1
  86. package/dist/styles/theme-config.d.ts +0 -83
  87. package/dist/types/auto-imports.d.ts +0 -84
  88. package/dist/types/components.d.ts +0 -55
  89. package/packages/styles/element/button.scss +0 -99
  90. package/packages/styles/element/form.scss +0 -27
@@ -1,4536 +0,0 @@
1
- import { Fn, MaybeRef, MaybeComputedRef, Awaitable, ConfigurableEventFilter, ConfigurableFlush, RemovableRef, EventHookOn, Arrayable, MaybeReadonlyRef, UseIntervalFnOptions, Pausable, UseTimeoutFnOptions, EventHook } from '@vueuse/shared';
2
- import { Ref, InjectionKey, ComputedRef, ComponentPublicInstance, Component, UnwrapRef, WatchOptions, UnwrapNestedRefs, WatchSource, ToRefs, StyleValue, ShallowRef } from 'vue-demi';
3
- import * as _vueuse_shared from '@vueuse/shared';
4
- export * from '@vueuse/shared';
5
- import * as vue_demi from 'vue-demi';
6
- import * as vue from 'vue-demi';
7
-
8
- /**
9
- * Handle overlapping async evaluations.
10
- *
11
- * @param cancelCallback The provided callback is invoked when a re-evaluation of the computed value is triggered before the previous one finished
12
- */
13
- type AsyncComputedOnCancel = (cancelCallback: Fn) => void;
14
- interface AsyncComputedOptions {
15
- /**
16
- * Should value be evaluated lazily
17
- *
18
- * @default false
19
- */
20
- lazy?: boolean;
21
- /**
22
- * Ref passed to receive the updated of async evaluation
23
- */
24
- evaluating?: Ref<boolean>;
25
- /**
26
- * Use shallowRef
27
- *
28
- * The default value will be changed to `true` in the next major version
29
- *
30
- * @default false
31
- */
32
- shallow?: boolean;
33
- /**
34
- * Callback when error is caught.
35
- */
36
- onError?: (e: unknown) => void;
37
- }
38
- /**
39
- * Create an asynchronous computed dependency.
40
- *
41
- * @see https://vueuse.org/computedAsync
42
- * @param evaluationCallback The promise-returning callback which generates the computed value
43
- * @param initialState The initial state, used until the first evaluation finishes
44
- * @param optionsOrRef Additional options or a ref passed to receive the updates of the async evaluation
45
- */
46
- declare function computedAsync<T>(evaluationCallback: (onCancel: AsyncComputedOnCancel) => T | Promise<T>, initialState?: T, optionsOrRef?: Ref<boolean> | AsyncComputedOptions): Ref<T>;
47
-
48
- type ComputedInjectGetter<T, K> = (source: T | undefined, ctx?: any) => K;
49
- type ComputedInjectGetterWithDefault<T, K> = (source: T, ctx?: any) => K;
50
- type ComputedInjectSetter<T> = (v: T) => void;
51
- interface WritableComputedInjectOptions<T, K> {
52
- get: ComputedInjectGetter<T, K>;
53
- set: ComputedInjectSetter<K>;
54
- }
55
- interface WritableComputedInjectOptionsWithDefault<T, K> {
56
- get: ComputedInjectGetterWithDefault<T, K>;
57
- set: ComputedInjectSetter<K>;
58
- }
59
- declare function computedInject<T, K = any>(key: InjectionKey<T> | string, getter: ComputedInjectGetter<T, K>): ComputedRef<K | undefined>;
60
- declare function computedInject<T, K = any>(key: InjectionKey<T> | string, options: WritableComputedInjectOptions<T, K>): ComputedRef<K | undefined>;
61
- declare function computedInject<T, K = any>(key: InjectionKey<T> | string, getter: ComputedInjectGetterWithDefault<T, K>, defaultSource: T, treatDefaultAsFactory?: false): ComputedRef<K>;
62
- declare function computedInject<T, K = any>(key: InjectionKey<T> | string, options: WritableComputedInjectOptionsWithDefault<T, K>, defaultSource: T | (() => T), treatDefaultAsFactory: true): ComputedRef<K>;
63
-
64
- type UnrefFn<T> = T extends (...args: infer A) => infer R ? (...args: {
65
- [K in keyof A]: MaybeRef<A[K]>;
66
- }) => R : never;
67
- /**
68
- * Make a plain function accepting ref and raw values as arguments.
69
- * Returns the same value the unconverted function returns, with proper typing.
70
- */
71
- declare const createUnrefFn: <T extends Function>(fn: T) => UnrefFn<T>;
72
-
73
- type VueInstance = ComponentPublicInstance;
74
- type MaybeElementRef<T extends MaybeElement = MaybeElement> = MaybeRef<T>;
75
- type MaybeComputedElementRef<T extends MaybeElement = MaybeElement> = MaybeComputedRef<T>;
76
- type MaybeElement = HTMLElement | SVGElement | VueInstance | undefined | null;
77
- type UnRefElementReturn<T extends MaybeElement = MaybeElement> = T extends VueInstance ? Exclude<MaybeElement, VueInstance> : T | undefined;
78
- /**
79
- * Get the dom element of a ref of element or Vue component instance
80
- *
81
- * @param elRef
82
- */
83
- declare function unrefElement<T extends MaybeElement>(elRef: MaybeComputedElementRef<T>): UnRefElementReturn<T>;
84
-
85
- interface ConfigurableWindow {
86
- window?: Window;
87
- }
88
- interface ConfigurableDocument {
89
- document?: Document;
90
- }
91
- interface ConfigurableDocumentOrShadowRoot {
92
- document?: DocumentOrShadowRoot;
93
- }
94
- interface ConfigurableNavigator {
95
- navigator?: Navigator;
96
- }
97
- interface ConfigurableLocation {
98
- location?: Location;
99
- }
100
- declare const defaultWindow: (Window & typeof globalThis) | undefined;
101
- declare const defaultDocument: Document | undefined;
102
- declare const defaultNavigator: Navigator | undefined;
103
- declare const defaultLocation: Location | undefined;
104
-
105
- interface OnClickOutsideOptions extends ConfigurableWindow {
106
- /**
107
- * List of elements that should not trigger the event.
108
- */
109
- ignore?: (MaybeElementRef | string)[];
110
- /**
111
- * Use capturing phase for internal event listener.
112
- * @default true
113
- */
114
- capture?: boolean;
115
- /**
116
- * Run handler function if focus moves to an iframe.
117
- * @default false
118
- */
119
- detectIframe?: boolean;
120
- }
121
- type OnClickOutsideHandler<T extends {
122
- detectIframe: OnClickOutsideOptions['detectIframe'];
123
- } = {
124
- detectIframe: false;
125
- }> = (evt: T['detectIframe'] extends true ? PointerEvent | FocusEvent : PointerEvent) => void;
126
- /**
127
- * Listen for clicks outside of an element.
128
- *
129
- * @see https://vueuse.org/onClickOutside
130
- * @param target
131
- * @param handler
132
- * @param options
133
- */
134
- declare function onClickOutside<T extends OnClickOutsideOptions>(target: MaybeElementRef, handler: OnClickOutsideHandler<{
135
- detectIframe: T['detectIframe'];
136
- }>, options?: T): (() => void) | undefined;
137
-
138
- type KeyPredicate = (event: KeyboardEvent) => boolean;
139
- type KeyFilter = true | string | string[] | KeyPredicate;
140
- type KeyStrokeEventName = 'keydown' | 'keypress' | 'keyup';
141
- interface OnKeyStrokeOptions {
142
- eventName?: KeyStrokeEventName;
143
- target?: MaybeComputedRef<EventTarget | null | undefined>;
144
- passive?: boolean;
145
- }
146
- declare function onKeyStroke(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): () => void;
147
- declare function onKeyStroke(handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): () => void;
148
- /**
149
- * Listen for keyboard keys being stroked.
150
- *
151
- * @see https://vueuse.org/onKeyStroke
152
- */
153
- declare function onKeyStroke(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): () => void;
154
- declare function onKeyStroke(handler: (event: KeyboardEvent) => void, options?: OnKeyStrokeOptions): () => void;
155
- /**
156
- * Listen to the keydown event of the given key.
157
- *
158
- * @see https://vueuse.org/onKeyStroke
159
- * @param key
160
- * @param handler
161
- * @param options
162
- */
163
- declare function onKeyDown(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: Omit<OnKeyStrokeOptions, 'eventName'>): () => void;
164
- /**
165
- * Listen to the keypress event of the given key.
166
- *
167
- * @see https://vueuse.org/onKeyStroke
168
- * @param key
169
- * @param handler
170
- * @param options
171
- */
172
- declare function onKeyPressed(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: Omit<OnKeyStrokeOptions, 'eventName'>): () => void;
173
- /**
174
- * Listen to the keyup event of the given key.
175
- *
176
- * @see https://vueuse.org/onKeyStroke
177
- * @param key
178
- * @param handler
179
- * @param options
180
- */
181
- declare function onKeyUp(key: KeyFilter, handler: (event: KeyboardEvent) => void, options?: Omit<OnKeyStrokeOptions, 'eventName'>): () => void;
182
-
183
- interface OnLongPressOptions {
184
- /**
185
- * Time in ms till `longpress` gets called
186
- *
187
- * @default 500
188
- */
189
- delay?: number;
190
- modifiers?: OnLongPressModifiers;
191
- }
192
- interface OnLongPressModifiers {
193
- stop?: boolean;
194
- once?: boolean;
195
- prevent?: boolean;
196
- capture?: boolean;
197
- self?: boolean;
198
- }
199
- declare function onLongPress(target: MaybeElementRef, handler: (evt: PointerEvent) => void, options?: OnLongPressOptions): void;
200
-
201
- /**
202
- * Fires when users start typing on non-editable elements.
203
- *
204
- * @see https://vueuse.org/onStartTyping
205
- * @param callback
206
- * @param options
207
- */
208
- declare function onStartTyping(callback: (event: KeyboardEvent) => void, options?: ConfigurableDocument): void;
209
-
210
- /**
211
- * Shorthand for binding ref to template element.
212
- *
213
- * @see https://vueuse.org/templateRef
214
- * @param key
215
- * @param initialValue
216
- */
217
- declare function templateRef<T extends HTMLElement | SVGElement | Component | null>(key: string, initialValue?: T | null): Readonly<Ref<T>>;
218
-
219
- interface UseActiveElementOptions extends ConfigurableWindow, ConfigurableDocumentOrShadowRoot {
220
- }
221
- /**
222
- * Reactive `document.activeElement`
223
- *
224
- * @see https://vueuse.org/useActiveElement
225
- * @param options
226
- */
227
- declare function useActiveElement<T extends HTMLElement>(options?: UseActiveElementOptions): _vueuse_shared.ComputedRefWithControl<T | null | undefined>;
228
-
229
- type UseAsyncQueueTask<T> = (...args: any[]) => T | Promise<T>;
230
- interface UseAsyncQueueResult<T> {
231
- state: 'pending' | 'fulfilled' | 'rejected';
232
- data: T | null;
233
- }
234
- interface UseAsyncQueueReturn<T> {
235
- activeIndex: Ref<number>;
236
- result: T;
237
- }
238
- interface UseAsyncQueueOptions {
239
- /**
240
- * Interrupt tasks when current task fails.
241
- *
242
- * @default true
243
- */
244
- interrupt?: boolean;
245
- /**
246
- * Trigger it when the tasks fails.
247
- *
248
- */
249
- onError?: () => void;
250
- /**
251
- * Trigger it when the tasks ends.
252
- *
253
- */
254
- onFinished?: () => void;
255
- }
256
- /**
257
- * Asynchronous queue task controller.
258
- *
259
- * @see https://vueuse.org/useAsyncQueue
260
- * @param tasks
261
- * @param options
262
- */
263
- declare function useAsyncQueue<T1>(tasks: [UseAsyncQueueTask<T1>], options?: UseAsyncQueueOptions): UseAsyncQueueReturn<[UseAsyncQueueResult<T1>]>;
264
- declare function useAsyncQueue<T1, T2>(tasks: [UseAsyncQueueTask<T1>, UseAsyncQueueTask<T2>], options?: UseAsyncQueueOptions): UseAsyncQueueReturn<[UseAsyncQueueResult<T1>, UseAsyncQueueResult<T2>]>;
265
- declare function useAsyncQueue<T1, T2, T3>(tasks: [UseAsyncQueueTask<T1>, UseAsyncQueueTask<T2>, UseAsyncQueueTask<T3>], options?: UseAsyncQueueOptions): UseAsyncQueueReturn<[UseAsyncQueueResult<T1>, UseAsyncQueueResult<T2>, UseAsyncQueueResult<T3>]>;
266
- declare function useAsyncQueue<T1, T2, T3, T4>(tasks: [UseAsyncQueueTask<T1>, UseAsyncQueueTask<T2>, UseAsyncQueueTask<T3>, UseAsyncQueueTask<T4>], options?: UseAsyncQueueOptions): UseAsyncQueueReturn<[UseAsyncQueueResult<T1>, UseAsyncQueueResult<T2>, UseAsyncQueueResult<T3>, UseAsyncQueueResult<T4>]>;
267
- declare function useAsyncQueue<T1, T2, T3, T4, T5>(tasks: [UseAsyncQueueTask<T1>, UseAsyncQueueTask<T2>, UseAsyncQueueTask<T3>, UseAsyncQueueTask<T4>, UseAsyncQueueTask<T5>], options?: UseAsyncQueueOptions): UseAsyncQueueReturn<[UseAsyncQueueResult<T1>, UseAsyncQueueResult<T2>, UseAsyncQueueResult<T3>, UseAsyncQueueResult<T4>, UseAsyncQueueResult<T5>]>;
268
- declare function useAsyncQueue<T>(tasks: UseAsyncQueueTask<T>[], options?: UseAsyncQueueOptions): UseAsyncQueueReturn<UseAsyncQueueResult<T>[]>;
269
-
270
- interface UseAsyncStateReturn<Data, Params extends any[], Shallow extends boolean> {
271
- state: Shallow extends true ? Ref<Data> : Ref<UnwrapRef<Data>>;
272
- isReady: Ref<boolean>;
273
- isLoading: Ref<boolean>;
274
- error: Ref<unknown>;
275
- execute: (delay?: number, ...args: Params) => Promise<Data>;
276
- }
277
- interface UseAsyncStateOptions<Shallow extends boolean, D = any> {
278
- /**
279
- * Delay for executing the promise. In milliseconds.
280
- *
281
- * @default 0
282
- */
283
- delay?: number;
284
- /**
285
- * Execute the promise right after the function is invoked.
286
- * Will apply the delay if any.
287
- *
288
- * When set to false, you will need to execute it manually.
289
- *
290
- * @default true
291
- */
292
- immediate?: boolean;
293
- /**
294
- * Callback when error is caught.
295
- */
296
- onError?: (e: unknown) => void;
297
- /**
298
- * Callback when success is caught.
299
- * @param {D} data
300
- */
301
- onSuccess?: (data: D) => void;
302
- /**
303
- * Sets the state to initialState before executing the promise.
304
- *
305
- * This can be useful when calling the execute function more than once (for
306
- * example, to refresh data). When set to false, the current state remains
307
- * unchanged until the promise resolves.
308
- *
309
- * @default true
310
- */
311
- resetOnExecute?: boolean;
312
- /**
313
- * Use shallowRef.
314
- *
315
- * @default true
316
- */
317
- shallow?: Shallow;
318
- /**
319
- *
320
- * An error is thrown when executing the execute function
321
- *
322
- * @default false
323
- */
324
- throwError?: boolean;
325
- }
326
- /**
327
- * Reactive async state. Will not block your setup function and will trigger changes once
328
- * the promise is ready.
329
- *
330
- * @see https://vueuse.org/useAsyncState
331
- * @param promise The promise / async function to be resolved
332
- * @param initialState The initial state, used until the first evaluation finishes
333
- * @param options
334
- */
335
- declare function useAsyncState<Data, Params extends any[] = [], Shallow extends boolean = true>(promise: Promise<Data> | ((...args: Params) => Promise<Data>), initialState: Data, options?: UseAsyncStateOptions<Shallow, Data>): UseAsyncStateReturn<Data, Params, Shallow>;
336
-
337
- interface ToDataURLOptions {
338
- /**
339
- * MIME type
340
- */
341
- type?: string | undefined;
342
- /**
343
- * Image quality of jpeg or webp
344
- */
345
- quality?: any;
346
- }
347
- interface UseBase64ObjectOptions<T> {
348
- serializer: (v: T) => string;
349
- }
350
- interface UseBase64Return {
351
- base64: Ref<string>;
352
- promise: Ref<Promise<string>>;
353
- execute: () => Promise<string>;
354
- }
355
- declare function useBase64(target: MaybeComputedRef<string>): UseBase64Return;
356
- declare function useBase64(target: MaybeComputedRef<Blob>): UseBase64Return;
357
- declare function useBase64(target: MaybeComputedRef<ArrayBuffer>): UseBase64Return;
358
- declare function useBase64(target: MaybeComputedRef<HTMLCanvasElement>, options?: ToDataURLOptions): UseBase64Return;
359
- declare function useBase64(target: MaybeComputedRef<HTMLImageElement>, options?: ToDataURLOptions): UseBase64Return;
360
- declare function useBase64<T extends Record<string, unknown>>(target: MaybeComputedRef<T>, options?: UseBase64ObjectOptions<T>): UseBase64Return;
361
- declare function useBase64<T extends Map<string, unknown>>(target: MaybeComputedRef<T>, options?: UseBase64ObjectOptions<T>): UseBase64Return;
362
- declare function useBase64<T extends Set<unknown>>(target: MaybeComputedRef<T>, options?: UseBase64ObjectOptions<T>): UseBase64Return;
363
- declare function useBase64<T>(target: MaybeComputedRef<T[]>, options?: UseBase64ObjectOptions<T[]>): UseBase64Return;
364
-
365
- interface BatteryManager extends EventTarget {
366
- charging: boolean;
367
- chargingTime: number;
368
- dischargingTime: number;
369
- level: number;
370
- }
371
- /**
372
- * Reactive Battery Status API.
373
- *
374
- * @see https://vueuse.org/useBattery
375
- * @param options
376
- */
377
- declare function useBattery({ navigator }?: ConfigurableNavigator): {
378
- isSupported: vue_demi.Ref<boolean>;
379
- charging: vue_demi.Ref<boolean>;
380
- chargingTime: vue_demi.Ref<number>;
381
- dischargingTime: vue_demi.Ref<number>;
382
- level: vue_demi.Ref<number>;
383
- };
384
- type UseBatteryReturn = ReturnType<typeof useBattery>;
385
-
386
- interface UseBluetoothRequestDeviceOptions {
387
- /**
388
- *
389
- * An array of BluetoothScanFilters. This filter consists of an array
390
- * of BluetoothServiceUUIDs, a name parameter, and a namePrefix parameter.
391
- *
392
- */
393
- filters?: BluetoothLEScanFilter[] | undefined;
394
- /**
395
- *
396
- * An array of BluetoothServiceUUIDs.
397
- *
398
- * @see https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/uuid
399
- *
400
- */
401
- optionalServices?: BluetoothServiceUUID[] | undefined;
402
- }
403
- interface UseBluetoothOptions extends UseBluetoothRequestDeviceOptions, ConfigurableNavigator {
404
- /**
405
- *
406
- * A boolean value indicating that the requesting script can accept all Bluetooth
407
- * devices. The default is false.
408
- *
409
- * !! This may result in a bunch of unrelated devices being shown
410
- * in the chooser and energy being wasted as there are no filters.
411
- *
412
- *
413
- * Use it with caution.
414
- *
415
- * @default false
416
- *
417
- */
418
- acceptAllDevices?: boolean;
419
- }
420
- declare function useBluetooth(options?: UseBluetoothOptions): UseBluetoothReturn;
421
- interface UseBluetoothReturn {
422
- isSupported: Ref<boolean>;
423
- isConnected: ComputedRef<boolean>;
424
- device: Ref<BluetoothDevice | undefined>;
425
- requestDevice: () => Promise<void>;
426
- server: Ref<BluetoothRemoteGATTServer | undefined>;
427
- error: Ref<unknown | null>;
428
- }
429
-
430
- /**
431
- * Breakpoints from Tailwind V2
432
- *
433
- * @see https://tailwindcss.com/docs/breakpoints
434
- */
435
- declare const breakpointsTailwind: {
436
- sm: number;
437
- md: number;
438
- lg: number;
439
- xl: number;
440
- '2xl': number;
441
- };
442
- /**
443
- * Breakpoints from Bootstrap V5
444
- *
445
- * @see https://getbootstrap.com/docs/5.0/layout/breakpoints
446
- */
447
- declare const breakpointsBootstrapV5: {
448
- sm: number;
449
- md: number;
450
- lg: number;
451
- xl: number;
452
- xxl: number;
453
- };
454
- /**
455
- * Breakpoints from Vuetify V2
456
- *
457
- * @see https://vuetifyjs.com/en/features/breakpoints
458
- */
459
- declare const breakpointsVuetify: {
460
- xs: number;
461
- sm: number;
462
- md: number;
463
- lg: number;
464
- };
465
- /**
466
- * Breakpoints from Ant Design
467
- *
468
- * @see https://ant.design/components/layout/#breakpoint-width
469
- */
470
- declare const breakpointsAntDesign: {
471
- xs: number;
472
- sm: number;
473
- md: number;
474
- lg: number;
475
- xl: number;
476
- xxl: number;
477
- };
478
- /**
479
- * Breakpoints from Quasar V2
480
- *
481
- * @see https://quasar.dev/style/breakpoints
482
- */
483
- declare const breakpointsQuasar: {
484
- xs: number;
485
- sm: number;
486
- md: number;
487
- lg: number;
488
- };
489
- /**
490
- * Sematic Breakpoints
491
- */
492
- declare const breakpointsSematic: {
493
- mobileS: number;
494
- mobileM: number;
495
- mobileL: number;
496
- tablet: number;
497
- laptop: number;
498
- laptopL: number;
499
- desktop4K: number;
500
- };
501
- /**
502
- * Breakpoints from Master CSS
503
- *
504
- * @see https://docs.master.co/css/breakpoints
505
- */
506
- declare const breakpointsMasterCss: {
507
- '3xs': number;
508
- '2xs': number;
509
- xs: number;
510
- sm: number;
511
- md: number;
512
- lg: number;
513
- xl: number;
514
- '2xl': number;
515
- '3xl': number;
516
- '4xl': number;
517
- };
518
-
519
- type Breakpoints<K extends string = string> = Record<K, number | string>;
520
- /**
521
- * Reactively viewport breakpoints
522
- *
523
- * @see https://vueuse.org/useBreakpoints
524
- * @param options
525
- */
526
- declare function useBreakpoints<K extends string>(breakpoints: Breakpoints<K>, options?: ConfigurableWindow): {
527
- greater(k: K): Ref<boolean>;
528
- greaterOrEqual: (k: K) => Ref<boolean>;
529
- smaller(k: K): Ref<boolean>;
530
- smallerOrEqual(k: K): Ref<boolean>;
531
- between(a: K, b: K): Ref<boolean>;
532
- isGreater(k: K): boolean;
533
- isGreaterOrEqual(k: K): boolean;
534
- isSmaller(k: K): boolean;
535
- isSmallerOrEqual(k: K): boolean;
536
- isInBetween(a: K, b: K): boolean;
537
- } & Record<K, Ref<boolean>>;
538
- type UseBreakpointsReturn<K extends string = string> = {
539
- greater: (k: K) => Ref<boolean>;
540
- greaterOrEqual: (k: K) => Ref<boolean>;
541
- smaller(k: K): Ref<boolean>;
542
- smallerOrEqual: (k: K) => Ref<boolean>;
543
- between(a: K, b: K): Ref<boolean>;
544
- isGreater(k: K): boolean;
545
- isGreaterOrEqual(k: K): boolean;
546
- isSmaller(k: K): boolean;
547
- isSmallerOrEqual(k: K): boolean;
548
- isInBetween(a: K, b: K): boolean;
549
- } & Record<K, Ref<boolean>>;
550
-
551
- interface UseBroadcastChannelOptions extends ConfigurableWindow {
552
- /**
553
- * The name of the channel.
554
- */
555
- name: string;
556
- }
557
- /**
558
- * Reactive BroadcastChannel
559
- *
560
- * @see https://vueuse.org/useBroadcastChannel
561
- * @see https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
562
- * @param options
563
- *
564
- */
565
- declare const useBroadcastChannel: <D, P>(options: UseBroadcastChannelOptions) => UseBroadcastChannelReturn<D, P>;
566
- interface UseBroadcastChannelReturn<D, P> {
567
- isSupported: Ref<boolean>;
568
- channel: Ref<BroadcastChannel | undefined>;
569
- data: Ref<D>;
570
- post: (data: P) => void;
571
- close: () => void;
572
- error: Ref<Event | null>;
573
- isClosed: Ref<boolean>;
574
- }
575
-
576
- interface BrowserLocationState {
577
- trigger: string;
578
- state?: any;
579
- length?: number;
580
- hash?: string;
581
- host?: string;
582
- hostname?: string;
583
- href?: string;
584
- origin?: string;
585
- pathname?: string;
586
- port?: string;
587
- protocol?: string;
588
- search?: string;
589
- }
590
- /**
591
- * Reactive browser location.
592
- *
593
- * @see https://vueuse.org/useBrowserLocation
594
- * @param options
595
- */
596
- declare function useBrowserLocation({ window }?: ConfigurableWindow): vue_demi.Ref<{
597
- trigger: string;
598
- state?: any;
599
- length?: number | undefined;
600
- hash?: string | undefined;
601
- host?: string | undefined;
602
- hostname?: string | undefined;
603
- href?: string | undefined;
604
- origin?: string | undefined;
605
- pathname?: string | undefined;
606
- port?: string | undefined;
607
- protocol?: string | undefined;
608
- search?: string | undefined;
609
- }>;
610
- type UseBrowserLocationReturn = ReturnType<typeof useBrowserLocation>;
611
-
612
- declare function useCached<T>(refValue: Ref<T>, comparator?: (a: T, b: T) => boolean, watchOptions?: WatchOptions): Ref<T>;
613
-
614
- interface UseClipboardOptions<Source> extends ConfigurableNavigator {
615
- /**
616
- * Enabled reading for clipboard
617
- *
618
- * @default false
619
- */
620
- read?: boolean;
621
- /**
622
- * Copy source
623
- */
624
- source?: Source;
625
- /**
626
- * Milliseconds to reset state of `copied` ref
627
- *
628
- * @default 1500
629
- */
630
- copiedDuring?: number;
631
- /**
632
- * Whether fallback to document.execCommand('copy') if clipboard is undefined.
633
- *
634
- * @default false
635
- */
636
- legacy?: boolean;
637
- }
638
- interface UseClipboardReturn<Optional> {
639
- isSupported: Ref<boolean>;
640
- text: ComputedRef<string>;
641
- copied: ComputedRef<boolean>;
642
- copy: Optional extends true ? (text?: string) => Promise<void> : (text: string) => Promise<void>;
643
- }
644
- /**
645
- * Reactive Clipboard API.
646
- *
647
- * @see https://vueuse.org/useClipboard
648
- * @param options
649
- */
650
- declare function useClipboard(options?: UseClipboardOptions<undefined>): UseClipboardReturn<false>;
651
- declare function useClipboard(options: UseClipboardOptions<MaybeComputedRef<string>>): UseClipboardReturn<true>;
652
-
653
- interface UseClonedOptions<T = any> extends WatchOptions {
654
- /**
655
- * Custom clone function.
656
- *
657
- * By default, it use `JSON.parse(JSON.stringify(value))` to clone.
658
- */
659
- clone?: (source: T) => T;
660
- /**
661
- * Manually sync the ref
662
- *
663
- * @default false
664
- */
665
- manual?: boolean;
666
- }
667
- interface UseClonedReturn<T> {
668
- /**
669
- * Cloned ref
670
- */
671
- cloned: ComputedRef<T>;
672
- /**
673
- * Sync cloned data with source manually
674
- */
675
- sync: () => void;
676
- }
677
- type CloneFn<F, T = F> = (x: F) => T;
678
- declare function cloneFnJSON<T>(source: T): T;
679
- declare function useCloned<T>(source: MaybeComputedRef<T>, options?: UseClonedOptions): {
680
- cloned: vue_demi.Ref<vue_demi.UnwrapRef<T>>;
681
- sync: () => void;
682
- };
683
-
684
- interface StorageLikeAsync {
685
- getItem(key: string): Awaitable<string | null>;
686
- setItem(key: string, value: string): Awaitable<void>;
687
- removeItem(key: string): Awaitable<void>;
688
- }
689
- interface StorageLike {
690
- getItem(key: string): string | null;
691
- setItem(key: string, value: string): void;
692
- removeItem(key: string): void;
693
- }
694
- /**
695
- * @experimental The API is not finalized yet. It might not follow semver.
696
- */
697
- interface SSRHandlersMap {
698
- getDefaultStorage: () => StorageLike | undefined;
699
- getDefaultStorageAsync: () => StorageLikeAsync | undefined;
700
- updateHTMLAttrs: (selector: string, attribute: string, value: string) => void;
701
- }
702
- declare function getSSRHandler<T extends keyof SSRHandlersMap>(key: T, fallback: SSRHandlersMap[T]): SSRHandlersMap[T];
703
- declare function getSSRHandler<T extends keyof SSRHandlersMap>(key: T, fallback: SSRHandlersMap[T] | undefined): SSRHandlersMap[T] | undefined;
704
- declare function setSSRHandler<T extends keyof SSRHandlersMap>(key: T, fn: SSRHandlersMap[T]): void;
705
-
706
- interface Serializer<T> {
707
- read(raw: string): T;
708
- write(value: T): string;
709
- }
710
- interface SerializerAsync<T> {
711
- read(raw: string): Awaitable<T>;
712
- write(value: T): Awaitable<string>;
713
- }
714
- declare const StorageSerializers: Record<'boolean' | 'object' | 'number' | 'any' | 'string' | 'map' | 'set' | 'date', Serializer<any>>;
715
- declare const customStorageEventName = "vueuse-storage";
716
- interface StorageEventLike {
717
- storageArea: StorageLike | null;
718
- key: StorageEvent['key'];
719
- oldValue: StorageEvent['oldValue'];
720
- newValue: StorageEvent['newValue'];
721
- }
722
- interface UseStorageOptions<T> extends ConfigurableEventFilter, ConfigurableWindow, ConfigurableFlush {
723
- /**
724
- * Watch for deep changes
725
- *
726
- * @default true
727
- */
728
- deep?: boolean;
729
- /**
730
- * Listen to storage changes, useful for multiple tabs application
731
- *
732
- * @default true
733
- */
734
- listenToStorageChanges?: boolean;
735
- /**
736
- * Write the default value to the storage when it does not exist
737
- *
738
- * @default true
739
- */
740
- writeDefaults?: boolean;
741
- /**
742
- * Merge the default value with the value read from the storage.
743
- *
744
- * When setting it to true, it will perform a **shallow merge** for objects.
745
- * You can pass a function to perform custom merge (e.g. deep merge), for example:
746
- *
747
- * @default false
748
- */
749
- mergeDefaults?: boolean | ((storageValue: T, defaults: T) => T);
750
- /**
751
- * Custom data serialization
752
- */
753
- serializer?: Serializer<T>;
754
- /**
755
- * On error callback
756
- *
757
- * Default log error to `console.error`
758
- */
759
- onError?: (error: unknown) => void;
760
- /**
761
- * Use shallow ref as reference
762
- *
763
- * @default false
764
- */
765
- shallow?: boolean;
766
- }
767
- declare function useStorage(key: string, defaults: MaybeComputedRef<string>, storage?: StorageLike, options?: UseStorageOptions<string>): RemovableRef<string>;
768
- declare function useStorage(key: string, defaults: MaybeComputedRef<boolean>, storage?: StorageLike, options?: UseStorageOptions<boolean>): RemovableRef<boolean>;
769
- declare function useStorage(key: string, defaults: MaybeComputedRef<number>, storage?: StorageLike, options?: UseStorageOptions<number>): RemovableRef<number>;
770
- declare function useStorage<T>(key: string, defaults: MaybeComputedRef<T>, storage?: StorageLike, options?: UseStorageOptions<T>): RemovableRef<T>;
771
- declare function useStorage<T = unknown>(key: string, defaults: MaybeComputedRef<null>, storage?: StorageLike, options?: UseStorageOptions<T>): RemovableRef<T>;
772
-
773
- type BasicColorSchema = 'light' | 'dark' | 'auto';
774
- interface UseColorModeOptions<T extends string = BasicColorSchema> extends UseStorageOptions<T | BasicColorSchema> {
775
- /**
776
- * CSS Selector for the target element applying to
777
- *
778
- * @default 'html'
779
- */
780
- selector?: string;
781
- /**
782
- * HTML attribute applying the target element
783
- *
784
- * @default 'class'
785
- */
786
- attribute?: string;
787
- /**
788
- * The initial color mode
789
- *
790
- * @default 'auto'
791
- */
792
- initialValue?: T | BasicColorSchema;
793
- /**
794
- * Prefix when adding value to the attribute
795
- */
796
- modes?: Partial<Record<T | BasicColorSchema, string>>;
797
- /**
798
- * A custom handler for handle the updates.
799
- * When specified, the default behavior will be overridden.
800
- *
801
- * @default undefined
802
- */
803
- onChanged?: (mode: T | BasicColorSchema, defaultHandler: ((mode: T | BasicColorSchema) => void)) => void;
804
- /**
805
- * Custom storage ref
806
- *
807
- * When provided, `useStorage` will be skipped
808
- */
809
- storageRef?: Ref<T | BasicColorSchema>;
810
- /**
811
- * Key to persist the data into localStorage/sessionStorage.
812
- *
813
- * Pass `null` to disable persistence
814
- *
815
- * @default 'vueuse-color-scheme'
816
- */
817
- storageKey?: string | null;
818
- /**
819
- * Storage object, can be localStorage or sessionStorage
820
- *
821
- * @default localStorage
822
- */
823
- storage?: StorageLike;
824
- /**
825
- * Emit `auto` mode from state
826
- *
827
- * When set to `true`, preferred mode won't be translated into `light` or `dark`.
828
- * This is useful when the fact that `auto` mode was selected needs to be known.
829
- *
830
- * @default undefined
831
- */
832
- emitAuto?: boolean;
833
- }
834
- /**
835
- * Reactive color mode with auto data persistence.
836
- *
837
- * @see https://vueuse.org/useColorMode
838
- * @param options
839
- */
840
- declare function useColorMode<T extends string = BasicColorSchema>(options?: UseColorModeOptions<T>): vue_demi.WritableComputedRef<BasicColorSchema | T>;
841
-
842
- type UseConfirmDialogRevealResult<C, D> = {
843
- data?: C;
844
- isCanceled: false;
845
- } | {
846
- data?: D;
847
- isCanceled: true;
848
- };
849
- interface UseConfirmDialogReturn<RevealData, ConfirmData, CancelData> {
850
- /**
851
- * Revealing state
852
- */
853
- isRevealed: ComputedRef<boolean>;
854
- /**
855
- * Opens the dialog.
856
- * Create promise and return it. Triggers `onReveal` hook.
857
- */
858
- reveal: (data?: RevealData) => Promise<UseConfirmDialogRevealResult<ConfirmData, CancelData>>;
859
- /**
860
- * Confirms and closes the dialog. Triggers a callback inside `onConfirm` hook.
861
- * Resolves promise from `reveal()` with `data` and `isCanceled` ref with `false` value.
862
- * Can accept any data and to pass it to `onConfirm` hook.
863
- */
864
- confirm: (data?: ConfirmData) => void;
865
- /**
866
- * Cancels and closes the dialog. Triggers a callback inside `onCancel` hook.
867
- * Resolves promise from `reveal()` with `data` and `isCanceled` ref with `true` value.
868
- * Can accept any data and to pass it to `onCancel` hook.
869
- */
870
- cancel: (data?: CancelData) => void;
871
- /**
872
- * Event Hook to be triggered right before dialog creating.
873
- */
874
- onReveal: EventHookOn<RevealData>;
875
- /**
876
- * Event Hook to be called on `confirm()`.
877
- * Gets data object from `confirm` function.
878
- */
879
- onConfirm: EventHookOn<ConfirmData>;
880
- /**
881
- * Event Hook to be called on `cancel()`.
882
- * Gets data object from `cancel` function.
883
- */
884
- onCancel: EventHookOn<CancelData>;
885
- }
886
- /**
887
- * Hooks for creating confirm dialogs. Useful for modal windows, popups and logins.
888
- *
889
- * @see https://vueuse.org/useConfirmDialog/
890
- * @param revealed `boolean` `ref` that handles a modal window
891
- */
892
- declare function useConfirmDialog<RevealData = any, ConfirmData = any, CancelData = any>(revealed?: Ref<boolean>): UseConfirmDialogReturn<RevealData, ConfirmData, CancelData>;
893
-
894
- interface UseCssVarOptions extends ConfigurableWindow {
895
- initialValue?: string;
896
- }
897
- /**
898
- * Manipulate CSS variables.
899
- *
900
- * @see https://vueuse.org/useCssVar
901
- * @param prop
902
- * @param target
903
- * @param initialValue
904
- * @param options
905
- */
906
- declare function useCssVar(prop: MaybeComputedRef<string>, target?: MaybeElementRef, { window, initialValue }?: UseCssVarOptions): vue_demi.Ref<string>;
907
-
908
- declare function useCurrentElement<T extends Element = Element>(): _vueuse_shared.ComputedRefWithControl<T>;
909
-
910
- interface UseCycleListOptions<T> {
911
- /**
912
- * The initial value of the state.
913
- * A ref can be provided to reuse.
914
- */
915
- initialValue?: MaybeRef<T>;
916
- /**
917
- * The default index when
918
- */
919
- fallbackIndex?: number;
920
- /**
921
- * Custom function to get the index of the current value.
922
- */
923
- getIndexOf?: (value: T, list: T[]) => number;
924
- }
925
- /**
926
- * Cycle through a list of items
927
- *
928
- * @see https://vueuse.org/useCycleList
929
- */
930
- declare function useCycleList<T>(list: T[], options?: UseCycleListOptions<T>): UseCycleListReturn<T>;
931
- interface UseCycleListReturn<T> {
932
- state: Ref<T>;
933
- index: Ref<number>;
934
- next: (n?: number) => T;
935
- prev: (n?: number) => T;
936
- }
937
-
938
- interface UseDarkOptions extends Omit<UseColorModeOptions<BasicColorSchema>, 'modes' | 'onChanged'> {
939
- /**
940
- * Value applying to the target element when isDark=true
941
- *
942
- * @default 'dark'
943
- */
944
- valueDark?: string;
945
- /**
946
- * Value applying to the target element when isDark=false
947
- *
948
- * @default ''
949
- */
950
- valueLight?: string;
951
- /**
952
- * A custom handler for handle the updates.
953
- * When specified, the default behavior will be overridden.
954
- *
955
- * @default undefined
956
- */
957
- onChanged?: (isDark: boolean) => void;
958
- }
959
- /**
960
- * Reactive dark mode with auto data persistence.
961
- *
962
- * @see https://vueuse.org/useDark
963
- * @param options
964
- */
965
- declare function useDark(options?: UseDarkOptions): vue_demi.WritableComputedRef<boolean>;
966
-
967
- interface UseRefHistoryRecord<T> {
968
- snapshot: T;
969
- timestamp: number;
970
- }
971
- interface UseManualRefHistoryOptions<Raw, Serialized = Raw> {
972
- /**
973
- * Maximum number of history to be kept. Default to unlimited.
974
- */
975
- capacity?: number;
976
- /**
977
- * Clone when taking a snapshot, shortcut for dump: JSON.parse(JSON.stringify(value)).
978
- * Default to false
979
- *
980
- * @default false
981
- */
982
- clone?: boolean | CloneFn<Raw>;
983
- /**
984
- * Serialize data into the history
985
- */
986
- dump?: (v: Raw) => Serialized;
987
- /**
988
- * Deserialize data from the history
989
- */
990
- parse?: (v: Serialized) => Raw;
991
- /**
992
- * Deserialize data from the history
993
- */
994
- setSource?: (source: Ref<Raw>, v: Raw) => void;
995
- }
996
- interface UseManualRefHistoryReturn<Raw, Serialized> {
997
- /**
998
- * Bypassed tracking ref from the argument
999
- */
1000
- source: Ref<Raw>;
1001
- /**
1002
- * An array of history records for undo, newest comes to first
1003
- */
1004
- history: Ref<UseRefHistoryRecord<Serialized>[]>;
1005
- /**
1006
- * Last history point, source can be different if paused
1007
- */
1008
- last: Ref<UseRefHistoryRecord<Serialized>>;
1009
- /**
1010
- * Same as {@link UseManualRefHistoryReturn.history | history}
1011
- */
1012
- undoStack: Ref<UseRefHistoryRecord<Serialized>[]>;
1013
- /**
1014
- * Records array for redo
1015
- */
1016
- redoStack: Ref<UseRefHistoryRecord<Serialized>[]>;
1017
- /**
1018
- * A ref representing if undo is possible (non empty undoStack)
1019
- */
1020
- canUndo: Ref<boolean>;
1021
- /**
1022
- * A ref representing if redo is possible (non empty redoStack)
1023
- */
1024
- canRedo: Ref<boolean>;
1025
- /**
1026
- * Undo changes
1027
- */
1028
- undo: () => void;
1029
- /**
1030
- * Redo changes
1031
- */
1032
- redo: () => void;
1033
- /**
1034
- * Clear all the history
1035
- */
1036
- clear: () => void;
1037
- /**
1038
- * Create new a new history record
1039
- */
1040
- commit: () => void;
1041
- /**
1042
- * Reset ref's value with latest history
1043
- */
1044
- reset: () => void;
1045
- }
1046
- /**
1047
- * Track the change history of a ref, also provides undo and redo functionality.
1048
- *
1049
- * @see https://vueuse.org/useManualRefHistory
1050
- * @param source
1051
- * @param options
1052
- */
1053
- declare function useManualRefHistory<Raw, Serialized = Raw>(source: Ref<Raw>, options?: UseManualRefHistoryOptions<Raw, Serialized>): UseManualRefHistoryReturn<Raw, Serialized>;
1054
-
1055
- interface UseRefHistoryOptions<Raw, Serialized = Raw> extends ConfigurableEventFilter {
1056
- /**
1057
- * Watch for deep changes, default to false
1058
- *
1059
- * When set to true, it will also create clones for values store in the history
1060
- *
1061
- * @default false
1062
- */
1063
- deep?: boolean;
1064
- /**
1065
- * The flush option allows for greater control over the timing of a history point, default to 'pre'
1066
- *
1067
- * Possible values: 'pre', 'post', 'sync'
1068
- * It works in the same way as the flush option in watch and watch effect in vue reactivity
1069
- *
1070
- * @default 'pre'
1071
- */
1072
- flush?: 'pre' | 'post' | 'sync';
1073
- /**
1074
- * Maximum number of history to be kept. Default to unlimited.
1075
- */
1076
- capacity?: number;
1077
- /**
1078
- * Clone when taking a snapshot, shortcut for dump: JSON.parse(JSON.stringify(value)).
1079
- * Default to false
1080
- *
1081
- * @default false
1082
- */
1083
- clone?: boolean | CloneFn<Raw>;
1084
- /**
1085
- * Serialize data into the history
1086
- */
1087
- dump?: (v: Raw) => Serialized;
1088
- /**
1089
- * Deserialize data from the history
1090
- */
1091
- parse?: (v: Serialized) => Raw;
1092
- }
1093
- interface UseRefHistoryReturn<Raw, Serialized> extends UseManualRefHistoryReturn<Raw, Serialized> {
1094
- /**
1095
- * A ref representing if the tracking is enabled
1096
- */
1097
- isTracking: Ref<boolean>;
1098
- /**
1099
- * Pause change tracking
1100
- */
1101
- pause(): void;
1102
- /**
1103
- * Resume change tracking
1104
- *
1105
- * @param [commit] if true, a history record will be create after resuming
1106
- */
1107
- resume(commit?: boolean): void;
1108
- /**
1109
- * A sugar for auto pause and auto resuming within a function scope
1110
- *
1111
- * @param fn
1112
- */
1113
- batch(fn: (cancel: Fn) => void): void;
1114
- /**
1115
- * Clear the data and stop the watch
1116
- */
1117
- dispose(): void;
1118
- }
1119
- /**
1120
- * Track the change history of a ref, also provides undo and redo functionality.
1121
- *
1122
- * @see https://vueuse.org/useRefHistory
1123
- * @param source
1124
- * @param options
1125
- */
1126
- declare function useRefHistory<Raw, Serialized = Raw>(source: Ref<Raw>, options?: UseRefHistoryOptions<Raw, Serialized>): UseRefHistoryReturn<Raw, Serialized>;
1127
-
1128
- /**
1129
- * Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with debounce filter.
1130
- *
1131
- * @see https://vueuse.org/useDebouncedRefHistory
1132
- * @param source
1133
- * @param options
1134
- */
1135
- declare function useDebouncedRefHistory<Raw, Serialized = Raw>(source: Ref<Raw>, options?: Omit<UseRefHistoryOptions<Raw, Serialized>, 'eventFilter'> & {
1136
- debounce?: MaybeComputedRef<number>;
1137
- }): UseRefHistoryReturn<Raw, Serialized>;
1138
-
1139
- interface DeviceMotionOptions extends ConfigurableWindow, ConfigurableEventFilter {
1140
- }
1141
- /**
1142
- * Reactive DeviceMotionEvent.
1143
- *
1144
- * @see https://vueuse.org/useDeviceMotion
1145
- * @param options
1146
- */
1147
- declare function useDeviceMotion(options?: DeviceMotionOptions): {
1148
- acceleration: Ref<DeviceMotionEventAcceleration | null>;
1149
- accelerationIncludingGravity: Ref<DeviceMotionEventAcceleration | null>;
1150
- rotationRate: Ref<DeviceMotionEventRotationRate | null>;
1151
- interval: Ref<number>;
1152
- };
1153
- type UseDeviceMotionReturn = ReturnType<typeof useDeviceMotion>;
1154
-
1155
- /**
1156
- * Reactive DeviceOrientationEvent.
1157
- *
1158
- * @see https://vueuse.org/useDeviceOrientation
1159
- * @param options
1160
- */
1161
- declare function useDeviceOrientation(options?: ConfigurableWindow): {
1162
- isSupported: Ref<boolean>;
1163
- isAbsolute: Ref<boolean>;
1164
- alpha: Ref<number | null>;
1165
- beta: Ref<number | null>;
1166
- gamma: Ref<number | null>;
1167
- };
1168
- type UseDeviceOrientationReturn = ReturnType<typeof useDeviceOrientation>;
1169
-
1170
- /**
1171
- * Reactively track `window.devicePixelRatio`.
1172
- *
1173
- * @see https://vueuse.org/useDevicePixelRatio
1174
- * @param options
1175
- */
1176
- declare function useDevicePixelRatio({ window, }?: ConfigurableWindow): {
1177
- pixelRatio: vue_demi.Ref<number>;
1178
- };
1179
- type UseDevicePixelRatioReturn = ReturnType<typeof useDevicePixelRatio>;
1180
-
1181
- interface UseDevicesListOptions extends ConfigurableNavigator {
1182
- onUpdated?: (devices: MediaDeviceInfo[]) => void;
1183
- /**
1184
- * Request for permissions immediately if it's not granted,
1185
- * otherwise label and deviceIds could be empty
1186
- *
1187
- * @default false
1188
- */
1189
- requestPermissions?: boolean;
1190
- /**
1191
- * Request for types of media permissions
1192
- *
1193
- * @default { audio: true, video: true }
1194
- */
1195
- constraints?: MediaStreamConstraints;
1196
- }
1197
- interface UseDevicesListReturn {
1198
- /**
1199
- * All devices
1200
- */
1201
- devices: Ref<MediaDeviceInfo[]>;
1202
- videoInputs: ComputedRef<MediaDeviceInfo[]>;
1203
- audioInputs: ComputedRef<MediaDeviceInfo[]>;
1204
- audioOutputs: ComputedRef<MediaDeviceInfo[]>;
1205
- permissionGranted: Ref<boolean>;
1206
- ensurePermissions: () => Promise<boolean>;
1207
- isSupported: Ref<boolean>;
1208
- }
1209
- /**
1210
- * Reactive `enumerateDevices` listing available input/output devices
1211
- *
1212
- * @see https://vueuse.org/useDevicesList
1213
- * @param options
1214
- */
1215
- declare function useDevicesList(options?: UseDevicesListOptions): UseDevicesListReturn;
1216
-
1217
- interface UseDisplayMediaOptions extends ConfigurableNavigator {
1218
- /**
1219
- * If the stream is enabled
1220
- * @default false
1221
- */
1222
- enabled?: MaybeRef<boolean>;
1223
- /**
1224
- * If the stream video media constraints
1225
- */
1226
- video?: boolean | MediaTrackConstraints | undefined;
1227
- /**
1228
- * If the stream audio media constraints
1229
- */
1230
- audio?: boolean | MediaTrackConstraints | undefined;
1231
- }
1232
- /**
1233
- * Reactive `mediaDevices.getDisplayMedia` streaming
1234
- *
1235
- * @see https://vueuse.org/useDisplayMedia
1236
- * @param options
1237
- */
1238
- declare function useDisplayMedia(options?: UseDisplayMediaOptions): {
1239
- isSupported: Ref<boolean>;
1240
- stream: Ref<MediaStream | undefined>;
1241
- start: () => Promise<MediaStream | undefined>;
1242
- stop: () => void;
1243
- enabled: Ref<boolean>;
1244
- };
1245
- type UseDisplayMediaReturn = ReturnType<typeof useDisplayMedia>;
1246
-
1247
- /**
1248
- * Reactively track `document.visibilityState`.
1249
- *
1250
- * @see https://vueuse.org/useDocumentVisibility
1251
- * @param options
1252
- */
1253
- declare function useDocumentVisibility({ document }?: ConfigurableDocument): Ref<DocumentVisibilityState>;
1254
-
1255
- interface Position {
1256
- x: number;
1257
- y: number;
1258
- }
1259
- interface RenderableComponent {
1260
- /**
1261
- * The element that the component should be rendered as
1262
- *
1263
- * @default 'div'
1264
- */
1265
- as?: Object | string;
1266
- }
1267
- type PointerType = 'mouse' | 'touch' | 'pen';
1268
-
1269
- interface UseDraggableOptions {
1270
- /**
1271
- * Only start the dragging when click on the element directly
1272
- *
1273
- * @default false
1274
- */
1275
- exact?: MaybeComputedRef<boolean>;
1276
- /**
1277
- * Prevent events defaults
1278
- *
1279
- * @default false
1280
- */
1281
- preventDefault?: MaybeComputedRef<boolean>;
1282
- /**
1283
- * Prevent events propagation
1284
- *
1285
- * @default false
1286
- */
1287
- stopPropagation?: MaybeComputedRef<boolean>;
1288
- /**
1289
- * Element to attach `pointermove` and `pointerup` events to.
1290
- *
1291
- * @default window
1292
- */
1293
- draggingElement?: MaybeComputedRef<HTMLElement | SVGElement | Window | Document | null | undefined>;
1294
- /**
1295
- * Handle that triggers the drag event
1296
- *
1297
- * @default target
1298
- */
1299
- handle?: MaybeComputedRef<HTMLElement | SVGElement | null | undefined>;
1300
- /**
1301
- * Pointer types that listen to.
1302
- *
1303
- * @default ['mouse', 'touch', 'pen']
1304
- */
1305
- pointerTypes?: PointerType[];
1306
- /**
1307
- * Initial position of the element.
1308
- *
1309
- * @default { x: 0, y: 0 }
1310
- */
1311
- initialValue?: MaybeComputedRef<Position>;
1312
- /**
1313
- * Callback when the dragging starts. Return `false` to prevent dragging.
1314
- */
1315
- onStart?: (position: Position, event: PointerEvent) => void | false;
1316
- /**
1317
- * Callback during dragging.
1318
- */
1319
- onMove?: (position: Position, event: PointerEvent) => void;
1320
- /**
1321
- * Callback when dragging end.
1322
- */
1323
- onEnd?: (position: Position, event: PointerEvent) => void;
1324
- }
1325
- /**
1326
- * Make elements draggable.
1327
- *
1328
- * @see https://vueuse.org/useDraggable
1329
- * @param target
1330
- * @param options
1331
- */
1332
- declare function useDraggable(target: MaybeComputedRef<HTMLElement | SVGElement | null | undefined>, options?: UseDraggableOptions): {
1333
- position: vue_demi.Ref<{
1334
- x: number;
1335
- y: number;
1336
- }>;
1337
- isDragging: vue_demi.ComputedRef<boolean>;
1338
- style: vue_demi.ComputedRef<string>;
1339
- x: vue_demi.Ref<number>;
1340
- y: vue_demi.Ref<number>;
1341
- };
1342
- type UseDraggableReturn = ReturnType<typeof useDraggable>;
1343
-
1344
- interface UseDropZoneReturn {
1345
- isOverDropZone: Ref<boolean>;
1346
- }
1347
- declare function useDropZone(target: MaybeComputedRef<HTMLElement | null | undefined>, onDrop?: (files: File[] | null) => void): UseDropZoneReturn;
1348
-
1349
- interface UseElementBoundingOptions {
1350
- /**
1351
- * Reset values to 0 on component unmounted
1352
- *
1353
- * @default true
1354
- */
1355
- reset?: boolean;
1356
- /**
1357
- * Listen to window resize event
1358
- *
1359
- * @default true
1360
- */
1361
- windowResize?: boolean;
1362
- /**
1363
- * Listen to window scroll event
1364
- *
1365
- * @default true
1366
- */
1367
- windowScroll?: boolean;
1368
- /**
1369
- * Immediately call update on component mounted
1370
- *
1371
- * @default true
1372
- */
1373
- immediate?: boolean;
1374
- }
1375
- /**
1376
- * Reactive bounding box of an HTML element.
1377
- *
1378
- * @see https://vueuse.org/useElementBounding
1379
- * @param target
1380
- */
1381
- declare function useElementBounding(target: MaybeComputedElementRef, options?: UseElementBoundingOptions): {
1382
- height: vue_demi.Ref<number>;
1383
- bottom: vue_demi.Ref<number>;
1384
- left: vue_demi.Ref<number>;
1385
- right: vue_demi.Ref<number>;
1386
- top: vue_demi.Ref<number>;
1387
- width: vue_demi.Ref<number>;
1388
- x: vue_demi.Ref<number>;
1389
- y: vue_demi.Ref<number>;
1390
- update: () => void;
1391
- };
1392
- type UseElementBoundingReturn = ReturnType<typeof useElementBounding>;
1393
-
1394
- interface UseElementByPointOptions extends ConfigurableDocument {
1395
- x: MaybeComputedRef<number>;
1396
- y: MaybeComputedRef<number>;
1397
- }
1398
- /**
1399
- * Reactive element by point.
1400
- *
1401
- * @see https://vueuse.org/useElementByPoint
1402
- * @param options - UseElementByPointOptions
1403
- */
1404
- declare function useElementByPoint(options: UseElementByPointOptions): {
1405
- isActive: Readonly<vue_demi.Ref<boolean>>;
1406
- pause: _vueuse_shared.Fn;
1407
- resume: _vueuse_shared.Fn;
1408
- element: vue_demi.Ref<HTMLElement | null>;
1409
- };
1410
- type UseElementByPointReturn = ReturnType<typeof useElementByPoint>;
1411
-
1412
- interface UseElementHoverOptions extends ConfigurableWindow {
1413
- delayEnter?: number;
1414
- delayLeave?: number;
1415
- }
1416
- declare function useElementHover(el: MaybeComputedRef<EventTarget | null | undefined>, options?: UseElementHoverOptions): Ref<boolean>;
1417
-
1418
- interface ResizeObserverSize {
1419
- readonly inlineSize: number;
1420
- readonly blockSize: number;
1421
- }
1422
- interface ResizeObserverEntry {
1423
- readonly target: Element;
1424
- readonly contentRect: DOMRectReadOnly;
1425
- readonly borderBoxSize?: ReadonlyArray<ResizeObserverSize>;
1426
- readonly contentBoxSize?: ReadonlyArray<ResizeObserverSize>;
1427
- readonly devicePixelContentBoxSize?: ReadonlyArray<ResizeObserverSize>;
1428
- }
1429
- type ResizeObserverCallback = (entries: ReadonlyArray<ResizeObserverEntry>, observer: ResizeObserver) => void;
1430
- interface UseResizeObserverOptions extends ConfigurableWindow {
1431
- /**
1432
- * Sets which box model the observer will observe changes to. Possible values
1433
- * are `content-box` (the default), `border-box` and `device-pixel-content-box`.
1434
- *
1435
- * @default 'content-box'
1436
- */
1437
- box?: ResizeObserverBoxOptions;
1438
- }
1439
- declare class ResizeObserver {
1440
- constructor(callback: ResizeObserverCallback);
1441
- disconnect(): void;
1442
- observe(target: Element, options?: UseResizeObserverOptions): void;
1443
- unobserve(target: Element): void;
1444
- }
1445
- /**
1446
- * Reports changes to the dimensions of an Element's content or the border-box
1447
- *
1448
- * @see https://vueuse.org/useResizeObserver
1449
- * @param target
1450
- * @param callback
1451
- * @param options
1452
- */
1453
- declare function useResizeObserver(target: MaybeComputedElementRef, callback: ResizeObserverCallback, options?: UseResizeObserverOptions): {
1454
- isSupported: vue_demi.Ref<boolean>;
1455
- stop: () => void;
1456
- };
1457
- type UseResizeObserverReturn = ReturnType<typeof useResizeObserver>;
1458
-
1459
- interface ElementSize {
1460
- width: number;
1461
- height: number;
1462
- }
1463
- /**
1464
- * Reactive size of an HTML element.
1465
- *
1466
- * @see https://vueuse.org/useElementSize
1467
- * @param target
1468
- * @param callback
1469
- * @param options
1470
- */
1471
- declare function useElementSize(target: MaybeComputedElementRef, initialSize?: ElementSize, options?: UseResizeObserverOptions): {
1472
- width: vue_demi.Ref<number>;
1473
- height: vue_demi.Ref<number>;
1474
- };
1475
- type UseElementSizeReturn = ReturnType<typeof useElementSize>;
1476
-
1477
- interface UseElementVisibilityOptions extends ConfigurableWindow {
1478
- scrollTarget?: MaybeComputedRef<HTMLElement | undefined | null>;
1479
- }
1480
- /**
1481
- * Tracks the visibility of an element within the viewport.
1482
- *
1483
- * @see https://vueuse.org/useElementVisibility
1484
- * @param element
1485
- * @param options
1486
- */
1487
- declare function useElementVisibility(element: MaybeComputedElementRef, { window, scrollTarget }?: UseElementVisibilityOptions): vue_demi.Ref<boolean>;
1488
-
1489
- type EventBusListener<T = unknown, P = any> = (event: T, payload?: P) => void;
1490
- type EventBusEvents<T, P = any> = EventBusListener<T, P>[];
1491
- interface EventBusKey<T> extends Symbol {
1492
- }
1493
- type EventBusIdentifier<T = unknown> = EventBusKey<T> | string | number;
1494
- interface UseEventBusReturn<T, P> {
1495
- /**
1496
- * Subscribe to an event. When calling emit, the listeners will execute.
1497
- * @param listener watch listener.
1498
- * @returns a stop function to remove the current callback.
1499
- */
1500
- on: (listener: EventBusListener<T, P>) => Fn;
1501
- /**
1502
- * Similar to `on`, but only fires once
1503
- * @param listener watch listener.
1504
- * @returns a stop function to remove the current callback.
1505
- */
1506
- once: (listener: EventBusListener<T, P>) => Fn;
1507
- /**
1508
- * Emit an event, the corresponding event listeners will execute.
1509
- * @param event data sent.
1510
- */
1511
- emit: (event?: T, payload?: P) => void;
1512
- /**
1513
- * Remove the corresponding listener.
1514
- * @param listener watch listener.
1515
- */
1516
- off: (listener: EventBusListener<T>) => void;
1517
- /**
1518
- * Clear all events
1519
- */
1520
- reset: () => void;
1521
- }
1522
- declare function useEventBus<T = unknown, P = any>(key: EventBusIdentifier<T>): UseEventBusReturn<T, P>;
1523
-
1524
- interface InferEventTarget<Events> {
1525
- addEventListener(event: Events, fn?: any, options?: any): any;
1526
- removeEventListener(event: Events, fn?: any, options?: any): any;
1527
- }
1528
- type WindowEventName = keyof WindowEventMap;
1529
- type DocumentEventName = keyof DocumentEventMap;
1530
- interface GeneralEventListener<E = Event> {
1531
- (evt: E): void;
1532
- }
1533
- /**
1534
- * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.
1535
- *
1536
- * Overload 1: Omitted Window target
1537
- *
1538
- * @see https://vueuse.org/useEventListener
1539
- * @param event
1540
- * @param listener
1541
- * @param options
1542
- */
1543
- declare function useEventListener<E extends keyof WindowEventMap>(event: Arrayable<E>, listener: Arrayable<(this: Window, ev: WindowEventMap[E]) => any>, options?: MaybeComputedRef<boolean | AddEventListenerOptions>): Fn;
1544
- /**
1545
- * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.
1546
- *
1547
- * Overload 2: Explicitly Window target
1548
- *
1549
- * @see https://vueuse.org/useEventListener
1550
- * @param target
1551
- * @param event
1552
- * @param listener
1553
- * @param options
1554
- */
1555
- declare function useEventListener<E extends keyof WindowEventMap>(target: Window, event: Arrayable<E>, listener: Arrayable<(this: Window, ev: WindowEventMap[E]) => any>, options?: MaybeComputedRef<boolean | AddEventListenerOptions>): Fn;
1556
- /**
1557
- * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.
1558
- *
1559
- * Overload 3: Explicitly Document target
1560
- *
1561
- * @see https://vueuse.org/useEventListener
1562
- * @param target
1563
- * @param event
1564
- * @param listener
1565
- * @param options
1566
- */
1567
- declare function useEventListener<E extends keyof DocumentEventMap>(target: DocumentOrShadowRoot, event: Arrayable<E>, listener: Arrayable<(this: Document, ev: DocumentEventMap[E]) => any>, options?: MaybeComputedRef<boolean | AddEventListenerOptions>): Fn;
1568
- /**
1569
- * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.
1570
- *
1571
- * Overload 4: Custom event target with event type infer
1572
- *
1573
- * @see https://vueuse.org/useEventListener
1574
- * @param target
1575
- * @param event
1576
- * @param listener
1577
- * @param options
1578
- */
1579
- declare function useEventListener<Names extends string, EventType = Event>(target: InferEventTarget<Names>, event: Arrayable<Names>, listener: Arrayable<GeneralEventListener<EventType>>, options?: MaybeComputedRef<boolean | AddEventListenerOptions>): Fn;
1580
- /**
1581
- * Register using addEventListener on mounted, and removeEventListener automatically on unmounted.
1582
- *
1583
- * Overload 5: Custom event target fallback
1584
- *
1585
- * @see https://vueuse.org/useEventListener
1586
- * @param target
1587
- * @param event
1588
- * @param listener
1589
- * @param options
1590
- */
1591
- declare function useEventListener<EventType = Event>(target: MaybeComputedRef<EventTarget | null | undefined>, event: Arrayable<string>, listener: Arrayable<GeneralEventListener<EventType>>, options?: MaybeComputedRef<boolean | AddEventListenerOptions>): Fn;
1592
-
1593
- type UseEventSourceOptions = EventSourceInit;
1594
- /**
1595
- * Reactive wrapper for EventSource.
1596
- *
1597
- * @see https://vueuse.org/useEventSource
1598
- * @see https://developer.mozilla.org/en-US/docs/Web/API/EventSource/EventSource EventSource
1599
- * @param url
1600
- * @param events
1601
- * @param options
1602
- */
1603
- declare function useEventSource(url: string, events?: Array<string>, options?: UseEventSourceOptions): {
1604
- eventSource: Ref<EventSource | null>;
1605
- event: Ref<string | null>;
1606
- data: Ref<string | null>;
1607
- status: Ref<"OPEN" | "CONNECTING" | "CLOSED">;
1608
- error: Ref<Event | null>;
1609
- close: () => void;
1610
- };
1611
- type UseEventSourceReturn = ReturnType<typeof useEventSource>;
1612
-
1613
- interface EyeDropperOpenOptions {
1614
- /**
1615
- * @see https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal
1616
- */
1617
- signal?: AbortSignal;
1618
- }
1619
- interface EyeDropper {
1620
- new (): EyeDropper;
1621
- open: (options?: EyeDropperOpenOptions) => Promise<{
1622
- sRGBHex: string;
1623
- }>;
1624
- [Symbol.toStringTag]: 'EyeDropper';
1625
- }
1626
- interface UseEyeDropperOptions {
1627
- /**
1628
- * Initial sRGBHex.
1629
- *
1630
- * @default ''
1631
- */
1632
- initialValue?: string;
1633
- }
1634
- /**
1635
- * Reactive [EyeDropper API](https://developer.mozilla.org/en-US/docs/Web/API/EyeDropper_API)
1636
- *
1637
- * @see https://vueuse.org/useEyeDropper
1638
- * @param initialValue string
1639
- */
1640
- declare function useEyeDropper(options?: UseEyeDropperOptions): {
1641
- isSupported: vue_demi.Ref<boolean>;
1642
- sRGBHex: vue_demi.Ref<string>;
1643
- open: (openOptions?: EyeDropperOpenOptions) => Promise<{
1644
- sRGBHex: string;
1645
- } | undefined>;
1646
- };
1647
- type UseEyeDropperReturn = ReturnType<typeof useEyeDropper>;
1648
-
1649
- interface UseFaviconOptions extends ConfigurableDocument {
1650
- baseUrl?: string;
1651
- rel?: string;
1652
- }
1653
- /**
1654
- * Reactive favicon.
1655
- *
1656
- * @see https://vueuse.org/useFavicon
1657
- * @param newIcon
1658
- * @param options
1659
- */
1660
- declare function useFavicon(newIcon: MaybeReadonlyRef<string | null | undefined>, options?: UseFaviconOptions): ComputedRef<string | null | undefined>;
1661
- declare function useFavicon(newIcon?: MaybeRef<string | null | undefined>, options?: UseFaviconOptions): Ref<string | null | undefined>;
1662
- type UseFaviconReturn = ReturnType<typeof useFavicon>;
1663
-
1664
- interface UseFetchReturn<T> {
1665
- /**
1666
- * Indicates if the fetch request has finished
1667
- */
1668
- isFinished: Ref<boolean>;
1669
- /**
1670
- * The statusCode of the HTTP fetch response
1671
- */
1672
- statusCode: Ref<number | null>;
1673
- /**
1674
- * The raw response of the fetch response
1675
- */
1676
- response: Ref<Response | null>;
1677
- /**
1678
- * Any fetch errors that may have occurred
1679
- */
1680
- error: Ref<any>;
1681
- /**
1682
- * The fetch response body, may either be JSON or text
1683
- */
1684
- data: Ref<T | null>;
1685
- /**
1686
- * Indicates if the request is currently being fetched.
1687
- */
1688
- isFetching: Ref<boolean>;
1689
- /**
1690
- * Indicates if the fetch request is able to be aborted
1691
- */
1692
- canAbort: ComputedRef<boolean>;
1693
- /**
1694
- * Indicates if the fetch request was aborted
1695
- */
1696
- aborted: Ref<boolean>;
1697
- /**
1698
- * Abort the fetch request
1699
- */
1700
- abort: Fn;
1701
- /**
1702
- * Manually call the fetch
1703
- * (default not throwing error)
1704
- */
1705
- execute: (throwOnFailed?: boolean) => Promise<any>;
1706
- /**
1707
- * Fires after the fetch request has finished
1708
- */
1709
- onFetchResponse: EventHookOn<Response>;
1710
- /**
1711
- * Fires after a fetch request error
1712
- */
1713
- onFetchError: EventHookOn;
1714
- /**
1715
- * Fires after a fetch has completed
1716
- */
1717
- onFetchFinally: EventHookOn;
1718
- get(): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1719
- post(payload?: MaybeComputedRef<unknown>, type?: string): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1720
- put(payload?: MaybeComputedRef<unknown>, type?: string): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1721
- delete(payload?: MaybeComputedRef<unknown>, type?: string): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1722
- patch(payload?: MaybeComputedRef<unknown>, type?: string): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1723
- head(payload?: MaybeComputedRef<unknown>, type?: string): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1724
- options(payload?: MaybeComputedRef<unknown>, type?: string): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1725
- json<JSON = any>(): UseFetchReturn<JSON> & PromiseLike<UseFetchReturn<JSON>>;
1726
- text(): UseFetchReturn<string> & PromiseLike<UseFetchReturn<string>>;
1727
- blob(): UseFetchReturn<Blob> & PromiseLike<UseFetchReturn<Blob>>;
1728
- arrayBuffer(): UseFetchReturn<ArrayBuffer> & PromiseLike<UseFetchReturn<ArrayBuffer>>;
1729
- formData(): UseFetchReturn<FormData> & PromiseLike<UseFetchReturn<FormData>>;
1730
- }
1731
- type Combination = 'overwrite' | 'chain';
1732
- interface BeforeFetchContext {
1733
- /**
1734
- * The computed url of the current request
1735
- */
1736
- url: string;
1737
- /**
1738
- * The request options of the current request
1739
- */
1740
- options: RequestInit;
1741
- /**
1742
- * Cancels the current request
1743
- */
1744
- cancel: Fn;
1745
- }
1746
- interface AfterFetchContext<T = any> {
1747
- response: Response;
1748
- data: T | null;
1749
- }
1750
- interface OnFetchErrorContext<T = any, E = any> {
1751
- error: E;
1752
- data: T | null;
1753
- }
1754
- interface UseFetchOptions {
1755
- /**
1756
- * Fetch function
1757
- */
1758
- fetch?: typeof window.fetch;
1759
- /**
1760
- * Will automatically run fetch when `useFetch` is used
1761
- *
1762
- * @default true
1763
- */
1764
- immediate?: boolean;
1765
- /**
1766
- * Will automatically refetch when:
1767
- * - the URL is changed if the URL is a ref
1768
- * - the payload is changed if the payload is a ref
1769
- *
1770
- * @default false
1771
- */
1772
- refetch?: MaybeComputedRef<boolean>;
1773
- /**
1774
- * Initial data before the request finished
1775
- *
1776
- * @default null
1777
- */
1778
- initialData?: any;
1779
- /**
1780
- * Timeout for abort request after number of millisecond
1781
- * `0` means use browser default
1782
- *
1783
- * @default 0
1784
- */
1785
- timeout?: number;
1786
- /**
1787
- * Will run immediately before the fetch request is dispatched
1788
- */
1789
- beforeFetch?: (ctx: BeforeFetchContext) => Promise<Partial<BeforeFetchContext> | void> | Partial<BeforeFetchContext> | void;
1790
- /**
1791
- * Will run immediately after the fetch request is returned.
1792
- * Runs after any 2xx response
1793
- */
1794
- afterFetch?: (ctx: AfterFetchContext) => Promise<Partial<AfterFetchContext>> | Partial<AfterFetchContext>;
1795
- /**
1796
- * Will run immediately after the fetch request is returned.
1797
- * Runs after any 4xx and 5xx response
1798
- */
1799
- onFetchError?: (ctx: {
1800
- data: any;
1801
- response: Response | null;
1802
- error: any;
1803
- }) => Promise<Partial<OnFetchErrorContext>> | Partial<OnFetchErrorContext>;
1804
- }
1805
- interface CreateFetchOptions {
1806
- /**
1807
- * The base URL that will be prefixed to all urls unless urls are absolute
1808
- */
1809
- baseUrl?: MaybeComputedRef<string>;
1810
- /**
1811
- * Determine the inherit behavior for beforeFetch, afterFetch, onFetchError
1812
- * @default 'chain'
1813
- */
1814
- combination?: Combination;
1815
- /**
1816
- * Default Options for the useFetch function
1817
- */
1818
- options?: UseFetchOptions;
1819
- /**
1820
- * Options for the fetch request
1821
- */
1822
- fetchOptions?: RequestInit;
1823
- }
1824
- declare function createFetch(config?: CreateFetchOptions): typeof useFetch;
1825
- declare function useFetch<T>(url: MaybeComputedRef<string>): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1826
- declare function useFetch<T>(url: MaybeComputedRef<string>, useFetchOptions: UseFetchOptions): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1827
- declare function useFetch<T>(url: MaybeComputedRef<string>, options: RequestInit, useFetchOptions?: UseFetchOptions): UseFetchReturn<T> & PromiseLike<UseFetchReturn<T>>;
1828
-
1829
- interface UseFileDialogOptions extends ConfigurableDocument {
1830
- /**
1831
- * @default true
1832
- */
1833
- multiple?: boolean;
1834
- /**
1835
- * @default '*'
1836
- */
1837
- accept?: string;
1838
- /**
1839
- * Select the input source for the capture file.
1840
- * @see [HTMLInputElement Capture](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/capture)
1841
- */
1842
- capture?: string;
1843
- }
1844
- interface UseFileDialogReturn {
1845
- files: Ref<FileList | null>;
1846
- open: (localOptions?: Partial<UseFileDialogOptions>) => void;
1847
- reset: () => void;
1848
- }
1849
- /**
1850
- * Open file dialog with ease.
1851
- *
1852
- * @see https://vueuse.org/useFileDialog
1853
- * @param options
1854
- */
1855
- declare function useFileDialog(options?: UseFileDialogOptions): UseFileDialogReturn;
1856
-
1857
- /**
1858
- * window.showOpenFilePicker parameters
1859
- * @see https://developer.mozilla.org/en-US/docs/Web/API/window/showOpenFilePicker#parameters
1860
- */
1861
- interface FileSystemAccessShowOpenFileOptions {
1862
- multiple?: boolean;
1863
- types?: Array<{
1864
- description?: string;
1865
- accept: Record<string, string[]>;
1866
- }>;
1867
- excludeAcceptAllOption?: boolean;
1868
- }
1869
- /**
1870
- * window.showSaveFilePicker parameters
1871
- * @see https://developer.mozilla.org/en-US/docs/Web/API/window/showSaveFilePicker#parameters
1872
- */
1873
- interface FileSystemAccessShowSaveFileOptions {
1874
- suggestedName?: string;
1875
- types?: Array<{
1876
- description?: string;
1877
- accept: Record<string, string[]>;
1878
- }>;
1879
- excludeAcceptAllOption?: boolean;
1880
- }
1881
- /**
1882
- * FileHandle
1883
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle
1884
- */
1885
- interface FileSystemFileHandle {
1886
- getFile: () => Promise<File>;
1887
- createWritable: () => FileSystemWritableFileStream;
1888
- }
1889
- /**
1890
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream
1891
- */
1892
- interface FileSystemWritableFileStream extends WritableStream {
1893
- /**
1894
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write
1895
- */
1896
- write: FileSystemWritableFileStreamWrite;
1897
- /**
1898
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/seek
1899
- */
1900
- seek: (position: number) => Promise<void>;
1901
- /**
1902
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/truncate
1903
- */
1904
- truncate: (size: number) => Promise<void>;
1905
- }
1906
- /**
1907
- * FileStream.write
1908
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write
1909
- */
1910
- interface FileSystemWritableFileStreamWrite {
1911
- (data: string | BufferSource | Blob): Promise<void>;
1912
- (options: {
1913
- type: 'write';
1914
- position: number;
1915
- data: string | BufferSource | Blob;
1916
- }): Promise<void>;
1917
- (options: {
1918
- type: 'seek';
1919
- position: number;
1920
- }): Promise<void>;
1921
- (options: {
1922
- type: 'truncate';
1923
- size: number;
1924
- }): Promise<void>;
1925
- }
1926
- /**
1927
- * FileStream.write
1928
- * @see https://developer.mozilla.org/en-US/docs/Web/API/FileSystemWritableFileStream/write
1929
- */
1930
- type FileSystemAccessWindow = Window & {
1931
- showSaveFilePicker: (options: FileSystemAccessShowSaveFileOptions) => Promise<FileSystemFileHandle>;
1932
- showOpenFilePicker: (options: FileSystemAccessShowOpenFileOptions) => Promise<FileSystemFileHandle[]>;
1933
- };
1934
- type UseFileSystemAccessCommonOptions = Pick<FileSystemAccessShowOpenFileOptions, 'types' | 'excludeAcceptAllOption'>;
1935
- type UseFileSystemAccessShowSaveFileOptions = Pick<FileSystemAccessShowSaveFileOptions, 'suggestedName'>;
1936
- type UseFileSystemAccessOptions = ConfigurableWindow & UseFileSystemAccessCommonOptions & {
1937
- /**
1938
- * file data type
1939
- */
1940
- dataType?: MaybeComputedRef<'Text' | 'ArrayBuffer' | 'Blob'>;
1941
- };
1942
- /**
1943
- * Create and read and write local files.
1944
- * @see https://vueuse.org/useFileSystemAccess
1945
- * @param options
1946
- */
1947
- declare function useFileSystemAccess(options: UseFileSystemAccessOptions & {
1948
- dataType: 'Text';
1949
- }): UseFileSystemAccessReturn<string>;
1950
- declare function useFileSystemAccess(options: UseFileSystemAccessOptions & {
1951
- dataType: 'ArrayBuffer';
1952
- }): UseFileSystemAccessReturn<ArrayBuffer>;
1953
- declare function useFileSystemAccess(options: UseFileSystemAccessOptions & {
1954
- dataType: 'Blob';
1955
- }): UseFileSystemAccessReturn<Blob>;
1956
- declare function useFileSystemAccess(options: UseFileSystemAccessOptions): UseFileSystemAccessReturn<string | ArrayBuffer | Blob>;
1957
- interface UseFileSystemAccessReturn<T = string> {
1958
- isSupported: Ref<boolean>;
1959
- data: Ref<T | undefined>;
1960
- file: Ref<File | undefined>;
1961
- fileName: Ref<string>;
1962
- fileMIME: Ref<string>;
1963
- fileSize: Ref<number>;
1964
- fileLastModified: Ref<number>;
1965
- open: (_options?: UseFileSystemAccessCommonOptions) => Awaitable<void>;
1966
- create: (_options?: UseFileSystemAccessShowSaveFileOptions) => Awaitable<void>;
1967
- save: (_options?: UseFileSystemAccessShowSaveFileOptions) => Awaitable<void>;
1968
- saveAs: (_options?: UseFileSystemAccessShowSaveFileOptions) => Awaitable<void>;
1969
- updateData: () => Awaitable<void>;
1970
- }
1971
-
1972
- interface UseFocusOptions extends ConfigurableWindow {
1973
- /**
1974
- * Initial value. If set true, then focus will be set on the target
1975
- *
1976
- * @default false
1977
- */
1978
- initialValue?: boolean;
1979
- }
1980
- interface UseFocusReturn {
1981
- /**
1982
- * If read as true, then the element has focus. If read as false, then the element does not have focus
1983
- * If set to true, then the element will be focused. If set to false, the element will be blurred.
1984
- */
1985
- focused: Ref<boolean>;
1986
- }
1987
- /**
1988
- * Track or set the focus state of a DOM element.
1989
- *
1990
- * @see https://vueuse.org/useFocus
1991
- * @param target The target element for the focus and blur events.
1992
- * @param options
1993
- */
1994
- declare function useFocus(target: MaybeElementRef, options?: UseFocusOptions): UseFocusReturn;
1995
-
1996
- interface UseFocusWithinReturn {
1997
- /**
1998
- * True if the element or any of its descendants are focused
1999
- */
2000
- focused: ComputedRef<boolean>;
2001
- }
2002
- /**
2003
- * Track if focus is contained within the target element
2004
- *
2005
- * @see https://vueuse.org/useFocusWithin
2006
- * @param target The target element to track
2007
- * @param options Focus within options
2008
- */
2009
- declare function useFocusWithin(target: MaybeElementRef, options?: ConfigurableWindow): UseFocusWithinReturn;
2010
-
2011
- interface UseFpsOptions {
2012
- /**
2013
- * Calculate the FPS on every x frames.
2014
- * @default 10
2015
- */
2016
- every?: number;
2017
- }
2018
- declare function useFps(options?: UseFpsOptions): Ref<number>;
2019
-
2020
- interface UseFullscreenOptions extends ConfigurableDocument {
2021
- /**
2022
- * Automatically exit fullscreen when component is unmounted
2023
- *
2024
- * @default false
2025
- */
2026
- autoExit?: boolean;
2027
- }
2028
- /**
2029
- * Reactive Fullscreen API.
2030
- *
2031
- * @see https://vueuse.org/useFullscreen
2032
- * @param target
2033
- * @param options
2034
- */
2035
- declare function useFullscreen(target?: MaybeElementRef, options?: UseFullscreenOptions): {
2036
- isSupported: vue_demi.Ref<boolean>;
2037
- isFullscreen: vue_demi.Ref<boolean>;
2038
- enter: () => Promise<void>;
2039
- exit: () => Promise<void>;
2040
- toggle: () => Promise<void>;
2041
- };
2042
- type UseFullscreenReturn = ReturnType<typeof useFullscreen>;
2043
-
2044
- interface UseGamepadOptions extends ConfigurableWindow, ConfigurableNavigator {
2045
- }
2046
- /**
2047
- * Maps a standard standard gamepad to an Xbox 360 Controller.
2048
- */
2049
- declare function mapGamepadToXbox360Controller(gamepad: Ref<Gamepad | undefined>): vue_demi.ComputedRef<{
2050
- buttons: {
2051
- a: GamepadButton;
2052
- b: GamepadButton;
2053
- x: GamepadButton;
2054
- y: GamepadButton;
2055
- };
2056
- bumper: {
2057
- left: GamepadButton;
2058
- right: GamepadButton;
2059
- };
2060
- triggers: {
2061
- left: GamepadButton;
2062
- right: GamepadButton;
2063
- };
2064
- stick: {
2065
- left: {
2066
- horizontal: number;
2067
- vertical: number;
2068
- button: GamepadButton;
2069
- };
2070
- right: {
2071
- horizontal: number;
2072
- vertical: number;
2073
- button: GamepadButton;
2074
- };
2075
- };
2076
- dpad: {
2077
- up: GamepadButton;
2078
- down: GamepadButton;
2079
- left: GamepadButton;
2080
- right: GamepadButton;
2081
- };
2082
- back: GamepadButton;
2083
- start: GamepadButton;
2084
- } | null>;
2085
- declare function useGamepad(options?: UseGamepadOptions): {
2086
- isSupported: Ref<boolean>;
2087
- onConnected: _vueuse_shared.EventHookOn<number>;
2088
- onDisconnected: _vueuse_shared.EventHookOn<number>;
2089
- gamepads: Ref<{
2090
- readonly axes: readonly number[];
2091
- readonly buttons: readonly {
2092
- readonly pressed: boolean;
2093
- readonly touched: boolean;
2094
- readonly value: number;
2095
- }[];
2096
- readonly connected: boolean;
2097
- readonly hapticActuators: readonly {
2098
- readonly type: "vibration";
2099
- }[];
2100
- readonly id: string;
2101
- readonly index: number;
2102
- readonly mapping: GamepadMappingType;
2103
- readonly timestamp: number;
2104
- }[]>;
2105
- pause: _vueuse_shared.Fn;
2106
- resume: _vueuse_shared.Fn;
2107
- isActive: Readonly<Ref<boolean>>;
2108
- };
2109
- type UseGamepadReturn = ReturnType<typeof useGamepad>;
2110
-
2111
- interface UseGeolocationOptions extends Partial<PositionOptions>, ConfigurableNavigator {
2112
- immediate?: boolean;
2113
- }
2114
- /**
2115
- * Reactive Geolocation API.
2116
- *
2117
- * @see https://vueuse.org/useGeolocation
2118
- * @param options
2119
- */
2120
- declare function useGeolocation(options?: UseGeolocationOptions): {
2121
- isSupported: Ref<boolean>;
2122
- coords: Ref<GeolocationCoordinates>;
2123
- locatedAt: Ref<number | null>;
2124
- error: Ref<{
2125
- readonly code: number;
2126
- readonly message: string;
2127
- readonly PERMISSION_DENIED: number;
2128
- readonly POSITION_UNAVAILABLE: number;
2129
- readonly TIMEOUT: number;
2130
- } | null>;
2131
- resume: () => void;
2132
- pause: () => void;
2133
- };
2134
- type UseGeolocationReturn = ReturnType<typeof useGeolocation>;
2135
-
2136
- interface UseIdleOptions extends ConfigurableWindow, ConfigurableEventFilter {
2137
- /**
2138
- * Event names that listen to for detected user activity
2139
- *
2140
- * @default ['mousemove', 'mousedown', 'resize', 'keydown', 'touchstart', 'wheel']
2141
- */
2142
- events?: WindowEventName[];
2143
- /**
2144
- * Listen for document visibility change
2145
- *
2146
- * @default true
2147
- */
2148
- listenForVisibilityChange?: boolean;
2149
- /**
2150
- * Initial state of the ref idle
2151
- *
2152
- * @default false
2153
- */
2154
- initialState?: boolean;
2155
- }
2156
- interface UseIdleReturn {
2157
- idle: Ref<boolean>;
2158
- lastActive: Ref<number>;
2159
- }
2160
- /**
2161
- * Tracks whether the user is being inactive.
2162
- *
2163
- * @see https://vueuse.org/useIdle
2164
- * @param timeout default to 1 minute
2165
- * @param options IdleOptions
2166
- */
2167
- declare function useIdle(timeout?: number, options?: UseIdleOptions): UseIdleReturn;
2168
-
2169
- interface UseImageOptions {
2170
- /** Address of the resource */
2171
- src: string;
2172
- /** Images to use in different situations, e.g., high-resolution displays, small monitors, etc. */
2173
- srcset?: string;
2174
- /** Image sizes for different page layouts */
2175
- sizes?: string;
2176
- }
2177
- /**
2178
- * Reactive load an image in the browser, you can wait the result to display it or show a fallback.
2179
- *
2180
- * @see https://vueuse.org/useImage
2181
- * @param options Image attributes, as used in the <img> tag
2182
- * @param asyncStateOptions
2183
- */
2184
- declare const useImage: <Shallow extends true>(options: MaybeComputedRef<UseImageOptions>, asyncStateOptions?: UseAsyncStateOptions<Shallow, any>) => UseAsyncStateReturn<HTMLImageElement | undefined, [], true>;
2185
- type UseImageReturn = ReturnType<typeof useImage>;
2186
-
2187
- interface UseScrollOptions {
2188
- /**
2189
- * Throttle time for scroll event, it’s disabled by default.
2190
- *
2191
- * @default 0
2192
- */
2193
- throttle?: number;
2194
- /**
2195
- * The check time when scrolling ends.
2196
- * This configuration will be setting to (throttle + idle) when the `throttle` is configured.
2197
- *
2198
- * @default 200
2199
- */
2200
- idle?: number;
2201
- /**
2202
- * Offset arrived states by x pixels
2203
- *
2204
- */
2205
- offset?: {
2206
- left?: number;
2207
- right?: number;
2208
- top?: number;
2209
- bottom?: number;
2210
- };
2211
- /**
2212
- * Trigger it when scrolling.
2213
- *
2214
- */
2215
- onScroll?: (e: Event) => void;
2216
- /**
2217
- * Trigger it when scrolling ends.
2218
- *
2219
- */
2220
- onStop?: (e: Event) => void;
2221
- /**
2222
- * Listener options for scroll event.
2223
- *
2224
- * @default {capture: false, passive: true}
2225
- */
2226
- eventListenerOptions?: boolean | AddEventListenerOptions;
2227
- /**
2228
- * Optionally specify a scroll behavior of `auto` (default, not smooth scrolling) or
2229
- * `smooth` (for smooth scrolling) which takes effect when changing the `x` or `y` refs.
2230
- *
2231
- * @default 'auto'
2232
- */
2233
- behavior?: MaybeComputedRef<ScrollBehavior>;
2234
- }
2235
- /**
2236
- * Reactive scroll.
2237
- *
2238
- * @see https://vueuse.org/useScroll
2239
- * @param element
2240
- * @param options
2241
- */
2242
- declare function useScroll(element: MaybeComputedRef<HTMLElement | SVGElement | Window | Document | null | undefined>, options?: UseScrollOptions): {
2243
- x: vue_demi.WritableComputedRef<number>;
2244
- y: vue_demi.WritableComputedRef<number>;
2245
- isScrolling: vue_demi.Ref<boolean>;
2246
- arrivedState: {
2247
- left: boolean;
2248
- right: boolean;
2249
- top: boolean;
2250
- bottom: boolean;
2251
- };
2252
- directions: {
2253
- left: boolean;
2254
- right: boolean;
2255
- top: boolean;
2256
- bottom: boolean;
2257
- };
2258
- };
2259
- type UseScrollReturn = ReturnType<typeof useScroll>;
2260
-
2261
- interface UseInfiniteScrollOptions extends UseScrollOptions {
2262
- /**
2263
- * The minimum distance between the bottom of the element and the bottom of the viewport
2264
- *
2265
- * @default 0
2266
- */
2267
- distance?: number;
2268
- /**
2269
- * The direction in which to listen the scroll.
2270
- *
2271
- * @default 'bottom'
2272
- */
2273
- direction?: 'top' | 'bottom' | 'left' | 'right';
2274
- /**
2275
- * Whether to preserve the current scroll position when loading more items.
2276
- *
2277
- * @default false
2278
- */
2279
- preserveScrollPosition?: boolean;
2280
- }
2281
- /**
2282
- * Reactive infinite scroll.
2283
- *
2284
- * @see https://vueuse.org/useInfiniteScroll
2285
- */
2286
- declare function useInfiniteScroll(element: MaybeComputedRef<HTMLElement | SVGElement | Window | Document | null | undefined>, onLoadMore: (state: UnwrapNestedRefs<ReturnType<typeof useScroll>>) => void | Promise<void>, options?: UseInfiniteScrollOptions): void;
2287
-
2288
- interface UseIntersectionObserverOptions extends ConfigurableWindow {
2289
- /**
2290
- * The Element or Document whose bounds are used as the bounding box when testing for intersection.
2291
- */
2292
- root?: MaybeElementRef;
2293
- /**
2294
- * A string which specifies a set of offsets to add to the root's bounding_box when calculating intersections.
2295
- */
2296
- rootMargin?: string;
2297
- /**
2298
- * Either a single number or an array of numbers between 0.0 and 1.
2299
- */
2300
- threshold?: number | number[];
2301
- }
2302
- /**
2303
- * Detects that a target element's visibility.
2304
- *
2305
- * @see https://vueuse.org/useIntersectionObserver
2306
- * @param target
2307
- * @param callback
2308
- * @param options
2309
- */
2310
- declare function useIntersectionObserver(target: MaybeElementRef, callback: IntersectionObserverCallback, options?: UseIntersectionObserverOptions): {
2311
- isSupported: vue_demi.Ref<boolean>;
2312
- stop: () => void;
2313
- };
2314
- type UseIntersectionObserverReturn = ReturnType<typeof useIntersectionObserver>;
2315
-
2316
- type KeyModifier = 'Alt' | 'AltGraph' | 'CapsLock' | 'Control' | 'Fn' | 'FnLock' | 'Meta' | 'NumLock' | 'ScrollLock' | 'Shift' | 'Symbol' | 'SymbolLock';
2317
- interface UseModifierOptions<Initial> extends ConfigurableDocument {
2318
- /**
2319
- * Event names that will prompt update to modifier states
2320
- *
2321
- * @default ['mousedown', 'mouseup', 'keydown', 'keyup']
2322
- */
2323
- events?: WindowEventName[];
2324
- /**
2325
- * Initial value of the returned ref
2326
- *
2327
- * @default null
2328
- */
2329
- initial?: Initial;
2330
- }
2331
- type UseKeyModifierReturn<Initial> = Ref<Initial extends boolean ? boolean : boolean | null>;
2332
- declare function useKeyModifier<Initial extends boolean | null>(modifier: KeyModifier, options?: UseModifierOptions<Initial>): UseKeyModifierReturn<Initial>;
2333
-
2334
- declare function useLocalStorage(key: string, initialValue: MaybeComputedRef<string>, options?: UseStorageOptions<string>): RemovableRef<string>;
2335
- declare function useLocalStorage(key: string, initialValue: MaybeComputedRef<boolean>, options?: UseStorageOptions<boolean>): RemovableRef<boolean>;
2336
- declare function useLocalStorage(key: string, initialValue: MaybeComputedRef<number>, options?: UseStorageOptions<number>): RemovableRef<number>;
2337
- declare function useLocalStorage<T>(key: string, initialValue: MaybeComputedRef<T>, options?: UseStorageOptions<T>): RemovableRef<T>;
2338
- declare function useLocalStorage<T = unknown>(key: string, initialValue: MaybeComputedRef<null>, options?: UseStorageOptions<T>): RemovableRef<T>;
2339
-
2340
- declare const DefaultMagicKeysAliasMap: Readonly<Record<string, string>>;
2341
-
2342
- interface UseMagicKeysOptions<Reactive extends Boolean> {
2343
- /**
2344
- * Returns a reactive object instead of an object of refs
2345
- *
2346
- * @default false
2347
- */
2348
- reactive?: Reactive;
2349
- /**
2350
- * Target for listening events
2351
- *
2352
- * @default window
2353
- */
2354
- target?: MaybeComputedRef<EventTarget>;
2355
- /**
2356
- * Alias map for keys, all the keys should be lowercase
2357
- * { target: keycode }
2358
- *
2359
- * @example { ctrl: "control" }
2360
- * @default <predefined-map>
2361
- */
2362
- aliasMap?: Record<string, string>;
2363
- /**
2364
- * Register passive listener
2365
- *
2366
- * @default true
2367
- */
2368
- passive?: boolean;
2369
- /**
2370
- * Custom event handler for keydown/keyup event.
2371
- * Useful when you want to apply custom logic.
2372
- *
2373
- * When using `e.preventDefault()`, you will need to pass `passive: false` to useMagicKeys().
2374
- */
2375
- onEventFired?: (e: KeyboardEvent) => void | boolean;
2376
- }
2377
- interface MagicKeysInternal {
2378
- /**
2379
- * A Set of currently pressed keys,
2380
- * Stores raw keyCodes.
2381
- *
2382
- * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key
2383
- */
2384
- current: Set<string>;
2385
- }
2386
- type UseMagicKeysReturn<Reactive extends Boolean> = Readonly<Omit<Reactive extends true ? Record<string, boolean> : Record<string, ComputedRef<boolean>>, keyof MagicKeysInternal> & MagicKeysInternal>;
2387
- /**
2388
- * Reactive keys pressed state, with magical keys combination support.
2389
- *
2390
- * @see https://vueuse.org/useMagicKeys
2391
- */
2392
- declare function useMagicKeys(options?: UseMagicKeysOptions<false>): UseMagicKeysReturn<false>;
2393
- declare function useMagicKeys(options: UseMagicKeysOptions<true>): UseMagicKeysReturn<true>;
2394
-
2395
- /**
2396
- * Many of the jsdoc definitions here are modified version of the
2397
- * documentation from MDN(https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement)
2398
- */
2399
- interface UseMediaSource {
2400
- /**
2401
- * The source url for the media
2402
- */
2403
- src: string;
2404
- /**
2405
- * The media codec type
2406
- */
2407
- type?: string;
2408
- }
2409
- interface UseMediaTextTrackSource {
2410
- /**
2411
- * Indicates that the track should be enabled unless the user's preferences indicate
2412
- * that another track is more appropriate
2413
- */
2414
- default?: boolean;
2415
- /**
2416
- * How the text track is meant to be used. If omitted the default kind is subtitles.
2417
- */
2418
- kind: TextTrackKind;
2419
- /**
2420
- * A user-readable title of the text track which is used by the browser
2421
- * when listing available text tracks.
2422
- */
2423
- label: string;
2424
- /**
2425
- * Address of the track (.vtt file). Must be a valid URL. This attribute
2426
- * must be specified and its URL value must have the same origin as the document
2427
- */
2428
- src: string;
2429
- /**
2430
- * Language of the track text data. It must be a valid BCP 47 language tag.
2431
- * If the kind attribute is set to subtitles, then srclang must be defined.
2432
- */
2433
- srcLang: string;
2434
- }
2435
- interface UseMediaControlsOptions extends ConfigurableDocument {
2436
- /**
2437
- * The source for the media, may either be a string, a `UseMediaSource` object, or a list
2438
- * of `UseMediaSource` objects.
2439
- */
2440
- src?: MaybeComputedRef<string | UseMediaSource | UseMediaSource[]>;
2441
- /**
2442
- * A list of text tracks for the media
2443
- */
2444
- tracks?: MaybeComputedRef<UseMediaTextTrackSource[]>;
2445
- }
2446
- interface UseMediaTextTrack {
2447
- /**
2448
- * The index of the text track
2449
- */
2450
- id: number;
2451
- /**
2452
- * The text track label
2453
- */
2454
- label: string;
2455
- /**
2456
- * Language of the track text data. It must be a valid BCP 47 language tag.
2457
- * If the kind attribute is set to subtitles, then srclang must be defined.
2458
- */
2459
- language: string;
2460
- /**
2461
- * Specifies the display mode of the text track, either `disabled`,
2462
- * `hidden`, or `showing`
2463
- */
2464
- mode: TextTrackMode;
2465
- /**
2466
- * How the text track is meant to be used. If omitted the default kind is subtitles.
2467
- */
2468
- kind: TextTrackKind;
2469
- /**
2470
- * Indicates the track's in-band metadata track dispatch type.
2471
- */
2472
- inBandMetadataTrackDispatchType: string;
2473
- /**
2474
- * A list of text track cues
2475
- */
2476
- cues: TextTrackCueList | null;
2477
- /**
2478
- * A list of active text track cues
2479
- */
2480
- activeCues: TextTrackCueList | null;
2481
- }
2482
- declare function useMediaControls(target: MaybeRef<HTMLMediaElement | null | undefined>, options?: UseMediaControlsOptions): {
2483
- currentTime: vue_demi.Ref<number>;
2484
- duration: vue_demi.Ref<number>;
2485
- waiting: vue_demi.Ref<boolean>;
2486
- seeking: vue_demi.Ref<boolean>;
2487
- ended: vue_demi.Ref<boolean>;
2488
- stalled: vue_demi.Ref<boolean>;
2489
- buffered: vue_demi.Ref<[number, number][]>;
2490
- playing: vue_demi.Ref<boolean>;
2491
- rate: vue_demi.Ref<number>;
2492
- volume: vue_demi.Ref<number>;
2493
- muted: vue_demi.Ref<boolean>;
2494
- tracks: vue_demi.Ref<{
2495
- id: number;
2496
- label: string;
2497
- language: string;
2498
- mode: TextTrackMode;
2499
- kind: TextTrackKind;
2500
- inBandMetadataTrackDispatchType: string;
2501
- cues: {
2502
- [x: number]: {
2503
- endTime: number;
2504
- id: string;
2505
- onenter: ((this: TextTrackCue, ev: Event) => any) | null;
2506
- onexit: ((this: TextTrackCue, ev: Event) => any) | null;
2507
- pauseOnExit: boolean;
2508
- startTime: number;
2509
- readonly track: {
2510
- readonly activeCues: any | null;
2511
- readonly cues: any | null;
2512
- readonly id: string;
2513
- readonly inBandMetadataTrackDispatchType: string;
2514
- readonly kind: TextTrackKind;
2515
- readonly label: string;
2516
- readonly language: string;
2517
- mode: TextTrackMode;
2518
- oncuechange: ((this: TextTrack, ev: Event) => any) | null;
2519
- addCue: (cue: TextTrackCue) => void;
2520
- removeCue: (cue: TextTrackCue) => void;
2521
- addEventListener: {
2522
- <K extends "cuechange">(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
2523
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
2524
- };
2525
- removeEventListener: {
2526
- <K_1 extends "cuechange">(type: K_1, listener: (this: TextTrack, ev: TextTrackEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
2527
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
2528
- };
2529
- dispatchEvent: (event: Event) => boolean;
2530
- } | null;
2531
- addEventListener: {
2532
- <K_2 extends keyof TextTrackCueEventMap>(type: K_2, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K_2]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
2533
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
2534
- };
2535
- removeEventListener: {
2536
- <K_3 extends keyof TextTrackCueEventMap>(type: K_3, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K_3]) => any, options?: boolean | EventListenerOptions | undefined): void;
2537
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
2538
- };
2539
- dispatchEvent: (event: Event) => boolean;
2540
- };
2541
- readonly length: number;
2542
- getCueById: (id: string) => TextTrackCue | null;
2543
- [Symbol.iterator]: () => IterableIterator<TextTrackCue>;
2544
- } | null;
2545
- activeCues: {
2546
- [x: number]: {
2547
- endTime: number;
2548
- id: string;
2549
- onenter: ((this: TextTrackCue, ev: Event) => any) | null;
2550
- onexit: ((this: TextTrackCue, ev: Event) => any) | null;
2551
- pauseOnExit: boolean;
2552
- startTime: number;
2553
- readonly track: {
2554
- readonly activeCues: any | null;
2555
- readonly cues: any | null;
2556
- readonly id: string;
2557
- readonly inBandMetadataTrackDispatchType: string;
2558
- readonly kind: TextTrackKind;
2559
- readonly label: string;
2560
- readonly language: string;
2561
- mode: TextTrackMode;
2562
- oncuechange: ((this: TextTrack, ev: Event) => any) | null;
2563
- addCue: (cue: TextTrackCue) => void;
2564
- removeCue: (cue: TextTrackCue) => void;
2565
- addEventListener: {
2566
- <K extends "cuechange">(type: K, listener: (this: TextTrack, ev: TextTrackEventMap[K]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
2567
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
2568
- };
2569
- removeEventListener: {
2570
- <K_1 extends "cuechange">(type: K_1, listener: (this: TextTrack, ev: TextTrackEventMap[K_1]) => any, options?: boolean | EventListenerOptions | undefined): void;
2571
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
2572
- };
2573
- dispatchEvent: (event: Event) => boolean;
2574
- } | null;
2575
- addEventListener: {
2576
- <K_2 extends keyof TextTrackCueEventMap>(type: K_2, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K_2]) => any, options?: boolean | AddEventListenerOptions | undefined): void;
2577
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | undefined): void;
2578
- };
2579
- removeEventListener: {
2580
- <K_3 extends keyof TextTrackCueEventMap>(type: K_3, listener: (this: TextTrackCue, ev: TextTrackCueEventMap[K_3]) => any, options?: boolean | EventListenerOptions | undefined): void;
2581
- (type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions | undefined): void;
2582
- };
2583
- dispatchEvent: (event: Event) => boolean;
2584
- };
2585
- readonly length: number;
2586
- getCueById: (id: string) => TextTrackCue | null;
2587
- [Symbol.iterator]: () => IterableIterator<TextTrackCue>;
2588
- } | null;
2589
- }[]>;
2590
- selectedTrack: vue_demi.Ref<number>;
2591
- enableTrack: (track: number | UseMediaTextTrack, disableTracks?: boolean) => void;
2592
- disableTrack: (track?: number | UseMediaTextTrack) => void;
2593
- supportsPictureInPicture: boolean | undefined;
2594
- togglePictureInPicture: () => Promise<unknown>;
2595
- isPictureInPicture: vue_demi.Ref<boolean>;
2596
- onSourceError: _vueuse_shared.EventHookOn<Event>;
2597
- };
2598
- type UseMediaControlsReturn = ReturnType<typeof useMediaControls>;
2599
-
2600
- /**
2601
- * Reactive Media Query.
2602
- *
2603
- * @see https://vueuse.org/useMediaQuery
2604
- * @param query
2605
- * @param options
2606
- */
2607
- declare function useMediaQuery(query: MaybeComputedRef<string>, options?: ConfigurableWindow): vue_demi.Ref<boolean>;
2608
-
2609
- type CacheKey = any;
2610
- /**
2611
- * Custom memoize cache handler
2612
- */
2613
- interface UseMemoizeCache<Key, Value> {
2614
- /**
2615
- * Get value for key
2616
- */
2617
- get(key: Key): Value | undefined;
2618
- /**
2619
- * Set value for key
2620
- */
2621
- set(key: Key, value: Value): void;
2622
- /**
2623
- * Return flag if key exists
2624
- */
2625
- has(key: Key): boolean;
2626
- /**
2627
- * Delete value for key
2628
- */
2629
- delete(key: Key): void;
2630
- /**
2631
- * Clear cache
2632
- */
2633
- clear(): void;
2634
- }
2635
- /**
2636
- * Memoized function
2637
- */
2638
- interface UseMemoizeReturn<Result, Args extends unknown[]> {
2639
- /**
2640
- * Get result from cache or call memoized function
2641
- */
2642
- (...args: Args): Result;
2643
- /**
2644
- * Call memoized function and update cache
2645
- */
2646
- load(...args: Args): Result;
2647
- /**
2648
- * Delete cache of given arguments
2649
- */
2650
- delete(...args: Args): void;
2651
- /**
2652
- * Clear cache
2653
- */
2654
- clear(): void;
2655
- /**
2656
- * Generate cache key for given arguments
2657
- */
2658
- generateKey(...args: Args): CacheKey;
2659
- /**
2660
- * Cache container
2661
- */
2662
- cache: UseMemoizeCache<CacheKey, Result>;
2663
- }
2664
- interface UseMemoizeOptions<Result, Args extends unknown[]> {
2665
- getKey?: (...args: Args) => string | number;
2666
- cache?: UseMemoizeCache<CacheKey, Result>;
2667
- }
2668
- /**
2669
- * Reactive function result cache based on arguments
2670
- */
2671
- declare function useMemoize<Result, Args extends unknown[]>(resolver: (...args: Args) => Result, options?: UseMemoizeOptions<Result, Args>): UseMemoizeReturn<Result, Args>;
2672
-
2673
- /**
2674
- * Performance.memory
2675
- *
2676
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Performance/memory
2677
- */
2678
- interface MemoryInfo {
2679
- /**
2680
- * The maximum size of the heap, in bytes, that is available to the context.
2681
- */
2682
- readonly jsHeapSizeLimit: number;
2683
- /**
2684
- * The total allocated heap size, in bytes.
2685
- */
2686
- readonly totalJSHeapSize: number;
2687
- /**
2688
- * The currently active segment of JS heap, in bytes.
2689
- */
2690
- readonly usedJSHeapSize: number;
2691
- [Symbol.toStringTag]: 'MemoryInfo';
2692
- }
2693
- interface UseMemoryOptions extends UseIntervalFnOptions {
2694
- interval?: number;
2695
- }
2696
- /**
2697
- * Reactive Memory Info.
2698
- *
2699
- * @see https://vueuse.org/useMemory
2700
- * @param options
2701
- */
2702
- declare function useMemory(options?: UseMemoryOptions): {
2703
- isSupported: vue_demi.Ref<boolean>;
2704
- memory: vue_demi.Ref<MemoryInfo | undefined>;
2705
- };
2706
- type UseMemoryReturn = ReturnType<typeof useMemory>;
2707
-
2708
- /**
2709
- * Mounted state in ref.
2710
- *
2711
- * @see https://vueuse.org/useMounted
2712
- * @param options
2713
- */
2714
- declare function useMounted(): vue_demi.Ref<boolean>;
2715
-
2716
- interface UseMouseOptions extends ConfigurableWindow, ConfigurableEventFilter {
2717
- /**
2718
- * Mouse position based by page, client, or relative to previous position
2719
- *
2720
- * @default 'page'
2721
- */
2722
- type?: 'page' | 'client' | 'movement';
2723
- /**
2724
- * Listen to `touchmove` events
2725
- *
2726
- * @default true
2727
- */
2728
- touch?: boolean;
2729
- /**
2730
- * Reset to initial value when `touchend` event fired
2731
- *
2732
- * @default false
2733
- */
2734
- resetOnTouchEnds?: boolean;
2735
- /**
2736
- * Initial values
2737
- */
2738
- initialValue?: Position;
2739
- }
2740
- type MouseSourceType = 'mouse' | 'touch' | null;
2741
- /**
2742
- * Reactive mouse position.
2743
- *
2744
- * @see https://vueuse.org/useMouse
2745
- * @param options
2746
- */
2747
- declare function useMouse(options?: UseMouseOptions): {
2748
- x: vue_demi.Ref<number>;
2749
- y: vue_demi.Ref<number>;
2750
- sourceType: vue_demi.Ref<MouseSourceType>;
2751
- };
2752
- type UseMouseReturn = ReturnType<typeof useMouse>;
2753
-
2754
- interface MouseInElementOptions extends UseMouseOptions {
2755
- handleOutside?: boolean;
2756
- }
2757
- /**
2758
- * Reactive mouse position related to an element.
2759
- *
2760
- * @see https://vueuse.org/useMouseInElement
2761
- * @param target
2762
- * @param options
2763
- */
2764
- declare function useMouseInElement(target?: MaybeElementRef, options?: MouseInElementOptions): {
2765
- x: vue_demi.Ref<number>;
2766
- y: vue_demi.Ref<number>;
2767
- sourceType: vue_demi.Ref<MouseSourceType>;
2768
- elementX: vue_demi.Ref<number>;
2769
- elementY: vue_demi.Ref<number>;
2770
- elementPositionX: vue_demi.Ref<number>;
2771
- elementPositionY: vue_demi.Ref<number>;
2772
- elementHeight: vue_demi.Ref<number>;
2773
- elementWidth: vue_demi.Ref<number>;
2774
- isOutside: vue_demi.Ref<boolean>;
2775
- stop: () => void;
2776
- };
2777
- type UseMouseInElementReturn = ReturnType<typeof useMouseInElement>;
2778
-
2779
- interface MousePressedOptions extends ConfigurableWindow {
2780
- /**
2781
- * Listen to `touchstart` `touchend` events
2782
- *
2783
- * @default true
2784
- */
2785
- touch?: boolean;
2786
- /**
2787
- * Listen to `dragstart` `drop` and `dragend` events
2788
- *
2789
- * @default true
2790
- */
2791
- drag?: boolean;
2792
- /**
2793
- * Initial values
2794
- *
2795
- * @default false
2796
- */
2797
- initialValue?: boolean;
2798
- /**
2799
- * Element target to be capture the click
2800
- */
2801
- target?: MaybeElementRef;
2802
- }
2803
- /**
2804
- * Reactive mouse position.
2805
- *
2806
- * @see https://vueuse.org/useMousePressed
2807
- * @param options
2808
- */
2809
- declare function useMousePressed(options?: MousePressedOptions): {
2810
- pressed: vue_demi.Ref<boolean>;
2811
- sourceType: vue_demi.Ref<MouseSourceType>;
2812
- };
2813
- type UseMousePressedReturn = ReturnType<typeof useMousePressed>;
2814
-
2815
- interface UseMutationObserverOptions extends MutationObserverInit, ConfigurableWindow {
2816
- }
2817
- /**
2818
- * Watch for changes being made to the DOM tree.
2819
- *
2820
- * @see https://vueuse.org/useMutationObserver
2821
- * @see https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver MutationObserver MDN
2822
- * @param target
2823
- * @param callback
2824
- * @param options
2825
- */
2826
- declare function useMutationObserver(target: MaybeElementRef, callback: MutationCallback, options?: UseMutationObserverOptions): {
2827
- isSupported: vue_demi.Ref<boolean>;
2828
- stop: () => void;
2829
- };
2830
- type UseMutationObserverReturn = ReturnType<typeof useMutationObserver>;
2831
-
2832
- interface NavigatorLanguageState {
2833
- isSupported: Ref<boolean>;
2834
- /**
2835
- *
2836
- * ISO 639-1 standard Language Code
2837
- *
2838
- * @info The detected user agent language preference as a language tag
2839
- * (which is sometimes referred to as a "locale identifier").
2840
- * This consists of a 2-3 letter base language tag that indicates a
2841
- * language, optionally followed by additional subtags separated by
2842
- * '-'. The most common extra information is the country or region
2843
- * variant (like 'en-US' or 'fr-CA').
2844
- *
2845
- *
2846
- * @see https://www.iso.org/iso-639-language-codes.html
2847
- * @see https://www.loc.gov/standards/iso639-2/php/code_list.php
2848
- *
2849
- */
2850
- language: Ref<string | undefined>;
2851
- }
2852
- /**
2853
- *
2854
- * Reactive useNavigatorLanguage
2855
- *
2856
- * Detects the currently selected user language and returns a reactive language
2857
- * @see https://vueuse.org/useNavigatorLanguage
2858
- *
2859
- */
2860
- declare const useNavigatorLanguage: (options?: ConfigurableWindow) => Readonly<NavigatorLanguageState>;
2861
- type UseNavigatorLanguageReturn = ReturnType<typeof useNavigatorLanguage>;
2862
-
2863
- type NetworkType = 'bluetooth' | 'cellular' | 'ethernet' | 'none' | 'wifi' | 'wimax' | 'other' | 'unknown';
2864
- type NetworkEffectiveType = 'slow-2g' | '2g' | '3g' | '4g' | undefined;
2865
- interface NetworkState {
2866
- isSupported: Ref<boolean>;
2867
- /**
2868
- * If the user is currently connected.
2869
- */
2870
- isOnline: Ref<boolean>;
2871
- /**
2872
- * The time since the user was last connected.
2873
- */
2874
- offlineAt: Ref<number | undefined>;
2875
- /**
2876
- * At this time, if the user is offline and reconnects
2877
- */
2878
- onlineAt: Ref<number | undefined>;
2879
- /**
2880
- * The download speed in Mbps.
2881
- */
2882
- downlink: Ref<number | undefined>;
2883
- /**
2884
- * The max reachable download speed in Mbps.
2885
- */
2886
- downlinkMax: Ref<number | undefined>;
2887
- /**
2888
- * The detected effective speed type.
2889
- */
2890
- effectiveType: Ref<NetworkEffectiveType | undefined>;
2891
- /**
2892
- * The estimated effective round-trip time of the current connection.
2893
- */
2894
- rtt: Ref<number | undefined>;
2895
- /**
2896
- * If the user activated data saver mode.
2897
- */
2898
- saveData: Ref<boolean | undefined>;
2899
- /**
2900
- * The detected connection/network type.
2901
- */
2902
- type: Ref<NetworkType>;
2903
- }
2904
- /**
2905
- * Reactive Network status.
2906
- *
2907
- * @see https://vueuse.org/useNetwork
2908
- * @param options
2909
- */
2910
- declare function useNetwork(options?: ConfigurableWindow): Readonly<NetworkState>;
2911
- type UseNetworkReturn = ReturnType<typeof useNetwork>;
2912
-
2913
- interface UseNowOptions<Controls extends boolean> {
2914
- /**
2915
- * Expose more controls
2916
- *
2917
- * @default false
2918
- */
2919
- controls?: Controls;
2920
- /**
2921
- * Update interval, or use requestAnimationFrame
2922
- *
2923
- * @default requestAnimationFrame
2924
- */
2925
- interval?: 'requestAnimationFrame' | number;
2926
- }
2927
- /**
2928
- * Reactive current Date instance.
2929
- *
2930
- * @see https://vueuse.org/useNow
2931
- * @param options
2932
- */
2933
- declare function useNow(options?: UseNowOptions<false>): Ref<Date>;
2934
- declare function useNow(options: UseNowOptions<true>): {
2935
- now: Ref<Date>;
2936
- } & Pausable;
2937
- type UseNowReturn = ReturnType<typeof useNow>;
2938
-
2939
- /**
2940
- * Reactive URL representing an object.
2941
- *
2942
- * @see https://vueuse.org/useObjectUrl
2943
- * @param object
2944
- */
2945
- declare function useObjectUrl(object: MaybeRef<Blob | MediaSource | undefined>): Readonly<vue_demi.Ref<string | undefined>>;
2946
-
2947
- interface UseOffsetPaginationOptions {
2948
- /**
2949
- * Total number of items.
2950
- */
2951
- total?: MaybeRef<number>;
2952
- /**
2953
- * The number of items to display per page.
2954
- * @default 10
2955
- */
2956
- pageSize?: MaybeRef<number>;
2957
- /**
2958
- * The current page number.
2959
- * @default 1
2960
- */
2961
- page?: MaybeRef<number>;
2962
- /**
2963
- * Callback when the `page` change.
2964
- */
2965
- onPageChange?: (returnValue: UnwrapNestedRefs<UseOffsetPaginationReturn>) => unknown;
2966
- /**
2967
- * Callback when the `pageSize` change.
2968
- */
2969
- onPageSizeChange?: (returnValue: UnwrapNestedRefs<UseOffsetPaginationReturn>) => unknown;
2970
- /**
2971
- * Callback when the `pageCount` change.
2972
- */
2973
- onPageCountChange?: (returnValue: UnwrapNestedRefs<UseOffsetPaginationReturn>) => unknown;
2974
- }
2975
- interface UseOffsetPaginationReturn {
2976
- currentPage: Ref<number>;
2977
- currentPageSize: Ref<number>;
2978
- pageCount: ComputedRef<number>;
2979
- isFirstPage: ComputedRef<boolean>;
2980
- isLastPage: ComputedRef<boolean>;
2981
- prev: () => void;
2982
- next: () => void;
2983
- }
2984
- type UseOffsetPaginationInfinityPageReturn = Omit<UseOffsetPaginationReturn, 'isLastPage'>;
2985
- declare function useOffsetPagination(options: Omit<UseOffsetPaginationOptions, 'total'>): UseOffsetPaginationInfinityPageReturn;
2986
- declare function useOffsetPagination(options: UseOffsetPaginationOptions): UseOffsetPaginationReturn;
2987
-
2988
- /**
2989
- * Reactive online state.
2990
- *
2991
- * @see https://vueuse.org/useOnline
2992
- * @param options
2993
- */
2994
- declare function useOnline(options?: ConfigurableWindow): vue.Ref<boolean>;
2995
-
2996
- /**
2997
- * Reactive state to show whether mouse leaves the page.
2998
- *
2999
- * @see https://vueuse.org/usePageLeave
3000
- * @param options
3001
- */
3002
- declare function usePageLeave(options?: ConfigurableWindow): vue_demi.Ref<boolean>;
3003
-
3004
- interface UseParallaxOptions extends ConfigurableWindow {
3005
- deviceOrientationTiltAdjust?: (i: number) => number;
3006
- deviceOrientationRollAdjust?: (i: number) => number;
3007
- mouseTiltAdjust?: (i: number) => number;
3008
- mouseRollAdjust?: (i: number) => number;
3009
- }
3010
- interface UseParallaxReturn {
3011
- /**
3012
- * Roll value. Scaled to `-0.5 ~ 0.5`
3013
- */
3014
- roll: ComputedRef<number>;
3015
- /**
3016
- * Tilt value. Scaled to `-0.5 ~ 0.5`
3017
- */
3018
- tilt: ComputedRef<number>;
3019
- /**
3020
- * Sensor source, can be `mouse` or `deviceOrientation`
3021
- */
3022
- source: ComputedRef<'deviceOrientation' | 'mouse'>;
3023
- }
3024
- /**
3025
- * Create parallax effect easily. It uses `useDeviceOrientation` and fallback to `useMouse`
3026
- * if orientation is not supported.
3027
- *
3028
- * @param target
3029
- * @param options
3030
- */
3031
- declare function useParallax(target: MaybeElementRef, options?: UseParallaxOptions): UseParallaxReturn;
3032
-
3033
- type DescriptorNamePolyfill = 'accelerometer' | 'accessibility-events' | 'ambient-light-sensor' | 'background-sync' | 'camera' | 'clipboard-read' | 'clipboard-write' | 'gyroscope' | 'magnetometer' | 'microphone' | 'notifications' | 'payment-handler' | 'persistent-storage' | 'push' | 'speaker';
3034
- type GeneralPermissionDescriptor = PermissionDescriptor | {
3035
- name: DescriptorNamePolyfill;
3036
- };
3037
- interface UsePermissionOptions<Controls extends boolean> extends ConfigurableNavigator {
3038
- /**
3039
- * Expose more controls
3040
- *
3041
- * @default false
3042
- */
3043
- controls?: Controls;
3044
- }
3045
- type UsePermissionReturn = Readonly<Ref<PermissionState | undefined>>;
3046
- interface UsePermissionReturnWithControls {
3047
- state: UsePermissionReturn;
3048
- isSupported: Ref<boolean>;
3049
- query: () => Promise<PermissionStatus | undefined>;
3050
- }
3051
- /**
3052
- * Reactive Permissions API.
3053
- *
3054
- * @see https://vueuse.org/usePermission
3055
- */
3056
- declare function usePermission(permissionDesc: GeneralPermissionDescriptor | GeneralPermissionDescriptor['name'], options?: UsePermissionOptions<false>): UsePermissionReturn;
3057
- declare function usePermission(permissionDesc: GeneralPermissionDescriptor | GeneralPermissionDescriptor['name'], options: UsePermissionOptions<true>): UsePermissionReturnWithControls;
3058
-
3059
- interface UsePointerState extends Position {
3060
- pressure: number;
3061
- pointerId: number;
3062
- tiltX: number;
3063
- tiltY: number;
3064
- width: number;
3065
- height: number;
3066
- twist: number;
3067
- pointerType: PointerType | null;
3068
- }
3069
- interface UsePointerOptions extends ConfigurableWindow {
3070
- /**
3071
- * Pointer types that listen to.
3072
- *
3073
- * @default ['mouse', 'touch', 'pen']
3074
- */
3075
- pointerTypes?: PointerType[];
3076
- /**
3077
- * Initial values
3078
- */
3079
- initialValue?: MaybeRef<Partial<UsePointerState>>;
3080
- /**
3081
- * @default window
3082
- */
3083
- target?: MaybeRef<EventTarget | null | undefined> | Document | Window;
3084
- }
3085
- /**
3086
- * Reactive pointer state.
3087
- *
3088
- * @see https://vueuse.org/usePointer
3089
- * @param options
3090
- */
3091
- declare function usePointer(options?: UsePointerOptions): {
3092
- isInside: Ref<boolean>;
3093
- pressure: Ref<number>;
3094
- pointerId: Ref<number>;
3095
- tiltX: Ref<number>;
3096
- tiltY: Ref<number>;
3097
- width: Ref<number>;
3098
- height: Ref<number>;
3099
- twist: Ref<number>;
3100
- pointerType: Ref<PointerType | null>;
3101
- x: Ref<number>;
3102
- y: Ref<number>;
3103
- };
3104
- type UsePointerReturn = ReturnType<typeof usePointer>;
3105
-
3106
- declare global {
3107
- interface PointerLockOptions {
3108
- unadjustedMovement?: boolean;
3109
- }
3110
- interface Element {
3111
- requestPointerLock(options?: PointerLockOptions): Promise<void> | void;
3112
- }
3113
- }
3114
- type MaybeHTMLElement = HTMLElement | undefined | null;
3115
- interface UsePointerLockOptions extends ConfigurableDocument {
3116
- pointerLockOptions?: PointerLockOptions;
3117
- }
3118
- /**
3119
- * Reactive pointer lock.
3120
- *
3121
- * @see https://vueuse.org/usePointerLock
3122
- * @param target
3123
- * @param options
3124
- */
3125
- declare function usePointerLock(target?: MaybeElementRef<MaybeHTMLElement>, options?: UsePointerLockOptions): {
3126
- isSupported: vue_demi.Ref<boolean>;
3127
- element: vue_demi.Ref<MaybeHTMLElement>;
3128
- triggerElement: vue_demi.Ref<MaybeHTMLElement>;
3129
- lock: (e: MaybeElementRef<MaybeHTMLElement> | Event, options?: PointerLockOptions) => Promise<HTMLElement>;
3130
- unlock: () => Promise<boolean>;
3131
- };
3132
- type UsePointerLockReturn = ReturnType<typeof usePointerLock>;
3133
-
3134
- declare enum SwipeDirection {
3135
- UP = "UP",
3136
- RIGHT = "RIGHT",
3137
- DOWN = "DOWN",
3138
- LEFT = "LEFT",
3139
- NONE = "NONE"
3140
- }
3141
- interface UseSwipeOptions extends ConfigurableWindow {
3142
- /**
3143
- * Register events as passive
3144
- *
3145
- * @default true
3146
- */
3147
- passive?: boolean;
3148
- /**
3149
- * @default 50
3150
- */
3151
- threshold?: number;
3152
- /**
3153
- * Callback on swipe start
3154
- */
3155
- onSwipeStart?: (e: TouchEvent) => void;
3156
- /**
3157
- * Callback on swipe moves
3158
- */
3159
- onSwipe?: (e: TouchEvent) => void;
3160
- /**
3161
- * Callback on swipe ends
3162
- */
3163
- onSwipeEnd?: (e: TouchEvent, direction: SwipeDirection) => void;
3164
- }
3165
- interface UseSwipeReturn {
3166
- isPassiveEventSupported: boolean;
3167
- isSwiping: Ref<boolean>;
3168
- direction: ComputedRef<SwipeDirection | null>;
3169
- coordsStart: Readonly<Position>;
3170
- coordsEnd: Readonly<Position>;
3171
- lengthX: ComputedRef<number>;
3172
- lengthY: ComputedRef<number>;
3173
- stop: () => void;
3174
- }
3175
- /**
3176
- * Reactive swipe detection.
3177
- *
3178
- * @see https://vueuse.org/useSwipe
3179
- * @param target
3180
- * @param options
3181
- */
3182
- declare function useSwipe(target: MaybeComputedRef<EventTarget | null | undefined>, options?: UseSwipeOptions): UseSwipeReturn;
3183
-
3184
- interface UsePointerSwipeOptions {
3185
- /**
3186
- * @default 50
3187
- */
3188
- threshold?: number;
3189
- /**
3190
- * Callback on swipe start.
3191
- */
3192
- onSwipeStart?: (e: PointerEvent) => void;
3193
- /**
3194
- * Callback on swipe move.
3195
- */
3196
- onSwipe?: (e: PointerEvent) => void;
3197
- /**
3198
- * Callback on swipe end.
3199
- */
3200
- onSwipeEnd?: (e: PointerEvent, direction: SwipeDirection) => void;
3201
- /**
3202
- * Pointer types to listen to.
3203
- *
3204
- * @default ['mouse', 'touch', 'pen']
3205
- */
3206
- pointerTypes?: PointerType[];
3207
- }
3208
- interface UsePointerSwipeReturn {
3209
- readonly isSwiping: Ref<boolean>;
3210
- direction: Readonly<Ref<SwipeDirection | null>>;
3211
- readonly posStart: Position;
3212
- readonly posEnd: Position;
3213
- distanceX: Readonly<Ref<number>>;
3214
- distanceY: Readonly<Ref<number>>;
3215
- stop: () => void;
3216
- }
3217
- /**
3218
- * Reactive swipe detection based on PointerEvents.
3219
- *
3220
- * @see https://vueuse.org/usePointerSwipe
3221
- * @param target
3222
- * @param options
3223
- */
3224
- declare function usePointerSwipe(target: MaybeComputedRef<HTMLElement | null | undefined>, options?: UsePointerSwipeOptions): UsePointerSwipeReturn;
3225
-
3226
- type ColorSchemeType = 'dark' | 'light' | 'no-preference';
3227
- /**
3228
- * Reactive prefers-color-scheme media query.
3229
- *
3230
- * @see https://vueuse.org/usePreferredColorScheme
3231
- * @param [options]
3232
- */
3233
- declare function usePreferredColorScheme(options?: ConfigurableWindow): vue_demi.ComputedRef<ColorSchemeType>;
3234
-
3235
- type ContrastType = 'more' | 'less' | 'custom' | 'no-preference';
3236
- /**
3237
- * Reactive prefers-contrast media query.
3238
- *
3239
- * @see https://vueuse.org/usePreferredContrast
3240
- * @param [options]
3241
- */
3242
- declare function usePreferredContrast(options?: ConfigurableWindow): vue_demi.ComputedRef<ContrastType>;
3243
-
3244
- /**
3245
- * Reactive dark theme preference.
3246
- *
3247
- * @see https://vueuse.org/usePreferredDark
3248
- * @param [options]
3249
- */
3250
- declare function usePreferredDark(options?: ConfigurableWindow): vue.Ref<boolean>;
3251
-
3252
- /**
3253
- * Reactive Navigator Languages.
3254
- *
3255
- * @see https://vueuse.org/usePreferredLanguages
3256
- * @param options
3257
- */
3258
- declare function usePreferredLanguages(options?: ConfigurableWindow): Ref<readonly string[]>;
3259
-
3260
- type ReducedMotionType = 'reduce' | 'no-preference';
3261
- /**
3262
- * Reactive prefers-reduced-motion media query.
3263
- *
3264
- * @see https://vueuse.org/usePreferredReducedMotion
3265
- * @param [options]
3266
- */
3267
- declare function usePreferredReducedMotion(options?: ConfigurableWindow): vue_demi.ComputedRef<ReducedMotionType>;
3268
-
3269
- /**
3270
- * Holds the previous value of a ref.
3271
- *
3272
- * @see {@link https://vueuse.org/usePrevious}
3273
- */
3274
- declare function usePrevious<T>(value: MaybeComputedRef<T>): Readonly<Ref<T | undefined>>;
3275
- declare function usePrevious<T>(value: MaybeComputedRef<T>, initialValue: T): Readonly<Ref<T>>;
3276
-
3277
- interface UseRafFnCallbackArguments {
3278
- /**
3279
- * Time elapsed between this and the last frame.
3280
- */
3281
- delta: number;
3282
- /**
3283
- * Time elapsed since the creation of the web page. See {@link https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp#the_time_origin Time origin}.
3284
- */
3285
- timestamp: DOMHighResTimeStamp;
3286
- }
3287
- interface UseRafFnOptions extends ConfigurableWindow {
3288
- /**
3289
- * Start the requestAnimationFrame loop immediately on creation
3290
- *
3291
- * @default true
3292
- */
3293
- immediate?: boolean;
3294
- }
3295
- /**
3296
- * Call function on every `requestAnimationFrame`. With controls of pausing and resuming.
3297
- *
3298
- * @see https://vueuse.org/useRafFn
3299
- * @param fn
3300
- * @param options
3301
- */
3302
- declare function useRafFn(fn: (args: UseRafFnCallbackArguments) => void, options?: UseRafFnOptions): Pausable;
3303
-
3304
- /**
3305
- * Reactive screen orientation
3306
- *
3307
- * @see https://vueuse.org/useScreenOrientation
3308
- */
3309
- declare const useScreenOrientation: (options?: ConfigurableWindow) => {
3310
- isSupported: vue_demi.Ref<boolean>;
3311
- orientation: vue_demi.Ref<OrientationType | undefined>;
3312
- angle: vue_demi.Ref<number>;
3313
- lockOrientation: (type: OrientationLockType) => Promise<void>;
3314
- unlockOrientation: () => void;
3315
- };
3316
- type UseScreenOrientationReturn = ReturnType<typeof useScreenOrientation>;
3317
-
3318
- /**
3319
- * Reactive `env(safe-area-inset-*)`
3320
- *
3321
- * @see https://vueuse.org/useScreenSafeArea
3322
- */
3323
- declare function useScreenSafeArea(): {
3324
- top: vue_demi.Ref<string>;
3325
- right: vue_demi.Ref<string>;
3326
- bottom: vue_demi.Ref<string>;
3327
- left: vue_demi.Ref<string>;
3328
- update: () => void;
3329
- };
3330
-
3331
- interface UseScriptTagOptions extends ConfigurableDocument {
3332
- /**
3333
- * Load the script immediately
3334
- *
3335
- * @default true
3336
- */
3337
- immediate?: boolean;
3338
- /**
3339
- * Add `async` attribute to the script tag
3340
- *
3341
- * @default true
3342
- */
3343
- async?: boolean;
3344
- /**
3345
- * Script type
3346
- *
3347
- * @default 'text/javascript'
3348
- */
3349
- type?: string;
3350
- /**
3351
- * Manual controls the timing of loading and unloading
3352
- *
3353
- * @default false
3354
- */
3355
- manual?: boolean;
3356
- crossOrigin?: 'anonymous' | 'use-credentials';
3357
- referrerPolicy?: 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url';
3358
- noModule?: boolean;
3359
- defer?: boolean;
3360
- /**
3361
- * Add custom attribute to the script tag
3362
- *
3363
- */
3364
- attrs?: Record<string, string>;
3365
- }
3366
- /**
3367
- * Async script tag loading.
3368
- *
3369
- * @see https://vueuse.org/useScriptTag
3370
- * @param src
3371
- * @param onLoaded
3372
- * @param options
3373
- */
3374
- declare function useScriptTag(src: MaybeComputedRef<string>, onLoaded?: (el: HTMLScriptElement) => void, options?: UseScriptTagOptions): {
3375
- scriptTag: vue_demi.Ref<HTMLScriptElement | null>;
3376
- load: (waitForScriptLoad?: boolean) => Promise<HTMLScriptElement | boolean>;
3377
- unload: () => void;
3378
- };
3379
- type UseScriptTagReturn = ReturnType<typeof useScriptTag>;
3380
-
3381
- /**
3382
- * Lock scrolling of the element.
3383
- *
3384
- * @see https://vueuse.org/useScrollLock
3385
- * @param element
3386
- */
3387
- declare function useScrollLock(element: MaybeComputedRef<HTMLElement | SVGElement | Window | Document | null | undefined>, initialState?: boolean): vue_demi.WritableComputedRef<boolean>;
3388
-
3389
- declare function useSessionStorage(key: string, initialValue: MaybeComputedRef<string>, options?: UseStorageOptions<string>): RemovableRef<string>;
3390
- declare function useSessionStorage(key: string, initialValue: MaybeComputedRef<boolean>, options?: UseStorageOptions<boolean>): RemovableRef<boolean>;
3391
- declare function useSessionStorage(key: string, initialValue: MaybeComputedRef<number>, options?: UseStorageOptions<number>): RemovableRef<number>;
3392
- declare function useSessionStorage<T>(key: string, initialValue: MaybeComputedRef<T>, options?: UseStorageOptions<T>): RemovableRef<T>;
3393
- declare function useSessionStorage<T = unknown>(key: string, initialValue: MaybeComputedRef<null>, options?: UseStorageOptions<T>): RemovableRef<T>;
3394
-
3395
- interface UseShareOptions {
3396
- title?: string;
3397
- files?: File[];
3398
- text?: string;
3399
- url?: string;
3400
- }
3401
- /**
3402
- * Reactive Web Share API.
3403
- *
3404
- * @see https://vueuse.org/useShare
3405
- * @param shareOptions
3406
- * @param options
3407
- */
3408
- declare function useShare(shareOptions?: MaybeComputedRef<UseShareOptions>, options?: ConfigurableNavigator): {
3409
- isSupported: vue.Ref<boolean>;
3410
- share: (overrideOptions?: MaybeComputedRef<UseShareOptions>) => Promise<void>;
3411
- };
3412
- type UseShareReturn = ReturnType<typeof useShare>;
3413
-
3414
- type UseSortedCompareFn<T = any> = (a: T, b: T) => number;
3415
- type UseSortedFn<T = any> = (arr: T[], compareFn: UseSortedCompareFn<T>) => T[];
3416
- interface UseSortedOptions<T = any> {
3417
- /**
3418
- * sort algorithm
3419
- */
3420
- sortFn?: UseSortedFn<T>;
3421
- /**
3422
- * compare function
3423
- */
3424
- compareFn?: UseSortedCompareFn<T>;
3425
- /**
3426
- * change the value of the source array
3427
- * @default false
3428
- */
3429
- dirty?: boolean;
3430
- }
3431
- declare function useSorted<T = any>(source: MaybeRef<T[]>, compareFn?: UseSortedCompareFn<T>): Ref<T[]>;
3432
- declare function useSorted<T = any>(source: MaybeRef<T[]>, options?: UseSortedOptions<T>): Ref<T[]>;
3433
- declare function useSorted<T = any>(source: MaybeRef<T[]>, compareFn?: UseSortedCompareFn<T>, options?: Omit<UseSortedOptions<T>, 'compareFn'>): Ref<T[]>;
3434
-
3435
- type SpeechRecognitionErrorCode = 'aborted' | 'audio-capture' | 'bad-grammar' | 'language-not-supported' | 'network' | 'no-speech' | 'not-allowed' | 'service-not-allowed';
3436
- interface SpeechGrammar {
3437
- src: string;
3438
- weight: number;
3439
- }
3440
- interface SpeechGrammarList {
3441
- readonly length: number;
3442
- addFromString(string: string, weight?: number): void;
3443
- addFromURI(src: string, weight?: number): void;
3444
- item(index: number): SpeechGrammar;
3445
- [index: number]: SpeechGrammar;
3446
- }
3447
- interface SpeechRecognitionErrorEvent extends Event {
3448
- readonly error: SpeechRecognitionErrorCode;
3449
- readonly message: string;
3450
- }
3451
- interface SpeechRecognitionEvent extends Event {
3452
- readonly resultIndex: number;
3453
- readonly results: SpeechRecognitionResultList;
3454
- }
3455
- interface SpeechRecognitionEventMap {
3456
- 'audioend': Event;
3457
- 'audiostart': Event;
3458
- 'end': Event;
3459
- 'error': SpeechRecognitionErrorEvent;
3460
- 'nomatch': SpeechRecognitionEvent;
3461
- 'result': SpeechRecognitionEvent;
3462
- 'soundend': Event;
3463
- 'soundstart': Event;
3464
- 'speechend': Event;
3465
- 'speechstart': Event;
3466
- 'start': Event;
3467
- }
3468
- interface SpeechRecognition extends EventTarget {
3469
- continuous: boolean;
3470
- grammars: SpeechGrammarList;
3471
- interimResults: boolean;
3472
- lang: string;
3473
- maxAlternatives: number;
3474
- onaudioend: ((this: SpeechRecognition, ev: Event) => any) | null;
3475
- onaudiostart: ((this: SpeechRecognition, ev: Event) => any) | null;
3476
- onend: ((this: SpeechRecognition, ev: Event) => any) | null;
3477
- onerror: ((this: SpeechRecognition, ev: SpeechRecognitionErrorEvent) => any) | null;
3478
- onnomatch: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
3479
- onresult: ((this: SpeechRecognition, ev: SpeechRecognitionEvent) => any) | null;
3480
- onsoundend: ((this: SpeechRecognition, ev: Event) => any) | null;
3481
- onsoundstart: ((this: SpeechRecognition, ev: Event) => any) | null;
3482
- onspeechend: ((this: SpeechRecognition, ev: Event) => any) | null;
3483
- onspeechstart: ((this: SpeechRecognition, ev: Event) => any) | null;
3484
- onstart: ((this: SpeechRecognition, ev: Event) => any) | null;
3485
- abort(): void;
3486
- start(): void;
3487
- stop(): void;
3488
- addEventListener<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
3489
- addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
3490
- removeEventListener<K extends keyof SpeechRecognitionEventMap>(type: K, listener: (this: SpeechRecognition, ev: SpeechRecognitionEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
3491
- removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
3492
- }
3493
-
3494
- interface UseSpeechRecognitionOptions extends ConfigurableWindow {
3495
- /**
3496
- * Controls whether continuous results are returned for each recognition, or only a single result.
3497
- *
3498
- * @default true
3499
- */
3500
- continuous?: boolean;
3501
- /**
3502
- * Controls whether interim results should be returned (true) or not (false.) Interim results are results that are not yet final
3503
- *
3504
- * @default true
3505
- */
3506
- interimResults?: boolean;
3507
- /**
3508
- * Language for SpeechRecognition
3509
- *
3510
- * @default 'en-US'
3511
- */
3512
- lang?: MaybeComputedRef<string>;
3513
- }
3514
- /**
3515
- * Reactive SpeechRecognition.
3516
- *
3517
- * @see https://vueuse.org/useSpeechRecognition
3518
- * @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechRecognition SpeechRecognition
3519
- * @param options
3520
- */
3521
- declare function useSpeechRecognition(options?: UseSpeechRecognitionOptions): {
3522
- isSupported: Ref<boolean>;
3523
- isListening: Ref<boolean>;
3524
- isFinal: Ref<boolean>;
3525
- recognition: SpeechRecognition | undefined;
3526
- result: Ref<string>;
3527
- error: Ref<SpeechRecognitionErrorEvent | undefined>;
3528
- toggle: (value?: boolean) => void;
3529
- start: () => void;
3530
- stop: () => void;
3531
- };
3532
- type UseSpeechRecognitionReturn = ReturnType<typeof useSpeechRecognition>;
3533
-
3534
- type UseSpeechSynthesisStatus = 'init' | 'play' | 'pause' | 'end';
3535
- interface UseSpeechSynthesisOptions extends ConfigurableWindow {
3536
- /**
3537
- * Language for SpeechSynthesis
3538
- *
3539
- * @default 'en-US'
3540
- */
3541
- lang?: MaybeComputedRef<string>;
3542
- /**
3543
- * Gets and sets the pitch at which the utterance will be spoken at.
3544
- *
3545
- * @default 1
3546
- */
3547
- pitch?: SpeechSynthesisUtterance['pitch'];
3548
- /**
3549
- * Gets and sets the speed at which the utterance will be spoken at.
3550
- *
3551
- * @default 1
3552
- */
3553
- rate?: SpeechSynthesisUtterance['rate'];
3554
- /**
3555
- * Gets and sets the voice that will be used to speak the utterance.
3556
- */
3557
- voice?: MaybeRef<SpeechSynthesisVoice>;
3558
- /**
3559
- * Gets and sets the volume that the utterance will be spoken at.
3560
- *
3561
- * @default 1
3562
- */
3563
- volume?: SpeechSynthesisUtterance['volume'];
3564
- }
3565
- /**
3566
- * Reactive SpeechSynthesis.
3567
- *
3568
- * @see https://vueuse.org/useSpeechSynthesis
3569
- * @see https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis SpeechSynthesis
3570
- * @param options
3571
- */
3572
- declare function useSpeechSynthesis(text: MaybeComputedRef<string>, options?: UseSpeechSynthesisOptions): {
3573
- isSupported: Ref<boolean>;
3574
- isPlaying: Ref<boolean>;
3575
- status: Ref<UseSpeechSynthesisStatus>;
3576
- utterance: vue_demi.ComputedRef<SpeechSynthesisUtterance>;
3577
- error: Ref<SpeechSynthesisErrorEvent | undefined>;
3578
- stop: () => void;
3579
- toggle: (value?: boolean) => void;
3580
- speak: () => void;
3581
- };
3582
- type UseSpeechSynthesisReturn = ReturnType<typeof useSpeechSynthesis>;
3583
-
3584
- interface UseStepperReturn<StepName, Steps, Step> {
3585
- /** List of steps. */
3586
- steps: Readonly<Ref<Steps>>;
3587
- /** List of step names. */
3588
- stepNames: Readonly<Ref<StepName[]>>;
3589
- /** Index of the current step. */
3590
- index: Ref<number>;
3591
- /** Current step. */
3592
- current: ComputedRef<Step>;
3593
- /** Next step, or undefined if the current step is the last one. */
3594
- next: ComputedRef<StepName | undefined>;
3595
- /** Previous step, or undefined if the current step is the first one. */
3596
- previous: ComputedRef<StepName | undefined>;
3597
- /** Whether the current step is the first one. */
3598
- isFirst: ComputedRef<boolean>;
3599
- /** Whether the current step is the last one. */
3600
- isLast: ComputedRef<boolean>;
3601
- /** Get the step at the specified index. */
3602
- at: (index: number) => Step | undefined;
3603
- /** Get a step by the specified name. */
3604
- get: (step: StepName) => Step | undefined;
3605
- /** Go to the specified step. */
3606
- goTo: (step: StepName) => void;
3607
- /** Go to the next step. Does nothing if the current step is the last one. */
3608
- goToNext: () => void;
3609
- /** Go to the previous step. Does nothing if the current step is the previous one. */
3610
- goToPrevious: () => void;
3611
- /** Go back to the given step, only if the current step is after. */
3612
- goBackTo: (step: StepName) => void;
3613
- /** Checks whether the given step is the next step. */
3614
- isNext: (step: StepName) => boolean;
3615
- /** Checks whether the given step is the previous step. */
3616
- isPrevious: (step: StepName) => boolean;
3617
- /** Checks whether the given step is the current step. */
3618
- isCurrent: (step: StepName) => boolean;
3619
- /** Checks if the current step is before the given step. */
3620
- isBefore: (step: StepName) => boolean;
3621
- /** Checks if the current step is after the given step. */
3622
- isAfter: (step: StepName) => boolean;
3623
- }
3624
- declare function useStepper<T extends string | number>(steps: MaybeRef<T[]>, initialStep?: T): UseStepperReturn<T, T[], T>;
3625
- declare function useStepper<T extends Record<string, any>>(steps: MaybeRef<T>, initialStep?: keyof T): UseStepperReturn<Exclude<keyof T, symbol>, T, T[keyof T]>;
3626
-
3627
- interface UseStorageAsyncOptions<T> extends Omit<UseStorageOptions<T>, 'serializer'> {
3628
- /**
3629
- * Custom data serialization
3630
- */
3631
- serializer?: SerializerAsync<T>;
3632
- }
3633
- declare function useStorageAsync(key: string, initialValue: MaybeComputedRef<string>, storage?: StorageLikeAsync, options?: UseStorageAsyncOptions<string>): RemovableRef<string>;
3634
- declare function useStorageAsync(key: string, initialValue: MaybeComputedRef<boolean>, storage?: StorageLikeAsync, options?: UseStorageAsyncOptions<boolean>): RemovableRef<boolean>;
3635
- declare function useStorageAsync(key: string, initialValue: MaybeComputedRef<number>, storage?: StorageLikeAsync, options?: UseStorageAsyncOptions<number>): RemovableRef<number>;
3636
- declare function useStorageAsync<T>(key: string, initialValue: MaybeComputedRef<T>, storage?: StorageLikeAsync, options?: UseStorageAsyncOptions<T>): RemovableRef<T>;
3637
- declare function useStorageAsync<T = unknown>(key: string, initialValue: MaybeComputedRef<null>, storage?: StorageLikeAsync, options?: UseStorageAsyncOptions<T>): RemovableRef<T>;
3638
-
3639
- interface UseStyleTagOptions extends ConfigurableDocument {
3640
- /**
3641
- * Media query for styles to apply
3642
- */
3643
- media?: string;
3644
- /**
3645
- * Load the style immediately
3646
- *
3647
- * @default true
3648
- */
3649
- immediate?: boolean;
3650
- /**
3651
- * Manual controls the timing of loading and unloading
3652
- *
3653
- * @default false
3654
- */
3655
- manual?: boolean;
3656
- /**
3657
- * DOM id of the style tag
3658
- *
3659
- * @default auto-incremented
3660
- */
3661
- id?: string;
3662
- }
3663
- interface UseStyleTagReturn {
3664
- id: string;
3665
- css: Ref<string>;
3666
- load: () => void;
3667
- unload: () => void;
3668
- isLoaded: Readonly<Ref<boolean>>;
3669
- }
3670
- /**
3671
- * Inject <style> element in head.
3672
- *
3673
- * Overload: Omitted id
3674
- *
3675
- * @see https://vueuse.org/useStyleTag
3676
- * @param css
3677
- * @param options
3678
- */
3679
- declare function useStyleTag(css: MaybeRef<string>, options?: UseStyleTagOptions): UseStyleTagReturn;
3680
-
3681
- declare function useSupported(callback: () => unknown, sync?: boolean): Ref<boolean>;
3682
-
3683
- type TemplateRefsList<T> = T[] & {
3684
- set(el: Object | null): void;
3685
- };
3686
- declare function useTemplateRefsList<T = Element>(): Readonly<Ref<Readonly<TemplateRefsList<T>>>>;
3687
-
3688
- type UseTextDirectionValue = 'ltr' | 'rtl' | 'auto';
3689
- interface UseTextDirectionOptions extends ConfigurableDocument {
3690
- /**
3691
- * CSS Selector for the target element applying to
3692
- *
3693
- * @default 'html'
3694
- */
3695
- selector?: string;
3696
- /**
3697
- * Observe `document.querySelector(selector)` changes using MutationObserve
3698
- *
3699
- * @default false
3700
- */
3701
- observe?: boolean;
3702
- /**
3703
- * Initial value
3704
- *
3705
- * @default 'ltr'
3706
- */
3707
- initialValue?: UseTextDirectionValue;
3708
- }
3709
- /**
3710
- * Reactive dir of the element's text.
3711
- *
3712
- * @see https://vueuse.org/useTextDirection
3713
- */
3714
- declare function useTextDirection(options?: UseTextDirectionOptions): vue_demi.WritableComputedRef<UseTextDirectionValue>;
3715
-
3716
- /**
3717
- * Reactively track user text selection based on [`Window.getSelection`](https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection).
3718
- *
3719
- * @see https://vueuse.org/useTextSelection
3720
- */
3721
- declare function useTextSelection(options?: ConfigurableWindow): {
3722
- text: vue_demi.ComputedRef<string>;
3723
- rects: vue_demi.ComputedRef<DOMRect[]>;
3724
- ranges: vue_demi.ComputedRef<Range[]>;
3725
- selection: vue_demi.Ref<{
3726
- readonly anchorNode: Node | null;
3727
- readonly anchorOffset: number;
3728
- readonly focusNode: Node | null;
3729
- readonly focusOffset: number;
3730
- readonly isCollapsed: boolean;
3731
- readonly rangeCount: number;
3732
- readonly type: string;
3733
- addRange: (range: Range) => void;
3734
- collapse: (node: Node | null, offset?: number | undefined) => void;
3735
- collapseToEnd: () => void;
3736
- collapseToStart: () => void;
3737
- containsNode: (node: Node, allowPartialContainment?: boolean | undefined) => boolean;
3738
- deleteFromDocument: () => void;
3739
- empty: () => void;
3740
- extend: (node: Node, offset?: number | undefined) => void;
3741
- getRangeAt: (index: number) => Range;
3742
- modify: (alter?: string | undefined, direction?: string | undefined, granularity?: string | undefined) => void;
3743
- removeAllRanges: () => void;
3744
- removeRange: (range: Range) => void;
3745
- selectAllChildren: (node: Node) => void;
3746
- setBaseAndExtent: (anchorNode: Node, anchorOffset: number, focusNode: Node, focusOffset: number) => void;
3747
- setPosition: (node: Node | null, offset?: number | undefined) => void;
3748
- toString: () => string;
3749
- } | null>;
3750
- };
3751
- type UseTextSelectionReturn = ReturnType<typeof useTextSelection>;
3752
-
3753
- interface UseTextareaAutosizeOptions {
3754
- /** Textarea element to autosize. */
3755
- element?: MaybeRef<HTMLTextAreaElement | undefined>;
3756
- /** Textarea content. */
3757
- input?: MaybeRef<string | undefined>;
3758
- /** Watch sources that should trigger a textarea resize. */
3759
- watch?: WatchSource | Array<WatchSource>;
3760
- /** Function called when the textarea size changes. */
3761
- onResize?: () => void;
3762
- }
3763
- declare function useTextareaAutosize(options?: UseTextareaAutosizeOptions): {
3764
- textarea: vue_demi.Ref<HTMLTextAreaElement>;
3765
- input: vue_demi.Ref<string>;
3766
- triggerResize: () => void;
3767
- };
3768
- type UseTextareaAutosizeReturn = ReturnType<typeof useTextareaAutosize>;
3769
-
3770
- type UseThrottledRefHistoryOptions<Raw, Serialized = Raw> = Omit<UseRefHistoryOptions<Raw, Serialized>, 'eventFilter'> & {
3771
- throttle?: MaybeRef<number>;
3772
- trailing?: boolean;
3773
- };
3774
- type UseThrottledRefHistoryReturn<Raw, Serialized = Raw> = UseRefHistoryReturn<Raw, Serialized>;
3775
- /**
3776
- * Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with throttled filter.
3777
- *
3778
- * @see https://vueuse.org/useThrottledRefHistory
3779
- * @param source
3780
- * @param options
3781
- */
3782
- declare function useThrottledRefHistory<Raw, Serialized = Raw>(source: Ref<Raw>, options?: UseThrottledRefHistoryOptions<Raw, Serialized>): UseThrottledRefHistoryReturn<Raw, Serialized>;
3783
-
3784
- type UseTimeAgoFormatter<T = number> = (value: T, isPast: boolean) => string;
3785
- type UseTimeAgoUnitNamesDefault = 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'year';
3786
- interface UseTimeAgoMessagesBuiltIn {
3787
- justNow: string;
3788
- past: string | UseTimeAgoFormatter<string>;
3789
- future: string | UseTimeAgoFormatter<string>;
3790
- invalid: string;
3791
- }
3792
- type UseTimeAgoMessages<UnitNames extends string = UseTimeAgoUnitNamesDefault> = UseTimeAgoMessagesBuiltIn & Record<UnitNames, string | UseTimeAgoFormatter<number>>;
3793
- interface FormatTimeAgoOptions<UnitNames extends string = UseTimeAgoUnitNamesDefault> {
3794
- /**
3795
- * Maximum unit (of diff in milliseconds) to display the full date instead of relative
3796
- *
3797
- * @default undefined
3798
- */
3799
- max?: UnitNames | number;
3800
- /**
3801
- * Formatter for full date
3802
- */
3803
- fullDateFormatter?: (date: Date) => string;
3804
- /**
3805
- * Messages for formatting the string
3806
- */
3807
- messages?: UseTimeAgoMessages<UnitNames>;
3808
- /**
3809
- * Minimum display time unit (default is minute)
3810
- *
3811
- * @default false
3812
- */
3813
- showSecond?: boolean;
3814
- /**
3815
- * Rounding method to apply.
3816
- *
3817
- * @default 'round'
3818
- */
3819
- rounding?: 'round' | 'ceil' | 'floor' | number;
3820
- /**
3821
- * Custom units
3822
- */
3823
- units?: UseTimeAgoUnit<UseTimeAgoUnitNamesDefault>[];
3824
- }
3825
- interface UseTimeAgoOptions<Controls extends boolean, UnitNames extends string = UseTimeAgoUnitNamesDefault> extends FormatTimeAgoOptions<UnitNames> {
3826
- /**
3827
- * Expose more controls
3828
- *
3829
- * @default false
3830
- */
3831
- controls?: Controls;
3832
- /**
3833
- * Intervals to update, set 0 to disable auto update
3834
- *
3835
- * @default 30_000
3836
- */
3837
- updateInterval?: number;
3838
- }
3839
- interface UseTimeAgoUnit<Unit extends string = UseTimeAgoUnitNamesDefault> {
3840
- max: number;
3841
- value: number;
3842
- name: Unit;
3843
- }
3844
- type UseTimeAgoReturn<Controls extends boolean = false> = Controls extends true ? {
3845
- timeAgo: ComputedRef<string>;
3846
- } & Pausable : ComputedRef<string>;
3847
- /**
3848
- * Reactive time ago formatter.
3849
- *
3850
- * @see https://vueuse.org/useTimeAgo
3851
- * @param options
3852
- */
3853
- declare function useTimeAgo<UnitNames extends string = UseTimeAgoUnitNamesDefault>(time: MaybeComputedRef<Date | number | string>, options?: UseTimeAgoOptions<false, UnitNames>): UseTimeAgoReturn<false>;
3854
- declare function useTimeAgo<UnitNames extends string = UseTimeAgoUnitNamesDefault>(time: MaybeComputedRef<Date | number | string>, options: UseTimeAgoOptions<true, UnitNames>): UseTimeAgoReturn<true>;
3855
- declare function formatTimeAgo<UnitNames extends string = UseTimeAgoUnitNamesDefault>(from: Date, options?: FormatTimeAgoOptions<UnitNames>, now?: Date | number): string;
3856
-
3857
- declare function useTimeoutPoll(fn: () => Awaitable<void>, interval: MaybeComputedRef<number>, timeoutPollOptions?: UseTimeoutFnOptions): Pausable;
3858
-
3859
- interface UseTimestampOptions<Controls extends boolean> {
3860
- /**
3861
- * Expose more controls
3862
- *
3863
- * @default false
3864
- */
3865
- controls?: Controls;
3866
- /**
3867
- * Offset value adding to the value
3868
- *
3869
- * @default 0
3870
- */
3871
- offset?: number;
3872
- /**
3873
- * Update the timestamp immediately
3874
- *
3875
- * @default true
3876
- */
3877
- immediate?: boolean;
3878
- /**
3879
- * Update interval, or use requestAnimationFrame
3880
- *
3881
- * @default requestAnimationFrame
3882
- */
3883
- interval?: 'requestAnimationFrame' | number;
3884
- /**
3885
- * Callback on each update
3886
- */
3887
- callback?: (timestamp: number) => void;
3888
- }
3889
- /**
3890
- * Reactive current timestamp.
3891
- *
3892
- * @see https://vueuse.org/useTimestamp
3893
- * @param options
3894
- */
3895
- declare function useTimestamp(options?: UseTimestampOptions<false>): Ref<number>;
3896
- declare function useTimestamp(options: UseTimestampOptions<true>): {
3897
- timestamp: Ref<number>;
3898
- } & Pausable;
3899
- type UseTimestampReturn = ReturnType<typeof useTimestamp>;
3900
-
3901
- type UseTitleOptionsBase = {
3902
- /**
3903
- * Observe `document.title` changes using MutationObserve
3904
- * Cannot be used together with `titleTemplate` option.
3905
- *
3906
- * @default false
3907
- */
3908
- observe?: boolean;
3909
- } | {
3910
- /**
3911
- * The template string to parse the title (e.g., '%s | My Website')
3912
- * Cannot be used together with `observe` option.
3913
- *
3914
- * @default '%s'
3915
- */
3916
- titleTemplate?: MaybeRef<string> | ((title: string) => string);
3917
- };
3918
- type UseTitleOptions = ConfigurableDocument & UseTitleOptionsBase;
3919
- declare function useTitle(newTitle: MaybeReadonlyRef<string | null | undefined>, options?: UseTitleOptions): ComputedRef<string | null | undefined>;
3920
- declare function useTitle(newTitle?: MaybeRef<string | null | undefined>, options?: UseTitleOptions): Ref<string | null | undefined>;
3921
- type UseTitleReturn = ReturnType<typeof useTitle>;
3922
-
3923
- /**
3924
- * Cubic bezier points
3925
- */
3926
- type CubicBezierPoints = [number, number, number, number];
3927
- /**
3928
- * Easing function
3929
- */
3930
- type EasingFunction = (n: number) => number;
3931
- /**
3932
- * Transition options
3933
- */
3934
- interface UseTransitionOptions {
3935
- /**
3936
- * Milliseconds to wait before starting transition
3937
- */
3938
- delay?: MaybeRef<number>;
3939
- /**
3940
- * Disables the transition
3941
- */
3942
- disabled?: MaybeRef<boolean>;
3943
- /**
3944
- * Transition duration in milliseconds
3945
- */
3946
- duration?: MaybeRef<number>;
3947
- /**
3948
- * Callback to execute after transition finishes
3949
- */
3950
- onFinished?: () => void;
3951
- /**
3952
- * Callback to execute after transition starts
3953
- */
3954
- onStarted?: () => void;
3955
- /**
3956
- * Easing function or cubic bezier points for calculating transition values
3957
- */
3958
- transition?: MaybeRef<EasingFunction | CubicBezierPoints>;
3959
- }
3960
- /**
3961
- * Common transitions
3962
- *
3963
- * @see https://easings.net
3964
- */
3965
- declare const TransitionPresets: Record<"easeInSine" | "easeOutSine" | "easeInOutSine" | "easeInQuad" | "easeOutQuad" | "easeInOutQuad" | "easeInCubic" | "easeOutCubic" | "easeInOutCubic" | "easeInQuart" | "easeOutQuart" | "easeInOutQuart" | "easeInQuint" | "easeOutQuint" | "easeInOutQuint" | "easeInExpo" | "easeOutExpo" | "easeInOutExpo" | "easeInCirc" | "easeOutCirc" | "easeInOutCirc" | "easeInBack" | "easeOutBack" | "easeInOutBack", CubicBezierPoints> & {
3966
- linear: EasingFunction;
3967
- };
3968
- declare function useTransition(source: Ref<number>, options?: UseTransitionOptions): ComputedRef<number>;
3969
- declare function useTransition<T extends MaybeRef<number>[]>(source: [...T], options?: UseTransitionOptions): ComputedRef<{
3970
- [K in keyof T]: number;
3971
- }>;
3972
- declare function useTransition<T extends Ref<number[]>>(source: T, options?: UseTransitionOptions): ComputedRef<number[]>;
3973
-
3974
- type UrlParams = Record<string, string[] | string>;
3975
- interface UseUrlSearchParamsOptions<T> extends ConfigurableWindow {
3976
- /**
3977
- * @default true
3978
- */
3979
- removeNullishValues?: boolean;
3980
- /**
3981
- * @default false
3982
- */
3983
- removeFalsyValues?: boolean;
3984
- /**
3985
- * @default {}
3986
- */
3987
- initialValue?: T;
3988
- /**
3989
- * Write back to `window.history` automatically
3990
- *
3991
- * @default true
3992
- */
3993
- write?: boolean;
3994
- }
3995
- /**
3996
- * Reactive URLSearchParams
3997
- *
3998
- * @see https://vueuse.org/useUrlSearchParams
3999
- * @param mode
4000
- * @param options
4001
- */
4002
- declare function useUrlSearchParams<T extends Record<string, any> = UrlParams>(mode?: 'history' | 'hash' | 'hash-params', options?: UseUrlSearchParamsOptions<T>): T;
4003
-
4004
- interface UseUserMediaOptions extends ConfigurableNavigator {
4005
- /**
4006
- * If the stream is enabled
4007
- * @default false
4008
- */
4009
- enabled?: MaybeRef<boolean>;
4010
- /**
4011
- * Recreate stream when the input devices id changed
4012
- *
4013
- * @default true
4014
- */
4015
- autoSwitch?: MaybeRef<boolean>;
4016
- /**
4017
- * The device id of video input
4018
- *
4019
- * When passing with `undefined` the default device will be used.
4020
- * Pass `false` or "none" to disabled video input
4021
- *
4022
- * @default undefined
4023
- */
4024
- videoDeviceId?: MaybeRef<string | undefined | false | 'none'>;
4025
- /**
4026
- * The device id of audi input
4027
- *
4028
- * When passing with `undefined` the default device will be used.
4029
- * Pass `false` or "none" to disabled audi input
4030
- *
4031
- * @default undefined
4032
- */
4033
- audioDeviceId?: MaybeRef<string | undefined | false | 'none'>;
4034
- }
4035
- /**
4036
- * Reactive `mediaDevices.getUserMedia` streaming
4037
- *
4038
- * @see https://vueuse.org/useUserMedia
4039
- * @param options
4040
- */
4041
- declare function useUserMedia(options?: UseUserMediaOptions): {
4042
- isSupported: Ref<boolean>;
4043
- stream: Ref<MediaStream | undefined>;
4044
- start: () => Promise<MediaStream | undefined>;
4045
- stop: () => void;
4046
- restart: () => Promise<MediaStream | undefined>;
4047
- videoDeviceId: Ref<string | false | undefined>;
4048
- audioDeviceId: Ref<string | false | undefined>;
4049
- enabled: Ref<boolean>;
4050
- autoSwitch: Ref<boolean>;
4051
- };
4052
- type UseUserMediaReturn = ReturnType<typeof useUserMedia>;
4053
-
4054
- interface UseVModelOptions<T> {
4055
- /**
4056
- * When passive is set to `true`, it will use `watch` to sync with props and ref.
4057
- * Instead of relying on the `v-model` or `.sync` to work.
4058
- *
4059
- * @default false
4060
- */
4061
- passive?: boolean;
4062
- /**
4063
- * When eventName is set, it's value will be used to overwrite the emit event name.
4064
- *
4065
- * @default undefined
4066
- */
4067
- eventName?: string;
4068
- /**
4069
- * Attempting to check for changes of properties in a deeply nested object or array.
4070
- * Apply only when `passive` option is set to `true`
4071
- *
4072
- * @default false
4073
- */
4074
- deep?: boolean;
4075
- /**
4076
- * Defining default value for return ref when no value is passed.
4077
- *
4078
- * @default undefined
4079
- */
4080
- defaultValue?: T;
4081
- /**
4082
- * Clone the props.
4083
- * Accepts a custom clone function.
4084
- * When setting to `true`, it will use `JSON.parse(JSON.stringify(value))` to clone.
4085
- *
4086
- * @default false
4087
- */
4088
- clone?: boolean | CloneFn<T>;
4089
- }
4090
- /**
4091
- * Shorthand for v-model binding, props + emit -> ref
4092
- *
4093
- * @see https://vueuse.org/useVModel
4094
- * @param props
4095
- * @param key (default 'value' in Vue 2 and 'modelValue' in Vue 3)
4096
- * @param emit
4097
- */
4098
- declare function useVModel<P extends object, K extends keyof P, Name extends string>(props: P, key?: K, emit?: (name: Name, ...args: any[]) => void, options?: UseVModelOptions<P[K]>): vue_demi.Ref<UnwrapRef<P[K]>> | vue_demi.WritableComputedRef<P[K]>;
4099
-
4100
- /**
4101
- * Shorthand for props v-model binding. Think like `toRefs(props)` but changes will also emit out.
4102
- *
4103
- * @see https://vueuse.org/useVModels
4104
- * @param props
4105
- * @param emit
4106
- */
4107
- declare function useVModels<P extends object, Name extends string>(props: P, emit?: (name: Name, ...args: any[]) => void, options?: UseVModelOptions<any>): ToRefs<P>;
4108
-
4109
- interface UseVibrateOptions extends ConfigurableNavigator {
4110
- /**
4111
- *
4112
- * Vibration Pattern
4113
- *
4114
- * An array of values describes alternating periods in which the
4115
- * device is vibrating and not vibrating. Each value in the array
4116
- * is converted to an integer, then interpreted alternately as
4117
- * the number of milliseconds the device should vibrate and the
4118
- * number of milliseconds it should not be vibrating
4119
- *
4120
- * @default []
4121
- *
4122
- */
4123
- pattern?: MaybeComputedRef<number[] | number>;
4124
- /**
4125
- * Interval to run a persistent vibration, in ms
4126
- *
4127
- * Pass `0` to disable
4128
- *
4129
- * @default 0
4130
- *
4131
- */
4132
- interval?: number;
4133
- }
4134
- /**
4135
- * Reactive vibrate
4136
- *
4137
- * @see https://vueuse.org/useVibrate
4138
- * @see https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API
4139
- * @param options
4140
- */
4141
- declare function useVibrate(options?: UseVibrateOptions): {
4142
- isSupported: vue.Ref<boolean>;
4143
- pattern: MaybeComputedRef<number | number[]>;
4144
- intervalControls: Pausable | undefined;
4145
- vibrate: (pattern?: number | number[]) => void;
4146
- stop: () => void;
4147
- };
4148
- type UseVibrateReturn = ReturnType<typeof useVibrate>;
4149
-
4150
- type UseVirtualListItemSize = number | ((index: number) => number);
4151
- interface UseHorizontalVirtualListOptions extends UseVirtualListOptionsBase {
4152
- /**
4153
- * item width, accept a pixel value or a function that returns the height
4154
- *
4155
- * @default 0
4156
- */
4157
- itemWidth: UseVirtualListItemSize;
4158
- }
4159
- interface UseVerticalVirtualListOptions extends UseVirtualListOptionsBase {
4160
- /**
4161
- * item height, accept a pixel value or a function that returns the height
4162
- *
4163
- * @default 0
4164
- */
4165
- itemHeight: UseVirtualListItemSize;
4166
- }
4167
- interface UseVirtualListOptionsBase {
4168
- /**
4169
- * the extra buffer items outside of the view area
4170
- *
4171
- * @default 5
4172
- */
4173
- overscan?: number;
4174
- }
4175
- type UseVirtualListOptions = UseHorizontalVirtualListOptions | UseVerticalVirtualListOptions;
4176
- interface UseVirtualListItem<T> {
4177
- data: T;
4178
- index: number;
4179
- }
4180
- interface UseVirtualListReturn<T> {
4181
- list: Ref<UseVirtualListItem<T>[]>;
4182
- scrollTo: (index: number) => void;
4183
- containerProps: {
4184
- ref: Ref<HTMLElement | null>;
4185
- onScroll: () => void;
4186
- style: StyleValue;
4187
- };
4188
- wrapperProps: ComputedRef<{
4189
- style: {
4190
- width: string;
4191
- height: string;
4192
- marginTop: string;
4193
- } | {
4194
- width: string;
4195
- height: string;
4196
- marginLeft: string;
4197
- display: string;
4198
- };
4199
- }>;
4200
- }
4201
- /**
4202
- * Please consider using [`vue-virtual-scroller`](https://github.com/Akryum/vue-virtual-scroller) if you are looking for more features.
4203
- */
4204
- declare function useVirtualList<T = any>(list: MaybeRef<T[]>, options: UseVirtualListOptions): UseVirtualListReturn<T>;
4205
-
4206
- type WakeLockType = 'screen';
4207
- interface WakeLockSentinel extends EventTarget {
4208
- type: WakeLockType;
4209
- released: boolean;
4210
- release: () => Promise<void>;
4211
- }
4212
- type UseWakeLockOptions = ConfigurableNavigator & ConfigurableDocument;
4213
- /**
4214
- * Reactive Screen Wake Lock API.
4215
- *
4216
- * @see https://vueuse.org/useWakeLock
4217
- * @param options
4218
- */
4219
- declare const useWakeLock: (options?: UseWakeLockOptions) => {
4220
- isSupported: vue_demi.Ref<boolean>;
4221
- isActive: vue_demi.Ref<boolean>;
4222
- request: (type: WakeLockType) => Promise<void>;
4223
- release: () => Promise<void>;
4224
- };
4225
- type UseWakeLockReturn = ReturnType<typeof useWakeLock>;
4226
-
4227
- interface WebNotificationOptions {
4228
- /**
4229
- * The title read-only property of the Notification interface indicates
4230
- * the title of the notification
4231
- *
4232
- * @default ''
4233
- */
4234
- title?: string;
4235
- /**
4236
- * The body string of the notification as specified in the constructor's
4237
- * options parameter.
4238
- *
4239
- * @default ''
4240
- */
4241
- body?: string;
4242
- /**
4243
- * The text direction of the notification as specified in the constructor's
4244
- * options parameter.
4245
- *
4246
- * @default ''
4247
- */
4248
- dir?: 'auto' | 'ltr' | 'rtl';
4249
- /**
4250
- * The language code of the notification as specified in the constructor's
4251
- * options parameter.
4252
- *
4253
- * @default DOMString
4254
- */
4255
- lang?: string;
4256
- /**
4257
- * The ID of the notification(if any) as specified in the constructor's options
4258
- * parameter.
4259
- *
4260
- * @default ''
4261
- */
4262
- tag?: string;
4263
- /**
4264
- * The URL of the image used as an icon of the notification as specified
4265
- * in the constructor's options parameter.
4266
- *
4267
- * @default ''
4268
- */
4269
- icon?: string;
4270
- /**
4271
- * Specifies whether the user should be notified after a new notification
4272
- * replaces an old one.
4273
- *
4274
- * @default false
4275
- */
4276
- renotify?: boolean;
4277
- /**
4278
- * A boolean value indicating that a notification should remain active until the
4279
- * user clicks or dismisses it, rather than closing automatically.
4280
- *
4281
- * @default false
4282
- */
4283
- requireInteraction?: boolean;
4284
- /**
4285
- * The silent read-only property of the Notification interface specifies
4286
- * whether the notification should be silent, i.e., no sounds or vibrations
4287
- * should be issued, regardless of the device settings.
4288
- *
4289
- * @default false
4290
- */
4291
- silent?: boolean;
4292
- /**
4293
- * Specifies a vibration pattern for devices with vibration hardware to emit.
4294
- * A vibration pattern, as specified in the Vibration API spec
4295
- *
4296
- * @see https://w3c.github.io/vibration/
4297
- */
4298
- vibrate?: number[];
4299
- }
4300
- interface UseWebNotificationOptions extends WebNotificationOptions, ConfigurableWindow {
4301
- }
4302
- /**
4303
- * Reactive useWebNotification
4304
- *
4305
- * @see https://vueuse.org/useWebNotification
4306
- * @see https://developer.mozilla.org/en-US/docs/Web/API/notification
4307
- * @param title
4308
- * @param defaultOptions of type WebNotificationOptions
4309
- * @param methods of type WebNotificationMethods
4310
- */
4311
- declare const useWebNotification: (defaultOptions?: UseWebNotificationOptions) => {
4312
- isSupported: Ref<boolean>;
4313
- notification: Ref<Notification | null>;
4314
- show: (overrides?: WebNotificationOptions) => Promise<Notification | undefined>;
4315
- close: () => void;
4316
- onClick: EventHook<any>;
4317
- onShow: EventHook<any>;
4318
- onError: EventHook<any>;
4319
- onClose: EventHook<any>;
4320
- };
4321
- type UseWebNotificationReturn = ReturnType<typeof useWebNotification>;
4322
-
4323
- type WebSocketStatus = 'OPEN' | 'CONNECTING' | 'CLOSED';
4324
- interface UseWebSocketOptions {
4325
- onConnected?: (ws: WebSocket) => void;
4326
- onDisconnected?: (ws: WebSocket, event: CloseEvent) => void;
4327
- onError?: (ws: WebSocket, event: Event) => void;
4328
- onMessage?: (ws: WebSocket, event: MessageEvent) => void;
4329
- /**
4330
- * Send heartbeat for every x milliseconds passed
4331
- *
4332
- * @default false
4333
- */
4334
- heartbeat?: boolean | {
4335
- /**
4336
- * Message for the heartbeat
4337
- *
4338
- * @default 'ping'
4339
- */
4340
- message?: string | ArrayBuffer | Blob;
4341
- /**
4342
- * Interval, in milliseconds
4343
- *
4344
- * @default 1000
4345
- */
4346
- interval?: number;
4347
- /**
4348
- * Heartbeat response timeout, in milliseconds
4349
- *
4350
- * @default 1000
4351
- */
4352
- pongTimeout?: number;
4353
- };
4354
- /**
4355
- * Enabled auto reconnect
4356
- *
4357
- * @default false
4358
- */
4359
- autoReconnect?: boolean | {
4360
- /**
4361
- * Maximum retry times.
4362
- *
4363
- * Or you can pass a predicate function (which returns true if you want to retry).
4364
- *
4365
- * @default -1
4366
- */
4367
- retries?: number | (() => boolean);
4368
- /**
4369
- * Delay for reconnect, in milliseconds
4370
- *
4371
- * @default 1000
4372
- */
4373
- delay?: number;
4374
- /**
4375
- * On maximum retry times reached.
4376
- */
4377
- onFailed?: Fn;
4378
- };
4379
- /**
4380
- * Automatically open a connection
4381
- *
4382
- * @default true
4383
- */
4384
- immediate?: boolean;
4385
- /**
4386
- * Automatically close a connection
4387
- *
4388
- * @default true
4389
- */
4390
- autoClose?: boolean;
4391
- /**
4392
- * List of one or more sub-protocol strings
4393
- *
4394
- * @default []
4395
- */
4396
- protocols?: string[];
4397
- }
4398
- interface UseWebSocketReturn<T> {
4399
- /**
4400
- * Reference to the latest data received via the websocket,
4401
- * can be watched to respond to incoming messages
4402
- */
4403
- data: Ref<T | null>;
4404
- /**
4405
- * The current websocket status, can be only one of:
4406
- * 'OPEN', 'CONNECTING', 'CLOSED'
4407
- */
4408
- status: Ref<WebSocketStatus>;
4409
- /**
4410
- * Closes the websocket connection gracefully.
4411
- */
4412
- close: WebSocket['close'];
4413
- /**
4414
- * Reopen the websocket connection.
4415
- * If there the current one is active, will close it before opening a new one.
4416
- */
4417
- open: Fn;
4418
- /**
4419
- * Sends data through the websocket connection.
4420
- *
4421
- * @param data
4422
- * @param useBuffer when the socket is not yet open, store the data into the buffer and sent them one connected. Default to true.
4423
- */
4424
- send: (data: string | ArrayBuffer | Blob, useBuffer?: boolean) => boolean;
4425
- /**
4426
- * Reference to the WebSocket instance.
4427
- */
4428
- ws: Ref<WebSocket | undefined>;
4429
- }
4430
- /**
4431
- * Reactive WebSocket client.
4432
- *
4433
- * @see https://vueuse.org/useWebSocket
4434
- * @param url
4435
- */
4436
- declare function useWebSocket<Data = any>(url: MaybeComputedRef<string | URL | undefined>, options?: UseWebSocketOptions): UseWebSocketReturn<Data>;
4437
-
4438
- interface UseWebWorkerReturn<Data = any> {
4439
- data: Ref<Data>;
4440
- post: typeof Worker.prototype['postMessage'];
4441
- terminate: () => void;
4442
- worker: ShallowRef<Worker | undefined>;
4443
- }
4444
- type WorkerFn = (...args: unknown[]) => Worker;
4445
- /**
4446
- * Simple Web Workers registration and communication.
4447
- *
4448
- * @see https://vueuse.org/useWebWorker
4449
- * @param url
4450
- * @param workerOptions
4451
- * @param options
4452
- */
4453
- declare function useWebWorker<T = any>(url: string, workerOptions?: WorkerOptions, options?: ConfigurableWindow): UseWebWorkerReturn<T>;
4454
- /**
4455
- * Simple Web Workers registration and communication.
4456
- *
4457
- * @see https://vueuse.org/useWebWorker
4458
- * @param worker
4459
- */
4460
- declare function useWebWorker<T = any>(worker: Worker | WorkerFn): UseWebWorkerReturn<T>;
4461
-
4462
- type WebWorkerStatus = 'PENDING' | 'SUCCESS' | 'RUNNING' | 'ERROR' | 'TIMEOUT_EXPIRED';
4463
- interface UseWebWorkerOptions extends ConfigurableWindow {
4464
- /**
4465
- * Number of milliseconds before killing the worker
4466
- *
4467
- * @default undefined
4468
- */
4469
- timeout?: number;
4470
- /**
4471
- * An array that contains the external dependencies needed to run the worker
4472
- */
4473
- dependencies?: string[];
4474
- }
4475
- /**
4476
- * Run expensive function without blocking the UI, using a simple syntax that makes use of Promise.
4477
- *
4478
- * @see https://vueuse.org/useWebWorkerFn
4479
- * @param fn
4480
- * @param options
4481
- */
4482
- declare const useWebWorkerFn: <T extends (...fnArgs: any[]) => any>(fn: T, options?: UseWebWorkerOptions) => {
4483
- workerFn: (...fnArgs: Parameters<T>) => Promise<ReturnType<T>>;
4484
- workerStatus: vue_demi.Ref<WebWorkerStatus>;
4485
- workerTerminate: (status?: WebWorkerStatus) => void;
4486
- };
4487
- type UseWebWorkerFnReturn = ReturnType<typeof useWebWorkerFn>;
4488
-
4489
- /**
4490
- * Reactively track window focus with `window.onfocus` and `window.onblur`.
4491
- *
4492
- * @see https://vueuse.org/useWindowFocus
4493
- * @param options
4494
- */
4495
- declare function useWindowFocus({ window }?: ConfigurableWindow): Ref<boolean>;
4496
-
4497
- /**
4498
- * Reactive window scroll.
4499
- *
4500
- * @see https://vueuse.org/useWindowScroll
4501
- * @param options
4502
- */
4503
- declare function useWindowScroll({ window }?: ConfigurableWindow): {
4504
- x: vue_demi.Ref<number>;
4505
- y: vue_demi.Ref<number>;
4506
- };
4507
- type UseWindowScrollReturn = ReturnType<typeof useWindowScroll>;
4508
-
4509
- interface UseWindowSizeOptions extends ConfigurableWindow {
4510
- initialWidth?: number;
4511
- initialHeight?: number;
4512
- /**
4513
- * Listen to window `orientationchange` event
4514
- *
4515
- * @default true
4516
- */
4517
- listenOrientation?: boolean;
4518
- /**
4519
- * Whether the scrollbar should be included in the width and height
4520
- * @default true
4521
- */
4522
- includeScrollbar?: boolean;
4523
- }
4524
- /**
4525
- * Reactive window size.
4526
- *
4527
- * @see https://vueuse.org/useWindowSize
4528
- * @param options
4529
- */
4530
- declare function useWindowSize(options?: UseWindowSizeOptions): {
4531
- width: vue_demi.Ref<number>;
4532
- height: vue_demi.Ref<number>;
4533
- };
4534
- type UseWindowSizeReturn = ReturnType<typeof useWindowSize>;
4535
-
4536
- export { AfterFetchContext, AsyncComputedOnCancel, AsyncComputedOptions, BasicColorSchema, BatteryManager, BeforeFetchContext, Breakpoints, BrowserLocationState, CloneFn, ColorSchemeType, ComputedInjectGetter, ComputedInjectGetterWithDefault, ComputedInjectSetter, ConfigurableDocument, ConfigurableDocumentOrShadowRoot, ConfigurableLocation, ConfigurableNavigator, ConfigurableWindow, ContrastType, CreateFetchOptions, CubicBezierPoints, DefaultMagicKeysAliasMap, DeviceMotionOptions, DocumentEventName, EasingFunction, ElementSize, EventBusEvents, EventBusIdentifier, EventBusKey, EventBusListener, EyeDropper, EyeDropperOpenOptions, FileSystemAccessShowOpenFileOptions, FileSystemAccessShowSaveFileOptions, FileSystemAccessWindow, FileSystemFileHandle, FormatTimeAgoOptions, GeneralEventListener, GeneralPermissionDescriptor, KeyFilter, KeyModifier, KeyPredicate, KeyStrokeEventName, MagicKeysInternal, MaybeComputedElementRef, MaybeElement, MaybeElementRef, MemoryInfo, MouseInElementOptions, MousePressedOptions, MouseSourceType, NavigatorLanguageState, NetworkEffectiveType, NetworkState, NetworkType, OnClickOutsideHandler, OnClickOutsideOptions, OnFetchErrorContext, OnKeyStrokeOptions, OnLongPressModifiers, OnLongPressOptions, PointerType, Position, ReducedMotionType, RenderableComponent, ResizeObserverCallback, ResizeObserverEntry, ResizeObserverSize, SSRHandlersMap, Serializer, SerializerAsync, StorageEventLike, StorageLike, StorageLikeAsync, StorageSerializers, SwipeDirection, TemplateRefsList, ToDataURLOptions, TransitionPresets, UnRefElementReturn, UnrefFn, UrlParams, UseActiveElementOptions, UseAsyncQueueOptions, UseAsyncQueueResult, UseAsyncQueueReturn, UseAsyncQueueTask, UseAsyncStateOptions, UseAsyncStateReturn, UseBase64ObjectOptions, UseBase64Return, UseBatteryReturn, UseBluetoothOptions, UseBluetoothRequestDeviceOptions, UseBluetoothReturn, UseBreakpointsReturn, UseBroadcastChannelOptions, UseBroadcastChannelReturn, UseBrowserLocationReturn, UseClipboardOptions, UseClipboardReturn, UseClonedOptions, UseClonedReturn, UseColorModeOptions, UseConfirmDialogReturn, UseConfirmDialogRevealResult, UseCssVarOptions, UseCycleListOptions, UseCycleListReturn, UseDarkOptions, UseDeviceMotionReturn, UseDeviceOrientationReturn, UseDevicePixelRatioReturn, UseDevicesListOptions, UseDevicesListReturn, UseDisplayMediaOptions, UseDisplayMediaReturn, UseDraggableOptions, UseDraggableReturn, UseDropZoneReturn, UseElementBoundingOptions, UseElementBoundingReturn, UseElementByPointOptions, UseElementByPointReturn, UseElementHoverOptions, UseElementSizeReturn, UseElementVisibilityOptions, UseEventBusReturn, UseEventSourceOptions, UseEventSourceReturn, UseEyeDropperOptions, UseEyeDropperReturn, UseFaviconOptions, UseFaviconReturn, UseFetchOptions, UseFetchReturn, UseFileDialogOptions, UseFileDialogReturn, UseFileSystemAccessCommonOptions, UseFileSystemAccessOptions, UseFileSystemAccessReturn, UseFileSystemAccessShowSaveFileOptions, UseFocusOptions, UseFocusReturn, UseFocusWithinReturn, UseFpsOptions, UseFullscreenOptions, UseFullscreenReturn, UseGamepadOptions, UseGamepadReturn, UseGeolocationOptions, UseGeolocationReturn, UseHorizontalVirtualListOptions, UseIdleOptions, UseIdleReturn, UseImageOptions, UseImageReturn, UseInfiniteScrollOptions, UseIntersectionObserverOptions, UseIntersectionObserverReturn, UseKeyModifierReturn, UseMagicKeysOptions, UseMagicKeysReturn, UseManualRefHistoryOptions, UseManualRefHistoryReturn, UseMediaControlsReturn, UseMediaSource, UseMediaTextTrack, UseMediaTextTrackSource, UseMemoizeCache, UseMemoizeOptions, UseMemoizeReturn, UseMemoryOptions, UseMemoryReturn, UseModifierOptions, UseMouseInElementReturn, UseMouseOptions, UseMousePressedReturn, UseMouseReturn, UseMutationObserverOptions, UseMutationObserverReturn, UseNavigatorLanguageReturn, UseNetworkReturn, UseNowOptions, UseNowReturn, UseOffsetPaginationInfinityPageReturn, UseOffsetPaginationOptions, UseOffsetPaginationReturn, UseParallaxOptions, UseParallaxReturn, UsePermissionOptions, UsePermissionReturn, UsePermissionReturnWithControls, UsePointerLockOptions, UsePointerLockReturn, UsePointerOptions, UsePointerReturn, UsePointerState, UsePointerSwipeOptions, UsePointerSwipeReturn, UseRafFnCallbackArguments, UseRafFnOptions, UseRefHistoryOptions, UseRefHistoryRecord, UseRefHistoryReturn, UseResizeObserverOptions, UseResizeObserverReturn, UseScreenOrientationReturn, UseScriptTagOptions, UseScriptTagReturn, UseScrollOptions, UseScrollReturn, UseShareOptions, UseShareReturn, UseSortedCompareFn, UseSortedFn, UseSortedOptions, UseSpeechRecognitionOptions, UseSpeechRecognitionReturn, UseSpeechSynthesisOptions, UseSpeechSynthesisReturn, UseSpeechSynthesisStatus, UseStepperReturn, UseStorageAsyncOptions, UseStorageOptions, UseStyleTagOptions, UseStyleTagReturn, UseSwipeOptions, UseSwipeReturn, UseTextDirectionOptions, UseTextDirectionValue, UseTextSelectionReturn, UseTextareaAutosizeOptions, UseTextareaAutosizeReturn, UseThrottledRefHistoryOptions, UseThrottledRefHistoryReturn, UseTimeAgoFormatter, UseTimeAgoMessages, UseTimeAgoMessagesBuiltIn, UseTimeAgoOptions, UseTimeAgoReturn, UseTimeAgoUnit, UseTimeAgoUnitNamesDefault, UseTimestampOptions, UseTimestampReturn, UseTitleOptions, UseTitleOptionsBase, UseTitleReturn, UseTransitionOptions, UseUrlSearchParamsOptions, UseUserMediaOptions, UseUserMediaReturn, UseVModelOptions, UseVerticalVirtualListOptions, UseVibrateOptions, UseVibrateReturn, UseVirtualListItem, UseVirtualListOptions, UseVirtualListOptionsBase, UseVirtualListReturn, UseWakeLockOptions, UseWakeLockReturn, UseWebNotificationOptions, UseWebNotificationReturn, UseWebSocketOptions, UseWebSocketReturn, UseWebWorkerFnReturn, UseWebWorkerOptions, UseWebWorkerReturn, UseWindowScrollReturn, UseWindowSizeOptions, UseWindowSizeReturn, VueInstance, WakeLockSentinel, WebNotificationOptions, WebSocketStatus, WebWorkerStatus, WindowEventName, WritableComputedInjectOptions, WritableComputedInjectOptionsWithDefault, computedAsync as asyncComputed, breakpointsAntDesign, breakpointsBootstrapV5, breakpointsMasterCss, breakpointsQuasar, breakpointsSematic, breakpointsTailwind, breakpointsVuetify, cloneFnJSON, computedAsync, computedInject, createFetch, createUnrefFn, customStorageEventName, defaultDocument, defaultLocation, defaultNavigator, defaultWindow, formatTimeAgo, getSSRHandler, mapGamepadToXbox360Controller, onClickOutside, onKeyDown, onKeyPressed, onKeyStroke, onKeyUp, onLongPress, onStartTyping, setSSRHandler, templateRef, unrefElement, useActiveElement, useAsyncQueue, useAsyncState, useBase64, useBattery, useBluetooth, useBreakpoints, useBroadcastChannel, useBrowserLocation, useCached, useClipboard, useCloned, useColorMode, useConfirmDialog, useCssVar, useCurrentElement, useCycleList, useDark, useDebouncedRefHistory, useDeviceMotion, useDeviceOrientation, useDevicePixelRatio, useDevicesList, useDisplayMedia, useDocumentVisibility, useDraggable, useDropZone, useElementBounding, useElementByPoint, useElementHover, useElementSize, useElementVisibility, useEventBus, useEventListener, useEventSource, useEyeDropper, useFavicon, useFetch, useFileDialog, useFileSystemAccess, useFocus, useFocusWithin, useFps, useFullscreen, useGamepad, useGeolocation, useIdle, useImage, useInfiniteScroll, useIntersectionObserver, useKeyModifier, useLocalStorage, useMagicKeys, useManualRefHistory, useMediaControls, useMediaQuery, useMemoize, useMemory, useMounted, useMouse, useMouseInElement, useMousePressed, useMutationObserver, useNavigatorLanguage, useNetwork, useNow, useObjectUrl, useOffsetPagination, useOnline, usePageLeave, useParallax, usePermission, usePointer, usePointerLock, usePointerSwipe, usePreferredColorScheme, usePreferredContrast, usePreferredDark, usePreferredLanguages, usePreferredReducedMotion, usePrevious, useRafFn, useRefHistory, useResizeObserver, useScreenOrientation, useScreenSafeArea, useScriptTag, useScroll, useScrollLock, useSessionStorage, useShare, useSorted, useSpeechRecognition, useSpeechSynthesis, useStepper, useStorage, useStorageAsync, useStyleTag, useSupported, useSwipe, useTemplateRefsList, useTextDirection, useTextSelection, useTextareaAutosize, useThrottledRefHistory, useTimeAgo, useTimeoutPoll, useTimestamp, useTitle, useTransition, useUrlSearchParams, useUserMedia, useVModel, useVModels, useVibrate, useVirtualList, useWakeLock, useWebNotification, useWebSocket, useWebWorker, useWebWorkerFn, useWindowFocus, useWindowScroll, useWindowSize };