declare type Optional = { [P in keyof T]?: T[P] | null; }; declare type Collection = Record; declare type BaseRouteParameter = string | boolean | Date | number; declare type MethodRouteParameter = BaseRouteParameter | (() => BaseRouteParameter); declare type ModelRouteParameter = { id: MethodRouteParameter; } | { to_param: MethodRouteParameter; } | { toParam: MethodRouteParameter; }; declare type RequiredRouteParameter = BaseRouteParameter | ModelRouteParameter; declare type OptionalRouteParameter = undefined | null | RequiredRouteParameter; declare type QueryRouteParameter = OptionalRouteParameter | QueryRouteParameter[] | { [k: string]: QueryRouteParameter; }; declare type RouteParameters = Collection; declare type Serializable = Collection; declare type Serializer = (value: Serializable) => string; declare type RouteHelperExtras = { requiredParams(): string[]; toString(): string; }; declare type RequiredParameters = T extends 1 ? [RequiredRouteParameter] : T extends 2 ? [RequiredRouteParameter, RequiredRouteParameter] : T extends 3 ? [RequiredRouteParameter, RequiredRouteParameter, RequiredRouteParameter] : T extends 4 ? [ RequiredRouteParameter, RequiredRouteParameter, RequiredRouteParameter, RequiredRouteParameter ] : RequiredRouteParameter[]; declare type RouteHelperOptions = RouteOptions & Collection; declare type RouteHelper = ((...args: [...RequiredParameters, RouteHelperOptions]) => string) & RouteHelperExtras; declare type RouteHelpers = Collection; declare type Configuration = { prefix: string; default_url_options: RouteParameters; special_options_key: string; serializer: Serializer; }; interface RouterExposedMethods { config(): Configuration; configure(arg: Partial): Configuration; serialize: Serializer; } declare type KeywordUrlOptions = Optional<{ host: string; protocol: string; subdomain: string; port: string | number; anchor: string; trailing_slash: boolean; params: RouteParameters; }>; declare type RouteOptions = KeywordUrlOptions & RouteParameters; declare type PartsTable = Collection<{ r?: boolean; d?: OptionalRouteParameter; }>; declare type ModuleType = "CJS" | "AMD" | "UMD" | "ESM" | "DTS" | "NIL"; declare const RubyVariables: { PREFIX: string; DEPRECATED_FALSE_PARAMETER_BEHAVIOR: boolean; SPECIAL_OPTIONS_KEY: string; DEFAULT_URL_OPTIONS: RouteParameters; SERIALIZER: Serializer; ROUTES_OBJECT: RouteHelpers; MODULE_TYPE: ModuleType; WRAPPER: (callback: T) => T; }; declare const define: undefined | (((arg: unknown[], callback: () => unknown) => void) & { amd?: unknown; }); declare const module: { exports: unknown; } | undefined;