-
Notifications
You must be signed in to change notification settings - Fork 167
/
serverless-http.d.ts
43 lines (38 loc) · 1.08 KB
/
serverless-http.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
import { Server } from "http";
declare namespace ServerlessHttp {
export interface FrameworkApplication {
callback: Function;
handle: Function;
router: {
route: Function;
}
_core: {
_dispatch: Function;
}
}
/**
* Handler-compatible function, application or plain http server.
*/
export type Application = Function | Partial<FrameworkApplication> | Server;
export type Result = Function | Partial<FrameworkApplication> | Server;
export type Options = {
provider?: 'aws' | 'azure'
requestId?: string,
request?: Object | Function,
response?: Object | Function,
binary?: boolean | Function | string | string[],
basePath?: string
}
/**
* AWS Lambda APIGatewayProxyHandler-like handler.
*/
export type Handler = (
event: Object,
context: Object
) => Promise<Object>;
}
/**
* Wraps the application into a Lambda APIGatewayProxyHandler-like handler.
*/
declare function ServerlessHttp(application: ServerlessHttp.Application, options?: ServerlessHttp.Options): ServerlessHttp.Handler;
export = ServerlessHttp;