import { Codec } from '../Codecs'; import { Routeway } from '../Routeways'; /** * Base structure of codec definitions. Useful for generic constraints. */ export type CodecMap = Record>; /** * Defines the type of path, which is any string that starts with a `/` char. */ export type PathLike = `/${string}`; /** * Transform a record of codecs to a record based on the types of each codec. */ export type CodecsToRecord = { [K in keyof T]: T[K] extends Codec ? V : never; }; /** * Merges the path variables and query parameter in a single object. * * @param V the record type of the path variables * @param Q the record type of the query parameters */ export type RouteParams = CodecsToRecord & Partial>; /** * Infers the query parameters type of a route. * * @example * ``` * type UsersQueryParams = InferQueryParams; * // ^ type = { search?: string; page?: number; } * ``` * * @param T the type of the route to make the infer */ export type InferQueryParams = T extends Routeway> ? Partial> : never; export declare function safeKeys(obj: T): Extract[]; export declare function isValidDate(date: Date): boolean;