@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.
60 lines (56 loc) • 2.32 kB
TypeScript
import { HttpsFunction } from 'firebase-functions/v1';
import { F as FrameworkContract } from '../../framework.contract-td-lRvq6.js';
import { H as HandlerContract } from '../../handler.contract-Ckhqvom_.js';
import { R as RawRequest } from '../../raw-request-CoVOqVRW.js';
import { IncomingMessage, ServerResponse } from 'node:http';
import { https } from 'firebase-functions/v2';
import 'http';
import '../../adapter.contract-FnS-TPRj.js';
import '../../headers-DjfGHDmI.js';
import '../../logger-F8qccesk.js';
import '../../request-DI51fiy-.js';
/**
* The class that implements a handler for Firebase Https Events
*
* @remarks Read more about Https Events {@link https://firebase.google.com/docs/functions/http-events | here}
*
* @breadcrumb Handlers / HttpFirebaseHandler
* @public
*/
declare class HttpFirebaseHandler<TApp> extends RawRequest<TApp> implements HandlerContract<TApp, never, never, never, void, void | Promise<void>> {
/**
* {@inheritDoc}
*/
getHandler(app: TApp, framework: FrameworkContract<TApp>): HttpsFunction;
}
/**
* The HTTP handler that is exposed when you use {@link HttpFirebaseV2Handler}.
*
* @breadcrumb Handlers / HttpFirebaseHandler
* @public
*/
type FirebaseHttpHandler = (request: IncomingMessage, response: ServerResponse) => void | Promise<void>;
/**
* The class that implements a handler for Firebase Https Events
*
* @remarks Read more about Https Events {@link https://firebase.google.com/docs/functions/http-events | here}
*
* @breadcrumb Handlers / HttpFirebaseHandler
* @public
*/
declare class HttpFirebaseV2Handler<TApp> extends RawRequest<TApp> implements HandlerContract<TApp, never, never, never, void, void | Promise<void>> {
protected readonly options?: https.HttpsOptions | undefined;
/**
* Construtor padrão
*/
constructor(options?: https.HttpsOptions | undefined);
/**
* {@inheritDoc}
*/
getHandler(app: TApp, framework: FrameworkContract<TApp>): FirebaseHttpHandler;
/**
* Wrapper method around onRequest for better testability
*/
protected onRequestWithOptions(options: https.HttpsOptions, callback: ReturnType<HttpFirebaseV2Handler<TApp>['onRequestCallback']>): FirebaseHttpHandler;
}
export { type FirebaseHttpHandler, HttpFirebaseHandler, HttpFirebaseV2Handler };