import { Timestamp } from "../model/Timestamp"; import { Uuid } from "../model/Uuid"; import { Signal } from "../protos"; import { IHasPeerConnection } from "./IHasPeerConnection"; import { IHasRemoteDeviceId } from "./IHasRemoteDeviceId"; import { IPingInfo } from "./models/IPingInfo"; import { IRtcConnectionConfiguration } from "./models/IRtcConnectionConfiguration"; 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"; export declare class RtcConnection implements IHasPeerConnection, IHasRemoteDeviceId { private iceServers; private config; private dataChannelNotifier; private readonly connectTimeoutMs; private readonly iceGatheringTimeoutMs; private readonly pingUpdateTimeoutMs; private readonly pingV2UpdateTimeoutMs; private readonly pingV2MetricsGatherTimeoutMs; private readonly streamsInfoUpdateTimeoutMs; private readonly reassemblyTimeoutMs; private readonly reassemblyTableCleanupMs; private readonly heartbeatTimeoutMs; private _peerConnection; get peerConnection(): RTCPeerConnection; private heartbeatChannel; private latestTtlStreamChannel; private reliableStreamChannel; private latestReliableStreamChannel; private latestTryOnceStreamChannel; private streamLatestTimestamp; private reassemblyTable; private reassemblyTableLastTimestamp; private pingTimeMs; private lastMessageTimestamp; private sessionMetrics; private closeCalled; private gotOffer; private hasIceCandidate; private pingV2Map; private pingInfo; private readonly reassemblyTableCleanupTimeout; private readonly pingUpdateTimeout; private readonly pingV2UpdateTimeout; private readonly pingV2MetricsGatherTimeout; private readonly streamsInfoUpdateTimeout; private readonly heartbeatTimeout; constructor(peerConnection: RTCPeerConnection, iceServers: RTCIceServer[], config: IRtcConnectionConfiguration, dataChannelNotifier: (channel: RTCDataChannel) => void); handleSignal(signal: Signal): Promise; /** * Sends a message to the remote peer. */ send(message: IRtcStreamMessage, config: IRtcSendConfiguration): void; controlRemoteStream(streamControl: IStreamControl): void; isActive(): boolean; /** * Checks that the peerConnection is connected * and all data channels exist and are open */ isReady(): boolean; close(): Promise; getPing(): number | undefined; getPingInfo(): IPingInfo | undefined; getLastMessageTimestamp(): Timestamp | undefined; getSessionCreatedTimestamp(): Timestamp | undefined; setSessionCreatedTimestamp(sessionCreatedTimestamp: Timestamp): void; getSessionId(): Uuid | undefined; setSessionId(sessionId: Uuid): void; getRemotePeerId(): Uuid | undefined; getRemoteDeviceId(): Uuid | undefined; setRemoteDeviceId(deviceId: Uuid | undefined): void; getSessionMetricsMessageCounts(): IRtcSessionMetricsMessageCounts | undefined; getConnectionStatsInfo(): Promise; private initializeChannels; getOffer(): Promise; getLanOffer(): Promise; handleLanAnswer(answerSdp: RTCSessionDescription): Promise; private getChannelFromLabel; private sendOnChannel; private channelNotRecognized; private setupChannel; private receiveChannelMessage; private receiveChannelMessageChunk; /** * Handles system messages (e.g., ping/pong). * Returns true if the message is a system message. */ private handleSystemMessage; private sendSystemMessage; private isLatestMessage; private sendPingV2; private gatherPingV2Metrics; }