import * as hono from 'hono'; import { Context } from 'hono'; import createFactory from 'ronin'; import { QueryHandlerOptions } from 'ronin/types'; type Factory = ReturnType; type Bindings = { RONIN_TOKEN: string; }; type Variables = { ronin: Factory; }; type Env = { Bindings: Bindings; Variables: Variables; }; interface Options extends QueryHandlerOptions { } /** * Create a Hono middleware that injects a RONIN client into the Hono context variables. * * @param options - An optional object that can be used to configure the RONIN client. * * @example .env * ```bash * RONIN_TOKEN=your-ronin-token * ``` * * @example * ```ts * import { Hono } from 'hono'; * import { ronin, type Bindings, type Variables } from '@ronin/hono'; * * const app = new Hono() * .use('*', ronin()) * .get('/', async (c) => { * const posts = await c.var.ronin.get.posts(); * return c.json(posts); * }); * ``` * * @returns A Hono middleware. */ declare const ronin: (options?: Options | ((context: Context) => Options)) => hono.MiddlewareHandler; export { type Bindings, type Variables, ronin };