import { URLSearchParams } from 'iso-url'; import { TimeoutError, HTTPError } from './http/error.js'; import type { UploadProgressFn } from '../index.js'; type Override = Omit & R; export type FetchOptions = Override; export interface HTTPOptions extends FetchOptions { json?: any; /** * The base URL to use in case url is a relative URL */ base?: string; /** * Throw not ok responses as Errors */ throwHttpErrors?: boolean; /** * Transform search params */ transformSearchParams?(params: URLSearchParams): URLSearchParams; /** * When iterating the response body, transform each chunk with this function. */ transform?(chunk: any): any; /** * Handle errors */ handleError?(rsp: Response): Promise; /** * Control request creation */ agent?: any; } export interface ExtendedResponse extends Response { iterator(): AsyncGenerator; ndjson(): AsyncGenerator; } export declare class HTTP { static HTTPError: typeof HTTPError; static TimeoutError: typeof TimeoutError; static post: (resource: string | Request, options?: HTTPOptions) => Promise; static get: (resource: string | Request, options?: HTTPOptions) => Promise; static put: (resource: string | Request, options?: HTTPOptions) => Promise; static delete: (resource: string | Request, options?: HTTPOptions) => Promise; static options: (resource: string | Request, options?: HTTPOptions) => Promise; readonly opts: HTTPOptions; constructor(options?: HTTPOptions); /** * Fetch */ fetch(resource: string | Request, options?: HTTPOptions): Promise; post(resource: string | Request, options?: HTTPOptions): Promise; get(resource: string | Request, options?: HTTPOptions): Promise; put(resource: string | Request, options?: HTTPOptions): Promise; delete(resource: string | Request, options?: HTTPOptions): Promise; options(resource: string | Request, options?: HTTPOptions): Promise; } export {}; //# sourceMappingURL=http.d.ts.map