import type { CacheOptions, CacheHandle } from '../types.js'; /** * Creates a TTL-based cache policy that memoizes the result of the wrapped * async operation. Supports stale-while-revalidate for background refresh. * * Returns an object with `execute` (the policy function) and `handle` * (an interface to inspect / invalidate the cache). * * @example * ```ts * const c = cache({ ttl: 10_000 }); * const result = await c.execute(() => callApi()); * ``` */ export declare function cache(options?: CacheOptions): { execute: (fn: () => Promise) => Promise; handle: CacheHandle; }; //# sourceMappingURL=cache.d.ts.map