import { RemoteParticipantState } from '@internal/calling-stateful-client' ; import { CommunicationUserKind , PhoneNumberKind , MicrosoftTeamsUserKind , UnknownIdentifierKind } from '@azure/communication-common' ; import { MeetingEndReason } from './MeetingEndReason' ; beta export interface MeetingParticipant extends Pick < RemoteParticipantState , 'displayName' | 'state' | 'videoStreams' | 'isMuted' | 'isSpeaking' > { /** ID of the meeting participant. */ id : CommunicationUserKind | PhoneNumberKind | MicrosoftTeamsUserKind | UnknownIdentifierKind ; /** Describes the reason the meeting ended for this participant. */ meetingEndReason ? : MeetingEndReason ; } beta export type MeetingParticipants = { [ keys ] : MeetingParticipant ; } ; private function meetingParticipantFromCallParticipant ( callParticipant ) { return { id : callParticipant . identifier , meetingEndReason : callParticipant . callEndReason , displayName : callParticipant . displayName , state : callParticipant . state , videoStreams : callParticipant . videoStreams , isMuted : callParticipant . isMuted , isSpeaking : callParticipant . isSpeaking } ; } private function callParticipantFromMeetingParticipant ( meetingParticipant ) { return { identifier : meetingParticipant . id , callEndReason : meetingParticipant . meetingEndReason , displayName : meetingParticipant . displayName , state : meetingParticipant . state , videoStreams : meetingParticipant . videoStreams , isMuted : meetingParticipant . isMuted , isSpeaking : meetingParticipant . isSpeaking } ; } type RemoteCallParticipants = { [ keys ] : RemoteParticipantState ; } ; private export function meetingParticipantsFromCallParticipants ( callParticipants ) { const meetingParticipants = { } ; for ( const [ key , value ] of Object . entries ( callParticipants ) ) { meetingParticipants [ key ] = meetingParticipantFromCallParticipant ( value ) ; } return meetingParticipants ; } private export function callParticipantsFromMeetingParticipants ( meetingParticipants ) { const callParticipants = { } ; for ( const [ key , value ] of Object . entries ( meetingParticipants ) ) { callParticipants [ key ] = callParticipantFromMeetingParticipant ( value ) ; } return callParticipants ; }