@poveste/vendors 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (423) hide show
  1. package/README.md +15 -1
  2. package/iconify.d.ts +5 -0
  3. package/iconify.js +5 -0
  4. package/package.json +39 -34
  5. package/pinia.d.ts +5 -0
  6. package/pinia.js +5 -0
  7. package/vue-router.d.ts +5 -0
  8. package/vue-router.js +5 -0
  9. package/vue-use.d.ts +5 -0
  10. package/vue-use.js +5 -0
  11. package/vue.d.ts +5 -0
  12. package/vue.js +9 -0
  13. package/dist/client/b-floating-vue.d.ts +0 -3
  14. package/dist/client/b-floating-vue.js +0 -3377
  15. package/dist/client/b-iconify.d.ts +0 -1
  16. package/dist/client/b-iconify.js +0 -1896
  17. package/dist/client/b-pinia.d.ts +0 -1
  18. package/dist/client/b-pinia.js +0 -1492
  19. package/dist/client/b-scroll.d.ts +0 -2
  20. package/dist/client/b-scroll.js +0 -7
  21. package/dist/client/b-vue-router.d.ts +0 -1
  22. package/dist/client/b-vue-router.js +0 -3058
  23. package/dist/client/b-vue-use.d.ts +0 -1
  24. package/dist/client/b-vue-use.js +0 -10774
  25. package/dist/client/b-vue.d.ts +0 -1
  26. package/dist/client/b-vue.js +0 -1
  27. package/dist/client/devtools-api.js +0 -6568
  28. package/dist/client/index.js +0 -185
  29. package/dist/client/node_modules/@babel/helper-string-parser/package.json +0 -31
  30. package/dist/client/node_modules/@babel/helper-validator-identifier/package.json +0 -31
  31. package/dist/client/node_modules/@babel/parser/package.json +0 -50
  32. package/dist/client/node_modules/@babel/parser/typings/babel-parser.d.ts +0 -262
  33. package/dist/client/node_modules/@babel/types/lib/index-legacy.d.ts +0 -2796
  34. package/dist/client/node_modules/@babel/types/lib/index.d.ts +0 -3616
  35. package/dist/client/node_modules/@babel/types/package.json +0 -39
  36. package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +0 -535
  37. package/dist/client/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +0 -535
  38. package/dist/client/node_modules/@floating-ui/core/package.json +0 -63
  39. package/dist/client/node_modules/@floating-ui/dom/index.d.ts +0 -1
  40. package/dist/client/node_modules/@floating-ui/dom/package.json +0 -74
  41. package/dist/client/node_modules/@floating-ui/dom/src/autoUpdate.d.ts +0 -31
  42. package/dist/client/node_modules/@floating-ui/dom/src/index.d.ts +0 -11
  43. package/dist/client/node_modules/@floating-ui/dom/src/platform.d.ts +0 -2
  44. package/dist/client/node_modules/@floating-ui/dom/src/types.d.ts +0 -128
  45. package/dist/client/node_modules/@floating-ui/dom/src/utils/convertOffsetParentRelativeRectToViewportRelativeRect.d.ts +0 -6
  46. package/dist/client/node_modules/@floating-ui/dom/src/utils/getBoundingClientRect.d.ts +0 -2
  47. package/dist/client/node_modules/@floating-ui/dom/src/utils/getClippingRect.d.ts +0 -12
  48. package/dist/client/node_modules/@floating-ui/dom/src/utils/getComputedStyle.d.ts +0 -1
  49. package/dist/client/node_modules/@floating-ui/dom/src/utils/getCssDimensions.d.ts +0 -4
  50. package/dist/client/node_modules/@floating-ui/dom/src/utils/getDimensions.d.ts +0 -2
  51. package/dist/client/node_modules/@floating-ui/dom/src/utils/getDocumentElement.d.ts +0 -1
  52. package/dist/client/node_modules/@floating-ui/dom/src/utils/getDocumentRect.d.ts +0 -2
  53. package/dist/client/node_modules/@floating-ui/dom/src/utils/getNearestOverflowAncestor.d.ts +0 -1
  54. package/dist/client/node_modules/@floating-ui/dom/src/utils/getNodeName.d.ts +0 -1
  55. package/dist/client/node_modules/@floating-ui/dom/src/utils/getNodeScroll.d.ts +0 -2
  56. package/dist/client/node_modules/@floating-ui/dom/src/utils/getOffsetParent.d.ts +0 -1
  57. package/dist/client/node_modules/@floating-ui/dom/src/utils/getOverflowAncestors.d.ts +0 -3
  58. package/dist/client/node_modules/@floating-ui/dom/src/utils/getParentNode.d.ts +0 -1
  59. package/dist/client/node_modules/@floating-ui/dom/src/utils/getRectRelativeToOffsetParent.d.ts +0 -2
  60. package/dist/client/node_modules/@floating-ui/dom/src/utils/getScale.d.ts +0 -7
  61. package/dist/client/node_modules/@floating-ui/dom/src/utils/getViewportRect.d.ts +0 -2
  62. package/dist/client/node_modules/@floating-ui/dom/src/utils/getWindowScrollBarX.d.ts +0 -1
  63. package/dist/client/node_modules/@floating-ui/dom/src/utils/is.d.ts +0 -17
  64. package/dist/client/node_modules/@floating-ui/dom/src/utils/math.d.ts +0 -3
  65. package/dist/client/node_modules/@floating-ui/dom/src/utils/unwrapElement.d.ts +0 -2
  66. package/dist/client/node_modules/@floating-ui/dom/src/utils/userAgent.d.ts +0 -1
  67. package/dist/client/node_modules/@floating-ui/dom/src/utils/window.d.ts +0 -1
  68. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +0 -105
  69. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +0 -105
  70. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +0 -47
  71. package/dist/client/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +0 -47
  72. package/dist/client/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +0 -47
  73. package/dist/client/node_modules/@floating-ui/utils/dom/package.json +0 -6
  74. package/dist/client/node_modules/@floating-ui/utils/package.json +0 -70
  75. package/dist/client/node_modules/@iconify/types/package.json +0 -23
  76. package/dist/client/node_modules/@iconify/types/provider.d.ts +0 -44
  77. package/dist/client/node_modules/@iconify/types/types.d.ts +0 -272
  78. package/dist/client/node_modules/@iconify/vue/dist/iconify.d.ts +0 -420
  79. package/dist/client/node_modules/@iconify/vue/dist/offline.d.ts +0 -109
  80. package/dist/client/node_modules/@iconify/vue/offline/package.json +0 -14
  81. package/dist/client/node_modules/@iconify/vue/package.json +0 -62
  82. package/dist/client/node_modules/@jridgewell/gen-mapping/dist/types/gen-mapping.d.ts +0 -88
  83. package/dist/client/node_modules/@jridgewell/gen-mapping/dist/types/set-array.d.ts +0 -32
  84. package/dist/client/node_modules/@jridgewell/gen-mapping/dist/types/sourcemap-segment.d.ts +0 -12
  85. package/dist/client/node_modules/@jridgewell/gen-mapping/dist/types/types.d.ts +0 -43
  86. package/dist/client/node_modules/@jridgewell/gen-mapping/package.json +0 -67
  87. package/dist/client/node_modules/@jridgewell/gen-mapping/types/gen-mapping.d.mts +0 -89
  88. package/dist/client/node_modules/@jridgewell/gen-mapping/types/set-array.d.mts +0 -33
  89. package/dist/client/node_modules/@jridgewell/gen-mapping/types/sourcemap-segment.d.mts +0 -13
  90. package/dist/client/node_modules/@jridgewell/gen-mapping/types/types.d.mts +0 -44
  91. package/dist/client/node_modules/@jridgewell/remapping/package.json +0 -71
  92. package/dist/client/node_modules/@jridgewell/remapping/types/build-source-map-tree.d.mts +0 -15
  93. package/dist/client/node_modules/@jridgewell/remapping/types/remapping.d.mts +0 -21
  94. package/dist/client/node_modules/@jridgewell/remapping/types/source-map-tree.d.mts +0 -46
  95. package/dist/client/node_modules/@jridgewell/remapping/types/source-map.d.mts +0 -19
  96. package/dist/client/node_modules/@jridgewell/remapping/types/types.d.mts +0 -16
  97. package/dist/client/node_modules/@jridgewell/resolve-uri/dist/types/resolve-uri.d.ts +0 -4
  98. package/dist/client/node_modules/@jridgewell/resolve-uri/package.json +0 -69
  99. package/dist/client/node_modules/@jridgewell/sourcemap-codec/package.json +0 -64
  100. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/range-mappings.d.mts +0 -5
  101. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/scopes.d.mts +0 -50
  102. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/sourcemap-codec.d.mts +0 -11
  103. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/strings.d.mts +0 -16
  104. package/dist/client/node_modules/@jridgewell/sourcemap-codec/types/vlq.d.mts +0 -9
  105. package/dist/client/node_modules/@jridgewell/trace-mapping/package.json +0 -67
  106. package/dist/client/node_modules/@jridgewell/trace-mapping/types/binary-search.d.mts +0 -33
  107. package/dist/client/node_modules/@jridgewell/trace-mapping/types/by-source.d.mts +0 -4
  108. package/dist/client/node_modules/@jridgewell/trace-mapping/types/flatten-map.d.mts +0 -9
  109. package/dist/client/node_modules/@jridgewell/trace-mapping/types/resolve.d.mts +0 -4
  110. package/dist/client/node_modules/@jridgewell/trace-mapping/types/sort.d.mts +0 -4
  111. package/dist/client/node_modules/@jridgewell/trace-mapping/types/sourcemap-segment.d.mts +0 -17
  112. package/dist/client/node_modules/@jridgewell/trace-mapping/types/strip-filename.d.mts +0 -5
  113. package/dist/client/node_modules/@jridgewell/trace-mapping/types/trace-mapping.d.mts +0 -80
  114. package/dist/client/node_modules/@jridgewell/trace-mapping/types/types.d.mts +0 -107
  115. package/dist/client/node_modules/@types/web-bluetooth/index.d.ts +0 -265
  116. package/dist/client/node_modules/@types/web-bluetooth/package.json +0 -46
  117. package/dist/client/node_modules/@vue/compiler-core/dist/compiler-core.d.ts +0 -1120
  118. package/dist/client/node_modules/@vue/compiler-core/package.json +0 -58
  119. package/dist/client/node_modules/@vue/compiler-dom/dist/compiler-dom.d.ts +0 -45
  120. package/dist/client/node_modules/@vue/compiler-dom/package.json +0 -57
  121. package/dist/client/node_modules/@vue/compiler-sfc/dist/compiler-sfc.d.ts +0 -487
  122. package/dist/client/node_modules/@vue/compiler-sfc/package.json +0 -67
  123. package/dist/client/node_modules/@vue/compiler-ssr/dist/compiler-ssr.d.ts +0 -4
  124. package/dist/client/node_modules/@vue/compiler-ssr/package.json +0 -34
  125. package/dist/client/node_modules/@vue/devtools-api/dist/index-node.d.ts +0 -11
  126. package/dist/client/node_modules/@vue/devtools-api/dist/index.d.ts +0 -2
  127. package/dist/client/node_modules/@vue/devtools-api/package.json +0 -38
  128. package/dist/client/node_modules/@vue/devtools-kit/dist/index.d.ts +0 -1170
  129. package/dist/client/node_modules/@vue/devtools-kit/global.d.ts +0 -20
  130. package/dist/client/node_modules/@vue/devtools-kit/package.json +0 -44
  131. package/dist/client/node_modules/@vue/devtools-kit/types.d.ts +0 -2
  132. package/dist/client/node_modules/@vue/devtools-shared/dist/index.d.ts +0 -40
  133. package/dist/client/node_modules/@vue/devtools-shared/package.json +0 -33
  134. package/dist/client/node_modules/@vue/reactivity/dist/reactivity.d.ts +0 -757
  135. package/dist/client/node_modules/@vue/reactivity/package.json +0 -55
  136. package/dist/client/node_modules/@vue/runtime-core/dist/runtime-core.d.ts +0 -1868
  137. package/dist/client/node_modules/@vue/runtime-core/package.json +0 -52
  138. package/dist/client/node_modules/@vue/runtime-dom/dist/runtime-dom.d.ts +0 -1452
  139. package/dist/client/node_modules/@vue/runtime-dom/package.json +0 -60
  140. package/dist/client/node_modules/@vue/server-renderer/dist/server-renderer.d.ts +0 -65
  141. package/dist/client/node_modules/@vue/server-renderer/package.json +0 -53
  142. package/dist/client/node_modules/@vue/shared/dist/shared.d.ts +0 -334
  143. package/dist/client/node_modules/@vue/shared/package.json +0 -47
  144. package/dist/client/node_modules/@vue-macros/common/dist/index.d.ts +0 -124
  145. package/dist/client/node_modules/@vue-macros/common/package.json +0 -63
  146. package/dist/client/node_modules/@vueuse/core/dist/index.d.ts +0 -5860
  147. package/dist/client/node_modules/@vueuse/core/dist/metadata.d.mts +0 -1
  148. package/dist/client/node_modules/@vueuse/core/package.json +0 -56
  149. package/dist/client/node_modules/@vueuse/metadata/dist/index.d.ts +0 -81
  150. package/dist/client/node_modules/@vueuse/metadata/package.json +0 -41
  151. package/dist/client/node_modules/@vueuse/shared/dist/index.d.ts +0 -1511
  152. package/dist/client/node_modules/@vueuse/shared/package.json +0 -45
  153. package/dist/client/node_modules/acorn/dist/acorn.d.mts +0 -897
  154. package/dist/client/node_modules/acorn/dist/acorn.d.ts +0 -897
  155. package/dist/client/node_modules/acorn/package.json +0 -50
  156. package/dist/client/node_modules/ast-kit/dist/index.d.ts +0 -380
  157. package/dist/client/node_modules/ast-kit/package.json +0 -63
  158. package/dist/client/node_modules/ast-walker-scope/dist/index.d.mts +0 -51
  159. package/dist/client/node_modules/ast-walker-scope/package.json +0 -60
  160. package/dist/client/node_modules/birpc/dist/index.d.mts +0 -215
  161. package/dist/client/node_modules/birpc/dist/index.d.ts +0 -215
  162. package/dist/client/node_modules/birpc/package.json +0 -57
  163. package/dist/client/node_modules/chokidar/handler.d.ts +0 -90
  164. package/dist/client/node_modules/chokidar/index.d.ts +0 -217
  165. package/dist/client/node_modules/chokidar/package.json +0 -63
  166. package/dist/client/node_modules/compute-scroll-into-view/dist/index.d.ts +0 -75
  167. package/dist/client/node_modules/compute-scroll-into-view/package.json +0 -82
  168. package/dist/client/node_modules/confbox/dist/_chunks/_format.d.mts +0 -25
  169. package/dist/client/node_modules/confbox/dist/index.d.mts +0 -34
  170. package/dist/client/node_modules/confbox/dist/ini.d.mts +0 -62
  171. package/dist/client/node_modules/confbox/dist/json5.d.mts +0 -59
  172. package/dist/client/node_modules/confbox/dist/jsonc.d.mts +0 -41
  173. package/dist/client/node_modules/confbox/dist/toml.d.mts +0 -23
  174. package/dist/client/node_modules/confbox/dist/yaml.d.mts +0 -96
  175. package/dist/client/node_modules/confbox/package.json +0 -67
  176. package/dist/client/node_modules/csstype/index.d.ts +0 -22569
  177. package/dist/client/node_modules/csstype/package.json +0 -70
  178. package/dist/client/node_modules/entities/decode.d.ts +0 -3
  179. package/dist/client/node_modules/entities/dist/commonjs/decode-codepoint.d.ts +0 -19
  180. package/dist/client/node_modules/entities/dist/commonjs/decode.d.ts +0 -205
  181. package/dist/client/node_modules/entities/dist/commonjs/encode.d.ts +0 -22
  182. package/dist/client/node_modules/entities/dist/commonjs/escape.d.ts +0 -46
  183. package/dist/client/node_modules/entities/dist/commonjs/generated/decode-data-html.d.ts +0 -2
  184. package/dist/client/node_modules/entities/dist/commonjs/generated/decode-data-xml.d.ts +0 -2
  185. package/dist/client/node_modules/entities/dist/commonjs/generated/encode-html.d.ts +0 -3
  186. package/dist/client/node_modules/entities/dist/commonjs/index.d.ts +0 -96
  187. package/dist/client/node_modules/entities/dist/commonjs/internal/bin-trie-flags.d.ts +0 -17
  188. package/dist/client/node_modules/entities/dist/commonjs/internal/decode-shared.d.ts +0 -2
  189. package/dist/client/node_modules/entities/dist/commonjs/internal/encode-shared.d.ts +0 -32
  190. package/dist/client/node_modules/entities/dist/commonjs/package.json +0 -3
  191. package/dist/client/node_modules/entities/dist/esm/decode-codepoint.d.ts +0 -19
  192. package/dist/client/node_modules/entities/dist/esm/decode.d.ts +0 -205
  193. package/dist/client/node_modules/entities/dist/esm/encode.d.ts +0 -22
  194. package/dist/client/node_modules/entities/dist/esm/escape.d.ts +0 -46
  195. package/dist/client/node_modules/entities/dist/esm/generated/decode-data-html.d.ts +0 -2
  196. package/dist/client/node_modules/entities/dist/esm/generated/decode-data-xml.d.ts +0 -2
  197. package/dist/client/node_modules/entities/dist/esm/generated/encode-html.d.ts +0 -3
  198. package/dist/client/node_modules/entities/dist/esm/index.d.ts +0 -96
  199. package/dist/client/node_modules/entities/dist/esm/internal/bin-trie-flags.d.ts +0 -17
  200. package/dist/client/node_modules/entities/dist/esm/internal/decode-shared.d.ts +0 -2
  201. package/dist/client/node_modules/entities/dist/esm/internal/encode-shared.d.ts +0 -32
  202. package/dist/client/node_modules/entities/dist/esm/package.json +0 -3
  203. package/dist/client/node_modules/entities/escape.d.ts +0 -3
  204. package/dist/client/node_modules/entities/package.json +0 -120
  205. package/dist/client/node_modules/estree-walker/dist/esm/package.json +0 -1
  206. package/dist/client/node_modules/estree-walker/package.json +0 -37
  207. package/dist/client/node_modules/estree-walker/src/package.json +0 -1
  208. package/dist/client/node_modules/estree-walker/types/async.d.ts +0 -53
  209. package/dist/client/node_modules/estree-walker/types/index.d.ts +0 -56
  210. package/dist/client/node_modules/estree-walker/types/sync.d.ts +0 -53
  211. package/dist/client/node_modules/estree-walker/types/walker.d.ts +0 -37
  212. package/dist/client/node_modules/exsolve/dist/index.d.mts +0 -66
  213. package/dist/client/node_modules/exsolve/package.json +0 -42
  214. package/dist/client/node_modules/fdir/dist/index.d.mts +0 -155
  215. package/dist/client/node_modules/fdir/package.json +0 -103
  216. package/dist/client/node_modules/floating-vue/dist/components/Dropdown.d.ts +0 -398
  217. package/dist/client/node_modules/floating-vue/dist/components/Menu.d.ts +0 -398
  218. package/dist/client/node_modules/floating-vue/dist/components/Popper.d.ts +0 -495
  219. package/dist/client/node_modules/floating-vue/dist/components/Popper.vue.d.ts +0 -474
  220. package/dist/client/node_modules/floating-vue/dist/components/PopperContent.vue.d.ts +0 -37
  221. package/dist/client/node_modules/floating-vue/dist/components/PopperMethods.d.ts +0 -9
  222. package/dist/client/node_modules/floating-vue/dist/components/PopperWrapper.vue.d.ts +0 -414
  223. package/dist/client/node_modules/floating-vue/dist/components/ThemeClass.d.ts +0 -6
  224. package/dist/client/node_modules/floating-vue/dist/components/Tooltip.d.ts +0 -398
  225. package/dist/client/node_modules/floating-vue/dist/components/TooltipDirective.vue.d.ts +0 -67
  226. package/dist/client/node_modules/floating-vue/dist/config.d.ts +0 -11
  227. package/dist/client/node_modules/floating-vue/dist/directives/v-close-popper.d.ts +0 -13
  228. package/dist/client/node_modules/floating-vue/dist/directives/v-tooltip.d.ts +0 -27
  229. package/dist/client/node_modules/floating-vue/dist/directives/v-tooltip.spec.d.ts +0 -1
  230. package/dist/client/node_modules/floating-vue/dist/index.d.ts +0 -2239
  231. package/dist/client/node_modules/floating-vue/dist/util/assign-deep.d.ts +0 -1
  232. package/dist/client/node_modules/floating-vue/dist/util/env.d.ts +0 -2
  233. package/dist/client/node_modules/floating-vue/dist/util/events.d.ts +0 -14
  234. package/dist/client/node_modules/floating-vue/dist/util/frame.d.ts +0 -1
  235. package/dist/client/node_modules/floating-vue/dist/util/lang.d.ts +0 -1
  236. package/dist/client/node_modules/floating-vue/dist/util/popper.d.ts +0 -3
  237. package/dist/client/node_modules/floating-vue/package.json +0 -80
  238. package/dist/client/node_modules/hookable/dist/index.d.ts +0 -103
  239. package/dist/client/node_modules/hookable/package.json +0 -49
  240. package/dist/client/node_modules/local-pkg/dist/index.d.mts +0 -42
  241. package/dist/client/node_modules/local-pkg/dist/index.d.ts +0 -42
  242. package/dist/client/node_modules/local-pkg/package.json +0 -65
  243. package/dist/client/node_modules/magic-string/dist/magic-string.cjs.d.ts +0 -289
  244. package/dist/client/node_modules/magic-string/dist/magic-string.es.d.mts +0 -289
  245. package/dist/client/node_modules/magic-string/package.json +0 -67
  246. package/dist/client/node_modules/magic-string-ast/dist/index.d.ts +0 -67
  247. package/dist/client/node_modules/magic-string-ast/package.json +0 -64
  248. package/dist/client/node_modules/mlly/dist/index.d.mts +0 -564
  249. package/dist/client/node_modules/mlly/dist/index.d.ts +0 -564
  250. package/dist/client/node_modules/mlly/node_modules/confbox/dist/index.d.mts +0 -32
  251. package/dist/client/node_modules/mlly/node_modules/confbox/dist/index.d.ts +0 -32
  252. package/dist/client/node_modules/mlly/node_modules/confbox/dist/json5.d.mts +0 -58
  253. package/dist/client/node_modules/mlly/node_modules/confbox/dist/json5.d.ts +0 -58
  254. package/dist/client/node_modules/mlly/node_modules/confbox/dist/jsonc.d.mts +0 -41
  255. package/dist/client/node_modules/mlly/node_modules/confbox/dist/jsonc.d.ts +0 -41
  256. package/dist/client/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.mts +0 -24
  257. package/dist/client/node_modules/mlly/node_modules/confbox/dist/shared/confbox.9745c98f.d.ts +0 -24
  258. package/dist/client/node_modules/mlly/node_modules/confbox/dist/toml.d.mts +0 -22
  259. package/dist/client/node_modules/mlly/node_modules/confbox/dist/toml.d.ts +0 -22
  260. package/dist/client/node_modules/mlly/node_modules/confbox/dist/yaml.d.mts +0 -95
  261. package/dist/client/node_modules/mlly/node_modules/confbox/dist/yaml.d.ts +0 -95
  262. package/dist/client/node_modules/mlly/node_modules/confbox/json5.d.ts +0 -2
  263. package/dist/client/node_modules/mlly/node_modules/confbox/jsonc.d.ts +0 -2
  264. package/dist/client/node_modules/mlly/node_modules/confbox/package.json +0 -86
  265. package/dist/client/node_modules/mlly/node_modules/confbox/toml.d.ts +0 -2
  266. package/dist/client/node_modules/mlly/node_modules/confbox/yaml.d.ts +0 -2
  267. package/dist/client/node_modules/mlly/node_modules/pkg-types/dist/index.d.mts +0 -411
  268. package/dist/client/node_modules/mlly/node_modules/pkg-types/dist/index.d.ts +0 -411
  269. package/dist/client/node_modules/mlly/node_modules/pkg-types/package.json +0 -47
  270. package/dist/client/node_modules/mlly/package.json +0 -55
  271. package/dist/client/node_modules/muggle-string/out/base.d.ts +0 -6
  272. package/dist/client/node_modules/muggle-string/out/basic.d.ts +0 -6
  273. package/dist/client/node_modules/muggle-string/out/binarySearch.d.ts +0 -1
  274. package/dist/client/node_modules/muggle-string/out/common.d.ts +0 -9
  275. package/dist/client/node_modules/muggle-string/out/getLength.d.ts +0 -2
  276. package/dist/client/node_modules/muggle-string/out/index.d.ts +0 -10
  277. package/dist/client/node_modules/muggle-string/out/map.d.ts +0 -3
  278. package/dist/client/node_modules/muggle-string/out/overwriteSource.d.ts +0 -3
  279. package/dist/client/node_modules/muggle-string/out/replace.d.ts +0 -3
  280. package/dist/client/node_modules/muggle-string/out/segment.d.ts +0 -6
  281. package/dist/client/node_modules/muggle-string/out/sourceBased.d.ts +0 -3
  282. package/dist/client/node_modules/muggle-string/out/toString.d.ts +0 -2
  283. package/dist/client/node_modules/muggle-string/out/track.d.ts +0 -6
  284. package/dist/client/node_modules/muggle-string/out/types.d.ts +0 -16
  285. package/dist/client/node_modules/muggle-string/package.json +0 -22
  286. package/dist/client/node_modules/nanoid/async/index.d.ts +0 -56
  287. package/dist/client/node_modules/nanoid/async/package.json +0 -12
  288. package/dist/client/node_modules/nanoid/index.d.ts +0 -91
  289. package/dist/client/node_modules/nanoid/non-secure/index.d.ts +0 -33
  290. package/dist/client/node_modules/nanoid/non-secure/package.json +0 -6
  291. package/dist/client/node_modules/nanoid/package.json +0 -89
  292. package/dist/client/node_modules/nanoid/url-alphabet/package.json +0 -6
  293. package/dist/client/node_modules/nostics/dist/diagnostic-wduO7saY.d.mts +0 -295
  294. package/dist/client/node_modules/nostics/dist/formatters/ansi.d.mts +0 -15
  295. package/dist/client/node_modules/nostics/dist/formatters/json.d.mts +0 -7
  296. package/dist/client/node_modules/nostics/dist/index.d.mts +0 -51
  297. package/dist/client/node_modules/nostics/dist/reporters/dev.d.mts +0 -13
  298. package/dist/client/node_modules/nostics/dist/reporters/fetch.d.mts +0 -11
  299. package/dist/client/node_modules/nostics/dist/reporters/node.d.mts +0 -43
  300. package/dist/client/node_modules/nostics/package.json +0 -125
  301. package/dist/client/node_modules/pathe/dist/index.d.mts +0 -47
  302. package/dist/client/node_modules/pathe/dist/index.d.ts +0 -47
  303. package/dist/client/node_modules/pathe/dist/utils.d.mts +0 -32
  304. package/dist/client/node_modules/pathe/dist/utils.d.ts +0 -32
  305. package/dist/client/node_modules/pathe/package.json +0 -61
  306. package/dist/client/node_modules/pathe/utils.d.ts +0 -1
  307. package/dist/client/node_modules/perfect-debounce/dist/index.d.mts +0 -49
  308. package/dist/client/node_modules/perfect-debounce/package.json +0 -41
  309. package/dist/client/node_modules/picocolors/package.json +0 -25
  310. package/dist/client/node_modules/picocolors/picocolors.d.ts +0 -5
  311. package/dist/client/node_modules/picocolors/types.d.ts +0 -51
  312. package/dist/client/node_modules/picomatch/package.json +0 -83
  313. package/dist/client/node_modules/pinia/dist/pinia.d.ts +0 -955
  314. package/dist/client/node_modules/pinia/package.json +0 -82
  315. package/dist/client/node_modules/pkg-types/dist/index.d.mts +0 -695
  316. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/_chunks/_format.d.mts +0 -22
  317. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/_chunks/libs/js-yaml.d.mts +0 -33
  318. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/index.d.mts +0 -7
  319. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/ini.d.mts +0 -59
  320. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/json.d.mts +0 -25
  321. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/json5.d.mts +0 -55
  322. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/jsonc.d.mts +0 -29
  323. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/toml.d.mts +0 -20
  324. package/dist/client/node_modules/pkg-types/node_modules/confbox/dist/yaml.d.mts +0 -101
  325. package/dist/client/node_modules/pkg-types/node_modules/confbox/package.json +0 -68
  326. package/dist/client/node_modules/pkg-types/package.json +0 -47
  327. package/dist/client/node_modules/postcss/lib/at-rule.d.ts +0 -139
  328. package/dist/client/node_modules/postcss/lib/comment.d.ts +0 -67
  329. package/dist/client/node_modules/postcss/lib/container.d.ts +0 -474
  330. package/dist/client/node_modules/postcss/lib/css-syntax-error.d.ts +0 -247
  331. package/dist/client/node_modules/postcss/lib/declaration.d.ts +0 -150
  332. package/dist/client/node_modules/postcss/lib/document.d.ts +0 -68
  333. package/dist/client/node_modules/postcss/lib/fromJSON.d.ts +0 -9
  334. package/dist/client/node_modules/postcss/lib/input.d.ts +0 -226
  335. package/dist/client/node_modules/postcss/lib/lazy-result.d.ts +0 -189
  336. package/dist/client/node_modules/postcss/lib/list.d.ts +0 -60
  337. package/dist/client/node_modules/postcss/lib/no-work-result.d.ts +0 -45
  338. package/dist/client/node_modules/postcss/lib/node.d.ts +0 -555
  339. package/dist/client/node_modules/postcss/lib/parse.d.ts +0 -9
  340. package/dist/client/node_modules/postcss/lib/postcss.d.mts +0 -66
  341. package/dist/client/node_modules/postcss/lib/postcss.d.ts +0 -464
  342. package/dist/client/node_modules/postcss/lib/previous-map.d.ts +0 -80
  343. package/dist/client/node_modules/postcss/lib/processor.d.ts +0 -114
  344. package/dist/client/node_modules/postcss/lib/result.d.ts +0 -204
  345. package/dist/client/node_modules/postcss/lib/root.d.ts +0 -86
  346. package/dist/client/node_modules/postcss/lib/rule.d.ts +0 -126
  347. package/dist/client/node_modules/postcss/lib/stringifier.d.ts +0 -45
  348. package/dist/client/node_modules/postcss/lib/stringify.d.ts +0 -9
  349. package/dist/client/node_modules/postcss/lib/warning.d.ts +0 -146
  350. package/dist/client/node_modules/postcss/package.json +0 -88
  351. package/dist/client/node_modules/quansync/dist/index.d.mts +0 -22
  352. package/dist/client/node_modules/quansync/dist/index.d.ts +0 -22
  353. package/dist/client/node_modules/quansync/dist/macro.d.mts +0 -18
  354. package/dist/client/node_modules/quansync/dist/macro.d.ts +0 -18
  355. package/dist/client/node_modules/quansync/dist/types.d.mts +0 -27
  356. package/dist/client/node_modules/quansync/dist/types.d.ts +0 -27
  357. package/dist/client/node_modules/quansync/package.json +0 -95
  358. package/dist/client/node_modules/readdirp/index.d.ts +0 -117
  359. package/dist/client/node_modules/readdirp/package.json +0 -62
  360. package/dist/client/node_modules/scroll-into-view-if-needed/dist/index.d.ts +0 -79
  361. package/dist/client/node_modules/scroll-into-view-if-needed/package.json +0 -80
  362. package/dist/client/node_modules/scule/dist/index.d.mts +0 -57
  363. package/dist/client/node_modules/scule/dist/index.d.ts +0 -57
  364. package/dist/client/node_modules/scule/package.json +0 -43
  365. package/dist/client/node_modules/source-map-js/lib/source-map-consumer.d.ts +0 -1
  366. package/dist/client/node_modules/source-map-js/lib/source-map-generator.d.ts +0 -1
  367. package/dist/client/node_modules/source-map-js/lib/source-node.d.ts +0 -1
  368. package/dist/client/node_modules/source-map-js/package.json +0 -71
  369. package/dist/client/node_modules/source-map-js/source-map.d.ts +0 -104
  370. package/dist/client/node_modules/tinyglobby/dist/index.d.mts +0 -148
  371. package/dist/client/node_modules/tinyglobby/package.json +0 -70
  372. package/dist/client/node_modules/ufo/dist/index.d.mts +0 -714
  373. package/dist/client/node_modules/ufo/dist/index.d.ts +0 -714
  374. package/dist/client/node_modules/ufo/package.json +0 -48
  375. package/dist/client/node_modules/unplugin/dist/index.d.mts +0 -241
  376. package/dist/client/node_modules/unplugin/dist/rspack/loaders/load.d.mts +0 -4
  377. package/dist/client/node_modules/unplugin/dist/rspack/loaders/transform.d.mts +0 -4
  378. package/dist/client/node_modules/unplugin/dist/webpack/loaders/load.d.mts +0 -4
  379. package/dist/client/node_modules/unplugin/dist/webpack/loaders/transform.d.mts +0 -4
  380. package/dist/client/node_modules/unplugin/package.json +0 -146
  381. package/dist/client/node_modules/unplugin-utils/dist/index.d.ts +0 -31
  382. package/dist/client/node_modules/unplugin-utils/package.json +0 -61
  383. package/dist/client/node_modules/vue/compiler-sfc/index.d.mts +0 -1
  384. package/dist/client/node_modules/vue/compiler-sfc/index.d.ts +0 -1
  385. package/dist/client/node_modules/vue/compiler-sfc/package.json +0 -4
  386. package/dist/client/node_modules/vue/dist/vue.d.mts +0 -7
  387. package/dist/client/node_modules/vue/dist/vue.d.ts +0 -7
  388. package/dist/client/node_modules/vue/jsx-runtime/index.d.ts +0 -25
  389. package/dist/client/node_modules/vue/jsx-runtime/package.json +0 -5
  390. package/dist/client/node_modules/vue/jsx.d.ts +0 -22
  391. package/dist/client/node_modules/vue/package.json +0 -112
  392. package/dist/client/node_modules/vue/server-renderer/index.d.mts +0 -1
  393. package/dist/client/node_modules/vue/server-renderer/index.d.ts +0 -1
  394. package/dist/client/node_modules/vue/server-renderer/package.json +0 -4
  395. package/dist/client/node_modules/vue-resize/package.json +0 -77
  396. package/dist/client/node_modules/vue-router/dist/experimental/index.d.ts +0 -7
  397. package/dist/client/node_modules/vue-router/dist/experimental/pinia-colada.d.ts +0 -151
  398. package/dist/client/node_modules/vue-router/dist/index-D7ja2BKs.d.ts +0 -3293
  399. package/dist/client/node_modules/vue-router/dist/options-CwYZKRl4.d.mts +0 -2923
  400. package/dist/client/node_modules/vue-router/dist/unplugin/esbuild.d.mts +0 -10
  401. package/dist/client/node_modules/vue-router/dist/unplugin/index.d.mts +0 -62
  402. package/dist/client/node_modules/vue-router/dist/unplugin/options.d.mts +0 -7
  403. package/dist/client/node_modules/vue-router/dist/unplugin/rolldown.d.mts +0 -10
  404. package/dist/client/node_modules/vue-router/dist/unplugin/rollup.d.mts +0 -10
  405. package/dist/client/node_modules/vue-router/dist/unplugin/types.d.mts +0 -7
  406. package/dist/client/node_modules/vue-router/dist/unplugin/vite.d.mts +0 -10
  407. package/dist/client/node_modules/vue-router/dist/unplugin/webpack.d.mts +0 -10
  408. package/dist/client/node_modules/vue-router/dist/vue-router.d.ts +0 -7
  409. package/dist/client/node_modules/vue-router/package.json +0 -211
  410. package/dist/client/node_modules/vue-router/vue-router-auto-resolver.d.mts +0 -27
  411. package/dist/client/node_modules/vue-router/vue-router-auto-routes.d.mts +0 -53
  412. package/dist/client/node_modules/vue-router/vue-router-auto.d.ts +0 -2
  413. package/dist/client/node_modules/webpack-virtual-modules/lib/index.d.ts +0 -15
  414. package/dist/client/node_modules/webpack-virtual-modules/lib/virtual-stats.d.ts +0 -11
  415. package/dist/client/node_modules/webpack-virtual-modules/package.json +0 -82
  416. package/dist/client/vue.runtime.esm-bundler.js +0 -13389
  417. package/src/client/b-floating-vue.ts +0 -5
  418. package/src/client/b-iconify.ts +0 -1
  419. package/src/client/b-pinia.ts +0 -1
  420. package/src/client/b-scroll.ts +0 -4
  421. package/src/client/b-vue-router.ts +0 -1
  422. package/src/client/b-vue-use.ts +0 -1
  423. package/src/client/b-vue.ts +0 -1
