/** * DurableObjectAdapter - Cloudflare Durable Objects storage adapter * Optimized for stateful operations, coordination, and real-time features */ import { StatefulAdapter, StorageResult, PerformanceMetrics, AdapterConfig } from '../interfaces/storage-engine'; export interface DurableObjectConfig extends AdapterConfig { namespace: DurableObjectNamespace; defaultObjectId?: string; maxStateSize: number; hibernationTimeout: number; enablePersistence: boolean; coordinationMode: 'single' | 'distributed'; } export interface DurableObjectState { id: string; name?: string; data: any; version: number; lastModified: string; expires?: string; } export interface LockInfo { id: string; key: string; owner: string; acquiredAt: string; expiresAt: string; renewable: boolean; } export interface CoordinationEvent { type: 'state_change' | 'lock_acquired' | 'lock_released' | 'heartbeat'; objectId: string; data: any; timestamp: number; } export declare class DurableObjectAdapter implements StatefulAdapter { readonly backend = "durable_object"; private namespace; private config; private metrics; private objectCache; private eventListeners; constructor(config: DurableObjectConfig); initialize(): Promise; destroy(): Promise; health(): Promise; getMetrics(): Promise; getState(key: string): Promise>; setState(key: string, value: any): Promise>; deleteState(key: string): Promise>; listStates(prefix?: string): Promise>>; acquireLock(key: string, ttl?: number): Promise>; releaseLock(key: string, lockId: string): Promise>; atomicUpdate(key: string, updateFunction: (current: any) => any): Promise>; compareAndSwap(key: string, expected: any, newValue: any): Promise>; createEventStream(objectId: string): Promise>; broadcastEvent(event: CoordinationEvent): Promise>; buildVectorIndex(collection: string, dimensions: number, metric?: string): Promise>; addVectorToIndex(indexId: string, vectorId: string, vector: Float32Array): Promise>; searchVectorIndex(indexId: string, queryVector: Float32Array, k?: number): Promise>>; private getObjectStub; private getObjectIdForKey; private hashKey; private emitEvent; private updateMetrics; private createStorageError; private isRetryableError; on(eventType: string, listener: (event: CoordinationEvent) => void): void; off(eventType: string, listener: (event: CoordinationEvent) => void): void; } //# sourceMappingURL=durable-object-adapter.d.ts.map