import Agent from 'agentkeepalive';
import { Response as ExpressResponse } from 'express';
import { ApiConfig, GetRequest } from './types';
import Dict = NodeJS.Dict;
export interface ResultWithHeaders<T> {
    data: T;
    headers: Dict<string>;
}
interface Request {
    path: string;
    query?: object | string;
    headers?: Record<string, string>;
    responseType?: string;
    raw?: boolean;
}
interface RequestWithBody extends Request {
    data?: Record<string, unknown> | string;
    retry?: boolean;
}
declare class RestClient {
    private readonly name;
    private readonly config;
    agent: Agent;
    constructor(name: string, config: ApiConfig);
    private apiUrl;
    private timeoutConfig;
    get<T>(request: GetRequest): Promise<T>;
    getStream({ path, query, headers, token }: GetRequest, res: ExpressResponse): Promise<void>;
    private requestWithBody;
    post<Response = unknown>(request: RequestWithBody, token: string): Promise<Response>;
    getWithHeaders<T>({ path, query, headers, responseType, raw, token, }: GetRequest): Promise<ResultWithHeaders<T>>;
    deleteWithHeaders<T>({ path, query, headers, responseType, raw, token, }: GetRequest): Promise<ResultWithHeaders<T>>;
    delete<T>(request: GetRequest): Promise<T>;
}
export { RestClient };
export default RestClient;
