tuil
ReferencePackages@mwillbanks/tuil-routerAPI

RouteDefinition

interface exported by @mwillbanks/tuil-router.

View rawEdit

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

MemberTypeRequiredDescriptionRelated types
componentunknownNoThe component member uses the unknown contract.
childrenTChildren | undefinedNoThe children member uses the TChildren | undefined contract.
parseParams((params: unknown) => TParams) | undefinedNoThe parseParams member uses the ((params: unknown) => TParams) | undefined contract.
beforeEnter((context: RouteContext<TParams>) => string | boolean | Promise<string | boolean>) | undefinedNoThe beforeEnter member uses the ((context: RouteContext<TParams>) => string | boolean | Promise<string | boolean>) | undefined contract.RouteContext
loader((context: RouteContext<TParams>) => unknown) | undefinedNoThe loader member uses the ((context: RouteContext<TParams>) => unknown) | undefined contract.RouteContext
onError((error: unknown, context: RouteContext<TParams>) => void) | undefinedNoThe onError member uses the ((error: unknown, context: RouteContext<TParams>) => void) | undefined contract.RouteContext
beforeLeave((context: RouteContext<TParams>) => boolean | Promise<boolean>) | undefinedNoThe 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.

No package-local related types.

Source

View the secondary source reference

Package

@mwillbanks/tuil-router

On this page