@histoire/vendors 0.8.4 → 0.9.0

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