import type { APIGatewayEvent, APIGatewayEventRequestContextWithAuthorizer, AttributeValue, Context as LambdaContext, DynamoDBRecord, DynamoDBStreamEvent, EventBridgeEvent, S3Event, SNSEvent, SQSEvent } from "@webiny/aws-sdk/types/index.js"; import "fastify"; import type { CreateHandlerParams as BaseCreateHandlerParams } from "@webiny/handler"; import type { LambdaFastifyOptions as LambdaOptions } from "@fastify/aws-lambda"; import type { GenericRecord } from "@webiny/utils"; export type { AttributeValue, DynamoDBRecord }; export type { HandlerRegistry } from "./registry.js"; export * from "@webiny/handler/types.js"; export type { APIGatewayEvent, LambdaContext, APIGatewayEventRequestContextWithAuthorizer }; export type HandlerEvent = APIGatewayEvent | SNSEvent | SQSEvent | S3Event | EventBridgeEvent | DynamoDBStreamEvent | GenericRecord; export interface EventResolver { (event: HandlerEvent, context: LambdaContext): T; } export interface HandlerFactoryParams extends BaseCreateHandlerParams { lambdaOptions?: LambdaOptions; } export interface HandlerFactory { (params: T): EventResolver; } export interface HandlerParams { params: P; event: E; context: LambdaContext; } export interface SourceHandler { name: string; canUse: (event: Partial, context: LambdaContext) => boolean; handle: (params: HandlerParams) => Promise; } export declare enum Base64EncodeHeader { encoded = "x-webiny-base64-encoded", binary = "x-webiny-binary" } declare module "fastify" { interface FastifyRequest { awsLambda: { event: APIGatewayEvent; context: LambdaContext; }; } }