Skip to content

Commit 3484c8b

Browse files
committed
refactor(types): prefix matcher types
1 parent 51f12c2 commit 3484c8b

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

packages/router/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export { START_LOCATION_NORMALIZED as START_LOCATION } from './types'
3333
export type {
3434
// route ___location
3535
_RouteLocationBase,
36-
LocationAsPath,
36+
MatcherLocationAsPath,
3737
LocationAsRelativeRaw,
3838
RouteQueryAndHash,
3939
RouteLocationRaw,

packages/router/src/types/index.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ export interface RouteQueryAndHash {
5858
/**
5959
* @internal
6060
*/
61-
export interface LocationAsPath<P extends string = string> {
61+
export interface MatcherLocationAsPath<P extends string = string> {
6262
path: P
6363
}
6464

6565
/**
6666
* @internal
6767
*/
68-
export interface LocationAsName {
68+
export interface MatcherLocationAsName {
6969
name: RouteRecordName
7070
params?: RouteParams
7171
}
@@ -86,7 +86,7 @@ export interface LocationAsRelativeRaw<
8686
/**
8787
* @internal
8888
*/
89-
export interface LocationAsRelative<
89+
export interface MatcherLocationAsRelative<
9090
Info extends RouteNamedInfo = RouteNamedInfo
9191
> {
9292
params?: Info extends RouteNamedInfo<any, infer Params, any>
@@ -167,11 +167,11 @@ export type RouteLocationNamedRaw<
167167
export type RouteLocationPathRaw<
168168
RouteMap extends RouteStaticPathMapGeneric = RouteStaticPathMapGeneric
169169
> = RouteStaticPathMapGeneric extends RouteMap
170-
? // allows assigning a RouteLocationRaw to RouteLocationPat
171-
RouteQueryAndHash & LocationAsPath & RouteLocationOptions
170+
? // allows assigning a RouteLocationRaw to RouteLocationPath
171+
RouteQueryAndHash & MatcherLocationAsPath & RouteLocationOptions
172172
: RouteQueryAndHash &
173173
RouteLocationOptions &
174-
LocationAsPath<
174+
MatcherLocationAsPath<
175175
LiteralUnion<
176176
{ [K in keyof RouteMap]: RouteMap[K] }[keyof RouteMap],
177177
string
@@ -467,11 +467,17 @@ export const START_LOCATION_NORMALIZED: RouteLocationNormalizedLoaded = {
467467

468468
// Matcher types
469469
// the matcher doesn't care about query and hash
470+
/**
471+
* Route ___location that can be passed to the matcher.
472+
*/
470473
export type MatcherLocationRaw =
471-
| LocationAsPath
472-
| LocationAsName
473-
| LocationAsRelative
474+
| MatcherLocationAsPath
475+
| MatcherLocationAsName
476+
| MatcherLocationAsRelative
474477

478+
/**
479+
* Normalized/resolved Route ___location that returned by the matcher.
480+
*/
475481
export interface MatcherLocation {
476482
/**
477483
* Name of the matched record

0 commit comments

Comments
 (0)