import { $, $Events } from '../../Class/$';
import { System } from '../../system';
export declare function waitAllCandidates(rtc: RTCPeerConnection): Promise<RTCIceCandidate[]>;
export type Peer_EE = {
    connect: [];
    error: [Error];
    close: [];
    message: [any];
    start: [MediaStream];
    stop: [];
};
export type PeerEvents = $Events<Peer_EE> & Peer_EE;
export declare class Peer extends $<PeerEvents> {
    private _initiator;
    private _config;
    private _rtc;
    private _rtc_channel;
    private _outgoing_stream;
    private _incoming_stream;
    private _video_transceiver;
    private _audio_transceiver;
    constructor(system: System, initiatior: boolean, config: RTCConfiguration);
    send(message: string): void;
    offer(): Promise<string>;
    _offer(rtc: RTCPeerConnection): Promise<string>;
    private _setup;
    private _plunk;
    private _plunk_channel;
    acceptOffer(signal: string): Promise<void>;
    _acceptOffer(rtc: RTCPeerConnection, signal: string): Promise<void>;
    answer(): Promise<string>;
    _answer(rtc: RTCPeerConnection): Promise<string>;
    acceptAnswer(signal: string): Promise<void>;
    _acceptAnswer(rtc: RTCPeerConnection, signal: string): Promise<void>;
    private _stream;
    addStream(stream: MediaStream): Promise<void>;
    removeStream(): Promise<void>;
    close(): void;
}
