Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
naorpeled committed Feb 8, 2025
1 parent 03f3c29 commit 56e4ce4
Show file tree
Hide file tree
Showing 2 changed files with 370 additions and 61 deletions.
52 changes: 52 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,3 +528,55 @@ export declare function isApiGatewayV2Context(
export declare function isAlbContext(
context: RequestContext
): context is ALBContext;

export declare function isApiGatewayEvent(
event: Event
): event is APIGatewayProxyEvent;

export declare function isApiGatewayV2Event(
event: Event
): event is APIGatewayProxyEventV2;

export declare function isAlbEvent(event: Event): event is ALBEvent;

export declare function isApiGatewayRequest<
TQuery extends Record<string, string | undefined> = Record<
string,
string | undefined
>,
TParams extends Record<string, string | undefined> = Record<
string,
string | undefined
>,
TBody = any
>(
req: Request<any, TQuery, TParams, TBody>
): req is Request<APIGatewayContext, TQuery, TParams, TBody>;

export declare function isApiGatewayV2Request<
TQuery extends Record<string, string | undefined> = Record<
string,
string | undefined
>,
TParams extends Record<string, string | undefined> = Record<
string,
string | undefined
>,
TBody = any
>(
req: Request<any, TQuery, TParams, TBody>
): req is Request<APIGatewayV2Context, TQuery, TParams, TBody>;

export declare function isAlbRequest<
TQuery extends Record<string, string | undefined> = Record<
string,
string | undefined
>,
TParams extends Record<string, string | undefined> = Record<
string,
string | undefined
>,
TBody = any
>(
req: Request<any, TQuery, TParams, TBody>
): req is Request<ALBContext, TQuery, TParams, TBody>;
Loading

0 comments on commit 56e4ce4

Please sign in to comment.