/** * Progress formatting and throttling. * * Pure functions — no Raycast imports — so they are testable without a host and * usable from the detached runner. The toast presenter that consumes these lives * separately, because it needs `@raycast/api` and a status file to watch. * * Every formatter returns an em dash rather than `NaN`/`undefined` for unknown * values. These strings go straight into a toast: "NaN undefined" is a visible * bug, a dash reads as "not known yet". */ /** Human-readable byte count. `formatBytes(383713905)` → `"365.9 MB"`. */ export declare function formatBytes(bytes: number | undefined): string; /** Transfer rate. Zero is treated as unknown — a stalled transfer shows no rate. */ export declare function formatSpeed(bytesPerSec: number | undefined): string; /** Compact duration. Caps at a day, above which the estimate is noise. */ export declare function formatEta(seconds: number | undefined): string; export interface ProgressLineInput { bytesDownloaded: number; totalBytes?: number; speedBytesPerSec?: number; etaSeconds?: number; } /** * One-line progress summary for a toast message. * * Omits segments it cannot compute rather than padding with dashes: a line * reading "— · — · —" is noise. With a known total this yields * `"50% · 183.0 MB / 365.9 MB · 1.2 MB/s · 2m 30s"`. */ export declare function formatProgressLine(input: ProgressLineInput): string; /** * Per-key throttle. * * A 350 MB transfer emits progress tens of thousands of times. Without this, * each one becomes a Raycast UI update. Returns the callback's value when it * runs and `undefined` when suppressed. * * Scoped to the returned closure rather than a module-global map (which is how * Fetch does it today) so two concurrent views can't throttle each other. */ export declare function createThrottle(intervalMs?: number): (key: string, fn: () => T) => T | undefined; //# sourceMappingURL=progress.d.ts.map