import type { CachedEntry, CacheLike } from "./types.js"; /** * Encode cache keys/tags to be safe for HTTP headers (used by Vercel cache tags). * HTTP headers only allow ASCII printable characters (0x20-0x7E), excluding certain chars. * We use percent-encoding for non-ASCII and problematic characters, keeping ASCII readable. * @internal Exported for testing */ export declare function encodeCacheKey(path: string): string; /** Error handler function type for KVCache error logging */ export type ErrorHandler = (message: string, error: unknown) => void; export interface KVCacheOptions { ttl: number; /** Optional cache implementation for testing */ cache?: CacheLike; /** Optional error handler for testing (defaults to console.error) */ onError?: ErrorHandler; } export declare class KVCache { private ttl; private useProxy; private useMemory; private injectedCache; private errorHandler; constructor(options: KVCacheOptions | number); private getCache; private getCacheKey; private getCacheTag; private sleep; get(path: string): Promise | null>; set(path: string, entry: CachedEntry): Promise; invalidate(path: string): Promise; } //# sourceMappingURL=cache.d.ts.map