delta-sync
Version:
A lightweight framework for bi-directional database synchronization with automatic version tracking and conflict resolution.
14 lines (13 loc) • 678 B
TypeScript
import { DatabaseAdapter, SyncResponse, DataChange, AttachmentChange } from './types';
export declare class CloudCoordinator {
cloudAdapter: DatabaseAdapter;
readonly CHANGES_STORE = "cloud_synced_changes";
readonly ATTACHMENT_CHANGES_STORE = "cloud_attachment_changes";
constructor(cloudAdapter: DatabaseAdapter);
applyChanges(changes: DataChange[]): Promise<SyncResponse>;
applyAttachmentChanges(changes: AttachmentChange[]): Promise<SyncResponse>;
getAttachmentChanges(since: number): Promise<AttachmentChange[]>;
getPendingChanges(since: number): Promise<SyncResponse>;
private getErrorMessage;
getLatestVersion(): Promise<number>;
}