import * as t from 'io-ts'; import { HttpResponse } from './httpResponse'; import { HttpRequestCodec } from './httpRequest'; export declare const Method: t.KeyofC<{ get: number; post: number; put: number; delete: number; patch: number; }>; export declare type Method = t.TypeOf; export declare type HttpRoute = { readonly path: string; readonly method: Uppercase; readonly request: HttpRequestCodec; readonly response: HttpResponse; }; export declare type RequestType = t.TypeOf; export declare type ResponseType = { [K in keyof T['response']]: T['response'][K] extends t.Mixed ? { type: K; payload: t.TypeOf; } : never; }[keyof T['response']]; export declare type ApiSpec = { [ApiAction: string]: { [M in Method]?: HttpRoute; }; }; declare type UnknownKeysToError = { [ApiAction in keyof Spec]: { [M in keyof Spec[ApiAction]]: M extends Method ? Spec[ApiAction][M] : `Unsupported HTTP Method. Use "get" | "post" | "put" | "delete" | "patch"`; }; }; export declare const apiSpec: (spec: UnknownKeysToError) => Spec; export declare const httpRoute: >(spec: Props) => Props; export {}; //# sourceMappingURL=httpRoute.d.ts.map