// normalize component/components into components and make every property always present
export interface RouteRecordNormalized {
- path: RouteRecordMultipleViews['path']
+ /**
+ * {@inheritDoc _RouteRecordBase.path}
+ */
+ path: _RouteRecordBase['path']
+ /**
+ * {@inheritDoc _RouteRecordBase.redirect}
+ */
redirect: _RouteRecordBase['redirect'] | undefined
- name: RouteRecordMultipleViews['name']
+ /**
+ * {@inheritDoc _RouteRecordBase.name}
+ */
+ name: _RouteRecordBase['name']
+ /**
+ * {@inheritDoc RouteRecordMultipleViews.components}
+ */
components: RouteRecordMultipleViews['components']
- children: Exclude<RouteRecordMultipleViews['children'], void>
- meta: Exclude<RouteRecordMultipleViews['meta'], void>
+ /**
+ * {@inheritDoc _RouteRecordBase.components}
+ */
+ children: Exclude<_RouteRecordBase['children'], void>
+ /**
+ * {@inheritDoc _RouteRecordBase.meta}
+ */
+ meta: Exclude<_RouteRecordBase['meta'], void>
/**
* Object of props options with the same keys as `components`
+ * {@inheritDoc RouteRecordMultipleViews.props}
*/
props: Record<string, _RouteRecordProps>
+ /**
+ * {@inheritDoc _RouteRecordBase.props}
+ */
beforeEnter: RouteRecordMultipleViews['beforeEnter']
+ /**
+ * Registered leave guards
+ *
+ * @internal
+ */
leaveGuards: NavigationGuard[]
+ /**
+ * Registered update guards
+ *
+ * @internal
+ */
updateGuards: NavigationGuard[]
+ /**
+ * Registered beforeRouteEnter callbacks passed to `next` or returned in guards
+ *
+ * @internal
+ */
enterCallbacks: Record<string, NavigationGuardNextCallback[]>
- // having the instances on the record mean beforeRouteUpdate and
- // beforeRouteLeave guards can only be invoked with the latest mounted app
- // instance if there are multiple application instances rendering the same
- // view, basically duplicating the content on the page, which shouldn't happen
- // in practice. It will work if multiple apps are rendering different named
- // views.
+ /**
+ * Mounted route component instances
+ * Having the instances on the record mean beforeRouteUpdate and
+ * beforeRouteLeave guards can only be invoked with the latest mounted app
+ * instance if there are multiple application instances rendering the same
+ * view, basically duplicating the content on the page, which shouldn't happen
+ * in practice. It will work if multiple apps are rendering different named
+ * views.
+ */
instances: Record<string, ComponentPublicInstance | undefined | null>
// can only be of of the same type as this record
+ /**
+ * Defines if this record is the alias of another one. This property is
+ * `undefined` if the record is the original one.
+ */
aliasOf: RouteRecordNormalized | undefined
}
* @internal
*/
export interface _RouteLocationBase {
+ /**
+ * Percentage encoded pathname section of the URL.
+ */
path: string
+ /**
+ * The whole location including the `search` and `hash`. This string is
+ * percentage encoded.
+ */
fullPath: string
+ /**
+ * Object representation of the `search` property of the current location.
+ */
query: LocationQuery
+ /**
+ * Hash of the current location. If present, starts with a `#`.
+ */
hash: string
+ /**
+ * Name of the matched record
+ */
name: RouteRecordName | null | undefined
+ /**
+ * Object of decoded params extracted from the `path`.
+ */
params: RouteParams
+ /**
+ * Contains the location we were initially trying to access before ending up
+ * on the current location.
+ */
redirectedFrom: RouteLocation | undefined
+ /**
+ * Merged `meta` properties from all of the matched route records.
+ */
meta: Record<string | number | symbol, any>
}
/**
* Path of the record. Should start with `/` unless the record is the child of
* another record.
+ *
+ * @example `/users/:id` matches `/users/1` as well as `/users/posva`.
*/
path: string
/**