export declare function assertSafeHttpUrl(raw: string): URL; export interface FetchTimeoutOptions { /** stall 超时(默认沿用 timeoutMs):只要持续有字节到达就自动续期。 */ stallMs?: number; /** 绝对总时长上限,0 表示不限。 */ totalMs?: number; /** 每收到一段数据回调,便于上层判断“还在动”。 */ onProgress?: (bytes: number) => void; } /** * stall 超时:只要持续有字节到达就自动续期,只有“无任何字节”超过 stallMs 才超时。 * totalMs(>0 时为绝对上限,0 表示不限总时长):真死链兜底。 */ export declare function fetchWithTimeout(url: string, init: RequestInit, timeoutMs: number, opts?: FetchTimeoutOptions): Promise; export declare function readResponseTextLimited(response: Response, maxBytes: number): Promise; export declare function parseJsonLimited(response: Response, maxBytes: number): Promise; export interface DownloadImageOptions { totalMs?: number; } export declare function downloadImage(url: string, outputDir: string, stallMs: number, maxBytes: number, authorization?: string, opts?: DownloadImageOptions): Promise<{ path: string; mimeType: string; }>; //# sourceMappingURL=download.d.ts.map