UNPKG

co-compose

Version:

AdonisJS and Koa style middleware layer with ability to run parallel middleware

23 lines (22 loc) 658 B
/** * An array of arguments + the next function */ export declare type MiddlewareArgs = any[]; /** * The middleware actual function */ export declare type MiddlewareFn = (...params: MiddlewareArgs) => Promise<void>; /** * Executor job is to execute one middleware function at a * time and pass arguments to it */ export declare type Executor = (fn: any, params: MiddlewareArgs) => Promise<void>; /** * Args received by the final handler */ export declare type FinalHandlerArgs = any[]; /** * Final handler is called when the entire chain executes * completely */ export declare type FinalHandler = (...params: FinalHandlerArgs) => Promise<void>;