import type { HttpContext } from "../server/http-context"; import type { HttpMiddleware } from "./middleware-definition"; /** * Composes middleware stack using a Koa-style `next()` chain. * Throws when `next()` is called multiple times in the same middleware. */ export declare function compose(middlewares: HttpMiddleware[], handler: (ctx: HttpContext) => T | Promise): (ctx: HttpContext) => Promise;