import * as http from 'http'; import { IAPIResponse, IDomainRequestOptions } from "../interfaces/common"; import { TStringValueObject } from "../types"; import { EventEmitter } from "./EventEmitter"; /** * Класс запросов к порталу AmoCRM * */ export default class DomainRequest extends EventEmitter { protected readonly config: IDomainRequestOptions; protected readonly hostname: string; constructor(config: IDomainRequestOptions); protected isFormData(): boolean; protected getHeaders(): TStringValueObject; protected getMethod(): string; protected getData(): string | undefined; protected getLocation(): URL; protected getPath(): string; protected getHostname(): string; process(): Promise>; protected parseResponse(apiResponse: IAPIResponse): IAPIResponse; protected makeRequest(): Promise>; protected onResponse(callback: CallableFunction): (response: http.IncomingMessage) => void; onError(callback: CallableFunction): (error: Error) => any; }