Some ignored filles was missing
This commit is contained in:
parent
7db22245e2
commit
fd5ab6bc0d
268 changed files with 31970 additions and 4 deletions
78
wwwroot/js/workers/SyncManager.d.ts
vendored
Normal file
78
wwwroot/js/workers/SyncManager.d.ts
vendored
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
import { IEventBus } from '../types/CalendarTypes';
|
||||
import { OperationQueue } from '../storage/OperationQueue';
|
||||
import { IndexedDBService } from '../storage/IndexedDBService';
|
||||
import { ApiEventRepository } from '../repositories/ApiEventRepository';
|
||||
/**
|
||||
* SyncManager - Background sync worker
|
||||
* Processes operation queue and syncs with API when online
|
||||
*
|
||||
* Features:
|
||||
* - Monitors online/offline status
|
||||
* - Processes queue with FIFO order
|
||||
* - Exponential backoff retry logic
|
||||
* - Updates syncStatus in IndexedDB after successful sync
|
||||
* - Emits sync events for UI feedback
|
||||
*/
|
||||
export declare class SyncManager {
|
||||
private eventBus;
|
||||
private queue;
|
||||
private indexedDB;
|
||||
private apiRepository;
|
||||
private isOnline;
|
||||
private isSyncing;
|
||||
private syncInterval;
|
||||
private maxRetries;
|
||||
private intervalId;
|
||||
constructor(eventBus: IEventBus, queue: OperationQueue, indexedDB: IndexedDBService, apiRepository: ApiEventRepository);
|
||||
/**
|
||||
* Setup online/offline event listeners
|
||||
*/
|
||||
private setupNetworkListeners;
|
||||
/**
|
||||
* Start background sync worker
|
||||
*/
|
||||
startSync(): void;
|
||||
/**
|
||||
* Stop background sync worker
|
||||
*/
|
||||
stopSync(): void;
|
||||
/**
|
||||
* Process operation queue
|
||||
* Sends pending operations to API
|
||||
*/
|
||||
private processQueue;
|
||||
/**
|
||||
* Process a single operation
|
||||
*/
|
||||
private processOperation;
|
||||
/**
|
||||
* Mark event as synced in IndexedDB
|
||||
*/
|
||||
private markEventAsSynced;
|
||||
/**
|
||||
* Mark event as error in IndexedDB
|
||||
*/
|
||||
private markEventAsError;
|
||||
/**
|
||||
* Calculate exponential backoff delay
|
||||
* @param retryCount Current retry count
|
||||
* @returns Delay in milliseconds
|
||||
*/
|
||||
private calculateBackoff;
|
||||
/**
|
||||
* Manually trigger sync (for testing or manual sync button)
|
||||
*/
|
||||
triggerManualSync(): Promise<void>;
|
||||
/**
|
||||
* Get current sync status
|
||||
*/
|
||||
getSyncStatus(): {
|
||||
isOnline: boolean;
|
||||
isSyncing: boolean;
|
||||
isRunning: boolean;
|
||||
};
|
||||
/**
|
||||
* Cleanup - stop sync and remove listeners
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue