/** * Next function supports optional `ctx` replacement for following middleware. */ export declare type Next = () => Promise; /** * Middleware function pattern. */ export declare type Middleware = (ctx: T, next: Next) => U | Promise; /** * Final function has no `next()`. */ export declare type Done = (ctx: T) => U | Promise; /** * Composed function signature. */ export declare type Composed = (ctx: T, done: Done) => Promise; /** * Production-mode middleware composition (no errors thrown). */ declare function composeMiddleware(middleware: Array>): Composed; /** * Compose an array of middleware functions into a single function. */ export declare const compose: typeof composeMiddleware; export {};