import { FromPathOption, NavigateOptions, PathParamOptions, SearchParamOptions, ToPathOption } from './link.cjs'; import { Redirect } from './redirect.cjs'; import { RouteIds } from './routeInfo.cjs'; import { AnyRouter, RegisteredRouter } from './router.cjs'; import { UseParamsResult } from './useParams.cjs'; import { UseSearchResult } from './useSearch.cjs'; import { Constrain, ConstrainLiteral } from './utils.cjs'; export type ValidateFromPath = FromPathOption; export type ValidateToPath = ToPathOption; export type ValidateSearch = SearchParamOptions; export type ValidateParams = PathParamOptions; /** * @internal */ export type InferFrom = TOptions extends { from: infer TFrom extends string; } ? TFrom : TDefaultFrom; /** * @internal */ export type InferTo = TOptions extends { to: infer TTo extends string; } ? TTo : undefined; /** * @internal */ export type InferMaskTo = TOptions extends { mask: { to: infer TTo extends string; }; } ? TTo : ''; export type InferMaskFrom = TOptions extends { mask: { from: infer TFrom extends string; }; } ? TFrom : string; export type ValidateNavigateOptions = Constrain, InferTo, InferMaskFrom, InferMaskTo>>; export type ValidateNavigateOptionsArray = ReadonlyArray, TDefaultFrom extends string = string> = { [K in keyof TOptions]: ValidateNavigateOptions; }; export type ValidateRedirectOptions = Constrain, InferTo, InferMaskFrom, InferMaskTo>>; export type ValidateRedirectOptionsArray = ReadonlyArray, TDefaultFrom extends string = string> = { [K in keyof TOptions]: ValidateRedirectOptions; }; export type ValidateId = ConstrainLiteral>; /** * @internal */ export type InferStrict = TOptions extends { strict: infer TStrict extends boolean; } ? TStrict : true; /** * @internal */ export type InferShouldThrow = TOptions extends { shouldThrow: infer TShouldThrow extends boolean; } ? TShouldThrow : true; /** * @internal */ export type InferSelected = TOptions extends { select: (...args: Array) => infer TSelected; } ? TSelected : unknown; export type ValidateUseSearchResult = UseSearchResult, InferStrict, InferSelected>; export type ValidateUseParamsResult = Constrain, InferStrict, InferSelected>>;