import axios, { AxiosResponse } from "axios"; import { Method } from "../lib"; export type RequestOptions = { method: Method; path: string; body?: any; query?: Record; headers?: Record; /** * If true, adds headers from getAuthHeaders() to the request. getAuthHeaders should be implemented in the child class. * @default true **/ authenticated?: boolean; responseType?: string; timeout?: number; }; /** * Base class for all types of apis. Provides basic http methods and error handling. */ export declare class HttpClient { protected baseURL: string; protected timeout: number; protected axiosInstance: ReturnType; constructor(baseURL: string, timeout?: number); protected setTimeout(timeout: number): void; protected post({ path, body, query, headers, authenticated, timeout, }: Pick): Promise>; protected get({ path, query, headers, authenticated, responseType, timeout, }: Pick): Promise>; protected put({ path, body, headers, authenticated, timeout, }: Pick): Promise>; protected patch({ path, body, headers, authenticated, timeout, }: Pick): Promise>; protected delete({ path, query, headers, authenticated, body, timeout, }: Pick): Promise>; protected doRequest({ method, path, body, query, headers, authenticated, responseType, timeout, }: RequestOptions): Promise>; private tryToParseJSONErr; protected getDefaultHeaders(): Promise>; protected getAuthHeaders(authenticated?: boolean): Promise>; protected getDefaultQuery(): Promise>; }