import { AxiosInstance, AxiosPromise, AxiosRequestConfig } from 'axios'; import { Base } from '../base'; import { IShifterConfig, IShifterChangeIp } from './types'; /** * @description Shifter proxy provider. * @extends {Base} */ export declare class Shifter extends Base { axios: AxiosInstance; private readonly config; private readonly strategy; /** * @constructor * @param {IShifterConfig} config */ constructor(config: IShifterConfig); /** * @description Create and set proxy agents. A different port matches a * different country / IP. * @param {IShifterChangeIp} params Params to handle multiple strategies. * @returns {Shifter} An instance of a shifter proxy provider. */ setIp(params?: IShifterChangeIp): Shifter; /** * @description Picks a random port from a list of matching countries. * @param {EShifterCountry[]} countries A list of verified countries. * @returns {number} A port number. */ private getRandomPort; /** * @description Picks a random country among a given list of them. * @param {EShifterCountry[]} countries A list of verified countries. * @returns {string} A single country from the given list. */ private getRandomCountry; /** * @description Checks weither or not the mapping contains a single entry. * @param {TShifterCountryPortMapping} mapping country to port mapping. * @throws {Error} Will throw if mapping has no entries. */ private isCountryPortMappingEmpty; /** * @description Sends a request. * @param {AxiosRequestConfig} axiosRequestConfig * @returns {AxiosPromise} */ fetch(axiosRequestConfig: AxiosRequestConfig): AxiosPromise; /** * @description Creates both an HTTP and HTTPS proxy * @param { port: number } params * @returns {ICreateProxyConfig} */ private createProxyAgents; }