11import type { Emitter } from '@rocket.chat/emitter' ;
22
33import type { CallEvents } from './CallEvents' ;
4- import type { IMediaStreamWrapper } from '../media/IMediaStreamWrapper' ;
5-
6- export type CallActorType = 'user' | 'sip' ;
7-
8- export type CallContact = {
9- type ?: CallActorType ;
10- id ?: string ;
11- contractId ?: string ;
12-
13- displayName ?: string ;
14- username ?: string ;
15- sipExtension ?: string ;
16- } ;
17-
18- export type CallRole = 'caller' | 'callee' ;
4+ import type {
5+ AnyClientMediaCallParticipant ,
6+ IClientMediaCallLocalParticipant ,
7+ IClientMediaCallRemoteParticipant ,
8+ } from './IClientMediaCallParticipant' ;
9+ import type { CallActorType } from './common' ;
1910
2011export type CallService = 'webrtc' ;
2112
@@ -77,26 +68,13 @@ export type CallFlag = 'internal' | 'create-data-channel';
7768
7869export interface IClientMediaCall {
7970 callId : string ;
80- role : CallRole ;
81- service : CallService | null ;
82- flags : readonly CallFlag [ ] ;
83- features : readonly CallFeature [ ] ;
8471
8572 state : CallState ;
8673 ignored : boolean ;
8774 signed : boolean ;
8875 hidden : boolean ;
89- muted : boolean ;
90- /* if the call was put on hold */
91- held : boolean ;
9276 /* busy = state >= 'accepted' && state < 'hangup' */
9377 busy : boolean ;
94- /* if the other side has put the call on hold */
95- remoteHeld : boolean ;
96- remoteMute : boolean ;
97-
98- contact : CallContact ;
99- transferredBy : CallContact | null ;
10078
10179 /** The timestamp of the moment the call was marked as active for the first time */
10280 activeTimestamp ?: Date ;
@@ -108,14 +86,9 @@ export interface IClientMediaCall {
10886
10987 emitter : Emitter < CallEvents > ;
11088
111- getLocalMediaStream ( tag ?: string ) : IMediaStreamWrapper | null ;
112- getRemoteMediaStream ( tag ?: string ) : IMediaStreamWrapper | null ;
113-
11489 accept ( ) : void ;
11590 reject ( ) : void ;
11691 hangup ( ) : void ;
117- setMuted ( muted : boolean ) : void ;
118- setHeld ( onHold : boolean ) : void ;
11992 requestScreenShare ( requested : boolean ) : void ;
12093 setScreenVideoTrack ( videoTrack : MediaStreamTrack | null ) : Promise < void > ;
12194 hasScreenVideoTrack ( ) : boolean ;
@@ -126,4 +99,9 @@ export interface IClientMediaCall {
12699
127100 getStats ( selector ?: MediaStreamTrack | null ) : Promise < RTCStatsReport | null > ;
128101 isFeatureAvailable ( feature : CallFeature ) : boolean ;
102+ hasFlag ( flag : CallFlag ) : boolean ;
103+
104+ readonly localParticipant : IClientMediaCallLocalParticipant ;
105+ readonly remoteParticipants : IClientMediaCallRemoteParticipant [ ] ;
106+ readonly participants : AnyClientMediaCallParticipant [ ] ;
129107}
0 commit comments