import type { Merge, MergeDeep, Replace } from 'type-fest'; import { type LocationType } from './XRouter'; import { XRouteSchema, type RouteSchema } from './XRouteSchema'; import { z } from 'zod'; /** * Route definition. * * @example * * const AppRoute = XRoute('app') * .Resource('/app/:section?') * .Type<{ * pathname: { section?: 'a'|'b' }; * search: { language?: 'en'|'da' }; * hash?: 'foo'|'bar' * }>() */ export declare const XRoute: (key: KEY, resource?: RESOURCE, location?: LOCATION) => XRouteConstructor, z.ZodObject<{}, z.UnknownKeysParam, z.ZodTypeAny, {}, {}>, undefined>>>; export declare class XRouteConstructor = XRouteSchema> { key: KEY; resource: RESOURCE; location: LOCATION; structure: SCHEMA; constructor(key: KEY, resource?: RESOURCE, location?: LOCATION, structure?: SCHEMA); Resource(r: R): XRouteConstructor, LOCATION, SCHEMA>; Type(l?: T): XRouteConstructor; search: MergeDeep; } & (T extends { hash: string; } ? { hash: T['hash']; } : T extends { hash?: string; } ? { hash?: T['hash']; } : { hash?: LOCATION['hash']; }), SCHEMA>; Extend(key: NEW_KEY): XRouteConstructor; Schema: (build: (s: SCHEMA) => Z) => XRouteConstructor>; search: z.TypeOf>; hash?: z.TypeOf> | undefined; }, XRouteSchema>; } export type RouteConfig = { key: string; resource: string; location: LocationType; };