@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.
54 lines (51 loc) • 2.06 kB
TypeScript
import { Context } from '@azure/functions';
import { B as BinarySettings, S as ServerlessHandler } from '../../handler.contract-Ckhqvom_.js';
import { A as AdapterContract, R as ResolverContract } from '../../adapter.contract-FnS-TPRj.js';
import { F as FrameworkContract } from '../../framework.contract-td-lRvq6.js';
import { I as ILogger } from '../../logger-F8qccesk.js';
import { DefaultHandler } from '../default/index.js';
import '../../headers-DjfGHDmI.js';
import 'http';
import 'node:http';
import '../../base-handler-DTcqjFpI.js';
import '../../request-DI51fiy-.js';
/**
* The options to customize {@link AzureHandler}
*
* @breadcrumb Handlers / AzureHandler
* @public
*/
interface AzureHandlerOptions {
/**
* Indicates to use the context log instead console.log when logger is internal (created by the library)
*
* @defaultValue true
*/
useContextLogWhenInternalLogger: boolean;
}
/**
* The class that implements a serverless handler for Azure Function.
*
* When you don't specify a custom logger, the {@link Context} logger is used instead.
*
* @breadcrumb Handlers / AzureHandler
* @public
*/
declare class AzureHandler<TApp, TEvent, TCallback, TResponse, TReturn> extends DefaultHandler<TApp, TEvent, Context, TCallback, TResponse, TReturn> {
protected readonly options?: AzureHandlerOptions | undefined;
/**
* Default Constructor
*/
constructor(options?: AzureHandlerOptions | undefined);
/**
* {@inheritDoc}
*/
getHandler(app: TApp, framework: FrameworkContract<TApp>, adapters: AdapterContract<TEvent, Context, TResponse>[], resolverFactory: ResolverContract<TEvent, Context, TCallback, TResponse, TReturn>, binarySettings: BinarySettings, respondWithErrors: boolean, log: ILogger): ServerlessHandler<TReturn>;
/**
* Get the {@link ILogger} instance from logger of the context
*
* @param context - The Azure Context
*/
protected createLoggerFromContext(context: Context): ILogger;
}
export { AzureHandler, type AzureHandlerOptions };