import { Result } from '..'; export interface HTTPClient { get(url: string, config?: RequestConfig): Promise>; delete(url: string, config?: RequestConfig): Promise>; head(url: string, config?: RequestConfig): Promise>; options(url: string, config?: RequestConfig): Promise>; post(url: string, data?: R, config?: RequestConfig): Promise>; put(url: string, data?: R, config?: RequestConfig): Promise>; patch(url: string, data?: R, config?: RequestConfig): Promise>; } export interface RequestConfig { headers?: Record; baseURL?: string; params?: unknown; signal?: AbortSignal; timeout?: number; } export type HTTPMethod = keyof { [K in keyof HTTPClient as HTTPClient[K] extends (...args: any) => Promise> ? K : never]: never; }; export interface HTTPRequestFactory { method: HTTPMethod; url: string; headers: Record; try(): Promise>; } export type HTTPRequestCompletionCallback = (result: Result>, request: HTTPRequestFactory) => void; export type HTTPErrorHandler = (response: HTTPResponse, request: HTTPRequestFactory, extraData: E) => void; export interface HTTPResponse { status: number; data: T; } export interface HTTPError extends Error { response: HTTPResponse; } export declare const HTTP_METHODS: readonly ["get", "delete", "head", "options", "post", "put", "patch"]; export declare const isHTTPError: (e: unknown) => e is HTTPError; export declare const isHTTPErrorResponse: (response: HTTPResponse) => response is HTTPResponse<{ error: string; }>;