import { AxiosError, AxiosInstance, AxiosRequestConfig, HttpStatusCode } from "axios";
export interface BaseClientConfig<HandleError extends boolean = boolean> {
    debug?: boolean;
    baseUrl: string;
    handleError?: HandleError;
    storage?: Storage;
    defaultSecure?: boolean;
    authDataStorageKey?: string;
    axiosConfig?: AxiosRequestConfig;
    onAxiosError?: (error: AxiosError) => void;
    onError?: (error: unknown) => void;
}
export enum ContentType {
    Json = "application/json",
    FormData = "multipart/form-data",
    UrlEncoded = "application/x-www-form-urlencoded",
    Text = "text/plain"
}
export type RequestConfig<Body = unknown> = AxiosRequestConfig<Body> & {
    secure?: boolean;
    contentType?: ContentType;
    handleError?: boolean;
};
export type ResponseStatus = {
    status: HttpStatusCode | -1;
    statusText: string;
};
export type SuccessClientResponse<Data = unknown> = ResponseStatus & {
    success: true;
    data: Data;
};
export type ErrorClientResponse = ResponseStatus & {
    success: false;
    data?: any;
    error: unknown;
};
export type ClientResponse<Data = unknown, HandleError extends boolean = boolean> = HandleError extends true ? SuccessClientResponse<Data> | ErrorClientResponse : SuccessClientResponse<Data>;
export abstract class BaseClient<HandleError extends boolean = boolean, AuthData = unknown> {
    protected readonly config: BaseClientConfig<HandleError>;
    protected readonly axiosInstance: AxiosInstance;
    protected readonly storage: Storage;
    constructor(config: BaseClientConfig<HandleError>);
    protected stringifyFormItem(formItem: unknown): string;
    protected createFormData(input: Record<string, unknown>): FormData;
    request<Data = unknown, Error = unknown, Body = unknown>(requestConfig: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
    get<Data = unknown, Error = unknown, Body = unknown>(url: string, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
    delete<Data = unknown, Error = unknown, Body = unknown>(url: string, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
    head<Data = unknown, Error = unknown, Body = unknown>(url: string, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
    options<Data = unknown, Error = unknown, Body = unknown>(url: string, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
    post<Data = unknown, Error = unknown, Body = unknown>(url: string, data?: Body, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
    put<Data = unknown, Error = unknown, Body = unknown>(url: string, data?: Body, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
    patch<Data = unknown, Error = unknown, Body = unknown>(url: string, data?: Body, config?: RequestConfig<Body>): Promise<ClientResponse<Data, HandleError>>;
    getAxios(): AxiosInstance;
    setAuthData(data: AuthData | null): void;
    getAuthData(): AuthData | null;
    getConfig(): BaseClientConfig<HandleError>;
    protected abstract prepareAuthRequestConfig(): Promise<Pick<RequestConfig<any>, 'headers' | 'data' | 'params'>>;
}
export class BaseApi<HandleError extends boolean = boolean, ApiClient extends BaseClient<HandleError> = BaseClient<HandleError>> {
    protected readonly apiClient: ApiClient;
    constructor(apiClient: ApiClient);
    getApiClient(): ApiClient;
}
export interface JwtClientConfig<HandleError extends boolean = boolean, AuthData extends JwtAuthData = JwtAuthData> extends BaseClientConfig<HandleError> {
    authSchema?: string;
    autoRenewToken?: boolean;
    onRenewToken?: () => Promise<AuthData>;
}
export interface JwtAuthData {
    accessToken: string;
    refreshToken?: string;
}
export class JwtClient<HandleError extends boolean = boolean, AuthData extends JwtAuthData = JwtAuthData> extends BaseClient<HandleError, AuthData> {
    protected readonly config: JwtClientConfig<HandleError, AuthData>;
    constructor(config: JwtClientConfig<HandleError, AuthData>);
    getConfig(): JwtClientConfig<HandleError>;
    setRenewTokenCallback(renewTokenCallback: () => Promise<AuthData>): void;
    protected prepareAuthRequestConfig(): Promise<Pick<RequestConfig<any>, 'headers' | 'data' | 'params'>>;
}

//# sourceMappingURL=index.d.ts.map
