import type { WebSocketServer } from "ws"; export type OpStatus = "active" | "done" | "error" | "cancelled"; export type OpType = "clone" | "delete" | "upload"; export interface ServerOperation { id: string; type: OpType; label: string; status: OpStatus; progress: number; totalBytes: number; processedBytes: number; startedAt: number; completedAt: number | null; error: string | null; } export declare class OperationsManager { private ops; private wss; private pollTimer; setWss(wss: WebSocketServer): void; list(): ServerOperation[]; get(id: string): ServerOperation | undefined; cancel(id: string): boolean; /** * Run a clone operation in a worker thread with polling-based progress. */ runClone(src: string, dest: string, label: string): string; /** * Run a delete operation (cross-device trash: copy to trash, then rm original) * in a worker thread with polling-based progress. */ runDelete(src: string, trashDest: string, label: string): string; /** * Create a tracked operation for things that don't need a worker (instant ops, uploads). */ create(type: OpType, label: string, id?: string): string; complete(id: string, error?: string): void; clearCompleted(): void; private startWorker; /** Single polling loop for all active operations — runs every 1s */ private ensurePolling; private checkPolling; private pollAll; private broadcast; private broadcastFsChange; }