@napp/api-server
Version:
Rest full api. Server
32 lines • 1.13 kB
TypeScript
import { AInterface, METHOD } from "@napp/api-core";
import { IValidation, IMiddleware, IAction, IErrorHandle } from "./common";
import { AModule } from "./module";
import { OAPIHandler } from "./action.common";
export declare class AHandler<REQ, RES> {
private meta;
private opt;
constructor(meta: AInterface<REQ, RES>, opt: OAPIHandler<REQ, RES>);
getOptions(): {
meta: AInterface<REQ, RES>;
befores: IMiddleware[];
validation: IValidation<REQ> | undefined;
action: IAction<REQ, RES>;
};
}
export declare class AHandlerWrap<REQ, RES> {
private module;
private meta;
private _validation?;
private _action;
private _befores;
constructor(module: AModule, handler: AHandler<REQ, RES>);
get name(): string;
get path(): string;
get method(): METHOD;
getBefores(): IMiddleware[];
private buildReqParam;
response(actionResult: any, req: any, res: any): Promise<any>;
action(req: any, res: any, next: any, errorHandle?: IErrorHandle): void;
private doAction;
}
//# sourceMappingURL=action.d.ts.map