From: Eduardo San Martin Morote Date: Thu, 5 Nov 2020 11:24:15 +0000 (+0100) Subject: feat: expose injection symbols as internals X-Git-Tag: v4.0.0-rc.2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0056aca5b251df2a18bab79e18874a18e0204b4d;p=thirdparty%2Fvuejs%2Frouter.git feat: expose injection symbols as internals --- 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