import asyncRetry from 'async-retry';
import { fetch, URL } from '@whatwg-node/fetch';
import type { LegacyLogger } from './types';
export interface HttpCallConfig {
    headers: Record<string, string>;
    /**
     * timeout in milliseconds (for each single fetch call)
     * @default 20_000
     */
    timeout?: number;
    /** Retry configuration. Set to `false` for having no retries. */
    retry?: RetryOptions | false;
    /** custom fetch implementation. */
    fetchImplementation?: typeof fetch;
    /** Logger for HTTP info and request errors. Uses `console` by default. */
    logger?: LegacyLogger;
    /**
     * Function for determining whether the request response is okay.
     * You can override it if you want to accept other status codes as well.
     * @default {response => response.ok}
     **/
    isRequestOk?: ResponseAssertFunction;
    /** Optional abort signal */
    signal?: AbortSignal;
}
/**
 * Return a string that contains the reason on why the request should be retried.
 */
type ResponseAssertFunction = (response: Response) => boolean;
export type RetryOptions = Parameters<typeof asyncRetry>[1];
declare function get(endpoint: string, config: HttpCallConfig): Promise<Response>;
declare function post(endpoint: string, data: string | Buffer, config: HttpCallConfig): Promise<Response>;
export declare const http: {
    get: typeof get;
    post: typeof post;
};
export declare function makeFetchCall(endpoint: URL | string, config: {
    body?: string | Buffer;
    method: 'GET' | 'POST';
    headers: Record<string, string>;
    /**
     * timeout in milliseconds (for each single fetch call)
     * @default 20_000
     */
    timeout?: number;
    /** Retry configuration. Set to `false` for having no retries. */
    retry?: RetryOptions | false;
    /** custom fetch implementation. */
    fetchImplementation?: typeof fetch;
    /** Logger for HTTP info and request errors. Uses `console` by default. */
    logger?: LegacyLogger;
    /**
     * Function for determining whether the request response is okay.
     * You can override it if you want to accept other status codes as well.
     * @default {response => response.ok}
     **/
    isRequestOk?: ResponseAssertFunction;
    /** Optional abort signal */
    signal?: AbortSignal;
}): Promise<Response>;
export { URL };
//# sourceMappingURL=http-client.d.ts.map