/// import Cors from "@koa/cors"; import { ActionResult, Application, BodyParserOption, Class, Configuration, Facility, Invocation, KoaMiddleware, Middleware, PlumierApplication, PlumierConfiguration, RouteInfo } from "@plumjs/core"; import Koa, { Context } from "koa"; export declare function extractDecorators(route: RouteInfo): Middleware[]; export declare class MiddlewareInvocation implements Invocation { private middleware; context: Context; private next; constructor(middleware: Middleware, context: Context, next: Invocation); proceed(): Promise; } export declare class ActionInvocation implements Invocation { context: Context; constructor(context: Context); proceed(): Promise; } export declare function pipe(middleware: Middleware[], context: Context, invocation: Invocation): Invocation; /** * Preset configuration for building web api. This facility contains: * * body parser: koa-bodyparser * * cors: @koa/cors */ export declare class WebApiFacility implements Facility { private opt?; constructor(opt?: { controller?: string | Class | Class[] | undefined; bodyParser?: BodyParserOption | undefined; cors?: Cors.Options | undefined; } | undefined); setup(app: Readonly): Promise; } /** * Preset configuration for building restful style api. This facility contains: * * body parser: koa-bodyparser * * cors: @koa/cors * * default response status: { get: 200, post: 201, put: 204, delete: 204 } */ export declare class RestfulApiFacility extends WebApiFacility { setup(app: Readonly): Promise; } export declare class Plumier implements PlumierApplication { readonly config: Readonly; readonly koa: Koa; constructor(); use(option: KoaMiddleware): Application; use(option: Middleware): Application; set(facility: Facility): Application; set(config: Partial): Application; initialize(): Promise; }