import type Sync from "./sync"; import { type LocalTree, type LocalTreeError } from "./filesystems/local"; import { type RemoteTree } from "./filesystems/remote"; export type Delta = { path: string; } & ({ type: "uploadFile"; size: number; md5Hash?: string; } | { type: "createRemoteDirectory"; } | { type: "createLocalDirectory"; } | { type: "deleteLocalFile"; } | { type: "deleteRemoteFile"; } | { type: "deleteLocalDirectory"; } | { type: "deleteRemoteDirectory"; } | { type: "downloadFile"; size: number; } | { type: "renameLocalFile"; from: string; to: string; } | { type: "renameRemoteFile"; from: string; to: string; } | { type: "renameRemoteDirectory"; from: string; to: string; } | { type: "renameLocalDirectory"; from: string; to: string; }); /** * Deltas * @date 3/1/2024 - 11:11:32 PM * * @export * @class Deltas * @typedef {Deltas} */ export declare class Deltas { private readonly sync; /** * Creates an instance of Deltas. * * @constructor * @public * @param {Sync} sync */ constructor(sync: Sync); /** * Process the directory trees and return all sync deltas. * * @public * @async * @param {{ * currentLocalTree: LocalTree * currentRemoteTree: RemoteTree * previousLocalTree: LocalTree * previousRemoteTree: RemoteTree * currentLocalTreeErrors: LocalTreeError[] * }} param0 * @param {LocalTree} param0.currentLocalTree * @param {RemoteTree} param0.currentRemoteTree * @param {LocalTree} param0.previousLocalTree * @param {RemoteTree} param0.previousRemoteTree * @param {{}} param0.currentLocalTreeErrors * @returns {Promise<{ * deltas: Delta[], * deleteLocalDirectoryCountRaw: number * deleteLocalFileCountRaw: number * deleteRemoteDirectoryCountRaw: number * deleteRemoteFileCountRaw: number * }>} */ process({ currentLocalTree, currentRemoteTree, previousLocalTree, previousRemoteTree, currentLocalTreeErrors }: { currentLocalTree: LocalTree; currentRemoteTree: RemoteTree; previousLocalTree: LocalTree; previousRemoteTree: RemoteTree; currentLocalTreeErrors: LocalTreeError[]; }): Promise<{ deltas: Delta[]; deleteLocalDirectoryCountRaw: number; deleteLocalFileCountRaw: number; deleteRemoteDirectoryCountRaw: number; deleteRemoteFileCountRaw: number; }>; } export default Deltas;