import { LocationQuery, LocationQueryRaw } from './query'
-import {
- RouteLocation,
- RouteLocationNormalized,
- RouteParamValue,
-} from './types'
+import { RouteLocationNormalized, RouteParamValue } from './types'
import { RouteRecord } from './matcher/types'
import { warn } from './warning'
import { isArray } from './utils'
import { decode } from './encoding'
-import { RouteLocationNormalizedLoaded } from './typed-routes'
+import { RouteLocation, RouteLocationNormalizedLoaded } from './typed-routes'
/**
* Location object returned by {@link `parseURL`}.
export type {
_RouteRecordName as RouteRecordName,
_RouteLocationRaw as RouteLocationRaw,
- _RouteLocation as RouteLocation,
+ RouteLocation,
_RouteLocationNormalized as RouteLocationNormalized,
_RouteLocationNormalizedLoaded as RouteLocationNormalizedLoaded,
_RouteLocationResolved as RouteLocationResolved,
import type {
- RouteLocation,
RouteLocationNormalized,
RouteLocationNormalizedLoaded,
RouteLocationOptions,
RouteQueryAndHash,
RouteRecordName,
RouteLocationRaw,
+ _RouteLocationBase,
} from '../types'
import type { _LiteralUnion } from '../types/utils'
// inlining the type as it avoids code splitting issues
import type { RouteMap, _RouteMapGeneric } from './route-map'
import type { Router } from '../router'
+import type { RouteRecord } from '../matcher/types'
/**
* Type safe version if it exists of the routes' names.
export interface RouteLocationTyped<
RouteMap extends _RouteMapGeneric,
Name extends keyof RouteMap
-> extends RouteLocation {
+> extends _RouteLocationBase {
name: Extract<Name, RouteRecordName>
params: RouteMap[Name]['params']
+
+ /**
+ * Array of {@link RouteRecord} containing components as they were
+ * passed when adding records. It can also contain redirect records. This
+ * can't be used directly
+ */
+ matched: RouteRecord[] // non-enumerable
}
/**
> = RouteLocationResolvedTypedList<RouteMap>[Name]
/**
- * Type safe version of `RouteLocation` . Allows passing the name of the route to be passed as a generic.
+ * {@link RouteLocationRaw} resolved using the matcher
* @see {@link RouteLocation}
*/
-export type _RouteLocation<Name extends keyof RouteMap = keyof RouteMap> =
+export type RouteLocation<Name extends keyof RouteMap = keyof RouteMap> =
RouteLocationTypedList<RouteMap>[Name]
/**
-import { _RouteLocation, _RouteLocationRaw } from './route-location'
+import { RouteLocation, _RouteLocationRaw } from './route-location'
/**
* @internal
*/
export type RouteRecordRedirectOption =
| _RouteLocationRaw
- | ((to: _RouteLocation) => _RouteLocationRaw)
+ | ((to: RouteLocation) => _RouteLocationRaw)
import { NavigationFailure } from '../errors'
import {
NavigationGuardWithThis,
+ RouteLocation,
RouteRecordRedirectOption,
} from '../typed-routes'
import { _Awaitable } from './utils'
matched: RouteLocationMatched[] // non-enumerable
}
-/**
- * {@link RouteLocationRaw} resolved using the matcher
- */
-export interface RouteLocation extends _RouteLocationBase {
- /**
- * Array of {@link RouteRecord} containing components as they were
- * passed when adding records. It can also contain redirect records. This
- * can't be used directly
- */
- matched: RouteRecord[] // non-enumerable
-}
-
/**
* Similar to {@link RouteLocation} but its
* {@link RouteLocationNormalized.matched} cannot contain redirect records