import { t as CacheAdapter } from "../cache.adapter-z0MMDFoK.js"; //#region src/adapters/cloudflare-kv.adapter.d.ts /** * Minimal structurally-typed subset of Cloudflare's `KVNamespace`. * * Defined locally (instead of importing `@cloudflare/workers-types`) so the * adapter stays runtime-agnostic and imposes no type dependency on consumers. * Any real `KVNamespace` binding satisfies this interface. */ interface MinimalKVNamespace { get(key: string, type?: "text" | "json"): Promise; put(key: string, value: string, options?: { expirationTtl?: number; }): Promise; delete(key: string): Promise; list(options?: { prefix?: string; cursor?: string; }): Promise<{ keys: { name: string; }[]; cursor?: string; list_complete?: boolean; }>; } /** * Create a Cloudflare KV cache adapter for the subscriptions package * * Note: Cloudflare KV is eventually consistent. Writes may take up to ~60s * to propagate globally, so cached reads may briefly return stale data. * * @example * ```typescript * import { kvCacheAdapter } from '@abshahin/subscriptions/adapters/cloudflare-kv'; * * const subs = createSubscriptions({ * // ... * cache: kvCacheAdapter(env.SUBSCRIPTIONS_KV), * }); * ``` */ declare function kvCacheAdapter(namespace: MinimalKVNamespace): CacheAdapter; //#endregion export { MinimalKVNamespace, kvCacheAdapter }; //# sourceMappingURL=cloudflare-kv.adapter.d.ts.map