import { RequestInfo, Response } from "../services/fetcher.ts"; import { ScrapeRequester, ProviderContext, ProviderFetchOptions } from "../types/index.ts"; /** * Provider fetch function * - Wrapper around appFetch that adds support for user agent and proxy from the requester * - Determines the type of request (normal, retry, timeout) based on the options provided and calls the appropriate fetch function * - Can be extended in the future to add additional logging or error handling specific to provider requests * @param request - The input to fetch, can be a URL string or a Request object * @param fetchOptions - Options for the fetch request, can include timeout or retry options * @param requester - The ScrapeRequester object containing user agent and proxy information * @returns A Promise that resolves to the Response object from the fetch call * * * @see {@link ProviderFetchOptions} for the options that can be passed to this function, including timeout and retry options * @defaults - `attachUserAgent`: true, `attachProxy`: true */ export declare function providerFetch(request: RequestInfo | URL, fetchOptions: ProviderFetchOptions, requester: ScrapeRequester): Promise; /** Provider fetch reponse handler * - Wrapper around handleResponse that can be used to handle responses for provider fetches * - Can be extended in the future to add additional logging or error handling specific to provider requests */ export declare function providerFetchResponse(request: RequestInfo | URL, fetchOptions: ProviderFetchOptions, requester: ScrapeRequester): Promise; /** Provider fetch response handler * - Wrapper around handleResponse that can be used to handle responses for provider fetches * - Can be extended in the future to add additional logging or error handling specific to provider requests */ export declare function providerHandleResponse(requestResponse: Response): Promise; /** Provider fetch status checker * - Wrapper around providerFetch that returns a simplified status object indicating whether the fetch was successful and the HTTP status code * - Can be extended in the future to add additional logging or error handling specific to provider requests */ export declare function fetchStatus(request: RequestInfo | URL, options: ProviderFetchOptions, requester: ScrapeRequester): Promise<{ ok: boolean; status: number; data: {} | null; error?: undefined; } | { ok: boolean; status: number; error: { name: string; message: string; code: string; } | { name: string; message: string; code?: undefined; }; data?: undefined; }>; declare const context: ProviderContext["xhr"]; export default context;