@histoire/vendors 0.17.16 → 1.0.0-alpha.1

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 (231) hide show
  1. package/dist/client/b-floating-vue.d.ts +3 -3
  2. package/dist/client/b-floating-vue.js +2176 -2149
  3. package/dist/client/b-iconify.d.ts +1 -1
  4. package/dist/client/b-iconify.js +751 -825
  5. package/dist/client/b-pinia.d.ts +1 -1
  6. package/dist/client/b-pinia.js +130 -68
  7. package/dist/client/b-scroll.d.ts +2 -2
  8. package/dist/client/b-scroll.js +5 -52
  9. package/dist/client/b-vue-router.d.ts +1 -1
  10. package/dist/client/b-vue-router.js +385 -237
  11. package/dist/client/b-vue-use.d.ts +1 -1
  12. package/dist/client/b-vue-use.js +3898 -2871
  13. package/dist/client/b-vue.d.ts +1 -1
  14. package/dist/client/b-vue.js +1 -1
  15. package/dist/client/index.js +162 -20
  16. package/dist/client/node_modules/@babel/helper-string-parser/package.json +31 -0
  17. package/dist/client/node_modules/@babel/helper-validator-identifier/package.json +31 -0
  18. package/dist/client/node_modules/@babel/parser/package.json +10 -6
  19. package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +47 -31
  20. package/dist/client/node_modules/@babel/types/lib/index-legacy.d.ts +2776 -0
  21. package/dist/client/node_modules/@babel/types/lib/index.d.ts +3275 -0
  22. package/dist/client/node_modules/@babel/types/package.json +39 -0
  23. package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +525 -0
  24. package/dist/client/node_modules/@floating-ui/core/package.json +32 -39
  25. package/dist/client/node_modules/@floating-ui/dom/package.json +23 -24
  26. package/dist/client/node_modules/@floating-ui/dom/src/autoUpdate.d.ts +31 -0
  27. package/dist/client/node_modules/@floating-ui/dom/src/index.d.ts +11 -7
  28. package/dist/client/node_modules/@floating-ui/dom/src/platform.d.ts +1 -1
  29. package/dist/client/node_modules/@floating-ui/dom/src/types.d.ts +121 -20
  30. package/dist/client/node_modules/@floating-ui/dom/src/utils/getBoundingClientRect.d.ts +1 -1
  31. package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingRect.d.ts +12 -0
  32. package/dist/client/node_modules/@floating-ui/dom/src/utils/getCssDimensions.d.ts +4 -0
  33. package/dist/client/node_modules/@floating-ui/dom/src/utils/getDimensions.d.ts +1 -1
  34. package/dist/client/node_modules/@floating-ui/dom/src/utils/getNearestOverflowAncestor.d.ts +1 -0
  35. package/dist/client/node_modules/@floating-ui/dom/src/utils/getOverflowAncestors.d.ts +3 -0
  36. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScale.d.ts +7 -0
  37. package/dist/client/node_modules/@floating-ui/dom/src/utils/getViewportRect.d.ts +2 -2
  38. package/dist/client/node_modules/@floating-ui/dom/src/utils/getWindowScrollBarX.d.ts +1 -1
  39. package/dist/client/node_modules/@floating-ui/dom/src/utils/is.d.ts +3 -1
  40. package/dist/client/node_modules/@floating-ui/dom/src/utils/unwrapElement.d.ts +2 -0
  41. package/dist/client/node_modules/@floating-ui/dom/src/utils/userAgent.d.ts +1 -0
  42. package/dist/client/node_modules/@floating-ui/dom/src/utils/window.d.ts +1 -2
  43. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +103 -0
  44. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +47 -0
  45. package/dist/client/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +47 -0
  46. package/dist/client/node_modules/@floating-ui/utils/dom/package.json +6 -0
  47. package/dist/client/node_modules/@floating-ui/utils/package.json +70 -0
  48. package/dist/client/node_modules/@iconify/types/package.json +23 -0
  49. package/dist/client/node_modules/@iconify/types/provider.d.ts +44 -0
  50. package/dist/client/node_modules/@iconify/types/types.d.ts +272 -0
  51. package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +72 -330
  52. package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +28 -268
  53. package/dist/client/node_modules/@iconify/vue/package.json +64 -60
  54. package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/scopes.d.ts +49 -0
  55. package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/sourcemap-codec.d.ts +2 -0
  56. package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/strings.d.ts +15 -0
  57. package/dist/client/node_modules/@jridgewell/sourcemap-codec/dist/types/vlq.d.ts +6 -0
  58. package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +3 -2
  59. package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +33 -14
  60. package/dist/client/node_modules/@types/web-bluetooth/package.json +12 -12
  61. package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +218 -125
  62. package/dist/client/node_modules/@vue/compiler-core/package.json +20 -5
  63. package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +6 -3
  64. package/dist/client/node_modules/@vue/compiler-dom/package.json +17 -3
  65. package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +35 -25
  66. package/dist/client/node_modules/@vue/compiler-sfc/package.json +27 -18
  67. package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +2 -2
  68. package/dist/client/node_modules/@vue/compiler-ssr/package.json +3 -3
  69. package/dist/client/node_modules/@vue/devtools-api/package.json +1 -1
  70. package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +268 -166
  71. package/dist/client/node_modules/@vue/reactivity/package.json +16 -2
  72. package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +728 -529
  73. package/dist/client/node_modules/@vue/runtime-core/package.json +17 -3
  74. package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +195 -86
  75. package/dist/client/node_modules/@vue/runtime-dom/package.json +22 -4
  76. package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +4 -8
  77. package/dist/client/node_modules/@vue/server-renderer/package.json +18 -4
  78. package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +45 -30
  79. package/dist/client/node_modules/@vue/shared/package.json +15 -1
  80. package/dist/client/node_modules/@vueuse/core/index.d.ts +2040 -633
  81. package/dist/client/node_modules/@vueuse/core/package.json +10 -12
  82. package/dist/client/node_modules/@vueuse/metadata/index.d.ts +7 -5
  83. package/dist/client/node_modules/@vueuse/metadata/package.json +4 -4
  84. package/dist/client/node_modules/@vueuse/shared/index.d.ts +410 -273
  85. package/dist/client/node_modules/@vueuse/shared/package.json +5 -6
  86. package/dist/client/node_modules/compute-scroll-into-view/dist/index.d.ts +75 -0
  87. package/dist/client/node_modules/compute-scroll-into-view/package.json +35 -45
  88. package/dist/client/node_modules/entities/lib/decode.d.ts +211 -0
  89. package/dist/client/node_modules/entities/lib/decode_codepoint.d.ts +19 -0
  90. package/dist/client/node_modules/entities/lib/encode.d.ts +22 -0
  91. package/dist/client/node_modules/entities/lib/escape.d.ts +43 -0
  92. package/dist/client/node_modules/entities/lib/esm/decode.d.ts +211 -0
  93. package/dist/client/node_modules/entities/lib/esm/decode_codepoint.d.ts +19 -0
  94. package/dist/client/node_modules/entities/lib/esm/encode.d.ts +22 -0
  95. package/dist/client/node_modules/entities/lib/esm/escape.d.ts +43 -0
  96. package/dist/client/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +3 -0
  97. package/dist/client/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +3 -0
  98. package/dist/client/node_modules/entities/lib/esm/generated/encode-html.d.ts +8 -0
  99. package/dist/client/node_modules/entities/lib/esm/index.d.ts +96 -0
  100. package/dist/client/node_modules/entities/lib/esm/package.json +1 -0
  101. package/dist/client/node_modules/entities/lib/generated/decode-data-html.d.ts +3 -0
  102. package/dist/client/node_modules/entities/lib/generated/decode-data-xml.d.ts +3 -0
  103. package/dist/client/node_modules/entities/lib/generated/encode-html.d.ts +8 -0
  104. package/dist/client/node_modules/entities/lib/index.d.ts +96 -0
  105. package/dist/client/node_modules/entities/package.json +90 -0
  106. package/dist/client/node_modules/floating-vue/dist/components/Dropdown.d.ts +398 -0
  107. package/dist/client/node_modules/floating-vue/dist/components/Menu.d.ts +398 -0
  108. package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +225 -105
  109. package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +471 -364
  110. package/dist/client/node_modules/floating-vue/dist/components/PopperContent.vue.d.ts +14 -25
  111. package/dist/client/node_modules/floating-vue/dist/components/PopperWrapper.vue.d.ts +392 -6
  112. package/dist/client/node_modules/floating-vue/dist/components/Tooltip.d.ts +398 -0
  113. package/dist/client/node_modules/floating-vue/dist/components/TooltipDirective.vue.d.ts +49 -10
  114. package/dist/client/node_modules/floating-vue/dist/config.d.ts +1 -1
  115. package/dist/client/node_modules/floating-vue/dist/index.d.ts +2071 -247
  116. package/dist/client/node_modules/floating-vue/dist/util/events.d.ts +2 -0
  117. package/dist/client/node_modules/floating-vue/dist/util/popper.d.ts +1 -1
  118. package/dist/client/node_modules/floating-vue/package.json +42 -33
  119. package/dist/client/node_modules/magic-string/dist/magic-string.cjs.d.ts +250 -229
  120. package/dist/client/node_modules/magic-string/package.json +24 -26
  121. package/dist/client/node_modules/nanoid/package.json +1 -1
  122. package/dist/client/node_modules/picocolors/package.json +2 -2
  123. package/dist/client/node_modules/picocolors/types.d.ts +51 -0
  124. package/dist/client/node_modules/pinia/dist/pinia.d.ts +116 -37
  125. package/dist/client/node_modules/pinia/package.json +7 -11
  126. package/dist/client/node_modules/postcss/lib/at-rule.d.ts +25 -22
  127. package/dist/client/node_modules/postcss/lib/comment.d.ts +10 -9
  128. package/dist/client/node_modules/postcss/lib/container.d.ts +47 -54
  129. package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +1 -1
  130. package/dist/client/node_modules/postcss/lib/declaration.d.ts +20 -17
  131. package/dist/client/node_modules/postcss/lib/document.d.ts +4 -4
  132. package/dist/client/node_modules/postcss/lib/input.d.ts +14 -0
  133. package/dist/client/node_modules/postcss/lib/list.d.ts +5 -2
  134. package/dist/client/node_modules/postcss/lib/node.d.ts +19 -14
  135. package/dist/client/node_modules/postcss/lib/postcss.d.ts +25 -8
  136. package/dist/client/node_modules/postcss/lib/processor.d.ts +1 -1
  137. package/dist/client/node_modules/postcss/lib/result.d.ts +0 -1
  138. package/dist/client/node_modules/postcss/lib/root.d.ts +4 -4
  139. package/dist/client/node_modules/postcss/lib/rule.d.ts +27 -18
  140. package/dist/client/node_modules/postcss/package.json +4 -4
  141. package/dist/client/node_modules/scroll-into-view-if-needed/dist/index.d.ts +79 -0
  142. package/dist/client/node_modules/scroll-into-view-if-needed/package.json +28 -67
  143. package/dist/client/node_modules/source-map-js/lib/source-map-consumer.d.ts +1 -0
  144. package/dist/client/node_modules/source-map-js/lib/source-map-generator.d.ts +1 -0
  145. package/dist/client/node_modules/source-map-js/lib/source-node.d.ts +1 -0
  146. package/dist/client/node_modules/source-map-js/package.json +1 -1
  147. package/dist/client/node_modules/source-map-js/source-map.d.ts +88 -99
  148. package/dist/client/node_modules/vue/dist/vue.d.ts +0 -4
  149. package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +2 -1
  150. package/dist/client/node_modules/vue/jsx.d.ts +2 -1
  151. package/dist/client/node_modules/vue/package.json +13 -14
  152. package/dist/client/node_modules/{pinia/node_modules/vue-demi → vue-demi}/package.json +1 -1
  153. package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +410 -81
  154. package/dist/client/node_modules/vue-router/package.json +66 -37
  155. package/dist/client/node_modules/vue-router/vue-router-auto-routes.d.ts +4 -0
  156. package/dist/client/node_modules/vue-router/vue-router-auto.d.ts +4 -0
  157. package/dist/client/vue.runtime.esm-bundler.js +6458 -4714
  158. package/floating-vue.d.ts +1 -0
  159. package/iconify.d.ts +1 -0
  160. package/package.json +20 -20
  161. package/pinia.d.ts +1 -0
  162. package/rollup.config.mjs +11 -9
  163. package/scroll.d.ts +1 -0
  164. package/src/client/b-floating-vue.ts +2 -0
  165. package/src/client/b-scroll.ts +2 -0
  166. package/tsconfig.json +17 -17
  167. package/vue-router.d.ts +1 -0
  168. package/vue-use.d.ts +1 -0
  169. package/vue.d.ts +1 -0
  170. package/dist/client/index2.js +0 -168
  171. package/dist/client/node_modules/@floating-ui/core/index.d.ts +0 -1
  172. package/dist/client/node_modules/@floating-ui/core/src/_babel.d.ts +0 -1
  173. package/dist/client/node_modules/@floating-ui/core/src/computeCoordsFromPlacement.d.ts +0 -4
  174. package/dist/client/node_modules/@floating-ui/core/src/computePosition.d.ts +0 -2
  175. package/dist/client/node_modules/@floating-ui/core/src/detectOverflow.d.ts +0 -9
  176. package/dist/client/node_modules/@floating-ui/core/src/enums.d.ts +0 -4
  177. package/dist/client/node_modules/@floating-ui/core/src/index.d.ts +0 -11
  178. package/dist/client/node_modules/@floating-ui/core/src/middleware/arrow.d.ts +0 -6
  179. package/dist/client/node_modules/@floating-ui/core/src/middleware/autoPlacement.d.ts +0 -9
  180. package/dist/client/node_modules/@floating-ui/core/src/middleware/flip.d.ts +0 -10
  181. package/dist/client/node_modules/@floating-ui/core/src/middleware/hide.d.ts +0 -2
  182. package/dist/client/node_modules/@floating-ui/core/src/middleware/inline.d.ts +0 -5
  183. package/dist/client/node_modules/@floating-ui/core/src/middleware/offset.d.ts +0 -21
  184. package/dist/client/node_modules/@floating-ui/core/src/middleware/shift.d.ts +0 -32
  185. package/dist/client/node_modules/@floating-ui/core/src/middleware/size.d.ts +0 -6
  186. package/dist/client/node_modules/@floating-ui/core/src/types.d.ts +0 -148
  187. package/dist/client/node_modules/@floating-ui/core/src/utils/expandPaddingObject.d.ts +0 -2
  188. package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignment.d.ts +0 -2
  189. package/dist/client/node_modules/@floating-ui/core/src/utils/getAlignmentSides.d.ts +0 -5
  190. package/dist/client/node_modules/@floating-ui/core/src/utils/getBasePlacement.d.ts +0 -2
  191. package/dist/client/node_modules/@floating-ui/core/src/utils/getCrossAxis.d.ts +0 -2
  192. package/dist/client/node_modules/@floating-ui/core/src/utils/getExpandedPlacements.d.ts +0 -2
  193. package/dist/client/node_modules/@floating-ui/core/src/utils/getLengthFromAxis.d.ts +0 -2
  194. package/dist/client/node_modules/@floating-ui/core/src/utils/getMainAxisFromPlacement.d.ts +0 -2
  195. package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositeAlignmentPlacement.d.ts +0 -2
  196. package/dist/client/node_modules/@floating-ui/core/src/utils/getOppositePlacement.d.ts +0 -1
  197. package/dist/client/node_modules/@floating-ui/core/src/utils/getPaddingObject.d.ts +0 -2
  198. package/dist/client/node_modules/@floating-ui/core/src/utils/math.d.ts +0 -2
  199. package/dist/client/node_modules/@floating-ui/core/src/utils/rectToClientRect.d.ts +0 -2
  200. package/dist/client/node_modules/@floating-ui/core/src/utils/within.d.ts +0 -1
  201. package/dist/client/node_modules/@floating-ui/dom/src/utils/contains.d.ts +0 -1
  202. package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingClientRect.d.ts +0 -6
  203. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParent.d.ts +0 -1
  204. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScrollParents.d.ts +0 -1
  205. package/dist/client/node_modules/@vue/reactivity-transform/dist/reactivity-transform.d.ts +0 -43
  206. package/dist/client/node_modules/@vue/reactivity-transform/package.json +0 -41
  207. package/dist/client/node_modules/@vueuse/core/node_modules/vue-demi/package.json +0 -47
  208. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/index.d.ts +0 -22
  209. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
  210. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
  211. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
  212. package/dist/client/node_modules/@vueuse/shared/node_modules/vue-demi/package.json +0 -47
  213. package/dist/client/node_modules/compute-scroll-into-view/typings/index.d.ts +0 -19
  214. package/dist/client/node_modules/floating-vue/dist/components/Dropdown.vue.d.ts +0 -25
  215. package/dist/client/node_modules/floating-vue/dist/components/Menu.vue.d.ts +0 -25
  216. package/dist/client/node_modules/floating-vue/dist/components/Tooltip.vue.d.ts +0 -25
  217. package/dist/client/node_modules/floating-vue/src/global-shim.d.ts +0 -1
  218. package/dist/client/node_modules/floating-vue/src/vue-shim.d.ts +0 -5
  219. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/index.d.ts +0 -22
  220. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2/index.d.ts +0 -33
  221. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v2.7/index.d.ts +0 -38
  222. package/dist/client/node_modules/pinia/node_modules/vue-demi/lib/v3/index.d.ts +0 -22
  223. package/dist/client/node_modules/scroll-into-view-if-needed/typings/index.d.ts +0 -13
  224. package/dist/client/node_modules/scroll-into-view-if-needed/typings/types.d.ts +0 -19
  225. package/dist/client/node_modules/vue/macros-global.d.ts +0 -19
  226. package/dist/client/node_modules/vue/macros.d.ts +0 -112
  227. package/dist/client/node_modules/vue/ref-macros.d.ts +0 -2
  228. /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/index.d.ts +0 -0
  229. /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2/index.d.ts +0 -0
  230. /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v2.7/index.d.ts +0 -0
  231. /package/dist/client/node_modules/{@vueuse/core/node_modules/vue-demi → vue-demi}/lib/v3/index.d.ts +0 -0
