import { TypeInfo } from 'rtti'; import { HttpSchema, Method } from './shared'; export declare type ExtractMethod = Route extends `${infer M} ${string}` ? M extends Method ? M : never : never; export declare type ExtractPath = Route extends `${string} ${infer Path}` ? Path : never; /** Extracts the union of string literal paths for the given schema and method. */ export declare type Paths = FilterRoutes['path']; /** Extracts the union of string literal named params for the given schema/method/path, or never if no params. */ export declare type NamedParams = FilterRoutes['namedParams'] extends Array ? Extract : never; /** Extracts the request body type for the given schema/method/path, or undefined if no body type specified. */ export declare type RequestBody = FilterRoutes['requestBody'] extends infer U ? U extends TypeInfo ? T : undefined : never; /** Extracts the response body type for the given schema/method/path, or undefined if no body type specified. */ export declare type ResponseBody = FilterRoutes['responseBody'] extends infer U ? U extends TypeInfo ? T : undefined : never; /** Helper mapped type that selects the (should be single) RouteInfo matching the given method/path. */ export declare type FilterRoutes = S[keyof S] extends infer U ? (U extends { method: M; path: P; } ? U : never) : never; /** Helper type to simplify output type display. */ export declare type Anonymize = Anonymize2<{ [K in keyof Obj]: Obj[K]; }>; declare type Anonymize2 = T; export {};