Skip to content

Commit 56e4ce4

Browse files
committed
.
1 parent 03f3c29 commit 56e4ce4

File tree

2 files changed

+370
-61
lines changed

2 files changed

+370
-61
lines changed

index.d.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -528,3 +528,55 @@ export declare function isApiGatewayV2Context(
528528
export declare function isAlbContext(
529529
context: RequestContext
530530
): context is ALBContext;
531+
532+
export declare function isApiGatewayEvent(
533+
event: Event
534+
): event is APIGatewayProxyEvent;
535+
536+
export declare function isApiGatewayV2Event(
537+
event: Event
538+
): event is APIGatewayProxyEventV2;
539+
540+
export declare function isAlbEvent(event: Event): event is ALBEvent;
541+
542+
export declare function isApiGatewayRequest<
543+
TQuery extends Record<string, string | undefined> = Record<
544+
string,
545+
string | undefined
546+
>,
547+
TParams extends Record<string, string | undefined> = Record<
548+
string,
549+
string | undefined
550+
>,
551+
TBody = any
552+
>(
553+
req: Request<any, TQuery, TParams, TBody>
554+
): req is Request<APIGatewayContext, TQuery, TParams, TBody>;
555+
556+
export declare function isApiGatewayV2Request<
557+
TQuery extends Record<string, string | undefined> = Record<
558+
string,
559+
string | undefined
560+
>,
561+
TParams extends Record<string, string | undefined> = Record<
562+
string,
563+
string | undefined
564+
>,
565+
TBody = any
566+
>(
567+
req: Request<any, TQuery, TParams, TBody>
568+
): req is Request<APIGatewayV2Context, TQuery, TParams, TBody>;
569+
570+
export declare function isAlbRequest<
571+
TQuery extends Record<string, string | undefined> = Record<
572+
string,
573+
string | undefined
574+
>,
575+
TParams extends Record<string, string | undefined> = Record<
576+
string,
577+
string | undefined
578+
>,
579+
TBody = any
580+
>(
581+
req: Request<any, TQuery, TParams, TBody>
582+
): req is Request<ALBContext, TQuery, TParams, TBody>;

0 commit comments

Comments
 (0)