Skip to content

Commit 0056aca

Browse files
committed
feat: expose injection symbols as internals
1 parent ca529c4 commit 0056aca

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ export {
1414
export { RouterHistory } from './history/common'
1515

1616
export { RouteRecord, RouteRecordNormalized } from './matcher/types'
17+
1718
export {
1819
PathParserOptions,
1920
_PathParserOptions,
2021
} from './matcher/pathParserRanker'
2122

23+
export { routeLocationKey, routerKey } from './injectionSymbols'
24+
2225
export {
2326
RouteMeta,
2427
_RouteLocationBase,

src/injectionSymbols.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,20 @@ export const viewDepthKey = /*#__PURE__*/ PolySymbol(
2121
__DEV__ ? 'router view depth' : 'rvd'
2222
) as InjectionKey<number>
2323

24-
// r = router
24+
/**
25+
* Allows overriding the router instance returned by `useRouter` in tests. r stands for router
26+
*
27+
* @internal
28+
*/
2529
export const routerKey = /*#__PURE__*/ PolySymbol(
2630
__DEV__ ? 'router' : 'r'
2731
) as InjectionKey<Router>
28-
// rt = route ___location
32+
33+
/**
34+
* Allows overriding the current route returned by `useRoute` in tests. rl stands for route ___location
35+
*
36+
* @internal
37+
*/
2938
export const routeLocationKey = /*#__PURE__*/ PolySymbol(
3039
__DEV__ ? 'route ___location' : 'rl'
3140
) as InjectionKey<RouteLocationNormalizedLoaded>

0 commit comments

Comments
 (0)