import { JustDropApi } from "../core/api.js"; import { DropSession } from "../core/session.js"; import { type CheckedFile } from "./safety.js"; export type DropFileStatus = "queued" | "encrypting" | "uploading" | "sent" | "downloaded" | "error"; export interface DropFileState { path: string; name: string; size: number; status: DropFileStatus; fileId?: string; error?: string; } export interface ReceivedFileState { fileId: string; name: string; size: number; status: "downloading" | "saved" | "error"; savedPath?: string; error?: string; } export type JobState = "waiting_for_peer" | "transferring" | "sent_awaiting_download" | "completed" | "cancelled" | "expired" | "error"; export interface TransferJob { kind: "drop" | "receive"; roomCode: string; link: string; createdAt: number; expiresAt: number | null; state: JobState; peerPresent: boolean; joinedExisting: boolean; files: DropFileState[]; received: ReceivedFileState[]; saveDir?: string; error?: string; session: DropSession; abort: AbortController; uploadsStarted?: boolean; } export declare class TransferManager { private readonly api; private readonly jobs; constructor(api: JustDropApi); link(roomCode: string): string; get(roomCode: string): TransferJob | undefined; list(): TransferJob[]; startDrop(files: CheckedFile[], expiryMinutes: number, existingRoomCode?: string): Promise; startReceive(saveDir: string, expiryMinutes: number, existingRoomCode?: string): Promise; cancel(roomCode: string): Promise; private runDropWorker; private runUploads; private runReceiveWorker; private downloadOne; private armExpiryGuard; private failJob; }