-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.d.ts
55 lines (55 loc) · 2.58 KB
/
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
47
48
49
50
51
52
53
54
55
import { APIGatewayProxyEvent as AWS_APIGatewayProxyEvent, APIGatewayProxyEventV2 as AWS_APIGatewayProxyEventV2, APIGatewayProxyResult, APIGatewayProxyStructuredResultV2, Callback, Context } from "aws-lambda";
import middy from "@middy/core";
/**
* Casted interface for APIGatewayProxyEvents as converted through the middleware
*/
export interface APIGatewayProxyEvent extends AWS_APIGatewayProxyEvent {
/**
* HTTP Request body, parsed from a JSON string into an object.
*/
body: any | null;
/**
* HTTP Path Parameters, always defined, never null
*/
pathParameters: {
[name: string]: string;
};
/**
* HTTP URL query string parameters, always defined, never null
*/
queryStringParameters: {
[name: string]: string;
};
}
export type APIGatewayProxyEventV1 = APIGatewayProxyEvent;
/**
* Casted interface for APIGatewayProxyEventsV2 as converted through the middleware
*/
export interface APIGatewayProxyEventV2 extends AWS_APIGatewayProxyEventV2 {
/**
* HTTP Request body, parsed from a JSON string into an object.
*/
body: any | null;
/**
* HTTP Path Parameters, always defined, never null
*/
pathParameters: {
[name: string]: string;
};
/**
* HTTP URL query string parameters, always defined, never null
*/
queryStringParameters: {
[name: string]: string;
};
}
export type APIGatewayProxyEventAnyVersion = AWS_APIGatewayProxyEvent | APIGatewayProxyEvent | AWS_APIGatewayProxyEventV2 | APIGatewayProxyEventV2;
export type APIGatewayProxyResultAnyVersion = APIGatewayProxyResult | APIGatewayProxyStructuredResultV2;
/** LambdaUtils version of ProxyHandler for API Gateway v1 payload format */
export type AsyncProxyHandlerV1 = (event: APIGatewayProxyEvent, context: Context, callback?: Callback<APIGatewayProxyResult>) => Promise<APIGatewayProxyResult | object | void>;
/** LambdaUtils version of an API Gateway v1 payload handler wrapped with middy */
export type AsyncMiddyifedHandlerV1 = middy.MiddyfiedHandler<AWS_APIGatewayProxyEvent, APIGatewayProxyResult | object | void>;
/** LambdaUtils version of ProxyHandler for API Gateway v2 payload format */
export type AsyncProxyHandlerV2 = (event: APIGatewayProxyEventV2, context: Context, callback?: Callback<APIGatewayProxyStructuredResultV2>) => Promise<APIGatewayProxyStructuredResultV2 | object | void>;
/** LambdaUtils version of an API Gateway v12payload handler wrapped with middy */
export type AsyncMiddyifedHandlerV2 = middy.MiddyfiedHandler<AWS_APIGatewayProxyEventV2, APIGatewayProxyStructuredResultV2 | object | void>;