import { AnyParams, OptionalParams, RouteRef, SubRouteRef } from './types'; /** * Used in {@link PathParams} type declaration. * @public * @deprecated this type is deprecated and will be removed in the future */ export type ParamPart = S extends `:${infer Param}` ? Param : never; /** * Used in {@link PathParams} type declaration. * @public * @deprecated this type is deprecated and will be removed in the future */ export type ParamNames = S extends `${infer Part}/${infer Rest}` ? ParamPart | ParamNames : ParamPart; /** * This utility type helps us infer a Param object type from a string path * For example, `/foo/:bar/:baz` inferred to `{ bar: string, baz: string }` * @public * @deprecated this type is deprecated and will be removed in the future */ export type PathParams = { [name in ParamNames]: string; }; /** * Merges a param object type with an optional params type into a params object. * @public * @deprecated this type is deprecated and will be removed in the future */ export type MergeParams = (P1[keyof P1] extends never ? {} : P1) & (P2 extends undefined ? {} : P2); /** * Creates a SubRouteRef type given the desired parameters and parent route parameters. * The parameters types are merged together while ensuring that there is no overlap between the two. * * @public * @deprecated this type is deprecated and will be removed in the future */ export type MakeSubRouteRef = keyof Params & keyof ParentParams extends never ? SubRouteRef>> : never; /** * Create a {@link SubRouteRef} from a route descriptor. * * @param config - Description of the route reference to be created. * @public */ export declare function createSubRouteRef(config: { id: string; path: Path; parent: RouteRef; }): MakeSubRouteRef, ParentParams>;