UNPKG

@h4ad/serverless-adapter

Version:

Run REST APIs and other web applications using your existing Node.js application framework (NestJS, Express, Koa, Hapi, Fastify and many others), on top of AWS, Azure, Digital Ocean and many other clouds.

30 lines (27 loc) 1.24 kB
import { R as ResolverContract, b as ResolverProps, c as Resolver } from '../../adapter.contract-Cp2Jsh5V.cjs'; import '../../headers-DjfGHDmI.cjs'; import 'http'; import 'node:http'; import '../../logger-F8qccesk.cjs'; /** * The default signature of the callback sent by serverless * * @breadcrumb Resolvers / CallbackResolver * @public */ type ServerlessCallback<TResponse> = (error: Error | null, success: TResponse | null) => void; /** * The class that implements the resolver using the callback function sent by serverless * * @remarks To use this resolver on AWS, you MUST leave `{@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html | callbackWaitsForEmptyEventLoop}` as true, otherwise, AWS will not wait for this resolver to resolve. * * @breadcrumb Resolvers / CallbackResolver * @public */ declare class CallbackResolver<TEvent, TContext, TResponse> implements ResolverContract<TEvent, TContext, ServerlessCallback<any>, TResponse, void> { /** * {@inheritDoc} */ createResolver({ callback, event, log, respondWithErrors, adapter, }: ResolverProps<TEvent, TContext, ServerlessCallback<any>, TResponse>): Resolver<any, void>; } export { CallbackResolver, type ServerlessCallback };