RouteParams
A route's params: what its screen receives, and what a deep link's text parses into.
Utilização
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);Declaração do tipo
export type RouteParams = { readonly [name: string]: ParamValue };Tipo
{ readonly [name: string]: ParamValue;}Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.