bknd
Version:
Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, React Router, Astro, Cloudflare, Bun, Node, AWS Lambda & more.
18 lines (17 loc) • 732 B
TypeScript
import type { ICacheDriver } from "../../../core/drivers";
interface WorkersKVCacheOptions {
defaultTTL?: number;
cachePrefix?: string;
}
export declare class WorkersKVCacheDriver implements ICacheDriver {
protected readonly kv: KVNamespace;
protected readonly defaultTTL?: number;
protected readonly cachePrefix: string;
constructor(kv: KVNamespace, options?: WorkersKVCacheOptions);
protected getKey(key: string): string;
get(key: string): Promise<string | undefined>;
set(key: string, value: string, ttl?: number): Promise<void>;
del(key: string): Promise<void>;
}
export declare const cacheWorkersKV: (kv: KVNamespace, options?: WorkersKVCacheOptions) => WorkersKVCacheDriver;
export {};