RouteDefinition
interface exported by @mwillbanks/tuil-router.
interface
Public interface exported by @mwillbanks/tuil-router.
export interface RouteDefinition<
TParams = EmptyParams,
TChildren extends Readonly<Record<string, object>> = Readonly<
Record<string, object>
>,
> {
readonly component?: unknown;
readonly children?: TChildren;
readonly parseParams?: (params: unknown) => TParams;
readonly beforeEnter?: RouteHandler<
TParams,
boolean | string | Promise<boolean | string>
>;
readonly loader?: RouteHandler<TParams, unknown | Promise<unknown>>;
readonly onError?: RouteErrorHandler<TParams>;
readonly beforeLeave?: RouteHandler<TParams, boolean | Promise<boolean>>;
}Members
| Member | Type | Required | Description | Related types |
|---|---|---|---|---|
component | unknown | No | The component member uses the unknown contract. | — |
children | TChildren | undefined | No | The children member uses the TChildren | undefined contract. | — |
parseParams | ((params: unknown) => TParams) | undefined | No | The parseParams member uses the ((params: unknown) => TParams) | undefined contract. | — |
beforeEnter | ((context: RouteContext<TParams>) => string | boolean | Promise<string | boolean>) | undefined | No | The beforeEnter member uses the ((context: RouteContext<TParams>) => string | boolean | Promise<string | boolean>) | undefined contract. | RouteContext |
loader | ((context: RouteContext<TParams>) => unknown) | undefined | No | The loader member uses the ((context: RouteContext<TParams>) => unknown) | undefined contract. | RouteContext |
onError | ((error: unknown, context: RouteContext<TParams>) => void) | undefined | No | The onError member uses the ((error: unknown, context: RouteContext<TParams>) => void) | undefined contract. | RouteContext |
beforeLeave | ((context: RouteContext<TParams>) => boolean | Promise<boolean>) | undefined | No | The beforeLeave member uses the ((context: RouteContext<TParams>) => boolean | Promise<boolean>) | undefined contract. | RouteContext |
Parameters
This declaration has no public members.
Returns
This declaration does not return a value.
Throws
No thrown errors are documented for this declaration.
Related types
No package-local related types.
Source
View the secondary source reference