Usage

Type a destination's parameters.

tsx
// Type a destination's parameters.
import { navigate, routes, type RouteParams, type RouteTo } from 'kuito';

declare module 'kuito' {
  interface Routes {
    episode: RouteTo<{ show: number; season: number }>;
  }
}

// Logs every navigation with its params before it happens.
function track(route: string, params: RouteParams) {
  console.log('open', route, JSON.stringify(params));
}

const destination = routes.episode({ show: 7, season: 2 });

track(destination.route, destination.params);
navigate(destination);

Type declaration

ts
export type RouteParams = { readonly [name: string]: ParamValue };

Type

ts
{    readonly [name: string]: ParamValue;}
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.