export declare type EncodingType = 'json' | 'raw'; export declare class Response { status: number; /** * Constructs a new Response, with the given status code, headers, and * body. The body will be encoded as JSON by default. Use `encodeAs('raw')` * to disable JSON encoding. */ constructor(status: number, headers: string[][] | any, body: any, isRawBody?: boolean); /** * Headers for the response, as an array of [key, value] tuple arrays. */ headers: string[][]; /** * Body of the response. */ body: string; /** * Stores the raw, unencoded body in case the user calls encodeAs() */ private unencodedBody; /** * Return a 201 Created response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static created(url: string, body: any): Response; /** * Return a 200 OK response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static ok(body?: any): Response; /** * Return a 500 Internal Server Error response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static serverError(body?: any): Response; /** * Return a 400 Bad Request response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static badRequest(body?: any): Response; /** * Return a 404 Not Found response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static notFound(body?: any): Response; /** * Return a 401 Unauthorized response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static unauthorized(body?: any): Response; /** * Return a 403 Forbidden response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static forbidden(body?: any): Response; /** * Return a 100 Continue response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static continue(body?: any): Response; /** * Return a 101 Switching Protocols response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static switchingProtocols(body?: any): Response; /** * Return a 102 Processing response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static processing(body?: any): Response; /** * Return a 202 Accepted response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static accepted(body?: any): Response; /** * Return a 203 Non-Authoritative Information response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static nonAuthoritativeInformation(body: any): Response; /** * Return a 204 No Content response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static noContent(): Response; /** * Return a 205 Reset Content response. */ static resetContent(): Response; /** * Return a 206 Partial Content response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static partialContent(body: any): Response; /** * Return a 300 Multiple Choices response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). * There is no standard format for the body, but you should indicate Content-Type, and ideally provide a Location header indicating * the server's preferred choice. */ static multipleChoices(body: any): Response; /** * Return a 301 Moved Permanently response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static movedPermanently(url: any, body?: any): Response; /** * Return a 302 Found response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static found(url: any, body?: any): Response; /** * Return a 303 See Other response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). * Use this after a new resource is created from a PUT or POST request to send the user agent to the new resource * without causing them to redirect future requests to the POST/PUT endpoint itself. */ static seeOther(url: any, body?: any): Response; /** * Return a 304 Not Modified response. * This request should usually have a Date header on it as well. */ static notModified(): Response; /** * Return a 305 Use Proxy response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). * Use this if you are restricting requests only to approved proxies, and the user is not an approved proxy. */ static useProxy(url: any, body?: any): Response; /** * Return a 307 Temporary Redirect response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static temporaryRedirect(url: any, body?: any): Response; /** * Return a 402 Payment Required response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). * Caution: This status code has not been formally specified. */ static paymentRequired(body?: any): Response; /** * Return a 405 Method Not Allowed response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static methodNotAllowed(allowedMethods: string, body?: any): Response; /** * Return a 406 Not Acceptable response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static notAcceptable(body?: any): Response; /** * Return a 407 Not Acceptable response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static proxyAuthenticationRequired(challenge: any, body?: any): Response; /** * Return a 408 Request Timeout response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static requestTimeout(body?: any): Response; /** * Return a 409 Conflict response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static conflict(body?: any): Response; /** * Return a 410 Gone response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static gone(body?: any): Response; /** * Return a 411 Length Required response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static lengthRequired(body?: any): Response; /** * Return a 412 Precondition Failed response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static preconditionFailed(body?: any): Response; /** * Return a 413 Request Entity Too Large response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static requestTooLarge(body?: any): Response; /** * Return a 414 Request-URI Too Long response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static uriTooLong(body?: any): Response; /** * Return a 415 Unsupported Media Type response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static unsupportedMediaType(body?: any): Response; /** * Return a 416 Unsupported Media Type response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static rangeNotSatisfiable(body?: any): Response; /** * Return a 417 Unsupported Media Type response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static expectationFailed(body?: any): Response; /** * Return a 501 Not Implemented response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static notImplemented(body?: any): Response; /** * Return a 502 Bad Gateway response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static badGateway(body?: any): Response; /** * Return a 503 Service Unavailable response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static serviceUnavailable(body?: any): Response; /** * Return a 504 Gateway Timeout response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static gatewayTimeout(body?: any): Response; /** * Return a 505 HTTP Version Not Supported response with the given body (will be encoded as JSON, append encodeAs('raw') to disable). */ static httpVersionNotSupported(body?: any): Response; /** * Throw this response as an `HttpException` */ throw(): void; /** * Change the encoding of the body in the response. By default, Response will encode the body contents as * JSON, even if the type of the value is a string. To send a body which is not JSON, you must call * encodeAs('raw'). */ encodeAs(encoding: EncodingType): this; /** * Attach the given header to this response and return itself for fluent calls. */ header(name: string, value: string): this; }