@azure/communication-react 1.24.0-alpha-202501290016 → 1.24.0-alpha-202501300015

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/dist/communication-react.d.ts +112 -5
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DFTHjaH_.js → ChatMessageComponentAsRichTextEditBox-B7usiRRs.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-DFTHjaH_.js.map → ChatMessageComponentAsRichTextEditBox-B7usiRRs.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-B1uO80N9.js → RichTextSendBoxWrapper-BUOpEC0L.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-B1uO80N9.js.map → RichTextSendBoxWrapper-BUOpEC0L.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-B2zHVkUS.js → index-BYO_RzRh.js} +490 -99
  7. package/dist/dist-cjs/communication-react/index-BYO_RzRh.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +11 -4
  12. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +12 -2
  13. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.d.ts +9 -0
  15. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js +102 -5
  16. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +1 -0
  18. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +8 -17
  19. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +7 -21
  21. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  22. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +3 -11
  23. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  24. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +2 -3
  25. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +0 -1
  26. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
  27. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +1 -1
  28. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +1 -9
  29. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  30. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +1 -7
  31. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  32. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +61 -1
  33. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  34. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +5 -0
  35. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +110 -6
  36. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  37. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
  38. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +9 -3
  39. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  40. package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +6 -0
  41. package/dist/dist-esm/calling-stateful-client/src/Converter.js +12 -0
  42. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  43. package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.d.ts +16 -0
  44. package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.js +25 -0
  45. package/dist/dist-esm/calling-stateful-client/src/RealTimeTextSubscriber.js.map +1 -0
  46. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  47. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +1 -1
  49. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +4 -4
  50. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  51. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.d.ts +4 -0
  52. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js +1 -1
  53. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js.map +1 -1
  54. package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.d.ts +2 -2
  55. package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.js.map +1 -1
  56. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +1 -1
  57. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -0
  58. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  59. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +5 -0
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +20 -4
  61. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  62. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +22 -0
  63. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  64. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +1 -0
  65. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +23 -3
  67. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  68. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +4 -0
  69. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  70. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -0
  71. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  72. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +9 -0
  73. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +12 -0
  74. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  75. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +4 -0
  76. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +16 -0
  77. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  78. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +10 -1
  79. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  80. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -0
  81. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +6 -0
  82. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  83. package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.d.ts +1 -0
  84. package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js +3 -1
  85. package/dist/dist-esm/react-composites/src/composites/common/CallingCaptionsBanner.js.map +1 -1
  86. package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.d.ts +12 -0
  87. package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.js +23 -0
  88. package/dist/dist-esm/react-composites/src/composites/common/CallingRealTimeTextModal.js.map +1 -0
  89. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +3 -0
  90. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +27 -2
  91. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  92. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +3 -0
  93. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +48 -0
  94. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
  95. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +3 -0
  96. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +36 -0
  97. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  98. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.d.ts +1 -1
  99. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js.map +1 -1
  100. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +3 -0
  101. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
  102. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +1 -0
  103. package/package.json +1 -1
  104. package/dist/dist-cjs/communication-react/index-B2zHVkUS.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CallClientState.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallClientState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA0gClC;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAclC,YAAY,MAAuB,EAAE,UAAiB,EAAE,SAAgB;QACtE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,8EAA8E;QAC9E,IAAI,CAAC,SAAS,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n AudioDeviceInfo,\n CallDirection,\n CallEndReason,\n CallerInfo,\n CallState as CallStatus,\n DeviceAccess,\n DominantSpeakersInfo,\n IncomingCallKind,\n LatestMediaDiagnostics,\n LatestNetworkDiagnostics,\n MediaStreamType,\n ParticipantRole,\n RemoteParticipantState as RemoteParticipantStatus,\n ScalingMode,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoom, BreakoutRoomsSettings } from '@azure/communication-calling';\n/* @conditional-compile-remove(remote-ufd) */\nimport type {\n ServerDiagnosticType,\n MediaDiagnosticType,\n NetworkDiagnosticType,\n DiagnosticValueType,\n DiagnosticQuality,\n DiagnosticFlag\n} from '@azure/communication-calling';\nimport { TeamsCallInfo } from '@azure/communication-calling';\nimport { CallInfo } from '@azure/communication-calling';\nimport { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communication-calling';\nimport { CaptionsResultType } from '@azure/communication-calling';\nimport { CaptionsKind } from '@azure/communication-calling';\nimport { VideoEffectName } from '@azure/communication-calling';\nimport { CallKind } from '@azure/communication-calling';\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { ReactionMessage } from '@azure/communication-calling';\nimport { SpotlightedParticipant } from '@azure/communication-calling';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingInfo, RecordingInfo } from '@azure/communication-calling';\n\n/**\n * State only version of {@link @azure/communication-calling#CallAgent} except calls is moved to be a child directly of\n * {@link CallClientState} and not included here. The reason to have CallAgent's state proxied is to provide access to\n * displayName. We don't flatten CallAgent.displayName and put it in CallClientState because it would be ambiguious that\n * displayName is actually reliant on the creation/existence of CallAgent to be available.\n *\n * @public\n */\nexport interface CallAgentState {\n /**\n * Proxy of {@link @azure/communication-calling#CallAgent.displayName}.\n */\n displayName?: string;\n}\n\n/**\n * @public\n */\nexport interface CaptionsInfo {\n /**\n * The state in which this caption data can be classified.\n */\n resultType: CaptionsResultType;\n /**\n * The information of the call participant who spoke the captioned text.\n */\n speaker: CallerInfo;\n /**\n * The language that the spoken words were interpretted as. Corresponds to the language specified in startCaptions / setSpokenLanguage.\n */\n spokenLanguage: string;\n /**\n * The caption text.\n */\n captionText: string;\n /**\n * Timestamp of when the captioned words were initially spoken.\n */\n timestamp: Date;\n /**\n * The language that the captions are presented in. Corresponds to the captionLanguage specified in startCaptions / setCaptionLanguage.\n */\n captionLanguage?: string;\n /**\n * The original spoken caption text prior to translating to subtitle language\n */\n spokenText?: string;\n}\n\n/**\n * @public\n */\nexport interface CaptionsCallFeatureState {\n /**\n * supported spoken languages\n */\n supportedSpokenLanguages: string[];\n /**\n * array of received captions\n */\n captions: CaptionsInfo[];\n /**\n * whether captions is on/off\n */\n isCaptionsFeatureActive: boolean;\n /**\n * whether start captions button is clicked or now\n */\n startCaptionsInProgress: boolean;\n /**\n * supported caption languages\n */\n supportedCaptionLanguages: string[];\n /**\n * current spoken language\n */\n currentSpokenLanguage: string;\n /**\n * current caption language\n */\n currentCaptionLanguage: string;\n\n /**\n * current caption kind: teams or acs captions\n */\n captionsKind: CaptionsKind;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#TranscriptionCallFeature}. {@link StatefulCallClient} will\n * automatically listen for transcription state of the call and update the state exposed by {@link StatefulCallClient}\n * accordingly.\n *\n * @public\n */\nexport interface TranscriptionCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#TranscriptionCallFeature.isTranscriptionActive}.\n */\n isTranscriptionActive: boolean;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#CapabilitiesFeature}\n *\n * @public\n */\nexport interface CapabilitiesFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#CapabilitiesFeature.capabilities}.\n */\n capabilities: ParticipantCapabilities;\n /**\n * Proxy of the latest {@link @azure/communication-calling#CapabilitiesChangeInfo}\n */\n latestCapabilitiesChangeInfo: CapabilitiesChangeInfo;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#SpotlightCallFeature}\n *\n * @public\n */\nexport interface SpotlightCallFeatureState {\n /**\n * Ordered array of spotlighted participants in call\n */\n spotlightedParticipants: SpotlightedParticipant[];\n /**\n * Local participant spotlight\n */\n localParticipantSpotlight?: SpotlightState;\n /**\n * Proxy of {@link @azure/communication-calling#SpotlightCallFeature.maxParticipantsToSpotlight}.\n */\n maxParticipantsToSpotlight: number;\n}\n\n/**\n * Spotlight state with order\n *\n * @public\n */\nexport interface SpotlightState {\n /**\n * Order position of spotlight in call\n */\n spotlightedOrderPosition?: number;\n}\n\n/* @conditional-compile-remove(breakout-rooms) */\n/**\n * Breakout rooms state\n *\n * @public\n */\nexport interface BreakoutRoomsState {\n assignedBreakoutRoom?: BreakoutRoom;\n breakoutRoomSettings?: BreakoutRoomsSettings;\n breakoutRoomOriginCallId?: string;\n breakoutRoomDisplayName?: string;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#RecordingCallFeature}. {@link StatefulCallClient} will\n * automatically listen for recording state of the call and update the state exposed by {@link StatefulCallClient} accordingly.\n *\n * @public\n */\nexport interface RecordingCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#RecordingCallFeature.isRecordingActive}.\n */\n isRecordingActive: boolean;\n /* @conditional-compile-remove(local-recording-notification) */\n /**\n * Contains list of information of started recordings\n * Proxy of {@link @azure/communication-calling#RecordingCallFeature.recordings}.\n */\n activeRecordings?: RecordingInfo[];\n /* @conditional-compile-remove(local-recording-notification) */\n /**\n * Contains list of information of stopped recordings\n */\n lastStoppedRecording?: RecordingInfo[];\n}\n\n/* @conditional-compile-remove(local-recording-notification) */\n/**\n * State only version of {@link @azure/communication-calling#LocalRecordingCallFeature}. {@link StatefulCallClient} will\n * automatically listen for local recording state of the call and update the state exposed by {@link StatefulCallClient} accordingly.\n *\n * @beta\n */\nexport interface LocalRecordingCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#LocalRecordingCallFeature.isRecordingActive}.\n */\n isLocalRecordingActive: boolean;\n /**\n * Contains list of information of started recordings\n * Proxy of {@link @azure/communication-calling#LocalRecordingCallFeature.recordings}.\n */\n activeLocalRecordings?: LocalRecordingInfo[];\n /**\n * Contains list of information of stopped recordings\n */\n lastStoppedLocalRecording?: LocalRecordingInfo[];\n}\n\n/**\n * State only version of {@link @azure/communication-calling#RaiseHandCallFeature}. {@link StatefulCallClient} will\n * automatically listen for raised hands on the call and update the state exposed by {@link StatefulCallClient} accordingly.\n *\n * @public\n */\nexport interface RaiseHandCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#RaiseHandCallFeature.raisedHands}.\n */\n raisedHands: RaisedHandState[];\n /**\n * Contains information for local participant from list {@link @azure/communication-calling#RaiseHandCallFeature.raisedHands}.\n */\n localParticipantRaisedHand?: RaisedHandState;\n}\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * Represents the name of the call feature stream\n * @beta\n */\nexport type CallFeatureStreamName = 'togetherMode';\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * State only version of {@link @azure/communication-calling#CallFeatureStream}.\n * Represents call feature stream state.\n * @beta\n */\nexport interface CallFeatureStreamState extends RemoteVideoStreamState {\n feature?: CallFeatureStreamName;\n}\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * State only version of {@link @azure/communication-calling#TogetherModeSeatingMap}.\n * @beta\n *\n * Represents the seating position of a participant in Together Mode.\n */\nexport interface TogetherModeSeatingPositionState {\n /* The top left offset from the top of the together mode view.*/\n top: number;\n /* The left offset position from the left of the together mode view. */\n left: number;\n /* The width of the seating area */\n width: number;\n /* The height of the seating area. */\n height: number;\n}\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * Represents the seating positions of participants in Together Mode.\n *\n * @beta\n */\nexport type TogetherModeParticipantSeatingState = Record<string, TogetherModeSeatingPositionState>;\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * Represents the streams in Together Mode.\n *\n * @beta\n */\nexport interface TogetherModeStreamsState {\n mainVideoStream?: CallFeatureStreamState;\n}\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * State only version of {@link @azure/communication-calling#TogetherModeCallFeature}. {@link StatefulCallClient}.\n * Represents the state of the Together Mode feature.\n * @beta\n */\nexport interface TogetherModeCallFeatureState {\n isActive: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#TogetherModeCallFeature.togetherModeStream}.\n */\n streams: TogetherModeStreamsState;\n /**\n * Proxy of {@link @azure/communication-calling#TogetherModeCallFeature.TogetherModeSeatingMap}.\n */\n seatingPositions: TogetherModeParticipantSeatingState;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#PPTLiveCallFeature}. {@link StatefulCallClient} will\n * automatically listen for pptLive on the call and update the state exposed by {@link StatefulCallClient} accordingly.\n *\n * @public\n */\nexport interface PPTLiveCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#PPTLiveCallFeature.isActive}.\n */\n isActive: boolean;\n}\n/**\n * Raised hand state with order\n *\n * @public\n */\nexport type RaisedHandState = {\n raisedHandOrderPosition: number;\n};\n\n/**\n * State only version of {@link @azure/communication-calling#Call.ReactionMessage} with UI helper props receivedOn.\n * Reaction state with a timestamp which helps UI to decide to render the reaction accordingly.\n *\n * @public\n */\nexport type ReactionState = {\n /**\n * Reaction message from the meeting {@link @azure/communication-calling#Call.ReactionMessage}\n */\n reactionMessage: ReactionMessage;\n /**\n * Received timestamp of the reaction message in a meeting.\n */\n receivedOn: Date;\n};\n\n/**\n * State only version of {@link @azure/communication-calling#LocalVideoStream}.\n *\n * @public\n */\nexport interface LocalVideoStreamState {\n /**\n * Proxy of {@link @azure/communication-calling#LocalVideoStream.source}.\n */\n source: VideoDeviceInfo;\n /**\n * Proxy of {@link @azure/communication-calling#LocalVideoStream.mediaStreamType}.\n */\n mediaStreamType: MediaStreamType;\n /**\n * {@link VideoStreamRendererView} that is managed by createView/disposeView in {@link StatefulCallClient}\n * API. This can be undefined if the stream has not yet been rendered and defined after createView creates the view.\n */\n view?: VideoStreamRendererViewState;\n\n /**\n * Stores the state of the video effects.\n * @public\n */\n videoEffects?: LocalVideoStreamVideoEffectsState;\n}\n\n/**\n * State only version of a LocalVideoStream's {@link @azure/communication-calling#VideoEffectsFeature}.\n *\n * @public\n */\nexport interface LocalVideoStreamVideoEffectsState {\n /**\n * List of effects if any are active.\n */\n activeEffects?: VideoEffectName[];\n}\n\n/**\n * State only version of Optimal Video Count Feature {@link @azure/communication-calling#OptimalVideoCountCallFeature}.\n *\n * @public\n */\nexport interface OptimalVideoCountFeatureState {\n /**\n * State of the current optimal video count.\n */\n maxRemoteVideoStreams: number;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#RemoteVideoStream}.\n *\n * @public\n */\nexport interface RemoteVideoStreamState {\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.id}.\n */\n id: number;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.mediaStreamType}.\n */\n mediaStreamType: MediaStreamType;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.isAvailable}.\n */\n isAvailable: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.isReceiving}.\n * @public\n */\n isReceiving: boolean;\n /**\n * {@link VideoStreamRendererView} that is managed by createView/disposeView in {@link StatefulCallClient}\n * API. This can be undefined if the stream has not yet been rendered and defined after createView creates the view.\n */\n view?: VideoStreamRendererViewState;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.size}.\n */\n streamSize?: { width: number; height: number };\n}\n\n/**\n * State only version of {@link @azure/communication-calling#VideoStreamRendererView}. This property is added to the state exposed\n * by {@link StatefulCallClient} by {@link StatefulCallClient.createView} and removed by {@link StatefulCallClient.disposeView}.\n *\n * @public\n */\nexport interface VideoStreamRendererViewState {\n /**\n * Proxy of {@link @azure/communication-calling#VideoStreamRendererView.scalingMode}.\n */\n scalingMode: ScalingMode;\n /**\n * Proxy of {@link @azure/communication-calling#VideoStreamRendererView.isMirrored}.\n */\n isMirrored: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#VideoStreamRendererView.target}.\n */\n target: HTMLElement;\n}\n\n/**\n * Media access state\n * @public\n */\nexport interface MediaAccessState {\n /**\n * Whether the audio is forcibly muted\n */\n isAudioPermitted: boolean;\n /**\n * Whether the video is forcibly muted\n */\n isVideoPermitted: boolean;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#RemoteParticipant}. {@link StatefulCallClient} will\n * automatically retrieve RemoteParticipants and add their state to the state exposed by {@link StatefulCallClient}.\n *\n * @public\n */\nexport interface RemoteParticipantState {\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.identifier}.\n */\n identifier: CommunicationIdentifierKind;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.displayName}.\n */\n displayName?: string;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.state}.\n */\n state: RemoteParticipantStatus;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.callEndReason}.\n */\n callEndReason?: CallEndReason;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.videoStreams} as an object with\n * {@link RemoteVideoStream} fields keyed by {@link @azure/communication-calling#RemoteVideoStream.id}.\n */\n videoStreams: { [key: number]: RemoteVideoStreamState };\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.isMuted}.\n */\n isMuted: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.isSpeaking}.\n */\n isSpeaking: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.role}.\n */\n role?: ParticipantRole;\n /**\n * Proxy of {@link @azure/communication-calling#Call.RaisedHand.raisedHands}.\n */\n raisedHand?: RaisedHandState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.PPTLive.target}.\n *\n * @public\n */\n contentSharingStream?: HTMLElement;\n /**\n * Proxy of {@link @azure/communication-calling#Call.ReactionMessage} with\n * UI helper props receivedOn which indicates the timestamp when the message was received.\n *\n * @public\n */\n reactionState?: ReactionState;\n /**\n * Proxy of {@link @azure/communication-calling#SpotlightCallFeature.spotlightedParticipants}.\n */\n spotlight?: SpotlightState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.MediaAccessCallFeature.MediaAccess}.\n */\n mediaAccess?: MediaAccessState;\n /* @conditional-compile-remove(remote-ufd) */\n /**\n * The diagnostic status of RemoteParticipant{@link @azure/communication-calling#RemoteDiagnostics}.\n */\n diagnostics?: Partial<Record<RemoteDiagnosticType, RemoteDiagnosticState>>;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#Call}. {@link StatefulCallClient} will automatically\n * retrieve Call's state and add it to the state exposed by {@link StatefulCallClient}.\n *\n * @public\n */\nexport interface CallState {\n /**\n * Proxy of {@link @azure/communication-calling#Call.id}.\n */\n id: string;\n\n /**\n * Type of the call.\n */\n kind: CallKind;\n /**\n * Proxy of {@link @azure/communication-calling#Call.callerInfo}.\n */\n callerInfo: CallerInfo;\n /**\n * Proxy of {@link @azure/communication-calling#Call.state}.\n */\n state: CallStatus;\n /**\n * Proxy of {@link @azure/communication-calling#Call.callEndReason}.\n */\n callEndReason?: CallEndReason;\n /**\n * Proxy of {@link @azure/communication-calling#Call.direction}.\n */\n direction: CallDirection;\n /**\n * Proxy of {@link @azure/communication-calling#Call.isMuted}.\n */\n isMuted: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#Call.isScreenSharingOn}.\n */\n isScreenSharingOn: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#DominantSpeakersInfo }.\n */\n dominantSpeakers?: DominantSpeakersInfo;\n /**\n * Proxy of {@link @azure/communication-calling#Call.localVideoStreams}.\n */\n localVideoStreams: LocalVideoStreamState[];\n /**\n * Proxy of {@link @azure/communication-calling#Call.remoteParticipants}.\n * Object with {@link RemoteParticipant} fields keyed by flattened {@link RemoteParticipantState.identifier}.\n * To obtain a flattened {@link RemoteParticipantState.identifier}, use\n * {@link @azure/communication-react#toFlatCommunicationIdentifier}.\n */\n remoteParticipants: { [keys: string]: RemoteParticipantState };\n /**\n * Stores remote participants that have left the call so that the callEndReason could be retrieved.\n * Object with {@link RemoteParticipant} fields keyed by flattened {@link RemoteParticipantState.identifier}.\n * To obtain a flattened {@link RemoteParticipantState.identifier}, use\n * {@link @azure/communication-react#toFlatCommunicationIdentifier}.\n */\n remoteParticipantsEnded: { [keys: string]: RemoteParticipantState };\n /**\n * Proxy of {@link @azure/communication-calling#TranscriptionCallFeature}.\n */\n transcription: TranscriptionCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#TranscriptionCallFeature}.\n */\n captionsFeature: CaptionsCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#OptimalVideoCountCallFeature}.\n */\n optimalVideoCount: OptimalVideoCountFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#RecordingCallFeature}.\n */\n recording: RecordingCallFeatureState;\n /* @conditional-compile-remove(local-recording-notification) */\n /**\n * Proxy of {@link @azure/communication-calling#LocalRecordingCallFeature}.\n */\n localRecording: LocalRecordingCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#PPTLiveCallFeature}.\n *\n *@public\n */\n pptLive: PPTLiveCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#RaiseHandCallFeature}.\n */\n raiseHand: RaiseHandCallFeatureState;\n /* @conditional-compile-remove(together-mode) */\n /**\n * Proxy of {@link @azure/communication-calling#TogetherModeCallFeature}.\n * @beta\n */\n togetherMode: TogetherModeCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.ReactionMessage} with\n * UI helper props receivedOn which indicates the timestamp when the message was received.\n *\n * @public\n */\n localParticipantReaction?: ReactionState;\n /**\n * Stores the currently active screenshare participant's key. If there is no screenshare active, then this will be\n * undefined. You can use this key to access the remoteParticipant data in {@link CallState.remoteParticipants} object.\n *\n * Note this only applies to ScreenShare in RemoteParticipant. A local ScreenShare being active will not affect this\n * property.\n *\n * This property is added by the stateful layer and is not a proxy of SDK state\n */\n screenShareRemoteParticipant?: string;\n /**\n * Stores the currently active pptlive participant's key. Will be reused by White board etc. If there is no screenshare active, then this will be\n * undefined. You can use this key to access the remoteParticipant data in {@link CallState.remoteParticipants} object.\n *\n * Note this only applies to PPTLive in RemoteParticipant.\n *\n * This property is added by the stateful layer and is not a proxy of SDK state\n *\n * @public\n */\n contentSharingRemoteParticipant?: string;\n /**\n * Stores the local date when the call started on the client. This property is added by the stateful layer and is not\n * a proxy of SDK state.\n */\n startTime: Date;\n /**\n * Stores the local date when the call ended on the client. This property is added by the stateful layer and is not\n * a proxy of SDK state.\n */\n endTime: Date | undefined;\n\n /**\n * Stores the latest call diagnostics.\n */\n diagnostics: DiagnosticsCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.role}.\n */\n role?: ParticipantRole;\n\n /* @conditional-compile-remove(total-participant-count) */\n /**\n * Proxy of {@link @azure/communication-calling#Call.totalParticipantCount}.\n */\n totalParticipantCount?: number;\n /**\n * Transfer state of call\n */\n transfer: TransferFeatureState;\n\n /**\n * Proxy of {@link @azure/communication-calling#CapabilitiesFeature}.\n */\n capabilitiesFeature?: CapabilitiesFeatureState;\n /**\n * Hide attendee names in teams meeting\n */\n hideAttendeeNames?: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#SpotlightCallFeature}.\n */\n spotlight?: SpotlightCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.info}.\n */\n info?: TeamsCallInfo | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n\n /**\n * Proxy of {@link @azure/communication-calling#TeamsMeetingAudioConferencingCallFeature}.\n */\n meetingConference?: { conferencePhones: ConferencePhoneInfo[] };\n\n /* @conditional-compile-remove(breakout-rooms) */\n /**\n * Proxy of {@link @azure/communication-calling#BreakoutRoomsFeature}.\n */\n breakoutRooms?: BreakoutRoomsState;\n\n /**\n * Proxy of {@link @azure/communication-calling#MediaAccessFeature}.\n */\n meetingMediaAccess?: MediaAccessState;\n}\n\n/**\n * Transfer feature state\n *\n * @public\n */\nexport interface TransferFeatureState {\n /**\n * Accepted transfer requests\n */\n acceptedTransfers: { [key: string]: AcceptedTransfer };\n}\n\n/**\n * Transfer feature state\n *\n * @public\n */\nexport interface AcceptedTransfer {\n /**\n * Stores call id of accepted transfer\n */\n callId: string;\n /**\n * Stores timestamp when transfer was accepted\n */\n timestamp: Date;\n}\n\n/**\n * State to track the types {@link CallInfo} and {@link TeamsCallInfo}\n * @public\n */\nexport interface CallInfoState {\n /**\n * GroupId of the call that you joined\n */\n groupId?: string;\n /**\n * The teams meeting thread id\n */\n threadId?: string;\n /**\n * participant id of the local user\n */\n participantId: string;\n /**\n * Differentiator between the Call and TeamsCall types\n */\n kind: IncomingCallKind;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#IncomingCall}. {@link StatefulCallClient} will\n * automatically detect incoming calls and add their state to the state exposed by {@link StatefulCallClient}.\n *\n * @public\n */\nexport interface IncomingCallState {\n /**\n * Proxy of {@link @azure/communication-calling#IncomingCall.id}.\n */\n id: string;\n /**\n * Proxy of {@link @azure/communication-calling#IncomingCall.callInfo}.\n */\n info: CallInfoState;\n /**\n * Proxy of {@link @azure/communication-calling#IncomingCall.callerInfo}.\n */\n callerInfo: CallerInfo;\n /**\n * Set to the state returned by 'callEnded' event on {@link @azure/communication-calling#IncomingCall} when received.\n * This property is added by the stateful layer and is not a proxy of SDK state.\n */\n callEndReason?: CallEndReason;\n /**\n * Stores the local date when the call started on the client. This property is added by the stateful layer and is not\n * a proxy of SDK state.\n */\n startTime: Date;\n /**\n * Stores the local date when the call ended on the client. This property is added by the stateful layer and is not a\n * proxy of SDK state. It is undefined if the call is not ended yet.\n */\n endTime?: Date;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#TeamsIncomingCall}\n * @public\n */\nexport interface TeamsIncomingCallState {\n /**\n * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.id}.\n */\n id: string;\n /**\n * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.teamsCallInfo}.\n */\n info: CallInfoState;\n /**\n * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.callerInfo}.\n */\n callerInfo: CallerInfo;\n /**\n * Set to the state returned by 'callEnded' event on {@link @azure/communication-calling#IncomingCall} when received.\n * This property is added by the stateful layer and is not a proxy of SDK state.\n */\n callEndReason?: CallEndReason;\n /**\n * Stores the local date when the call started on the client. This property is added by the stateful layer and is not\n * a proxy of SDK state.\n */\n startTime: Date;\n /**\n * Stores the local date when the call ended on the client. This property is added by the stateful layer and is not a\n * proxy of SDK state. It is undefined if the call is not ended yet.\n */\n endTime?: Date;\n}\n\n/**\n * This type is meant to encapsulate all the state inside {@link @azure/communication-calling#DeviceManager}. For\n * optional parameters they may not be available until permission is granted by the user. The cameras, microphones,\n * speakers, and deviceAccess states will be empty until the corresponding\n * {@link @azure/communication-calling#DeviceManager}'s getCameras, getMicrophones, getSpeakers, and askDevicePermission\n * APIs are called and completed.\n *\n * @public\n */\nexport type DeviceManagerState = {\n /**\n * Proxy of {@link @azure/communication-calling#DeviceManager.isSpeakerSelectionAvailable}.\n */\n isSpeakerSelectionAvailable: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#DeviceManager.selectedMicrophone}.\n */\n selectedMicrophone?: AudioDeviceInfo;\n /**\n * Proxy of {@link @azure/communication-calling#DeviceManager.selectedSpeaker}.\n */\n selectedSpeaker?: AudioDeviceInfo;\n /**\n * Stores the selected camera device info. This is added by the stateful layer and does not exist in the Calling SDK.\n * It is meant as a convenience to the developer. It must be explicitly set before it has any value and does not\n * persist across instances of the {@link StatefulCallClient}. The developer controls entirely what this value holds\n * at any time.\n */\n selectedCamera?: VideoDeviceInfo;\n /**\n * Stores any cameras data returned from {@link @azure/communication-calling#DeviceManager.getCameras}.\n */\n cameras: VideoDeviceInfo[];\n /**\n * Stores any microphones data returned from {@link @azure/communication-calling#DeviceManager.getMicrophones}.\n */\n microphones: AudioDeviceInfo[];\n /**\n * Stores any speakers data returned from {@link @azure/communication-calling#DeviceManager.getSpeakers}.\n */\n speakers: AudioDeviceInfo[];\n /**\n * Stores deviceAccess data returned from {@link @azure/communication-calling#DeviceManager.askDevicePermission}.\n */\n deviceAccess?: DeviceAccess;\n /**\n * Stores created views that are not associated with any CallState (when {@link StatefulCallClient.createView} is\n * called with undefined callId, undefined participantId, and defined LocalVideoStream).\n *\n * The values in this array are generated internally when {@link StatefulCallClient.createView} is called and are\n * considered immutable.\n */\n unparentedViews: LocalVideoStreamState[];\n};\n\n/**\n * Container for all of the state data proxied by {@link StatefulCallClient}. The calls, callsEnded, incomingCalls, and\n * incomingCallsEnded states will be automatically provided if a callAgent has been created. The deviceManager will be\n * empty initially until populated see {@link DeviceManagerState}. The userId state is provided as a convenience for the\n * developer and is completely controled and set by the developer.\n *\n * @public\n */\nexport interface CallClientState {\n /**\n * Proxy of {@link @azure/communication-calling#CallAgent.calls} as an object with CallState {@link CallState} fields.\n * It is keyed by {@link @azure/communication-calling#Call.id}. Please note that\n * {@link @azure/communication-calling#Call.id} could change. You should not cache the id itself but the entire\n * {@link @azure/communication-calling#Call} and then use the id contained to look up data in this map.\n */\n calls: { [key: string]: CallState };\n /**\n * Calls that have ended are stored here so the callEndReason could be checked.\n * It is an object with {@link @azure/communication-calling#Call.id} keys and {@link CallState} values.\n *\n * Only {@link MAX_CALL_HISTORY_LENGTH} Calls are kept in the history. Oldest calls are evicted if required.\n */\n callsEnded: { [key: string]: CallState };\n /**\n * Proxy of {@link @azure/communication-calling#IncomingCall} as an object with {@link IncomingCall} fields.\n * It is keyed by {@link @azure/communication-calling#IncomingCall.id}.\n */\n incomingCalls: {\n [key: string]: IncomingCallState | TeamsIncomingCallState;\n };\n /**\n * Incoming Calls that have ended are stored here so the callEndReason could be checked.\n * It is an as an object with {@link @azure/communication-calling#Call.id} keys and {@link IncomingCall} values.\n *\n * Only {@link MAX_CALL_HISTORY_LENGTH} Calls are kept in the history. Oldest calls are evicted if required.\n */\n incomingCallsEnded: {\n [key: string]: IncomingCallState | TeamsIncomingCallState;\n };\n /**\n * Proxy of {@link @azure/communication-calling#DeviceManager}. Please review {@link DeviceManagerState}.\n */\n deviceManager: DeviceManagerState;\n /**\n * Proxy of {@link @azure/communication-calling#CallAgent}. Please review {@link CallAgentState}.\n */\n callAgent?: CallAgentState;\n /**\n * Stores a userId. This is not used by the {@link StatefulCallClient} and is provided here as a convenience for the\n * developer for easier access to userId. Must be passed in at initialization of the {@link StatefulCallClient}.\n * Completely controlled by the developer.\n */\n userId: CommunicationIdentifierKind;\n /**\n * Stores the latest error for each API method.\n *\n * See documentation of {@Link CallErrors} for details.\n */\n latestErrors: CallErrors;\n /**\n * Stores the latest notifications.\n *\n * See documentation of {@Link CallNotifications} for details.\n */\n latestNotifications: CallNotifications;\n /**\n * A phone number in E.164 format that will be used to represent callers identity.\n * For example, using the alternateCallerId to add a participant using PSTN, this number will\n * be used as the caller id in the PSTN call.\n */\n alternateCallerId?: string;\n /**\n * state to track the environment that the stateful client was made in is supported\n */\n environmentInfo?: EnvironmentInfo;\n}\n\n/**\n * Errors teed from API calls to the Calling SDK.\n *\n * Each property in the object stores the latest error for a particular SDK API method.\n *\n * Errors from this object can be cleared using the {@link newClearCallErrorsModifier}.\n * Additionally, errors are automatically cleared when:\n * - The state is cleared.\n * - Subsequent calls to related API methods succeed.\n * See documentation of individual stateful client methods for details on when errors may be automatically cleared.\n *\n * @public\n */\nexport type CallErrors = {\n [target in CallErrorTarget]: CallError;\n};\n\n/**\n * Error thrown from failed stateful API methods.\n *\n * @public\n */\nexport class CallError extends Error {\n /**\n * The API method target that failed.\n */\n public target: CallErrorTarget;\n /**\n * Error thrown by the failed SDK method.\n */\n public innerError: Error;\n /**\n * Timestamp added to the error by the stateful layer.\n */\n public timestamp: Date;\n\n constructor(target: CallErrorTarget, innerError: Error, timestamp?: Date) {\n super();\n this.target = target;\n this.innerError = innerError;\n // Testing note: It is easier to mock Date::now() than the Date() constructor.\n this.timestamp = timestamp ?? new Date(Date.now());\n this.name = 'CallError';\n this.message = `${this.target}: ${this.innerError.message}`;\n }\n}\n\n/**\n * String literal type for all permissible keys in {@Link CallErrors}.\n *\n * @public\n */\nexport type CallErrorTarget =\n | 'Call.addParticipant'\n | 'Call.dispose'\n | 'Call.feature'\n | 'Call.hangUp'\n | 'Call.hold'\n | 'Call.mute'\n | 'Call.muteIncomingAudio'\n | 'Call.off'\n | 'Call.on'\n | 'Call.removeParticipant'\n | 'Call.resume'\n | 'Call.sendDtmf'\n | 'Call.startAudio'\n | 'Call.startScreenSharing'\n | 'Call.startVideo'\n | 'Call.stopScreenSharing'\n | 'Call.stopAudio'\n | 'Call.stopVideo'\n | 'Call.unmute'\n | 'Call.unmuteIncomingAudio'\n | 'CallAgent.dispose'\n | 'CallAgent.feature'\n | 'CallAgent.join'\n | 'CallAgent.off'\n | 'CallAgent.on'\n | 'CallAgent.startCall'\n | 'CallClient.createCallAgent'\n | 'CallClient.createTeamsCallAgent'\n | 'CallClient.feature'\n | 'CallClient.getDeviceManager'\n | 'CallClient.getEnvironmentInfo'\n | 'DeviceManager.askDevicePermission'\n | 'DeviceManager.getCameras'\n | 'DeviceManager.getMicrophones'\n | 'DeviceManager.getSpeakers'\n | 'DeviceManager.off'\n | 'DeviceManager.on'\n | 'DeviceManager.selectMicrophone'\n | 'DeviceManager.selectSpeaker'\n | 'IncomingCall.accept'\n | 'IncomingCall.reject'\n | 'TeamsCall.addParticipant'\n | 'VideoEffectsFeature.startEffects'\n | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallAgent.handlePushNotification'\n | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admit'\n | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.rejectParticipant'\n | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admitAll'\n | 'Call.mutedByOthers'\n | 'Call.muteAllRemoteParticipants'\n | 'Call.setConstraints';\n\n/**\n * @public\n */\nexport type CallNotifications = {\n [target in NotificationTarget]: CallNotification;\n};\n\n/**\n * @public\n */\nexport interface CallNotification {\n target: NotificationTarget;\n\n timestamp: Date;\n}\n\n/** @public */\nexport type NotificationTarget =\n | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomOpened'\n | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomOpenedPromptJoin'\n | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomChanged'\n | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomJoined'\n | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomClosingSoon'\n | 'capabilityTurnVideoOnPresent'\n | 'capabilityTurnVideoOnAbsent'\n | 'capabilityUnmuteMicPresent'\n | 'capabilityUnmuteMicAbsent'\n | /* @conditional-compile-remove(together-mode) */ 'togetherModeStarted'\n | /* @conditional-compile-remove(together-mode) */ 'togetherModeEnded';\n\n/**\n * State only proxy for {@link @azure/communication-calling#DiagnosticsCallFeature}.\n *\n * @public\n */\nexport interface DiagnosticsCallFeatureState {\n /**\n * Stores diagnostics related to network conditions.\n */\n network: NetworkDiagnosticsState;\n\n /**\n * Stores diagnostics related to media quality.\n */\n media: MediaDiagnosticsState;\n}\n\n/* @conditional-compile-remove(remote-ufd) */\n/**\n * All type names for {@link @azure/communication-calling#RemoteDiagnosticState}.\n *\n * @beta\n */\nexport type RemoteDiagnosticType = NetworkDiagnosticType | MediaDiagnosticType | ServerDiagnosticType;\n\n/* @conditional-compile-remove(remote-ufd) */\n/**\n * State only proxy for {@link @azure/communication-calling#DiagnosticsCallFeature}.\n *\n * @beta\n */\nexport declare type RemoteDiagnosticState = {\n readonly diagnostic: RemoteDiagnosticType;\n readonly value: DiagnosticQuality | DiagnosticFlag;\n readonly valueType: DiagnosticValueType;\n};\n\n/**\n * State only proxy for {@link @azure/communication-calling#NetworkDiagnostics}.\n *\n * @public\n */\nexport interface NetworkDiagnosticsState {\n latest: LatestNetworkDiagnostics;\n}\n\n/**\n * State only proxy for {@link @azure/communication-calling#MediaDiagnostics}.\n *\n * @public\n */\nexport interface MediaDiagnosticsState {\n latest: LatestMediaDiagnostics;\n}\n\n/**\n * @public\n * Information for conference phone info\n */\nexport interface ConferencePhoneInfo {\n /**\n * Phone number for the conference\n */\n phoneNumber: string;\n /**\n * Conference id for the conference\n */\n conferenceId: string;\n /**\n * Is toll free phone number\n */\n isTollFree: boolean;\n /**\n * phone number country\n */\n country?: string;\n /**\n * phone number city\n */\n city?: string;\n}\n"]}
1
+ {"version":3,"file":"CallClientState.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallClientState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA2kClC;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAclC,YAAY,MAAuB,EAAE,UAAiB,EAAE,SAAgB;QACtE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,8EAA8E;QAC9E,IAAI,CAAC,SAAS,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n AudioDeviceInfo,\n CallDirection,\n CallEndReason,\n CallerInfo,\n CallState as CallStatus,\n DeviceAccess,\n DominantSpeakersInfo,\n IncomingCallKind,\n LatestMediaDiagnostics,\n LatestNetworkDiagnostics,\n MediaStreamType,\n ParticipantRole,\n RemoteParticipantState as RemoteParticipantStatus,\n ScalingMode,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { BreakoutRoom, BreakoutRoomsSettings } from '@azure/communication-calling';\n/* @conditional-compile-remove(remote-ufd) */\nimport type {\n ServerDiagnosticType,\n MediaDiagnosticType,\n NetworkDiagnosticType,\n DiagnosticValueType,\n DiagnosticQuality,\n DiagnosticFlag\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(rtt) */\nimport { ParticipantInfo, RealTimeTextResultType } from '@azure/communication-calling';\nimport { TeamsCallInfo } from '@azure/communication-calling';\nimport { CallInfo } from '@azure/communication-calling';\nimport { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communication-calling';\nimport { CaptionsResultType } from '@azure/communication-calling';\nimport { CaptionsKind } from '@azure/communication-calling';\nimport { VideoEffectName } from '@azure/communication-calling';\nimport { CallKind } from '@azure/communication-calling';\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { ReactionMessage } from '@azure/communication-calling';\nimport { SpotlightedParticipant } from '@azure/communication-calling';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingInfo, RecordingInfo } from '@azure/communication-calling';\n\n/**\n * State only version of {@link @azure/communication-calling#CallAgent} except calls is moved to be a child directly of\n * {@link CallClientState} and not included here. The reason to have CallAgent's state proxied is to provide access to\n * displayName. We don't flatten CallAgent.displayName and put it in CallClientState because it would be ambiguious that\n * displayName is actually reliant on the creation/existence of CallAgent to be available.\n *\n * @public\n */\nexport interface CallAgentState {\n /**\n * Proxy of {@link @azure/communication-calling#CallAgent.displayName}.\n */\n displayName?: string;\n}\n\n/**\n * @public\n */\nexport interface CaptionsInfo {\n /**\n * The state in which this caption data can be classified.\n */\n resultType: CaptionsResultType;\n /**\n * The information of the call participant who spoke the captioned text.\n */\n speaker: CallerInfo;\n /**\n * The language that the spoken words were interpretted as. Corresponds to the language specified in startCaptions / setSpokenLanguage.\n */\n spokenLanguage: string;\n /**\n * The caption text.\n */\n captionText: string;\n /**\n * Timestamp of when the captioned words were initially spoken.\n */\n timestamp: Date;\n /**\n * Timestamp of when the captions were last updated.\n */\n lastUpdatedTimestamp?: Date;\n /**\n * The language that the captions are presented in. Corresponds to the captionLanguage specified in startCaptions / setCaptionLanguage.\n */\n captionLanguage?: string;\n /**\n * The original spoken caption text prior to translating to subtitle language\n */\n spokenText?: string;\n}\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n */\nexport interface RealTimeTextInfo {\n /**\n * The sequence id of the real time text.\n */\n sequenceId: number;\n /**\n * The sender of the real time text.\n */\n sender: ParticipantInfo;\n /**\n * The real time text message.\n */\n message: string;\n /**\n * The result type of the real time text message.\n */\n resultType: RealTimeTextResultType;\n /**\n * The timestamp when the real time text message was created.\n */\n receivedTimestamp?: Date;\n /**\n * The timestamp when the real time text message was last updated.\n */\n updatedTimestamp?: Date;\n /**\n * If message originated from the local participant\n * default is false\n */\n isMe?: boolean;\n}\n\n/**\n * @public\n */\nexport interface CaptionsCallFeatureState {\n /**\n * supported spoken languages\n */\n supportedSpokenLanguages: string[];\n /**\n * array of received captions\n */\n captions: CaptionsInfo[];\n /**\n * whether captions is on/off\n */\n isCaptionsFeatureActive: boolean;\n /**\n * whether start captions button is clicked or now\n */\n startCaptionsInProgress: boolean;\n /**\n * supported caption languages\n */\n supportedCaptionLanguages: string[];\n /**\n * current spoken language\n */\n currentSpokenLanguage: string;\n /**\n * current caption language\n */\n currentCaptionLanguage: string;\n /**\n * current caption kind: teams or acs captions\n */\n captionsKind: CaptionsKind;\n}\n\n/* @conditional-compile-remove(rtt) */\n/**\n * @beta\n */\nexport interface RealTimeTextCallFeatureState {\n /**\n * array of received captions\n */\n realTimeTexts: {\n completedMessages?: RealTimeTextInfo[];\n currentInProgress?: RealTimeTextInfo[];\n myInProgress?: RealTimeTextInfo;\n };\n /**\n * whether real time text is on/off\n */\n isRealTimeTextFeatureActive?: boolean;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#TranscriptionCallFeature}. {@link StatefulCallClient} will\n * automatically listen for transcription state of the call and update the state exposed by {@link StatefulCallClient}\n * accordingly.\n *\n * @public\n */\nexport interface TranscriptionCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#TranscriptionCallFeature.isTranscriptionActive}.\n */\n isTranscriptionActive: boolean;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#CapabilitiesFeature}\n *\n * @public\n */\nexport interface CapabilitiesFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#CapabilitiesFeature.capabilities}.\n */\n capabilities: ParticipantCapabilities;\n /**\n * Proxy of the latest {@link @azure/communication-calling#CapabilitiesChangeInfo}\n */\n latestCapabilitiesChangeInfo: CapabilitiesChangeInfo;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#SpotlightCallFeature}\n *\n * @public\n */\nexport interface SpotlightCallFeatureState {\n /**\n * Ordered array of spotlighted participants in call\n */\n spotlightedParticipants: SpotlightedParticipant[];\n /**\n * Local participant spotlight\n */\n localParticipantSpotlight?: SpotlightState;\n /**\n * Proxy of {@link @azure/communication-calling#SpotlightCallFeature.maxParticipantsToSpotlight}.\n */\n maxParticipantsToSpotlight: number;\n}\n\n/**\n * Spotlight state with order\n *\n * @public\n */\nexport interface SpotlightState {\n /**\n * Order position of spotlight in call\n */\n spotlightedOrderPosition?: number;\n}\n\n/* @conditional-compile-remove(breakout-rooms) */\n/**\n * Breakout rooms state\n *\n * @public\n */\nexport interface BreakoutRoomsState {\n assignedBreakoutRoom?: BreakoutRoom;\n breakoutRoomSettings?: BreakoutRoomsSettings;\n breakoutRoomOriginCallId?: string;\n breakoutRoomDisplayName?: string;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#RecordingCallFeature}. {@link StatefulCallClient} will\n * automatically listen for recording state of the call and update the state exposed by {@link StatefulCallClient} accordingly.\n *\n * @public\n */\nexport interface RecordingCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#RecordingCallFeature.isRecordingActive}.\n */\n isRecordingActive: boolean;\n /* @conditional-compile-remove(local-recording-notification) */\n /**\n * Contains list of information of started recordings\n * Proxy of {@link @azure/communication-calling#RecordingCallFeature.recordings}.\n */\n activeRecordings?: RecordingInfo[];\n /* @conditional-compile-remove(local-recording-notification) */\n /**\n * Contains list of information of stopped recordings\n */\n lastStoppedRecording?: RecordingInfo[];\n}\n\n/* @conditional-compile-remove(local-recording-notification) */\n/**\n * State only version of {@link @azure/communication-calling#LocalRecordingCallFeature}. {@link StatefulCallClient} will\n * automatically listen for local recording state of the call and update the state exposed by {@link StatefulCallClient} accordingly.\n *\n * @beta\n */\nexport interface LocalRecordingCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#LocalRecordingCallFeature.isRecordingActive}.\n */\n isLocalRecordingActive: boolean;\n /**\n * Contains list of information of started recordings\n * Proxy of {@link @azure/communication-calling#LocalRecordingCallFeature.recordings}.\n */\n activeLocalRecordings?: LocalRecordingInfo[];\n /**\n * Contains list of information of stopped recordings\n */\n lastStoppedLocalRecording?: LocalRecordingInfo[];\n}\n\n/**\n * State only version of {@link @azure/communication-calling#RaiseHandCallFeature}. {@link StatefulCallClient} will\n * automatically listen for raised hands on the call and update the state exposed by {@link StatefulCallClient} accordingly.\n *\n * @public\n */\nexport interface RaiseHandCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#RaiseHandCallFeature.raisedHands}.\n */\n raisedHands: RaisedHandState[];\n /**\n * Contains information for local participant from list {@link @azure/communication-calling#RaiseHandCallFeature.raisedHands}.\n */\n localParticipantRaisedHand?: RaisedHandState;\n}\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * Represents the name of the call feature stream\n * @beta\n */\nexport type CallFeatureStreamName = 'togetherMode';\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * State only version of {@link @azure/communication-calling#CallFeatureStream}.\n * Represents call feature stream state.\n * @beta\n */\nexport interface CallFeatureStreamState extends RemoteVideoStreamState {\n feature?: CallFeatureStreamName;\n}\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * State only version of {@link @azure/communication-calling#TogetherModeSeatingMap}.\n * @beta\n *\n * Represents the seating position of a participant in Together Mode.\n */\nexport interface TogetherModeSeatingPositionState {\n /* The top left offset from the top of the together mode view.*/\n top: number;\n /* The left offset position from the left of the together mode view. */\n left: number;\n /* The width of the seating area */\n width: number;\n /* The height of the seating area. */\n height: number;\n}\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * Represents the seating positions of participants in Together Mode.\n *\n * @beta\n */\nexport type TogetherModeParticipantSeatingState = Record<string, TogetherModeSeatingPositionState>;\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * Represents the streams in Together Mode.\n *\n * @beta\n */\nexport interface TogetherModeStreamsState {\n mainVideoStream?: CallFeatureStreamState;\n}\n\n/* @conditional-compile-remove(together-mode) */\n/**\n * State only version of {@link @azure/communication-calling#TogetherModeCallFeature}. {@link StatefulCallClient}.\n * Represents the state of the Together Mode feature.\n * @beta\n */\nexport interface TogetherModeCallFeatureState {\n isActive: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#TogetherModeCallFeature.togetherModeStream}.\n */\n streams: TogetherModeStreamsState;\n /**\n * Proxy of {@link @azure/communication-calling#TogetherModeCallFeature.TogetherModeSeatingMap}.\n */\n seatingPositions: TogetherModeParticipantSeatingState;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#PPTLiveCallFeature}. {@link StatefulCallClient} will\n * automatically listen for pptLive on the call and update the state exposed by {@link StatefulCallClient} accordingly.\n *\n * @public\n */\nexport interface PPTLiveCallFeatureState {\n /**\n * Proxy of {@link @azure/communication-calling#PPTLiveCallFeature.isActive}.\n */\n isActive: boolean;\n}\n/**\n * Raised hand state with order\n *\n * @public\n */\nexport type RaisedHandState = {\n raisedHandOrderPosition: number;\n};\n\n/**\n * State only version of {@link @azure/communication-calling#Call.ReactionMessage} with UI helper props receivedOn.\n * Reaction state with a timestamp which helps UI to decide to render the reaction accordingly.\n *\n * @public\n */\nexport type ReactionState = {\n /**\n * Reaction message from the meeting {@link @azure/communication-calling#Call.ReactionMessage}\n */\n reactionMessage: ReactionMessage;\n /**\n * Received timestamp of the reaction message in a meeting.\n */\n receivedOn: Date;\n};\n\n/**\n * State only version of {@link @azure/communication-calling#LocalVideoStream}.\n *\n * @public\n */\nexport interface LocalVideoStreamState {\n /**\n * Proxy of {@link @azure/communication-calling#LocalVideoStream.source}.\n */\n source: VideoDeviceInfo;\n /**\n * Proxy of {@link @azure/communication-calling#LocalVideoStream.mediaStreamType}.\n */\n mediaStreamType: MediaStreamType;\n /**\n * {@link VideoStreamRendererView} that is managed by createView/disposeView in {@link StatefulCallClient}\n * API. This can be undefined if the stream has not yet been rendered and defined after createView creates the view.\n */\n view?: VideoStreamRendererViewState;\n\n /**\n * Stores the state of the video effects.\n * @public\n */\n videoEffects?: LocalVideoStreamVideoEffectsState;\n}\n\n/**\n * State only version of a LocalVideoStream's {@link @azure/communication-calling#VideoEffectsFeature}.\n *\n * @public\n */\nexport interface LocalVideoStreamVideoEffectsState {\n /**\n * List of effects if any are active.\n */\n activeEffects?: VideoEffectName[];\n}\n\n/**\n * State only version of Optimal Video Count Feature {@link @azure/communication-calling#OptimalVideoCountCallFeature}.\n *\n * @public\n */\nexport interface OptimalVideoCountFeatureState {\n /**\n * State of the current optimal video count.\n */\n maxRemoteVideoStreams: number;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#RemoteVideoStream}.\n *\n * @public\n */\nexport interface RemoteVideoStreamState {\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.id}.\n */\n id: number;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.mediaStreamType}.\n */\n mediaStreamType: MediaStreamType;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.isAvailable}.\n */\n isAvailable: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.isReceiving}.\n * @public\n */\n isReceiving: boolean;\n /**\n * {@link VideoStreamRendererView} that is managed by createView/disposeView in {@link StatefulCallClient}\n * API. This can be undefined if the stream has not yet been rendered and defined after createView creates the view.\n */\n view?: VideoStreamRendererViewState;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteVideoStream.size}.\n */\n streamSize?: { width: number; height: number };\n}\n\n/**\n * State only version of {@link @azure/communication-calling#VideoStreamRendererView}. This property is added to the state exposed\n * by {@link StatefulCallClient} by {@link StatefulCallClient.createView} and removed by {@link StatefulCallClient.disposeView}.\n *\n * @public\n */\nexport interface VideoStreamRendererViewState {\n /**\n * Proxy of {@link @azure/communication-calling#VideoStreamRendererView.scalingMode}.\n */\n scalingMode: ScalingMode;\n /**\n * Proxy of {@link @azure/communication-calling#VideoStreamRendererView.isMirrored}.\n */\n isMirrored: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#VideoStreamRendererView.target}.\n */\n target: HTMLElement;\n}\n\n/**\n * Media access state\n * @public\n */\nexport interface MediaAccessState {\n /**\n * Whether the audio is forcibly muted\n */\n isAudioPermitted: boolean;\n /**\n * Whether the video is forcibly muted\n */\n isVideoPermitted: boolean;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#RemoteParticipant}. {@link StatefulCallClient} will\n * automatically retrieve RemoteParticipants and add their state to the state exposed by {@link StatefulCallClient}.\n *\n * @public\n */\nexport interface RemoteParticipantState {\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.identifier}.\n */\n identifier: CommunicationIdentifierKind;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.displayName}.\n */\n displayName?: string;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.state}.\n */\n state: RemoteParticipantStatus;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.callEndReason}.\n */\n callEndReason?: CallEndReason;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.videoStreams} as an object with\n * {@link RemoteVideoStream} fields keyed by {@link @azure/communication-calling#RemoteVideoStream.id}.\n */\n videoStreams: { [key: number]: RemoteVideoStreamState };\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.isMuted}.\n */\n isMuted: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.isSpeaking}.\n */\n isSpeaking: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#RemoteParticipant.role}.\n */\n role?: ParticipantRole;\n /**\n * Proxy of {@link @azure/communication-calling#Call.RaisedHand.raisedHands}.\n */\n raisedHand?: RaisedHandState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.PPTLive.target}.\n *\n * @public\n */\n contentSharingStream?: HTMLElement;\n /**\n * Proxy of {@link @azure/communication-calling#Call.ReactionMessage} with\n * UI helper props receivedOn which indicates the timestamp when the message was received.\n *\n * @public\n */\n reactionState?: ReactionState;\n /**\n * Proxy of {@link @azure/communication-calling#SpotlightCallFeature.spotlightedParticipants}.\n */\n spotlight?: SpotlightState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.MediaAccessCallFeature.MediaAccess}.\n */\n mediaAccess?: MediaAccessState;\n /* @conditional-compile-remove(remote-ufd) */\n /**\n * The diagnostic status of RemoteParticipant{@link @azure/communication-calling#RemoteDiagnostics}.\n */\n diagnostics?: Partial<Record<RemoteDiagnosticType, RemoteDiagnosticState>>;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#Call}. {@link StatefulCallClient} will automatically\n * retrieve Call's state and add it to the state exposed by {@link StatefulCallClient}.\n *\n * @public\n */\nexport interface CallState {\n /**\n * Proxy of {@link @azure/communication-calling#Call.id}.\n */\n id: string;\n\n /**\n * Type of the call.\n */\n kind: CallKind;\n /**\n * Proxy of {@link @azure/communication-calling#Call.callerInfo}.\n */\n callerInfo: CallerInfo;\n /**\n * Proxy of {@link @azure/communication-calling#Call.state}.\n */\n state: CallStatus;\n /**\n * Proxy of {@link @azure/communication-calling#Call.callEndReason}.\n */\n callEndReason?: CallEndReason;\n /**\n * Proxy of {@link @azure/communication-calling#Call.direction}.\n */\n direction: CallDirection;\n /**\n * Proxy of {@link @azure/communication-calling#Call.isMuted}.\n */\n isMuted: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#Call.isScreenSharingOn}.\n */\n isScreenSharingOn: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#DominantSpeakersInfo }.\n */\n dominantSpeakers?: DominantSpeakersInfo;\n /**\n * Proxy of {@link @azure/communication-calling#Call.localVideoStreams}.\n */\n localVideoStreams: LocalVideoStreamState[];\n /**\n * Proxy of {@link @azure/communication-calling#Call.remoteParticipants}.\n * Object with {@link RemoteParticipant} fields keyed by flattened {@link RemoteParticipantState.identifier}.\n * To obtain a flattened {@link RemoteParticipantState.identifier}, use\n * {@link @azure/communication-react#toFlatCommunicationIdentifier}.\n */\n remoteParticipants: { [keys: string]: RemoteParticipantState };\n /**\n * Stores remote participants that have left the call so that the callEndReason could be retrieved.\n * Object with {@link RemoteParticipant} fields keyed by flattened {@link RemoteParticipantState.identifier}.\n * To obtain a flattened {@link RemoteParticipantState.identifier}, use\n * {@link @azure/communication-react#toFlatCommunicationIdentifier}.\n */\n remoteParticipantsEnded: { [keys: string]: RemoteParticipantState };\n /**\n * Proxy of {@link @azure/communication-calling#TranscriptionCallFeature}.\n */\n transcription: TranscriptionCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#CaptionsCallFeature}.\n */\n captionsFeature: CaptionsCallFeatureState;\n /* @conditional-compile-remove(rtt) */\n /**\n * Proxy of {@link @azure/communication-calling#RealTimeTextCallFeature}.\n */\n realTimeTextFeature: RealTimeTextCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#OptimalVideoCountCallFeature}.\n */\n optimalVideoCount: OptimalVideoCountFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#RecordingCallFeature}.\n */\n recording: RecordingCallFeatureState;\n /* @conditional-compile-remove(local-recording-notification) */\n /**\n * Proxy of {@link @azure/communication-calling#LocalRecordingCallFeature}.\n */\n localRecording: LocalRecordingCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#PPTLiveCallFeature}.\n *\n *@public\n */\n pptLive: PPTLiveCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#RaiseHandCallFeature}.\n */\n raiseHand: RaiseHandCallFeatureState;\n /* @conditional-compile-remove(together-mode) */\n /**\n * Proxy of {@link @azure/communication-calling#TogetherModeCallFeature}.\n * @beta\n */\n togetherMode: TogetherModeCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.ReactionMessage} with\n * UI helper props receivedOn which indicates the timestamp when the message was received.\n *\n * @public\n */\n localParticipantReaction?: ReactionState;\n /**\n * Stores the currently active screenshare participant's key. If there is no screenshare active, then this will be\n * undefined. You can use this key to access the remoteParticipant data in {@link CallState.remoteParticipants} object.\n *\n * Note this only applies to ScreenShare in RemoteParticipant. A local ScreenShare being active will not affect this\n * property.\n *\n * This property is added by the stateful layer and is not a proxy of SDK state\n */\n screenShareRemoteParticipant?: string;\n /**\n * Stores the currently active pptlive participant's key. Will be reused by White board etc. If there is no screenshare active, then this will be\n * undefined. You can use this key to access the remoteParticipant data in {@link CallState.remoteParticipants} object.\n *\n * Note this only applies to PPTLive in RemoteParticipant.\n *\n * This property is added by the stateful layer and is not a proxy of SDK state\n *\n * @public\n */\n contentSharingRemoteParticipant?: string;\n /**\n * Stores the local date when the call started on the client. This property is added by the stateful layer and is not\n * a proxy of SDK state.\n */\n startTime: Date;\n /**\n * Stores the local date when the call ended on the client. This property is added by the stateful layer and is not\n * a proxy of SDK state.\n */\n endTime: Date | undefined;\n\n /**\n * Stores the latest call diagnostics.\n */\n diagnostics: DiagnosticsCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.role}.\n */\n role?: ParticipantRole;\n\n /* @conditional-compile-remove(total-participant-count) */\n /**\n * Proxy of {@link @azure/communication-calling#Call.totalParticipantCount}.\n */\n totalParticipantCount?: number;\n /**\n * Transfer state of call\n */\n transfer: TransferFeatureState;\n\n /**\n * Proxy of {@link @azure/communication-calling#CapabilitiesFeature}.\n */\n capabilitiesFeature?: CapabilitiesFeatureState;\n /**\n * Hide attendee names in teams meeting\n */\n hideAttendeeNames?: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#SpotlightCallFeature}.\n */\n spotlight?: SpotlightCallFeatureState;\n /**\n * Proxy of {@link @azure/communication-calling#Call.info}.\n */\n info?: TeamsCallInfo | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n\n /**\n * Proxy of {@link @azure/communication-calling#TeamsMeetingAudioConferencingCallFeature}.\n */\n meetingConference?: { conferencePhones: ConferencePhoneInfo[] };\n\n /* @conditional-compile-remove(breakout-rooms) */\n /**\n * Proxy of {@link @azure/communication-calling#BreakoutRoomsFeature}.\n */\n breakoutRooms?: BreakoutRoomsState;\n\n /**\n * Proxy of {@link @azure/communication-calling#MediaAccessFeature}.\n */\n meetingMediaAccess?: MediaAccessState;\n}\n\n/**\n * Transfer feature state\n *\n * @public\n */\nexport interface TransferFeatureState {\n /**\n * Accepted transfer requests\n */\n acceptedTransfers: { [key: string]: AcceptedTransfer };\n}\n\n/**\n * Transfer feature state\n *\n * @public\n */\nexport interface AcceptedTransfer {\n /**\n * Stores call id of accepted transfer\n */\n callId: string;\n /**\n * Stores timestamp when transfer was accepted\n */\n timestamp: Date;\n}\n\n/**\n * State to track the types {@link CallInfo} and {@link TeamsCallInfo}\n * @public\n */\nexport interface CallInfoState {\n /**\n * GroupId of the call that you joined\n */\n groupId?: string;\n /**\n * The teams meeting thread id\n */\n threadId?: string;\n /**\n * participant id of the local user\n */\n participantId: string;\n /**\n * Differentiator between the Call and TeamsCall types\n */\n kind: IncomingCallKind;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#IncomingCall}. {@link StatefulCallClient} will\n * automatically detect incoming calls and add their state to the state exposed by {@link StatefulCallClient}.\n *\n * @public\n */\nexport interface IncomingCallState {\n /**\n * Proxy of {@link @azure/communication-calling#IncomingCall.id}.\n */\n id: string;\n /**\n * Proxy of {@link @azure/communication-calling#IncomingCall.callInfo}.\n */\n info: CallInfoState;\n /**\n * Proxy of {@link @azure/communication-calling#IncomingCall.callerInfo}.\n */\n callerInfo: CallerInfo;\n /**\n * Set to the state returned by 'callEnded' event on {@link @azure/communication-calling#IncomingCall} when received.\n * This property is added by the stateful layer and is not a proxy of SDK state.\n */\n callEndReason?: CallEndReason;\n /**\n * Stores the local date when the call started on the client. This property is added by the stateful layer and is not\n * a proxy of SDK state.\n */\n startTime: Date;\n /**\n * Stores the local date when the call ended on the client. This property is added by the stateful layer and is not a\n * proxy of SDK state. It is undefined if the call is not ended yet.\n */\n endTime?: Date;\n}\n\n/**\n * State only version of {@link @azure/communication-calling#TeamsIncomingCall}\n * @public\n */\nexport interface TeamsIncomingCallState {\n /**\n * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.id}.\n */\n id: string;\n /**\n * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.teamsCallInfo}.\n */\n info: CallInfoState;\n /**\n * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.callerInfo}.\n */\n callerInfo: CallerInfo;\n /**\n * Set to the state returned by 'callEnded' event on {@link @azure/communication-calling#IncomingCall} when received.\n * This property is added by the stateful layer and is not a proxy of SDK state.\n */\n callEndReason?: CallEndReason;\n /**\n * Stores the local date when the call started on the client. This property is added by the stateful layer and is not\n * a proxy of SDK state.\n */\n startTime: Date;\n /**\n * Stores the local date when the call ended on the client. This property is added by the stateful layer and is not a\n * proxy of SDK state. It is undefined if the call is not ended yet.\n */\n endTime?: Date;\n}\n\n/**\n * This type is meant to encapsulate all the state inside {@link @azure/communication-calling#DeviceManager}. For\n * optional parameters they may not be available until permission is granted by the user. The cameras, microphones,\n * speakers, and deviceAccess states will be empty until the corresponding\n * {@link @azure/communication-calling#DeviceManager}'s getCameras, getMicrophones, getSpeakers, and askDevicePermission\n * APIs are called and completed.\n *\n * @public\n */\nexport type DeviceManagerState = {\n /**\n * Proxy of {@link @azure/communication-calling#DeviceManager.isSpeakerSelectionAvailable}.\n */\n isSpeakerSelectionAvailable: boolean;\n /**\n * Proxy of {@link @azure/communication-calling#DeviceManager.selectedMicrophone}.\n */\n selectedMicrophone?: AudioDeviceInfo;\n /**\n * Proxy of {@link @azure/communication-calling#DeviceManager.selectedSpeaker}.\n */\n selectedSpeaker?: AudioDeviceInfo;\n /**\n * Stores the selected camera device info. This is added by the stateful layer and does not exist in the Calling SDK.\n * It is meant as a convenience to the developer. It must be explicitly set before it has any value and does not\n * persist across instances of the {@link StatefulCallClient}. The developer controls entirely what this value holds\n * at any time.\n */\n selectedCamera?: VideoDeviceInfo;\n /**\n * Stores any cameras data returned from {@link @azure/communication-calling#DeviceManager.getCameras}.\n */\n cameras: VideoDeviceInfo[];\n /**\n * Stores any microphones data returned from {@link @azure/communication-calling#DeviceManager.getMicrophones}.\n */\n microphones: AudioDeviceInfo[];\n /**\n * Stores any speakers data returned from {@link @azure/communication-calling#DeviceManager.getSpeakers}.\n */\n speakers: AudioDeviceInfo[];\n /**\n * Stores deviceAccess data returned from {@link @azure/communication-calling#DeviceManager.askDevicePermission}.\n */\n deviceAccess?: DeviceAccess;\n /**\n * Stores created views that are not associated with any CallState (when {@link StatefulCallClient.createView} is\n * called with undefined callId, undefined participantId, and defined LocalVideoStream).\n *\n * The values in this array are generated internally when {@link StatefulCallClient.createView} is called and are\n * considered immutable.\n */\n unparentedViews: LocalVideoStreamState[];\n};\n\n/**\n * Container for all of the state data proxied by {@link StatefulCallClient}. The calls, callsEnded, incomingCalls, and\n * incomingCallsEnded states will be automatically provided if a callAgent has been created. The deviceManager will be\n * empty initially until populated see {@link DeviceManagerState}. The userId state is provided as a convenience for the\n * developer and is completely controled and set by the developer.\n *\n * @public\n */\nexport interface CallClientState {\n /**\n * Proxy of {@link @azure/communication-calling#CallAgent.calls} as an object with CallState {@link CallState} fields.\n * It is keyed by {@link @azure/communication-calling#Call.id}. Please note that\n * {@link @azure/communication-calling#Call.id} could change. You should not cache the id itself but the entire\n * {@link @azure/communication-calling#Call} and then use the id contained to look up data in this map.\n */\n calls: { [key: string]: CallState };\n /**\n * Calls that have ended are stored here so the callEndReason could be checked.\n * It is an object with {@link @azure/communication-calling#Call.id} keys and {@link CallState} values.\n *\n * Only {@link MAX_CALL_HISTORY_LENGTH} Calls are kept in the history. Oldest calls are evicted if required.\n */\n callsEnded: { [key: string]: CallState };\n /**\n * Proxy of {@link @azure/communication-calling#IncomingCall} as an object with {@link IncomingCall} fields.\n * It is keyed by {@link @azure/communication-calling#IncomingCall.id}.\n */\n incomingCalls: {\n [key: string]: IncomingCallState | TeamsIncomingCallState;\n };\n /**\n * Incoming Calls that have ended are stored here so the callEndReason could be checked.\n * It is an as an object with {@link @azure/communication-calling#Call.id} keys and {@link IncomingCall} values.\n *\n * Only {@link MAX_CALL_HISTORY_LENGTH} Calls are kept in the history. Oldest calls are evicted if required.\n */\n incomingCallsEnded: {\n [key: string]: IncomingCallState | TeamsIncomingCallState;\n };\n /**\n * Proxy of {@link @azure/communication-calling#DeviceManager}. Please review {@link DeviceManagerState}.\n */\n deviceManager: DeviceManagerState;\n /**\n * Proxy of {@link @azure/communication-calling#CallAgent}. Please review {@link CallAgentState}.\n */\n callAgent?: CallAgentState;\n /**\n * Stores a userId. This is not used by the {@link StatefulCallClient} and is provided here as a convenience for the\n * developer for easier access to userId. Must be passed in at initialization of the {@link StatefulCallClient}.\n * Completely controlled by the developer.\n */\n userId: CommunicationIdentifierKind;\n /**\n * Stores the latest error for each API method.\n *\n * See documentation of {@Link CallErrors} for details.\n */\n latestErrors: CallErrors;\n /**\n * Stores the latest notifications.\n *\n * See documentation of {@Link CallNotifications} for details.\n */\n latestNotifications: CallNotifications;\n /**\n * A phone number in E.164 format that will be used to represent callers identity.\n * For example, using the alternateCallerId to add a participant using PSTN, this number will\n * be used as the caller id in the PSTN call.\n */\n alternateCallerId?: string;\n /**\n * state to track the environment that the stateful client was made in is supported\n */\n environmentInfo?: EnvironmentInfo;\n}\n\n/**\n * Errors teed from API calls to the Calling SDK.\n *\n * Each property in the object stores the latest error for a particular SDK API method.\n *\n * Errors from this object can be cleared using the {@link newClearCallErrorsModifier}.\n * Additionally, errors are automatically cleared when:\n * - The state is cleared.\n * - Subsequent calls to related API methods succeed.\n * See documentation of individual stateful client methods for details on when errors may be automatically cleared.\n *\n * @public\n */\nexport type CallErrors = {\n [target in CallErrorTarget]: CallError;\n};\n\n/**\n * Error thrown from failed stateful API methods.\n *\n * @public\n */\nexport class CallError extends Error {\n /**\n * The API method target that failed.\n */\n public target: CallErrorTarget;\n /**\n * Error thrown by the failed SDK method.\n */\n public innerError: Error;\n /**\n * Timestamp added to the error by the stateful layer.\n */\n public timestamp: Date;\n\n constructor(target: CallErrorTarget, innerError: Error, timestamp?: Date) {\n super();\n this.target = target;\n this.innerError = innerError;\n // Testing note: It is easier to mock Date::now() than the Date() constructor.\n this.timestamp = timestamp ?? new Date(Date.now());\n this.name = 'CallError';\n this.message = `${this.target}: ${this.innerError.message}`;\n }\n}\n\n/**\n * String literal type for all permissible keys in {@Link CallErrors}.\n *\n * @public\n */\nexport type CallErrorTarget =\n | 'Call.addParticipant'\n | 'Call.dispose'\n | 'Call.feature'\n | 'Call.hangUp'\n | 'Call.hold'\n | 'Call.mute'\n | 'Call.muteIncomingAudio'\n | 'Call.off'\n | 'Call.on'\n | 'Call.removeParticipant'\n | 'Call.resume'\n | 'Call.sendDtmf'\n | 'Call.startAudio'\n | 'Call.startScreenSharing'\n | 'Call.startVideo'\n | 'Call.stopScreenSharing'\n | 'Call.stopAudio'\n | 'Call.stopVideo'\n | 'Call.unmute'\n | 'Call.unmuteIncomingAudio'\n | 'CallAgent.dispose'\n | 'CallAgent.feature'\n | 'CallAgent.join'\n | 'CallAgent.off'\n | 'CallAgent.on'\n | 'CallAgent.startCall'\n | 'CallClient.createCallAgent'\n | 'CallClient.createTeamsCallAgent'\n | 'CallClient.feature'\n | 'CallClient.getDeviceManager'\n | 'CallClient.getEnvironmentInfo'\n | 'DeviceManager.askDevicePermission'\n | 'DeviceManager.getCameras'\n | 'DeviceManager.getMicrophones'\n | 'DeviceManager.getSpeakers'\n | 'DeviceManager.off'\n | 'DeviceManager.on'\n | 'DeviceManager.selectMicrophone'\n | 'DeviceManager.selectSpeaker'\n | 'IncomingCall.accept'\n | 'IncomingCall.reject'\n | 'TeamsCall.addParticipant'\n | 'VideoEffectsFeature.startEffects'\n | /* @conditional-compile-remove(calling-beta-sdk) */ 'CallAgent.handlePushNotification'\n | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admit'\n | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.rejectParticipant'\n | /* @conditional-compile-remove(calling-beta-sdk) */ 'Call.admitAll'\n | 'Call.mutedByOthers'\n | 'Call.muteAllRemoteParticipants'\n | 'Call.setConstraints';\n\n/**\n * @public\n */\nexport type CallNotifications = {\n [target in NotificationTarget]: CallNotification;\n};\n\n/**\n * @public\n */\nexport interface CallNotification {\n target: NotificationTarget;\n\n timestamp: Date;\n}\n\n/** @public */\nexport type NotificationTarget =\n | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomOpened'\n | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomOpenedPromptJoin'\n | /* @conditional-compile-remove(breakout-rooms) */ 'assignedBreakoutRoomChanged'\n | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomJoined'\n | /* @conditional-compile-remove(breakout-rooms) */ 'breakoutRoomClosingSoon'\n | 'capabilityTurnVideoOnPresent'\n | 'capabilityTurnVideoOnAbsent'\n | 'capabilityUnmuteMicPresent'\n | 'capabilityUnmuteMicAbsent'\n | /* @conditional-compile-remove(together-mode) */ 'togetherModeStarted'\n | /* @conditional-compile-remove(together-mode) */ 'togetherModeEnded';\n\n/**\n * State only proxy for {@link @azure/communication-calling#DiagnosticsCallFeature}.\n *\n * @public\n */\nexport interface DiagnosticsCallFeatureState {\n /**\n * Stores diagnostics related to network conditions.\n */\n network: NetworkDiagnosticsState;\n\n /**\n * Stores diagnostics related to media quality.\n */\n media: MediaDiagnosticsState;\n}\n\n/* @conditional-compile-remove(remote-ufd) */\n/**\n * All type names for {@link @azure/communication-calling#RemoteDiagnosticState}.\n *\n * @beta\n */\nexport type RemoteDiagnosticType = NetworkDiagnosticType | MediaDiagnosticType | ServerDiagnosticType;\n\n/* @conditional-compile-remove(remote-ufd) */\n/**\n * State only proxy for {@link @azure/communication-calling#DiagnosticsCallFeature}.\n *\n * @beta\n */\nexport declare type RemoteDiagnosticState = {\n readonly diagnostic: RemoteDiagnosticType;\n readonly value: DiagnosticQuality | DiagnosticFlag;\n readonly valueType: DiagnosticValueType;\n};\n\n/**\n * State only proxy for {@link @azure/communication-calling#NetworkDiagnostics}.\n *\n * @public\n */\nexport interface NetworkDiagnosticsState {\n latest: LatestNetworkDiagnostics;\n}\n\n/**\n * State only proxy for {@link @azure/communication-calling#MediaDiagnostics}.\n *\n * @public\n */\nexport interface MediaDiagnosticsState {\n latest: LatestMediaDiagnostics;\n}\n\n/**\n * @public\n * Information for conference phone info\n */\nexport interface ConferencePhoneInfo {\n /**\n * Phone number for the conference\n */\n phoneNumber: string;\n /**\n * Conference id for the conference\n */\n conferenceId: string;\n /**\n * Is toll free phone number\n */\n isTollFree: boolean;\n /**\n * phone number country\n */\n country?: string;\n /**\n * phone number city\n */\n city?: string;\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  import { CommunicationIdentifierKind } from '@azure/communication-common';
2
2
  import { AudioDeviceInfo, DeviceAccess, DominantSpeakersInfo, ParticipantRole, ScalingMode, VideoDeviceInfo } from '@azure/communication-calling';
3
+ import { RealTimeTextInfo as AcsRealTimeTextInfo } from '@azure/communication-calling';
3
4
  import { RaisedHand, MediaAccess, MeetingMediaAccess } from '@azure/communication-calling';
4
5
  import { BreakoutRoom, BreakoutRoomsSettings } from '@azure/communication-calling';
5
6
  import { TeamsMeetingAudioConferencingDetails } from '@azure/communication-calling';
@@ -123,12 +124,16 @@ export declare class CallContext {
123
124
  deleteDeviceManagerUnparentedView(localVideoStream: LocalVideoStreamState): void;
124
125
  setDeviceManagerUnparentedViewVideoEffects(localVideoStream: LocalVideoStreamState, videoEffects: LocalVideoStreamVideoEffectsState): void;
125
126
  getAndIncrementAtomicId(): number;
127
+ private processNewRealTimeText;
128
+ private findTimeoutRealTimeText;
126
129
  private processNewCaption;
127
130
  addTeamsCaption(callId: string, caption: TeamsCaptionsInfo): void;
128
131
  addCaption(callId: string, caption: AcsCaptionsInfo): void;
132
+ addRealTimeText(callId: string, realTimeText: AcsRealTimeTextInfo): void;
129
133
  setCaptionsKind(callId: string, kind: CaptionsKind): void;
130
134
  clearCaptions(callId: string): void;
131
135
  setIsCaptionActive(callId: string, isCaptionsActive: boolean): void;
136
+ setIsRealTimeTextActive(callId: string, isRealTimeTextActive: boolean): void;
132
137
  setStartCaptionsInProgress(callId: string, startCaptionsInProgress: boolean): void;
133
138
  setSelectedSpokenLanguage(callId: string, spokenLanguage: string): void;
134
139
  setSelectedCaptionLanguage(callId: string, captionLanguage: string): void;
@@ -10,6 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  });
11
11
  };
12
12
  import { convertConferencePhoneInfo } from './Converter';
13
+ /* @conditional-compile-remove(rtt) */
14
+ import { convertFromSDKRealTimeTextToRealTimeTextInfoState } from './Converter';
13
15
  import { createClientLogger, getLogLevel } from '@azure/logger';
14
16
  import { EventEmitter } from 'events';
15
17
  import { enableMapSet, enablePatches, produce } from 'immer';
@@ -961,10 +963,92 @@ export class CallContext {
961
963
  this._atomicId++;
962
964
  return id;
963
965
  }
966
+ /* @conditional-compile-remove(rtt) */
967
+ processNewRealTimeText(realTimeTexts, newRealTimeText) {
968
+ var _a, _b, _c, _d, _e;
969
+ // if the new message is final, push it to completed messages
970
+ if (newRealTimeText.resultType === 'Final') {
971
+ if (!realTimeTexts.completedMessages) {
972
+ realTimeTexts.completedMessages = [];
973
+ }
974
+ (_a = realTimeTexts.completedMessages) === null || _a === void 0 ? void 0 : _a.push(newRealTimeText);
975
+ // clear the corresponding in progress message
976
+ if (newRealTimeText.isMe) {
977
+ realTimeTexts.myInProgress = undefined;
978
+ }
979
+ else {
980
+ realTimeTexts.currentInProgress = (_b = realTimeTexts.currentInProgress) === null || _b === void 0 ? void 0 : _b.filter((message) => message.sequenceId !== newRealTimeText.sequenceId);
981
+ }
982
+ }
983
+ else {
984
+ // if receive partial real time text
985
+ // if message is from me, assign it to myInProgress
986
+ if (newRealTimeText.isMe) {
987
+ realTimeTexts.myInProgress = newRealTimeText;
988
+ }
989
+ // if message is from others, assign it to currentInProgress
990
+ else {
991
+ if (!realTimeTexts.currentInProgress) {
992
+ realTimeTexts.currentInProgress = [];
993
+ realTimeTexts.currentInProgress.push(newRealTimeText);
994
+ return;
995
+ }
996
+ // find the index of the existing in progress message
997
+ // replace the existing in progress message with the new one
998
+ const existingIndex = (_c = realTimeTexts.currentInProgress) === null || _c === void 0 ? void 0 : _c.findIndex((message) => message.sequenceId === newRealTimeText.sequenceId);
999
+ if (existingIndex === -1) {
1000
+ (_d = realTimeTexts.currentInProgress) === null || _d === void 0 ? void 0 : _d.push(newRealTimeText);
1001
+ }
1002
+ else {
1003
+ realTimeTexts.currentInProgress[existingIndex] = newRealTimeText;
1004
+ }
1005
+ }
1006
+ }
1007
+ // edge case check for in progress messages time out
1008
+ if (!realTimeTexts.completedMessages) {
1009
+ realTimeTexts.completedMessages = [];
1010
+ }
1011
+ this.findTimeoutRealTimeText(realTimeTexts.currentInProgress, realTimeTexts.completedMessages);
1012
+ this.findTimeoutRealTimeText(realTimeTexts.myInProgress, realTimeTexts.completedMessages);
1013
+ // we only want to store up to 50 finalized messages
1014
+ if (realTimeTexts.completedMessages && ((_e = realTimeTexts.completedMessages) === null || _e === void 0 ? void 0 : _e.length) > 50) {
1015
+ realTimeTexts.completedMessages.shift();
1016
+ }
1017
+ }
1018
+ /* @conditional-compile-remove(rtt) */
1019
+ findTimeoutRealTimeText(inProgressRealTimeTexts, completedRealTimeTexts) {
1020
+ // if inProgressRealTimeTexts is an array
1021
+ if (inProgressRealTimeTexts && Array.isArray(inProgressRealTimeTexts)) {
1022
+ // find the in progress real time text that has not been updated for 5 seconds
1023
+ inProgressRealTimeTexts.forEach((realTimeText, index) => {
1024
+ if (realTimeText.updatedTimestamp && Date.now() - realTimeText.updatedTimestamp.getTime() > 5000) {
1025
+ // turn the in progress real time text to final
1026
+ realTimeText.resultType = 'Final';
1027
+ // move the in progress real time text to completed
1028
+ completedRealTimeTexts.push(realTimeText);
1029
+ // remove the in progress real time text from in progress
1030
+ inProgressRealTimeTexts && inProgressRealTimeTexts.splice(index, 1);
1031
+ }
1032
+ });
1033
+ }
1034
+ else {
1035
+ // if inProgressRealTimeTexts is a single object
1036
+ if (inProgressRealTimeTexts &&
1037
+ inProgressRealTimeTexts.updatedTimestamp &&
1038
+ Date.now() - inProgressRealTimeTexts.updatedTimestamp.getTime() > 5000) {
1039
+ // turn the in progress real time text to final
1040
+ inProgressRealTimeTexts.resultType = 'Final';
1041
+ // move the in progress real time text to completed
1042
+ completedRealTimeTexts.push(inProgressRealTimeTexts);
1043
+ // remove the in progress real time text from in progress
1044
+ inProgressRealTimeTexts = undefined;
1045
+ }
1046
+ }
1047
+ }
964
1048
  processNewCaption(captions, newCaption) {
965
1049
  var _a;
966
1050
  // time stamp when new caption comes in
967
- newCaption.timestamp = new Date();
1051
+ newCaption.lastUpdatedTimestamp = new Date();
968
1052
  // if this is the first caption, push it in
969
1053
  if (captions.length === 0) {
970
1054
  captions.push(newCaption);
@@ -985,8 +1069,8 @@ export class CallContext {
985
1069
  }
986
1070
  // if different speaker, ignore the interjector until the current speaker finishes
987
1071
  // edge case: if we dont receive the final caption from the current speaker for 5 secs, we turn the current speaker caption to final and push in the new interjector
988
- else if (lastCaption) {
989
- if (Date.now() - lastCaption.timestamp.getTime() > 5000) {
1072
+ else if (lastCaption === null || lastCaption === void 0 ? void 0 : lastCaption.lastUpdatedTimestamp) {
1073
+ if (Date.now() - lastCaption.lastUpdatedTimestamp.getTime() > 5000) {
990
1074
  lastCaption.resultType = 'Final';
991
1075
  captions.push(newCaption);
992
1076
  }
@@ -999,22 +1083,33 @@ export class CallContext {
999
1083
  }
1000
1084
  addTeamsCaption(callId, caption) {
1001
1085
  this.modifyState((draft) => {
1086
+ var _a;
1002
1087
  const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1003
1088
  if (call) {
1004
1089
  const currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;
1005
1090
  if (caption.captionLanguage.toUpperCase() === currentCaptionLanguage.toUpperCase() ||
1006
1091
  currentCaptionLanguage === '' ||
1007
1092
  currentCaptionLanguage === undefined) {
1008
- this.processNewCaption(call.captionsFeature.captions, convertFromTeamsSDKToCaptionInfoState(caption));
1093
+ this.processNewCaption((_a = call === null || call === void 0 ? void 0 : call.captionsFeature.captions) !== null && _a !== void 0 ? _a : [], convertFromTeamsSDKToCaptionInfoState(caption));
1009
1094
  }
1010
1095
  }
1011
1096
  });
1012
1097
  }
1013
1098
  addCaption(callId, caption) {
1014
1099
  this.modifyState((draft) => {
1100
+ var _a;
1015
1101
  const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1016
1102
  if (call) {
1017
- this.processNewCaption(call.captionsFeature.captions, convertFromSDKToCaptionInfoState(caption));
1103
+ this.processNewCaption((_a = call === null || call === void 0 ? void 0 : call.captionsFeature.captions) !== null && _a !== void 0 ? _a : [], convertFromSDKToCaptionInfoState(caption));
1104
+ }
1105
+ });
1106
+ }
1107
+ /* @conditional-compile-remove(rtt) */
1108
+ addRealTimeText(callId, realTimeText) {
1109
+ this.modifyState((draft) => {
1110
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1111
+ if (call) {
1112
+ this.processNewRealTimeText(call.realTimeTextFeature.realTimeTexts, convertFromSDKRealTimeTextToRealTimeTextInfoState(realTimeText));
1018
1113
  }
1019
1114
  });
1020
1115
  }
@@ -1030,7 +1125,7 @@ export class CallContext {
1030
1125
  this.modifyState((draft) => {
1031
1126
  const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1032
1127
  if (call) {
1033
- call.captionsFeature.captions = [];
1128
+ call.captionsFeature.captions = call.captionsFeature.captions.filter((c) => 'message' in c);
1034
1129
  }
1035
1130
  });
1036
1131
  }
@@ -1042,6 +1137,15 @@ export class CallContext {
1042
1137
  }
1043
1138
  });
1044
1139
  }
1140
+ /* @conditional-compile-remove(rtt) */
1141
+ setIsRealTimeTextActive(callId, isRealTimeTextActive) {
1142
+ this.modifyState((draft) => {
1143
+ const call = draft.calls[this._callIdHistory.latestCallId(callId)];
1144
+ if (call) {
1145
+ call.realTimeTextFeature.isRealTimeTextFeatureActive = isRealTimeTextActive;
1146
+ }
1147
+ });
1148
+ }
1045
1149
  setStartCaptionsInProgress(callId, startCaptionsInProgress) {
1046
1150
  this.modifyState((draft) => {
1047
1151
  const call = draft.calls[this._callIdHistory.latestCallId(callId)];