import { EventEmitter } from 'events'; export * from './interfaces'; export interface StatsGathererOpts { session?: string; initiator?: string; conference?: string; interval?: number; logger?: { error(...any: any[]): any; warn(...any: any[]): any; }; } export default class StatsGatherer extends EventEmitter { peerConnection: RTCPeerConnection; private session; private initiator; private conference; private statsInterval; private pollingInterval; private lastResult; private lastActiveLocalCandidate; private lastActiveRemoteCandidate; private haveConnectionMetrics; private iceStartTime; private iceFailedTime; private iceConnectionTime; private logger; private statsArr; private boundHandleIceStateChange; private boundHandleConnectionStateChange; constructor(peerConnection: RTCPeerConnection, opts?: StatsGathererOpts); /** * Stops the stats polling interval and removes event listeners from the peer connection. * Call this when you are done with the gatherer to prevent leaked timers. */ stop(): void; private handleIceStateChange; private waitForSelectedCandidatePair; private getSelectedCandidatePair; private gatherSelectedCandidateInfo; private handleConnectionStateChange; private pollForStats; private checkBitrate; private polyFillStats; private isNativeStatsReport; private gatherStats; private createStatsReport; private processSource; private processSelectedCandidatePair; private checkLastActiveCandidate; }