export interface RtcRemoteTrackSnapshot { kind: string; id: string; readyState: string; } export interface RtcSyntheticMediaResource { audioCtx: AudioContext; source?: AudioScheduledSourceNode; drawIntervalId?: number; } export interface WebRtcTestHarnessWindow extends Window { __rtcConnections: RTCPeerConnection[]; __rtcDataChannels: RTCDataChannel[]; __rtcRemoteTracks: RtcRemoteTrackSnapshot[]; __rtcSyntheticMediaResources: RtcSyntheticMediaResource[]; __trackedAudioContexts?: AudioContext[]; __rtcStatsHWM?: Record>; __rtcVideoStatsHWM?: Record>; __lastRtcState?: RTCPeerConnectionState; RTCPeerConnection: typeof RTCPeerConnection; AudioContext: typeof AudioContext; } export function getWebRtcTestHarnessWindow(): WebRtcTestHarnessWindow { return window as unknown as WebRtcTestHarnessWindow; }