import { RequestListener } from "http"; import { HapiListener } from "./handlers/hapiListener"; import * as apigw from "./types"; declare namespace handler { type APIGatewayEvent = apigw.APIGatewayEvent; type APIGatewayResponse = apigw.LambdaResponse; type LambdaResponse = apigw.LambdaResponse; type LambdaContext = apigw.LambdaContext; type APIGatewayEventHandler = (event: handler.APIGatewayEvent, context?: handler.LambdaContext) => Promise; } type PromiseFactory = () => Promise; interface Options { beforeDispatch?: (r: apigw.APIGatewayEvent) => Promise; beforeReturn?: (r: apigw.LambdaResponse) => Promise; onError?: (e: Error) => Promise; } declare const handler: { (app: RequestListener, options?: Options): handler.APIGatewayEventHandler; deferred: (appFn: PromiseFactory, options?: Options) => handler.APIGatewayEventHandler; HapiListener: typeof HapiListener; nestHandler: (nestApp: any) => Promise; fastifyHandler: (fastifyBuilder: (options: object) => any) => (options: object) => Promise; fastifyV4Handler: (app: any) => Promise; }; export = handler;