import { ExpressResponse } from './express'; export declare type ResponseBody = any; export declare type ResponseCallback = (code: number, body?: ResponseBody) => void; export declare type AssertionType = 'array' | 'object' | 'string' | 'number' | 'boolean' | 'function'; export declare class Response { private req; private res; /** Lock this response as a backup so it's not send twice. */ private lock; private callback?; private code?; private message?; get expressResponse(): ExpressResponse; get isLocked(): boolean; get statusCode(): number | undefined; get statusMessage(): string | undefined; constructor(req: RequestType, res: ExpressResponse, callback?: ResponseCallback); sendResponse: (code: number, body?: ResponseBody, doRunCallback?: boolean) => void; /** * Assert the presence of a value for parameter testing. * Sends a "400 Bad Request" if the check fails. * @param key The key in the request object that is being tested. Split with dots to access * child properties of an object, such as `event.eventName`. * @param type The type of the value to assert. * @param isRequired Is the parameter required? * @returns True if the assertion passes, false otherwise. */ assert: (key: keyof RequestType | string, type: AssertionType, isRequired?: boolean) => boolean; ok: (res: ResponseType) => void; continue: (body?: ResponseBody) => void; noContent: (body?: ResponseBody) => void; movedPermanently: (body?: ResponseBody) => void; badRequest: (body?: ResponseBody) => void; unauthorized: (body?: ResponseBody) => void; paymentRequired: (body?: ResponseBody) => void; forbidden: (body?: ResponseBody) => void; notFound: (body?: ResponseBody) => void; methodNotAllowed: (body?: ResponseBody) => void; notAcceptable: (body?: ResponseBody) => void; requestTimeout: (body?: ResponseBody) => void; conflict: (body?: ResponseBody) => void; gone: (body?: ResponseBody) => void; tooManyRequests: (body?: ResponseBody) => void; internalServerError: (body?: ResponseBody) => void; notImplemented: (body?: ResponseBody) => void; serviceUnavailable: (body?: ResponseBody) => void; }