* }
* ```
*/
-
scrollBehavior?: RouterScrollBehavior
+
/**
* Custom implementation to parse a query. See its counterpart,
* {@link EXPERIMENTAL_RouterOptions_Base.stringifyQuery}.
* })
* ```
*/
-
parseQuery?: typeof originalParseQuery
+
/**
* Custom implementation to stringify a query object. Should not prepend a leading `?`.
- * {@link EXPERIMENTAL_RouterOptions_Base.parseQuery | parseQuery} counterpart to handle query parsing.
+ * {@link parseQuery} counterpart to handle query parsing.
*/
stringifyQuery?: typeof originalStringifyQuery
+
/**
* Default class applied to active {@link RouterLink}. If none is provided,
* `router-link-active` will be applied.
*/
-
linkActiveClass?: string
+
/**
* Default class applied to exact active {@link RouterLink}. If none is provided,
* `router-link-exact-active` will be applied.
*/
-
linkExactActiveClass?: string
+
/**
* Default class applied to non-active {@link RouterLink}. If none is provided,
* `router-link-inactive` will be applied.
}
/**
- * Router instance.
+ * Router base instance.
* @experimental This version is not stable, it's meant to replace {@link Router} in the future.
*/
export interface EXPERIMENTAL_Router_Base<TRouteRecordRaw, TRouteRecord> {
}
// Initialization and Errors
-
let readyHandlers = useCallbacks<_OnReadyCallback>()
let errorListeners = useCallbacks<_ErrorListener>()
let ready: boolean
* only be called once, otherwise does nothing.
* @param err - optional error
*/
- function markAsReady<E = any>(err: E): E
- function markAsReady<E = any>(): void
- function markAsReady<E = any>(err?: E): E | void {
+ function markAsReady<E = unknown>(err: E): E
+ function markAsReady(): void
+ function markAsReady<E = unknown>(err?: E): E | void {
if (!ready) {
// still not ready if an error happened
ready = !err
*/
export type RawRouteComponent = RouteComponent | Lazy<RouteComponent>
-// TODO: could this be moved to matcher?
+// TODO: could this be moved to matcher? YES, it's on the way
/**
* Internal type for common properties among all kind of {@link RouteRecordRaw}.
*/
}
/**
- * Route Record defining one single component with a nested view.
+ * Route Record defining one single component with a nested view. Differently
+ * from {@link RouteRecordSingleView}, this record has children and allows a
+ * `redirect` option.
*/
export interface RouteRecordSingleViewWithChildren extends _RouteRecordBase {
/**