@histoire/vendors 0.8.4 → 0.9.2

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} +13 -18
  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 +46 -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 +375 -0
  139. package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +367 -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 +415 -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 +14 -5
  227. package/pinia.d.ts +3 -0
  228. package/rollup.config.mjs +117 -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,1491 @@
1
+ import { AllowedComponentProps } from 'vue';
2
+ import { App } from 'vue';
3
+ import { Component } from 'vue';
4
+ import { ComponentCustomProps } from 'vue';
5
+ import { ComponentPublicInstance } from 'vue';
6
+ import { ComputedRef } from 'vue';
7
+ import { DefineComponent } from 'vue';
8
+ import type { InjectionKey } from 'vue';
9
+ import { Ref } from 'vue';
10
+ import { UnwrapRef } from 'vue';
11
+ import { VNode } from 'vue';
12
+ import { VNodeProps } from 'vue';
13
+
14
+ declare type Awaitable<T> = T | Promise<T>;
15
+
16
+ /**
17
+ * Creates a in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere.
18
+ * It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.
19
+ *
20
+ * @param base - Base applied to all urls, defaults to '/'
21
+ * @returns a history object that can be passed to the router constructor
22
+ */
23
+ export declare function createMemoryHistory(base?: string): RouterHistory;
24
+
25
+ /**
26
+ * Creates a Router instance that can be used by a Vue app.
27
+ *
28
+ * @param options - {@link RouterOptions}
29
+ */
30
+ export declare function createRouter(options: RouterOptions): Router;
31
+
32
+ /**
33
+ * Creates a Router Matcher.
34
+ *
35
+ * @internal
36
+ * @param routes - array of initial routes
37
+ * @param globalOptions - global route options
38
+ */
39
+ export declare function createRouterMatcher(routes: Readonly<RouteRecordRaw[]>, globalOptions: PathParserOptions): RouterMatcher;
40
+
41
+ /**
42
+ * Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
43
+ * handle any URL is not possible.
44
+ *
45
+ * @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
46
+ * in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
47
+ * calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
48
+ * after the `#`).
49
+ *
50
+ * @example
51
+ * ```js
52
+ * // at https://example.com/folder
53
+ * createWebHashHistory() // gives a url of `https://example.com/folder#`
54
+ * createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
55
+ * // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
56
+ * createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
57
+ * // you should avoid doing this because it changes the original url and breaks copying urls
58
+ * createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
59
+ *
60
+ * // at file:///usr/etc/folder/index.html
61
+ * // for locations with no `host`, the base is ignored
62
+ * createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
63
+ * ```
64
+ */
65
+ export declare function createWebHashHistory(base?: string): RouterHistory;
66
+
67
+ /**
68
+ * Creates an HTML5 history. Most common history for single page applications.
69
+ *
70
+ * @param base -
71
+ */
72
+ export declare function createWebHistory(base?: string): RouterHistory;
73
+
74
+ /**
75
+ * Internal type to define an ErrorHandler
76
+ *
77
+ * @param error - error thrown
78
+ * @param to - location we were navigating to when the error happened
79
+ * @param from - location we were navigating from when the error happened
80
+ * @internal
81
+ */
82
+ declare type _ErrorHandler = (error: any, to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded) => any;
83
+
84
+ /**
85
+ * Flags so we can combine them when checking for multiple errors. This is the internal version of
86
+ * {@link NavigationFailureType}.
87
+ *
88
+ * @internal
89
+ */
90
+ export declare const enum ErrorTypes {
91
+ MATCHER_NOT_FOUND = 1,
92
+ NAVIGATION_GUARD_REDIRECT = 2,
93
+ NAVIGATION_ABORTED = 4,
94
+ NAVIGATION_CANCELLED = 8,
95
+ NAVIGATION_DUPLICATED = 16
96
+ }
97
+
98
+ declare type HistoryLocation = string;
99
+
100
+ /**
101
+ * Allowed HTML history.state
102
+ */
103
+ export declare interface HistoryState {
104
+ [x: number]: HistoryStateValue;
105
+ [x: string]: HistoryStateValue;
106
+ }
107
+
108
+ /**
109
+ * Allowed arrays for history.state.
110
+ *
111
+ * @internal
112
+ */
113
+ declare interface HistoryStateArray extends Array<HistoryStateValue> {
114
+ }
115
+
116
+ /**
117
+ * Allowed variables in HTML5 history state. Note that pushState clones the state
118
+ * passed and does not accept everything: e.g it doesn't accept symbols, nor
119
+ * functions as values. It also ignores Symbols as keys.
120
+ *
121
+ * @internal
122
+ */
123
+ declare type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;
124
+
125
+ /**
126
+ * Check if an object is a {@link NavigationFailure}.
127
+ *
128
+ * @example
129
+ * ```js
130
+ * import { isNavigationFailure, NavigationFailureType } from 'vue-router'
131
+ *
132
+ * router.afterEach((to, from, failure) => {
133
+ * // Any kind of navigation failure
134
+ * if (isNavigationFailure(failure)) {
135
+ * // ...
136
+ * }
137
+ * // Only duplicated navigations
138
+ * if (isNavigationFailure(failure, NavigationFailureType.duplicated)) {
139
+ * // ...
140
+ * }
141
+ * // Aborted or canceled navigations
142
+ * if (isNavigationFailure(failure, NavigationFailureType.aborted | NavigationFailureType.canceled)) {
143
+ * // ...
144
+ * }
145
+ * })
146
+ * ```
147
+ * @param error - possible {@link NavigationFailure}
148
+ * @param type - optional types to check for
149
+ */
150
+ export declare function isNavigationFailure(error: any, type?: ErrorTypes.NAVIGATION_GUARD_REDIRECT): error is NavigationRedirectError;
151
+
152
+ export declare function isNavigationFailure(error: any, type?: ErrorTypes | NavigationFailureType): error is NavigationFailure;
153
+
154
+ declare type Lazy<T> = () => Promise<T>;
155
+
156
+ /**
157
+ * Ensures a route is loaded so it can be passed as o prop to `<RouterView>`.
158
+ *
159
+ * @param route - resolved route to load
160
+ */
161
+ export declare function loadRouteLocation(route: RouteLocationNormalized): Promise<RouteLocationNormalizedLoaded>;
162
+
163
+ /**
164
+ * @internal
165
+ */
166
+ export declare interface LocationAsRelativeRaw {
167
+ name?: RouteRecordName;
168
+ params?: RouteParamsRaw;
169
+ }
170
+
171
+ /**
172
+ * Normalized query object that appears in {@link RouteLocationNormalized}
173
+ *
174
+ * @public
175
+ */
176
+ export declare type LocationQuery = Record<string, LocationQueryValue | LocationQueryValue[]>;
177
+
178
+ /**
179
+ * Loose {@link LocationQuery} object that can be passed to functions like
180
+ * {@link Router.push} and {@link Router.replace} or anywhere when creating a
181
+ * {@link RouteLocationRaw}
182
+ *
183
+ * @public
184
+ */
185
+ export declare type LocationQueryRaw = Record<string | number, LocationQueryValueRaw | LocationQueryValueRaw[]>;
186
+
187
+ /**
188
+ * Possible values in normalized {@link LocationQuery}. `null` renders the query
189
+ * param but without an `=`.
190
+ *
191
+ * @example
192
+ * ```
193
+ * ?isNull&isEmpty=&other=other
194
+ * gives
195
+ * `{ isNull: null, isEmpty: '', other: 'other' }`.
196
+ * ```
197
+ *
198
+ * @internal
199
+ */
200
+ export declare type LocationQueryValue = string | null;
201
+
202
+ /**
203
+ * Possible values when defining a query.
204
+ *
205
+ * @internal
206
+ */
207
+ export declare type LocationQueryValueRaw = LocationQueryValue | number | undefined;
208
+
209
+ /**
210
+ * RouteRecord being rendered by the closest ancestor Router View. Used for
211
+ * `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
212
+ * Location Matched
213
+ *
214
+ * @internal
215
+ */
216
+ export declare const matchedRouteKey: InjectionKey<ComputedRef<RouteRecordNormalized | undefined>>;
217
+
218
+ /**
219
+ * Normalized/resolved Route location that returned by the matcher.
220
+ */
221
+ declare interface MatcherLocation {
222
+ /**
223
+ * Name of the matched record
224
+ */
225
+ name: RouteRecordName | null | undefined;
226
+ /**
227
+ * Percentage encoded pathname section of the URL.
228
+ */
229
+ path: string;
230
+ /**
231
+ * Object of decoded params extracted from the `path`.
232
+ */
233
+ params: RouteParams;
234
+ /**
235
+ * Merged `meta` properties from all of the matched route records.
236
+ */
237
+ meta: RouteMeta;
238
+ /**
239
+ * Array of {@link RouteRecord} containing components as they were
240
+ * passed when adding records. It can also contain redirect records. This
241
+ * can't be used directly
242
+ */
243
+ matched: RouteRecord[];
244
+ }
245
+
246
+ /**
247
+ * @internal
248
+ */
249
+ declare interface MatcherLocationAsName {
250
+ name: RouteRecordName;
251
+ params?: RouteParams;
252
+ }
253
+
254
+ /**
255
+ * @internal
256
+ */
257
+ export declare interface MatcherLocationAsPath<P extends string = string> {
258
+ path: P;
259
+ }
260
+
261
+ /**
262
+ * @internal
263
+ */
264
+ declare interface MatcherLocationAsRelative {
265
+ params?: RouteParams;
266
+ }
267
+
268
+ /**
269
+ * Route location that can be passed to the matcher.
270
+ */
271
+ declare type MatcherLocationRaw = MatcherLocationAsPath | MatcherLocationAsName | MatcherLocationAsRelative;
272
+
273
+ declare interface NavigationCallback {
274
+ (to: HistoryLocation, from: HistoryLocation, information: NavigationInformation): void;
275
+ }
276
+
277
+ declare enum NavigationDirection {
278
+ back = "back",
279
+ forward = "forward",
280
+ unknown = ""
281
+ }
282
+
283
+ /**
284
+ * Extended Error that contains extra information regarding a failed navigation.
285
+ */
286
+ export declare interface NavigationFailure extends Error {
287
+ /**
288
+ * Type of the navigation. One of {@link NavigationFailureType}
289
+ */
290
+ type: ErrorTypes.NAVIGATION_CANCELLED | ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED;
291
+ /**
292
+ * Route location we were navigating from
293
+ */
294
+ from: RouteLocationNormalized;
295
+ /**
296
+ * Route location we were navigating to
297
+ */
298
+ to: RouteLocationNormalized;
299
+ }
300
+
301
+ /**
302
+ * Enumeration with all possible types for navigation failures. Can be passed to
303
+ * {@link isNavigationFailure} to check for specific failures.
304
+ */
305
+ export declare enum NavigationFailureType {
306
+ /**
307
+ * An aborted navigation is a navigation that failed because a navigation
308
+ * guard returned `false` or called `next(false)`
309
+ */
310
+ aborted = 4,
311
+ /**
312
+ * A cancelled navigation is a navigation that failed because a more recent
313
+ * navigation finished started (not necessarily finished).
314
+ */
315
+ cancelled = 8,
316
+ /**
317
+ * A duplicated navigation is a navigation that failed because it was
318
+ * initiated while already being at the exact same location.
319
+ */
320
+ duplicated = 16
321
+ }
322
+
323
+ /**
324
+ * Navigation guard. See [Navigation
325
+ * Guards](/guide/advanced/navigation-guards.md).
326
+ */
327
+ export declare interface NavigationGuard {
328
+ (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext): NavigationGuardReturn | Promise<NavigationGuardReturn>;
329
+ }
330
+
331
+ export declare interface NavigationGuardNext {
332
+ (): void;
333
+ (error: Error): void;
334
+ (location: RouteLocationRaw): void;
335
+ (valid: boolean | undefined): void;
336
+ (cb: NavigationGuardNextCallback): void;
337
+ }
338
+
339
+ declare type NavigationGuardNextCallback = (vm: ComponentPublicInstance) => any;
340
+
341
+ declare type NavigationGuardReturn = void | Error | RouteLocationRaw | boolean | NavigationGuardNextCallback;
342
+
343
+ /**
344
+ * {@inheritDoc NavigationGuard}
345
+ */
346
+ export declare interface NavigationGuardWithThis<T> {
347
+ (this: T, to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext): NavigationGuardReturn | Promise<NavigationGuardReturn>;
348
+ }
349
+
350
+ export declare interface NavigationHookAfter {
351
+ (to: RouteLocationNormalized, from: RouteLocationNormalized, failure?: NavigationFailure | void): any;
352
+ }
353
+
354
+ declare interface NavigationInformation {
355
+ type: NavigationType_2;
356
+ direction: NavigationDirection;
357
+ delta: number;
358
+ }
359
+
360
+ /**
361
+ * Internal error used to detect a redirection.
362
+ *
363
+ * @internal
364
+ */
365
+ export declare interface NavigationRedirectError extends Omit<NavigationFailure, 'to' | 'type'> {
366
+ type: ErrorTypes.NAVIGATION_GUARD_REDIRECT;
367
+ to: RouteLocationRaw;
368
+ }
369
+
370
+ declare enum NavigationType_2 {
371
+ pop = "pop",
372
+ push = "push"
373
+ }
374
+
375
+ /**
376
+ * Add a navigation guard that triggers whenever the component for the current
377
+ * location is about to be left. Similar to {@link beforeRouteLeave} but can be
378
+ * used in any component. The guard is removed when the component is unmounted.
379
+ *
380
+ * @param leaveGuard - {@link NavigationGuard}
381
+ */
382
+ export declare function onBeforeRouteLeave(leaveGuard: NavigationGuard): void;
383
+
384
+ /**
385
+ * Add a navigation guard that triggers whenever the current location is about
386
+ * to be updated. Similar to {@link beforeRouteUpdate} but can be used in any
387
+ * component. The guard is removed when the component is unmounted.
388
+ *
389
+ * @param updateGuard - {@link NavigationGuard}
390
+ */
391
+ export declare function onBeforeRouteUpdate(updateGuard: NavigationGuard): void;
392
+
393
+ /**
394
+ * Transforms a queryString into a {@link LocationQuery} object. Accept both, a
395
+ * version with the leading `?` and without Should work as URLSearchParams
396
+
397
+ * @internal
398
+ *
399
+ * @param search - search string to parse
400
+ * @returns a query object
401
+ */
402
+ export declare function parseQuery(search: string): LocationQuery;
403
+
404
+ declare type PathParams = Record<string, string | string[]>;
405
+
406
+ declare interface PathParser {
407
+ /**
408
+ * The regexp used to match a url
409
+ */
410
+ re: RegExp;
411
+ /**
412
+ * The score of the parser
413
+ */
414
+ score: Array<number[]>;
415
+ /**
416
+ * Keys that appeared in the path
417
+ */
418
+ keys: PathParserParamKey[];
419
+ /**
420
+ * Parses a url and returns the matched params or nul if it doesn't match. An
421
+ * optional param that isn't preset will be an empty string. A repeatable
422
+ * param will be an array if there is at least one value.
423
+ *
424
+ * @param path - url to parse
425
+ * @returns a Params object, empty if there are no params. `null` if there is
426
+ * no match
427
+ */
428
+ parse(path: string): PathParams | null;
429
+ /**
430
+ * Creates a string version of the url
431
+ *
432
+ * @param params - object of params
433
+ * @returns a url
434
+ */
435
+ stringify(params: PathParams): string;
436
+ }
437
+
438
+ export declare type PathParserOptions = Pick<_PathParserOptions, 'end' | 'sensitive' | 'strict'>;
439
+
440
+ /**
441
+ * @internal
442
+ */
443
+ export declare interface _PathParserOptions {
444
+ /**
445
+ * Makes the RegExp case sensitive. Defaults to false
446
+ */
447
+ sensitive?: boolean;
448
+ /**
449
+ * Should we disallow a trailing slash. Defaults to false
450
+ */
451
+ strict?: boolean;
452
+ /**
453
+ * Should the RegExp match from the beginning by prepending a `^` to it. Defaults to true
454
+ * @internal
455
+ */
456
+ start?: boolean;
457
+ /**
458
+ * Should the RegExp match until the end by appending a `$` to it. Defaults to true
459
+ */
460
+ end?: boolean;
461
+ }
462
+
463
+ /**
464
+ * A param in a url like `/users/:id`
465
+ */
466
+ declare interface PathParserParamKey {
467
+ name: string;
468
+ repeatable: boolean;
469
+ optional: boolean;
470
+ }
471
+
472
+ /**
473
+ * Allowed Component definitions in route records provided by the user
474
+ */
475
+ declare type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
476
+
477
+ /**
478
+ * Allowed Component in {@link RouteLocationMatched}
479
+ */
480
+ export declare type RouteComponent = Component | DefineComponent;
481
+
482
+ /**
483
+ * {@link RouteLocationRaw} resolved using the matcher
484
+ */
485
+ export declare interface RouteLocation extends _RouteLocationBase {
486
+ /**
487
+ * Array of {@link RouteRecord} containing components as they were
488
+ * passed when adding records. It can also contain redirect records. This
489
+ * can't be used directly
490
+ */
491
+ matched: RouteRecord[];
492
+ }
493
+
494
+ /**
495
+ * Base properties for a normalized route location.
496
+ *
497
+ * @internal
498
+ */
499
+ export declare interface _RouteLocationBase extends Pick<MatcherLocation, 'name' | 'path' | 'params' | 'meta'> {
500
+ /**
501
+ * The whole location including the `search` and `hash`. This string is
502
+ * percentage encoded.
503
+ */
504
+ fullPath: string;
505
+ /**
506
+ * Object representation of the `search` property of the current location.
507
+ */
508
+ query: LocationQuery;
509
+ /**
510
+ * Hash of the current location. If present, starts with a `#`.
511
+ */
512
+ hash: string;
513
+ /**
514
+ * Contains the location we were initially trying to access before ending up
515
+ * on the current location.
516
+ */
517
+ redirectedFrom: RouteLocation | undefined;
518
+ }
519
+
520
+ /**
521
+ * Allows overriding the current route returned by `useRoute` in tests. rl
522
+ * stands for route location
523
+ *
524
+ * @internal
525
+ */
526
+ export declare const routeLocationKey: InjectionKey<RouteLocationNormalizedLoaded>;
527
+
528
+ export declare interface RouteLocationMatched extends RouteRecordNormalized {
529
+ components: Record<string, RouteComponent> | null | undefined;
530
+ }
531
+
532
+ /**
533
+ * Route Location that can infer the necessary params based on the name.
534
+ *
535
+ * @internal
536
+ */
537
+ export declare interface RouteLocationNamedRaw extends RouteQueryAndHash, LocationAsRelativeRaw, RouteLocationOptions {
538
+ }
539
+
540
+ /**
541
+ * Similar to {@link RouteLocation} but its
542
+ * {@link RouteLocationNormalized.matched} cannot contain redirect records
543
+ */
544
+ export declare interface RouteLocationNormalized extends _RouteLocationBase {
545
+ /**
546
+ * Array of {@link RouteRecordNormalized}
547
+ */
548
+ matched: RouteRecordNormalized[];
549
+ }
550
+
551
+ /**
552
+ * {@link RouteLocationRaw} with
553
+ */
554
+ export declare interface RouteLocationNormalizedLoaded extends _RouteLocationBase {
555
+ /**
556
+ * Array of {@link RouteLocationMatched} containing only plain components (any
557
+ * lazy-loaded components have been loaded and were replaced inside of the
558
+ * `components` object) so it can be directly used to display routes. It
559
+ * cannot contain redirect records either
560
+ */
561
+ matched: RouteLocationMatched[];
562
+ }
563
+
564
+ /**
565
+ * Common options for all navigation methods.
566
+ */
567
+ export declare interface RouteLocationOptions {
568
+ /**
569
+ * Replace the entry in the history instead of pushing a new entry
570
+ */
571
+ replace?: boolean;
572
+ /**
573
+ * Triggers the navigation even if the location is the same as the current one.
574
+ * Note this will also add a new entry to the history unless `replace: true`
575
+ * is passed.
576
+ */
577
+ force?: boolean;
578
+ /**
579
+ * State to save using the History API. This cannot contain any reactive
580
+ * values and some primitives like Symbols are forbidden. More info at
581
+ * https://developer.mozilla.org/en-US/docs/Web/API/History/state
582
+ */
583
+ state?: HistoryState;
584
+ }
585
+
586
+ /**
587
+ * Route Location that can infer the possible paths.
588
+ *
589
+ * @internal
590
+ */
591
+ export declare interface RouteLocationPathRaw extends RouteQueryAndHash, MatcherLocationAsPath, RouteLocationOptions {
592
+ }
593
+
594
+ /**
595
+ * User-level route location
596
+ */
597
+ export declare type RouteLocationRaw = string | RouteLocationPathRaw | RouteLocationNamedRaw;
598
+
599
+ /**
600
+ * Interface to type `meta` fields in route records.
601
+ *
602
+ * @example
603
+ *
604
+ * ```ts
605
+ * // typings.d.ts or router.ts
606
+ * import 'vue-router';
607
+ *
608
+ * declare module 'vue-router' {
609
+ * interface RouteMeta {
610
+ * requiresAuth?: boolean
611
+ * }
612
+ * }
613
+ * ```
614
+ */
615
+ export declare interface RouteMeta extends Record<string | number | symbol, unknown> {
616
+ }
617
+
618
+ export declare type RouteParams = Record<string, RouteParamValue | RouteParamValue[]>;
619
+
620
+ export declare type RouteParamsRaw = Record<string, RouteParamValueRaw | Exclude<RouteParamValueRaw, null | undefined>[]>;
621
+
622
+ /**
623
+ * @internal
624
+ */
625
+ export declare type RouteParamValue = string;
626
+
627
+ /**
628
+ * @internal
629
+ */
630
+ export declare type RouteParamValueRaw = RouteParamValue | number | null | undefined;
631
+
632
+ /**
633
+ * @internal
634
+ */
635
+ export declare interface RouteQueryAndHash {
636
+ query?: LocationQueryRaw;
637
+ hash?: string;
638
+ }
639
+
640
+ /**
641
+ * Router instance.
642
+ */
643
+ export declare interface Router {
644
+ /**
645
+ * @internal
646
+ */
647
+ /**
648
+ * Current {@link RouteLocationNormalized}
649
+ */
650
+ readonly currentRoute: Ref<RouteLocationNormalizedLoaded>;
651
+ /**
652
+ * Original options object passed to create the Router
653
+ */
654
+ readonly options: RouterOptions;
655
+ /**
656
+ * Allows turning off the listening of history events. This is a low level api for micro-frontends.
657
+ */
658
+ listening: boolean;
659
+ /**
660
+ * Add a new {@link RouteRecordRaw | route record} as the child of an existing route.
661
+ *
662
+ * @param parentName - Parent Route Record where `route` should be appended at
663
+ * @param route - Route Record to add
664
+ */
665
+ addRoute(parentName: RouteRecordName, route: RouteRecordRaw): () => void;
666
+ /**
667
+ * Add a new {@link RouteRecordRaw | route record} to the router.
668
+ *
669
+ * @param route - Route Record to add
670
+ */
671
+ addRoute(route: RouteRecordRaw): () => void;
672
+ /**
673
+ * Remove an existing route by its name.
674
+ *
675
+ * @param name - Name of the route to remove
676
+ */
677
+ removeRoute(name: RouteRecordName): void;
678
+ /**
679
+ * Checks if a route with a given name exists
680
+ *
681
+ * @param name - Name of the route to check
682
+ */
683
+ hasRoute(name: RouteRecordName): boolean;
684
+ /**
685
+ * Get a full list of all the {@link RouteRecord | route records}.
686
+ */
687
+ getRoutes(): RouteRecord[];
688
+ /**
689
+ * Returns the {@link RouteLocation | normalized version} of a
690
+ * {@link RouteLocationRaw | route location}. Also includes an `href` property
691
+ * that includes any existing `base`. By default the `currentLocation` used is
692
+ * `route.currentRoute` and should only be overridden in advanced use cases.
693
+ *
694
+ * @param to - Raw route location to resolve
695
+ * @param currentLocation - Optional current location to resolve against
696
+ */
697
+ resolve(to: RouteLocationRaw, currentLocation?: RouteLocationNormalizedLoaded): RouteLocation & {
698
+ href: string;
699
+ };
700
+ /**
701
+ * Programmatically navigate to a new URL by pushing an entry in the history
702
+ * stack.
703
+ *
704
+ * @param to - Route location to navigate to
705
+ */
706
+ push(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
707
+ /**
708
+ * Programmatically navigate to a new URL by replacing the current entry in
709
+ * the history stack.
710
+ *
711
+ * @param to - Route location to navigate to
712
+ */
713
+ replace(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
714
+ /**
715
+ * Go back in history if possible by calling `history.back()`. Equivalent to
716
+ * `router.go(-1)`.
717
+ */
718
+ back(): ReturnType<Router['go']>;
719
+ /**
720
+ * Go forward in history if possible by calling `history.forward()`.
721
+ * Equivalent to `router.go(1)`.
722
+ */
723
+ forward(): ReturnType<Router['go']>;
724
+ /**
725
+ * Allows you to move forward or backward through the history. Calls
726
+ * `history.go()`.
727
+ *
728
+ * @param delta - The position in the history to which you want to move,
729
+ * relative to the current page
730
+ */
731
+ go(delta: number): void;
732
+ /**
733
+ * Add a navigation guard that executes before any navigation. Returns a
734
+ * function that removes the registered guard.
735
+ *
736
+ * @param guard - navigation guard to add
737
+ */
738
+ beforeEach(guard: NavigationGuardWithThis<undefined>): () => void;
739
+ /**
740
+ * Add a navigation guard that executes before navigation is about to be
741
+ * resolved. At this state all component have been fetched and other
742
+ * navigation guards have been successful. Returns a function that removes the
743
+ * registered guard.
744
+ *
745
+ * @example
746
+ * ```js
747
+ * router.beforeResolve(to => {
748
+ * if (to.meta.requiresAuth && !isAuthenticated) return false
749
+ * })
750
+ * ```
751
+ *
752
+ * @param guard - navigation guard to add
753
+ */
754
+ beforeResolve(guard: NavigationGuardWithThis<undefined>): () => void;
755
+ /**
756
+ * Add a navigation hook that is executed after every navigation. Returns a
757
+ * function that removes the registered hook.
758
+ *
759
+ * @example
760
+ * ```js
761
+ * router.afterEach((to, from, failure) => {
762
+ * if (isNavigationFailure(failure)) {
763
+ * console.log('failed navigation', failure)
764
+ * }
765
+ * })
766
+ * ```
767
+ *
768
+ * @param guard - navigation hook to add
769
+ */
770
+ afterEach(guard: NavigationHookAfter): () => void;
771
+ /**
772
+ * Adds an error handler that is called every time a non caught error happens
773
+ * during navigation. This includes errors thrown synchronously and
774
+ * asynchronously, errors returned or passed to `next` in any navigation
775
+ * guard, and errors occurred when trying to resolve an async component that
776
+ * is required to render a route.
777
+ *
778
+ * @param handler - error handler to register
779
+ */
780
+ onError(handler: _ErrorHandler): () => void;
781
+ /**
782
+ * Returns a Promise that resolves when the router has completed the initial
783
+ * navigation, which means it has resolved all async enter hooks and async
784
+ * components that are associated with the initial route. If the initial
785
+ * navigation already happened, the promise resolves immediately.
786
+ *
787
+ * This is useful in server-side rendering to ensure consistent output on both
788
+ * the server and the client. Note that on server side, you need to manually
789
+ * push the initial location while on client side, the router automatically
790
+ * picks it up from the URL.
791
+ */
792
+ isReady(): Promise<void>;
793
+ /**
794
+ * Called automatically by `app.use(router)`. Should not be called manually by
795
+ * the user. This will trigger the initial navigation when on client side.
796
+ *
797
+ * @internal
798
+ * @param app - Application that uses the router
799
+ */
800
+ install(app: App): void;
801
+ }
802
+
803
+ /**
804
+ * {@inheritDoc RouteRecordNormalized}
805
+ */
806
+ export declare type RouteRecord = RouteRecordNormalized;
807
+
808
+ /**
809
+ * Common properties among all kind of {@link RouteRecordRaw}
810
+ * @internal
811
+ */
812
+ export declare interface _RouteRecordBase extends PathParserOptions {
813
+ /**
814
+ * Path of the record. Should start with `/` unless the record is the child of
815
+ * another record.
816
+ *
817
+ * @example `/users/:id` matches `/users/1` as well as `/users/posva`.
818
+ */
819
+ path: string;
820
+ /**
821
+ * Where to redirect if the route is directly matched. The redirection happens
822
+ * before any navigation guard and triggers a new navigation with the new
823
+ * target location.
824
+ */
825
+ redirect?: RouteRecordRedirectOption;
826
+ /**
827
+ * Aliases for the record. Allows defining extra paths that will behave like a
828
+ * copy of the record. Allows having paths shorthands like `/users/:id` and
829
+ * `/u/:id`. All `alias` and `path` values must share the same params.
830
+ */
831
+ alias?: string | string[];
832
+ /**
833
+ * Name for the route record.
834
+ */
835
+ name?: RouteRecordName;
836
+ /**
837
+ * Before Enter guard specific to this record. Note `beforeEnter` has no
838
+ * effect if the record has a `redirect` property.
839
+ */
840
+ beforeEnter?: NavigationGuardWithThis<undefined> | NavigationGuardWithThis<undefined>[];
841
+ /**
842
+ * Arbitrary data attached to the record.
843
+ */
844
+ meta?: RouteMeta;
845
+ /**
846
+ * Array of nested routes.
847
+ */
848
+ children?: RouteRecordRaw[];
849
+ /**
850
+ * Allow passing down params as props to the component rendered by `router-view`.
851
+ */
852
+ props?: _RouteRecordProps | Record<string, _RouteRecordProps>;
853
+ }
854
+
855
+ declare interface RouteRecordMatcher extends PathParser {
856
+ record: RouteRecord;
857
+ parent: RouteRecordMatcher | undefined;
858
+ children: RouteRecordMatcher[];
859
+ alias: RouteRecordMatcher[];
860
+ }
861
+
862
+ /**
863
+ * Route Record defining multiple named components with the `components` option.
864
+ */
865
+ declare interface RouteRecordMultipleViews extends _RouteRecordBase {
866
+ /**
867
+ * Components to display when the URL matches this route. Allow using named views.
868
+ */
869
+ components: Record<string, RawRouteComponent>;
870
+ component?: never;
871
+ children?: never;
872
+ redirect?: never;
873
+ /**
874
+ * Allow passing down params as props to the component rendered by
875
+ * `router-view`. Should be an object with the same keys as `components` or a
876
+ * boolean to be applied to every component.
877
+ */
878
+ props?: Record<string, _RouteRecordProps> | boolean;
879
+ }
880
+
881
+ /**
882
+ * Route Record defining multiple named components with the `components` option and children.
883
+ */
884
+ declare interface RouteRecordMultipleViewsWithChildren extends _RouteRecordBase {
885
+ /**
886
+ * Components to display when the URL matches this route. Allow using named views.
887
+ */
888
+ components?: Record<string, RawRouteComponent> | null | undefined;
889
+ component?: never;
890
+ children: RouteRecordRaw[];
891
+ /**
892
+ * Allow passing down params as props to the component rendered by
893
+ * `router-view`. Should be an object with the same keys as `components` or a
894
+ * boolean to be applied to every component.
895
+ */
896
+ props?: Record<string, _RouteRecordProps> | boolean;
897
+ }
898
+
899
+ /**
900
+ * Possible values for a user-defined route record's name
901
+ */
902
+ export declare type RouteRecordName = string | symbol;
903
+
904
+ /**
905
+ * Normalized version of a {@link RouteRecord | route record}.
906
+ */
907
+ export declare interface RouteRecordNormalized {
908
+ /**
909
+ * {@inheritDoc _RouteRecordBase.path}
910
+ */
911
+ path: _RouteRecordBase['path'];
912
+ /**
913
+ * {@inheritDoc _RouteRecordBase.redirect}
914
+ */
915
+ redirect: _RouteRecordBase['redirect'] | undefined;
916
+ /**
917
+ * {@inheritDoc _RouteRecordBase.name}
918
+ */
919
+ name: _RouteRecordBase['name'];
920
+ /**
921
+ * {@inheritDoc RouteRecordMultipleViews.components}
922
+ */
923
+ components: RouteRecordMultipleViews['components'] | null | undefined;
924
+ /**
925
+ * Nested route records.
926
+ */
927
+ children: RouteRecordRaw[];
928
+ /**
929
+ * {@inheritDoc _RouteRecordBase.meta}
930
+ */
931
+ meta: Exclude<_RouteRecordBase['meta'], void>;
932
+ /**
933
+ * {@inheritDoc RouteRecordMultipleViews.props}
934
+ */
935
+ props: Record<string, _RouteRecordProps>;
936
+ /**
937
+ * Registered beforeEnter guards
938
+ */
939
+ beforeEnter: _RouteRecordBase['beforeEnter'];
940
+ /**
941
+ * Registered leave guards
942
+ *
943
+ * @internal
944
+ */
945
+ leaveGuards: Set<NavigationGuard>;
946
+ /**
947
+ * Registered update guards
948
+ *
949
+ * @internal
950
+ */
951
+ updateGuards: Set<NavigationGuard>;
952
+ /**
953
+ * Registered beforeRouteEnter callbacks passed to `next` or returned in guards
954
+ *
955
+ * @internal
956
+ */
957
+ enterCallbacks: Record<string, NavigationGuardNextCallback[]>;
958
+ /**
959
+ * Mounted route component instances
960
+ * Having the instances on the record mean beforeRouteUpdate and
961
+ * beforeRouteLeave guards can only be invoked with the latest mounted app
962
+ * instance if there are multiple application instances rendering the same
963
+ * view, basically duplicating the content on the page, which shouldn't happen
964
+ * in practice. It will work if multiple apps are rendering different named
965
+ * views.
966
+ */
967
+ instances: Record<string, ComponentPublicInstance | undefined | null>;
968
+ /**
969
+ * Defines if this record is the alias of another one. This property is
970
+ * `undefined` if the record is the original one.
971
+ */
972
+ aliasOf: RouteRecordNormalized | undefined;
973
+ }
974
+
975
+ /**
976
+ * @internal
977
+ */
978
+ declare type _RouteRecordProps = boolean | Record<string, any> | ((to: RouteLocationNormalized) => Record<string, any>);
979
+
980
+ export declare type RouteRecordRaw = RouteRecordSingleView | RouteRecordSingleViewWithChildren | RouteRecordMultipleViews | RouteRecordMultipleViewsWithChildren | RouteRecordRedirect;
981
+
982
+ /**
983
+ * Route Record that defines a redirect. Cannot have `component` or `components`
984
+ * as it is never rendered.
985
+ */
986
+ declare interface RouteRecordRedirect extends _RouteRecordBase {
987
+ redirect: RouteRecordRedirectOption;
988
+ component?: never;
989
+ components?: never;
990
+ props?: never;
991
+ }
992
+
993
+ /**
994
+ * @internal
995
+ */
996
+ export declare type RouteRecordRedirectOption = RouteLocationRaw | ((to: RouteLocation) => RouteLocationRaw);
997
+
998
+ /**
999
+ * Route Record defining one single component with the `component` option.
1000
+ */
1001
+ declare interface RouteRecordSingleView extends _RouteRecordBase {
1002
+ /**
1003
+ * Component to display when the URL matches this route.
1004
+ */
1005
+ component: RawRouteComponent;
1006
+ components?: never;
1007
+ children?: never;
1008
+ redirect?: never;
1009
+ /**
1010
+ * Allow passing down params as props to the component rendered by `router-view`.
1011
+ */
1012
+ props?: _RouteRecordProps;
1013
+ }
1014
+
1015
+ /**
1016
+ * Route Record defining one single component with a nested view.
1017
+ */
1018
+ declare interface RouteRecordSingleViewWithChildren extends _RouteRecordBase {
1019
+ /**
1020
+ * Component to display when the URL matches this route.
1021
+ */
1022
+ component?: RawRouteComponent | null | undefined;
1023
+ components?: never;
1024
+ children: RouteRecordRaw[];
1025
+ /**
1026
+ * Allow passing down params as props to the component rendered by `router-view`.
1027
+ */
1028
+ props?: _RouteRecordProps;
1029
+ }
1030
+
1031
+ /**
1032
+ * Interface implemented by History implementations that can be passed to the
1033
+ * router as {@link Router.history}
1034
+ *
1035
+ * @alpha
1036
+ */
1037
+ export declare interface RouterHistory {
1038
+ /**
1039
+ * Base path that is prepended to every url. This allows hosting an SPA at a
1040
+ * subfolder of a domain like `example.com/subfolder` by having a `base` of
1041
+ * `/subfolder`
1042
+ */
1043
+ readonly base: string;
1044
+ /**
1045
+ * Current History location
1046
+ */
1047
+ readonly location: HistoryLocation;
1048
+ /**
1049
+ * Current History state
1050
+ */
1051
+ readonly state: HistoryState;
1052
+ /**
1053
+ * Navigates to a location. In the case of an HTML5 History implementation,
1054
+ * this will call `history.pushState` to effectively change the URL.
1055
+ *
1056
+ * @param to - location to push
1057
+ * @param data - optional {@link HistoryState} to be associated with the
1058
+ * navigation entry
1059
+ */
1060
+ push(to: HistoryLocation, data?: HistoryState): void;
1061
+ /**
1062
+ * Same as {@link RouterHistory.push} but performs a `history.replaceState`
1063
+ * instead of `history.pushState`
1064
+ *
1065
+ * @param to - location to set
1066
+ * @param data - optional {@link HistoryState} to be associated with the
1067
+ * navigation entry
1068
+ */
1069
+ replace(to: HistoryLocation, data?: HistoryState): void;
1070
+ /**
1071
+ * Traverses history in a given direction.
1072
+ *
1073
+ * @example
1074
+ * ```js
1075
+ * myHistory.go(-1) // equivalent to window.history.back()
1076
+ * myHistory.go(1) // equivalent to window.history.forward()
1077
+ * ```
1078
+ *
1079
+ * @param delta - distance to travel. If delta is \< 0, it will go back,
1080
+ * if it's \> 0, it will go forward by that amount of entries.
1081
+ * @param triggerListeners - whether this should trigger listeners attached to
1082
+ * the history
1083
+ */
1084
+ go(delta: number, triggerListeners?: boolean): void;
1085
+ /**
1086
+ * Attach a listener to the History implementation that is triggered when the
1087
+ * navigation is triggered from outside (like the Browser back and forward
1088
+ * buttons) or when passing `true` to {@link RouterHistory.back} and
1089
+ * {@link RouterHistory.forward}
1090
+ *
1091
+ * @param callback - listener to attach
1092
+ * @returns a callback to remove the listener
1093
+ */
1094
+ listen(callback: NavigationCallback): () => void;
1095
+ /**
1096
+ * Generates the corresponding href to be used in an anchor tag.
1097
+ *
1098
+ * @param location - history location that should create an href
1099
+ */
1100
+ createHref(location: HistoryLocation): string;
1101
+ /**
1102
+ * Clears any event listener attached by the history implementation.
1103
+ */
1104
+ destroy(): void;
1105
+ }
1106
+
1107
+ /**
1108
+ * Allows overriding the router instance returned by `useRouter` in tests. r
1109
+ * stands for router
1110
+ *
1111
+ * @internal
1112
+ */
1113
+ export declare const routerKey: InjectionKey<Router>;
1114
+
1115
+ /**
1116
+ * Component to render a link that triggers a navigation on click.
1117
+ */
1118
+ export declare const RouterLink: _RouterLinkI;
1119
+
1120
+ /**
1121
+ * Typed version of the `RouterLink` component. Its generic defaults to the typed router so it can be inferred
1122
+ * automatically for JSX.
1123
+ *
1124
+ * @internal
1125
+ */
1126
+ export declare interface _RouterLinkI {
1127
+ new (): {
1128
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterLinkProps;
1129
+ $slots: {
1130
+ default: (arg: UnwrapRef<ReturnType<typeof useLink>>) => VNode[];
1131
+ };
1132
+ };
1133
+ /**
1134
+ * Access to `useLink()` without depending on using vue-router
1135
+ *
1136
+ * @internal
1137
+ */
1138
+ useLink: typeof useLink;
1139
+ }
1140
+
1141
+ declare interface RouterLinkOptions {
1142
+ /**
1143
+ * Route Location the link should navigate to when clicked on.
1144
+ */
1145
+ to: RouteLocationRaw;
1146
+ /**
1147
+ * Calls `router.replace` instead of `router.push`.
1148
+ */
1149
+ replace?: boolean;
1150
+ }
1151
+
1152
+ export declare interface RouterLinkProps extends RouterLinkOptions {
1153
+ /**
1154
+ * Whether RouterLink should not wrap its content in an `a` tag. Useful when
1155
+ * using `v-slot` to create a custom RouterLink
1156
+ */
1157
+ custom?: boolean;
1158
+ /**
1159
+ * Class to apply when the link is active
1160
+ */
1161
+ activeClass?: string;
1162
+ /**
1163
+ * Class to apply when the link is exact active
1164
+ */
1165
+ exactActiveClass?: string;
1166
+ /**
1167
+ * Value passed to the attribute `aria-current` when the link is exact active. Defaults to "page"
1168
+ */
1169
+ ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
1170
+ }
1171
+
1172
+ /**
1173
+ * Internal RouterMatcher
1174
+ *
1175
+ * @internal
1176
+ */
1177
+ export declare interface RouterMatcher {
1178
+ addRoute: (record: RouteRecordRaw, parent?: RouteRecordMatcher) => () => void;
1179
+ removeRoute: {
1180
+ (matcher: RouteRecordMatcher): void;
1181
+ (name: RouteRecordName): void;
1182
+ };
1183
+ getRoutes: () => RouteRecordMatcher[];
1184
+ getRecordMatcher: (name: RouteRecordName) => RouteRecordMatcher | undefined;
1185
+ /**
1186
+ * Resolves a location. Gives access to the route record that corresponds to the actual path as well as filling the corresponding params objects
1187
+ *
1188
+ * @param location - MatcherLocationRaw to resolve to a url
1189
+ * @param currentLocation - MatcherLocation of the current location
1190
+ */
1191
+ resolve: (location: MatcherLocationRaw, currentLocation: MatcherLocation) => MatcherLocation;
1192
+ }
1193
+
1194
+ /**
1195
+ * Options to initialize a {@link Router} instance.
1196
+ */
1197
+ export declare interface RouterOptions extends PathParserOptions {
1198
+ /**
1199
+ * History implementation used by the router. Most web applications should use
1200
+ * `createWebHistory` but it requires the server to be properly configured.
1201
+ * You can also use a _hash_ based history with `createWebHashHistory` that
1202
+ * does not require any configuration on the server but isn't handled at all
1203
+ * by search engines and does poorly on SEO.
1204
+ *
1205
+ * @example
1206
+ * ```js
1207
+ * createRouter({
1208
+ * history: createWebHistory(),
1209
+ * // other options...
1210
+ * })
1211
+ * ```
1212
+ */
1213
+ history: RouterHistory;
1214
+ /**
1215
+ * Initial list of routes that should be added to the router.
1216
+ */
1217
+ routes: Readonly<RouteRecordRaw[]>;
1218
+ /**
1219
+ * Function to control scrolling when navigating between pages. Can return a
1220
+ * Promise to delay scrolling. Check {@link ScrollBehavior}.
1221
+ *
1222
+ * @example
1223
+ * ```js
1224
+ * function scrollBehavior(to, from, savedPosition) {
1225
+ * // `to` and `from` are both route locations
1226
+ * // `savedPosition` can be null if there isn't one
1227
+ * }
1228
+ * ```
1229
+ */
1230
+ scrollBehavior?: RouterScrollBehavior;
1231
+ /**
1232
+ * Custom implementation to parse a query. See its counterpart,
1233
+ * {@link RouterOptions.stringifyQuery}.
1234
+ *
1235
+ * @example
1236
+ * Let's say you want to use the [qs package](https://github.com/ljharb/qs)
1237
+ * to parse queries, you can provide both `parseQuery` and `stringifyQuery`:
1238
+ * ```js
1239
+ * import qs from 'qs'
1240
+ *
1241
+ * createRouter({
1242
+ * // other options...
1243
+ * parseQuery: qs.parse,
1244
+ * stringifyQuery: qs.stringify,
1245
+ * })
1246
+ * ```
1247
+ */
1248
+ parseQuery?: typeof parseQuery;
1249
+ /**
1250
+ * Custom implementation to stringify a query object. Should not prepend a leading `?`.
1251
+ * {@link RouterOptions.parseQuery | parseQuery} counterpart to handle query parsing.
1252
+ */
1253
+ stringifyQuery?: typeof stringifyQuery;
1254
+ /**
1255
+ * Default class applied to active {@link RouterLink}. If none is provided,
1256
+ * `router-link-active` will be applied.
1257
+ */
1258
+ linkActiveClass?: string;
1259
+ /**
1260
+ * Default class applied to exact active {@link RouterLink}. If none is provided,
1261
+ * `router-link-exact-active` will be applied.
1262
+ */
1263
+ linkExactActiveClass?: string;
1264
+ }
1265
+
1266
+ /**
1267
+ * Type of the `scrollBehavior` option that can be passed to `createRouter`.
1268
+ */
1269
+ export declare interface RouterScrollBehavior {
1270
+ /**
1271
+ * @param to - Route location where we are navigating to
1272
+ * @param from - Route location where we are navigating from
1273
+ * @param savedPosition - saved position if it exists, `null` otherwise
1274
+ */
1275
+ (to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, savedPosition: _ScrollPositionNormalized | null): Awaitable<ScrollPosition | false | void>;
1276
+ }
1277
+
1278
+ /**
1279
+ * Component to display the current route the user is at.
1280
+ */
1281
+ export declare const RouterView: new () => {
1282
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterViewProps;
1283
+ $slots: {
1284
+ default: (arg: {
1285
+ Component: VNode;
1286
+ route: RouteLocationNormalizedLoaded;
1287
+ }) => VNode[];
1288
+ };
1289
+ };
1290
+
1291
+ /**
1292
+ * Allows overriding the current route used by router-view. Internally this is
1293
+ * used when the `route` prop is passed.
1294
+ *
1295
+ * @internal
1296
+ */
1297
+ export declare const routerViewLocationKey: InjectionKey<Ref<RouteLocationNormalizedLoaded>>;
1298
+
1299
+ export declare interface RouterViewProps {
1300
+ name?: string;
1301
+ route?: RouteLocationNormalized;
1302
+ }
1303
+
1304
+ declare type ScrollPosition = ScrollPositionCoordinates | ScrollPositionElement;
1305
+
1306
+ /**
1307
+ * Scroll position similar to
1308
+ * {@link https://developer.mozilla.org/en-US/docs/Web/API/ScrollToOptions | `ScrollToOptions`}.
1309
+ * Note that not all browsers support `behavior`.
1310
+ */
1311
+ declare type ScrollPositionCoordinates = {
1312
+ behavior?: ScrollOptions['behavior'];
1313
+ left?: number;
1314
+ top?: number;
1315
+ };
1316
+
1317
+ declare interface ScrollPositionElement extends ScrollToOptions {
1318
+ /**
1319
+ * A valid CSS selector. Note some characters must be escaped in id selectors (https://mathiasbynens.be/notes/css-escapes).
1320
+ * @example
1321
+ * Here are a few examples:
1322
+ *
1323
+ * - `.title`
1324
+ * - `.content:first-child`
1325
+ * - `#marker`
1326
+ * - `#marker\~with\~symbols`
1327
+ * - `#marker.with.dot`: selects `class="with dot" id="marker"`, not `id="marker.with.dot"`
1328
+ *
1329
+ */
1330
+ el: string | Element;
1331
+ }
1332
+
1333
+ /**
1334
+ * Internal normalized version of {@link ScrollPositionCoordinates} that always
1335
+ * has `left` and `top` coordinates.
1336
+ *
1337
+ * @internal
1338
+ */
1339
+ declare type _ScrollPositionNormalized = {
1340
+ behavior?: ScrollOptions['behavior'];
1341
+ left: number;
1342
+ top: number;
1343
+ };
1344
+
1345
+ /**
1346
+ * Initial route location where the router is. Can be used in navigation guards
1347
+ * to differentiate the initial navigation.
1348
+ *
1349
+ * @example
1350
+ * ```js
1351
+ * import { START_LOCATION } from 'vue-router'
1352
+ *
1353
+ * router.beforeEach((to, from) => {
1354
+ * if (from === START_LOCATION) {
1355
+ * // initial navigation
1356
+ * }
1357
+ * })
1358
+ * ```
1359
+ */
1360
+ export declare const START_LOCATION: RouteLocationNormalizedLoaded;
1361
+
1362
+ /**
1363
+ * Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
1364
+ * doesn't prepend a `?`
1365
+ *
1366
+ * @internal
1367
+ *
1368
+ * @param query - query object to stringify
1369
+ * @returns string version of the query without the leading `?`
1370
+ */
1371
+ export declare function stringifyQuery(query: LocationQueryRaw): string;
1372
+
1373
+ /**
1374
+ * Allows customizing existing types of the router that are used globally like `$router`, `<RouterLink>`, and `beforeRouteLeave()`. **ONLY FOR INTERNAL USAGE**.
1375
+ *
1376
+ * @internal
1377
+ */
1378
+ export declare interface TypesConfig {
1379
+ }
1380
+
1381
+ export declare function useLink(props: UseLinkOptions): {
1382
+ route: ComputedRef<RouteLocation & {
1383
+ href: string;
1384
+ }>;
1385
+ href: ComputedRef<string>;
1386
+ isActive: ComputedRef<boolean>;
1387
+ isExactActive: ComputedRef<boolean>;
1388
+ navigate: (e?: MouseEvent) => Promise<void | NavigationFailure>;
1389
+ };
1390
+
1391
+ export declare type UseLinkOptions = VueUseOptions<RouterLinkOptions>;
1392
+
1393
+ /**
1394
+ * Returns the current route location. Equivalent to using `$route` inside
1395
+ * templates.
1396
+ */
1397
+ export declare function useRoute(): RouteLocationNormalizedLoaded;
1398
+
1399
+ /**
1400
+ * Returns the router instance. Equivalent to using `$router` inside
1401
+ * templates.
1402
+ */
1403
+ export declare function useRouter(): Router;
1404
+
1405
+ /**
1406
+ * Allows overriding the router view depth to control which component in
1407
+ * `matched` is rendered. rvd stands for Router View Depth
1408
+ *
1409
+ * @internal
1410
+ */
1411
+ export declare const viewDepthKey: InjectionKey<number | Ref<number>>;
1412
+
1413
+ /**
1414
+ * Type to transform a static object into one that allows passing Refs as
1415
+ * values.
1416
+ * @internal
1417
+ */
1418
+ declare type VueUseOptions<T> = {
1419
+ [k in keyof T]: Ref<T[k]> | T[k];
1420
+ };
1421
+
1422
+ export { }
1423
+
1424
+ declare module '@vue/runtime-core' {
1425
+ export interface ComponentCustomOptions {
1426
+ /**
1427
+ * Guard called when the router is navigating to the route that is rendering
1428
+ * this component from a different route. Differently from `beforeRouteUpdate`
1429
+ * and `beforeRouteLeave`, `beforeRouteEnter` does not have access to the
1430
+ * component instance through `this` because it triggers before the component
1431
+ * is even mounted.
1432
+ *
1433
+ * @param to - RouteLocationRaw we are navigating to
1434
+ * @param from - RouteLocationRaw we are navigating from
1435
+ * @param next - function to validate, cancel or modify (by redirecting) the
1436
+ * navigation
1437
+ */
1438
+ beforeRouteEnter?: TypesConfig extends Record<'beforeRouteEnter', infer T>
1439
+ ? T
1440
+ : NavigationGuardWithThis<undefined>
1441
+
1442
+ /**
1443
+ * Guard called whenever the route that renders this component has changed but
1444
+ * it is reused for the new route. This allows you to guard for changes in
1445
+ * params, the query or the hash.
1446
+ *
1447
+ * @param to - RouteLocationRaw we are navigating to
1448
+ * @param from - RouteLocationRaw we are navigating from
1449
+ * @param next - function to validate, cancel or modify (by redirecting) the
1450
+ * navigation
1451
+ */
1452
+ beforeRouteUpdate?: TypesConfig extends Record<'beforeRouteUpdate', infer T>
1453
+ ? T
1454
+ : NavigationGuard
1455
+
1456
+ /**
1457
+ * Guard called when the router is navigating away from the current route that
1458
+ * is rendering this component.
1459
+ *
1460
+ * @param to - RouteLocationRaw we are navigating to
1461
+ * @param from - RouteLocationRaw we are navigating from
1462
+ * @param next - function to validate, cancel or modify (by redirecting) the
1463
+ * navigation
1464
+ */
1465
+ beforeRouteLeave?: TypesConfig extends Record<'beforeRouteLeave', infer T>
1466
+ ? T
1467
+ : NavigationGuard
1468
+ }
1469
+
1470
+ export interface ComponentCustomProperties {
1471
+ /**
1472
+ * Normalized current location. See {@link RouteLocationNormalizedLoaded}.
1473
+ */
1474
+ $route: TypesConfig extends Record<'$route', infer T>
1475
+ ? T
1476
+ : RouteLocationNormalizedLoaded
1477
+ /**
1478
+ * {@link Router} instance used by the application.
1479
+ */
1480
+ $router: TypesConfig extends Record<'$router', infer T> ? T : Router
1481
+ }
1482
+
1483
+ export interface GlobalComponents {
1484
+ RouterView: TypesConfig extends Record<'RouterView', infer T>
1485
+ ? T
1486
+ : typeof RouterView
1487
+ RouterLink: TypesConfig extends Record<'RouterLink', infer T>
1488
+ ? T
1489
+ : typeof RouterLink
1490
+ }
1491
+ }