import { type CoValueCore, type RawCoID, type SessionID, type StorageAPI } from "../exports.js"; import { StoreQueue } from "../queue/StoreQueue.js"; import { NewContentMessage, type PeerID } from "../sync.js"; import { CoValueKnownState } from "../knownState.js"; import { StorageKnownState } from "./knownState.js"; import type { CorrectionCallback, DBClientInterfaceAsync, StorageReconciliationAcquireResult } from "./types.js"; export declare class StorageApiAsync implements StorageAPI { private readonly dbClient; private deletedCoValuesEraserScheduler; private eraserController; /** * Keeps track of CoValues that are in memory, to avoid reloading them from storage * when it isn't necessary */ private inMemoryCoValues; private pendingKnownStateLoads; constructor(dbClient: DBClientInterfaceAsync); knownStates: StorageKnownState; getKnownState(id: string): CoValueKnownState; 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): Promise; private pushContentWithDependencies; storeQueue: StoreQueue; store(msg: NewContentMessage, correctionCallback: CorrectionCallback, done?: () => void): Promise; private interruptEraser; eraseAllDeletedCoValues(): Promise; /** * 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. * * The correction is applied immediately, to ensure that, when applicable, the dependent content in the queue won't require additional corrections. */ private handleCorrection; private storeSingle; private putNewTxs; deletedValues: Set<`co_z${string}`>; markDeleteAsValid(id: RawCoID): void; enableDeletedCoValuesErasure(): void; waitForSync(id: string, coValue: CoValueCore): Promise; trackCoValuesSyncState(updates: { id: RawCoID; peerId: PeerID; synced: boolean; }[], done?: () => void): void; 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; getUnsyncedCoValueIDs(callback: (unsyncedCoValueIDs: RawCoID[]) => void): void; stopTrackingSyncState(id: RawCoID): void; onCoValueUnmounted(id: RawCoID): void; close(): Promise | undefined; } //# sourceMappingURL=storageAsync.d.ts.map