/** * A quick, standalone link-speed test. * * The naive "fetch a slice and time it" measures the wrong thing through a * caching/buffering proxy (movi-tube's `/api/stream/media`, a CDN edge, a * Service Worker): the FIRST couple of megabytes come out of the proxy's * read-ahead buffer almost instantly — 600+ MB/s bursts show up in the logs — * and only AFTER that does the stream throttle down to the real origin rate. A * probe that stops inside the burst reads a fantasy number and picks a rung the * link can't actually carry. * * So this streams the response and IGNORES the burst: it starts its stopwatch * only once `SKIP_BYTES` have already arrived, then times how long the next * `MEASURE_BYTES` take (or whatever lands before the wall-clock cap). That tail * is the sustained rate. It downloads a few MB at most and aborts the moment it * has its answer — never the whole file. */ export interface BandwidthProbeOptions { headers?: Record; signal?: AbortSignal; /** Bytes to discard as the proxy/CDN burst before measuring. */ skipBytes?: number; /** Bytes to time after the burst for the sustained reading. */ measureBytes?: number; /** Hard wall-clock cap (ms) so a very slow link still returns something. */ timeoutMs?: number; } /** * Measure sustained link throughput in BITS/second, or -1 if it couldn't get a * trustworthy reading (fetch failed, file too small to clear the burst, or the * measured window was too short to be meaningful). Never throws. */ export declare function probeLinkBandwidth(url: string, opts?: BandwidthProbeOptions): Promise; //# sourceMappingURL=bandwidthProbe.d.ts.map