/** * KVAdapter - Cloudflare KV storage adapter * Optimized for document storage, caching, and warm tier data */ import { KeyValueAdapter, StorageResult, PerformanceMetrics, AdapterConfig, Document, DocumentQuery } from '../interfaces/storage-engine'; export interface KVConfig extends AdapterConfig { namespace: KVNamespace; defaultTTL: number; compressionThreshold: number; compressionAlgorithm: 'gzip' | 'brotli'; cacheTTL: number; maxKeySize: number; maxValueSize: number; } export interface KVDocument { document: Document; metadata: { compressed: boolean; size: number; createdAt: string; updatedAt: string; version: number; }; } export declare class KVAdapter implements KeyValueAdapter { readonly backend = "kv"; private kv; private config; private metrics; private compressionCache; constructor(config: KVConfig); initialize(): Promise; destroy(): Promise; health(): Promise; getMetrics(): Promise; put(key: string, value: any, options?: { ttl?: number; metadata?: Record; }): Promise>; get(key: string): Promise; }>>; delete(key: string): Promise>; list(prefix?: string, limit?: number): Promise>>; putDocument(collection: string, document: Document): Promise>; getDocument(collection: string, id: string): Promise>; deleteDocument(collection: string, id: string): Promise>; findDocuments(collection: string, query: DocumentQuery): Promise>; putCache(key: string, value: any, ttl?: number): Promise>; getCache(key: string): Promise>; deleteCache(key: string): Promise>; putMany(items: Array<{ key: string; value: any; options?: any; }>): Promise>; private getDocumentKey; private validateKey; private validateValueSize; private serializeValue; private deserializeValue; private compressValue; private decompressValue; private matchesFilter; private getNestedValue; private sortDocuments; private updateMetrics; private createStorageError; private isRetryableError; } //# sourceMappingURL=kv-adapter.d.ts.map