UNPKG

react-router-typesafe-routes

Version:

Enhanced type safety via validation for all route params in React Router v7.

11 lines (10 loc) 571 B
import { Type, ParserHint, Parser } from "../lib/index.mjs"; import type { StandardSchemaV1 } from "./standard-schema-spec.mjs"; interface ConfigureOptions { parserFactory: (hint?: ParserHint) => Parser<any, ParserHint>; } declare function configure({ parserFactory }: ConfigureOptions): { schema: <T>(schema: StandardSchemaV1<unknown, T | undefined>, parser?: Parser<T, never> | undefined) => Type<T>; }; declare const schema: <T>(schema: StandardSchemaV1<unknown, T | undefined>, parser?: Parser<T, never> | undefined) => Type<T>; export { configure, schema };