react-router-typesafe-routes
Version:
Enhanced type safety via validation for all route params in React Router v7.
11 lines (10 loc) • 569 B
TypeScript
import { Type, ParserHint, Parser } from "../lib/index.js";
import type { StandardSchemaV1 } from "./standard-schema-spec.js";
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 };