import { CallState , DeviceManagerState } from '@internal/calling-stateful-client' ; import type { AudioDeviceInfo , VideoDeviceInfo , Call , PermissionConstraints , RemoteParticipant , MediaDiagnosticChangedEventArgs , NetworkDiagnosticChangedEventArgs } from '@azure/communication-calling' ; import { VideoStreamOptions } from '@internal/react-components' ; import type { CommunicationIdentifierKind } from '@azure/communication-common' ; import type { AdapterState , Disposable , AdapterError , AdapterErrors } from '../../common/adapters' ; /**
 * Major UI screens shown in the  CallComposite .
 *
 *  public export type CallCompositePage = 'accessDeniedTeamsMeeting' | 'call' | 'configuration' | 'joinCallFailedDueToNoNetwork' | 'leftCall' | 'lobby' | 'removedFromCall' ; /**
 *  CallAdapter state for pure UI purposes.
 *
 *  public export type CallAdapterUiState = { isLocalPreviewMicrophoneEnabled : boolean ; page : CallCompositePage ; } ; /**
 *  CallAdapter state inferred from Azure Communication Services backend.
 *
 *  public export type CallAdapterClientState = { userId : CommunicationIdentifierKind ; displayName ? : string ; call ? : CallState ; devices : DeviceManagerState ; endedCall ? : CallState ; isTeamsCall : boolean ; /**
     * Latest error encountered for each operation performed via the adapter.
     */ latestErrors : AdapterErrors ; } ; /**
 *  CallAdapter state.
 *
 *  public export type CallAdapterState = CallAdapterUiState & CallAdapterClientState ; /**
 * Callback for  CallAdapterSubscribers 'participantsJoined' event.
 *
 *  public export type ParticipantsJoinedListener = ( event : { joined : RemoteParticipant [ ] ; } ) => void ; /**
 * Callback for  CallAdapterSubscribers 'participantsLeft' event.
 *
 *  public export type ParticipantsLeftListener = ( event : { removed : RemoteParticipant [ ] ; } ) => void ; /**
 * Callback for  CallAdapterSubscribers 'isMuted' event.
 *
 *  public export type IsMutedChangedListener = ( event : { identifier : CommunicationIdentifierKind ; isMuted : boolean ; } ) => void ; /**
 * Callback for  CallAdapterSubscribers 'callIdChanged' event.
 *
 *  public export type CallIdChangedListener = ( event : { callId : string ; } ) => void ; /**
 * Callback for  CallAdapterSubscribers 'isLocalScreenSharingActiveChanged' event.
 *
 *  public export type IsLocalScreenSharingActiveChangedListener = ( event : { isScreenSharingOn : boolean ; } ) => void ; /**
 * Callback for  CallAdapterSubscribers 'isSpeakingChanged' event.
 *
 *  public export type IsSpeakingChangedListener = ( event : { identifier : CommunicationIdentifierKind ; isSpeaking : boolean ; } ) => void ; /**
 * Callback for  CallAdapterSubscribers 'displayNameChanged' event.
 *
 *  public export type DisplayNameChangedListener = ( event : { participantId : CommunicationIdentifierKind ; displayName : string ; } ) => void ; /**
 * Callback for  CallAdapterSubscribers 'callEnded' event.
 *
 *  public export type CallEndedListener = ( event : { callId : string ; } ) => void ; /**
 * Payload for  DiagnosticChangedEventListner where there is a change in a media diagnostic.
 *
 *  public export type MediaDiagnosticChangedEvent = MediaDiagnosticChangedEventArgs & { type : 'media' ; } ; /**
 * Payload for  DiagnosticChangedEventListner where there is a change in a network diagnostic.
 *
 *  public export type NetworkDiagnosticChangedEvent = NetworkDiagnosticChangedEventArgs & { type : 'network' ; } ; /**
 * Callback for  CallAdapterSubscribers 'diagnosticChanged' event.
 *
 *  public export type DiagnosticChangedEventListner = ( event : MediaDiagnosticChangedEvent | NetworkDiagnosticChangedEvent ) => void ; public export interface CallAdapterCallManagement { param microphoneOn public joinCall ( microphoneOn ? ) : Call | undefined ; param forEveryone public leaveCall ( forEveryone ? ) : Promise < void > ; param options - Options to control how video streams are rendered  {@link @azure/communication-calling#VideoStreamOptions } public startCamera ( options ? ) : Promise < void > ; public stopCamera ( ) : Promise < void > ; public mute ( ) : Promise < void > ; public unmute ( ) : Promise < void > ; param participants public startCall ( participants ) : Call | undefined ; public startScreenShare ( ) : Promise < void > ; public stopScreenShare ( ) : Promise < void > ; param userId public removeParticipant ( userId ) : Promise < void > ; remarks param remoteUserId param options - Options to control how video streams are rendered  {@link @azure/communication-calling#VideoStreamOptions } public createStreamView ( remoteUserId ? , options ? ) : Promise < void > ; remarks param remoteUserId param options - Options to control how video streams are rendered  {@link @azure/communication-calling#VideoStreamOptions } public disposeStreamView ( remoteUserId ? , options ? ) : Promise < void > ; } public export interface CallAdapterDeviceManagement { remarks param constrain - Define constraints for accessing local devices  {@link @azure/communication-calling#PermissionConstraints } public askDevicePermission ( constrain ) : Promise < void > ; remarks return An array of video device information entities  {@link @azure/communication-calling#VideoDeviceInfo } public queryCameras ( ) : Promise < VideoDeviceInfo [ ] > ; remarks return An array of audio device information entities  {@link @azure/communication-calling#AudioDeviceInfo } public queryMicrophones ( ) : Promise < AudioDeviceInfo [ ] > ; remarks return An array of audio device information entities  {@link @azure/communication-calling#AudioDeviceInfo } public querySpeakers ( ) : Promise < AudioDeviceInfo [ ] > ; param sourceInfo - Camera device to choose, pick one returned by   CallAdapterDeviceManagement param options - Options to control how the camera stream is rendered  {@link @azure/communication-calling#VideoStreamOptions } public setCamera ( sourceInfo , options ? ) : Promise < void > ; param sourceInfo - Microphone device to choose, pick one returned by  CallAdapterDeviceManagement public setMicrophone ( sourceInfo ) : Promise < void > ; param sourceInfo - Speaker device to choose, pick one returned by  CallAdapterDeviceManagement public setSpeaker ( sourceInfo ) : Promise < void > ; } public export interface CallAdapterSubscribers { /**
     * Subscribe function for 'participantsJoined' event.
     */ on ( event , listener ) : void ; /**
     * Subscribe function for 'participantsLeft' event.
     */ on ( event , listener ) : void ; remarks on ( event , listener ) : void ; remarks on ( event , listener ) : void ; /**
     * Subscribe function for 'isLocalScreenSharingActiveChanged' event.
     */ on ( event , listener ) : void ; /**
     * Subscribe function for 'displayNameChanged' event.
     */ on ( event , listener ) : void ; /**
     * Subscribe function for 'isSpeakingChanged' event.
     */ on ( event , listener ) : void ; /**
     * Subscribe function for 'callEnded' event.
     */ on ( event , listener ) : void ; /**
     * Subscribe function for 'diagnosticChanged' event.
     *
     * This event fires whenever there is a change in user facing diagnostics about the ongoing call.
     */ on ( event , listener ) : void ; /**
     * Subscribe function for 'error' event.
     */ on ( event , listener ) : void ; /**
     * Unsubscribe function for 'participantsJoined' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'participantsLeft' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'isMutedChanged' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'callIdChanged' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'isLocalScreenSharingActiveChanged' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'displayNameChanged' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'isSpeakingChanged' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'callEnded' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'diagnosticChanged' event.
     */ off ( event , listener ) : void ; /**
     * Unsubscribe function for 'error' event.
     */ off ( event , listener ) : void ; } /**
 *  CallComposite Adapter interface.
 *
 *  public export interface CallAdapter extends AdapterState < CallAdapterState > , Disposable , CallAdapterCallManagement , CallAdapterDeviceManagement , CallAdapterSubscribers { }