RouteTo
One route of routes: its params in, a destination out; no argument without params.
Usage
Use typed destinations
import type { RouteTo } from 'kuito';
declare module 'kuito' {
interface Routes {
index: RouteTo;
show: RouteTo<{ id: number }>;
profile: RouteTo;
compose: RouteTo<{}, string>;
}
}Type declaration
export type RouteTo<P extends object = {}, R = undefined> = {} extends P
? (params?: P) => Destination<R>
: (params: P) => Destination<R>;Type
{} extends P ? (params?: P) => Destination<R> : (params: P) => Destination<R>Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.