///
import { Res } from "./Res";
import { Req } from "./Req";
import { Body } from "./Body";
import { Readable } from "stream";
export declare type KeyValues = {
[key: string]: string;
};
export declare type PathParams = {
[key: string]: string;
};
export declare type QueryField = string | string[];
export declare type Queries = {
[key: string]: QueryField;
};
export declare type FormField = string | string[];
export declare type FormJson = {
[key: string]: FormField;
};
export declare type HeadersJson = {
[key: string]: string;
};
export declare type BodyContent = Readable | string;
export interface HttpMessage {
headers: HeadersJson;
body: Body;
header(name: string): string;
withHeader(name: string, value: string): HttpMessage;
replaceHeader(name: string, value: string): HttpMessage;
replaceAllHeaders(headers: HeadersJson): HttpMessage;
removeHeader(name: string): HttpMessage;
withBody(body: string): HttpMessage;
bodyString(): string;
}
export declare type HttpHandler = (request: Req) => Promise;
export interface Handler {
handle(req: Req): Promise;
}
export declare function asHandler(handler: HttpHandler | Handler): Handler;