Utilização

Create a typed destination.

tsx
// Create a typed destination.
import { Link, navigate, present, routes, type RouteTo } from 'kuito';

declare module 'kuito' {
  interface Routes {
    library: RouteTo;
    album: RouteTo<{ id: number }>;
    rating: RouteTo<{ album: number }, number>;
  }
}

<Link to={routes.album({ id: 42 })}>Album 42</Link>;

navigate(routes.library());

// Resolves with what the rating screen dismisses with.
const stars = await present(routes.rating({ album: 42 }));

Tipo

ts
Routes
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.