import { WebRTCLiveClientOptions } from '../../providers/WebRTCLiveProvider/interface/WebRTCLiveClientOptions';
/**
 *
 */
export declare class WebRTCLiveClient {
    private options;
    private ws;
    private peerConnection;
    serverUrl: string;
    streamKey: string;
    stream: MediaStream | null;
    signalingType: string;
    private retryTimeout;
    private retryCount;
    private externalStartCallback;
    private externalStopCallback;
    private externalErrorCallback;
    /**
     * @param url
     * @param options
     */
    constructor(url: string, options?: Partial<WebRTCLiveClientOptions>);
    /**
     * Sets start streaming callback
     *
     * @param cb
     */
    onStart(cb: (stream: MediaStream) => void): void;
    /**
     * Sets stop streaming callback
     *
     * @param cb
     */
    onStop(cb: () => void): void;
    /**
     * Sets streaming or connection error callback
     *
     * @param cb
     */
    onError(cb: (e: Error) => void): void;
    /**
     * Start connection dialog
     */
    connect(): void;
    /**
     * Kill connection
     */
    disconnect(): void;
    /**
     * Begins socket opening
     * @private
     */
    private connectWS;
    /**
     * Socket opened event handler
     * Begins login process
     * @private
     */
    private onSocketOpen;
    /**
     * Socket close event handler
     * @param e
     * @private
     */
    private onSocketClose;
    /**
     * Socket connection error handler
     * @param e
     * @private
     */
    private onSocketError;
    /**
     * Socket message handler
     * @param message
     * @private
     */
    private onSocketMessage;
    /**
     * Socket JOIN message handler
     * @param message
     * @private
     */
    private handleJoinMessage;
    /**
     * Socket STATUS message handler
     * @param message
     * @private
     */
    private handleStatusMessage;
    /**
     * Socket UPDATE message handler
     * @param message
     * @private
     */
    private handleUpdateMessage;
    /**
     * Handles peer connection login process
     * @private
     */
    private handleLogin;
    /**
     * Adds received remote offer to peer connection
     * @private
     */
    private handleAnswer;
    /**
     * Adds ICE candidate to peer connection
     * @param candidate
     * @private
     */
    private handleCandidate;
    /**
     * Live stream finish handler
     * @private
     */
    private handleUnpublished;
    /**
     * Handles system failures
     */
    private handleSystemError;
    /**
     * Peer connection stream received handler
     * @param e
     * @private
     */
    private onPeerConnectionStream;
    /**
     * ICE candidate received handler
     * @param e
     * @private
     */
    private onPeerConnectionIceCandidate;
    /**
     * Peer connection ICE connection state change handler
     * @private
     */
    private onPeerConnectionIceConnectionStateChange;
    /**
     * Returns newly created offer
     * @private
     */
    private createOffer;
    /**
     * Handles RTC connection error
     * @param e
     * @private
     */
    private handleRTCError;
    /**
     * Handles network error
     * @private
     */
    private handleNetworkError;
    /**
     * Sends message to websocket
     * @param message
     * @private
     */
    private send;
    /**
     * Parses JSON message to object
     * @param message
     */
    private parseMessage;
    /**
     * Closes all connections (ws and peer connection)
     * @private
     */
    private closeConnections;
    /**
     * Kills peer connection
     * @private
     */
    private removePeerConnection;
    /**
     * Schedules connection retry
     *
     * @private
     */
    private scheduleRetry;
    /**
     * Returns normalized options with all defaults set
     *
     * @param userOptions
     * @private
     */
    private normalizeOptions;
}
