import { CustomError } from 'ts-custom-error'; declare enum HttpMethods { GET = "GET", POST = "POST", PUT = "PUT", PATCH = "PATCH", DELETE = "DELETE", HEAD = "HEAD" } declare class BaseError extends CustomError { } interface HttpResponse { method: HttpMethods; status: number; statusText: string; url: string; headers: Record; body: T; request: HttpRequest; } interface HttpInterceptor { onRequest?(request: HttpRequest): Promise; onResponse?(response: HttpResponse): Promise; onError?(error: Error, request: HttpRequest): Error; } declare enum ResponseBodyConversions { Json = "json", Stream = "stream", ArrayBuffer = "arraybuffer" } type OnProgress = (progress: number) => void; interface HttpClient { get(url: string, headers?: Record, options?: RequestOptions): Promise>; post(url: string, body: any, headers?: Record, options?: RequestOptions): Promise>; put(url: string, body: any, headers?: Record, options?: RequestOptions): Promise>; patch(url: string, body: any, headers?: Record, options?: RequestOptions): Promise>; delete(url: string, headers?: Record, options?: RequestOptions): Promise>; head(url: string, headers?: Record, options?: RequestOptions): Promise>; send(request: HttpRequest): Promise>; addInterceptor(interceptor: HttpInterceptor): void; } interface RequestOptions { responseBodyConversion?: ResponseBodyConversions; onUploadProgress?: OnProgress; onDownloadProgress?: OnProgress; } declare class HttpRequest { method: HttpMethods; url: string; body: any; headers: Record; options: RequestOptions; constructor(method: HttpMethods, url: string, body?: any, headers?: Record, options?: RequestOptions); } declare class HttpError extends BaseError { private readonly _request; private readonly _response; private readonly _innerError; constructor(request: HttpRequest, response: HttpResponse | null, innerError?: Error | null, message?: string); get request(): HttpRequest; get response(): HttpResponse | null; get innerError(): Error | null; get method(): HttpMethods; get url(): string; get status(): number | null; get statusText(): string | null; get body(): any; get headers(): any; } declare class NetworkError extends HttpError { constructor(request: HttpRequest, response: HttpResponse | null, innerError?: Error | null, message?: string); } declare class NetworkErrorInterceptor implements HttpInterceptor { onError?(error: Error, request: HttpRequest): Error; private isNetworkError; } declare class QueryStringBuilder { private params; add(name: string, value: any): void; remove(name: string): void; build(): string; } declare class UrlHelper { private readonly _baseUrl; private readonly _relativeUrl; private readonly _absoluteUrl; constructor(baseUrl: string | undefined, url: string | undefined); get baseUrl(): string; get relativeUrl(): string; get absoluteUrl(): string; private buildAbsoluteUrl; private buildRelativeUrl; private isAbsoluteUrl; private combineUrls; } export { HttpClient, HttpError, HttpInterceptor, HttpMethods, HttpRequest, HttpResponse, NetworkError, NetworkErrorInterceptor, OnProgress, QueryStringBuilder, RequestOptions, ResponseBodyConversions, UrlHelper };