@@ -1,11 +1,12 @@
1
1
  import { AllowedComponentProps } from 'vue';
2
2
  import { App } from 'vue';
3
- import { Component } from 'vue';
3
+ import type { Component } from 'vue';
4
4
  import { ComponentCustomProps } from 'vue';
5
5
  import { ComponentPublicInstance } from 'vue';
6
6
  import { ComputedRef } from 'vue';
7
- import { DefineComponent } from 'vue';
7
+ import type { DefineComponent } from 'vue';
8
8
  import type { InjectionKey } from 'vue';
9
+ import { MaybeRef } from 'vue';
9
10
  import { Ref } from 'vue';
10
11
  import { UnwrapRef } from 'vue';
11
12
  import { VNode } from 'vue';
@@ -13,6 +14,12 @@ import { VNodeProps } from 'vue';
13
14
 
14
15
  declare type Awaitable<T> = T | Promise<T>;
15
16
 
17
+ /**
18
+ * Maybe a promise maybe not
19
+ * @internal
20
+ */
21
+ export declare type _Awaitable<T> = T | PromiseLike<T>;
22
+
16
23
  /**
17
24
  * Creates an in-memory based history. The main purpose of this history is to handle SSR. It starts in a special location that is nowhere.
18
25
  * It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.
@@ -156,19 +163,29 @@ export declare function isNavigationFailure(error: any, type?: ErrorTypes | Navi
156
163
 
157
164
  declare type Lazy<T> = () => Promise<T>;
158
165
 
166
+ /**
167
+ * Creates a union type that still allows autocompletion for strings.
168
+ * @internal
169
+ */
170
+ declare type _LiteralUnion<LiteralType, BaseType extends string = string> = LiteralType | (BaseType & Record<never, never>);
171
+
159
172
  /**
160
173
  * Ensures a route is loaded, so it can be passed as o prop to `<RouterView>`.
161
174
  *
162
175
  * @param route - resolved route to load
163
176
  */
