@gabliam/web-core
Version:
Gabliam plugin for add web-core
37 lines (36 loc) • 1.1 kB
TypeScript
import HttpStatus from 'http-status-codes';
export { HttpStatus };
export declare class ResponseEntity<T = any> {
/**
* A shortcut for creating a ResponseEntity with the given body and the status set to OK.
* @param body
*/
static ok<U = any>(body?: U): ResponseEntity<U | undefined>;
/**
* Create a ResponseEntity with an ACCEPTED status.
*/
static accepted(): ResponseEntity<null>;
/**
* Create a ResponseEntity with a BAD_REQUEST status.
*/
static badRequest(): ResponseEntity<null>;
/**
* Create a ResponseEntity with a NO_CONTENT status.
*/
static noContent(): ResponseEntity<null>;
/**
* Create a ResponseEntity with a NOT_FOUND status.
*/
static notFound(): ResponseEntity<null>;
private _status;
private _headers;
private _body;
constructor(body: T, status?: number);
get status(): number;
get headers(): {
[]: string | number | string[];
};
get body(): T | null;
hasHeader(): boolean;
addHeader(headerName: string, value: any): void;
}