import { IRtcInfo } from "../model/IRtcInfo"; import { IRtcPeer } from "../model/IRtcPeer"; import { RtcConnectionStatus } from "../model/RtcConnectionStatus"; import { Timestamp } from "../model/Timestamp"; import { Uuid } from "../model/Uuid"; import { IPingInfo } from "./models/IPingInfo"; import { IRtcClientConfiguration } from "./models/IRtcClientConfiguration"; import { IRtcConnectionStatsInfo } from "./models/IRtcConnectionStatsInfo"; import { IRtcSendConfiguration } from "./models/IRtcSendConfiguration"; import { IRtcSessionMetricsMessageCounts } from "./models/IRtcSessionMetricsMessageCounts"; import { IRtcStreamMessage } from "./models/IRtcStreamMessage"; import { IStreamControl } from "./models/IStreamControl"; import { RtcConnection } from "./RtcConnection"; /** * RtcClient to be used by browsers. */ export declare class RtcClient { private config; private readonly grpcCallDeadline; private readonly refreshIntervalDelayMs; private readonly iceServersTtl; private localPeer?; private iceServers?; private iceServersLastUpdate?; private receiveSignalStream?; private refreshInterval; private connections; private localConnections; private isConnectionInitiator; private isOutgoingConnection; private peerDataChannelListeners; private rtcInstancesConstructed; private statsLoopsExecuted; constructor(config: IRtcClientConfiguration); send(remotePeerId: Uuid, message: IRtcStreamMessage, config: IRtcSendConfiguration): void; controlRemoteStream(remotePeerId: Uuid, streamControl: IStreamControl): void; getLocalPeer(): Promise; /** * Connects to a peer given its id. * Returns the id of the session, if one is created. */ connect(remotePeerId: Uuid, rtcInfo?: IRtcInfo): Promise; connectLan(agentEndpoint: string): Promise; getConnections(): RtcConnection[]; createCustomDataChannel(remotePeerId: Uuid, channelName: string, init: RTCDataChannelInit, isBinary: boolean, listener: (peerId: Uuid, channel: RTCDataChannel) => void): () => void; private onCustomDataChannel; getConnectionStatus(remotePeerId: Uuid): RtcConnectionStatus; getConnectionStatsInfo(remotePeerId: Uuid): Promise; disconnect(remotePeerId: Uuid): Promise; getPeers(): Promise; getSessions(): Promise<{ [key in string]: string[]; }>; getPing(remotePeerId: Uuid): number | undefined; getPingInfo(remotePeerId: Uuid): IPingInfo | undefined; getLastMessageTimestamp(remotePeerId: Uuid): Timestamp | undefined; getSessionMetricsMessageCounts(remotePeerId: Uuid): IRtcSessionMetricsMessageCounts | undefined; isReady(): boolean; shutdown(): Promise; private createPeer; private createReceiveSignalStream; private createRTCPeerConnection; private closeConnections; private getActiveConnection; private update; private gatherConnectionStats; private reset; private updateIceServers; private setupHandlers; private getMetadata; }