@@ -1,3293 +0,0 @@
1
- /*!
2
- * vue-router v5.3.1
3
- * (c) 2026 Eduardo San Martin Morote
4
- * @license MIT
5
- */
6
- import { AllowedComponentProps, AnchorHTMLAttributes, App, Component as Component$1, ComponentCustomProps, ComponentPublicInstance, ComputedRef, DefineComponent, EffectScope, InjectionKey, MaybeRef, Ref, ShallowRef, UnwrapRef, VNode, VNodeProps } from "vue";
7
- //#region src/experimental/data-loaders/symbols.d.ts
8
- /**
9
- * Retrieves the internal version of loaders.
10
- * @internal
11
- */
12
- declare const LOADER_SET_KEY: unique symbol;
13
- /**
14
- * Retrieves the internal version of loader entries.
15
- * @internal
16
- */
17
- declare const LOADER_ENTRIES_KEY: unique symbol;
18
- /**
19
- * Added to the loaders returned by `defineLoader()` to identify them.
20
- * Allows to extract exported useData() from a component.
21
- * @internal
22
- */
23
- declare const IS_USE_DATA_LOADER_KEY: unique symbol;
24
- /**
25
- * Symbol used to save the pending location on the router.
26
- * @internal
27
- */
28
- declare const PENDING_LOCATION_KEY: unique symbol;
29
- /**
30
- * Symbol used to know there is no value staged for the loader and that commit should be skipped.
31
- * @internal
32
- */
33
- declare const STAGED_NO_VALUE: unique symbol;
34
- /**
35
- * Gives access to the current app and it's `runWithContext` method.
36
- * @internal
37
- */
38
- declare const APP_KEY: unique symbol;
39
- /**
40
- * Gives access to an AbortController that aborts when the navigation is canceled.
41
- * @internal
42
- */
43
- declare const ABORT_CONTROLLER_KEY: unique symbol;
44
- /**
45
- * Symbol used to save the initial data on the router.
46
- * @internal
47
- */
48
- declare const IS_SSR_KEY: unique symbol;
49
- /**
50
- * Symbol used to get the effect scope used for data loaders.
51
- * @internal
52
- */
53
- declare const DATA_LOADERS_EFFECT_SCOPE_KEY: unique symbol;
54
- //#endregion
55
- //#region src/config.d.ts
56
- /**
57
- * Allows customizing existing types of the router that are used globally like `$router`, `<RouterLink>`, etc. **ONLY FOR INTERNAL USAGE**.
58
- *
59
- * - `Router` - swaps the public {@link Router} type (e.g. to `EXPERIMENTAL_Router`)
60
- * - `$router` - the router instance
61
- * - `$route` - the current route location
62
- * - `beforeRouteEnter` - Page component option
63
- * - `beforeRouteUpdate` - Page component option
64
- * - `beforeRouteLeave` - Page component option
65
- * - `RouterLink` - RouterLink Component
66
- * - `RouterView` - RouterView Component
67
- *
68
- * @internal
69
- */
70
- interface TypesConfig {}
71
- //#endregion
72
- //#region src/query.d.ts
73
- /**
74
- * Possible values in normalized {@link LocationQuery}. `null` renders the query
75
- * param but without an `=`.
76
- *
77
- * @example
78
- * ```
79
- * ?isNull&isEmpty=&other=other
80
- * gives
81
- * `{ isNull: null, isEmpty: '', other: 'other' }`.
82
- * ```
83
- *
84
- * @internal
85
- */
86
- type LocationQueryValue$1 = string | null;
87
- /**
88
- * Possible values when defining a query. `undefined` allows to remove a value.
89
- *
90
- * @internal
91
- */
92
- type LocationQueryValueRaw$1 = LocationQueryValue$1 | number | undefined;
93
- /**
94
- * Normalized query object that appears in {@link RouteLocationNormalized}
95
- *
96
- * @public
97
- */
98
- type LocationQuery$1 = Record<string, LocationQueryValue$1 | LocationQueryValue$1[]>;
99
- /**
100
- * Loose {@link LocationQuery} object that can be passed to functions like
101
- * {@link Router.push} and {@link Router.replace} or anywhere when creating a
102
- * {@link RouteLocationRaw}
103
- *
104
- * @public
105
- */
106
- type LocationQueryRaw$1 = Record<string | number, LocationQueryValueRaw$1 | LocationQueryValueRaw$1[]>;
107
- /**
108
- * Transforms a queryString into a {@link LocationQuery} object. Accept both, a
109
- * version with the leading `?` and without Should work as URLSearchParams
110
- * @internal
111
- *
112
- * @param search - search string to parse
113
- * @returns a query object
114
- */
115
- declare function parseQuery(search: string): LocationQuery$1;
116
- /**
117
- * Stringifies a {@link LocationQueryRaw} object. Like `URLSearchParams`, it
118
- * doesn't prepend a `?`
119
- *
120
- * @internal
121
- *
122
- * @param query - query object to stringify
123
- * @returns string version of the query without the leading `?`
124
- */
125
- declare function stringifyQuery(query: LocationQueryRaw$1 | undefined): string;
126
- //#endregion
127
- //#region src/matcher/types.d.ts
128
- /**
129
- * Normalized version of a {@link RouteRecord | route record}.
130
- */
131
- interface RouteRecordNormalized {
132
- /**
133
- * {@inheritDoc _RouteRecordBase.path}
134
- */
135
- path: _RouteRecordBase['path'];
136
- /**
137
- * {@inheritDoc _RouteRecordBase.redirect}
138
- */
139
- redirect: _RouteRecordBase['redirect'] | undefined;
140
- /**
141
- * {@inheritDoc _RouteRecordBase.name}
142
- */
143
- name: _RouteRecordBase['name'];
144
- /**
145
- * {@inheritDoc RouteRecordMultipleViews.components}
146
- */
147
- components: RouteRecordMultipleViews['components'] | null | undefined;
148
- /**
149
- * Contains the original modules for lazy loaded components.
150
- * @internal
151
- */
152
- mods: Record<string, unknown>;
153
- /**
154
- * Nested route records.
155
- */
156
- children: RouteRecordRaw[];
157
- /**
158
- * {@inheritDoc _RouteRecordBase.meta}
159
- */
160
- meta: Exclude<_RouteRecordBase['meta'], void>;
161
- /**
162
- * {@inheritDoc RouteRecordMultipleViews.props}
163
- */
164
- props: Record<string, _RouteRecordProps>;
165
- /**
166
- * Registered beforeEnter guards
167
- */
168
- beforeEnter: _RouteRecordBase['beforeEnter'];
169
- /**
170
- * Registered leave guards
171
- *
172
- * @internal
173
- */
174
- leaveGuards: Set<NavigationGuard>;
175
- /**
176
- * Registered update guards
177
- *
178
- * @internal
179
- */
180
- updateGuards: Set<NavigationGuard>;
181
- /**
182
- * Registered beforeRouteEnter callbacks passed to `next` or returned in guards
183
- *
184
- * @internal
185
- */
186
- enterCallbacks: Record<string, NavigationGuardNextCallback[]>;
187
- /**
188
- * Mounted route component instances
189
- * Having the instances on the record mean beforeRouteUpdate and
190
- * beforeRouteLeave guards can only be invoked with the latest mounted app
191
- * instance if there are multiple application instances rendering the same
192
- * view, basically duplicating the content on the page, which shouldn't happen
193
- * in practice. It will work if multiple apps are rendering different named
194
- * views.
195
- */
196
- instances: Record<string, ComponentPublicInstance | undefined | null>;
197
- /**
198
- * Defines if this record is the alias of another one. This property is
199
- * `undefined` if the record is the original one.
200
- */
201
- aliasOf: RouteRecordNormalized | undefined;
202
- }
203
- /**
204
- * {@inheritDoc RouteRecordNormalized}
205
- */
206
- type RouteRecord = RouteRecordNormalized;
207
- //#endregion
208
- //#region src/matcher/pathParserRanker.d.ts
209
- type PathParams = Record<string, string | string[]>;
210
- /**
211
- * A param in a url like `/users/:id`
212
- */
213
- interface PathParserParamKey {
214
- name: string;
215
- repeatable: boolean;
216
- optional: boolean;
217
- }
218
- interface PathParser {
219
- /**
220
- * The regexp used to match a url
221
- */
222
- re: RegExp;
223
- /**
224
- * The score of the parser
225
- */
226
- score: Array<number[]>;
227
- /**
228
- * Keys that appeared in the path
229
- */
230
- keys: PathParserParamKey[];
231
- /**
232
- * Parses a url and returns the matched params or null if it doesn't match. An
233
- * optional param that isn't preset will be an empty string. A repeatable
234
- * param will be an array if there is at least one value.
235
- *
236
- * @param path - url to parse
237
- * @returns a Params object, empty if there are no params. `null` if there is
238
- * no match
239
- */
240
- parse(path: string): PathParams | null;
241
- /**
242
- * Creates a string version of the url
243
- *
244
- * @param params - object of params
245
- * @returns a url
246
- */
247
- stringify(params: PathParams): string;
248
- }
249
- /**
250
- * @internal
251
- */
252
- interface _PathParserOptions {
253
- /**
254
- * Makes the RegExp case-sensitive.
255
- *
256
- * @defaultValue `false`
257
- */
258
- sensitive?: boolean;
259
- /**
260
- * Whether to disallow a trailing slash or not.
261
- *
262
- * @defaultValue `false`
263
- */
264
- strict?: boolean;
265
- /**
266
- * Should the RegExp match from the beginning by prepending a `^` to it.
267
- * @internal
268
- *
269
- * @defaultValue `true`
270
- */
271
- start?: boolean;
272
- /**
273
- * Should the RegExp match until the end by appending a `$` to it.
274
- *
275
- * @deprecated this option will alsways be `true` in the future. Open a discussion in vuejs/router if you need this to be `false`
276
- *
277
- * @defaultValue `true`
278
- */
279
- end?: boolean;
280
- }
281
- type PathParserOptions = Pick<_PathParserOptions, 'end' | 'sensitive' | 'strict'>;
282
- //#endregion
283
- //#region src/matcher/pathMatcher.d.ts
284
- interface RouteRecordMatcher extends PathParser {
285
- record: RouteRecord;
286
- parent: RouteRecordMatcher | undefined;
287
- children: RouteRecordMatcher[];
288
- alias: RouteRecordMatcher[];
289
- }
290
- //#endregion
291
- //#region src/matcher/index.d.ts
292
- /**
293
- * Internal RouterMatcher
294
- *
295
- * @internal
296
- */
297
- interface RouterMatcher {
298
- addRoute: (record: RouteRecordRaw, parent?: RouteRecordMatcher) => () => void;
299
- removeRoute(matcher: RouteRecordMatcher): void;
300
- removeRoute(name: NonNullable<RouteRecordNameGeneric>): void;
301
- clearRoutes: () => void;
302
- getRoutes: () => RouteRecordMatcher[];
303
- getRecordMatcher: (name: NonNullable<RouteRecordNameGeneric>) => RouteRecordMatcher | undefined;
304
- /**
305
- * Resolves a location. Gives access to the route record that corresponds to the actual path as well as filling the corresponding params objects
306
- *
307
- * @param location - MatcherLocationRaw to resolve to a url
308
- * @param currentLocation - MatcherLocation of the current location
309
- */
310
- resolve: (location: MatcherLocationRaw, currentLocation: MatcherLocation) => MatcherLocation;
311
- }
312
- /**
313
- * Creates a Router Matcher.
314
- *
315
- * @internal
316
- * @param routes - array of initial routes
317
- * @param globalOptions - global route options
318
- */
319
- declare function createRouterMatcher(routes: Readonly<RouteRecordRaw[]>, globalOptions: PathParserOptions): RouterMatcher;
320
- //#endregion
321
- //#region src/history/common.d.ts
322
- type HistoryLocation = string;
323
- /**
324
- * Allowed variables in HTML5 history state. Note that pushState clones the state
325
- * passed and does not accept everything: e.g.: it doesn't accept symbols, nor
326
- * functions as values. It also ignores Symbols as keys.
327
- *
328
- * @internal
329
- */
330
- type HistoryStateValue = string | number | boolean | null | undefined | HistoryState | HistoryStateArray;
331
- /**
332
- * Allowed HTML history.state
333
- */
334
- interface HistoryState {
335
- [x: number]: HistoryStateValue;
336
- [x: string]: HistoryStateValue;
337
- }
338
- /**
339
- * Allowed arrays for history.state.
340
- *
341
- * @internal
342
- */
343
- interface HistoryStateArray extends Array<HistoryStateValue> {}
344
- declare enum NavigationType {
345
- pop = "pop",
346
- push = "push"
347
- }
348
- declare enum NavigationDirection {
349
- back = "back",
350
- forward = "forward",
351
- unknown = ""
352
- }
353
- interface NavigationInformation {
354
- type: NavigationType;
355
- direction: NavigationDirection;
356
- delta: number;
357
- }
358
- interface NavigationCallback {
359
- (to: HistoryLocation, from: HistoryLocation, information: NavigationInformation): void;
360
- }
361
- /**
362
- * Interface implemented by History implementations that can be passed to the
363
- * router as {@link Router.history}
364
- *
365
- * @alpha
366
- */
367
- interface RouterHistory {
368
- /**
369
- * Base path that is prepended to every url. This allows hosting an SPA at a
370
- * sub-folder of a domain like `example.com/sub-folder` by having a `base` of
371
- * `/sub-folder`
372
- */
373
- readonly base: string;
374
- /**
375
- * Current History location
376
- */
377
- readonly location: HistoryLocation;
378
- /**
379
- * Current History state
380
- */
381
- readonly state: HistoryState;
382
- /**
383
- * Navigates to a location. In the case of an HTML5 History implementation,
384
- * this will call `history.pushState` to effectively change the URL.
385
- *
386
- * @param to - location to push
387
- * @param data - optional {@link HistoryState} to be associated with the
388
- * navigation entry
389
- */
390
- push(to: HistoryLocation, data?: HistoryState): void;
391
- /**
392
- * Same as {@link RouterHistory.push} but performs a `history.replaceState`
393
- * instead of `history.pushState`
394
- *
395
- * @param to - location to set
396
- * @param data - optional {@link HistoryState} to be associated with the
397
- * navigation entry
398
- */
399
- replace(to: HistoryLocation, data?: HistoryState): void;
400
- /**
401
- * Traverses history in a given direction.
402
- *
403
- * @example
404
- * ```js
405
- * myHistory.go(-1) // equivalent to window.history.back()
406
- * myHistory.go(1) // equivalent to window.history.forward()
407
- * ```
408
- *
409
- * @param delta - distance to travel. If delta is \< 0, it will go back,
410
- * if it's \> 0, it will go forward by that amount of entries.
411
- * @param triggerListeners - whether this should trigger listeners attached to
412
- * the history
413
- */
414
- go(delta: number, triggerListeners?: boolean): void;
415
- /**
416
- * Attach a listener to the History implementation that is triggered when the
417
- * navigation is triggered from outside (like the Browser back and forward
418
- * buttons) or when passing `true` to {@link RouterHistory.back} and
419
- * {@link RouterHistory.forward}
420
- *
421
- * @param callback - listener to attach
422
- * @returns a callback to remove the listener
423
- */
424
- listen(callback: NavigationCallback): () => void;
425
- /**
426
- * Generates the corresponding href to be used in an anchor tag.
427
- *
428
- * @param location - history location that should create an href
429
- */
430
- createHref(location: HistoryLocation): string;
431
- /**
432
- * Clears any event listener attached by the history implementation.
433
- */
434
- destroy(): void;
435
- }
436
- //#endregion
437
- //#region src/errors.d.ts
438
- /**
439
- * Flags so we can combine them when checking for multiple errors. This is the internal version of
440
- * {@link NavigationFailureType}.
441
- *
442
- * @internal
443
- */
444
- declare const enum ErrorTypes {
445
- MATCHER_NOT_FOUND = 1,
446
- NAVIGATION_GUARD_REDIRECT = 2,
447
- NAVIGATION_ABORTED = 4,
448
- NAVIGATION_CANCELLED = 8,
449
- NAVIGATION_DUPLICATED = 16
450
- }
451
- /**
452
- * Enumeration with all possible types for navigation failures. Can be passed to
453
- * {@link isNavigationFailure} to check for specific failures.
454
- */
455
- declare enum NavigationFailureType {
456
- /**
457
- * An aborted navigation is a navigation that failed because a navigation
458
- * guard returned `false` or called `next(false)`
459
- */
460
- aborted = 4,
461
- /**
462
- * A cancelled navigation is a navigation that failed because a more recent
463
- * navigation finished started (not necessarily finished).
464
- */
465
- cancelled = 8,
466
- /**
467
- * A duplicated navigation is a navigation that failed because it was
468
- * initiated while already being at the exact same location.
469
- */
470
- duplicated = 16
471
- }
472
- /**
473
- * Extended Error that contains extra information regarding a failed navigation.
474
- */
475
- interface NavigationFailure extends Error {
476
- /**
477
- * Type of the navigation. One of {@link NavigationFailureType}
478
- */
479
- type: ErrorTypes.NAVIGATION_CANCELLED | ErrorTypes.NAVIGATION_ABORTED | ErrorTypes.NAVIGATION_DUPLICATED;
480
- /**
481
- * Route location we were navigating from
482
- */
483
- from: RouteLocationNormalized;
484
- /**
485
- * Route location we were navigating to
486
- */
487
- to: RouteLocationNormalized;
488
- }
489
- /**
490
- * Internal error used to detect a redirection.
491
- *
492
- * @internal
493
- */
494
- interface NavigationRedirectError extends Omit<NavigationFailure, 'to' | 'type'> {
495
- type: ErrorTypes.NAVIGATION_GUARD_REDIRECT;
496
- to: RouteLocationRaw;
497
- }
498
- /**
499
- * Check if an object is a {@link NavigationFailure}.
500
- *
501
- * @param error - possible {@link NavigationFailure}
502
- * @param type - optional types to check for
503
- *
504
- * @example
505
- * ```js
506
- * import { isNavigationFailure, NavigationFailureType } from 'vue-router'
507
- *
508
- * router.afterEach((to, from, failure) => {
509
- * // Any kind of navigation failure
510
- * if (isNavigationFailure(failure)) {
511
- * // ...
512
- * }
513
- * // Only duplicated navigations
514
- * if (isNavigationFailure(failure, NavigationFailureType.duplicated)) {
515
- * // ...
516
- * }
517
- * // Aborted or canceled navigations
518
- * if (isNavigationFailure(failure, NavigationFailureType.aborted | NavigationFailureType.cancelled )) {
519
- * // ...
520
- * }
521
- * })
522
- * ```
523
- */
524
- declare function isNavigationFailure(error: any, type?: ErrorTypes.NAVIGATION_GUARD_REDIRECT): error is NavigationRedirectError;
525
- declare function isNavigationFailure(error: any, type?: ErrorTypes | NavigationFailureType): error is NavigationFailure;
526
- /**
527
- * Internal type to define an ErrorHandler
528
- *
529
- * @param error - error thrown
530
- * @param to - location we were navigating to when the error happened
531
- * @param from - location we were navigating from when the error happened
532
- * @internal
533
- */
534
- interface _ErrorListener {
535
- (error: any, to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded): any;
536
- }
537
- //#endregion
538
- //#region src/experimental/query.d.ts
539
- /**
540
- * NOTE: some types here are duplicated from ../query.ts
541
- * because they will change to always have (string | null)[] values
542
- */
543
- /**
544
- * Possible values in normalized {@link LocationQuery}. `null` renders the query
545
- * param but without an `=`.
546
- *
547
- * @internal
548
- */
549
- type LocationQueryValue = string | null;
550
- /**
551
- * Possible values when defining a query. `undefined` allows to remove a value.
552
- *
553
- * @internal
554
- */
555
- type LocationQueryValueRaw = LocationQueryValue | number | undefined;
556
- /**
557
- * Normalized query object that appears in {@link RouteLocationNormalized}
558
- *
559
- * @public
560
- */
561
- type LocationQuery = Record<string, LocationQueryValue | LocationQueryValue[]>;
562
- /**
563
- * Loose {@link LocationQuery} object that can be passed to functions like
564
- * {@link Router.push} and {@link Router.replace} or anywhere when creating a
565
- * {@link RouteLocationRaw}
566
- *
567
- * @public
568
- */
569
- type LocationQueryRaw = Record<string | number, LocationQueryValueRaw | LocationQueryValueRaw[]>;
570
- /**
571
- * Transforms a queryString into a {@link LocationQuery} object. Accept both, a
572
- * version with the leading `?` and without. Uses `Object.create(null)` so the
573
- * returned object cannot be exploited via prototype pollution.
574
- *
575
- * @internal
576
- *
577
- * @param search - search string to parse
578
- * @returns a query object
579
- */
580
- declare function experimental_parseQuery(search: string): LocationQuery;
581
- //#endregion
582
- //#region src/scrollBehavior.d.ts
583
- /**
584
- * Scroll position similar to
585
- * {@link https://developer.mozilla.org/en-US/docs/Web/API/ScrollToOptions | `ScrollToOptions`}.
586
- * Note that not all browsers support `behavior`.
587
- */
588
- type ScrollPositionCoordinates = {
589
- behavior?: ScrollOptions['behavior'];
590
- left?: number;
591
- top?: number;
592
- };
593
- /**
594
- * Internal normalized version of {@link ScrollPositionCoordinates} that always
595
- * has `left` and `top` coordinates. Must be a type to be assignable to HistoryStateValue.
596
- *
597
- * @internal
598
- */
599
- type _ScrollPositionNormalized = {
600
- behavior?: ScrollOptions['behavior'];
601
- left: number;
602
- top: number;
603
- };
604
- /**
605
- * Type of the `scrollBehavior` option that can be passed to `createRouter`.
606
- */
607
- interface RouterScrollBehavior {
608
- /**
609
- * @param to - Route location where we are navigating to
610
- * @param from - Route location where we are navigating from
611
- * @param savedPosition - saved position if it exists, `null` otherwise
612
- */
613
- (to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded, savedPosition: _ScrollPositionNormalized | null): Awaitable<ScrollPosition | false | void>;
614
- }
615
- interface ScrollPositionElement extends ScrollToOptions {
616
- /**
617
- * A valid CSS selector. Note some characters must be escaped in id selectors (https://mathiasbynens.be/notes/css-escapes).
618
- * @example
619
- * Here are a few examples:
620
- *
621
- * - `.title`
622
- * - `.content:first-child`
623
- * - `#marker`
624
- * - `#marker\~with\~symbols`
625
- * - `#marker.with.dot`: selects `class="with dot" id="marker"`, not `id="marker.with.dot"`
626
- *
627
- */
628
- el: string | Element;
629
- }
630
- type ScrollPosition = ScrollPositionCoordinates | ScrollPositionElement;
631
- type Awaitable<T> = T | PromiseLike<T>;
632
- //#endregion
633
- //#region src/experimental/route-resolver/matchers/param-parsers/types.d.ts
634
- /**
635
- * Defines a parser that can read a param from the url (string-based) and
636
- * transform it into a more complex type, or vice versa.
637
- *
638
- * @param TParam - the type of the param after parsing as exposed in
639
- * `route.params`
640
- *
641
- * @param TUrlParam - this is the most permissive type that can be passed to
642
- * get and returned by set. By default it's the type of query path params
643
- * (stricter as they do not allow `null` within an array or `undefined`). By
644
- * default it allows undefined because that represents a value that can be
645
- * omitted and is different from null in query params
646
- *
647
- * @param TParamRaw - the type that can be passed as a location when
648
- * navigating: `router.push({ params: {}})` it's sometimes more permissive than
649
- * TParam, for example allowing nullish values
650
- *
651
- * @see {@link MatcherPattern}
652
- */
653
- interface ParamParser<TParam = MatcherQueryParamsValue, TUrlParam = MatcherQueryParamsValue, TParamRaw = TParam> {
654
- get?: (value: NoInfer<TUrlParam>) => TParam;
655
- set?: (value: TParamRaw) => TUrlParam;
656
- }
657
- //#endregion
658
- //#region src/types/utils.d.ts
659
- /**
660
- * Creates a union type that still allows autocompletion for strings.
661
- * @internal
662
- */
663
- type _LiteralUnion<LiteralType, BaseType extends string = string> = LiteralType | (BaseType & Record<never, never>);
664
- /**
665
- * Maybe a promise maybe not
666
- * @internal
667
- */
668
- type _Awaitable<T> = T | PromiseLike<T>;
669
- /**
670
- * @internal
671
- */
672
- type Simplify<T> = { [K in keyof T]: T[K]; } & {};
673
- //#endregion
674
- //#region src/experimental/route-resolver/matchers/matcher-pattern.d.ts
675
- /**
676
- * Base interface for matcher patterns that extract params from a URL.
677
- *
678
- * @template TIn - type of the input value to match against the pattern
679
- * @template TParams - type of the output value after matching
680
- * @template TParamsRaw - type of the input value to build the input from
681
- *
682
- * In the case of the `path`, the `TIn` is a `string`, but in the case of the
683
- * query, it's the object of query params. `TParamsRaw` allows for a more permissive
684
- * type when building the value, for example allowing numbers and strings like
685
- * the old params.
686
- *
687
- * @internal this is the base interface for all matcher patterns, it shouldn't
688
- * be used directly
689
- */
690
- interface MatcherPattern<TIn = string, TParams extends MatcherParamsFormatted = MatcherParamsFormatted, TParamsRaw extends MatcherParamsFormatted = TParams> {
691
- /**
692
- * Matches a serialized params value against the pattern.
693
- *
694
- * @param value - params value to parse
695
- * @throws {MatchMiss} if the value doesn't match
696
- * @returns parsed params object
697
- */
698
- match(value: TIn): TParams;
699
- /**
700
- * Build a serializable value from parsed params. Should apply encoding if the
701
- * returned value is a string (e.g path and hash should be encoded but query
702
- * shouldn't).
703
- *
704
- * @param value - params value to parse
705
- * @returns serialized params value
706
- */
707
- build(params: TParamsRaw): TIn;
708
- }
709
- /**
710
- * Handles the `path` part of a URL. It can transform a path string into an
711
- * object of params and vice versa.
712
- */
713
- interface MatcherPatternPath<TParams extends MatcherParamsFormatted = MatcherParamsFormatted // | null // | undefined // | void // so it might be a bit more convenient
714
- , TParamsRaw extends MatcherParamsFormatted = TParams> extends MatcherPattern<string, TParams, TParamsRaw> {}
715
- /**
716
- * Allows matching a static path.
717
- *
718
- * @example
719
- * ```ts
720
- * const matcher = new MatcherPatternPathStatic('/team')
721
- * matcher.match('/team') // {}
722
- * matcher.match('/team/123') // throws MatchMiss
723
- * matcher.build() // '/team'
724
- * ```
725
- */
726
- declare class MatcherPatternPathStatic implements MatcherPatternPath<EmptyParams> {
727
- readonly path: string;
728
- /**
729
- * lowercase version of the path to match against.
730
- * This is used to make the matching case insensitive.
731
- */
732
- private pathi;
733
- constructor(path: string);
734
- match(path: string): EmptyParams;
735
- build(): string;
736
- }
737
- /**
738
- * Options for param parsers in {@link MatcherPatternPathDynamic}.
739
- */
740
- type MatcherPatternPathDynamic_ParamOptions<TUrlParam extends string | string[] | null = string | string[] | null, TParam = string | string[] | null, TParamRaw = TParam> = readonly [
741
- /**
742
- * Param parser to use for this param.
743
- */
744
- parser?: ParamParser<TParam, TUrlParam, TParamRaw>,
745
- /**
746
- * Is tha param a repeatable param and should be converted to an array
747
- */
748
- repeatable?: boolean,
749
- /**
750
- * Can this parameter be omitted or empty (for repeatable params, an empty array).
751
- */
752
- optional?: boolean];
753
- /**
754
- * Helper type to extract the params from the options object.
755
- *
756
- * @internal
757
- */
758
- type ExtractParamTypeFromOptions<TParamsOptions> = { [K in keyof TParamsOptions]: TParamsOptions[K] extends MatcherPatternPathDynamic_ParamOptions<any, infer TParam, any> ? TParam : never; };
759
- /**
760
- * Helper type to extract the raw params from the options object.
761
- *
762
- * @internal
763
- */
764
- type ExtractLocationParamTypeFromOptions<TParamsOptions> = { [K in keyof TParamsOptions]: TParamsOptions[K] extends MatcherPatternPathDynamic_ParamOptions<any, any, infer TParamRaw> ? TParamRaw : never; };
765
- /**
766
- * Handles the `path` part of a URL with dynamic parameters.
767
- */
768
- declare class MatcherPatternPathDynamic<TParamsOptions> implements MatcherPatternPath<ExtractParamTypeFromOptions<TParamsOptions>, ExtractLocationParamTypeFromOptions<TParamsOptions>> {
769
- readonly re: RegExp;
770
- readonly params: TParamsOptions & Record<string, MatcherPatternPathDynamic_ParamOptions<any, any>>;
771
- readonly pathParts: Array<string | number | Array<string | number>>;
772
- readonly trailingSlash: boolean | null;
773
- /**
774
- * Cached keys of the {@link params} object.
775
- */
776
- private paramsKeys;
777
- /**
778
- * Creates a new dynamic path matcher.
779
- *
780
- * @param re - regex to match the path against
781
- * @param params - object of param parsers as {@link MatcherPatternPathDynamic_ParamOptions}
782
- * @param pathParts - array of path parts, where strings are static parts, 1 are regular params, and 0 are splat params (not encode slash)
783
- * @param trailingSlash - whether the path should end with a trailing slash, null means "do not care" (for trailing splat params)
784
- */
785
- constructor(re: RegExp, params: TParamsOptions & Record<string, MatcherPatternPathDynamic_ParamOptions<any, any>>, pathParts: Array<string | number | Array<string | number>>, trailingSlash?: boolean | null);
786
- match(path: string): Simplify<ExtractParamTypeFromOptions<TParamsOptions>>;
787
- build(params: Simplify<ExtractLocationParamTypeFromOptions<TParamsOptions>>): string;
788
- }
789
- /**
790
- * Handles the `hash` part of a URL. It can transform a hash string into an
791
- * object of params and vice versa.
792
- */
793
- interface MatcherPatternHash<TParams extends MatcherParamsFormatted = MatcherParamsFormatted> extends MatcherPattern<string, TParams> {}
794
- /**
795
- * Generic object of params that can be passed to a matcher.
796
- */
797
- type MatcherParamsFormatted = Record<string, unknown>;
798
- /**
799
- * Empty object in TS.
800
- */
801
- type EmptyParams = Record<PropertyKey, never>;
802
- /**
803
- * Possible values for query params in a matcher.
804
- */
805
- type MatcherQueryParamsValue = string | null | undefined | Array<string | null>;
806
- type MatcherQueryParams = Record<string, MatcherQueryParamsValue>;
807
- //#endregion
808
- //#region src/location.d.ts
809
- /**
810
- * Location object returned by {@link `parseURL`}.
811
- * @internal
812
- */
813
- interface LocationNormalized {
814
- path: string;
815
- fullPath: string;
816
- hash: string;
817
- query: LocationQuery$1;
818
- }
819
- /**
820
- * Initial route location where the router is. Can be used in navigation guards
821
- * to differentiate the initial navigation.
822
- *
823
- * @example
824
- * ```js
825
- * import { START_LOCATION } from 'vue-router'
826
- *
827
- * router.beforeEach((to, from) => {
828
- * if (from === START_LOCATION) {
829
- * // initial navigation
830
- * }
831
- * })
832
- * ```
833
- */
834
- declare const START_LOCATION_NORMALIZED: RouteLocationNormalizedLoaded;
835
- //#endregion
836
- //#region src/experimental/route-resolver/resolver-abstract.d.ts
837
- /**
838
- * Allowed types for a matcher name.
839
- */
840
- type RecordName = string | symbol;
841
- /**
842
- * Manage and resolve routes. Also handles the encoding, decoding, parsing and
843
- * serialization of params, query, and hash.
844
- *
845
- * - `TMatcherRecordRaw` represents the raw record type passed to {@link addMatcher}.
846
- * - `TMatcherRecord` represents the normalized record type returned by {@link getRoutes}.
847
- */
848
- interface EXPERIMENTAL_Resolver_Base<TRecord> {
849
- /**
850
- * Resolves an absolute location (like `/path/to/somewhere`).
851
- *
852
- * @param absoluteLocation - The absolute location to resolve.
853
- * @param currentLocation - This value is ignored and should not be passed if the location is absolute.
854
- */
855
- resolve(absoluteLocation: `/${string}`, currentLocation?: undefined): ResolverLocationResolved<TRecord>;
856
- /**
857
- * Resolves a string location relative to another location. A relative
858
- * location can be `./same-folder`, `../parent-folder`, `same-folder`, or
859
- * even `?page=2`.
860
- */
861
- resolve(relativeLocation: string, currentLocation: ResolverLocationResolved<TRecord>): ResolverLocationResolved<TRecord>;
862
- /**
863
- * Resolves a location by its name. Any required params or query must be
864
- * passed in the `options` argument.
865
- */
866
- resolve(location: ResolverLocationAsNamed, currentLocation?: undefined): ResolverLocationResolved<TRecord>;
867
- /**
868
- * Resolves a location by its absolute path (starts with `/`). Any required query must be passed.
869
- *
870
- * @param location - The location to resolve.
871
- */
872
- resolve(location: ResolverLocationAsPathAbsolute, currentLocation?: undefined): ResolverLocationResolved<TRecord>;
873
- resolve(location: ResolverLocationAsPathRelative, currentLocation: ResolverLocationResolved<TRecord>): ResolverLocationResolved<TRecord>;
874
- /**
875
- * Resolves a location relative to another location. It reuses existing
876
- * properties in the `currentLocation` like `params`, `query`, and `hash`.
877
- */
878
- resolve(relativeLocation: ResolverLocationAsRelative, currentLocation: ResolverLocationResolved<TRecord>): ResolverLocationResolved<TRecord>;
879
- /**
880
- * Get a list of all resolver route records.
881
- */
882
- getRoutes(): TRecord[];
883
- /**
884
- * Get a resolver record by its name.
885
- * Previously named `getRecordMatcher()`
886
- */
887
- getRoute(name: RecordName): TRecord | undefined;
888
- }
889
- /**
890
- * Returned location object by {@link EXPERIMENTAL_Resolver_Base['resolve']}.
891
- * It contains the resolved name, params, query, hash, and matched records.
892
- */
893
- interface ResolverLocationResolved<TMatched> extends LocationNormalized {
894
- /**
895
- * Name of the route record. A symbol if no name is provided.
896
- */
897
- name: RecordName;
898
- /**
899
- * Parsed params. Already decoded and formatted.
900
- */
901
- params: MatcherParamsFormatted;
902
- /**
903
- * Chain of route records that lead to the matched one. The last record is
904
- * the the one that matched the location. Each previous record is the parent
905
- * of the next one.
906
- */
907
- matched: TMatched[];
908
- }
909
- /**
910
- * Location object that can be passed to {@link
911
- * EXPERIMENTAL_Resolver_Base['resolve']} and is recognized as a `name`.
912
- *
913
- * @example
914
- * ```ts
915
- * resolver.resolve({ name: 'user', params: { id: 123 } })
916
- * resolver.resolve({ name: 'user-search', params: {}, query: { page: 2 } })
917
- * ```
918
- */
919
- interface ResolverLocationAsNamed {
920
- name: RecordName;
921
- params: MatcherParamsFormatted;
922
- query?: LocationQueryRaw;
923
- hash?: string;
924
- /**
925
- * @deprecated This is ignored when `name` is provided
926
- */
927
- path?: undefined;
928
- }
929
- /**
930
- * Location object that can be passed to {@link EXPERIMENTAL_Resolver_Base['resolve']}
931
- * and is recognized as a relative path.
932
- *
933
- * @example
934
- * ```ts
935
- * resolver.resolve({ path: './123' }, currentLocation)
936
- * resolver.resolve({ path: '..' }, currentLocation)
937
- * ```
938
- */
939
- interface ResolverLocationAsPathRelative {
940
- path: string;
941
- query?: LocationQueryRaw;
942
- hash?: string;
943
- /**
944
- * @deprecated This is ignored when `path` is provided
945
- */
946
- name?: undefined;
947
- /**
948
- * @deprecated This is ignored when `path` (instead of `name`) is provided
949
- */
950
- params?: undefined;
951
- }
952
- /**
953
- * Location object that can be passed to {@link EXPERIMENTAL_Resolver_Base['resolve']}
954
- * and is recognized as an absolute path.
955
- *
956
- * @example
957
- * ```ts
958
- * resolver.resolve({ path: '/team/123' })
959
- * ```
960
- */
961
- interface ResolverLocationAsPathAbsolute extends ResolverLocationAsPathRelative {
962
- path: `/${string}`;
963
- }
964
- /**
965
- * Relative location object that can be passed to {@link EXPERIMENTAL_Resolver_Base['resolve']}
966
- * and is recognized as a relative location, copying the `params`, `query`, and
967
- * `hash` if not provided.
968
- *
969
- * @example
970
- * ```ts
971
- * resolver.resolve({ params: { id: 123 } }, currentLocation)
972
- * resolver.resolve({ hash: '#bottom' }, currentLocation)
973
- * ```
974
- */
975
- interface ResolverLocationAsRelative {
976
- params?: MatcherParamsFormatted;
977
- query?: LocationQueryRaw;
978
- hash?: string;
979
- /**
980
- * @deprecated This location is relative to the next parameter. This `name` will be ignored.
981
- */
982
- name?: undefined;
983
- /**
984
- * @deprecated This location is relative to the next parameter. This `path` will be ignored.
985
- */
986
- path?: undefined;
987
- }
988
- //#endregion
989
- //#region src/experimental/route-resolver/matchers/param-parsers/define-param-parser.d.ts
990
- /**
991
- * Defines a param parser that works with any kind of param (path, repeatable,
992
- * optional, query, hash, ...) but requires the user to handle all cases in the
993
- * get and set functions (nullish, undefined, arrays, etc). This allows you to
994
- * have full control over the parsing logic, but it also means that you need to
995
- * handle all edge cases yourself. If possible, prefer using {@see defineParamParser}
996
- * which provides a more structured way to handle these
997
- * cases and automatically handles arrays and nullish values.
998
- *
999
- * @example
1000
- *
1001
- * Here is an example that allows arbitrary numbers (NaN values are filtered
1002
- * out). It supports repeatable params, so it can be used both as a path param
1003
- * parser and a query param parser.
1004
- *
1005
- * ```ts
1006
- * export const parser = defineParamParserRaw<number>({
1007
- * get: value => {
1008
- * if (value == null) return null
1009
- * if (Array.isArray(value)) {
1010
- * return value
1011
- * .filter(v => v != null)
1012
- * .map(Number)
1013
- * .filter(v => !Number.isNaN(v))
1014
- * }
1015
- *
1016
- * return Number.isNaN(Number(value))
1017
- * ? miss(`"${value}" is not a valid number`)
1018
- * : Number(value)
1019
- * },
1020
- *
1021
- * set: value =>
1022
- * Array.isArray(value)
1023
- * ? value.map(String)
1024
- * : value == null
1025
- * ? null
1026
- * : String(value),
1027
- * })
1028
- * ```
1029
- *
1030
- * @see {@link defineParamParser}
1031
- */
1032
- /*! #__NO_SIDE_EFFECTS__ */
1033
- declare function defineParamParserRaw<TParam, TParamRaw = TParam, TUrlParam = MatcherQueryParamsValue>(parser: Required<ParamParser<TParam, TUrlParam, TParamRaw>>): Required<ParamParser<TParam, TUrlParam, TParamRaw>>;
1034
- /**
1035
- * Defines a param parser that transforms strings to another type. Handles
1036
- * optional and repeatable params:
1037
- *
1038
- * - Optional params: become `null` if the value is nullish
1039
- * - Repeatable params: the value becomes an array of the parsed type, and nullish values are filtered out
1040
- *
1041
- * @example
1042
- *
1043
- * Here is an example that allows arbitrary valid numbers (NaN values are
1044
- * filtered out). It can be used in both, path, and query params.
1045
- *
1046
- * ```ts
1047
- * import { defineParamParser, miss } from 'vue-router/experimental'
1048
- *
1049
- * export const parser = defineParamParser<number>({
1050
- * get: value => {
1051
- * const num = Number(value)
1052
- * if (Number.isNaN(num)) {
1053
- * miss(`"${value}" is not a valid number`)
1054
- * }
1055
- * return num
1056
- * },
1057
- *
1058
- * set: value => String(value),
1059
- * })
1060
- * ```
1061
- *
1062
- * @see {@link defineParamParserRaw}
1063
- */
1064
- declare function defineParamParser<TParam, TParamRaw = TParam>(parser: Required<ParamParser<TParam, string, TParamRaw>>): Required<ParamParser<TParam | TParam[] | null, MatcherQueryParamsValue, TParamRaw | TParamRaw[] | null | undefined>>;
1065
- //#endregion
1066
- //#region src/experimental/route-resolver/matchers/param-parsers/booleans.d.ts
1067
- /**
1068
- * Native Param parser for booleans.
1069
- *
1070
- * @internal
1071
- */
1072
- declare const PARAM_PARSER_BOOL: {
1073
- get: (value: NoInfer<MatcherQueryParamsValue>) => boolean | boolean[] | undefined;
1074
- set: (value: boolean | boolean[] | null | undefined) => string | string[] | null | undefined;
1075
- };
1076
- //#endregion
1077
- //#region src/experimental/route-resolver/matchers/param-parsers/integers.d.ts
1078
- /**
1079
- * Native Param parser for integers.
1080
- *
1081
- * @internal
1082
- */
1083
- declare const PARAM_PARSER_INT: {
1084
- get: (value: NoInfer<MatcherQueryParamsValue>) => number | number[] | null;
1085
- set: (value: number | number[] | null) => string | string[] | null;
1086
- };
1087
- //#endregion
1088
- //#region src/experimental/route-resolver/matchers/param-parsers/standard-schema-types.d.ts
1089
- /**
1090
- * Inlined subset of `@standard-schema/spec` v1.1.0 so the distributed code
1091
- * has zero external type dependencies. Keep the package installed to track
1092
- * upstream changes.
1093
- *
1094
- * @see https://github.com/standard-schema/standard-schema
1095
- */
1096
- /** The Standard Schema interface. */
1097
- interface StandardSchemaV1<Input = unknown, Output = Input> {
1098
- /** The Standard Schema properties. */
1099
- readonly '~standard': StandardSchemaV1.Props<Input, Output>;
1100
- }
1101
- declare namespace StandardSchemaV1 {
1102
- /** The Standard Schema properties interface. */
1103
- interface Props<Input = unknown, Output = Input> {
1104
- /** The version number of the standard. */
1105
- readonly version: 1;
1106
- /** The vendor name of the schema library. */
1107
- readonly vendor: string;
1108
- /** Inferred types associated with the schema. */
1109
- readonly types?: Types<Input, Output> | undefined;
1110
- /** Validates unknown input values. */
1111
- readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
1112
- }
1113
- /** The Standard Schema types interface. */
1114
- interface Types<Input = unknown, Output = Input> {
1115
- /** The input type of the schema. */
1116
- readonly input: Input;
1117
- /** The output type of the schema. */
1118
- readonly output: Output;
1119
- }
1120
- /** The result interface of the validate function. */
1121
- type Result<Output> = SuccessResult<Output> | FailureResult;
1122
- /** The result interface if validation succeeds. */
1123
- interface SuccessResult<Output> {
1124
- /** The typed output value. */
1125
- readonly value: Output;
1126
- /** A falsy value for `issues` indicates success. */
1127
- readonly issues?: undefined;
1128
- }
1129
- /** The result interface if validation fails. */
1130
- interface FailureResult {
1131
- /** The issues of failed validation. */
1132
- readonly issues: ReadonlyArray<Issue>;
1133
- }
1134
- /** The issue interface of the failure output. */
1135
- interface Issue {
1136
- /** The error message of the issue. */
1137
- readonly message: string;
1138
- /** The path of the issue, if any. */
1139
- readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
1140
- }
1141
- /** The path segment interface of the issue. */
1142
- interface PathSegment {
1143
- /** The key representing a path segment. */
1144
- readonly key: PropertyKey;
1145
- }
1146
- /** Infers the input type of a Standard Schema. */
1147
- type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['input'];
1148
- /** Infers the output type of a Standard Schema. */
1149
- type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema['~standard']['types']>['output'];
1150
- }
1151
- //#endregion
1152
- //#region src/experimental/route-resolver/matchers/param-parsers/standard-schema.d.ts
1153
- /**
1154
- * Normalizes a param parser input, converting a StandardSchema-compliant object
1155
- * into a {@link ParamParser} if needed.
1156
- *
1157
- * @param parser - a param parser or a StandardSchema-compliant validator
1158
- *
1159
- * @internal
1160
- */
1161
- declare function normalizeParamParser<TParam = MatcherQueryParamsValue, TUrlParam = MatcherQueryParamsValue, TParamRaw = TParam>(parser: ParamParser<TParam, TUrlParam, TParamRaw> | StandardSchemaV1<unknown, TParam>): ParamParser<TParam, TUrlParam, TParamRaw>;
1162
- /**
1163
- * Extracts the param type from Param Parsers or StandardSchema validators.
1164
- *
1165
- * @internal
1166
- */
1167
- type ExtractParamParserType<PP> = PP extends ParamParser<infer T, any, any> ? T : PP extends StandardSchemaV1<unknown, infer T> ? T : unknown;
1168
- //#endregion
1169
- //#region src/experimental/route-resolver/matchers/matcher-pattern-query.d.ts
1170
- /**
1171
- * Handles the `query` part of a URL. It can transform a query object into an
1172
- * object of params and vice versa.
1173
- */
1174
- interface MatcherPatternQuery<TParams extends MatcherParamsFormatted = MatcherParamsFormatted> extends MatcherPattern<MatcherQueryParams, TParams> {}
1175
- /**
1176
- * Matcher for a specific query parameter. It will read and write the parameter
1177
- */
1178
- declare class MatcherPatternQueryParam<T, ParamName extends string> implements MatcherPatternQuery<Record<ParamName, T>> {
1179
- private paramName;
1180
- private queryKey;
1181
- private format;
1182
- private parser;
1183
- private defaultValue?;
1184
- private required?;
1185
- constructor(paramName: ParamName, queryKey: string, format: 'value' | 'array', parser?: ParamParser<T>, defaultValue?: ((() => T) | T) | undefined, required?: boolean | undefined);
1186
- match(query: MatcherQueryParams): Record<ParamName, T>;
1187
- build(params: Record<ParamName, T>): MatcherQueryParams;
1188
- }
1189
- //#endregion
1190
- //#region src/experimental/route-resolver/resolver-fixed.d.ts
1191
- /**
1192
- * Base interface for a resolver record that can be extended.
1193
- */
1194
- interface EXPERIMENTAL_ResolverRecord_Base {
1195
- /**
1196
- * Name of the matcher. Unique across all matchers. If missing, this record
1197
- * cannot be matched. This is useful for grouping records.
1198
- */
1199
- name?: RecordName;
1200
- /**
1201
- * {@link MatcherPattern} for the path section of the URI.
1202
- */
1203
- path?: MatcherPatternPath;
1204
- /**
1205
- * {@link MatcherPattern} for the query section of the URI.
1206
- */
1207
- query?: MatcherPatternQuery[];
1208
- /**
1209
- * {@link MatcherPattern} for the hash section of the URI.
1210
- */
1211
- hash?: MatcherPatternHash;
1212
- /**
1213
- * Parent record. The parent can be a group or a matchable record.
1214
- * It will be included in the `matched` array of a resolved location.
1215
- */
1216
- parent?: EXPERIMENTAL_ResolverRecord_Base | null;
1217
- /**
1218
- * If this record is an alias of another record, this points to the original
1219
- * record. Alias records are not added to the name map and resolve to the
1220
- * original record's name.
1221
- */
1222
- aliasOf?: EXPERIMENTAL_ResolverRecord_Base | null;
1223
- }
1224
- /**
1225
- * A group can contain other useful properties like `meta` defined by the router.
1226
- */
1227
- interface EXPERIMENTAL_ResolverRecord_Group extends EXPERIMENTAL_ResolverRecord_Base {
1228
- /**
1229
- * A group route cannot be matched directly and cannot be named.
1230
- */
1231
- name?: undefined;
1232
- /**
1233
- * A group route can **only** match the `query`.
1234
- */
1235
- path?: undefined;
1236
- /**
1237
- * A group route can **only** match the `query`.
1238
- */
1239
- hash?: undefined;
1240
- }
1241
- /**
1242
- * A matchable record is a record that can be matched by a path, query or hash
1243
- * and will resolve to a location.
1244
- */
1245
- interface EXPERIMENTAL_ResolverRecord_Matchable extends EXPERIMENTAL_ResolverRecord_Base {
1246
- name: RecordName;
1247
- path: MatcherPatternPath;
1248
- }
1249
- /**
1250
- * @alias EXPERIMENTAL_Resolver_Base
1251
- */
1252
- interface EXPERIMENTAL_ResolverFixed<TRecord> extends EXPERIMENTAL_Resolver_Base<TRecord> {}
1253
- /**
1254
- * Creates a fixed resolver that must have all records defined at creation
1255
- * time.
1256
- *
1257
- * @template TRecord - extended type of the records
1258
- * @param {TRecord[]} records - Ordered array of records that will be used to resolve routes
1259
- * @returns a resolver that can be passed to the router
1260
- */
1261
- declare function createFixedResolver<TRecord extends EXPERIMENTAL_ResolverRecord_Matchable>(records: TRecord[]): EXPERIMENTAL_ResolverFixed<TRecord>;
1262
- //#endregion
1263
- //#region src/experimental/router.d.ts
1264
- /**
1265
- * Options to initialize a {@link Router} instance.
1266
- */
1267
- interface EXPERIMENTAL_RouterOptions_Base extends PathParserOptions {
1268
- /**
1269
- * History implementation used by the router. Most web applications should use
1270
- * `createWebHistory` but it requires the server to be properly configured.
1271
- * You can also use a _hash_ based history with `createWebHashHistory` that
1272
- * does not require any configuration on the server but isn't handled at all
1273
- * by search engines and does poorly on SEO.
1274
- *
1275
- * @example
1276
- * ```js
1277
- * createRouter({
1278
- * history: createWebHistory(),
1279
- * // other options...
1280
- * })
1281
- * ```
1282
- */
1283
- history: RouterHistory;
1284
- /**
1285
- * Function to control scrolling when navigating between pages. Can return a
1286
- * Promise to delay scrolling.
1287
- *
1288
- * @see {@link RouterScrollBehavior}.
1289
- *
1290
- * @example
1291
- * ```js
1292
- * function scrollBehavior(to, from, savedPosition) {
1293
- * // `to` and `from` are both route locations
1294
- * // `savedPosition` can be null if there isn't one
1295
- * }
1296
- * ```
1297
- */
1298
- scrollBehavior?: RouterScrollBehavior;
1299
- /**
1300
- * Custom implementation to parse a query. See its counterpart,
1301
- * {@link EXPERIMENTAL_RouterOptions_Base.stringifyQuery}.
1302
- *
1303
- * @example
1304
- * Let's say you want to use the [qs package](https://github.com/ljharb/qs)
1305
- * to parse queries, you can provide both `parseQuery` and `stringifyQuery`:
1306
- * ```js
1307
- * import qs from 'qs'
1308
- *
1309
- * createRouter({
1310
- * // other options...
1311
- * parseQuery: qs.parse,
1312
- * stringifyQuery: qs.stringify,
1313
- * })
1314
- * ```
1315
- */
1316
- parseQuery?: typeof experimental_parseQuery;
1317
- /**
1318
- * Custom implementation to stringify a query object. Should not prepend a leading `?`.
1319
- * {@link parseQuery} counterpart to handle query parsing.
1320
- */
1321
- stringifyQuery?: typeof stringifyQuery;
1322
- /**
1323
- * Default class applied to active {@link RouterLink}. If none is provided,
1324
- * `router-link-active` will be applied.
1325
- */
1326
- linkActiveClass?: string;
1327
- /**
1328
- * Default class applied to exact active {@link RouterLink}. If none is provided,
1329
- * `router-link-exact-active` will be applied.
1330
- */
1331
- linkExactActiveClass?: string;
1332
- }
1333
- /**
1334
- * Internal type for common properties among all kind of {@link RouteRecordRaw}.
1335
- */
1336
- interface EXPERIMENTAL_RouteRecord_Base extends EXPERIMENTAL_ResolverRecord_Base {
1337
- /**
1338
- * Where to redirect if the route is directly matched. The redirection happens
1339
- * before any navigation guard and triggers a new navigation with the new
1340
- * target location.
1341
- */
1342
- redirect?: RouteRecordRedirectOption;
1343
- /**
1344
- * Before Enter guard specific to this record. Note `beforeEnter` has no
1345
- * effect if the record has a `redirect` property.
1346
- */
1347
- /**
1348
- * Arbitrary data attached to the record.
1349
- */
1350
- meta?: RouteMeta;
1351
- /**
1352
- * Components to display when the URL matches this route. Allow using named views.
1353
- */
1354
- components?: Record<string, RawRouteComponent>;
1355
- /**
1356
- * Parent of this component if any
1357
- */
1358
- parent?: EXPERIMENTAL_RouteRecordNormalized | null;
1359
- /**
1360
- * References another record if this record is an alias of it.
1361
- */
1362
- aliasOf?: EXPERIMENTAL_RouteRecordNormalized | null;
1363
- }
1364
- interface EXPERIMENTAL_RouteRecord_Redirect extends Omit<EXPERIMENTAL_RouteRecord_Base, 'name' | 'path'>, Omit<EXPERIMENTAL_ResolverRecord_Matchable, 'parent' | 'aliasOf'> {
1365
- components?: Record<string, RawRouteComponent>;
1366
- redirect: RouteRecordRedirectOption;
1367
- }
1368
- interface EXPERIMENTAL_RouteRecord_Group extends Omit<EXPERIMENTAL_RouteRecord_Base, 'name' | 'path' | 'query' | 'hash'>, Omit<EXPERIMENTAL_ResolverRecord_Group, 'parent' | 'aliasOf'> {
1369
- components?: Record<string, RawRouteComponent>;
1370
- }
1371
- interface EXPERIMENTAL_RouteRecord_Components extends Omit<EXPERIMENTAL_RouteRecord_Base, 'name' | 'path'>, Omit<EXPERIMENTAL_ResolverRecord_Matchable, 'parent' | 'aliasOf'> {
1372
- components: Record<string, RawRouteComponent>;
1373
- redirect?: never;
1374
- }
1375
- type EXPERIMENTAL_RouteRecord_Matchable = EXPERIMENTAL_RouteRecord_Components | EXPERIMENTAL_RouteRecord_Redirect;
1376
- type EXPERIMENTAL_RouteRecordRaw = EXPERIMENTAL_RouteRecord_Matchable | EXPERIMENTAL_RouteRecord_Group;
1377
- interface EXPERIMENTAL_RouteRecordNormalized_Base {
1378
- /**
1379
- * Contains the original modules for lazy loaded components.
1380
- *
1381
- * @internal
1382
- */
1383
- mods: Record<string, unknown>;
1384
- props: Record<string, _RouteRecordProps>;
1385
- /**
1386
- * Registered leave guards
1387
- *
1388
- * @internal
1389
- */
1390
- leaveGuards: Set<NavigationGuard>;
1391
- /**
1392
- * Registered update guards
1393
- *
1394
- * @internal
1395
- */
1396
- updateGuards: Set<NavigationGuard>;
1397
- instances: Record<string, unknown>;
1398
- }
1399
- interface EXPERIMENTAL_RouteRecordNormalized_Group extends EXPERIMENTAL_RouteRecordNormalized_Base, EXPERIMENTAL_RouteRecord_Group {
1400
- meta: RouteMeta;
1401
- }
1402
- interface EXPERIMENTAL_RouteRecordNormalized_Redirect extends EXPERIMENTAL_RouteRecordNormalized_Base, EXPERIMENTAL_RouteRecord_Redirect {
1403
- meta: RouteMeta;
1404
- }
1405
- interface EXPERIMENTAL_RouteRecordNormalized_Components extends EXPERIMENTAL_RouteRecordNormalized_Base, EXPERIMENTAL_RouteRecord_Components {
1406
- meta: RouteMeta;
1407
- }
1408
- type EXPERIMENTAL_RouteRecordNormalized_Matchable = EXPERIMENTAL_RouteRecordNormalized_Components | EXPERIMENTAL_RouteRecordNormalized_Redirect;
1409
- type EXPERIMENTAL_RouteRecordNormalized = EXPERIMENTAL_RouteRecordNormalized_Matchable | EXPERIMENTAL_RouteRecordNormalized_Group;
1410
- declare function normalizeRouteRecord(record: EXPERIMENTAL_RouteRecord_Group): EXPERIMENTAL_RouteRecordNormalized_Group;
1411
- declare function normalizeRouteRecord(record: EXPERIMENTAL_RouteRecord_Matchable): EXPERIMENTAL_RouteRecordNormalized_Matchable;
1412
- /**
1413
- * Options to initialize an experimental {@link EXPERIMENTAL_Router} instance.
1414
- * @experimental
1415
- */
1416
- interface EXPERIMENTAL_RouterOptions extends EXPERIMENTAL_RouterOptions_Base {
1417
- /**
1418
- * Matcher to use to resolve routes.
1419
- *
1420
- * @experimental
1421
- */
1422
- resolver: EXPERIMENTAL_ResolverFixed<EXPERIMENTAL_RouteRecordNormalized_Matchable>;
1423
- }
1424
- /**
1425
- * Router base instance.
1426
- *
1427
- * @experimental This version is not stable, it's meant to replace {@link Router} in the future.
1428
- */
1429
- interface EXPERIMENTAL_Router_Base<TRecord> extends DataLoaderExtensions {
1430
- /**
1431
- * Current {@link RouteLocationNormalized}
1432
- */
1433
- readonly currentRoute: ShallowRef<RouteLocationNormalizedLoaded>;
1434
- /**
1435
- * Allows turning off the listening of history events. This is a low level api for micro-frontend.
1436
- */
1437
- listening: boolean;
1438
- /**
1439
- * Checks if a route with a given name exists
1440
- *
1441
- * @param name - Name of the route to check
1442
- */
1443
- hasRoute(name: NonNullable<RouteRecordNameGeneric>): boolean;
1444
- /**
1445
- * Get a full list of all the {@link RouteRecord | route records}.
1446
- */
1447
- getRoutes(): TRecord[];
1448
- /**
1449
- * Returns the {@link RouteLocation | normalized version} of a
1450
- * {@link RouteLocationRaw | route location}. Also includes an `href` property
1451
- * that includes any existing `base`. By default, the `currentLocation` used is
1452
- * `router.currentRoute` and should only be overridden in advanced use cases.
1453
- *
1454
- * @param to - Raw route location to resolve
1455
- * @param currentLocation - Optional current location to resolve against
1456
- */
1457
- resolve<Name extends keyof RouteMap = keyof RouteMap>(to: RouteLocationAsRelativeTyped<RouteMap, Name>, currentLocation?: RouteLocationNormalizedLoaded): RouteLocationResolved<Name>;
1458
- resolve(to: RouteLocationAsString | RouteLocationAsRelative | RouteLocationAsPath, currentLocation?: RouteLocationNormalizedLoaded): RouteLocationResolved;
1459
- /**
1460
- * Programmatically navigate to a new URL by pushing an entry in the history
1461
- * stack.
1462
- *
1463
- * @param to - Route location to navigate to
1464
- */
1465
- push(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
1466
- /**
1467
- * Programmatically navigate to a new URL by replacing the current entry in
1468
- * the history stack.
1469
- *
1470
- * @param to - Route location to navigate to
1471
- */
1472
- replace(to: RouteLocationRaw): Promise<NavigationFailure | void | undefined>;
1473
- /**
1474
- * Go back in history if possible by calling `history.back()`. Equivalent to
1475
- * `router.go(-1)`.
1476
- */
1477
- back(): void;
1478
- /**
1479
- * Go forward in history if possible by calling `history.forward()`.
1480
- * Equivalent to `router.go(1)`.
1481
- */
1482
- forward(): void;
1483
- /**
1484
- * Allows you to move forward or backward through the history. Calls
1485
- * `history.go()`.
1486
- *
1487
- * @param delta - The position in the history to which you want to move,
1488
- * relative to the current page
1489
- */
1490
- go(delta: number): void;
1491
- /**
1492
- * Add a navigation guard that executes before any navigation. Returns a
1493
- * function that removes the registered guard.
1494
- *
1495
- * @param guard - navigation guard to add
1496
- */
1497
- beforeEach(guard: NavigationGuardWithThis<undefined>): () => void;
1498
- /**
1499
- * Add a navigation guard that executes before navigation is about to be
1500
- * resolved. At this state all component have been fetched and other
1501
- * navigation guards have been successful. Returns a function that removes the
1502
- * registered guard.
1503
- *
1504
- * @param guard - navigation guard to add
1505
- * @returns a function that removes the registered guard
1506
- *
1507
- * @example
1508
- * ```js
1509
- * router.beforeResolve(to => {
1510
- * if (to.meta.requiresAuth && !isAuthenticated) return false
1511
- * })
1512
- * ```
1513
- *
1514
- */
1515
- beforeResolve(guard: _NavigationGuardResolved): () => void;
1516
- /**
1517
- * Add a navigation hook that is executed after every navigation. Returns a
1518
- * function that removes the registered hook.
1519
- *
1520
- * @param guard - navigation hook to add
1521
- * @returns a function that removes the registered hook
1522
- *
1523
- * @example
1524
- * ```js
1525
- * router.afterEach((to, from, failure) => {
1526
- * if (isNavigationFailure(failure)) {
1527
- * console.log('failed navigation', failure)
1528
- * }
1529
- * })
1530
- * ```
1531
- */
1532
- afterEach(guard: NavigationHookAfter): () => void;
1533
- /**
1534
- * Adds an error handler that is called every time a non caught error happens
1535
- * during navigation. This includes errors thrown synchronously and
1536
- * asynchronously, errors returned or passed to `next` in any navigation
1537
- * guard, and errors occurred when trying to resolve an async component that
1538
- * is required to render a route.
1539
- *
1540
- * @param handler - error handler to register
1541
- */
1542
- onError(handler: _ErrorListener): () => void;
1543
- /**
1544
- * Returns a Promise that resolves when the router has completed the initial
1545
- * navigation, which means it has resolved all async enter hooks and async
1546
- * components that are associated with the initial route. If the initial
1547
- * navigation already happened, the promise resolves immediately.
1548
- *
1549
- * This is useful in server-side rendering to ensure consistent output on both
1550
- * the server and the client. Note that on server side, you need to manually
1551
- * push the initial location while on client side, the router automatically
1552
- * picks it up from the URL.
1553
- */
1554
- isReady(): Promise<void>;
1555
- /**
1556
- * Called automatically by `app.use(router)`. Should not be called manually by
1557
- * the user. This will trigger the initial navigation when on client side.
1558
- *
1559
- * @internal
1560
- * @param app - Application that uses the router
1561
- */
1562
- install(app: App): void;
1563
- }
1564
- interface EXPERIMENTAL_Router extends EXPERIMENTAL_Router_Base<EXPERIMENTAL_RouteRecordNormalized_Matchable> {
1565
- /**
1566
- * Original options object passed to create the Router
1567
- */
1568
- readonly options: EXPERIMENTAL_RouterOptions;
1569
- /**
1570
- * Dev only method to replace the resolver used by the router. Used during HMR
1571
- *
1572
- * @param newResolver - new resolver to use
1573
- *
1574
- * @internal
1575
- */
1576
- _hmrReplaceResolver?: (newResolver: EXPERIMENTAL_ResolverFixed<EXPERIMENTAL_RouteRecordNormalized_Matchable>) => void;
1577
- }
1578
- /**
1579
- * Creates an experimental Router that allows passing a resolver instead of a
1580
- * routes array. This router does not have `addRoute()` and `removeRoute()`
1581
- * methods and is meant to be used with file-based routing thanks to
1582
- * vue-router/vite or vue-router/unplugin resolver generation in
1583
- * `'vue-router/auto-resolver'`.
1584
- *
1585
- * @param options - Options to initialize the router
1586
- */
1587
- declare function experimental_createRouter(options: EXPERIMENTAL_RouterOptions): EXPERIMENTAL_Router;
1588
- //#endregion
1589
- //#region src/experimental/route-resolver/matchers/errors.d.ts
1590
- /**
1591
- * Error throw when a matcher matches by regex but validation fails.
1592
- *
1593
- * @internal
1594
- */
1595
- declare class MatchMiss extends Error {
1596
- name: string;
1597
- }
1598
- /**
1599
- * Helper to throw a {@link MatchMiss} error.
1600
- * @param args - Arguments to pass to the `MatchMiss` constructor.
1601
- *
1602
- * @example
1603
- * ```ts
1604
- * miss()
1605
- * // in a number param matcher
1606
- * miss('Number must be finite')
1607
- * ```
1608
- */
1609
- declare const miss: (...args: ConstructorParameters<typeof MatchMiss>) => never;
1610
- //#endregion
1611
- //#region src/experimental/runtime.d.ts
1612
- /**
1613
- * Helper to define page properties with file-based routing.
1614
- * **Doesn't do anything**, used for types only.
1615
- *
1616
- * The `FilePath` type parameter is injected by the `sfc-typed-router` Volar
1617
- * plugin so that `params.path` keys are restricted to the file's actual path
1618
- * params. When omitted, `params.path` falls back to a loose record.
1619
- *
1620
- * @param route - route information to be added to this page
1621
- *
1622
- * @internal
1623
- */
1624
- declare function definePage<FilePath extends string = string>(route: DefinePage<FilePath>): DefinePage<FilePath>;
1625
- /**
1626
- * Resolves the union of valid path-param names for a given file path. Falls
1627
- * back to `string` when no entry is augmented (default Volar-less usage).
1628
- *
1629
- * Wired via the `_RouteFileInfoMap` slot in the user's augmented
1630
- * {@link TypesConfig} so the lookup survives the bundler that otherwise
1631
- * inlines an empty version of the base interface.
1632
- *
1633
- * @internal
1634
- */
1635
- type PathParamNamesForFilePath<FilePath extends string> = TypesConfig extends {
1636
- _RouteFileInfoMap: { [K in FilePath]: {
1637
- pathParamNames: infer N extends string;
1638
- }; };
1639
- } ? N : string;
1640
- /**
1641
- * Merges route records.
1642
- *
1643
- * @internal
1644
- *
1645
- * @param main - main route record
1646
- * @param routeRecords - route records to merge
1647
- * @returns merged route record
1648
- */
1649
- declare function _mergeRouteRecord(main: RouteRecordRaw, ...routeRecords: Partial<RouteRecordRaw>[]): RouteRecordRaw;
1650
- /**
1651
- * Type to define a page. Can be augmented to add custom properties.
1652
- *
1653
- * @typeParam FilePath - File path of the SFC declaring this page, used to
1654
- * narrow `params.path` keys to the actual path parameters of the route. When
1655
- * left as the default `string`, keys are unrestricted.
1656
- */
1657
- interface DefinePage<FilePath extends string = string> extends Partial<Omit<RouteRecordRaw, 'children' | 'components' | 'component' | 'name'>> {
1658
- /**
1659
- * Override the route name. If not provided, the name will be generated based
1660
- * on the file path. Can be set to `false` to make the route _anonymous_
1661
- * which removes it from types and make the route unmatchable.
1662
- */
1663
- name?: string | false;
1664
- /**
1665
- * Custom parameters for the route. Requires `experimental.paramParsers` enabled.
1666
- *
1667
- * @experimental
1668
- */
1669
- params?: {
1670
- /**
1671
- * Parameters extracted from the path. Allows to setup custom parsers without changing the filename.
1672
- */
1673
- path?: { [K in PathParamNamesForFilePath<FilePath>]?: ParamParserType; };
1674
- /**
1675
- * Parameters extracted from the query.
1676
- */
1677
- query?: Record<string, DefinePageQueryParamOptionsAny | ParamParserType>;
1678
- };
1679
- }
1680
- /**
1681
- * Built-in param parsers. Always available; merged into {@link ParamParsers}
1682
- * alongside any entries the user augments into {@link TypesConfig.ParamParsers}.
1683
- *
1684
- * @internal
1685
- */
1686
- interface ParamParsers_Native {
1687
- int: {
1688
- type: number;
1689
- };
1690
- bool: {
1691
- type: boolean;
1692
- };
1693
- string: {
1694
- type: string;
1695
- };
1696
- }
1697
- type ParamParserType_Native = keyof ParamParsers_Native;
1698
- /**
1699
- * Full registry of param parsers: built-ins merged with whatever the user
1700
- * augments into {@link TypesConfig.ParamParsers}. Each entry is shaped
1701
- * `{ type: T }` so the parsed value type can be looked up by name via
1702
- * {@link ParamParserTypeOf}. The vue-router codegen emits this augmentation
1703
- * automatically from files in the `params/` folder.
1704
- *
1705
- * @internal
1706
- */
1707
- type ParamParsers = ParamParsers_Native & (TypesConfig extends {
1708
- _ParamParsers: infer P;
1709
- } ? P : {});
1710
- /**
1711
- * Union of all known parser names (built-in + augmented).
1712
- */
1713
- type ParamParserType = keyof ParamParsers;
1714
- /**
1715
- * Resolves the parsed value type for a given parser name. Distributes over a
1716
- * union of names, so `ParamParserTypeOf<'int' | 'date'>` → `number | Date`.
1717
- *
1718
- * Falls back to `unknown` when an entry is registered without a `type` field.
1719
- * The `_ParamParsers` slot is internal — vue-router's codegen populates it
1720
- * from files in `params/`.
1721
- *
1722
- * @example
1723
- * ```ts
1724
- * declare module 'vue-router' {
1725
- * interface TypesConfig {
1726
- * _ParamParsers: {
1727
- * date: { type: Date }
1728
- * }
1729
- * }
1730
- * }
1731
- * ```
1732
- */
1733
- type ParamParserTypeOf<Name extends ParamParserType> = Name extends keyof ParamParsers ? ParamParsers[Name] extends {
1734
- type: infer T;
1735
- } ? T : unknown : unknown;
1736
- /**
1737
- * Distributive variant of {@link DefinePageQueryParamOptions} used in the
1738
- * `params.query` record. Distributing over `ParamParserType` produces one
1739
- * variant per literal parser name so the `parser` field acts as a discriminant
1740
- * and `default` is narrowed to that parser's resolved value type. Without
1741
- * this, the bare interface defaults `Parser` to the full `ParamParserType`
1742
- * union and `default` collapses to the union of every parser's value type.
1743
- *
1744
- * @internal
1745
- */
1746
- type DefinePageQueryParamOptionsAny<P extends ParamParserType = ParamParserType> = P extends ParamParserType ? DefinePageQueryParamOptions<P> : never;
1747
- /**
1748
- * Configures how to extract a route param from a specific query parameter.
1749
- *
1750
- * @typeParam Parser - name of the param parser used for this query parameter,
1751
- * used to type the {@link DefinePageQueryParamOptions.default | `default`}
1752
- * value via {@link ParamParserTypeOf}.
1753
- */
1754
- interface DefinePageQueryParamOptions<Parser extends ParamParserType = ParamParserType> {
1755
- /**
1756
- * The type of the query parameter. Allowed values are native param parsers
1757
- * and any parser in the {@link https://uvr.esm.is/TODO | params folder }. If
1758
- * not provided, the value will kept as is.
1759
- */
1760
- parser?: Parser;
1761
- /**
1762
- * Default value if the query parameter is missing or if the match fails
1763
- * (e.g. a invalid number is passed to the int param parser). If not provided
1764
- * and the param is not required, the route will match with undefined.
1765
- */
1766
- default?: (() => ParamParserTypeOf<Parser>) | ParamParserTypeOf<Parser>;
1767
- /**
1768
- * How to format the query parameter value.
1769
- *
1770
- * - 'value' - keep the first value only and pass that to parser
1771
- * - 'array' - keep all values (even one or none) as an array and pass that to parser
1772
- *
1773
- * @default 'value'
1774
- */
1775
- format?: 'value' | 'array';
1776
- /**
1777
- * Whether this query parameter is required. If true and the parameter is
1778
- * missing (and no default is provided), the route will not match.
1779
- *
1780
- * @default false
1781
- */
1782
- required?: boolean;
1783
- }
1784
- /**
1785
- * TODO: native parsers ideas:
1786
- * - json -> just JSON.parse(value)
1787
- * - boolean -> 'true' | 'false' -> boolean
1788
- * - number -> Number(value) -> NaN if not a number
1789
- */
1790
- //#endregion
1791
- //#region src/experimental/data-loaders/types-config.d.ts
1792
- /**
1793
- * The default error type used for data loaders. Can be customized via {@link TypesConfig}.
1794
- *
1795
- * @example
1796
- * ```ts
1797
- * // types-extension.d.ts
1798
- * import 'vue-router/experimental'
1799
- * export {}
1800
- * declare module 'vue-router/experimental' {
1801
- * interface TypesConfig {
1802
- * Error: MyCustomError
1803
- * }
1804
- * }
1805
- * ```
1806
- *
1807
- * @internal
1808
- */
1809
- type ErrorDefault = TypesConfig extends Record<'Error', infer E> ? E : Error;
1810
- //#endregion
1811
- //#region src/experimental/data-loaders/defineLoader.d.ts
1812
- /**
1813
- * Creates a data loader composable that can be exported by pages to attach the data loading to a route. In this version `data` is always defined.
1814
- *
1815
- * @param name - name of the route
1816
- * @param loader - function that returns a promise with the data
1817
- * @param options - options to configure the data loader
1818
- */
1819
- declare function defineBasicLoader<Name extends keyof RouteMap, Data>(name: Name, loader: DefineLoaderFn<Data, DataLoaderContext, RouteLocationNormalizedLoaded<Name>>, options?: DefineDataLoaderOptions_DefinedData): UseDataLoaderBasic_DefinedData<Data>;
1820
- /**
1821
- * Creates a data loader composable that can be exported by pages to attach the data loading to a route. In this version, `data` can be `undefined`.
1822
- *
1823
- * @param name - name of the route
1824
- * @param loader - function that returns a promise with the data
1825
- * @param options - options to configure the data loader
1826
- */
1827
- declare function defineBasicLoader<Name extends keyof RouteMap, Data>(name: Name, loader: DefineLoaderFn<Data, DataLoaderContext, RouteLocationNormalizedLoaded<Name>>, options: DefineDataLoaderOptions_LaxData): UseDataLoaderBasic_LaxData<Data>;
1828
- /**
1829
- * Creates a data loader composable that can be exported by pages to attach the data loading to a route. In this version `data` is always defined.
1830
- *
1831
- * @param loader - function that returns a promise with the data
1832
- * @param options - options to configure the data loader
1833
- */
1834
- declare function defineBasicLoader<Data>(loader: DefineLoaderFn<Data, DataLoaderContext, RouteLocationNormalizedLoaded>, options?: DefineDataLoaderOptions_DefinedData): UseDataLoaderBasic_DefinedData<Data>;
1835
- /**
1836
- * Creates a data loader composable that can be exported by pages to attach the data loading to a route. In this version, `data` can be `undefined`.
1837
- *
1838
- * @param loader - function that returns a promise with the data
1839
- * @param options - options to configure the data loader
1840
- */
1841
- declare function defineBasicLoader<Data>(loader: DefineLoaderFn<Data, DataLoaderContext, RouteLocationNormalizedLoaded>, options: DefineDataLoaderOptions_LaxData): UseDataLoaderBasic_LaxData<Data>;
1842
- interface DefineDataLoaderOptions_LaxData extends DefineDataLoaderOptionsBase_LaxData {
1843
- /**
1844
- * Key to use for SSR state. This will be used to read the initial data from `initialData`'s object.
1845
- */
1846
- key?: string;
1847
- }
1848
- interface DefineDataLoaderOptions_DefinedData extends DefineDataLoaderOptionsBase_DefinedData {
1849
- key?: string;
1850
- }
1851
- /**
1852
- * @deprecated use {@link DefineDataLoaderOptions_LaxData} instead
1853
- */
1854
- type DefineDataLoaderOptions = DefineDataLoaderOptions_LaxData;
1855
- interface DataLoaderContext extends DataLoaderContextBase {}
1856
- /**
1857
- * Symbol used to store the data in the router so it can be retrieved after the initial navigation.
1858
- * @internal
1859
- */
1860
- declare const SERVER_INITIAL_DATA_KEY: unique symbol;
1861
- /**
1862
- * Initial data generated on server and consumed on client.
1863
- * @internal
1864
- */
1865
- declare const INITIAL_DATA_KEY: unique symbol;
1866
- interface UseDataLoaderBasic_LaxData<Data> extends UseDataLoader<Data | undefined, ErrorDefault> {}
1867
- /**
1868
- * @deprecated use {@link UseDataLoaderBasic_LaxData} instead
1869
- */
1870
- type UseDataLoaderBasic<Data> = UseDataLoaderBasic_LaxData<Data>;
1871
- interface UseDataLoaderBasic_DefinedData<Data> extends UseDataLoader<Data, ErrorDefault> {}
1872
- interface DataLoaderBasicEntry<TData, TError = unknown, TDataInitial extends TData | undefined = TData | undefined> extends DataLoaderEntryBase<TData, TError, TDataInitial> {}
1873
- //#endregion
1874
- //#region src/experimental/index.d.ts
1875
- /**
1876
- * @deprecated Use {@link reroute} instead.
1877
- */
1878
- declare class NavigationResult$1 extends NavigationResult {
1879
- constructor(...args: ConstructorParameters<typeof NavigationResult>);
1880
- }
1881
- //#endregion
1882
- //#region src/types/index.d.ts
1883
- type Lazy<T> = () => Promise<T>;
1884
- /**
1885
- * @internal
1886
- */
1887
- type RouteParamValue = string;
1888
- /**
1889
- * @internal
1890
- */
1891
- type RouteParamValueRaw = RouteParamValue | number | null | undefined;
1892
- type RouteParamsGeneric = Record<string, RouteParamValue | RouteParamValue[]>;
1893
- type RouteParamsRawGeneric = Record<string, RouteParamValueRaw | Exclude<RouteParamValueRaw, null | undefined>[]>;
1894
- /**
1895
- * @internal
1896
- */
1897
- interface RouteQueryAndHash {
1898
- query?: LocationQueryRaw$1;
1899
- hash?: string;
1900
- }
1901
- /**
1902
- * @internal
1903
- */
1904
- interface MatcherLocationAsPath {
1905
- path: string;
1906
- }
1907
- /**
1908
- * @internal
1909
- */
1910
- interface MatcherLocationAsName {
1911
- name: RouteRecordNameGeneric;
1912
- /**
1913
- * Ignored path property since we are dealing with a relative location. Only `undefined` is allowed.
1914
- */
1915
- path?: undefined;
1916
- params?: RouteParamsGeneric;
1917
- }
1918
- /**
1919
- * @internal
1920
- */
1921
- interface MatcherLocationAsRelative {
1922
- /**
1923
- * Ignored path property since we are dealing with a relative location. Only `undefined` is allowed.
1924
- */
1925
- path?: undefined;
1926
- params?: RouteParamsGeneric;
1927
- }
1928
- /**
1929
- * @internal
1930
- */
1931
- interface LocationAsRelativeRaw {
1932
- name?: RouteRecordNameGeneric;
1933
- /**
1934
- * Ignored path property since we are dealing with a relative location. Only `undefined` is allowed.
1935
- */
1936
- path?: undefined;
1937
- params?: RouteParamsRawGeneric;
1938
- }
1939
- /**
1940
- * Common options for all navigation methods.
1941
- */
1942
- interface RouteLocationOptions {
1943
- /**
1944
- * Replace the entry in the history instead of pushing a new entry
1945
- */
1946
- replace?: boolean;
1947
- /**
1948
- * Triggers the navigation even if the location is the same as the current one.
1949
- * Note this will also add a new entry to the history unless `replace: true`
1950
- * is passed.
1951
- */
1952
- force?: boolean;
1953
- /**
1954
- * State to save using the History API. This cannot contain any reactive
1955
- * values and some primitives like Symbols are forbidden. More info at
1956
- * https://developer.mozilla.org/en-US/docs/Web/API/History/state
1957
- */
1958
- state?: HistoryState;
1959
- }
1960
- /**
1961
- * Route Location that can infer the necessary params based on the name.
1962
- *
1963
- * @internal
1964
- */
1965
- interface RouteLocationNamedRaw extends RouteQueryAndHash, LocationAsRelativeRaw, RouteLocationOptions {}
1966
- /**
1967
- * Route Location that can infer the possible paths.
1968
- *
1969
- * @internal
1970
- */
1971
- interface RouteLocationPathRaw extends RouteQueryAndHash, MatcherLocationAsPath, RouteLocationOptions {}
1972
- interface RouteLocationMatched extends RouteRecordNormalized {
1973
- components: Record<string, RouteComponent> | null | undefined;
1974
- }
1975
- /**
1976
- * Base properties for a normalized route location.
1977
- *
1978
- * @internal
1979
- */
1980
- interface _RouteLocationBase extends Pick<MatcherLocation, 'name' | 'path' | 'params' | 'meta'> {
1981
- /**
1982
- * The whole location including the `search` and `hash`. This string is
1983
- * percentage encoded.
1984
- */
1985
- fullPath: string;
1986
- /**
1987
- * Object representation of the `search` property of the current location.
1988
- */
1989
- query: LocationQuery$1;
1990
- /**
1991
- * Hash of the current location. If present, starts with a `#`.
1992
- */
1993
- hash: string;
1994
- /**
1995
- * Contains the location we were initially trying to access before ending up
1996
- * on the current location.
1997
- */
1998
- redirectedFrom: RouteLocation | undefined;
1999
- }
2000
- /**
2001
- * Allowed Component in {@link RouteLocationMatched}
2002
- */
2003
- type RouteComponent = Component$1 | DefineComponent;
2004
- /**
2005
- * Allowed Component definitions in route records provided by the user
2006
- */
2007
- type RawRouteComponent = RouteComponent | Lazy<RouteComponent>;
2008
- /**
2009
- * Internal type for common properties among all kind of {@link RouteRecordRaw}.
2010
- */
2011
- interface _RouteRecordBase extends PathParserOptions {
2012
- /**
2013
- * Path of the record. Should start with `/` unless the record is the child of
2014
- * another record.
2015
- *
2016
- * @example `/users/:id` matches `/users/1` as well as `/users/posva`.
2017
- */
2018
- path: string;
2019
- /**
2020
- * Where to redirect if the route is directly matched. The redirection happens
2021
- * before any navigation guard and triggers a new navigation with the new
2022
- * target location.
2023
- */
2024
- redirect?: RouteRecordRedirectOption;
2025
- /**
2026
- * Aliases for the record. Allows defining extra paths that will behave like a
2027
- * copy of the record. Allows having paths shorthands like `/users/:id` and
2028
- * `/u/:id`. All `alias` and `path` values must share the same params.
2029
- */
2030
- alias?: string | string[];
2031
- /**
2032
- * Name for the route record. Must be unique.
2033
- */
2034
- name?: RouteRecordNameGeneric;
2035
- /**
2036
- * Before Enter guard specific to this record. Note `beforeEnter` has no
2037
- * effect if the record has a `redirect` property.
2038
- */
2039
- beforeEnter?: NavigationGuardWithThis<undefined> | NavigationGuardWithThis<undefined>[];
2040
- /**
2041
- * Arbitrary data attached to the record.
2042
- */
2043
- meta?: RouteMeta;
2044
- /**
2045
- * Array of nested routes.
2046
- */
2047
- children?: RouteRecordRaw[];
2048
- /**
2049
- * Allow passing down params as props to the component rendered by `router-view`.
2050
- */
2051
- props?: _RouteRecordProps | Record<string, _RouteRecordProps>;
2052
- }
2053
- /**
2054
- * Interface to type `meta` fields in route records.
2055
- *
2056
- * @example
2057
- *
2058
- * ```ts
2059
- * // typings.d.ts or router.ts
2060
- * import 'vue-router';
2061
- *
2062
- * declare module 'vue-router' {
2063
- * interface RouteMeta {
2064
- * requiresAuth?: boolean
2065
- * }
2066
- * }
2067
- * ```
2068
- */
2069
- interface RouteMeta extends Record<PropertyKey, unknown> {
2070
- /**
2071
- * The data loaders for a route record. Add any data loader to this array to
2072
- * have it called when the route is navigated to. Note this is only needed
2073
- * when **not** using lazy components (`() => import('./pages/Home.vue')`) or
2074
- * when not explicitly exporting data loaders from page components.
2075
- *
2076
- * This requires the use of the experimental data loaders and is ignored otherwise.
2077
- *
2078
- * @see {@link DataLoaderPlugin}
2079
- */
2080
- loaders?: UseDataLoader[];
2081
- /**
2082
- * Set of loaders for the current route. This is built once during navigation
2083
- * and is used to merge the loaders from the lazy import in components or the
2084
- * `loaders` array in the route record.
2085
- *
2086
- * @internal
2087
- */
2088
- [LOADER_SET_KEY]?: Set<UseDataLoader>;
2089
- /**
2090
- * The signal that is aborted when the navigation is canceled or an error
2091
- * occurs.
2092
- *
2093
- * @internal
2094
- */
2095
- [ABORT_CONTROLLER_KEY]?: AbortController;
2096
- }
2097
- /**
2098
- * Route Record defining one single component with the `component` option.
2099
- */
2100
- interface RouteRecordSingleView extends _RouteRecordBase {
2101
- /**
2102
- * Component to display when the URL matches this route.
2103
- */
2104
- component: RawRouteComponent;
2105
- components?: never;
2106
- children?: never;
2107
- redirect?: never;
2108
- /**
2109
- * Allow passing down params as props to the component rendered by `router-view`.
2110
- */
2111
- props?: _RouteRecordProps;
2112
- }
2113
- /**
2114
- * Route Record defining one single component with a nested view. Differently
2115
- * from {@link RouteRecordSingleView}, this record has children and allows a
2116
- * `redirect` option.
2117
- */
2118
- interface RouteRecordSingleViewWithChildren extends _RouteRecordBase {
2119
- /**
2120
- * Component to display when the URL matches this route.
2121
- */
2122
- component?: RawRouteComponent | null | undefined;
2123
- components?: never;
2124
- children: RouteRecordRaw[];
2125
- /**
2126
- * Allow passing down params as props to the component rendered by `router-view`.
2127
- */
2128
- props?: _RouteRecordProps;
2129
- }
2130
- /**
2131
- * Route Record defining multiple named components with the `components` option.
2132
- */
2133
- interface RouteRecordMultipleViews extends _RouteRecordBase {
2134
- /**
2135
- * Components to display when the URL matches this route. Allow using named views.
2136
- */
2137
- components: Record<string, RawRouteComponent>;
2138
- component?: never;
2139
- children?: never;
2140
- redirect?: never;
2141
- /**
2142
- * Allow passing down params as props to the component rendered by
2143
- * `router-view`. Should be an object with the same keys as `components` or a
2144
- * boolean to be applied to every component.
2145
- */
2146
- props?: Record<string, _RouteRecordProps> | boolean;
2147
- }
2148
- /**
2149
- * Route Record defining multiple named components with the `components` option and children.
2150
- */
2151
- interface RouteRecordMultipleViewsWithChildren extends _RouteRecordBase {
2152
- /**
2153
- * Components to display when the URL matches this route. Allow using named views.
2154
- */
2155
- components?: Record<string, RawRouteComponent> | null | undefined;
2156
- component?: never;
2157
- children: RouteRecordRaw[];
2158
- /**
2159
- * Allow passing down params as props to the component rendered by
2160
- * `router-view`. Should be an object with the same keys as `components` or a
2161
- * boolean to be applied to every component.
2162
- */
2163
- props?: Record<string, _RouteRecordProps> | boolean;
2164
- }
2165
- /**
2166
- * Route Record that defines a redirect. Cannot have `component` or `components`
2167
- * as it is never rendered.
2168
- */
2169
- interface RouteRecordRedirect extends _RouteRecordBase {
2170
- redirect: RouteRecordRedirectOption;
2171
- component?: never;
2172
- components?: never;
2173
- props?: never;
2174
- }
2175
- type RouteRecordRaw = RouteRecordSingleView | RouteRecordSingleViewWithChildren | RouteRecordMultipleViews | RouteRecordMultipleViewsWithChildren | RouteRecordRedirect;
2176
- /**
2177
- * Route location that can be passed to the matcher.
2178
- */
2179
- type MatcherLocationRaw = MatcherLocationAsPath | MatcherLocationAsName | MatcherLocationAsRelative;
2180
- /**
2181
- * Normalized/resolved Route location that returned by the matcher.
2182
- */
2183
- interface MatcherLocation {
2184
- /**
2185
- * Name of the matched record
2186
- */
2187
- name: RouteRecordNameGeneric | null | undefined;
2188
- /**
2189
- * Percentage encoded pathname section of the URL.
2190
- */
2191
- path: string;
2192
- /**
2193
- * Object of decoded params extracted from the `path`.
2194
- */
2195
- params: RouteParamsGeneric;
2196
- /**
2197
- * Merged `meta` properties from all the matched route records.
2198
- */
2199
- meta: RouteMeta;
2200
- /**
2201
- * Array of {@link RouteRecord} containing components as they were
2202
- * passed when adding records. It can also contain redirect records. This
2203
- * can't be used directly
2204
- */
2205
- matched: RouteRecord[];
2206
- }
2207
- //#endregion
2208
- //#region src/typed-routes/route-map.d.ts
2209
- /**
2210
- * Helper type to define a Typed `RouteRecord`
2211
- * @see {@link RouteRecord}
2212
- */
2213
- interface RouteRecordInfo<Name extends string | symbol = string, Path extends string = string, ParamsRaw extends RouteParamsRawGeneric = RouteParamsRawGeneric, Params extends RouteParamsGeneric = RouteParamsGeneric, ChildrenNames extends string | symbol = never> {
2214
- name: Name;
2215
- path: Path;
2216
- paramsRaw: ParamsRaw;
2217
- params: Params;
2218
- childrenNames: ChildrenNames;
2219
- }
2220
- type RouteRecordInfoGeneric = RouteRecordInfo<string | symbol, string, RouteParamsRawGeneric, RouteParamsGeneric, string | symbol>;
2221
- /**
2222
- * Convenience type to get the typed RouteMap or a generic one if not provided.
2223
- * It is extracted from the {@link TypesConfig} if it exists, it becomes
2224
- * {@link RouteMapGeneric} otherwise.
2225
- */
2226
- type RouteMap = TypesConfig extends Record<'RouteNamedMap', infer RouteNamedMap> ? RouteNamedMap : RouteMapGeneric;
2227
- /**
2228
- * Generic version of the `RouteMap`.
2229
- */
2230
- type RouteMapGeneric = Record<string | symbol, RouteRecordInfoGeneric>;
2231
- //#endregion
2232
- //#region src/typed-routes/params.d.ts
2233
- /**
2234
- * Utility type for raw and non raw params like :id+
2235
- *
2236
- */
2237
- type ParamValueOneOrMore<isRaw extends boolean> = [ParamValue<isRaw>, ...ParamValue<isRaw>[]];
2238
- /**
2239
- * Utility type for raw and non raw params like :id*
2240
- *
2241
- */
2242
- type ParamValueZeroOrMore<isRaw extends boolean> = true extends isRaw ? ParamValue<isRaw>[] | undefined | null : ParamValue<isRaw>[] | undefined;
2243
- /**
2244
- * Utility type for raw and non raw params like :id?
2245
- *
2246
- */
2247
- type ParamValueZeroOrOne<isRaw extends boolean> = true extends isRaw ? string | number | null | undefined : string;
2248
- /**
2249
- * Utility type for raw and non raw params like :id
2250
- *
2251
- */
2252
- type ParamValue<isRaw extends boolean> = true extends isRaw ? string | number : string;
2253
- /**
2254
- * Generate a type safe params for a route location. Requires the name of the route to be passed as a generic.
2255
- * @see {@link RouteParamsGeneric}
2256
- */
2257
- type RouteParams<Name extends keyof RouteMap = keyof RouteMap> = RouteMap[Name]['params'];
2258
- /**
2259
- * Generate a type safe raw params for a route location. Requires the name of the route to be passed as a generic.
2260
- * @see {@link RouteParamsRaw}
2261
- */
2262
- type RouteParamsRaw<Name extends keyof RouteMap = keyof RouteMap> = RouteMap[Name]['paramsRaw'];
2263
- //#endregion
2264
- //#region src/typed-routes/route-records.d.ts
2265
- /**
2266
- * @internal
2267
- */
2268
- type RouteRecordRedirectOption = RouteLocationRaw | ((to: RouteLocation, from: RouteLocationNormalizedLoaded) => RouteLocationRaw);
2269
- /**
2270
- * Generic version of {@link RouteRecordName}.
2271
- */
2272
- type RouteRecordNameGeneric = string | symbol | undefined;
2273
- /**
2274
- * Possible values for a route record **after normalization**
2275
- *
2276
- * 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`}
2277
- */
2278
- type RouteRecordName = RouteMapGeneric extends RouteMap ? RouteRecordNameGeneric : keyof RouteMap;
2279
- /**
2280
- * @internal
2281
- */
2282
- type _RouteRecordProps<Name extends keyof RouteMap = keyof RouteMap> = boolean | Record<string, any> | ((to: RouteLocationNormalized<Name>) => Record<string, any>);
2283
- //#endregion
2284
- //#region src/typed-routes/route-location.d.ts
2285
- /**
2286
- * Generic version of {@link RouteLocation}. It is used when no {@link RouteMap} is provided.
2287
- */
2288
- interface RouteLocationGeneric extends _RouteLocationBase, RouteLocationOptions {
2289
- /**
2290
- * Array of {@link RouteRecord} containing components as they were
2291
- * passed when adding records. It can also contain redirect records. This
2292
- * can't be used directly. **This property is non-enumerable**.
2293
- */
2294
- matched: RouteRecord[];
2295
- }
2296
- /**
2297
- * Helper to generate a type safe version of the {@link RouteLocation} type.
2298
- */
2299
- interface RouteLocationTyped<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; }, Name extends keyof RouteMap> extends RouteLocationGeneric {
2300
- name: Extract<Name, string | symbol>;
2301
- params: RouteMap[Name]['params'];
2302
- }
2303
- /**
2304
- * List of all possible {@link RouteLocation} indexed by the route name.
2305
- * @internal
2306
- */
2307
- type RouteLocationTypedList<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric> = { [N in keyof RouteMap]: RouteLocationTyped<RouteMap, N>; };
2308
- /**
2309
- * Generic version of {@link RouteLocationNormalized} that is used when no {@link RouteMap} is provided.
2310
- */
2311
- interface RouteLocationNormalizedGeneric extends _RouteLocationBase {
2312
- name: RouteRecordNameGeneric;
2313
- /**
2314
- * Array of {@link RouteRecordNormalized}
2315
- */
2316
- matched: RouteRecordNormalized[];
2317
- }
2318
- /**
2319
- * Helper to generate a type safe version of the {@link RouteLocationNormalized} type.
2320
- */
2321
- interface RouteLocationNormalizedTyped<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> extends RouteLocationNormalizedGeneric {
2322
- name: Extract<Name, string | symbol>;
2323
- params: RouteMap[Name]['params'];
2324
- /**
2325
- * Array of {@link RouteRecordNormalized}
2326
- */
2327
- matched: RouteRecordNormalized[];
2328
- }
2329
- /**
2330
- * List of all possible {@link RouteLocationNormalized} indexed by the route name.
2331
- * @internal
2332
- */
2333
- type RouteLocationNormalizedTypedList<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric> = { [N in keyof RouteMap]: RouteLocationNormalizedTyped<RouteMap, N>; };
2334
- /**
2335
- * Generic version of {@link RouteLocationNormalizedLoaded} that is used when no {@link RouteMap} is provided.
2336
- */
2337
- interface RouteLocationNormalizedLoadedGeneric extends RouteLocationNormalizedGeneric {
2338
- /**
2339
- * Array of {@link RouteLocationMatched} containing only plain components (any
2340
- * lazy-loaded components have been loaded and were replaced inside the
2341
- * `components` object) so it can be directly used to display routes. It
2342
- * cannot contain redirect records either. **This property is non-enumerable**.
2343
- */
2344
- matched: RouteLocationMatched[];
2345
- }
2346
- /**
2347
- * Helper to generate a type safe version of the {@link RouteLocationNormalizedLoaded} type.
2348
- */
2349
- interface RouteLocationNormalizedLoadedTyped<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> extends RouteLocationNormalizedLoadedGeneric {
2350
- name: Extract<Name, string | symbol>;
2351
- params: RouteMap[Name]['params'];
2352
- }
2353
- /**
2354
- * List of all possible {@link RouteLocationNormalizedLoaded} indexed by the route name.
2355
- * @internal
2356
- */
2357
- type RouteLocationNormalizedLoadedTypedList<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric> = { [N in keyof RouteMap]: RouteLocationNormalizedLoadedTyped<RouteMap, N>; };
2358
- /**
2359
- * Generic version of {@link RouteLocationAsRelative}. It is used when no {@link RouteMap} is provided.
2360
- */
2361
- interface RouteLocationAsRelativeGeneric extends RouteQueryAndHash, RouteLocationOptions {
2362
- name?: RouteRecordNameGeneric;
2363
- params?: RouteParamsRawGeneric;
2364
- /**
2365
- * A relative path to the current location. This property should be removed
2366
- */
2367
- path?: undefined;
2368
- }
2369
- /**
2370
- * Helper to generate a type safe version of the {@link RouteLocationAsRelative} type.
2371
- */
2372
- interface RouteLocationAsRelativeTyped<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> extends RouteLocationAsRelativeGeneric {
2373
- name?: Extract<Name, string | symbol>;
2374
- params?: RouteMap[Name]['paramsRaw'];
2375
- }
2376
- /**
2377
- * List of all possible {@link RouteLocationAsRelative} indexed by the route name.
2378
- * @internal
2379
- */
2380
- type RouteLocationAsRelativeTypedList<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric> = { [N in keyof RouteMap]: RouteLocationAsRelativeTyped<RouteMap, N>; };
2381
- /**
2382
- * Generic version of {@link RouteLocationAsPath}. It is used when no {@link RouteMap} is provided.
2383
- */
2384
- interface RouteLocationAsPathGeneric extends RouteQueryAndHash, RouteLocationOptions {
2385
- /**
2386
- * Percentage encoded pathname section of the URL.
2387
- */
2388
- path: string;
2389
- }
2390
- /**
2391
- * Helper to generate a type safe version of the {@link RouteLocationAsPath} type.
2392
- */
2393
- interface RouteLocationAsPathTyped<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> extends RouteLocationAsPathGeneric {
2394
- path: _LiteralUnion<RouteMap[Name]['path']>;
2395
- }
2396
- /**
2397
- * List of all possible {@link RouteLocationAsPath} indexed by the route name.
2398
- * @internal
2399
- */
2400
- type RouteLocationAsPathTypedList<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric> = { [N in keyof RouteMap]: RouteLocationAsPathTyped<RouteMap, N>; };
2401
- /**
2402
- * Helper to generate a type safe version of the {@link RouteLocationAsString} type.
2403
- */
2404
- type RouteLocationAsStringTyped<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric, Name extends keyof RouteMap = keyof RouteMap> = RouteMap[Name]['path'];
2405
- /**
2406
- * List of all possible {@link RouteLocationAsString} indexed by the route name.
2407
- * @internal
2408
- */
2409
- type RouteLocationAsStringTypedList<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric> = { [N in keyof RouteMap]: RouteLocationAsStringTyped<RouteMap, N>; };
2410
- /**
2411
- * Generic version of {@link RouteLocationResolved}. It is used when no {@link RouteMap} is provided.
2412
- */
2413
- interface RouteLocationResolvedGeneric extends RouteLocationGeneric {
2414
- /**
2415
- * Resolved `href` for the route location that will be set on the `<a href="...">`.
2416
- */
2417
- href: string;
2418
- }
2419
- /**
2420
- * Helper to generate a type safe version of the {@link RouteLocationResolved} type.
2421
- */
2422
- interface RouteLocationResolvedTyped<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; }, Name extends keyof RouteMap> extends RouteLocationTyped<RouteMap, Name> {
2423
- /**
2424
- * Resolved `href` for the route location that will be set on the `<a href="...">`.
2425
- */
2426
- href: string;
2427
- }
2428
- /**
2429
- * List of all possible {@link RouteLocationResolved} indexed by the route name.
2430
- * @internal
2431
- */
2432
- type RouteLocationResolvedTypedList<RouteMap extends { [K in keyof RouteMap]: RouteRecordInfoGeneric; } = RouteMapGeneric> = { [N in keyof RouteMap]: RouteLocationResolvedTyped<RouteMap, N>; };
2433
- /**
2434
- * 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.
2435
- */
2436
- /**
2437
- * {@link RouteLocationRaw} resolved using the matcher
2438
- */
2439
- type RouteLocation<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationGeneric : RouteLocationTypedList<RouteMap>[Name];
2440
- /**
2441
- * Similar to {@link RouteLocation} but its
2442
- * {@link RouteLocationNormalizedTyped.matched | `matched` property} cannot contain redirect records
2443
- */
2444
- type RouteLocationNormalized<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationNormalizedGeneric : RouteLocationNormalizedTypedList<RouteMap>[Name];
2445
- /**
2446
- * Similar to {@link RouteLocationNormalized} but its `components` do not contain any function to lazy load components.
2447
- * In other words, it's ready to be rendered by `<RouterView>`.
2448
- */
2449
- type RouteLocationNormalizedLoaded<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationNormalizedLoadedGeneric : RouteLocationNormalizedLoadedTypedList<RouteMap>[Name];
2450
- /**
2451
- * Route location relative to the current location. It accepts other properties than `path` like `params`, `query` and
2452
- * `hash` to conveniently change them.
2453
- */
2454
- type RouteLocationAsRelative<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsRelativeGeneric : RouteLocationAsRelativeTypedList<RouteMap>[Name];
2455
- /**
2456
- * Route location resolved with {@link Router | `router.resolve()`}.
2457
- */
2458
- type RouteLocationResolved<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationResolvedGeneric : RouteLocationResolvedTypedList<RouteMap>[Name];
2459
- /**
2460
- * Same as {@link RouteLocationAsPath} but as a string literal.
2461
- */
2462
- type RouteLocationAsString<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? string : _LiteralUnion<RouteLocationAsStringTypedList<RouteMap>[Name], string>;
2463
- /**
2464
- * Route location as an object with a `path` property.
2465
- */
2466
- type RouteLocationAsPath<Name extends keyof RouteMap = keyof RouteMap> = RouteMapGeneric extends RouteMap ? RouteLocationAsPathGeneric : RouteLocationAsPathTypedList<RouteMap>[Name];
2467
- /**
2468
- * Route location that can be passed to `router.push()` and other user-facing APIs.
2469
- */
2470
- 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];
2471
- //#endregion
2472
- //#region src/typed-routes/navigation-guards.d.ts
2473
- /**
2474
- * Return types for a Navigation Guard. Based on `TypesConfig`
2475
- *
2476
- * @see {@link TypesConfig}
2477
- */
2478
- type NavigationGuardReturn = void | Error | boolean | RouteLocationRaw;
2479
- /**
2480
- * Navigation Guard with a type parameter for `this`.
2481
- * @see {@link TypesConfig}
2482
- */
2483
- interface NavigationGuardWithThis<T> {
2484
- (this: T, to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded,
2485
- /**
2486
- * @deprecated Return a value from the guard instead of calling `next(value)`.
2487
- * The callback will be removed in a future version of Vue Router.
2488
- */
2489
- next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
2490
- }
2491
- /**
2492
- * In `router.beforeResolve((to) => {})`, the `to` is typed as `RouteLocationNormalizedLoaded`, not
2493
- * `RouteLocationNormalized` like in `router.beforeEach()`. In practice it doesn't change much as users do not rely on
2494
- * the difference between them but if we update the type in vue-router, we will have to update this type too.
2495
- * @internal
2496
- */
2497
- interface _NavigationGuardResolved {
2498
- (this: undefined, to: RouteLocationNormalizedLoaded, from: RouteLocationNormalizedLoaded,
2499
- /**
2500
- * @deprecated Return a value from the guard instead of calling `next(value)`.
2501
- * The callback will be removed in a future version of Vue Router.
2502
- */
2503
- next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
2504
- }
2505
- /**
2506
- * Navigation Guard.
2507
- */
2508
- interface NavigationGuard {
2509
- (to: RouteLocationNormalized, from: RouteLocationNormalizedLoaded,
2510
- /**
2511
- * @deprecated Return a value from the guard instead of calling `next(value)`.
2512
- * The callback will be removed in a future version of Vue Router.
2513
- */
2514
- next: NavigationGuardNext): _Awaitable<NavigationGuardReturn>;
2515
- }
2516
- /**
2517
- * Navigation hook triggered after a navigation is settled.
2518
- */
2519
- interface NavigationHookAfter {
2520
- (to: RouteLocationNormalizedLoaded, from: RouteLocationNormalizedLoaded, failure?: NavigationFailure | void): unknown;
2521
- }
2522
- /**
2523
- * Callback passed to navigation guards to continue or abort the navigation.
2524
- *
2525
- * @deprecated Prefer returning a value from the guard instead of calling
2526
- * `next(value)`. The callback will be removed in a future version of Vue Router.
2527
- */
2528
- interface NavigationGuardNext {
2529
- (): void;
2530
- (error: Error): void;
2531
- (location: RouteLocationRaw): void;
2532
- (valid: boolean | undefined): void;
2533
- (cb: NavigationGuardNextCallback): void;
2534
- }
2535
- /**
2536
- * Callback that can be passed to `next()` in `beforeRouteEnter()` guards.
2537
- */
2538
- type NavigationGuardNextCallback = (vm: ComponentPublicInstance) => unknown;
2539
- //#endregion
2540
- //#region src/experimental/data-loaders/meta-extensions.d.ts
2541
- /**
2542
- * Map type for the entries used by data loaders.
2543
- * @internal
2544
- */
2545
- type _DefineLoaderEntryMap<DataLoaderEntry extends DataLoaderEntryBase<unknown> = DataLoaderEntryBase<unknown>> = WeakMap<object, DataLoaderEntry>;
2546
- /**
2547
- * The extensions added to the router instance for data loaders. These are used
2548
- * internally by the router and should not be accessed directly by users.
2549
- *
2550
- * @internal
2551
- */
2552
- interface DataLoaderExtensions {
2553
- /**
2554
- * The entries used by data loaders. Put on the router for convenience.
2555
- * @internal
2556
- */
2557
- [LOADER_ENTRIES_KEY]: _DefineLoaderEntryMap;
2558
- /**
2559
- * Pending navigation that is waiting for data loaders to resolve.
2560
- * @internal
2561
- */
2562
- [PENDING_LOCATION_KEY]: RouteLocationNormalizedLoaded | null;
2563
- /**
2564
- * The app instance that is used by the router.
2565
- * @internal
2566
- */
2567
- [APP_KEY]: App<unknown>;
2568
- /**
2569
- * Whether the router is running in server-side rendering mode.
2570
- * @internal
2571
- */
2572
- [IS_SSR_KEY]: boolean;
2573
- /**
2574
- * The effect scope used to run data loaders.
2575
- * @internal
2576
- */
2577
- [DATA_LOADERS_EFFECT_SCOPE_KEY]: EffectScope;
2578
- /**
2579
- * Gives access to the initial state during rendering. Should be set to `false` once it's consumed.
2580
- * Used by `defineLoader`
2581
- *
2582
- * @internal
2583
- */
2584
- [SERVER_INITIAL_DATA_KEY]?: Record<string, unknown> | false;
2585
- /**
2586
- * Used by `defineLoader`
2587
- *
2588
- * @internal
2589
- */
2590
- [INITIAL_DATA_KEY]?: Record<string, unknown> | false;
2591
- }
2592
- //#endregion
2593
- //#region src/history/hash.d.ts
2594
- /**
2595
- * Creates a hash history. Useful for web applications with no host (e.g. `file://`) or when configuring a server to
2596
- * handle any URL is not possible.
2597
- *
2598
- * @param base - optional base to provide. Defaults to `location.pathname + location.search` If there is a `<base>` tag
2599
- * in the `head`, its value will be ignored in favor of this parameter **but note it affects all the history.pushState()
2600
- * calls**, meaning that if you use a `<base>` tag, it's `href` value **has to match this parameter** (ignoring anything
2601
- * after the `#`).
2602
- *
2603
- * @example
2604
- * ```js
2605
- * // at https://example.com/folder
2606
- * createWebHashHistory() // gives a url of `https://example.com/folder#`
2607
- * createWebHashHistory('/folder/') // gives a url of `https://example.com/folder/#`
2608
- * // if the `#` is provided in the base, it won't be added by `createWebHashHistory`
2609
- * createWebHashHistory('/folder/#/app/') // gives a url of `https://example.com/folder/#/app/`
2610
- * // you should avoid doing this because it changes the original url and breaks copying urls
2611
- * createWebHashHistory('/other-folder/') // gives a url of `https://example.com/other-folder/#`
2612
- *
2613
- * // at file:///usr/etc/folder/index.html
2614
- * // for locations with no `host`, the base is ignored
2615
- * createWebHashHistory('/iAmIgnored') // gives a url of `file:///usr/etc/folder/index.html#`
2616
- * ```
2617
- */
2618
- declare function createWebHashHistory(base?: string): RouterHistory;
2619
- //#endregion
2620
- //#region src/history/html5.d.ts
2621
- /**
2622
- * Creates an HTML5 history. Most common history for single page applications.
2623
- *
2624
- * @param base -
2625
- */
2626
- declare function createWebHistory(base?: string): RouterHistory;
2627
- //#endregion
2628
- //#region src/history/memory.d.ts
2629
- /**
2630
- * 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.
2631
- * It's up to the user to replace that location with the starter location by either calling `router.push` or `router.replace`.
2632
- *
2633
- * @param base - Base applied to all urls, defaults to '/'
2634
- * @returns a history object that can be passed to the router constructor
2635
- */
2636
- declare function createMemoryHistory(base?: string): RouterHistory;
2637
- //#endregion
2638
- //#region src/router.d.ts
2639
- /**
2640
- * Options to initialize a {@link Router} instance.
2641
- */
2642
- interface RouterOptions extends EXPERIMENTAL_RouterOptions_Base {
2643
- /**
2644
- * Initial list of routes that should be added to the router.
2645
- */
2646
- routes: Readonly<RouteRecordRaw[]>;
2647
- }
2648
- /**
2649
- * Router instance.
2650
- */
2651
- interface RouterClassic extends EXPERIMENTAL_Router_Base<RouteRecordNormalized> {
2652
- /**
2653
- * Original options object passed to create the Router
2654
- */
2655
- readonly options: RouterOptions;
2656
- /**
2657
- * Add a new {@link RouteRecordRaw | route record} as the child of an existing route.
2658
- *
2659
- * @param parentName - Parent Route Record where `route` should be appended at
2660
- * @param route - Route Record to add
2661
- */
2662
- addRoute(parentName: NonNullable<RouteRecordNameGeneric>, route: RouteRecordRaw): () => void;
2663
- /**
2664
- * Add a new {@link RouteRecordRaw | route record} to the router.
2665
- *
2666
- * @param route - Route Record to add
2667
- */
2668
- addRoute(route: RouteRecordRaw): () => void;
2669
- /**
2670
- * Remove an existing route by its name.
2671
- *
2672
- * @param name - Name of the route to remove
2673
- */
2674
- removeRoute(name: NonNullable<RouteRecordNameGeneric>): void;
2675
- /**
2676
- * Delete all routes from the router.
2677
- */
2678
- clearRoutes(): void;
2679
- }
2680
- /**
2681
- * Router instance.
2682
- *
2683
- * By default this resolves to the classic {@link RouterClassic}. Augment
2684
- * {@link TypesConfig} with a `Router` slot to swap the public type.
2685
- *
2686
- * ```ts
2687
- * import { router } from './router'
2688
- * declare module 'vue-router' {
2689
- * interface TypesConfig {
2690
- * Router: typeof router
2691
- * }
2692
- * }
2693
- * ```
2694
- */
2695
- type Router = TypesConfig extends Record<'Router', infer T> ? T : RouterClassic;
2696
- /**
2697
- * Creates a Router instance that can be used by a Vue app.
2698
- *
2699
- * @param options - {@link RouterOptions}
2700
- */
2701
- declare function createRouter(options: RouterOptions): Router;
2702
- //#endregion
2703
- //#region src/injectionSymbols.d.ts
2704
- /**
2705
- * RouteRecord being rendered by the closest ancestor Router View. Used for
2706
- * `onBeforeRouteUpdate` and `onBeforeRouteLeave`. rvlm stands for Router View
2707
- * Location Matched
2708
- *
2709
- * @internal
2710
- */
2711
- declare const matchedRouteKey: InjectionKey<ComputedRef<RouteRecordNormalized | undefined>>;
2712
- /**
2713
- * Allows overriding the router view depth to control which component in
2714
- * `matched` is rendered. rvd stands for Router View Depth
2715
- *
2716
- * @internal
2717
- */
2718
- declare const viewDepthKey: InjectionKey<Ref<number> | number>;
2719
- /**
2720
- * Allows overriding the router instance returned by `useRouter` in tests. r
2721
- * stands for router
2722
- *
2723
- * @internal
2724
- */
2725
- declare const routerKey: InjectionKey<Router>;
2726
- /**
2727
- * Allows overriding the current route returned by `useRoute` in tests. rl
2728
- * stands for route location
2729
- *
2730
- * @internal
2731
- */
2732
- declare const routeLocationKey: InjectionKey<RouteLocationNormalizedLoaded>;
2733
- /**
2734
- * Allows overriding the current route used by router-view. Internally this is
2735
- * used when the `route` prop is passed.
2736
- *
2737
- * @internal
2738
- */
2739
- declare const routerViewLocationKey: InjectionKey<Ref<RouteLocationNormalizedLoaded>>;
2740
- //#endregion
2741
- //#region src/navigationGuards.d.ts
2742
- /**
2743
- * Add a navigation guard that triggers whenever the component for the current
2744
- * location is about to be left. Similar to {@link beforeRouteLeave} but can be
2745
- * used in any component. The guard is removed when the component is unmounted.
2746
- *
2747
- * @param leaveGuard - {@link NavigationGuard}
2748
- */
2749
- declare function onBeforeRouteLeave(leaveGuard: NavigationGuard): void;
2750
- /**
2751
- * Add a navigation guard that triggers whenever the current location is about
2752
- * to be updated. Similar to {@link beforeRouteUpdate} but can be used in any
2753
- * component. The guard is removed when the component is unmounted.
2754
- *
2755
- * @param updateGuard - {@link NavigationGuard}
2756
- */
2757
- declare function onBeforeRouteUpdate(updateGuard: NavigationGuard): void;
2758
- /**
2759
- * Ensures a route is loaded, so it can be passed as o prop to `<RouterView>`.
2760
- *
2761
- * @param route - resolved route to load
2762
- */
2763
- declare function loadRouteLocation(route: RouteLocation | RouteLocationNormalized): Promise<RouteLocationNormalizedLoaded>;
2764
- //#endregion
2765
- //#region src/RouterLink.d.ts
2766
- interface RouterLinkOptions {
2767
- /**
2768
- * Route Location the link should navigate to when clicked on.
2769
- */
2770
- to: RouteLocationRaw;
2771
- /**
2772
- * Calls `router.replace` instead of `router.push`.
2773
- */
2774
- replace?: boolean;
2775
- }
2776
- interface RouterLinkProps extends RouterLinkOptions {
2777
- /**
2778
- * Whether RouterLink should not wrap its content in an `a` tag. Useful when
2779
- * using `v-slot` to create a custom RouterLink
2780
- */
2781
- custom?: boolean;
2782
- /**
2783
- * Class to apply when the link is active
2784
- */
2785
- activeClass?: string;
2786
- /**
2787
- * Class to apply when the link is exact active
2788
- */
2789
- exactActiveClass?: string;
2790
- /**
2791
- * Value passed to the attribute `aria-current` when the link is exact active.
2792
- *
2793
- * @defaultValue `'page'`
2794
- */
2795
- ariaCurrentValue?: 'page' | 'step' | 'location' | 'date' | 'time' | 'true' | 'false';
2796
- /**
2797
- * Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
2798
- */
2799
- viewTransition?: boolean;
2800
- }
2801
- /**
2802
- * Options passed to {@link useLink}.
2803
- */
2804
- interface UseLinkOptions<Name extends keyof RouteMap = keyof RouteMap> {
2805
- to: MaybeRef<RouteLocationAsString | RouteLocationAsRelativeTyped<RouteMap, Name> | RouteLocationAsPath | RouteLocationRaw>;
2806
- replace?: MaybeRef<boolean | undefined>;
2807
- /**
2808
- * Pass the returned promise of `router.push()` to `document.startViewTransition()` if supported.
2809
- */
2810
- viewTransition?: boolean;
2811
- }
2812
- /**
2813
- * Return type of {@link useLink}.
2814
- * @internal
2815
- */
2816
- interface UseLinkReturn<Name extends keyof RouteMap = keyof RouteMap> {
2817
- route: ComputedRef<RouteLocationResolved<Name>>;
2818
- href: ComputedRef<string>;
2819
- isActive: ComputedRef<boolean>;
2820
- isExactActive: ComputedRef<boolean>;
2821
- navigate(e?: MouseEvent): Promise<void | NavigationFailure>;
2822
- }
2823
- /**
2824
- * Returns the internal behavior of a {@link RouterLink} without the rendering part.
2825
- *
2826
- * @param props - a `to` location and an optional `replace` flag
2827
- */
2828
- declare function useLink<Name extends keyof RouteMap = keyof RouteMap>(props: UseLinkOptions<Name>): UseLinkReturn<Name>;
2829
- /**
2830
- * Component to render a link that triggers a navigation on click.
2831
- */
2832
- declare const RouterLink: _RouterLinkI;
2833
- /**
2834
- * @internal
2835
- */
2836
- type _RouterLinkPropsTypedBase = AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterLinkProps;
2837
- /**
2838
- * @internal
2839
- */
2840
- type RouterLinkPropsTyped<Custom extends boolean | undefined> = Custom extends true ? _RouterLinkPropsTypedBase & {
2841
- custom: true;
2842
- } : _RouterLinkPropsTypedBase & {
2843
- custom?: false | undefined;
2844
- } & Omit<AnchorHTMLAttributes, 'href'>;
2845
- /**
2846
- * Typed version of the `RouterLink` component. Its generic defaults to the typed router, so it can be inferred
2847
- * automatically for JSX.
2848
- *
2849
- * @internal
2850
- */
2851
- interface _RouterLinkI {
2852
- new <Custom extends boolean | undefined = boolean | undefined>(): {
2853
- $props: RouterLinkPropsTyped<Custom>;
2854
- $slots: {
2855
- default?: ({ route, href, isActive, isExactActive, navigate }: UnwrapRef<UseLinkReturn>) => VNode[];
2856
- };
2857
- };
2858
- /**
2859
- * Access to `useLink()` without depending on using vue-router
2860
- *
2861
- * @internal
2862
- */
2863
- useLink: typeof useLink;
2864
- }
2865
- //#endregion
2866
- //#region src/RouterView.d.ts
2867
- interface RouterViewProps {
2868
- name?: string;
2869
- route?: RouteLocationNormalized;
2870
- }
2871
- /**
2872
- * Component to display the current route the user is at.
2873
- */
2874
- declare const RouterView: {
2875
- new (): {
2876
- $props: AllowedComponentProps & ComponentCustomProps & VNodeProps & RouterViewProps;
2877
- $slots: {
2878
- default?: ({ Component, route }: {
2879
- Component: VNode;
2880
- route: RouteLocationNormalizedLoaded;
2881
- }) => VNode[];
2882
- };
2883
- };
2884
- };
2885
- //#endregion
2886
- //#region src/useApi.d.ts
2887
- /**
2888
- * Returns the router instance. Equivalent to using `$router` inside
2889
- * templates.
2890
- */
2891
- declare function useRouter(): Router;
2892
- /**
2893
- * Returns the current route location. Equivalent to using `$route` inside
2894
- * templates.
2895
- */
2896
- declare function useRoute<Name extends keyof RouteMap = keyof RouteMap>(_name?: Name): RouteLocationNormalizedLoaded<Name | RouteMap[Name]["childrenNames"]>;
2897
- //#endregion
2898
- //#region src/index.d.ts
2899
- declare module 'vue' {
2900
- interface ComponentCustomOptions {
2901
- /**
2902
- * Guard called when the router is navigating to the route that is rendering
2903
- * this component from a different route. Differently from `beforeRouteUpdate`
2904
- * and `beforeRouteLeave`, `beforeRouteEnter` does not have access to the
2905
- * component instance through `this` because it triggers before the component
2906
- * is even mounted.
2907
- *
2908
- * @param to - RouteLocationRaw we are navigating to
2909
- * @param from - RouteLocationRaw we are navigating from
2910
- * @param next - function to validate, cancel or modify (by redirecting) the
2911
- * navigation
2912
- */
2913
- beforeRouteEnter?: TypesConfig extends Record<'beforeRouteEnter', infer T> ? T : NavigationGuardWithThis<undefined>;
2914
- /**
2915
- * Guard called whenever the route that renders this component has changed, but
2916
- * it is reused for the new route. This allows you to guard for changes in
2917
- * params, the query or the hash.
2918
- *
2919
- * @param to - RouteLocationRaw we are navigating to
2920
- * @param from - RouteLocationRaw we are navigating from
2921
- * @param next - function to validate, cancel or modify (by redirecting) the
2922
- * navigation
2923
- */
2924
- beforeRouteUpdate?: TypesConfig extends Record<'beforeRouteUpdate', infer T> ? T : NavigationGuard;
2925
- /**
2926
- * Guard called when the router is navigating away from the current route that
2927
- * is rendering this component.
2928
- *
2929
- * @param to - RouteLocationRaw we are navigating to
2930
- * @param from - RouteLocationRaw we are navigating from
2931
- * @param next - function to validate, cancel or modify (by redirecting) the
2932
- * navigation
2933
- */
2934
- beforeRouteLeave?: TypesConfig extends Record<'beforeRouteLeave', infer T> ? T : NavigationGuard;
2935
- }
2936
- interface ComponentCustomProperties {
2937
- /**
2938
- * Normalized current location. See {@link RouteLocationNormalizedLoaded}.
2939
- */
2940
- $route: TypesConfig extends Record<'$route', infer T> ? T : RouteLocationNormalizedLoaded;
2941
- /**
2942
- * {@link Router} instance used by the application.
2943
- */
2944
- $router: TypesConfig extends Record<'$router', infer T> ? T : Router;
2945
- }
2946
- interface GlobalComponents {
2947
- RouterView: TypesConfig extends Record<'RouterView', infer T> ? T : typeof RouterView;
2948
- RouterLink: TypesConfig extends Record<'RouterLink', infer T> ? T : typeof RouterLink;
2949
- }
2950
- }
2951
- //#endregion
2952
- //#region src/experimental/data-loaders/utils.d.ts
2953
- /**
2954
- * @internal: data loaders authoring only. Use `getCurrentContext` instead.
2955
- */
2956
- declare let currentContext: readonly [entry: DataLoaderEntryBase, router: Router, route: RouteLocationNormalizedLoaded] | undefined | null;
2957
- declare function getCurrentContext(): readonly [entry: DataLoaderEntryBase<unknown, unknown, unknown>, router: RouterClassic, route: RouteLocationNormalizedLoadedGeneric] | readonly [];
2958
- /**
2959
- * Sets the current context for data loaders. This allows for nested loaders to be aware of their parent context.
2960
- * INTERNAL ONLY.
2961
- *
2962
- * @param context - the context to set
2963
- * @internal
2964
- */
2965
- declare function setCurrentContext(context?: typeof currentContext | readonly []): void;
2966
- /**
2967
- * Restore the current context after a promise is resolved.
2968
- * @param promise - promise to wrap
2969
- */
2970
- declare function withLoaderContext<P extends Promise<unknown>>(promise: P): P;
2971
- /**
2972
- * Object and promise of the object itself. Used when we can await some of the properties of an object to be loaded.
2973
- * @internal
2974
- */
2975
- type _PromiseMerged<PromiseType, RawType = PromiseType> = RawType & Promise<PromiseType>;
2976
- /**
2977
- * Track the reads of a route and its properties
2978
- * @internal
2979
- * @param route - route to track
2980
- */
2981
- declare function trackRoute(route: RouteLocationNormalizedLoaded): readonly [{
2982
- readonly hash: string;
2983
- readonly params: RouteParamsGeneric;
2984
- readonly query: LocationQuery$1;
2985
- readonly matched: RouteLocationMatched[];
2986
- readonly name: RouteRecordNameGeneric;
2987
- readonly fullPath: string;
2988
- readonly redirectedFrom: RouteLocation | undefined;
2989
- readonly path: string;
2990
- readonly meta: RouteMeta;
2991
- }, Partial<RouteParamsGeneric>, Partial<LocationQuery$1>, {
2992
- v: string | null;
2993
- }];
2994
- //#endregion
2995
- //#region src/experimental/data-loaders/navigation-guard.d.ts
2996
- /**
2997
- * Options to initialize the data loader guard.
2998
- */
2999
- interface SetupLoaderGuardOptions extends DataLoaderPluginOptions {
3000
- /**
3001
- * The Vue app instance. Used to access the `provide` and `inject` APIs.
3002
- */
3003
- app: App<unknown>;
3004
- /**
3005
- * The effect scope to use for the data loaders.
3006
- */
3007
- effect: EffectScope;
3008
- }
3009
- /**
3010
- * Possible values to change the result of a navigation within a loader
3011
- * @internal
3012
- */
3013
- type _DataLoaderRedirectResult = Exclude<ReturnType<NavigationGuard>, Promise<unknown> | Function | true | void | undefined>;
3014
- /**
3015
- * Allows data loaders to change navigation. Called by {@link reroute}.
3016
- *
3017
- * @internal
3018
- */
3019
- declare class NavigationResult {
3020
- readonly value: _DataLoaderRedirectResult;
3021
- constructor(value: _DataLoaderRedirectResult);
3022
- }
3023
- /**
3024
- * Changes the navigation from within a data loader. Accepts the same values as a navigation
3025
- * guard return: a route location to redirect to, or `false` to cancel the navigation.
3026
- *
3027
- * @example
3028
- * ```ts
3029
- * export const useUserData = defineBasicLoader(async (to) => {
3030
- * const user = await fetchUser(to.params.id)
3031
- * if (!user) {
3032
- * reroute('/404')
3033
- * }
3034
- * return user
3035
- * })
3036
- * ```
3037
- */
3038
- declare function reroute(to: _DataLoaderRedirectResult): never;
3039
- /**
3040
- * Data Loader plugin to add data loading support to Vue Router.
3041
- *
3042
- * @example
3043
- * ```ts
3044
- * const router = createRouter({
3045
- * routes,
3046
- * history: createWebHistory(),
3047
- * })
3048
- *
3049
- * const app = createApp({})
3050
- * app.use(DataLoaderPlugin, { router })
3051
- * app.use(router)
3052
- * ```
3053
- */
3054
- declare function DataLoaderPlugin(app: App, options: DataLoaderPluginOptions): void;
3055
- /**
3056
- * Options passed to the DataLoaderPlugin.
3057
- */
3058
- interface DataLoaderPluginOptions {
3059
- /**
3060
- * The router instance. Adds the guards to it
3061
- */
3062
- router: Router;
3063
- isSSR?: boolean;
3064
- /**
3065
- * List of _expected_ errors that shouldn't abort the navigation (for non-lazy loaders). Provide a list of
3066
- * constructors that can be checked with `instanceof` or a custom function that returns `true` for expected errors.
3067
- */
3068
- errors?: Array<new (...args: any) => any> | ((reason?: unknown) => boolean);
3069
- }
3070
- /**
3071
- * Return a ref that reflects the global loading state of all loaders within a navigation.
3072
- * This state doesn't update if `refresh()` is manually called.
3073
- */
3074
- declare function useIsDataLoading(): ShallowRef<boolean>;
3075
- //#endregion
3076
- //#region src/experimental/data-loaders/createDataLoader.d.ts
3077
- /**
3078
- * Base type for a data loader entry. Each Data Loader has its own entry in the `loaderEntries` (accessible via `[LOADER_ENTRIES_KEY]`) map.
3079
- */
3080
- interface DataLoaderEntryBase<TData = unknown, TError = unknown, TDataInitial extends TData | undefined = TData | undefined> {
3081
- /**
3082
- * Data stored in the entry.
3083
- */
3084
- data: ShallowRef<TData | TDataInitial>;
3085
- /**
3086
- * Error if there was an error.
3087
- */
3088
- error: ShallowRef<TError | null>;
3089
- /**
3090
- * Location the data was loaded for or `null` if the data is not loaded.
3091
- */
3092
- to: RouteLocationNormalizedLoaded | null;
3093
- /**
3094
- * Whether there is an ongoing request.
3095
- */
3096
- isLoading: ShallowRef<boolean>;
3097
- options: DefineDataLoaderOptionsBase_LaxData;
3098
- /**
3099
- * Called by the navigation guard when the navigation is duplicated. Should be used to reset pendingTo and pendingLoad and any other property that should be reset.
3100
- */
3101
- resetPending: () => void;
3102
- /**
3103
- * The latest pending load. Allows to verify if the load is still valid when it resolves.
3104
- */
3105
- pendingLoad: Promise<void> | null;
3106
- /**
3107
- * The latest pending navigation's `to` route. Used to verify if the navigation is still valid when it resolves.
3108
- */
3109
- pendingTo: RouteLocationNormalizedLoaded | null;
3110
- /**
3111
- * Data that was staged by a loader. This is used to avoid showing the old data while the new data is loading. Calling
3112
- * the internal `commit()` function will replace the data with the staged data.
3113
- */
3114
- staged: TData | typeof STAGED_NO_VALUE;
3115
- /**
3116
- * Error that was staged by a loader. This is used to avoid showing the old error while the new data is loading.
3117
- * Calling the internal `commit()` function will replace the error with the staged error.
3118
- */
3119
- stagedError: TError | null;
3120
- /**
3121
- * Other data loaders that depend on this one. This is used to invalidate the data when a dependency is invalidated.
3122
- */
3123
- children: Set<DataLoaderEntryBase>;
3124
- /**
3125
- * Commits the pending data to the entry. This is called by the navigation guard when all non-lazy loaders have
3126
- * finished loading. It should be implemented by the loader. It **must be called** from the entry itself:
3127
- * `entry.commit(to)`.
3128
- */
3129
- commit(to: RouteLocationNormalizedLoaded): void;
3130
- }
3131
- /**
3132
- * Common properties for the options of `defineLoader()`. Types are `unknown` to allow for more specific types in the
3133
- * extended types while having documentation in one single place.
3134
- * @internal
3135
- */
3136
- interface _DefineDataLoaderOptionsBase_Common {
3137
- /**
3138
- * When the data should be committed to the entry. In the case of lazy loaders, the loader will try to commit the data
3139
- * after all non-lazy loaders have finished loading, but it might not be able to if the lazy loader hasn't been
3140
- * resolved yet.
3141
- *
3142
- * @see {@link DefineDataLoaderCommit}
3143
- * @defaultValue `'after-load'`
3144
- */
3145
- commit?: DefineDataLoaderCommit;
3146
- /**
3147
- * Whether the data should be lazy loaded without blocking the client side navigation or not. When set to true, the loader will no longer block the navigation and the returned composable can be called even
3148
- * without having the data ready.
3149
- *
3150
- * @defaultValue `false`
3151
- */
3152
- lazy?: unknown;
3153
- /**
3154
- * Whether this loader should be awaited on the server side or not. Combined with the `lazy` option, this gives full
3155
- * control over how to await for the data.
3156
- *
3157
- * @defaultValue `true`
3158
- */
3159
- server?: unknown;
3160
- /**
3161
- * List of _expected_ errors that shouldn't abort the navigation (for non-lazy loaders). Provide a list of
3162
- * constructors that can be checked with `instanceof` or a custom function that returns `true` for expected errors. Can also be set to `true` to accept all globally defined errors. Defaults to `false` to abort on any error.
3163
- * @default `false`
3164
- */
3165
- errors?: unknown;
3166
- }
3167
- /**
3168
- * Options for a data loader that returns a data that is possibly `undefined`. Available for data loaders
3169
- * implementations so they can be used in `defineLoader()` overloads.
3170
- */
3171
- interface DefineDataLoaderOptionsBase_LaxData extends _DefineDataLoaderOptionsBase_Common {
3172
- lazy?: boolean | ((to: RouteLocationNormalizedLoaded, from?: RouteLocationNormalizedLoaded) => boolean);
3173
- server?: boolean;
3174
- errors?: boolean | Array<new (...args: any[]) => any> | ((reason?: unknown) => boolean);
3175
- }
3176
- /**
3177
- * Options for a data loader making the data defined without it being possibly `undefined`. Available for data loaders
3178
- * implementations so they can be used in `defineLoader()` overloads.
3179
- */
3180
- interface DefineDataLoaderOptionsBase_DefinedData extends _DefineDataLoaderOptionsBase_Common {
3181
- lazy?: false;
3182
- server?: true;
3183
- errors?: false;
3184
- }
3185
- declare const toLazyValue: (lazy: undefined | DefineDataLoaderOptionsBase_LaxData["lazy"], to: RouteLocationNormalizedLoaded, from?: RouteLocationNormalizedLoaded) => boolean | undefined;
3186
- /**
3187
- * When the data should be committed to the entry.
3188
- * - `immediate`: the data is committed as soon as it is loaded.
3189
- * - `after-load`: the data is committed after all non-lazy loaders have finished loading.
3190
- */
3191
- type DefineDataLoaderCommit = 'immediate' | 'after-load';
3192
- interface DataLoaderContextBase {
3193
- /**
3194
- * Signal associated with the current navigation. It is aborted when the navigation is canceled or an error occurs.
3195
- */
3196
- signal: AbortSignal | undefined;
3197
- }
3198
- /**
3199
- * Data Loader composable returned by `defineLoader()`.
3200
- * @see {@link DefineDataLoader}
3201
- */
3202
- interface UseDataLoader<Data = unknown, TError = unknown> {
3203
- [IS_USE_DATA_LOADER_KEY]: true;
3204
- /**
3205
- * Data Loader composable returned by `defineLoader()`.
3206
- *
3207
- * @example
3208
- * Returns the Data loader data, isLoading, error etc. Meant to be used in `setup()` or `<script setup>` **without `await`**:
3209
- * ```vue
3210
- * <script setup>
3211
- * const { data, isLoading, error } = useUserData()
3212
- * </script>
3213
- * ```
3214
- *
3215
- * @example
3216
- * It also returns a promise of the data when used in nested loaders. Note this `data` is **not a ref**. This is not meant to be used in `setup()` or `<script setup>`.
3217
- * ```ts
3218
- * export const useUserConnections = defineLoader(async () => {
3219
- * const user = await useUserData()
3220
- * return fetchUserConnections(user.id)
3221
- * })
3222
- * ```
3223
- */
3224
- (): _PromiseMerged<Exclude<Data, NavigationResult | undefined>, UseDataLoaderResult<Exclude<Data, NavigationResult>, TError>>;
3225
- /**
3226
- * Internals of the data loader.
3227
- * @internal
3228
- */
3229
- _: UseDataLoaderInternals<Exclude<Data, NavigationResult | undefined>, TError>;
3230
- }
3231
- /**
3232
- * Internal properties of a data loader composable. Used by the internal implementation of `defineLoader()`. **Should
3233
- * not be used in application code.**
3234
- */
3235
- interface UseDataLoaderInternals<Data = unknown, TError = unknown> {
3236
- /**
3237
- * Loads the data from the cache if possible, otherwise loads it from the loader and awaits it.
3238
- *
3239
- * @param to - route location to load the data for
3240
- * @param router - router instance
3241
- * @param from - route location we are coming from
3242
- * @param parent - parent data loader entry
3243
- */
3244
- load: (to: RouteLocationNormalizedLoaded, router: Router, from?: RouteLocationNormalizedLoaded, parent?: DataLoaderEntryBase) => Promise<void>;
3245
- /**
3246
- * Resolved options for the loader.
3247
- */
3248
- options: DefineDataLoaderOptionsBase_LaxData;
3249
- /**
3250
- * Gets the entry associated with the router instance. Assumes the data loader has been loaded and that the entry
3251
- * exists.
3252
- *
3253
- * @param router - router instance
3254
- */
3255
- getEntry(router: Router): DataLoaderEntryBase<Data, TError>;
3256
- }
3257
- /**
3258
- * Return value of a loader composable defined with `defineLoader()`.
3259
- */
3260
- interface UseDataLoaderResult<TData = unknown, TError = ErrorDefault> {
3261
- /**
3262
- * Data returned by the loader. If the data loader is lazy, it will be undefined until the first load.
3263
- */
3264
- data: ShallowRef<TData>;
3265
- /**
3266
- * Whether there is an ongoing request.
3267
- */
3268
- isLoading: ShallowRef<boolean>;
3269
- /**
3270
- * Error if there was an error.
3271
- */
3272
- error: ShallowRef<TError | null>;
3273
- /**
3274
- * Reload the data using the current route location. Returns a promise that resolves when the data is reloaded. This
3275
- * method should not be called during a navigation as it can conflict with an ongoing load and lead to
3276
- * inconsistencies.
3277
- */
3278
- reload(): Promise<void>;
3279
- /**
3280
- * Reload the data using the route location passed as argument. Returns a promise that resolves when the data is reloaded.
3281
- *
3282
- * @param route - route location to load the data for
3283
- */
3284
- reload(route: RouteLocationNormalizedLoaded): Promise<void>;
3285
- }
3286
- /**
3287
- * Loader function that can be passed to `defineLoader()`.
3288
- */
3289
- interface DefineLoaderFn<Data, Context extends DataLoaderContextBase = DataLoaderContextBase, Route = RouteLocationNormalizedLoaded> {
3290
- (route: Route, context: Context): Promise<Data>;
3291
- }
3292
- //#endregion
3293
- export { RouteLocationAsPath as $, defineParamParserRaw as $n, RouteQueryAndHash as $t, useLink as A, MatchMiss as An, LocationQueryValue$1 as Ar, ParamValue as At, RouterClassic as B, EXPERIMENTAL_RouterOptions as Bn, LocationAsRelativeRaw as Bt, RouterView as C, ParamParserTypeOf as Cn, createRouterMatcher as Cr, RouteLocationResolvedTypedList as Ct, UseLinkOptions as D, PathParamNamesForFilePath as Dn, RouteRecordNormalized as Dr, RouteRecordNameGeneric as Dt, RouterLinkProps as E, ParamParsers_Native as En, RouteRecord as Er, RouteRecordName as Et, routeLocationKey as F, EXPERIMENTAL_RouteRecordRaw as Fn, RouteParamsRaw as Ft, createWebHashHistory as G, createFixedResolver as Gn, RouteLocationNamedRaw as Gt, createRouter as H, EXPERIMENTAL_Router_Base as Hn, MatcherLocationAsPath as Ht, routerKey as I, EXPERIMENTAL_RouteRecord_Base as In, RouteMap as It, NavigationGuardNextCallback as J, ExtractParamParserType as Jn, RouteMeta as Jt, NavigationGuard as K, MatcherPatternQuery as Kn, RouteLocationOptions as Kt, routerViewLocationKey as L, EXPERIMENTAL_RouteRecord_Group as Ln, RouteMapGeneric as Lt, onBeforeRouteLeave as M, EXPERIMENTAL_RouteRecordNormalized as Mn, parseQuery as Mr, ParamValueZeroOrMore as Mt, onBeforeRouteUpdate as N, EXPERIMENTAL_RouteRecordNormalized_Group as Nn, stringifyQuery as Nr, ParamValueZeroOrOne as Nt, UseLinkReturn as O, _mergeRouteRecord as On, LocationQuery$1 as Or, RouteRecordRedirectOption as Ot, matchedRouteKey as P, EXPERIMENTAL_RouteRecordNormalized_Matchable as Pn, TypesConfig as Pr, RouteParams as Pt, RouteLocation as Q, defineParamParser as Qn, RouteParamsRawGeneric as Qt, viewDepthKey as R, EXPERIMENTAL_RouteRecord_Matchable as Rn, RouteRecordInfo as Rt, useRouter as S, ParamParserType as Sn, RouterMatcher as Sr, RouteLocationResolvedTyped as St, RouterLink as T, ParamParsers as Tn, _PathParserOptions as Tr, RouteLocationTypedList as Tt, createMemoryHistory as U, experimental_createRouter as Un, RouteComponent as Ut, RouterOptions as V, EXPERIMENTAL_RouterOptions_Base as Vn, MatcherLocation as Vt, createWebHistory as W, normalizeRouteRecord as Wn, RouteLocationMatched as Wt, NavigationGuardWithThis as X, PARAM_PARSER_INT as Xn, RouteParamValueRaw as Xt, NavigationGuardReturn as Y, normalizeParamParser as Yn, RouteParamValue as Yt, NavigationHookAfter as Z, PARAM_PARSER_BOOL as Zn, RouteParamsGeneric as Zt, getCurrentContext as _, defineBasicLoader as _n, NavigationFailureType as _r, RouteLocationNormalizedTyped as _t, DefineLoaderFn as a, RouteRecordSingleViewWithChildren as an, MatcherPatternPath as ar, RouteLocationAsRelativeTyped as at, withLoaderContext as b, DefinePageQueryParamOptions as bn, HistoryState as br, RouteLocationResolved as bt, UseDataLoaderResult as c, NavigationResult$1 as cn, MatcherPatternPathStatic as cr, RouteLocationAsStringTyped as ct, DataLoaderPluginOptions as d, DefineDataLoaderOptions as dn, _Awaitable as dr, RouteLocationNormalized as dt, RouteRecordMultipleViews as en, START_LOCATION_NORMALIZED as er, RouteLocationAsPathGeneric as et, NavigationResult as f, DefineDataLoaderOptions_DefinedData as fn, ParamParser as fr, RouteLocationNormalizedGeneric as ft, _PromiseMerged as g, UseDataLoaderBasic_LaxData as gn, NavigationFailure as gr, RouteLocationNormalizedLoadedTypedList as gt, useIsDataLoading as h, UseDataLoaderBasic_DefinedData as hn, ErrorTypes as hr, RouteLocationNormalizedLoadedTyped as ht, DefineDataLoaderOptionsBase_LaxData as i, RouteRecordSingleView as in, MatcherPatternHash as ir, RouteLocationAsRelativeGeneric as it, loadRouteLocation as j, miss as jn, LocationQueryValueRaw$1 as jr, ParamValueOneOrMore as jt, _RouterLinkI as k, definePage as kn, LocationQueryRaw$1 as kr, _RouteRecordProps as kt, toLazyValue as l, DataLoaderBasicEntry as ln, MatcherQueryParams as lr, RouteLocationAsStringTypedList as lt, reroute as m, UseDataLoaderBasic as mn, LocationQuery as mr, RouteLocationNormalizedLoadedGeneric as mt, DataLoaderEntryBase as n, RouteRecordRaw as nn, MatcherParamsFormatted as nr, RouteLocationAsPathTypedList as nt, UseDataLoader as o, _RouteLocationBase as on, MatcherPatternPathDynamic as or, RouteLocationAsRelativeTypedList as ot, SetupLoaderGuardOptions as p, DefineDataLoaderOptions_LaxData as pn, RouterScrollBehavior as pr, RouteLocationNormalizedLoaded as pt, NavigationGuardNext as q, MatcherPatternQueryParam as qn, RouteLocationPathRaw as qt, DefineDataLoaderOptionsBase_DefinedData as r, RouteRecordRedirect as rn, MatcherPattern as rr, RouteLocationAsRelative as rt, UseDataLoaderInternals as s, _RouteRecordBase as sn, MatcherPatternPathDynamic_ParamOptions as sr, RouteLocationAsString as st, DataLoaderContextBase as t, RouteRecordMultipleViewsWithChildren as tn, EmptyParams as tr, RouteLocationAsPathTyped as tt, DataLoaderPlugin as u, DataLoaderContext as un, MatcherQueryParamsValue as ur, RouteLocationGeneric as ut, setCurrentContext as v, ErrorDefault as vn, NavigationRedirectError as vr, RouteLocationNormalizedTypedList as vt, RouterViewProps as w, ParamParserType_Native as wn, PathParserOptions as wr, RouteLocationTyped as wt, useRoute as x, DefinePageQueryParamOptionsAny as xn, RouterHistory as xr, RouteLocationResolvedGeneric as xt, trackRoute as y, DefinePage as yn, isNavigationFailure as yr, RouteLocationRaw as yt, Router as z, EXPERIMENTAL_Router as zn, RouteRecordInfoGeneric as zt };