RouteTo
One route of routes: its params in, a destination out; no argument without params.
Verwendung
Use typed destinations
import type { RouteTo } from 'kuito';
declare module 'kuito' {
interface Routes {
index: RouteTo;
show: RouteTo<{ id: number }>;
profile: RouteTo;
compose: RouteTo<{}, string>;
}
}Typdeklaration
export type RouteTo<P extends object = {}, R = undefined> = {} extends P
? (params?: P) => Destination<R>
: (params: P) => Destination<R>;Typ
{} extends P ? (params?: P) => Destination<R> : (params: P) => Destination<R>Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.