export type MiddlewareHandler = (context: TContext, next: () => Promise) => Response | Promise; /** * Runs an onion middleware chain and invokes the terminal handler when the chain completes. */ export declare function runMiddlewareChain(middleware: readonly MiddlewareHandler[], context: TContext, terminal: () => Promise): Promise;