]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
feat: expose injection symbols as internals
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 5 Nov 2020 11:24:15 +0000 (12:24 +0100)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 5 Nov 2020 11:24:15 +0000 (12:24 +0100)
src/index.ts
src/injectionSymbols.ts

index f5ee2f44a42d81deb7568e7b6c2ce2fbe8f04950..caca8b13eface359b63dfddcd2e2357503f6b053 100644 (file)
@@ -14,11 +14,14 @@ export {
 export { RouterHistory } from './history/common'
 
 export { RouteRecord, RouteRecordNormalized } from './matcher/types'
+
 export {
   PathParserOptions,
   _PathParserOptions,
 } from './matcher/pathParserRanker'
 
+export { routeLocationKey, routerKey } from './injectionSymbols'
+
 export {
   RouteMeta,
   _RouteLocationBase,
index 0f6aa03916fab02c1fc1c6c8597278fa83daa73b..457f1ea14ae2bad1d2cf94a9b65a1002b4427f0d 100644 (file)
@@ -21,11 +21,20 @@ export const viewDepthKey = /*#__PURE__*/ PolySymbol(
   __DEV__ ? 'router view depth' : 'rvd'
 ) as InjectionKey<number>
 
-// r = router
+/**
+ * Allows overriding the router instance returned by `useRouter` in tests. r stands for router
+ *
+ * @internal
+ */
 export const routerKey = /*#__PURE__*/ PolySymbol(
   __DEV__ ? 'router' : 'r'
 ) as InjectionKey<Router>
-// rt = route location
+
+/**
+ * Allows overriding the current route returned by `useRoute` in tests. rl stands for route location
+ *
+ * @internal
+ */
 export const routeLocationKey = /*#__PURE__*/ PolySymbol(
   __DEV__ ? 'route location' : 'rl'
 ) as InjectionKey<RouteLocationNormalizedLoaded>