import type { Browser, Page } from "puppeteer-core"; /** Completed download metadata returned by tab download helpers. */ export interface BrowserDownload { path: string; suggestedFilename: string; url: string; bytes: number; } /** Owns tab-scoped Chromium download behavior and completion events. */ export declare class DownloadManager { #private; /** * `perTab` gives each tab its own folder by saving under download GUIDs and moving each tab's own files. Leave it off * for a browser the user drives (connected, relay): there the folder also receives the user's own downloads, which * would otherwise be saved under bare GUIDs nobody renames. `pageEvents` is for the omp relay. */ constructor(browser: Browser, page: Page, tabId: string, options: { perTab: boolean; pageEvents: boolean; }); /** * Start a new tab's downloads: point them at `directory` when the tab was opened with one. Page events change no * browser setting, so the relay tracks them from here and a download clicked before any wait is listed. */ start(directory?: string): Promise; /** * Point the browser's one download folder at this tab's folder. Per tab, files are saved under their download GUID * so tabs never overwrite each other's, and each tab moves its own into its folder under the suggested name. The * relay cannot point Chrome anywhere (the tab supervisor refuses a folder for it), so there this only listens. */ enable(directory?: string): Promise; /** Enabling started by a `wait()` that has not yet applied; settles once downloads are tracked. */ get arming(): Promise | undefined; /** Wait for the next unclaimed completed download. */ wait(signal?: AbortSignal): Promise; /** Return every completed download for this tab. */ list(): BrowserDownload[]; /** Detach event listeners and reject outstanding waits. */ close(): Promise; }