export interface HttpConfig {
    baseUrl?: string;
    contentType?: string;
    timeout?: number;
}
export type HttpRequestOptions<D = string | object> = {
    headers?: Record<string, string>;
    params?: Record<string, string | number | boolean>;
    data?: D;
    withCredentials?: boolean;
    responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream' | 'formdata';
};
export type HttpRequestOptionsFormatter<D = string | object> = (requestOptions: HttpRequestOptions<D>, method: HttpMethod, url: string) => Promise<HttpRequestOptions<D>> | HttpRequestOptions<D>;
export type HttpErrorResponseCallbackRequest<D = string | object> = {
    client: HttpClientSDKInterface;
    method: HttpMethod;
    url: string;
    options?: HttpRequestOptions<D>;
};
export type HttpErrorResponseCallback<R = unknown, D = string | object> = (error: HttpError, request: HttpErrorResponseCallbackRequest<D>) => HttpClientPromise<R>;
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
export type HttpResponseHeader = string | Array<string> | number | boolean | null;
export type HttpResponse<D = unknown> = {
    status: number;
    data: D;
    headers?: Record<string, HttpResponseHeader>;
};
export type HttpError = {
    status: number;
    error?: string;
};
interface PromiseWithReason<T = unknown, R = unknown> extends Promise<T> {
    then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: R) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2>;
    catch<TResult = never>(onrejected?: ((reason: R) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult>;
}
export type HttpClientPromise<T> = PromiseWithReason<HttpResponse<T>, HttpError>;
export interface HttpClientSDKInterface {
    get<R = unknown>(destination: string, options?: HttpRequestOptions): HttpClientPromise<R>;
    post<R = unknown, D = string | object>(destination: string, data: D, options?: HttpRequestOptions<D>): HttpClientPromise<R>;
    put<R = unknown, D = string | object>(destination: string, data: D, options?: HttpRequestOptions<D>): HttpClientPromise<R>;
    patch<R = unknown, D = string | object>(destination: string, data: D, options?: HttpRequestOptions<D>): HttpClientPromise<R>;
    delete<R = unknown>(destination: string, options?: HttpRequestOptions): HttpClientPromise<R>;
    request<R = unknown, D = string | object>(method: HttpMethod, url: string, options?: HttpRequestOptions<D>): HttpClientPromise<R>;
    setRequestOptionsFormatter<D = string | object>(formatter: HttpRequestOptionsFormatter<D>): HttpClientSDKInterface;
    setErrorResponseHandler<R = unknown, D = string | object>(callback?: HttpErrorResponseCallback<R, D>): HttpClientSDKInterface;
}
export {};
