forked from dougmoscrop/serverless-http
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless-http.d.ts
34 lines (29 loc) · 908 Bytes
/
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
/// <reference types="aws-lambda" />
declare namespace ServerlessHttp {
export interface FrameworkApplication {
callback: Function;
handle: Function;
router: {
route: Function;
}
_core: {
_dispatch: Function;
}
}
/**
* Handler-compatible function or application.
*/
export type Application = Function | Partial<FrameworkApplication>;
/**
* AWS Lambda APIGatewayProxyHandler-like handler.
*/
export type Handler = (
event: AWSLambda.APIGatewayProxyEvent | AWSLambda.APIGatewayProxyEventV2,
context: AWSLambda.Context
) => Promise<AWSLambda.APIGatewayProxyResult | AWSLambda.APIGatewayProxyStructuredResultV2>;
}
/**
* Wraps the application into a Lambda APIGatewayProxyHandler-like handler.
*/
declare function ServerlessHttp(application: ServerlessHttp.Application, options?: any): ServerlessHttp.Handler;
export = ServerlessHttp;