/** * Koa Middleware * * HTTP request middleware for Koa that uses the core handler. * * @module */ import type { Context, Next } from 'koa'; import type { Bridge } from '@johnhenry/aimatey-core'; import type { HTTPListenerOptions } from '@johnhenry/aimatey-http-core'; /** * Create Koa middleware for handling AI chat requests * * @param bridge - Bridge instance * @param options - HTTP listener options * @returns Koa middleware function * * @example * ```typescript * import Koa from 'koa'; * import bodyParser from 'koa-bodyparser'; * import { KoaMiddleware } from '@johnhenry/aimatey-http/koa'; * * const app = new Koa(); * const bridge = new Bridge(frontend, backend); * * // Use body parser middleware first * app.use(bodyParser()); * * // Add AI chat middleware * app.use(KoaMiddleware(bridge, { * cors: true, * streaming: true, * })); * * app.listen(3000); * ``` */ export declare function KoaMiddleware(bridge: Bridge, options?: HTTPListenerOptions): (ctx: Context, next: Next) => Promise; //# sourceMappingURL=middleware.d.ts.map