///
import { RequestListener, IncomingMessage, ServerResponse } from 'http'
export type RequestHandler = (req: IncomingMessage, res: ServerResponse) => any
declare function serve(fn: RequestHandler): RequestListener
export function run(req: IncomingMessage, res: ServerResponse, fn: RequestHandler): Promise
export function json(req: IncomingMessage, info?: { limit?: string | number, encoding?: string }): Promise
export function text(req: IncomingMessage, info?: { limit?: string | number, encoding?: string }): Promise
export function buffer(req: IncomingMessage, info?: { limit?: string | number, encoding?: string }): Promise
export function send(res: ServerResponse, code: number, data?: any): Promise
export function createError(code: number, msg: string, orig?: Error): Error & { statusCode: number, originalError?: Error }
export function sendError(req: IncomingMessage, res: ServerResponse, info: { statusCode?: number, status?: number, message?: string, stack?: string }): Promise
export default serve