import { WebRtcDataPeer, NetworkEvent, ConnectionId, IBasicNetwork } from "./index";
import { SLogger } from "./Helper";
import { NetworkConfig } from "index";
import { RtcEvent } from "./IWebRtcNetwork";
export declare enum WebRtcNetworkServerState {
    Invalid = 0,
    Offline = 1,
    Starting = 2,
    Online = 3
}
export declare class WebRtcNetwork implements IBasicNetwork {
    private mTimeout;
    private mInSignaling;
    private mEvents;
    private mRtcEvents;
    private mIdToConnection;
    protected get IdToConnection(): {
        [id: number]: WebRtcDataPeer;
    };
    private mConnectionIds;
    GetConnections(): Array<ConnectionId>;
    private mServerState;
    protected mNetConfig: NetworkConfig;
    get NetworkConfig(): NetworkConfig;
    private mSignalingNetwork;
    protected mIsDisposed: boolean;
    protected mId: number;
    private static sNextId;
    protected log: SLogger;
    constructor(config: NetworkConfig);
    StartServer(): void;
    StartServer(address: string): void;
    protected StartServerInternal(address?: string): void;
    StopServer(): void;
    Connect(address: string): ConnectionId;
    Update(): void;
    Dequeue(): NetworkEvent;
    Peek(): NetworkEvent;
    Flush(): void;
    SendData(id: ConnectionId, data: Uint8Array, reliable: boolean): boolean;
    GetBufferedAmount(id: ConnectionId, reliable: boolean): number;
    Disconnect(id: ConnectionId): void;
    Shutdown(): void;
    protected DisposeInternal(): void;
    Dispose(): void;
    protected CreatePeer(peerId: ConnectionId): WebRtcDataPeer;
    private CheckSignalingState;
    private UpdateSignalingNetwork;
    private UpdatePeers;
    private AddOutgoingConnection;
    private AddIncomingConnection;
    private ConnectionEstablished;
    private RemoveSignalingConnection;
    private SignalingFailed;
    private HandleDisconnect;
    private StringToBuffer;
    private BufferToString;
    RequestStats(): void;
    protected EnqueueRtcEvent(evt: RtcEvent): void;
    DequeueRtcEvent(): RtcEvent;
}
