import { CancelToken } from 'axios'; import FormData from 'form-data'; export interface HttpClient { get: (path: string, params: object, options?: RequestOptions) => Promise; getData: (path: string, params: object, options?: RequestOptions) => Promise; post: (path: string, params: object, options?: RequestOptions) => Promise; postData: (path: string, params: FormData, options?: RequestOptions) => Promise; put: (path: string, params: object, options?: RequestOptions) => Promise; delete: (path: string, params: object, options?: RequestOptions) => Promise; } export type ErrorResponse = { data: T; status: number; statusText: string; headers: any; }; export type HttpResponse = { data: T; headers: any; }; export type HttpMethod = 'get' | 'post' | 'put' | 'delete'; export type Params = { [key: string]: unknown; }; export type ProxyConfig = { host: string; port: number; auth?: { username: string; password: string; }; }; export interface HttpClientError extends Error { response?: T; } export interface ResponseHandler { handle: (response: Promise>) => Promise; } export interface RequestConfig { method: HttpMethod; url: string; headers: any; httpsAgent?: any; data?: any; proxy?: ProxyConfig; } export interface RequestConfigBuilder { build: (method: HttpMethod, path: string, params: Params | FormData | Array, options?: RequestOptions) => Promise; } export interface RequestOptions { timeout?: number; maxBodyLength?: number; maxRedirects?: number; responseType?: string; transformRequest?: object | object[]; transformResponse?: object | object[]; cancelToken?: CancelToken; withCredentials?: boolean; xsrfCookieName?: string; xsrfHeaderName?: string; onDownloadProgress?: (e: any) => void; onUploadProgress?: (e: any) => void; validateStatus?: (status: number) => boolean; paramsSerializer?: (params: any) => string; [propsName: string]: any; } export interface ResolvedFn { (val: T): T | Promise; } export interface RejectedFn { (error: any): any; } //# sourceMappingURL=HttpClientInterface.d.ts.map