From 0056aca5b251df2a18bab79e18874a18e0204b4d Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Thu, 5 Nov 2020 12:24:15 +0100 Subject: [PATCH] feat: expose injection symbols as internals --- src/index.ts | 3 +++ src/injectionSymbols.ts | 13 +++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index f5ee2f44..caca8b13 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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, diff --git a/src/injectionSymbols.ts b/src/injectionSymbols.ts index 0f6aa039..457f1ea1 100644 --- a/src/injectionSymbols.ts +++ b/src/injectionSymbols.ts @@ -21,11 +21,20 @@ export const viewDepthKey = /*#__PURE__*/ PolySymbol( __DEV__ ? 'router view depth' : 'rvd' ) as InjectionKey -// 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 -// 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 -- 2.47.3