import { type SyncPair, type SyncMessage, type SyncMode } from "./types"; import Sync from "./lib/sync"; import FilenSDK, { type FilenSDKConfig } from "@filen/sdk"; import { Semaphore } from "./semaphore"; import Logger from "./lib/logger"; /** * SyncWorker * @date 2/23/2024 - 5:50:56 AM * * @export * @class SyncWorker * @typedef {SyncWorker} */ export declare class SyncWorker { readonly syncPairs: SyncPair[]; readonly syncs: Record; readonly dbPath: string; readonly updateSyncPairsMutex: Semaphore; readonly sdk: FilenSDK; readonly logger: Logger; readonly runOnce: boolean; constructor({ syncPairs, dbPath, sdkConfig, onMessage, runOnce, sdk, disableLogging }: { syncPairs: SyncPair[]; dbPath: string; sdkConfig?: FilenSDKConfig; onMessage?: (message: SyncMessage) => void; runOnce?: boolean; sdk?: FilenSDK; disableLogging?: boolean; }); resetCache(uuid: string): void; resetTaskErrors(uuid: string): void; resetLocalTreeErrors(uuid: string): void; toggleLocalTrash(uuid: string, enabled: boolean): void; /** * Update sync pairs. * * @public * @async * @param {SyncPair[]} pairs * @returns {Promise} */ updateSyncPairs(pairs: SyncPair[]): Promise; updatePaused(uuid: string, paused: boolean): void; updateRemoved(uuid: string, removed: boolean): Promise; updateExcludeDotFiles(uuid: string, excludeDotFiles: boolean): void; updateMode(uuid: string, mode: SyncMode): void; updateIgnorerContent(uuid: string, content?: string): Promise; updateRequireConfirmationOnLargeDeletion(uuid: string, requireConfirmationOnLargeDeletion: boolean): void; fetchIgnorerContent(uuid: string): Promise; stopTransfer(uuid: string, type: "download" | "upload", relativePath: string): void; pauseTransfer(uuid: string, type: "download" | "upload", relativePath: string): void; resumeTransfer(uuid: string, type: "download" | "upload", relativePath: string): void; confirmDeletion(uuid: string, result: "delete" | "restart"): void; /** * Initialize the Sync worker. * @date 2/23/2024 - 5:51:12 AM * * @public * @async * @returns {Promise} */ initialize(): Promise; } export * from "./utils"; export default SyncWorker;