@midwayjs/faas
Version:

58 lines • 3.06 kB
TypeScript
/// <reference types="node" />
import { Context, IFaaSConfigurationOptions, Application, NextFunction, HandlerOptions, HttpResponseFormat, wrapHttpRequestOptions } from './interface';
import { BaseFramework, CommonMiddlewareUnion, ContextMiddlewareManager, FunctionMiddleware, IMidwayBootstrapOptions, MidwayEnvironmentService, MidwayFrameworkType, MidwayMiddlewareService, 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;
environmentService: MidwayEnvironmentService;
middlewareService: MidwayMiddlewareService<Context, any>;
configure(options: IFaaSConfigurationOptions): any;
isEnable(): boolean;
applicationInitialize(options: IMidwayBootstrapOptions): Promise<void>;
run(): Promise<void>;
loadFunction(): Promise<void>;
getFrameworkType(): MidwayFrameworkType;
/**
* @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