import type { WireContext, WireMiddleware } from './host.js'; /** * Koa-style middleware composer. Returns a dispatcher that runs every * middleware and then `terminator` (the "real" wire send/receive). If any * middleware does not call `next`, the frame is dropped and `terminator` * never runs. * * Throws if `next` is called more than once within the same middleware (Koa * semantics), which catches a common middleware bug. */ export declare function composeWireMiddleware(middlewares: WireMiddleware[], terminator: (ctx: WireContext) => void | Promise): (ctx: WireContext) => Promise; /** Normalize host.wireMiddleware (single fn / array / undefined) into an array. */ export declare function normalizeWireMiddleware(value: WireMiddleware | WireMiddleware[] | undefined): WireMiddleware[];