import type { Context, MiddlewareHandler } from 'hono'; import type { Memorize } from '../domain/Memorize'; export interface HonoCallOptions { /** Time-to-live in milliseconds. Defaults to the global TTL. */ ttl?: number; /** Skip caching for this route. Sets `X-Cache: BYPASS`. */ noCache?: boolean; /** Custom cache key extractor. Defaults to `c.req.url`. */ key?: (c: Context) => string; /** Invalidation tags attached to every cached entry. See `deleteByTag`. */ tags?: string[]; } /** * Creates a Hono middleware that caches `GET` responses with a `2xx` status code. * * Requires `hono` to be installed as a peer dependency. * * @param cache - The {@link Memorize} instance to use as the backing store. * @param options - Optional per-route options. * * @example * ```ts * import { Hono } from 'hono'; * import { memorize } from 'express-memorize'; * import { createHonoMiddleware } from 'express-memorize/hono'; * * const app = new Hono(); * const cache = memorize({ ttl: 30_000 }); * * app.get('/users', createHonoMiddleware(cache), async (c) => { * return c.json(await usersService.findAll()); * }); * ``` */ export declare function createHonoMiddleware(cache: Memorize, options?: HonoCallOptions): MiddlewareHandler; //# sourceMappingURL=hono.d.ts.map