164
- export declare function loadRouteLocation(route: RouteLocationNormalized): Promise<RouteLocationNormalizedLoaded>;
177
+ export declare function loadRouteLocation(route: RouteLocation | RouteLocationNormalized): Promise<RouteLocationNormalizedLoaded>;
165
178
 
166
179
  /**
167
180
  * @internal
168
181
  */
169
182
  export declare interface LocationAsRelativeRaw {
170
- name?: RouteRecordName;
171
- params?: RouteParamsRaw;
183
+ name?: RouteRecordNameGeneric;
184
+ /**
185
+ * Ignored path property since we are dealing with a relative location. Only `undefined` is allowed.
186
+ */
187
+ path?: undefined;
188
+ params?: RouteParamsRawGeneric;
172
189
  }
173
190
 
174
191
  /**
@@ -221,11 +238,11 @@ export declare const matchedRouteKey: InjectionKey<ComputedRef<RouteRecordNormal
221
238
  /**
222
239
  * Normalized/resolved Route location that returned by the matcher.
223
240
  */
224
- declare interface MatcherLocation {
241
+ export declare interface MatcherLocation {
225
242
  /**
226
243
  * Name of the matched record
227
244
  */
228
- name: RouteRecordName | null | undefined;
245
+ name: RouteRecordNameGeneric | null | undefined;
229
246
  /**
230
247
  * Percentage encoded pathname section of the URL.
231
248
  */
@@ -233,7 +250,7 @@ declare interface MatcherLocation {
233
250
  /**
234
251
  * Object of decoded params extracted from the `path`.
235
252
  */
236
- params: RouteParams;
253
+ params: RouteParamsGeneric;
237
254
  /**
238
255
  * Merged `meta` properties from all the matched route records.
239
256
  */
@@ -250,8 +267,12 @@ declare interface MatcherLocation {
250
267
  * @internal
251
268
  */
252
269
  declare interface MatcherLocationAsName {
253
- name: RouteRecordName;
254
- params?: RouteParams;
270
+ name: RouteRecordNameGeneric;
271
+ /**
272
+ * Ignored path property since we are dealing with a relative location. Only `undefined` is allowed.
273
+ */
274
+ path?: undefined;
275
+ params?: RouteParamsGeneric;
255
276
  }
256
277
 
257
278
  /**
@@ -265,7 +286,11 @@ export declare interface MatcherLocationAsPath {
265
286
  * @internal
266
287
  */
267
288
  declare interface MatcherLocationAsRelative {
268
- params?: RouteParams;
289
+ /**
290
+ * Ignored path property since we are dealing with a relative location. Only `undefined` is allowed.
291
+ */
292
+ path?: undefined;
293
+ params?: RouteParamsGeneric;
269
294
  }
270
295
 
271
296
  /**
@@ -324,13 +349,15 @@ export declare enum NavigationFailureType {
324
349
  }
325
350
 
326
351
  /**
327
- * Navigation guard. See [Navigation
328
- * Guards](/guide/advanced/navigation-guards.md).
352
+ * Navigation Guard.
329
353
  */
330
354
  export declare interface NavigationGuard {
331
- (to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext): NavigationGuardReturn | Promise<NavigationGuardReturn>;
355
+ (to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
332
356
  }
333
357
 
358
+ /**
359
+ * `next()` callback passed to navigation guards.
360
+ */
334
361
  export declare interface NavigationGuardNext {
335
362
  (): void;
336
363
  (error: Error): void;
@@ -339,19 +366,31 @@ export declare interface NavigationGuardNext {
339
366
  (cb: NavigationGuardNextCallback): void;
340
367
  }
341
368
 
342
- declare type NavigationGuardNextCallback = (vm: ComponentPublicInstance) => unknown;
369
+ /**
370
+ * Callback that can be passed to `next()` in `beforeRouteEnter()` guards.
371
+ */
372
+ export declare type NavigationGuardNextCallback = (vm: ComponentPublicInstance) => unknown;
343
373
 
344
- declare type NavigationGuardReturn = void | Error | RouteLocationRaw | boolean | NavigationGuardNextCallback;
374
+ /**
375
+ * Return types for a Navigation Guard. Based on `TypesConfig`
376
+ *
377
+ * @see {@link TypesConfig}
378
+ */
379
+ export declare type NavigationGuardReturn = void | Error | boolean | RouteLocationRaw;
345
380
 
346
381
  /**
347
- * {@inheritDoc NavigationGuard}
382
+ * Navigation Guard with a type parameter for `this`.
383
+ * @see {@link TypesConfig}
348
384
  */
349
385
  export declare interface NavigationGuardWithThis<T> {
350
- (this: T, to: RouteLocationNormalized, from: RouteLocationNormalized, next: NavigationGuardNext): NavigationGuardReturn | Promise<NavigationGuardReturn>;
386
+ (this: T, to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
351
387
  }
352
388
 
389
+ /**
390
+ * Navigation hook triggered after a navigation is settled.
391
+ */
353
392
  export declare interface NavigationHookAfter {
354
- (to: RouteLocationNormalized, from: RouteLocationNormalized, failure?: NavigationFailure | void): any;
393
+ (to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, failure?: NavigationFailure | void): unknown;
355
394
  }
356
395
 
357
396
  declare interface NavigationInformation {
@@ -393,6 +432,33 @@ export declare function onBeforeRouteLeave(leaveGuard: NavigationGuard): void;
393
432
  */
394
433
  export declare function onBeforeRouteUpdate(updateGuard: NavigationGuard): void;
395
434
 
435
+ /**
436
+ * Utility type for raw and non raw params like :id
437
+ *
438
+ */
439
+ export declare type ParamValue<isRaw extends boolean> = true extends isRaw ? string | number : string;
440
+
441
+ /**
442
+ * Utility type for raw and non raw params like :id+
443
+ *
444
+ */
445
+ export declare type ParamValueOneOrMore<isRaw extends boolean> = [
446
+ ParamValue<isRaw>,
447
+ ...ParamValue<isRaw>[]
448
+ ];
449
+
450
+ /**
451
+ * Utility type for raw and non raw params like :id*
452
+ *
453
+ */
454
+ export declare type ParamValueZeroOrMore<isRaw extends boolean> = true extends isRaw ? ParamValue<isRaw>[] | undefined | null : ParamValue<isRaw>[] | undefined;
455
+
456
+ /**
457
+ * Utility type for raw and non raw params like :id?
458
+ *
459
+ */
460
+ export declare type ParamValueZeroOrOne<isRaw extends boolean> = true extends isRaw ? string | number | null | undefined : string;
461
+
396
462
  /**
397
463
  * Transforms a queryString into a {@link LocationQuery} object. Accept both, a
398
464
  * version with the leading `?` and without Should work as URLSearchParams
@@ -490,18 +556,96 @@ declare type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
490
556
  */
491
557
  export declare type RouteComponent = Component | DefineComponent;
492
558
 
559
+ /**
560
+ * Type safe versions of types that are exposed by vue-router. We have to use a generic check to allow for names to be `undefined` when no `RouteMap` is provided.
561
+ */
493
562
  /**
494
563
  * {@link RouteLocationRaw} resolved using the matcher
495
564
  */
496
- export declare interface RouteLocation extends _RouteLocationBase {
565
+ export declare type RouteLocation<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationGeneric : RouteLocationTypedList<RouteMap>[Name];
566
+
567
+ /**
568
+ * Route location as an object with a `path` property.
569
+ */
570
+ export declare type RouteLocationAsPath<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsPathGeneric : RouteLocationAsPathTypedList<RouteMap>[Name];
571
+
572
+ /**
573
+ * Generic version of {@link RouteLocationAsPath}. It is used when no {@link RouteMap} is provided.
574
+ */
575
+ export declare interface RouteLocationAsPathGeneric extends RouteQueryAndHash, RouteLocationOptions {
497
576
  /**
498
- * Array of {@link RouteRecord} containing components as they were
499
- * passed when adding records. It can also contain redirect records. This
500
- * can't be used directly
577
+ * Percentage encoded pathname section of the URL.
501
578
  */
502
- matched: RouteRecord[];
579
+ path: string;
503
580
  }
504
581
 
582
+ /**
583
+ * Helper to generate a type safe version of the {@link RouteLocationAsPath} type.
584
+ */
585
+ export declare interface RouteLocationAsPathTyped<RouteMap extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> extends RouteLocationAsPathGeneric {
586
+ path: _LiteralUnion<RouteMap[Name]['path']>;
587
+ }
588
+
589
+ /**
590
+ * List of all possible {@link RouteLocationAsPath} indexed by the route name.
591
+ * @internal
592
+ */
593
+ export declare type RouteLocationAsPathTypedList<RouteMap extends RouteMapGeneric = RouteMapGeneric> = {
594
+ [N in keyof RouteMap]: RouteLocationAsPathTyped<RouteMap, N>;
595
+ };
596
+
597
+ /**
598
+ * Route location relative to the current location. It accepts other properties than `path` like `params`, `query` and
599
+ * `hash` to conveniently change them.
600
+ */
601
+ export declare type RouteLocationAsRelative<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsRelativeGeneric : RouteLocationAsRelativeTypedList<RouteMap>[Name];
602
+
603
+ /**
604
+ * Generic version of {@link RouteLocationAsRelative}. It is used when no {@link RouteMap} is provided.
605
+ */
606
+ export declare interface RouteLocationAsRelativeGeneric extends RouteQueryAndHash, RouteLocationOptions {
607
+ name?: RouteRecordNameGeneric;
608
+ params?: RouteParamsRawGeneric;
609
+ /**
610
+ * A relative path to the current location. This property should be removed
611
+ */
612
+ path?: undefined;
613
+ }
614
+
615
+ /**
616
+ * Helper to generate a type safe version of the {@link RouteLocationAsRelative} type.
617
+ */
618
+ export declare interface RouteLocationAsRelativeTyped<RouteMap extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> extends RouteLocationAsRelativeGeneric {
619
+ name?: Extract<Name, string | symbol>;
620
+ params?: RouteMap[Name]['paramsRaw'];
621
+ }
622
+
623
+ /**
624
+ * List of all possible {@link RouteLocationAsRelative} indexed by the route name.
625
+ * @internal
626
+ */
627
+ export declare type RouteLocationAsRelativeTypedList<RouteMap extends RouteMapGeneric = RouteMapGeneric> = {
628
+ [N in keyof RouteMap]: RouteLocationAsRelativeTyped<RouteMap, N>;
629
+ };
630
+
631
+ /**
632
+ * Same as {@link RouteLocationAsPath} but as a string literal.
633
+ */
634
+ export declare type RouteLocationAsString<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? string : _LiteralUnion<RouteLocationAsStringTypedList<RouteMap>[Name], string>;
635
+
636
+ /**
637
+ * Helper to generate a type safe version of the {@link RouteLocationAsString} type.
638
+ */
639
+ export declare type RouteLocationAsStringTyped<RouteMap extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> = RouteMap[Name]['path'];
640
+
641
+ /**
642
+ * List of all possible {@link RouteLocationAsString} indexed by the route name.
643
+ * @internal
644
+ */
645
+ export declare type RouteLocationAsStringTypedList<RouteMap extends RouteMapGeneric = RouteMapGeneric> = {
646
+ [N in keyof RouteMap]: RouteLocationAsStringTyped<RouteMap, N>;
647
+ };
648
+
505
649
  /**
506
650
  * Base properties for a normalized route location.
507
651
  *
@@ -528,6 +672,18 @@ export declare interface _RouteLocationBase extends Pick<MatcherLocation, 'name'
528
672
  redirectedFrom: RouteLocation | undefined;
529
673
  }
530
674
 
675
+ /**
676
+ * Generic version of {@link RouteLocation}. It is used when no {@link RouteMap} is provided.
677
+ */
678
+ export declare interface RouteLocationGeneric extends _RouteLocationBase {
679
+ /**
680
+ * Array of {@link RouteRecord} containing components as they were
681
+ * passed when adding records. It can also contain redirect records. This
682
+ * can't be used directly. **This property is non-enumerable**.
683
+ */
684
+ matched: RouteRecord[];
685
+ }
686
+
531
687
  /**
532
688
  * Allows overriding the current route returned by `useRoute` in tests. rl
533
689
  * stands for route location
@@ -550,9 +706,16 @@ export declare interface RouteLocationNamedRaw extends RouteQueryAndHash, Locati
550
706
 
551
707
  /**
552
708
  * Similar to {@link RouteLocation} but its
553
- * {@link RouteLocationNormalized.matched} cannot contain redirect records
709
+ * {@link RouteLocationNormalizedTyped.matched | `matched` property} cannot contain redirect records
554
710
  */
555
- export declare interface RouteLocationNormalized extends _RouteLocationBase {
711
+ export declare type RouteLocationNormalized<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationNormalizedGeneric : RouteLocationNormalizedTypedList<RouteMap>[Name];
712
+
713
+ /**
714
+ * Generic version of {@link RouteLocationNormalized} that is used when no {@link RouteMap} is provided.
715
+ */
716
+ export declare interface RouteLocationNormalizedGeneric extends _RouteLocationBase {
717
+ name: RouteRecordNameGeneric;
718
+ params: RouteParamsGeneric;
556
719
  /**
557
720
  * Array of {@link RouteRecordNormalized}
558
721
  */
@@ -560,18 +723,60 @@ export declare interface RouteLocationNormalized extends _RouteLocationBase {
560
723
  }
561
724
 
562
725
  /**
563
- * {@link RouteLocationRaw} with
726
+ * Similar to {@link RouteLocationNormalized} but its `components` do not contain any function to lazy load components.
727
+ * In other words, it's ready to be rendered by `<RouterView>`.
728
+ */
729
+ export declare type RouteLocationNormalizedLoaded<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationNormalizedLoadedGeneric : RouteLocationNormalizedLoadedTypedList<RouteMap>[Name];
730
+
731
+ /**
732
+ * Generic version of {@link RouteLocationNormalizedLoaded} that is used when no {@link RouteMap} is provided.
564
733
  */
565
- export declare interface RouteLocationNormalizedLoaded extends _RouteLocationBase {
734
+ export declare interface RouteLocationNormalizedLoadedGeneric extends RouteLocationNormalizedGeneric {
566
735
  /**
567
736
  * Array of {@link RouteLocationMatched} containing only plain components (any
568
737
  * lazy-loaded components have been loaded and were replaced inside the
569
738
  * `components` object) so it can be directly used to display routes. It
570
- * cannot contain redirect records either
739
+ * cannot contain redirect records either. **This property is non-enumerable**.
571
740
  */
572
741
  matched: RouteLocationMatched[];
573
742
  }
574
743
 
744
+ /**
745
+ * Helper to generate a type safe version of the {@link RouteLocationNormalizedLoaded} type.
746
+ */
747
+ export declare interface RouteLocationNormalizedLoadedTyped<RouteMap extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> extends RouteLocationNormalizedLoadedGeneric {
748
+ name: Extract<Name, string | symbol>;
749
+ params: RouteMap[Name]['params'];
750
+ }
751
+
752
+ /**
753
+ * List of all possible {@link RouteLocationNormalizedLoaded} indexed by the route name.
754
+ * @internal
755
+ */
756
+ export declare type RouteLocationNormalizedLoadedTypedList<RouteMap extends RouteMapGeneric = RouteMapGeneric> = {
757
+ [N in keyof RouteMap]: RouteLocationNormalizedLoadedTyped<RouteMap, N>;
758
+ };
759
+
760
+ /**
761
+ * Helper to generate a type safe version of the {@link RouteLocationNormalized} type.
762
+ */
763
+ export declare interface RouteLocationNormalizedTyped<RouteMap extends RouteMapGeneric = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> extends RouteLocationNormalizedGeneric {
764
+ name: Extract<Name, string | symbol>;
765
+ params: RouteMap[Name]['params'];
766
+ /**
767
+ * Array of {@link RouteRecordNormalized}
768
+ */
769
+ matched: RouteRecordNormalized[];
770
+ }
771
+
772
+ /**
773
+ * List of all possible {@link RouteLocationNormalized} indexed by the route name.
774
+ * @internal
775
+ */
776
+ export declare type RouteLocationNormalizedTypedList<RouteMap extends RouteMapGeneric = RouteMapGeneric> = {
777
+ [N in keyof RouteMap]: RouteLocationNormalizedTyped<RouteMap, N>;
778
+ };
779
+
575
780
  /**
576
781
  * Common options for all navigation methods.
577
782
  */
@@ -603,9 +808,68 @@ export declare interface RouteLocationPathRaw extends RouteQueryAndHash, Matcher
603
808
  }
604
809
 
605
810
  /**
606
- * User-level route location
811
+ * Route location that can be passed to `router.push()` and other user-facing APIs.
812
+ */
813
+ export declare type RouteLocationRaw<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsString | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric : _LiteralUnion<RouteLocationAsStringTypedList<RouteMap>[Name], string> | RouteLocationAsRelativeTypedList<RouteMap>[Name] | RouteLocationAsPathTypedList<RouteMap>[Name];
814
+
815
+ /**
816
+ * Route location resolved with {@link Router | `router.resolve()`}.
607
817
  */
608
- export declare type RouteLocationRaw = string | RouteLocationPathRaw | RouteLocationNamedRaw;
818
+ export declare type RouteLocationResolved<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationResolvedGeneric : RouteLocationResolvedTypedList<RouteMap>[Name];
819
+
820
+ /**
821
+ * Generic version of {@link RouteLocationResolved}. It is used when no {@link RouteMap} is provided.
822
+ */
823
+ export declare interface RouteLocationResolvedGeneric extends RouteLocationGeneric {
824
+ /**
825
+ * Resolved `href` for the route location that will be set on the `<a href="...">`.
826
+ */
827
+ href: string;
828
+ }
829
+
830
+ /**
831
+ * Helper to generate a type safe version of the {@link RouteLocationResolved} type.
832
+ */
833
+ export declare interface RouteLocationResolvedTyped<RouteMap extends RouteMapGeneric, Name extends keyof RouteMap> extends RouteLocationTyped<RouteMap, Name> {
834
+ /**
835
+ * Resolved `href` for the route location that will be set on the `<a href="...">`.
836
+ */
837
+ href: string;
838
+ }
839
+
840
+ /**
841
+ * List of all possible {@link RouteLocationResolved} indexed by the route name.
842
+ * @internal
843
+ */
844
+ export declare type RouteLocationResolvedTypedList<RouteMap extends RouteMapGeneric = RouteMapGeneric> = {
845
+ [N in keyof RouteMap]: RouteLocationResolvedTyped<RouteMap, N>;
846
+ };
847
+
848
+ /**
849
+ * Helper to generate a type safe version of the {@link RouteLocation} type.
850
+ */
851
+ export declare interface RouteLocationTyped<RouteMap extends RouteMapGeneric, Name extends keyof RouteMap> extends RouteLocationGeneric {
852
+ name: Extract<Name, string | symbol>;
853
+ params: RouteMap[Name]['params'];
854
+ }
855
+
856
+ /**
857
+ * List of all possible {@link RouteLocation} indexed by the route name.
858
+ * @internal
859
+ */
860
+ export declare type RouteLocationTypedList<RouteMap extends RouteMapGeneric = RouteMapGeneric> = {
861
+ [N in keyof RouteMap]: RouteLocationTyped<RouteMap, N>;
862
+ };
863
+
864
+ /**
865
+ * Convenience type to get the typed RouteMap or a generic one if not provided. It is extracted from the {@link TypesConfig} if it exists, it becomes {@link RouteMapGeneric} otherwise.
866
+ */
867
+ export declare type RouteMap = TypesConfig extends Record<'RouteNamedMap', infer RouteNamedMap> ? RouteNamedMap : RouteMapGeneric;
868
+
869
+ /**
870
+ * Generic version of the `RouteMap`.
871
+ */
872
+ export declare type RouteMapGeneric = Record<string | symbol, RouteRecordInfo>;
609
873
 
610
874
  /**
611
875
  * Interface to type `meta` fields in route records.
@@ -620,15 +884,27 @@ export declare type RouteLocationRaw = string | RouteLocationPathRaw | RouteLoca
620
884
  * interface RouteMeta {
621
885
  * requiresAuth?: boolean
622
886
  * }
623
- * }
887
+ * }
624
888
  * ```
625
889
  */
626
890
  export declare interface RouteMeta extends Record<string | number | symbol, unknown> {
627
891
  }
628
892
 
629
- export declare type RouteParams = Record<string, RouteParamValue | RouteParamValue[]>;
893
+ /**
894
+ * Generate a type safe params for a route location. Requires the name of the route to be passed as a generic.
895
+ * @see {@link RouteParamsGeneric}
896
+ */
897
+ export declare type RouteParams<Name extends keyof RouteMap = keyof RouteMap> = RouteMap[Name]['params'];
630
898
 
631
- export declare type RouteParamsRaw = Record<string, RouteParamValueRaw | Exclude<RouteParamValueRaw, null | undefined>[]>;
899
+ export declare type RouteParamsGeneric = Record<string, RouteParamValue | RouteParamValue[]>;
900
+
901
+ /**
902
+ * Generate a type safe raw params for a route location. Requires the name of the route to be passed as a generic.
903
+ * @see {@link RouteParamsRaw}
904
+ */
905
+ export declare type RouteParamsRaw<Name extends keyof RouteMap = keyof RouteMap> = RouteMap[Name]['paramsRaw'];
906
+
907
+ export declare type RouteParamsRawGeneric = Record<string, RouteParamValueRaw | Exclude<RouteParamValueRaw, null | undefined>[]>;
632
908
 
633
909
  /**
634
910
  * @internal
@@ -664,7 +940,7 @@ export declare interface Router {
664
940
  */
665
941
  readonly options: RouterOptions;
666
942
  /**
667
- * Allows turning off the listening of history events. This is a low level api for micro-frontends.
943
+ * Allows turning off the listening of history events. This is a low level api for micro-frontend.
668
944
  */
669
945
  listening: boolean;
670
946
  /**
@@ -673,7 +949,7 @@ export declare interface Router {
673
949
  * @param parentName - Parent Route Record where `route` should be appended at
674
950
  * @param route - Route Record to add
675
951
  */
676
- addRoute(parentName: RouteRecordName, route: RouteRecordRaw): () => void;
952
+ addRoute(parentName: NonNullable<RouteRecordNameGeneric>, route: RouteRecordRaw): () => void;
677
953
  /**
678
954
  * Add a new {@link RouteRecordRaw | route record} to the router.
679
955
  *
@@ -685,17 +961,21 @@ export declare interface Router {
685
961
  *
686
962
  * @param name - Name of the route to remove
687
963
  */
688
- removeRoute(name: RouteRecordName): void;
964
+ removeRoute(name: NonNullable<RouteRecordNameGeneric>): void;
689
965
  /**
690
966
  * Checks if a route with a given name exists
691
967
  *
692
968
  * @param name - Name of the route to check
693
969
  */
694
- hasRoute(name: RouteRecordName): boolean;
970
+ hasRoute(name: NonNullable<RouteRecordNameGeneric>): boolean;
695
971
  /**
696
972
  * Get a full list of all the {@link RouteRecord | route records}.
697
973
  */
698
974
  getRoutes(): RouteRecord[];
975
+ /**
976
+ * Delete all routes from the router matcher.
977
+ */
978
+ clearRoutes(): void;
699
979
  /**
700
980
  * Returns the {@link RouteLocation | normalized version} of a
701
981
  * {@link RouteLocationRaw | route location}. Also includes an `href` property
@@ -705,9 +985,8 @@ export declare interface Router {
705
985
  * @param to - Raw route location to resolve
706
986
  * @param currentLocation - Optional current location to resolve against
707
987
  */
708
- resolve(to: RouteLocationRaw, currentLocation?: RouteLocationNormalizedLoaded): RouteLocation & {
709
- href: string;
710
- };
988
+ resolve<Name extends keyof RouteMap = keyof RouteMap>(to: RouteLocationAsRelativeTyped<RouteMap, Name>, currentLocation?: RouteLocationNormalizedLoaded): RouteLocationResolved<Name>;
989
+ resolve(to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath, currentLocation?: RouteLocationNormalizedLoaded): RouteLocationResolved;
711
990
  /**
712
991
  * Programmatically navigate to a new URL by pushing an entry in the history
713
992
  * stack.
@@ -845,7 +1124,7 @@ export declare interface _RouteRecordBase extends PathParserOptions {
845
1124
  /**
846
1125
  * Name for the route record. Must be unique.
847
1126
  */
848
- name?: RouteRecordName;
1127
+ name?: RouteRecordNameGeneric;
849
1128
  /**
850
1129
  * Before Enter guard specific to this record. Note `beforeEnter` has no
851
1130
  * effect if the record has a `redirect` property.
@@ -865,6 +1144,18 @@ export declare interface _RouteRecordBase extends PathParserOptions {
865
1144
  props?: _RouteRecordProps | Record<string, _RouteRecordProps>;
866
1145
  }
867
1146
 
1147
+ /**
1148
+ * Helper type to define a Typed `RouteRecord`
1149
+ * @see {@link RouteRecord}
1150
+ */
1151
+ export declare interface RouteRecordInfo<Name extends string | symbol = string, Path extends string = string, ParamsRaw extends RouteParamsRawGeneric = RouteParamsRawGeneric, Params extends RouteParamsGeneric = RouteParamsGeneric, Meta extends RouteMeta = RouteMeta> {
1152
+ name: Name;
1153
+ path: Path;
1154
+ paramsRaw: ParamsRaw;
1155
+ params: Params;
1156
+ meta: Meta;
1157
+ }
1158
+
868
1159
  declare interface RouteRecordMatcher extends PathParser {
869
1160
  record: RouteRecord;
870
1161
  parent: RouteRecordMatcher | undefined;
@@ -910,9 +1201,16 @@ export declare interface RouteRecordMultipleViewsWithChildren extends _RouteReco
910
1201
  }
911
1202
 
912
1203
  /**
913
- * Possible values for a user-defined route record's name
1204
+ * Possible values for a route record **after normalization**
1205
+ *
1206
+ * NOTE: since `RouteRecordName` is a type, it evaluates too early and it's often the generic version {@link RouteRecordNameGeneric}. If you need a typed version of all of the names of routes, use {@link RouteMap | `keyof RouteMap`}
914
1207
  */
915
- export declare type RouteRecordName = string | symbol;
1208
+ export declare type RouteRecordName = RouteMapGeneric extends RouteMap ? RouteRecordNameGeneric : keyof RouteMap;
1209
+
1210
+ /**
1211
+ * Generic version of {@link RouteRecordName}.
1212
+ */
1213
+ export declare type RouteRecordNameGeneric = string | symbol | undefined;
916
1214
 
917
1215
  /**
918
1216
  * Normalized version of a {@link RouteRecord | route record}.
@@ -934,6 +1232,11 @@ export declare interface RouteRecordNormalized {
934
1232
  * {@inheritDoc RouteRecordMultipleViews.components}
935
1233
  */
936
1234
  components: RouteRecordMultipleViews['components'] | null | undefined;
1235
+ /**
1236
+ * Contains the original modules for lazy loaded components.
1237
+ * @internal
1238
+ */
1239
+ mods: Record<string, unknown>;
937
1240
  /**
938
1241
  * Nested route records.
939
1242
  */
@@ -988,7 +1291,7 @@ export declare interface RouteRecordNormalized {
988
1291
  /**
989
1292
  * @internal
990
1293
  */
991
- declare type _RouteRecordProps = boolean | Record<string, any> | ((to: RouteLocationNormalized) => Record<string, any>);
1294
+ export declare type _RouteRecordProps<Name extends keyof RouteMap = keyof RouteMap> = boolean | Record<string, any> | ((to: RouteLocationNormalized<Name>) => Record<string, any>);
992
1295
 
993
1296
  export declare type RouteRecordRaw = RouteRecordSingleView | RouteRecordSingleViewWithChildren | RouteRecordMultipleViews | RouteRecordMultipleViewsWithChildren | RouteRecordRedirect;
994
1297
 
@@ -1140,7 +1443,7 @@ export declare interface _RouterLinkI {
1140
1443
  new (): {
1141
1444
  $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterLinkProps;
1142
1445
  $slots: {
1143
- default?: ({ route, href, isActive, isExactActive, navigate, }: UnwrapRef<ReturnType<typeof useLink>>) => VNode[];
1446
+ default?: ({ route, href, isActive, isExactActive, navigate, }: UnwrapRef<UseLinkReturn>) => VNode[];
1144
1447
  };
1145
1448
  };
1146
1449
  /**
@@ -1182,6 +1485,10 @@ export declare interface RouterLinkProps extends RouterLinkOptions {
1182
1485
  * @defaultValue `'page'`
1183
1486
  */
1184
1487
  ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
1488
+ /**
1489
+ * Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
1490
+ */
1491
+ viewTransition?: boolean;
1185
1492
  }
1186
1493
 
1187
1494
  /**
@@ -1191,12 +1498,11 @@ export declare interface RouterLinkProps extends RouterLinkOptions {
1191
1498
  */
1192
1499
  export declare interface RouterMatcher {
1193
1500
  addRoute: (record: RouteRecordRaw, parent?: RouteRecordMatcher) => () => void;
1194
- removeRoute: {
1195
- (matcher: RouteRecordMatcher): void;
1196
- (name: RouteRecordName): void;
1197
- };
1501
+ removeRoute(matcher: RouteRecordMatcher): void;
1502
+ removeRoute(name: NonNullable<RouteRecordNameGeneric>): void;
1503
+ clearRoutes: () => void;
1198
1504
  getRoutes: () => RouteRecordMatcher[];
1199
- getRecordMatcher: (name: RouteRecordName) => RouteRecordMatcher | undefined;
1505
+ getRecordMatcher: (name: NonNullable<RouteRecordNameGeneric>) => RouteRecordMatcher | undefined;
1200
1506
  /**
1201
1507
  * Resolves a location. Gives access to the route record that corresponds to the actual path as well as filling the corresponding params objects
1202
1508
  *
@@ -1293,13 +1599,15 @@ export declare interface RouterScrollBehavior {
1293
1599
  /**
1294
1600
  * Component to display the current route the user is at.
1295
1601
  */
1296
- export declare const RouterView: new () => {
1297
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterViewProps;
1298
- $slots: {
1299
- default?: (({ Component, route, }: {
1300
- Component: VNode;
1301
- route: RouteLocationNormalizedLoaded;
1302
- }) => VNode[]) | undefined;
1602
+ export declare const RouterView: {
1603
+ new (): {
1604
+ $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterViewProps;
1605
+ $slots: {
1606
+ default?: ({ Component, route, }: {
1607
+ Component: VNode;
1608
+ route: RouteLocationNormalizedLoaded;
1609
+ }) => VNode[];
1610
+ };
1303
1611
  };
1304
1612
  };
1305
1613
 
@@ -1347,7 +1655,7 @@ declare interface ScrollPositionElement extends ScrollToOptions {
1347
1655
 
1348
1656
  /**
1349
1657
  * Internal normalized version of {@link ScrollPositionCoordinates} that always
1350
- * has `left` and `top` coordinates.
1658
+ * has `left` and `top` coordinates. Must be a type to be assignable to HistoryStateValue.
1351
1659
  *
1352
1660
  * @internal
1353
1661
  */
@@ -1386,30 +1694,57 @@ export declare const START_LOCATION: RouteLocationNormalizedLoaded;
1386
1694
  export declare function stringifyQuery(query: LocationQueryRaw): string;
1387
1695
 
1388
1696
  /**
1389
- * Allows customizing existing types of the router that are used globally like `$router`, `<RouterLink>`, and `beforeRouteLeave()`. **ONLY FOR INTERNAL USAGE**.
1697
+ * Allows customizing existing types of the router that are used globally like `$router`, `<RouterLink>`, etc. **ONLY FOR INTERNAL USAGE**.
1698
+ *
1699
+ * - `$router` - the router instance
1700
+ * - `$route` - the current route location
1701
+ * - `beforeRouteEnter` - Page component option
1702
+ * - `beforeRouteUpdate` - Page component option
1703
+ * - `beforeRouteLeave` - Page component option
1704
+ * - `RouterLink` - RouterLink Component
1705
+ * - `RouterView` - RouterView Component
1390
1706
  *
1391
1707
  * @internal
1392
1708
  */
1393
1709
  export declare interface TypesConfig {
1394
1710
  }
1395
1711
 
1396
- export declare function useLink(props: UseLinkOptions): {
1397
- route: ComputedRef<RouteLocation & {
1398
- href: string;
1399
- }>;
1712
+ /**
1713
+ * Returns the internal behavior of a {@link RouterLink} without the rendering part.
1714
+ *
1715
+ * @param props - a `to` location and an optional `replace` flag
1716
+ */
1717
+ export declare function useLink<Name extends keyof RouteMap = keyof RouteMap>(props: UseLinkOptions<Name>): UseLinkReturn<Name>;
1718
+
1719
+ /**
1720
+ * Options passed to {@link useLink}.
1721
+ */
1722
+ export declare interface UseLinkOptions<Name extends keyof RouteMap = keyof RouteMap> {
1723
+ to: MaybeRef<RouteLocationAsString | RouteLocationAsRelativeTyped<RouteMap, Name> | RouteLocationAsPath | RouteLocationRaw>;
1724
+ replace?: MaybeRef<boolean | undefined>;
1725
+ /**
1726
+ * Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
1727
+ */
1728
+ viewTransition?: boolean;
1729
+ }
1730
+
1731
+ /**
1732
+ * Return type of {@link useLink}.
1733
+ * @internal
1734
+ */
1735
+ export declare interface UseLinkReturn<Name extends keyof RouteMap = keyof RouteMap> {
1736
+ route: ComputedRef<RouteLocationResolved<Name>>;
1400
1737
  href: ComputedRef<string>;
1401
1738
  isActive: ComputedRef<boolean>;
1402
1739
  isExactActive: ComputedRef<boolean>;
1403
- navigate: (e?: MouseEvent) => Promise<void | NavigationFailure>;
1404
- };
1405
-
1406
- export declare type UseLinkOptions = VueUseOptions<RouterLinkOptions>;
1740
+ navigate(e?: MouseEvent): Promise<void | NavigationFailure>;
1741
+ }
1407
1742
 
1408
1743
  /**
1409
1744
  * Returns the current route location. Equivalent to using `$route` inside
1410
1745
  * templates.
1411
1746
  */
1412
- export declare function useRoute(): RouteLocationNormalizedLoaded;
1747
+ export declare function useRoute<Name extends keyof RouteMap = keyof RouteMap>(_name?: Name): RouteLocationNormalizedLoaded<Name>;
1413
1748
 
1414
1749
  /**
1415
1750
  * Returns the router instance. Equivalent to using `$router` inside
@@ -1423,21 +1758,15 @@ export declare function useRouter(): Router;
1423
1758
  *
1424
1759
  * @internal
1425
1760
  */
1426
- export declare const viewDepthKey: InjectionKey<number | Ref<number>>;
1427
-
1428
- /**
1429
- * Type to transform a static object into one that allows passing Refs as
1430
- * values.
1431
- * @internal
1432
- */
1433
- declare type VueUseOptions<T> = {
1434
- [k in keyof T]: Ref<T[k]> | T[k];
1435
- };
1761
+ export declare const viewDepthKey: InjectionKey<Ref<number> | number>;
1436
1762
 
1437
1763
  export { }
1438
1764
 
1439
- // TODO: figure out why it cannot be 'vue' like said in docs
1440
- declare module '@vue/runtime-core' {
1765
+ /**
1766
+ * NOTE: this used to be `@vue/runtime-core` but it should have been `vue` for a long time. Using both declaration at
1767
+ * the same time breaks so using only one everywhere is the preferred way.
1768
+ */
1769
+ declare module 'vue' {
1441
1770
  export interface ComponentCustomOptions {
1442
1771
  /**
1443
1772
  * Guard called when the router is navigating to the route that is rendering