UNPKG

@dataql/react-native

Version:

DataQL React Native SDK with offline-first capabilities and clean API

29 lines (28 loc) 1.09 kB
import { OfflineCacheManager } from "../cache/OfflineCacheManager"; import type { SyncConfig, SyncEvent, SyncEventType } from "../types"; export declare class SyncManager { private cacheManager; private config; private syncInterval?; private eventListeners; private isOnline; private isSyncing; constructor(cacheManager: OfflineCacheManager, config: SyncConfig); private setupNetworkListener; private handleOnline; private handleOffline; startAutoSync(): void; stopAutoSync(): void; private fetchWithConnectionOrFallback; syncNow(): Promise<boolean>; private syncOperation; addEventListener(eventType: SyncEventType, listener: (event: SyncEvent) => void): void; removeEventListener(eventType: SyncEventType, listener: (event: SyncEvent) => void): void; private emitEvent; fetchFromServer<T>(tableName: string, params?: any): Promise<T[]>; getConfig(): SyncConfig; updateConfig(newConfig: Partial<SyncConfig>): void; isSyncInProgress(): boolean; getOnlineStatus(): boolean; destroy(): void; }