/// <reference types="node" />
import { EventEmitter } from 'events';
import { IWebRtcEndpoint } from './IWebRtcEndpoint';
import { PeerId, PeerInfo } from '../PeerInfo';
import { WebRtcConnection, ConstructorOptions, IceServer } from './WebRtcConnection';
import { MetricsContext } from '@streamr/utils';
import { RtcSignaller } from '../../logic/RtcSignaller';
import { Rtts } from '../../identifiers';
import { NegotiatedProtocolVersions } from '../NegotiatedProtocolVersions';
export interface WebRtcConnectionFactory {
    createConnection(opts: ConstructorOptions): WebRtcConnection;
    registerWebRtcEndpoint(): void;
    unregisterWebRtcEndpoint(): void;
}
export declare class WebRtcEndpoint extends EventEmitter implements IWebRtcEndpoint {
    private readonly peerInfo;
    private readonly iceServers;
    private readonly rtcSignaller;
    private readonly negotiatedProtocolVersions;
    private readonly connectionFactory;
    private connections;
    private messageQueues;
    private readonly newConnectionTimeout;
    private readonly pingInterval;
    private readonly logger;
    private readonly metrics;
    private stopped;
    private readonly bufferThresholdLow;
    private readonly bufferThresholdHigh;
    private readonly disallowPrivateAddresses;
    private readonly maxMessageSize;
    private statusReportTimer?;
    constructor(peerInfo: PeerInfo, iceServers: ReadonlyArray<IceServer>, rtcSignaller: RtcSignaller, metricsContext: MetricsContext, negotiatedProtocolVersions: NegotiatedProtocolVersions, connectionFactory: WebRtcConnectionFactory, newConnectionTimeout: number, pingInterval: number, webrtcDatachannelBufferThresholdLow: number, webrtcDatachannelBufferThresholdHigh: number, webrtcDisallowPrivateAddresses: boolean, maxMessageSize?: number);
    private startConnectionStatusReport;
    private createConnection;
    private onRtcOfferFromSignaller;
    private onRtcAnswerFromSignaller;
    isIceCandidateAllowed(candidate: string): boolean;
    private onIceCandidateFromSignaller;
    private onErrorFromSignaller;
    private onConnectFromSignaller;
    private replaceConnection;
    connect(targetPeerId: PeerId, routerId: string, trackerInstructed?: boolean): Promise<PeerId>;
    send(targetPeerId: PeerId, message: string): Promise<void>;
    private attemptProtocolVersionValidation;
    close(receiverPeerId: PeerId, reason: string): void;
    getRtts(): Readonly<Rtts>;
    getPeerInfo(): Readonly<PeerInfo>;
    getNegotiatedMessageLayerProtocolVersionOnNode(peerId: PeerId): number | undefined;
    getNegotiatedControlLayerProtocolVersionOnNode(peerId: PeerId): number | undefined;
    getDefaultMessageLayerProtocolVersion(): number;
    getDefaultControlLayerProtocolVersion(): number;
    /**
     * @deprecated
     */
    getAddress(): string;
    stop(): void;
    getAllConnectionNodeIds(): PeerId[];
    private onConnectionCountChange;
}
