import type { FirecrawlScrapeResult, LinkPreviewProgressEvent, ScrapeWithFirecrawl } from "../deps.js";
import type { CacheMode, FirecrawlDiagnostics } from "../types.js";
export interface FirecrawlFetchResult {
    payload: FirecrawlScrapeResult | null;
    diagnostics: FirecrawlDiagnostics;
}
export interface HtmlDocumentFetchResult {
    html: string;
    finalUrl: string;
}
export type AssetLikeHtmlFetchReason = "binary-payload" | "content-type" | "content-disposition";
export declare class AssetLikeHtmlFetchError extends Error {
    readonly code = "ASSET_LIKE_HTML_FETCH";
    readonly reason: AssetLikeHtmlFetchReason;
    constructor(reason: AssetLikeHtmlFetchReason, detail?: string | null);
}
export declare function isAssetLikeHtmlFetchError(error: unknown): error is AssetLikeHtmlFetchError;
export declare function fetchHtmlDocument(fetchImpl: typeof fetch, url: string, options?: {
    timeoutMs?: number;
    onProgress?: ((event: LinkPreviewProgressEvent) => void) | null;
    rejectNonHtmlText?: boolean;
}): Promise<HtmlDocumentFetchResult>;
export declare function fetchWithFirecrawl(url: string, scrapeWithFirecrawl: ScrapeWithFirecrawl | null, options?: {
    timeoutMs?: number;
    cacheMode?: CacheMode;
    onProgress?: ((event: LinkPreviewProgressEvent) => void) | null;
    reason?: string | null;
}): Promise<FirecrawlFetchResult>;
