/** * Single-mount adapter. Mount once via `app.express.use(createExpressAdapter(registry, app))`. * Dispatches each request through the registry: match → walk middlewares → call handler. * * Middleware instances are cached by `MiddlewareEntry` identity (WeakMap) * — each entry is constructed once on first request and reused thereafter. */ import type { NextFunction, Request, Response } from 'express'; import type { IApp } from '../../../server.ts'; import type { ResponseWriter } from '../ResponseWriter.ts'; import type { RouteRegistry } from './RouteRegistry.ts'; /** @internal A failure for `next`: a falsy one would fall through to the 404. */ export declare function failure(reason: unknown): unknown; export type ExpressAdapter = (req: Request, res: Response, next: NextFunction) => Promise; export declare function createExpressAdapter(registry: RouteRegistry, app: IApp, writer?: ResponseWriter): ExpressAdapter;