import type { APIResponse } from "./APIResponse.js"; import type { EndpointMetadata } from "./EndpointMetadata.js"; import { EndpointSupplier } from "./EndpointSupplier.js"; export type FetchFunction = (args: Fetcher.Args) => Promise>; export declare namespace Fetcher { interface Args { url: string; method: string; contentType?: string; headers?: Record | null | undefined>; queryParameters?: Record; body?: unknown; timeoutMs?: number; maxRetries?: number; withCredentials?: boolean; abortSignal?: AbortSignal; requestType?: "json" | "file" | "bytes"; responseType?: "json" | "blob" | "sse" | "streaming" | "text" | "arrayBuffer" | "binary-response"; duplex?: "half"; endpointMetadata?: EndpointMetadata; } type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; interface FailedStatusCodeError { reason: "status-code"; statusCode: number; body: unknown; } interface NonJsonError { reason: "non-json"; statusCode: number; rawBody: string; } interface TimeoutError { reason: "timeout"; } interface UnknownError { reason: "unknown"; errorMessage: string; } } export declare function fetcherImpl(args: Fetcher.Args): Promise>; export declare const fetcher: FetchFunction;