UNPKG

@midwayjs/faas

Version:

Midway Framework for FaaS (Function as a Service)

54 lines 2.81 kB
import { Context, IFaaSConfigurationOptions, Application, NextFunction, HandlerOptions, HttpResponseFormat, wrapHttpRequestOptions } from './interface'; import { BaseFramework, CommonMiddlewareUnion, ContextMiddlewareManager, FunctionMiddleware, IMidwayBootstrapOptions, RouterInfo } from '@midwayjs/core'; import { LoggerOptions } from '@midwayjs/logger'; import * as http from 'http'; export declare class MidwayFaaSFramework extends BaseFramework<Application, Context, IFaaSConfigurationOptions> { protected defaultHandlerMethod: string; protected funMappingStore: Map<string, RouterInfo>; protected logger: any; private lock; app: Application; private isReplaceLogger; private developmentRun; private server; private respond; private applicationAdapter; private serverlessFunctionService; protected httpMiddlewareManager: ContextMiddlewareManager<Context, unknown, unknown>; protected eventMiddlewareManager: ContextMiddlewareManager<Context, unknown, unknown>; private legacyVersion; private loadedFunction; configure(options: IFaaSConfigurationOptions): any; isEnable(): boolean; applicationInitialize(options: IMidwayBootstrapOptions): Promise<void>; run(): Promise<void>; loadFunction(): Promise<void>; /** * @deprecated * @param handlerMapping */ handleInvokeWrapper(handlerMapping: string): (...args: any[]) => Promise<any>; invokeTriggerFunction(context: any, handlerMapping: string, options: HandlerOptions): Promise<any>; formatHttpResponse(context: any, options?: { supportBufferResponse?: boolean; }): HttpResponseFormat; wrapHttpRequest(req: http.IncomingMessage | Record<string, any>, res?: http.ServerResponse | Record<string, any>, options?: wrapHttpRequestOptions): Promise<unknown>; /** * @deprecated * @param middlewareId */ generateMiddleware(middlewareId: string): Promise<FunctionMiddleware<Context, any>>; getContext(context?: any): any; private invokeHandler; protected getFunctionHandler(ctx: any, args: any, target: any, method: any): string; createLogger(name: string, option?: LoggerOptions): import("@midwayjs/logger").ILogger; getFrameworkName(): string; getServer(): http.Server<typeof http.IncomingMessage, typeof http.ServerResponse>; beforeStop(): Promise<void>; protected createHttpContext(req: any, res: any): Promise<unknown>; useMiddleware(middleware: CommonMiddlewareUnion<Context, NextFunction, undefined>): void; useEventMiddleware(middleware: CommonMiddlewareUnion<Context, NextFunction, undefined>): void; getEventMiddleware(): ContextMiddlewareManager<Context, NextFunction, undefined>; getAllHandlerNames(): string[]; } //# sourceMappingURL=framework.d.ts.map