/**
* Fetcher - retrieves raw HTML from a URL using the native fetch API (Node 18+).
*
* Supports proxy rotation and User-Agent rotation via WatchConfig.
* When proxies are provided, uses undici ProxyAgent for per-request proxy selection.
* Automatic retry with exponential backoff via `retries` and `retryDelay` options.
*/
import type { WatchConfig } from "../models.js";
export declare class FetchError extends Error {
readonly statusCode?: number | undefined;
/** Retry-After header value (seconds or HTTP-date), set on 429/503 responses. */
retryAfter?: string;
constructor(message: string, statusCode?: number | undefined);
}
export declare function assertSafeUrl(url: string): void;
export declare class Fetcher {
fetch(config: WatchConfig): Promise;
fetchWithHeaders(config: WatchConfig): Promise<{
html: string;
headers: Record;
}>;
private attemptFetchWithHeaders;
private fetchWithProxy;
}
//# sourceMappingURL=index.d.ts.map