export type ResponseSettings = {}; export type CookieOptions = { domain?: String; expires?: Date; httpOnly?: Boolean; maxAge?: Number; path?: String; secure?: Boolean; signed?: Boolean; sameSite?: Boolean | String; }; class Response { private static _instance: Response; public static getInstance(): Response { if (!this._instance) { this._instance = new Response(); } return this._instance; } public json(data: any) { //Response with JSON } public jsonP(data: any) { //Sends a JSON response with JSONP support } public links(links: { [x: string]: string; }) { //Joins the links provided as properties of the parameter to populate the response’s Link HTTP header field } public redirect(url: String) { //Redirects to the URL derived from the specified url } public render(view: String, locals: any) { //Renders a view and sends the rendered HTML string to the client (Views can be created in the Dashboard) } public send(body: String | Boolean | Array | Object) { //Sends the HTTP response. } public sendStatus(statusCode: Number) { //Sets the response HTTP status code to statusCode and sends the registered status message as the text response body } public status(statusCode: Number) { //Sets the HTTP status for the response. It is a chainable alias of res.statusCode return this; } public attachment(fileName: any) { //Sets the HTTP response Content-Disposition header field to “attachment” (Files have to be Uploaded on Api-Lib) } public download(fileName: any) { //Transfers the file at path as an “attachment”. Typically, browsers will prompt the user for download } public type(type: string) { //Sets the Content-Type HTTP header to the MIME type as determined by the specified type } public cookie( name: string, value: string | object, options: CookieOptions | undefined, ): void { //Sets cookie name to value. The value parameter may be a string or object converted to JSON } public clearCookie(name: string, options: CookieOptions): void { } public get(field: string): string | undefined { //Returns the HTTP response header specified by field return ""; } public set(field: string | object, value: string | undefined): void { //Sets the response’s HTTP header field to value. To set multiple fields at once, pass an object as the parameter } } export default Response;