RouteParams
A route's params: what its screen receives, and what a deep link's text parses into.
Usage
Type a destination's parameters.
// 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
export type RouteParams = { readonly [name: string]: ParamValue };Type
{ 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.