import { EventEmitter } from '../utils/EventEmitter'; import { GunDataProvider } from '../data/GunDataProvider'; import { SyncStatus, SyncPriority, SchemaDefinition } from '../Types'; import { DistributedState } from '../data/DistributedState'; export declare class SyncManager extends EventEmitter { private gunDataProvider; private syncStatus; private logger; private errorHandler; private distributedStates; private syncQueue; private isSyncing; private maxRetries; constructor(gunDataProvider: GunDataProvider); /** * Starts synchronization for a given path * @param path The path to synchronize * @param priority The priority of the sync operation */ startSync(path: string, priority?: SyncPriority): void; /** * Stops synchronization for a given path * @param path The path to stop synchronizing */ stopSync(path: string): void; getSyncedPaths(): string[]; /** * Gets the sync status for a given path * @param path The path to get the status for * @returns The sync status or undefined if not found */ getSyncStatus(path: string): SyncStatus | undefined; /** * Gets the distributed state for a given path * @param path The path to get the state for * @returns The distributed state or null if not found */ getDistributedState(path: string): DistributedState | null; /** * Handles updates from the GunDataProvider * @param path The path that was updated * @param data The updated data */ private handleUpdate; /** * Processes the sync queue */ private processSyncQueue; /** * Processes pending changes for a given path * @param path The path to process changes for */ private processPendingChanges; fetchStateFromPeers(path: string): Promise; syncState(path: string, schema: SchemaDefinition): DistributedState; persistState(path: string, schema: SchemaDefinition): DistributedState; loadPersistedState(path: string): Promise; /** * Forces synchronization for all paths */ forceSyncAll(): Promise; /** * Forces synchronization for a given path * @param path The path to force sync */ forceSync(path: string): Promise; /** * Gets the total count of pending changes across all paths * @returns The total count of pending changes */ getPendingChangesCount(): number; /** * Checks if any sync operation is in progress * @returns True if any sync is in progress, false otherwise */ isSyncInProgress(): boolean; /** * Pauses synchronization for a given path * @param path The path to pause synchronization for */ pauseSync(path: string): void; /** * Resumes synchronization for a given path * @param path The path to resume synchronization for */ resumeSync(path: string): void; stop(): void; }