import { PersistentTransport } from '../communication-interface/PersistentTransport';
export declare class WebRTCTransport implements PersistentTransport {
    private dataChannelName;
    private userConnections;
    constructor(dataChannelName: string);
    requiresBootstrap(): boolean;
    /**
     * Returns a webRTC offer to send to the other user
     * A webRTC offer is the first step in establishing a connection
     * the connection establishment works as follows:
     * 1. getOwnAddress is called
     * 2. the returned offer is sent to the other user
     * 3. the other user calls addContact with the offer
     * 4. the returned answer is sent to the other user
     * 5. the other user calls addContact with the answer
     *
     * @param userId the userId of the user to connect to (for internal book keeping)
     * @returns a webRTC offer to send to the other user
     */
    getOwnAddress(userId?: string): Promise<string>;
    /**
     * Adds a contact to the transport
     * Please see getOwnAddress for a description of the connection establishment process
     * @param userId the userId of the user to connect to (for internal book keeping)
     * @param address the address bundle retrieved by calling getOwnAddress on the other end (or the answer bundle retrieved by calling addContact on the other end)
     * @returns an address bundle to send to the other end (or undefined if the connection is already established)
     */
    addContact(userId: string, address: any): Promise<void | string>;
    /**
     * Disconnects the transport from the specified user
     * @param userId the userId of the user to remove
     */
    removeContact(userId: string): void;
    send(userIdTo: string, message: string): Promise<void>;
    private _messageReceived;
    private messageListeners;
    addMessageListener(listener: (payload: any) => void): void | Promise<void>;
    /**
     * get a list of clients directly connected via webRTC
     * @returns the user ids that currently have an established webRTC connection
     */
    getAllContacts(): string[];
}
//# sourceMappingURL=WebRTCTransport.d.ts.map