-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
46 lines (39 loc) · 916 Bytes
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
export module log {
export function info(args: any): void
export function error(args: any): void
export function debug(args: any): void
}
export function Response(
statusCode: number,
data: any,
cors: boolean = true
): ResponseType
export function HttpError(
statusCode: number,
message: string,
cors: boolean = true
): HttpError
export function createHandler(handler: any): any
export interface LogType {
info: (args: string) => void;
error: (args: string) => void;
debug: (args: string) => void;
}
export interface ResponseType {
statusCode: number;
body: any;
headers?: object;
}
export interface HttpErrorType {
statusCode: number;
body: any;
headers?: object;
}
export interface ShawermaInstance {
createHandler(): void;
log(): LogType;
Response(): ResponseType;
HttpError(): HttpErrorType;
}
declare const shawerma: ShawermaInstance;
export default shawerma;