import { CoValueCore, RawCoID, type SessionID, type StorageAPI } from "../exports.js"; import { NewContentMessage, type PeerID } from "../sync.js"; import { StorageKnownState } from "./knownState.js"; import { CoValueKnownState } from "../knownState.js"; import type { CorrectionCallback, DBClientInterfaceSync, StorageReconciliationAcquireResult } from "./types.js"; import { StorageStreamingQueue } from "../queue/StorageStreamingQueue.js"; export declare class StorageApiSync implements StorageAPI { private readonly dbClient; private deletedCoValuesEraserScheduler; /** * Keeps track of CoValues that are in memory, to avoid reloading them from storage * when it isn't necessary */ private inMemoryCoValues; /** * Queue for streaming content that will be pulled by SyncManager. * Only used when content requires streaming (multiple chunks). */ readonly streamingQueue: StorageStreamingQueue; constructor(dbClient: DBClientInterfaceSync); knownStates: StorageKnownState; getKnownState(id: string): CoValueKnownState; getCoValueIDs(limit: number, offset: number, callback: (batch: { id: RawCoID; }[]) => void): void; getCoValueCount(callback: (count: number) => void): void; tryAcquireStorageReconciliationLock(sessionId: SessionID, peerId: PeerID, callback: (result: StorageReconciliationAcquireResult) => void): void; renewStorageReconciliationLock(sessionId: SessionID, peerId: PeerID, offset: number): void; releaseStorageReconciliationLock(sessionId: SessionID, peerId: PeerID): void; loadKnownState(id: string, callback: (knownState: CoValueKnownState | undefined) => void): void; load(id: string, callback: (data: NewContentMessage) => void, done: (found: boolean) => void): Promise; loadCoValue(id: string, callback: (data: NewContentMessage) => void, done?: (found: boolean) => void): void; private loadSessionTransactions; private pushContentWithDependencies; store(msg: NewContentMessage, correctionCallback: CorrectionCallback, done?: () => void): boolean; /** * This function is called when the storage lacks the information required to store the incoming content. * * It triggers a `correctionCallback` to ask the syncManager to provide the missing information. */ private handleCorrection; private storeSingle; private putNewTxs; deletedValues: Set<`co_z${string}`>; markDeleteAsValid(id: RawCoID): void; eraseAllDeletedCoValues(): Promise; enableDeletedCoValuesErasure(): void; private eraseDeletedCoValuesOnceBudgeted; waitForSync(id: string, coValue: CoValueCore): Promise; trackCoValuesSyncState(updates: { id: RawCoID; peerId: PeerID; synced: boolean; }[], done?: () => void): void; getUnsyncedCoValueIDs(callback: (unsyncedCoValueIDs: RawCoID[]) => void): void; stopTrackingSyncState(id: RawCoID): void; onCoValueUnmounted(id: RawCoID): void; close(): undefined; } //# sourceMappingURL=storageSync.d.ts.map