1 | export declare function success({ body, json, cors, statusCode, headers, }?: ResponseParameters): ApiResponse;
|
2 | export declare function invalid({ body, json, cors, statusCode, headers, }?: ResponseParameters): ApiResponse;
|
3 | export declare function custom({ body, json, cors, statusCode, headers }: CustomParameters): ApiResponse;
|
4 | export declare function notFound({ body, json, cors, statusCode, headers, }?: ResponseParameters): ApiResponse;
|
5 | export declare function notAuthorized({ body, json, cors, statusCode, headers, }?: ResponseParameters): ApiResponse;
|
6 | export declare function error({ body, json, cors, statusCode, headers, err, }?: ErrorParameters): ApiResponse;
|
7 | export declare function redirect({ url, cors, statusCode, headers }: RedirectParameters): ApiResponse;
|
8 | export interface ApiResponse {
|
9 | statusCode: number;
|
10 | headers: {
|
11 | [name: string]: any;
|
12 | };
|
13 | body?: string;
|
14 | }
|
15 | export interface ResponseParameters {
|
16 | body?: any;
|
17 | json?: boolean;
|
18 | cors?: boolean;
|
19 | statusCode?: number;
|
20 | headers?: {
|
21 | [key: string]: any;
|
22 | };
|
23 | }
|
24 | export interface CustomParameters {
|
25 | body?: any;
|
26 | json?: boolean;
|
27 | cors?: boolean;
|
28 | statusCode: number;
|
29 | headers?: {
|
30 | [key: string]: any;
|
31 | };
|
32 | }
|
33 | export interface ErrorParameters {
|
34 | body?: any;
|
35 | json?: boolean;
|
36 | cors?: boolean;
|
37 | statusCode?: number;
|
38 | headers?: {
|
39 | [key: string]: any;
|
40 | };
|
41 | err?: Error;
|
42 | }
|
43 | export interface RedirectParameters {
|
44 | url: string;
|
45 | cors?: boolean;
|
46 | statusCode?: number;
|
47 | headers?: {
|
48 | [key: string]: any;
|
49 | };
|
50 | }
|