import type { APIGatewayEventRequestContextV2WithAuthorizer, APIGatewayEventRequestContextWithAuthorizer, APIGatewayProxyCallback, APIGatewayProxyCallbackV2, Callback, Context } from 'aws-lambda'; import { AuthorizerContext } from './authorizerContext'; import { BodyType, CustomRequestContextType, HeadersType, OutputType, PathParametersType, QueryStringParametersType } from './common'; import { ApiGatewayAuthorizerType, ApiGatewayIntegrationType } from './constants'; import { DefinedProperties } from './utils'; import { GenericApiGatewayContract } from '../apiGatewayContract'; export type RequestContext = (IntegrationType extends 'restApi' ? APIGatewayEventRequestContextWithAuthorizer> : APIGatewayEventRequestContextV2WithAuthorizer>) & (CustomRequestContext extends undefined ? unknown : CustomRequestContext); export type HandlerEventType = DefinedProperties<{ requestContext: RequestContext; pathParameters: PathParameters; queryStringParameters: QueryStringParameters; headers: Headers; body: Body; }>; /** * The type of the event passed as first argument to a Swarmion handler, * The handler function can define additional arguments. */ export type SwarmionApiGatewayEvent, QueryStringParameters = QueryStringParametersType, Headers = HeadersType, CustomRequestContext = CustomRequestContextType, Body = BodyType> = HandlerEventType; export type HandlerCallback = IntegrationType extends 'restApi' ? APIGatewayProxyCallback : APIGatewayProxyCallbackV2; /** * The type of output of a Swarmion handler, */ export type SwarmionApiGatewayOutput = OutputType; /** * The **internal** type of a Swarmion handler, with type-inferred event * The handler function can define additional arguments. * * For external use, prefer `SwarmionApiGatewayHandler` */ export type InternalSwarmionApiGatewayHandler> = (event: Event, context: Context, callback?: Callback, ...additionalArgs: AdditionalArgs) => Promise; /** * The type of a Swarmion handler, with type-inferred event * The handler function can define additional arguments. */ export type SwarmionApiGatewayHandler, QueryStringParameters = QueryStringParametersType, Headers = HeadersType, CustomRequestContext = CustomRequestContextType, Body = BodyType, Output = OutputType> = InternalSwarmionApiGatewayHandler; //# sourceMappingURL=lambdaHandler.d.ts.map