import type { AxiosInstance, AxiosRequestConfig, ResponseType } from "axios"; import FormData from "form-data"; export type QueryParamsType = Record; export interface FullRequestParams extends Omit { /** set parameter to `true` for call `securityWorker` for this request */ secure?: boolean; /** request path */ path: string; /** content type of request body */ type?: ContentType; /** query params */ query?: QueryParamsType; /** format of response (i.e. response.json() -\> format: "json") */ format?: ResponseType; /** request body */ body?: unknown; /** request code (method + path) */ code?: string; } export type RequestParams = Omit; export interface ApiConfig extends Omit { securityWorker?: (securityData: SecurityDataType | null) => Promise | AxiosRequestConfig | void; secure?: boolean; format?: ResponseType; } export declare enum ContentType { Json = "application/json", FormData = "multipart/form-data", UrlEncoded = "application/x-www-form-urlencoded", Text = "text/plain" } export declare class HttpClient { instance: AxiosInstance; private securityData; private securityWorker?; private secure?; private format?; constructor({ securityWorker, secure, format, ...axiosConfig }?: ApiConfig); setSecurityData: (data: SecurityDataType | null) => void; protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig; protected stringifyFormItem(formItem: unknown): string; protected createFormData(input: Record): FormData; request: ({ secure, path, type, query, format, body, code, ...params }: FullRequestParams) => Promise; }