/** * Information about product for SDK usage statistic. */ export declare type IProductInfo = { product: string; version: string; }; /** * Interface to be implemented by objects capable of making HTTP requests. * @hidden */ export interface IConnection { get(endpoint: string, accessToken: string): Promise; post(endpoint: string, accessToken: string, data?: object): Promise; } /** * Class responsible for making HTTP requests. * @hidden */ export declare class Connection implements IConnection { private readonly prefix; private virgilAgentValue; /** * Initializes a new instance of `Connection`. * @param {string} prefix - `prefix` will be prepended to the `endpoint` * argument of request methods. * @param {VirgilAgentValue} [virgilAgentValue] - optional instance of VirgilAgent for products that wraps * Virgil SDK */ constructor(prefix: string, info?: IProductInfo); /** * Issues a GET request against the `endpoint`. * @param {string} endpoint - Endpoint URL relative to the `prefix`. * @param {string} accessToken - Token to authenticate the request. * @returns {Promise} */ get(endpoint: string, accessToken: string): Promise; /** * Issues a POST request against the `endpoint` sending the `data` as JSON. * @param {string} endpoint - Endpoint URL relative to the `prefix`. * @param {string} accessToken - Token to authenticate the request. * @param {object} data - Response body. * @returns {Promise} */ post(endpoint: string, accessToken: string, data?: object): Promise; private send; private createHeaders; }