智慧水务管理系统 - 精河县供水工程综合管理平台

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