@azure/communication-react 1.19.0-alpha-202407250014 → 1.19.0-alpha-202407270014

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 (150) hide show
  1. package/dist/communication-react.d.ts +203 -23
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-D4Pf_JpT.js → ChatMessageComponentAsRichTextEditBox-BueeC-ud.js} +14 -15
  3. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BueeC-ud.js.map +1 -0
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BNwd6bE2.js → RichTextSendBoxWrapper-Br441vhG.js} +2 -3
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BNwd6bE2.js.map → RichTextSendBoxWrapper-Br441vhG.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-DdAkrosV.js → index-DznlW8XT.js} +411 -246
  7. package/dist/dist-cjs/communication-react/index-DznlW8XT.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +2 -2
  9. package/dist/dist-esm/acs-ui-common/src/index.d.ts +1 -0
  10. package/dist/dist-esm/acs-ui-common/src/index.js +2 -0
  11. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +7 -0
  13. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +18 -0
  14. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +1 -0
  15. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  16. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +14 -1
  18. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +16 -0
  19. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +2 -0
  21. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +17 -0
  22. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  23. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.d.ts +2 -0
  24. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +17 -0
  25. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  26. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +3 -1
  27. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +13 -1
  28. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  29. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.d.ts +16 -0
  30. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js +33 -0
  31. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js.map +1 -0
  32. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +2 -0
  33. package/dist/dist-esm/calling-component-bindings/src/index.js +1 -0
  34. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  35. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +6 -1
  36. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +12 -0
  37. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  38. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.d.ts +2 -7
  39. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js.map +1 -1
  40. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.d.ts +2 -2
  41. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +1 -2
  42. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  43. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +62 -3
  44. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  45. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +2 -1
  46. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +6 -1
  47. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  48. package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +4 -3
  49. package/dist/dist-esm/calling-stateful-client/src/Converter.js +26 -3
  50. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  51. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +3 -1
  52. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  53. package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.d.ts +1 -2
  54. package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.js.map +1 -1
  55. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +2 -2
  56. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  57. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +2 -1
  58. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  59. package/dist/dist-esm/calling-stateful-client/src/index.d.ts +1 -1
  60. package/dist/dist-esm/calling-stateful-client/src/index.js.map +1 -1
  61. package/dist/dist-esm/communication-react/src/index.d.ts +3 -2
  62. package/dist/dist-esm/communication-react/src/index.js +1 -1
  63. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  64. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +2 -2
  65. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  66. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +2 -2
  67. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  68. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +2 -2
  69. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +12 -12
  70. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -2
  72. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +2 -2
  73. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  74. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +6 -6
  75. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  76. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +2 -2
  77. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  78. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.d.ts +27 -1
  79. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js +73 -36
  80. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js.map +1 -1
  81. package/dist/dist-esm/react-components/src/components/IncomingCallStack.d.ts +76 -0
  82. package/dist/dist-esm/react-components/src/components/IncomingCallStack.js +23 -0
  83. package/dist/dist-esm/react-components/src/components/IncomingCallStack.js.map +1 -0
  84. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.d.ts +0 -5
  85. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js +3 -23
  86. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +6 -5
  88. package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -3
  89. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  90. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +2 -2
  91. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +15 -5
  92. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -1
  93. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +1 -1
  94. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +1 -1
  95. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  96. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +6 -4
  97. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  98. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +1 -1
  99. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +2 -2
  100. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  101. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +13 -11
  102. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +14 -14
  103. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  104. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +3 -0
  105. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +1 -1
  106. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +15 -15
  107. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  108. package/dist/dist-esm/react-components/src/components/VideoGallery.js +9 -6
  109. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  110. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -0
  111. package/dist/dist-esm/react-components/src/components/index.js +3 -0
  112. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  113. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  114. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +1 -1
  115. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +3 -3
  116. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +14 -11
  117. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  118. package/dist/dist-esm/react-components/src/components/utils/formatPhoneNumber.d.ts +2 -2
  119. package/dist/dist-esm/react-components/src/components/utils/formatPhoneNumber.js +6 -2
  120. package/dist/dist-esm/react-components/src/components/utils/formatPhoneNumber.js.map +1 -1
  121. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +5 -2
  122. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  123. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -2
  124. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +1 -6
  125. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  126. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +3 -3
  127. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  128. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +7 -9
  129. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  130. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +36 -33
  131. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  132. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +6 -4
  133. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  134. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -2
  135. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  136. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +3 -7
  137. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -8
  138. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  139. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +9 -8
  140. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  141. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +4 -10
  142. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +7 -23
  143. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +1 -1
  144. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js +2 -2
  145. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
  146. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +3 -3
  147. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  148. package/package.json +2 -3
  149. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-D4Pf_JpT.js.map +0 -1
  150. package/dist/dist-cjs/communication-react/index-DdAkrosV.js.map +0 -1
@@ -9,6 +9,8 @@ export type { ErrorBarSelector } from './errorBarSelector';
9
9
  export type { NotificationStackSelector } from './notificationStackSelector';
10
10
  export { notificationStackSelector } from './notificationStackSelector';
11
11
  export type { HoldButtonSelector } from './callControlSelectors';
12
+ export type { IncomingCallStackSelector } from './incomingCallStackSelector';
13
+ export { incomingCallStackSelector } from './incomingCallStackSelector';
12
14
  export type { _StartCaptionsButtonSelector, _CaptionSettingsSelector, _CaptionsBannerSelector } from './captionsSelector';
13
15
  export { _captionsBannerSelector, _startCaptionsButtonSelector, _captionSettingsSelector } from './captionsSelector';
14
16
  export type { CallingHandlers, CreateDefaultCallingHandlers } from './handlers/createHandlers';
@@ -6,6 +6,7 @@ export { createDefaultCallingHandlers } from './handlers/createHandlers';
6
6
  export { createDefaultTeamsCallingHandlers } from './handlers/createTeamsCallHandlers';
7
7
  /* @conditional-compile-remove(notifications) */
8
8
  export { notificationStackSelector } from './notificationStackSelector';
9
+ export { incomingCallStackSelector } from './incomingCallStackSelector';
9
10
  export { _captionsBannerSelector, _startCaptionsButtonSelector, _captionSettingsSelector } from './captionsSelector';
10
11
  /* @conditional-compile-remove(teams-identity-support) */
11
12
  export { useTeamsCall, useTeamsCallAgent } from './providers';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,yDAAyD;AACzD,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AAOvF,gDAAgD;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAUxE,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAWrH,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,aAAa,EACb,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG3G,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC7G,sDAAsD;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,mCAAmC,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport type { CallingBaseSelectorProps } from './baseSelectors';\nexport * from './callControlSelectors';\nexport { createDefaultCallingHandlers } from './handlers/createHandlers';\n/* @conditional-compile-remove(teams-identity-support) */\nexport { createDefaultTeamsCallingHandlers } from './handlers/createTeamsCallHandlers';\nexport type { ParticipantListSelector } from './participantListSelector';\nexport type { ParticipantsButtonSelector } from './participantsButtonSelector';\nexport type { VideoGallerySelector } from './videoGallerySelector';\nexport type { ErrorBarSelector } from './errorBarSelector';\n/* @conditional-compile-remove(notifications) */\nexport type { NotificationStackSelector } from './notificationStackSelector';\n/* @conditional-compile-remove(notifications) */\nexport { notificationStackSelector } from './notificationStackSelector';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonSelector } from './callControlSelectors';\n\nexport type {\n _StartCaptionsButtonSelector,\n _CaptionSettingsSelector,\n _CaptionsBannerSelector\n} from './captionsSelector';\n\nexport { _captionsBannerSelector, _startCaptionsButtonSelector, _captionSettingsSelector } from './captionsSelector';\n\nexport type { CallingHandlers, CreateDefaultCallingHandlers } from './handlers/createHandlers';\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallingHandlers } from './handlers/createTeamsCallHandlers';\nexport type { CommonCallingHandlers } from './handlers/createCommonHandlers';\nexport type { CaptionsOptions } from './handlers/createCommonHandlers';\n\nexport type { VideoBackgroundEffectsDependency } from './handlers/createCommonHandlers';\n\nexport type { _ComponentCallingHandlers, CallingHandlersOptions } from './handlers/createHandlers';\n/* @conditional-compile-remove(teams-identity-support) */\nexport { useTeamsCall, useTeamsCallAgent } from './providers';\n\nexport {\n CallAgentProvider,\n CallClientProvider,\n CallProvider,\n useCall,\n useCallAgent,\n useCallClient,\n useDeviceManager\n} from './providers';\nexport type { CallAgentProviderProps, CallClientProviderProps, CallProviderProps } from './providers';\n\nexport { usePropsFor as useCallingPropsFor, getSelector as getCallingSelector } from './hooks/usePropsFor';\nexport type { GetSelector as GetCallingSelector, EmptySelector } from './hooks/usePropsFor';\n\nexport { useSelector as useCallingSelector } from './hooks/useSelector';\nexport { useHandlers as useCallingHandlers } from './hooks/useHandlers';\n\nexport { _isInCall, _isPreviewOn, _isInLobbyOrConnecting, _updateUserDisplayNames } from './utils/callUtils';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { _getEnvironmentInfo } from './utils/callUtils';\n\nexport { _videoGalleryRemoteParticipantsMemo, _dominantSpeakersWithFlatId } from './utils/videoGalleryUtils';\nexport type { _VideoGalleryRemoteParticipantsMemoFn } from './utils/videoGalleryUtils';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AACzE,yDAAyD;AACzD,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AAOvF,gDAAgD;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAIxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAQxE,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAWrH,yDAAyD;AACzD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE9D,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,aAAa,EACb,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG3G,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACxE,OAAO,EAAE,WAAW,IAAI,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAExE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC7G,sDAAsD;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAE,mCAAmC,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport type { CallingBaseSelectorProps } from './baseSelectors';\nexport * from './callControlSelectors';\nexport { createDefaultCallingHandlers } from './handlers/createHandlers';\n/* @conditional-compile-remove(teams-identity-support) */\nexport { createDefaultTeamsCallingHandlers } from './handlers/createTeamsCallHandlers';\nexport type { ParticipantListSelector } from './participantListSelector';\nexport type { ParticipantsButtonSelector } from './participantsButtonSelector';\nexport type { VideoGallerySelector } from './videoGallerySelector';\nexport type { ErrorBarSelector } from './errorBarSelector';\n/* @conditional-compile-remove(notifications) */\nexport type { NotificationStackSelector } from './notificationStackSelector';\n/* @conditional-compile-remove(notifications) */\nexport { notificationStackSelector } from './notificationStackSelector';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonSelector } from './callControlSelectors';\nexport type { IncomingCallStackSelector } from './incomingCallStackSelector';\nexport { incomingCallStackSelector } from './incomingCallStackSelector';\n\nexport type {\n _StartCaptionsButtonSelector,\n _CaptionSettingsSelector,\n _CaptionsBannerSelector\n} from './captionsSelector';\n\nexport { _captionsBannerSelector, _startCaptionsButtonSelector, _captionSettingsSelector } from './captionsSelector';\n\nexport type { CallingHandlers, CreateDefaultCallingHandlers } from './handlers/createHandlers';\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallingHandlers } from './handlers/createTeamsCallHandlers';\nexport type { CommonCallingHandlers } from './handlers/createCommonHandlers';\nexport type { CaptionsOptions } from './handlers/createCommonHandlers';\n\nexport type { VideoBackgroundEffectsDependency } from './handlers/createCommonHandlers';\n\nexport type { _ComponentCallingHandlers, CallingHandlersOptions } from './handlers/createHandlers';\n/* @conditional-compile-remove(teams-identity-support) */\nexport { useTeamsCall, useTeamsCallAgent } from './providers';\n\nexport {\n CallAgentProvider,\n CallClientProvider,\n CallProvider,\n useCall,\n useCallAgent,\n useCallClient,\n useDeviceManager\n} from './providers';\nexport type { CallAgentProviderProps, CallClientProviderProps, CallProviderProps } from './providers';\n\nexport { usePropsFor as useCallingPropsFor, getSelector as getCallingSelector } from './hooks/usePropsFor';\nexport type { GetSelector as GetCallingSelector, EmptySelector } from './hooks/usePropsFor';\n\nexport { useSelector as useCallingSelector } from './hooks/useSelector';\nexport { useHandlers as useCallingHandlers } from './hooks/useHandlers';\n\nexport { _isInCall, _isPreviewOn, _isInLobbyOrConnecting, _updateUserDisplayNames } from './utils/callUtils';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { _getEnvironmentInfo } from './utils/callUtils';\n\nexport { _videoGalleryRemoteParticipantsMemo, _dominantSpeakersWithFlatId } from './utils/videoGalleryUtils';\nexport type { _VideoGalleryRemoteParticipantsMemoFn } from './utils/videoGalleryUtils';\n"]}
@@ -1,5 +1,5 @@
1
1
  import { DeviceManagerState, RemoteParticipantState, StatefulCallClient } from "../../../calling-stateful-client/src";
2
- import { CallState as CallStatus, ParticipantRole } from '@azure/communication-calling';
2
+ import { CallState as CallStatus, LocalVideoStream, ParticipantRole } from '@azure/communication-calling';
3
3
  import { EnvironmentInfo } from '@azure/communication-calling';
4
4
  import { CommunicationIdentifier, CommunicationUserIdentifier, MicrosoftTeamsUserIdentifier, PhoneNumberIdentifier, UnknownIdentifier } from '@azure/communication-common';
5
5
  type ParticipantConnectionState = 'Idle' | 'Connecting' | 'Ringing' | 'Connected' | 'Hold' | 'InLobby' | 'EarlyMedia' | 'Disconnected';
@@ -61,5 +61,10 @@ export declare const _isRingingPSTNParticipant: (participant: RemoteParticipantS
61
61
  * Changes the display name of the participant based on the local and remote user's role.
62
62
  */
63
63
  export declare const maskDisplayNameWithRole: (displayName: string | undefined, localUserRole?: ParticipantRole, participantRole?: ParticipantRole, isHideAttendeeNamesEnabled?: boolean) => string | undefined;
64
+ /**
65
+ * Helper to create a local video stream from the selected camera.
66
+ * @private
67
+ */
68
+ export declare const createLocalVideoStream: (callClient: StatefulCallClient) => Promise<LocalVideoStream | undefined>;
64
69
  export {};
65
70
  //# sourceMappingURL=callUtils.d.ts.map
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  step((generator = generator.apply(thisArg, _arguments || [])).next());
10
10
  });
11
11
  };
12
+ import { LocalVideoStream } from '@azure/communication-calling';
12
13
  /* @conditional-compile-remove(unsupported-browser) */
13
14
  import { Features } from '@azure/communication-calling';
14
15
  import { isCommunicationUserIdentifier, isMicrosoftTeamsUserIdentifier, isPhoneNumberIdentifier } from '@azure/communication-common';
@@ -125,4 +126,15 @@ export const maskDisplayNameWithRole = (displayName, localUserRole, participantR
125
126
  }
126
127
  return maskedDisplayName;
127
128
  };
129
+ /**
130
+ * Helper to create a local video stream from the selected camera.
131
+ * @private
132
+ */
133
+ export const createLocalVideoStream = (callClient) => __awaiter(void 0, void 0, void 0, function* () {
134
+ const camera = yield (callClient === null || callClient === void 0 ? void 0 : callClient.getState().deviceManager.selectedCamera);
135
+ if (camera) {
136
+ return new LocalVideoStream(camera);
137
+ }
138
+ return undefined;
139
+ });
128
140
  //# sourceMappingURL=callUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"callUtils.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/utils/callUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAIlC,sDAAsD;AACtD,OAAO,EAAE,QAAQ,EAAmB,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAGL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EAIxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,6BAA6B,EAAE,mCAAgC;AAYtF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,UAAuB,EAAW,EAAE,CAC5D,CAAC,CAAC,UAAU;IACZ,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAEzG;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAAkC,EAAW,EAAE,CACpF,CAAC,CAAC,UAAU,IAAI,CAAC,YAAY,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAE1F;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,aAAiC,EAAW,EAAE;IACzE,iHAAiH;IACjH,gFAAgF;IAChF,OAAO,aAAa,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC;AACzG,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,C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AAkB,WAAW,GAAG,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DeviceManagerState, RemoteParticipantState, StatefulCallClient } from '@internal/calling-stateful-client';\nimport { CallState as CallStatus, ParticipantRole } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { Features, EnvironmentInfo } from '@azure/communication-calling';\nimport {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier,\n MicrosoftTeamsUserIdentifier,\n PhoneNumberIdentifier,\n UnknownIdentifier\n} from '@azure/communication-common';\nimport { memoizeFnAll, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n\ntype ParticipantConnectionState =\n | 'Idle'\n | 'Connecting'\n | 'Ringing'\n | 'Connected'\n | 'Hold'\n | 'InLobby'\n | 'EarlyMedia'\n | 'Disconnected';\n\n/**\n * Check if the call state represents being in the call\n *\n * @internal\n */\nexport const _isInCall = (callStatus?: CallStatus): boolean =>\n !!callStatus &&\n !['None', 'Disconnected', 'Connecting', 'Ringing', 'EarlyMedia', 'Disconnecting'].includes(callStatus);\n\n/**\n * Check if the call state represents being in the lobby or waiting to be admitted.\n *\n * @internal\n */\nexport const _isInLobbyOrConnecting = (callStatus: CallStatus | undefined): boolean =>\n !!callStatus && ['Connecting', 'Ringing', 'InLobby', 'EarlyMedia'].includes(callStatus);\n\n/**\n * Check if the device manager local video is on when not part of a call\n * i.e. do unparented views exist.\n *\n * @internal\n */\nexport const _isPreviewOn = (deviceManager: DeviceManagerState): boolean => {\n // TODO: we should take in a LocalVideoStream that developer wants to use as their 'Preview' view. We should also\n // handle cases where 'Preview' view is in progress and not necessary completed.\n return deviceManager.unparentedViews.length > 0 && deviceManager.unparentedViews[0].view !== undefined;\n};\n\n/**\n * Dispose of all preview views\n * We assume all unparented views are local preview views.\n *\n * @private\n */\nexport const disposeAllLocalPreviewViews = async (callClient: StatefulCallClient): Promise<void> => {\n const unparentedViews = callClient.getState().deviceManager.unparentedViews;\n for (const view of unparentedViews) {\n await callClient.disposeView(undefined, undefined, view);\n }\n};\n\n/**\n * Update the users displayNames based on the type of user they are\n *\n * @internal\n */\nexport const _updateUserDisplayNames = (participants: RemoteParticipantState[]): RemoteParticipantState[] => {\n if (participants) {\n return memoizedUpdateDisplayName((memoizedFn) => {\n return Object.values(participants).map((p) => {\n const pid = toFlatCommunicationIdentifier(p.identifier);\n return memoizedFn(pid, p);\n });\n });\n } else {\n return [];\n }\n};\n\nconst memoizedUpdateDisplayName = memoizeFnAll((participantId: string, participant: RemoteParticipantState) => {\n if (isPhoneNumberIdentifier(participant.identifier)) {\n return {\n ...participant,\n displayName: participant.identifier.phoneNumber\n };\n } else {\n return participant;\n }\n});\n\n/* @conditional-compile-remove(unsupported-browser) */\n/**\n * Check whether the call is in a supported browser\n *\n * @internal\n */\nexport const _getEnvironmentInfo = async (callClient: StatefulCallClient): Promise<EnvironmentInfo> => {\n const environmentInfo = await callClient.feature(Features.DebugInfo).getEnvironmentInfo();\n return environmentInfo;\n};\n\n/**\n * @private\n * A type guard to ensure all participants are acceptable type for Teams call\n */\nexport const isTeamsCallParticipants = (\n participants: CommunicationIdentifier[]\n): participants is (PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | UnknownIdentifier)[] => {\n return participants.every((p) => !isCommunicationUserIdentifier(p));\n};\n\n/**\n * @private\n * A type guard to ensure all participants are acceptable type for ACS call\n */\nexport const isACSCallParticipants = (\n participants: CommunicationIdentifier[]\n): participants is (PhoneNumberIdentifier | CommunicationUserIdentifier | UnknownIdentifier)[] => {\n return participants.every((p) => !isMicrosoftTeamsUserIdentifier(p));\n};\n\n/**\n * @private\n * Checks whether the user is a 'Ringing' PSTN user.\n */\nexport const _isRingingPSTNParticipant = (participant: RemoteParticipantState): ParticipantConnectionState => {\n return isPhoneNumberIdentifier(participant.identifier) && participant.state === 'Connecting'\n ? 'Ringing'\n : participant.state;\n};\n\n/**\n * @private\n * Changes the display name of the participant based on the local and remote user's role.\n */\nexport const maskDisplayNameWithRole = (\n displayName: string | undefined,\n localUserRole?: ParticipantRole,\n participantRole?: ParticipantRole,\n isHideAttendeeNamesEnabled?: boolean\n): string | undefined => {\n let maskedDisplayName = displayName;\n if (isHideAttendeeNamesEnabled && participantRole && participantRole === 'Attendee') {\n if (localUserRole && localUserRole === 'Attendee') {\n maskedDisplayName = '{AttendeeRole}';\n }\n if (\n localUserRole &&\n (localUserRole === 'Presenter' || localUserRole === 'Co-organizer' || localUserRole === 'Organizer')\n ) {\n maskedDisplayName = `{AttendeeRole}(${displayName})`;\n }\n }\n return maskedDisplayName;\n};\n"]}
1
+ {"version":3,"file":"callUtils.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/utils/callUtils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,EAA2B,gBAAgB,EAAmB,MAAM,8BAA8B,CAAC;AAC1G,sDAAsD;AACtD,OAAO,EAAE,QAAQ,EAAmB,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAGL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EAIxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,6BAA6B,EAAE,mCAAgC;AAYtF;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,UAAuB,EAAW,EAAE,CAC5D,CAAC,CAAC,UAAU;IACZ,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,eAAe,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;AAEzG;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,UAAkC,EAAW,EAAE,CACpF,CAAC,CAAC,UAAU,IAAI,C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iC,EACjC,0BAAoC,EAChB,EAAE;IACtB,IAAI,iBAAiB,GAAG,WAAW,CAAC;IACpC,IAAI,0BAA0B,IAAI,eAAe,IAAI,eAAe,KAAK,UAAU,EAAE,CAAC;QACpF,IAAI,aAAa,IAAI,aAAa,KAAK,UAAU,EAAE,CAAC;YAClD,iBAAiB,GAAG,gBAAgB,CAAC;QACvC,CAAC;QACD,IACE,aAAa;YACb,CAAC,aAAa,KAAK,WAAW,IAAI,aAAa,KAAK,cAAc,IAAI,aAAa,KAAK,WAAW,CAAC,EACpG,CAAC;YACD,iBAAiB,GAAG,kBAAkB,WAAW,GAAG,CAAC;QACvD,CAAC;IACH,CAAC;IACD,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAO,UAA8B,EAAyC,EAAE;IACpH,MAAM,MAAM,GAAG,MAAM,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,GAAG,aAAa,CAAC,cAAc,CAAA,CAAC;IACzE,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAA,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DeviceManagerState, RemoteParticipantState, StatefulCallClient } from '@internal/calling-stateful-client';\nimport { CallState as CallStatus, LocalVideoStream, ParticipantRole } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { Features, EnvironmentInfo } from '@azure/communication-calling';\nimport {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier,\n MicrosoftTeamsUserIdentifier,\n PhoneNumberIdentifier,\n UnknownIdentifier\n} from '@azure/communication-common';\nimport { memoizeFnAll, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n\ntype ParticipantConnectionState =\n | 'Idle'\n | 'Connecting'\n | 'Ringing'\n | 'Connected'\n | 'Hold'\n | 'InLobby'\n | 'EarlyMedia'\n | 'Disconnected';\n\n/**\n * Check if the call state represents being in the call\n *\n * @internal\n */\nexport const _isInCall = (callStatus?: CallStatus): boolean =>\n !!callStatus &&\n !['None', 'Disconnected', 'Connecting', 'Ringing', 'EarlyMedia', 'Disconnecting'].includes(callStatus);\n\n/**\n * Check if the call state represents being in the lobby or waiting to be admitted.\n *\n * @internal\n */\nexport const _isInLobbyOrConnecting = (callStatus: CallStatus | undefined): boolean =>\n !!callStatus && ['Connecting', 'Ringing', 'InLobby', 'EarlyMedia'].includes(callStatus);\n\n/**\n * Check if the device manager local video is on when not part of a call\n * i.e. do unparented views exist.\n *\n * @internal\n */\nexport const _isPreviewOn = (deviceManager: DeviceManagerState): boolean => {\n // TODO: we should take in a LocalVideoStream that developer wants to use as their 'Preview' view. We should also\n // handle cases where 'Preview' view is in progress and not necessary completed.\n return deviceManager.unparentedViews.length > 0 && deviceManager.unparentedViews[0].view !== undefined;\n};\n\n/**\n * Dispose of all preview views\n * We assume all unparented views are local preview views.\n *\n * @private\n */\nexport const disposeAllLocalPreviewViews = async (callClient: StatefulCallClient): Promise<void> => {\n const unparentedViews = callClient.getState().deviceManager.unparentedViews;\n for (const view of unparentedViews) {\n await callClient.disposeView(undefined, undefined, view);\n }\n};\n\n/**\n * Update the users displayNames based on the type of user they are\n *\n * @internal\n */\nexport const _updateUserDisplayNames = (participants: RemoteParticipantState[]): RemoteParticipantState[] => {\n if (participants) {\n return memoizedUpdateDisplayName((memoizedFn) => {\n return Object.values(participants).map((p) => {\n const pid = toFlatCommunicationIdentifier(p.identifier);\n return memoizedFn(pid, p);\n });\n });\n } else {\n return [];\n }\n};\n\nconst memoizedUpdateDisplayName = memoizeFnAll((participantId: string, participant: RemoteParticipantState) => {\n if (isPhoneNumberIdentifier(participant.identifier)) {\n return {\n ...participant,\n displayName: participant.identifier.phoneNumber\n };\n } else {\n return participant;\n }\n});\n\n/* @conditional-compile-remove(unsupported-browser) */\n/**\n * Check whether the call is in a supported browser\n *\n * @internal\n */\nexport const _getEnvironmentInfo = async (callClient: StatefulCallClient): Promise<EnvironmentInfo> => {\n const environmentInfo = await callClient.feature(Features.DebugInfo).getEnvironmentInfo();\n return environmentInfo;\n};\n\n/**\n * @private\n * A type guard to ensure all participants are acceptable type for Teams call\n */\nexport const isTeamsCallParticipants = (\n participants: CommunicationIdentifier[]\n): participants is (PhoneNumberIdentifier | MicrosoftTeamsUserIdentifier | UnknownIdentifier)[] => {\n return participants.every((p) => !isCommunicationUserIdentifier(p));\n};\n\n/**\n * @private\n * A type guard to ensure all participants are acceptable type for ACS call\n */\nexport const isACSCallParticipants = (\n participants: CommunicationIdentifier[]\n): participants is (PhoneNumberIdentifier | CommunicationUserIdentifier | UnknownIdentifier)[] => {\n return participants.every((p) => !isMicrosoftTeamsUserIdentifier(p));\n};\n\n/**\n * @private\n * Checks whether the user is a 'Ringing' PSTN user.\n */\nexport const _isRingingPSTNParticipant = (participant: RemoteParticipantState): ParticipantConnectionState => {\n return isPhoneNumberIdentifier(participant.identifier) && participant.state === 'Connecting'\n ? 'Ringing'\n : participant.state;\n};\n\n/**\n * @private\n * Changes the display name of the participant based on the local and remote user's role.\n */\nexport const maskDisplayNameWithRole = (\n displayName: string | undefined,\n localUserRole?: ParticipantRole,\n participantRole?: ParticipantRole,\n isHideAttendeeNamesEnabled?: boolean\n): string | undefined => {\n let maskedDisplayName = displayName;\n if (isHideAttendeeNamesEnabled && participantRole && participantRole === 'Attendee') {\n if (localUserRole && localUserRole === 'Attendee') {\n maskedDisplayName = '{AttendeeRole}';\n }\n if (\n localUserRole &&\n (localUserRole === 'Presenter' || localUserRole === 'Co-organizer' || localUserRole === 'Organizer')\n ) {\n maskedDisplayName = `{AttendeeRole}(${displayName})`;\n }\n }\n return maskedDisplayName;\n};\n\n/**\n * Helper to create a local video stream from the selected camera.\n * @private\n */\nexport const createLocalVideoStream = async (callClient: StatefulCallClient): Promise<LocalVideoStream | undefined> => {\n const camera = await callClient?.getState().deviceManager.selectedCamera;\n if (camera) {\n return new LocalVideoStream(camera);\n }\n return undefined;\n};\n"]}
@@ -1,5 +1,5 @@
1
- import { Call, CallAgent, IncomingCall } from '@azure/communication-calling';
2
- import { TeamsCall as TeamsCallBeta, CallCommon as CallCommonBeta, CallAgentCommon as CallAgentCommonBeta, IncomingCallCommon as IncomingCallCommonBeta } from '@azure/communication-calling';
1
+ import { Call, CallAgent } from '@azure/communication-calling';
2
+ import { TeamsCall as TeamsCallBeta, CallCommon as CallCommonBeta, CallAgentCommon as CallAgentCommonBeta } from '@azure/communication-calling';
3
3
  /**
4
4
  * @public
5
5
  * The common interface for all types of Calls
@@ -14,9 +14,4 @@ export type CallAgentCommon = CallAgent | /* @conditional-compile-remove(teams-i
14
14
  * @beta
15
15
  */
16
16
  export type TeamsCall = never | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallBeta;
17
- /**
18
- * @public
19
- * The common interface for all types of IncomingCalls
20
- */
21
- export type IncomingCallCommon = IncomingCall | /* @conditional-compile-remove(teams-identity-support) */ IncomingCallCommonBeta;
22
17
  //# sourceMappingURL=BetaToStableTypes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BetaToStableTypes.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/BetaToStableTypes.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// This is for mapping new types from beta, which does not exist in stable sdk.\n// These mappings are necessary to bypass type check of conditional compilation\n// Remove these types when the feature get stabilized in stable sdk\n\n// For example, CallCommon doesn't exist in stable call sdk, so it will be still Call type\n// So we remove CallCommonBeta type in stable\n// In beta, Call | CallCommon = CallCommon because Call is just a super set of CallCommon\n\nimport { Call, CallAgent, IncomingCall } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport {\n TeamsCall as TeamsCallBeta,\n CallCommon as CallCommonBeta,\n CallAgentCommon as CallAgentCommonBeta,\n IncomingCallCommon as IncomingCallCommonBeta\n} from '@azure/communication-calling';\n\n/**\n * @public\n * The common interface for all types of Calls\n */\nexport type CallCommon = Call | /* @conditional-compile-remove(teams-identity-support) */ CallCommonBeta;\n\n/**\n * @public\n * The common interface for all types of CallAgents\n */\nexport type CallAgentCommon = CallAgent | /* @conditional-compile-remove(teams-identity-support) */ CallAgentCommonBeta;\n\n/**\n * @beta\n */\nexport type TeamsCall = never | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallBeta;\n\n/**\n * @public\n * The common interface for all types of IncomingCalls\n */\nexport type IncomingCallCommon =\n | IncomingCall\n | /* @conditional-compile-remove(teams-identity-support) */ IncomingCallCommonBeta;\n"]}
1
+ {"version":3,"file":"BetaToStableTypes.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/BetaToStableTypes.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// This is for mapping new types from beta, which does not exist in stable sdk.\n// These mappings are necessary to bypass type check of conditional compilation\n// Remove these types when the feature get stabilized in stable sdk\n\n// For example, CallCommon doesn't exist in stable call sdk, so it will be still Call type\n// So we remove CallCommonBeta type in stable\n// In beta, Call | CallCommon = CallCommon because Call is just a super set of CallCommon\n\nimport { Call, CallAgent } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport {\n TeamsCall as TeamsCallBeta,\n CallCommon as CallCommonBeta,\n CallAgentCommon as CallAgentCommonBeta\n} from '@azure/communication-calling';\n\n/**\n * @public\n * The common interface for all types of Calls\n */\nexport type CallCommon = Call | /* @conditional-compile-remove(teams-identity-support) */ CallCommonBeta;\n\n/**\n * @public\n * The common interface for all types of CallAgents\n */\nexport type CallAgentCommon = CallAgent | /* @conditional-compile-remove(teams-identity-support) */ CallAgentCommonBeta;\n\n/**\n * @beta\n */\nexport type TeamsCall = never | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallBeta;\n"]}
@@ -1,5 +1,5 @@
1
- import { CallAgent } from '@azure/communication-calling';
2
- import { IncomingCallCommon, CallAgentCommon, CallCommon } from './BetaToStableTypes';
1
+ import { CallAgent, IncomingCallCommon } from '@azure/communication-calling';
2
+ import { CallAgentCommon, CallCommon } from './BetaToStableTypes';
3
3
  import { TeamsCallAgent } from '@azure/communication-calling';
4
4
  import { CallContext } from './CallContext';
5
5
  import { InternalCallContext } from './InternalCallContext';
@@ -85,12 +85,11 @@ export class ProxyCallAgentCommon {
85
85
  }
86
86
  if (_isTeamsIncomingCall(incomingCall)) {
87
87
  this._incomingCalls.set(incomingCall.id, teamsIncomingCallDeclaratify(incomingCall, this._context));
88
- this._context.setIncomingCall(convertSdkIncomingCallToDeclarativeIncomingCall(incomingCall));
89
88
  }
90
89
  else {
91
90
  this._incomingCalls.set(incomingCall.id, incomingCallDeclaratify(incomingCall, this._context));
92
- this._context.setIncomingCall(convertSdkIncomingCallToDeclarativeIncomingCall(incomingCall));
93
91
  }
92
+ this._context.setIncomingCall(convertSdkIncomingCallToDeclarativeIncomingCall(incomingCall));
94
93
  };
95
94
  this.addCall = (call) => {
96
95
  var _a;
@@ -1 +1 @@
1
- {"version":3,"file":"CallAgentDeclarativeCommon.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallAgentDeclarativeCommon.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAiBlC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,+CAA+C,EAAE,MAAM,aAAa,CAAC;AAC/G,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,oBAAoB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ACL,CAAC,CAAC;YACJ,CAAC;YACD;;;;;;;;eAQG;YACH,KAAK,eAAe,CAAC,CAAC,CAAC;gBACrB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;YAClD,CAAC;YACD;gBACE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAoB,EAAE,eAAoC,EAAQ,EAAE;IACxG,sGAAsG;IACtG,oHAAoH;IACpH,qDAAqD;IACrD,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAE1C,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAChC,eAAe,CAAC,qBAAqB,EAAE,CAAC;AAC1C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Call,\n CallAgent,\n CallEndReason,\n CollectionUpdatedEvent,\n IncomingCall,\n TeamsIncomingCall\n} from '@azure/communication-calling';\n\nimport { IncomingCallCommon, CallAgentCommon, CallCommon } from './BetaToStableTypes';\n\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCallAgent } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\nimport { DeclarativeCall } from './CallDeclarative';\nimport { CallSubscriber } from './CallSubscriber';\nimport { convertSdkCallToDeclarativeCall, convertSdkIncomingCallToDeclarativeIncomingCall } from './Converter';\nimport { IncomingCallSubscriber } from './IncomingCallSubscriber';\nimport { InternalCallContext } from './InternalCallContext';\nimport { disposeAllViews, disposeAllViewsFromCall } from './StreamUtils';\nimport { _isTeamsIncomingCall } from './TypeGuards';\nimport { incomingCallDeclaratify } from './IncomingCallDeclarative';\nimport { teamsIncomingCallDeclaratify } from './TeamsIncomingCallDeclarative';\n\n/**\n *\n * @private\n */\nexport type DeclarativeCallCommon = CallCommon & {\n /**\n * Stop any declarative specific subscriptions and remove declarative subscribers.\n */\n unsubscribe(): void;\n};\n\n/**\n * ProxyCallAgent proxies CallAgent and saves any returned state in the given context. It will subscribe to all state\n * updates in the CallAgent and in the contained Calls and RemoteParticipants. When dispose is called it will\n * unsubscribe from all state updates.\n */\nexport abstract class ProxyCallAgentCommon {\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n private _callSubscribers: Map<CallCommon, CallSubscriber>;\n private _incomingCallSubscribers: Map<string, IncomingCallSubscriber>;\n private _incomingCalls: Map<string, IncomingCallCommon>;\n private _declarativeCalls: Map<CallCommon, DeclarativeCallCommon>;\n private _externalCallsUpdatedListeners: Set<CollectionUpdatedEvent<CallCommon>>;\n\n constructor(context: CallContext, internalContext: InternalCallContext) {\n this._context = context;\n this._internalContext = internalContext;\n this._callSubscribers = new Map<Call, CallSubscriber>();\n this._incomingCallSubscribers = new Map<string, IncomingCallSubscriber>();\n this._incomingCalls = new Map<string, IncomingCallCommon>();\n this._declarativeCalls = new Map<Call, DeclarativeCall>();\n this._externalCallsUpdatedListeners = new Set<CollectionUpdatedEvent<CallCommon>>();\n }\n\n // Unsubscribe is called when CallAgent is disposed. This should mean no more updating of existing call but we don't\n // remove any existing state.\n protected unregisterSubscriber = (): void => {\n for (const [_, callSubscriber] of this._callSubscribers.entries()) {\n callSubscriber.unsubscribe();\n }\n this._callSubscribers.clear();\n\n for (const [_, incomingCallSubscriber] of this._incomingCallSubscribers.entries()) {\n incomingCallSubscriber.unsubscribe();\n }\n this._incomingCallSubscribers.clear();\n this._incomingCalls.clear();\n\n for (const [_, declarativeCall] of this._declarativeCalls.entries()) {\n declarativeCall.unsubscribe();\n }\n this._declarativeCalls.clear();\n };\n\n protected abstract unsubscribe(): void;\n\n protected abstract callDeclaratify(call: CallCommon, context: CallContext): DeclarativeCallCommon;\n\n protected callsUpdated = (event: { added: CallCommon[]; removed: CallCommon[] }): void => {\n const addedStatefulCall: DeclarativeCallCommon[] = [];\n for (const call of event.added) {\n const statefulCall = this.addCall(call);\n addedStatefulCall.push(statefulCall);\n }\n const removedStatefulCall: DeclarativeCallCommon[] = [];\n for (const call of event.removed) {\n disposeAllViewsFromCall(this._context, this._internalContext, call.id);\n const callSubscriber = this._callSubscribers.get(call);\n if (callSubscriber) {\n callSubscriber.unsubscribe();\n this._callSubscribers.delete(call);\n }\n this._context.setCallEnded(call.id, call.callEndReason);\n const declarativeCall = this._declarativeCalls.get(call);\n if (declarativeCall) {\n declarativeCall.unsubscribe();\n removedStatefulCall.push(declarativeCall);\n this._declarativeCalls.delete(call);\n } else {\n removedStatefulCall.push(this.callDeclaratify(call, this._context));\n }\n }\n\n for (const externalCallsUpdatedListener of this._externalCallsUpdatedListeners) {\n externalCallsUpdatedListener({ added: addedStatefulCall, removed: removedStatefulCall });\n }\n };\n\n private setIncomingCallEnded = (incomingCallId: string, callEndReason: CallEndReason): void => {\n const incomingCallSubscriber = this._incomingCallSubscribers.get(incomingCallId);\n if (incomingCallSubscriber) {\n incomingCallSubscriber.unsubscribe();\n this._incomingCallSubscribers.delete(incomingCallId);\n }\n this._incomingCalls.delete(incomingCallId);\n this._context.setIncomingCallEnded(incomingCallId, callEndReason);\n };\n\n protected incomingCall = ({ incomingCall }: { incomingCall: IncomingCallCommon }): void => {\n // Make sure to not subscribe to the incoming call if we are already subscribed to it.\n if (!this._incomingCallSubscribers.has(incomingCall.id)) {\n this._incomingCallSubscribers.set(\n incomingCall.id,\n new IncomingCallSubscriber(incomingCall, this.setIncomingCallEnded)\n );\n }\n if (_isTeamsIncomingCall(incomingCall)) {\n this._incomingCalls.set(\n incomingCall.id,\n teamsIncomingCallDeclaratify(incomingCall as TeamsIncomingCall, this._context)\n );\n this._context.setIncomingCall(convertSdkIncomingCallToDeclarativeIncomingCall(incomingCall));\n } else {\n this._incomingCalls.set(incomingCall.id, incomingCallDeclaratify(incomingCall as IncomingCall, this._context));\n this._context.setIncomingCall(convertSdkIncomingCallToDeclarativeIncomingCall(incomingCall));\n }\n };\n\n protected addCall = (call: CallCommon): DeclarativeCallCommon => {\n this._callSubscribers.get(call)?.unsubscribe();\n\n // For API extentions we need to have the call in the state when we are subscribing as we may want to update the\n // state during the subscription process in the subscriber so we add the call to state before subscribing.\n this._context.setCall(convertSdkCallToDeclarativeCall(call));\n this._callSubscribers.set(call, new CallSubscriber(call, this._context, this._internalContext));\n return this.getOrCreateDeclarativeCall(call);\n };\n\n private getOrCreateDeclarativeCall = (call: CallCommon): DeclarativeCallCommon => {\n const declarativeCall = this._declarativeCalls.get(call);\n if (declarativeCall) {\n return declarativeCall;\n }\n\n const newDeclarativeCall = this.callDeclaratify(call, this._context);\n this._declarativeCalls.set(call, newDeclarativeCall);\n return newDeclarativeCall;\n };\n\n // args could be either from teamsCall or Call, set it as unknown and cast it in child class later\n protected abstract startCall(agent: CallAgentCommon, args: unknown[]): CallCommon;\n protected abstract joinCall(agent: CallAgentCommon, args: unknown[]): CallCommon;\n protected abstract agentSubscribe(agent: CallAgentCommon, args: unknown[]): void;\n protected abstract agentUnsubscribe(agent: CallAgentCommon, args: unknown[]): void;\n\n // We can't directly override get function because it is proxied,\n // Add a getCommon function and call it in child class\n protected getCommon<\n AgentType extends CallAgent | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallAgent,\n P extends keyof CallAgent\n >(target: AgentType, prop: P | 'incomingCalls'): any {\n switch (prop) {\n case 'startCall': {\n return this._context.withErrorTeedToState((...args: Parameters<AgentType['startCall']>): CallCommon => {\n const call = this.startCall(target, args);\n this.addCall(call);\n return this.getOrCreateDeclarativeCall(call);\n }, 'CallAgent.startCall');\n }\n case 'join': {\n return this._context.withErrorTeedToState((...args: Parameters<AgentType['join']>): CallCommon => {\n const call = this.joinCall(target, args);\n this.addCall(call);\n return this.getOrCreateDeclarativeCall(call);\n }, 'CallAgent.join');\n }\n case 'calls': {\n return Array.from(this._declarativeCalls.values());\n }\n case 'on': {\n return (...args: Parameters<AgentType['on']>): void => {\n // typescript is not smart enough to handle multiple overloads and pull the correct type here so force casting args\n const event = args[0] as 'incomingCall' | 'callsUpdated' | 'connectionStateChanged';\n\n const isCallsUpdated = event === 'callsUpdated';\n if (isCallsUpdated) {\n const listener = args[1] as unknown as CollectionUpdatedEvent<CallCommon>;\n this._externalCallsUpdatedListeners.add(listener);\n } else {\n this.agentSubscribe(target, args);\n }\n };\n }\n case 'off': {\n return (...args: Parameters<AgentType['off']>): void => {\n // typescript is not smart enough to handle multiple overloads and pull the correct type here so force casting args\n const event = args[0] as 'incomingCall' | 'callsUpdated' | 'connectionStateChanged';\n\n const isCallsUpdated = event === 'callsUpdated';\n if (isCallsUpdated) {\n const listener = args[1] as unknown as CollectionUpdatedEvent<CallCommon>;\n this._externalCallsUpdatedListeners.delete(listener);\n } else {\n this.agentUnsubscribe(target, args);\n }\n };\n }\n case 'dispose': {\n /* @conditional-compile-remove(calling-beta-sdk) */\n return (): void => {\n target.dispose();\n this.unsubscribe();\n };\n // Wrapping CallAgent.dispose in a callback type (): Promise<void> to accomodate the change of CallAgent.dispose\n // in calling beta version 1.8.0-beta.1 from callback type (): Promise<void> to (): void\n const callAgentDisposeAsyncCallbackWrapper = async (): Promise<void> => {\n await target.dispose();\n return Promise.resolve();\n };\n return (): Promise<void> => {\n return callAgentDisposeAsyncCallbackWrapper().then(() => {\n this.unsubscribe();\n });\n };\n }\n /**\n * This attribute is a special case and doesn't exist on the CallAgent interface.\n * We need this to be able to return a declarative incoming call object using the call agent.\n * In a standard headless SDK usage, the right way to get an incoming call is to use the `incomingCall` event.\n * However, using the declarative layer, the ideal usage would be to:\n * 1. subscribe to the `onStateChange` event\n * 2. Get the incoming call from the new state and it's ID\n * 3. Use `callAgent.incomingCalls` and filter an incoming call ID to get a declarative incoming call object\n */\n case 'incomingCalls': {\n return Array.from(this._incomingCalls.values());\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * @private\n */\nexport const clearCallRelatedState = (context: CallContext, internalContext: InternalCallContext): void => {\n // Make sure there are no existing call data if creating a new CallAgentDeclarative (if creating a new\n // CallAgentDeclarative after disposing of the hold one will mean context have old call state). TODO: should we stop\n // rendering when the previous callAgent is disposed?\n disposeAllViews(context, internalContext);\n\n context.clearCallRelatedState();\n internalContext.clearCallRelatedState();\n};\n"]}
1
+ {"version":3,"file":"CallAgentDeclarativeCommon.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallAgentDeclarativeCommon.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAkBlC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,+CAA+C,EAAE,MAAM,aAAa,CAAC;AAC/G,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAa9E;;;;GAIG;AACH,MAAM,OAAgB,oBAAoB;IASxC,YAAY,OAAoB,EAAE,eAAoC;QAUtE,oHAAoH;QACpH,6BAA6B;QACnB,yBAAoB,GAAG,GAAS,EAAE;YAC1C,KAAK,MAAM,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,EAAE,CAAC;gBAClE,cAAc,CAAC,WAAW,EAAE,CAAC;YAC/B,CAAC;YACD,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;YAE9B,KAAK,MAAM,CAAC,CAAC,EAAE,sBAAsB,CAAC,IAAI,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,EAAE,CAAC;gBAClF,sBAAsB,CAAC,WAAW,EAAE,CAAC;YACvC,CAAC;YACD,IAAI,CAAC,wBAAwB,CAAC,KA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CAAC,CAAC;gBACf,mDAAmD;gBACnD,OAAO,GAAS,EAAE;oBAChB,MAAM,CAAC,OAAO,EAAE,CAAC;oBACjB,IAAI,CAAC,WAAW,EAAE,CAAC;gBACrB,CAAC,CAAC;gBACF,gHAAgH;gBAChH,wFAAwF;gBACxF,MAAM,oCAAoC,GAAG,GAAwB,EAAE;oBACrE,MAAM,MAAM,CAAC,OAAO,EAAE,CAAC;oBACvB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;gBAC3B,CAAC,CAAA,CAAC;gBACF,OAAO,GAAkB,EAAE;oBACzB,OAAO,oCAAoC,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE;wBACtD,IAAI,CAAC,WAAW,EAAE,CAAC;oBACrB,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC;YACJ,CAAC;YACD;;;;;;;;eAQG;YACH,KAAK,eAAe,CAAC,CAAC,CAAC;gBACrB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC;YAClD,CAAC;YACD;gBACE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAoB,EAAE,eAAoC,EAAQ,EAAE;IACxG,sGAAsG;IACtG,oHAAoH;IACpH,qDAAqD;IACrD,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;IAE1C,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAChC,eAAe,CAAC,qBAAqB,EAAE,CAAC;AAC1C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n Call,\n CallAgent,\n CallEndReason,\n CollectionUpdatedEvent,\n IncomingCall,\n TeamsIncomingCall,\n IncomingCallCommon\n} from '@azure/communication-calling';\n\nimport { CallAgentCommon, CallCommon } from './BetaToStableTypes';\n\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCallAgent } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\nimport { DeclarativeCall } from './CallDeclarative';\nimport { CallSubscriber } from './CallSubscriber';\nimport { convertSdkCallToDeclarativeCall, convertSdkIncomingCallToDeclarativeIncomingCall } from './Converter';\nimport { IncomingCallSubscriber } from './IncomingCallSubscriber';\nimport { InternalCallContext } from './InternalCallContext';\nimport { disposeAllViews, disposeAllViewsFromCall } from './StreamUtils';\nimport { _isTeamsIncomingCall } from './TypeGuards';\nimport { incomingCallDeclaratify } from './IncomingCallDeclarative';\nimport { teamsIncomingCallDeclaratify } from './TeamsIncomingCallDeclarative';\n\n/**\n *\n * @private\n */\nexport type DeclarativeCallCommon = CallCommon & {\n /**\n * Stop any declarative specific subscriptions and remove declarative subscribers.\n */\n unsubscribe(): void;\n};\n\n/**\n * ProxyCallAgent proxies CallAgent and saves any returned state in the given context. It will subscribe to all state\n * updates in the CallAgent and in the contained Calls and RemoteParticipants. When dispose is called it will\n * unsubscribe from all state updates.\n */\nexport abstract class ProxyCallAgentCommon {\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n private _callSubscribers: Map<CallCommon, CallSubscriber>;\n private _incomingCallSubscribers: Map<string, IncomingCallSubscriber>;\n private _incomingCalls: Map<string, IncomingCallCommon>;\n private _declarativeCalls: Map<CallCommon, DeclarativeCallCommon>;\n private _externalCallsUpdatedListeners: Set<CollectionUpdatedEvent<CallCommon>>;\n\n constructor(context: CallContext, internalContext: InternalCallContext) {\n this._context = context;\n this._internalContext = internalContext;\n this._callSubscribers = new Map<Call, CallSubscriber>();\n this._incomingCallSubscribers = new Map<string, IncomingCallSubscriber>();\n this._incomingCalls = new Map<string, IncomingCallCommon>();\n this._declarativeCalls = new Map<Call, DeclarativeCall>();\n this._externalCallsUpdatedListeners = new Set<CollectionUpdatedEvent<CallCommon>>();\n }\n\n // Unsubscribe is called when CallAgent is disposed. This should mean no more updating of existing call but we don't\n // remove any existing state.\n protected unregisterSubscriber = (): void => {\n for (const [_, callSubscriber] of this._callSubscribers.entries()) {\n callSubscriber.unsubscribe();\n }\n this._callSubscribers.clear();\n\n for (const [_, incomingCallSubscriber] of this._incomingCallSubscribers.entries()) {\n incomingCallSubscriber.unsubscribe();\n }\n this._incomingCallSubscribers.clear();\n this._incomingCalls.clear();\n\n for (const [_, declarativeCall] of this._declarativeCalls.entries()) {\n declarativeCall.unsubscribe();\n }\n this._declarativeCalls.clear();\n };\n\n protected abstract unsubscribe(): void;\n\n protected abstract callDeclaratify(call: CallCommon, context: CallContext): DeclarativeCallCommon;\n\n protected callsUpdated = (event: { added: CallCommon[]; removed: CallCommon[] }): void => {\n const addedStatefulCall: DeclarativeCallCommon[] = [];\n for (const call of event.added) {\n const statefulCall = this.addCall(call);\n addedStatefulCall.push(statefulCall);\n }\n const removedStatefulCall: DeclarativeCallCommon[] = [];\n for (const call of event.removed) {\n disposeAllViewsFromCall(this._context, this._internalContext, call.id);\n const callSubscriber = this._callSubscribers.get(call);\n if (callSubscriber) {\n callSubscriber.unsubscribe();\n this._callSubscribers.delete(call);\n }\n this._context.setCallEnded(call.id, call.callEndReason);\n const declarativeCall = this._declarativeCalls.get(call);\n if (declarativeCall) {\n declarativeCall.unsubscribe();\n removedStatefulCall.push(declarativeCall);\n this._declarativeCalls.delete(call);\n } else {\n removedStatefulCall.push(this.callDeclaratify(call, this._context));\n }\n }\n\n for (const externalCallsUpdatedListener of this._externalCallsUpdatedListeners) {\n externalCallsUpdatedListener({ added: addedStatefulCall, removed: removedStatefulCall });\n }\n };\n\n private setIncomingCallEnded = (incomingCallId: string, callEndReason: CallEndReason): void => {\n const incomingCallSubscriber = this._incomingCallSubscribers.get(incomingCallId);\n if (incomingCallSubscriber) {\n incomingCallSubscriber.unsubscribe();\n this._incomingCallSubscribers.delete(incomingCallId);\n }\n this._incomingCalls.delete(incomingCallId);\n this._context.setIncomingCallEnded(incomingCallId, callEndReason);\n };\n\n protected incomingCall = ({ incomingCall }: { incomingCall: IncomingCallCommon }): void => {\n // Make sure to not subscribe to the incoming call if we are already subscribed to it.\n if (!this._incomingCallSubscribers.has(incomingCall.id)) {\n this._incomingCallSubscribers.set(\n incomingCall.id,\n new IncomingCallSubscriber(incomingCall, this.setIncomingCallEnded)\n );\n }\n if (_isTeamsIncomingCall(incomingCall)) {\n this._incomingCalls.set(\n incomingCall.id,\n teamsIncomingCallDeclaratify(incomingCall as TeamsIncomingCall, this._context)\n );\n } else {\n this._incomingCalls.set(incomingCall.id, incomingCallDeclaratify(incomingCall as IncomingCall, this._context));\n }\n this._context.setIncomingCall(convertSdkIncomingCallToDeclarativeIncomingCall(incomingCall));\n };\n\n protected addCall = (call: CallCommon): DeclarativeCallCommon => {\n this._callSubscribers.get(call)?.unsubscribe();\n\n // For API extentions we need to have the call in the state when we are subscribing as we may want to update the\n // state during the subscription process in the subscriber so we add the call to state before subscribing.\n this._context.setCall(convertSdkCallToDeclarativeCall(call));\n this._callSubscribers.set(call, new CallSubscriber(call, this._context, this._internalContext));\n return this.getOrCreateDeclarativeCall(call);\n };\n\n private getOrCreateDeclarativeCall = (call: CallCommon): DeclarativeCallCommon => {\n const declarativeCall = this._declarativeCalls.get(call);\n if (declarativeCall) {\n return declarativeCall;\n }\n\n const newDeclarativeCall = this.callDeclaratify(call, this._context);\n this._declarativeCalls.set(call, newDeclarativeCall);\n return newDeclarativeCall;\n };\n\n // args could be either from teamsCall or Call, set it as unknown and cast it in child class later\n protected abstract startCall(agent: CallAgentCommon, args: unknown[]): CallCommon;\n protected abstract joinCall(agent: CallAgentCommon, args: unknown[]): CallCommon;\n protected abstract agentSubscribe(agent: CallAgentCommon, args: unknown[]): void;\n protected abstract agentUnsubscribe(agent: CallAgentCommon, args: unknown[]): void;\n\n // We can't directly override get function because it is proxied,\n // Add a getCommon function and call it in child class\n protected getCommon<\n AgentType extends CallAgent | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallAgent,\n P extends keyof CallAgent\n >(target: AgentType, prop: P | 'incomingCalls'): any {\n switch (prop) {\n case 'startCall': {\n return this._context.withErrorTeedToState((...args: Parameters<AgentType['startCall']>): CallCommon => {\n const call = this.startCall(target, args);\n this.addCall(call);\n return this.getOrCreateDeclarativeCall(call);\n }, 'CallAgent.startCall');\n }\n case 'join': {\n return this._context.withErrorTeedToState((...args: Parameters<AgentType['join']>): CallCommon => {\n const call = this.joinCall(target, args);\n this.addCall(call);\n return this.getOrCreateDeclarativeCall(call);\n }, 'CallAgent.join');\n }\n case 'calls': {\n return Array.from(this._declarativeCalls.values());\n }\n case 'on': {\n return (...args: Parameters<AgentType['on']>): void => {\n // typescript is not smart enough to handle multiple overloads and pull the correct type here so force casting args\n const event = args[0] as 'incomingCall' | 'callsUpdated' | 'connectionStateChanged';\n\n const isCallsUpdated = event === 'callsUpdated';\n if (isCallsUpdated) {\n const listener = args[1] as unknown as CollectionUpdatedEvent<CallCommon>;\n this._externalCallsUpdatedListeners.add(listener);\n } else {\n this.agentSubscribe(target, args);\n }\n };\n }\n case 'off': {\n return (...args: Parameters<AgentType['off']>): void => {\n // typescript is not smart enough to handle multiple overloads and pull the correct type here so force casting args\n const event = args[0] as 'incomingCall' | 'callsUpdated' | 'connectionStateChanged';\n\n const isCallsUpdated = event === 'callsUpdated';\n if (isCallsUpdated) {\n const listener = args[1] as unknown as CollectionUpdatedEvent<CallCommon>;\n this._externalCallsUpdatedListeners.delete(listener);\n } else {\n this.agentUnsubscribe(target, args);\n }\n };\n }\n case 'dispose': {\n /* @conditional-compile-remove(calling-beta-sdk) */\n return (): void => {\n target.dispose();\n this.unsubscribe();\n };\n // Wrapping CallAgent.dispose in a callback type (): Promise<void> to accomodate the change of CallAgent.dispose\n // in calling beta version 1.8.0-beta.1 from callback type (): Promise<void> to (): void\n const callAgentDisposeAsyncCallbackWrapper = async (): Promise<void> => {\n await target.dispose();\n return Promise.resolve();\n };\n return (): Promise<void> => {\n return callAgentDisposeAsyncCallbackWrapper().then(() => {\n this.unsubscribe();\n });\n };\n }\n /**\n * This attribute is a special case and doesn't exist on the CallAgent interface.\n * We need this to be able to return a declarative incoming call object using the call agent.\n * In a standard headless SDK usage, the right way to get an incoming call is to use the `incomingCall` event.\n * However, using the declarative layer, the ideal usage would be to:\n * 1. subscribe to the `onStateChange` event\n * 2. Get the incoming call from the new state and it's ID\n * 3. Use `callAgent.incomingCalls` and filter an incoming call ID to get a declarative incoming call object\n */\n case 'incomingCalls': {\n return Array.from(this._incomingCalls.values());\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * @private\n */\nexport const clearCallRelatedState = (context: CallContext, internalContext: InternalCallContext): void => {\n // Make sure there are no existing call data if creating a new CallAgentDeclarative (if creating a new\n // CallAgentDeclarative after disposing of the hold one will mean context have old call state). TODO: should we stop\n // rendering when the previous callAgent is disposed?\n disposeAllViews(context, internalContext);\n\n context.clearCallRelatedState();\n internalContext.clearCallRelatedState();\n};\n"]}
@@ -1,4 +1,4 @@
1
- import { AudioDeviceInfo, CallDirection, CallEndReason, CallerInfo, CallState as CallStatus, DeviceAccess, DominantSpeakersInfo, LatestMediaDiagnostics, LatestNetworkDiagnostics, MediaStreamType, ParticipantRole, RemoteParticipantState as RemoteParticipantStatus, ScalingMode, VideoDeviceInfo } from '@azure/communication-calling';
1
+ import { AudioDeviceInfo, CallDirection, CallEndReason, CallerInfo, CallState as CallStatus, DeviceAccess, DominantSpeakersInfo, IncomingCallKind, LatestMediaDiagnostics, LatestNetworkDiagnostics, MediaStreamType, ParticipantRole, RemoteParticipantState as RemoteParticipantStatus, ScalingMode, VideoDeviceInfo } from '@azure/communication-calling';
2
2
  import { TeamsCallInfo } from '@azure/communication-calling';
3
3
  import { CallInfo } from '@azure/communication-calling';
4
4
  import { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communication-calling';
@@ -614,6 +614,28 @@ export interface AcceptedTransfer {
614
614
  */
615
615
  timestamp: Date;
616
616
  }
617
+ /**
618
+ * State to track the types {@link CallInfo} and {@link TeamsCallInfo}
619
+ * @public
620
+ */
621
+ export interface CallInfoState {
622
+ /**
623
+ * GroupId of the call that you joined
624
+ */
625
+ groupId?: string;
626
+ /**
627
+ * The teams meeting thread id
628
+ */
629
+ threadId?: string;
630
+ /**
631
+ * participant id of the local user
632
+ */
633
+ participantId: string;
634
+ /**
635
+ * Differentiator between the Call and TeamsCall types
636
+ */
637
+ kind: IncomingCallKind;
638
+ }
617
639
  /**
618
640
  * State only version of {@link @azure/communication-calling#IncomingCall}. {@link StatefulCallClient} will
619
641
  * automatically detect incoming calls and add their state to the state exposed by {@link StatefulCallClient}.
@@ -625,6 +647,10 @@ export interface IncomingCallState {
625
647
  * Proxy of {@link @azure/communication-calling#IncomingCall.id}.
626
648
  */
627
649
  id: string;
650
+ /**
651
+ * Proxy of {@link @azure/communication-calling#IncomingCall.callInfo}.
652
+ */
653
+ info: CallInfoState;
628
654
  /**
629
655
  * Proxy of {@link @azure/communication-calling#IncomingCall.callerInfo}.
630
656
  */
@@ -645,6 +671,39 @@ export interface IncomingCallState {
645
671
  */
646
672
  endTime?: Date;
647
673
  }
674
+ /**
675
+ * State only version of {@link @azure/communication-calling#TeamsIncomingCall}
676
+ * @beta
677
+ */
678
+ export interface TeamsIncomingCallState {
679
+ /**
680
+ * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.id}.
681
+ */
682
+ id: string;
683
+ /**
684
+ * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.teamsCallInfo}.
685
+ */
686
+ info: CallInfoState;
687
+ /**
688
+ * Proxy of {@link @azure/communication-calling#TeamsIncomingCall.callerInfo}.
689
+ */
690
+ callerInfo: CallerInfo;
691
+ /**
692
+ * Set to the state returned by 'callEnded' event on {@link @azure/communication-calling#IncomingCall} when received.
693
+ * This property is added by the stateful layer and is not a proxy of SDK state.
694
+ */
695
+ callEndReason?: CallEndReason;
696
+ /**
697
+ * Stores the local date when the call started on the client. This property is added by the stateful layer and is not
698
+ * a proxy of SDK state.
699
+ */
700
+ startTime: Date;
701
+ /**
702
+ * Stores the local date when the call ended on the client. This property is added by the stateful layer and is not a
703
+ * proxy of SDK state. It is undefined if the call is not ended yet.
704
+ */
705
+ endTime?: Date;
706
+ }
648
707
  /**
649
708
  * This type is meant to encapsulate all the state inside {@link @azure/communication-calling#DeviceManager}. For
650
709
  * optional parameters they may not be available until permission is granted by the user. The cameras, microphones,
@@ -731,7 +790,7 @@ export interface CallClientState {
731
790
  * It is keyed by {@link @azure/communication-calling#IncomingCall.id}.
732
791
  */
733
792
  incomingCalls: {
734
- [key: string]: IncomingCallState;
793
+ [key: string]: IncomingCallState | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState;
735
794
  };
736
795
  /**
737
796
  * Incoming Calls that have ended are stored here so the callEndReason could be checked.
@@ -740,7 +799,7 @@ export interface CallClientState {
740
799
  * Only {@link MAX_CALL_HISTORY_LENGTH} Calls are kept in the history. Oldest calls are evicted if required.
741
800
  */
742
801
  incomingCallsEnded: {
743
- [key: string]: IncomingCallState;
802
+ [key: string]: IncomingCallState | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState;
744
803
  };
745
804
  /**
746
805
  * Proxy of {@link @azure/communication-calling#DeviceManager}. Please review {@link DeviceManagerState}.
@@ -1 +1 @@
1
- {"version":3,"file":"CallClientState.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallClientState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAs0BlC;;;;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 LatestMediaDiagnostics,\n LatestNetworkDiagnostics,\n MediaStreamType,\n ParticipantRole,\n RemoteParticipantState as RemoteParticipantStatus,\n ScalingMode,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(meeting-id) */\nimport { TeamsCallInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(calling-beta-sdk) */\nimport { CallInfo } from '@azure/communication-calling';\n\nimport { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communication-calling';\nimport { CaptionsResultType } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsKind } from '@azure/communication-calling';\nimport { VideoEffectName } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\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 /* @conditional-compile-remove(acs-close-captions) */\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/**\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/**\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 /* @conditional-compile-remove(video-stream-is-receiving-flag) */\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 * 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\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 /* @conditional-compile-remove(teams-identity-support) */\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 /**\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 /* @conditional-compile-remove(hide-attendee-name) */\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 /* @conditional-compile-remove(meeting-id) */\n /**\n * Proxy of {@link @azure/communication-calling#Call.info}.\n */\n info?: TeamsCallInfo | /* @conditional-compile-remove(calling-beta-sdk) */ CallInfo;\n\n /* @conditional-compile-remove(teams-meeting-conference) */\n /**\n * Proxy of {@link @azure/communication-calling#TeamsMeetingAudioConferencingCallFeature}.\n */\n meetingConference?: { conferencePhones: ConferencePhoneInfo[] };\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 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.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: { [key: string]: IncomingCallState };\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: { [key: string]: IncomingCallState };\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 /* @conditional-compile-remove(PSTN-calls) */\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 /* @conditional-compile-remove(unsupported-browser) */\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 | /* @conditional-compile-remove(calling-beta-sdk) */ '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 | /* @conditional-compile-remove(calling-beta-sdk) */ /* @conditional-compile-remove(teams-identity-support) */ '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 | /* @conditional-compile-remove(soft-mute) */ 'Call.mutedByOthers'\n | 'Call.muteAllRemoteParticipants'\n | 'Call.setConstraints';\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/**\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;AAq4BlC;;;;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';\nimport { TeamsCallInfo } from '@azure/communication-calling';\nimport { CallInfo } from '@azure/communication-calling';\n\nimport { CapabilitiesChangeInfo, ParticipantCapabilities } from '@azure/communication-calling';\nimport { CaptionsResultType } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsKind } from '@azure/communication-calling';\nimport { VideoEffectName } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\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 /* @conditional-compile-remove(acs-close-captions) */\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/**\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/**\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 /* @conditional-compile-remove(video-stream-is-receiving-flag) */\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 * 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\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 /* @conditional-compile-remove(teams-identity-support) */\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 /**\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 /* @conditional-compile-remove(hide-attendee-name) */\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 /* @conditional-compile-remove(teams-meeting-conference) */\n /**\n * Proxy of {@link @azure/communication-calling#TeamsMeetingAudioConferencingCallFeature}.\n */\n meetingConference?: { conferencePhones: ConferencePhoneInfo[] };\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 * @beta\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 | /* @conditional-compile-remove(one-to-n-calling) */ 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 | /* @conditional-compile-remove(one-to-n-calling) */ 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 /* @conditional-compile-remove(PSTN-calls) */\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 /* @conditional-compile-remove(unsupported-browser) */\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 | /* @conditional-compile-remove(calling-beta-sdk) */ '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 | /* @conditional-compile-remove(calling-beta-sdk) */ /* @conditional-compile-remove(teams-identity-support) */ '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 | /* @conditional-compile-remove(soft-mute) */ 'Call.mutedByOthers'\n | 'Call.muteAllRemoteParticipants'\n | 'Call.setConstraints';\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/**\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"]}
@@ -8,6 +8,7 @@ import { CaptionsKind, CaptionsInfo as AcsCaptionsInfo } from '@azure/communicat
8
8
  import { EnvironmentInfo } from '@azure/communication-calling';
9
9
  import { CallEndReason, CallState as CallStatus, RemoteParticipantState as RemoteParticipantStatus } from '@azure/communication-calling';
10
10
  import { CallState, CallClientState, LocalVideoStreamState, RemoteParticipantState, RemoteVideoStreamState, IncomingCallState, VideoStreamRendererViewState, CallAgentState, CallErrorTarget } from './CallClientState';
11
+ import { TeamsIncomingCallState } from './CallClientState';
11
12
  import { AcceptedTransfer } from './CallClientState';
12
13
  import { LocalVideoStreamVideoEffectsState } from './CallClientState';
13
14
  import { ReactionMessage } from '@azure/communication-calling';
@@ -88,7 +89,7 @@ export declare class CallContext {
88
89
  setRemoteVideoStreams(callId: string, participantKey: string, addRemoteVideoStream: RemoteVideoStreamState[], removeRemoteVideoStream: number[]): void;
89
90
  setRemoteVideoStreamRendererView(callId: string, participantKey: string, streamId: number, view: VideoStreamRendererViewState | undefined): void;
90
91
  setRemoteVideoStreamViewScalingMode(callId: string, participantKey: string, streamId: number, scalingMode: ScalingMode): void;
91
- setIncomingCall(call: IncomingCallState): void;
92
+ setIncomingCall(call: IncomingCallState | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState): void;
92
93
  removeIncomingCall(callId: string): void;
93
94
  setIncomingCallEnded(callId: string, callEndReason: CallEndReason | undefined): void;
94
95
  setDeviceManagerIsSpeakerSelectionAvailable(isSpeakerSelectionAvailable: boolean): void;
@@ -141,7 +141,6 @@ export class CallContext {
141
141
  // We don't update the startTime and endTime if we are updating an existing active call
142
142
  existingCall.captionsFeature.currentSpokenLanguage = call.captionsFeature.currentSpokenLanguage;
143
143
  existingCall.captionsFeature.currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;
144
- /* @conditional-compile-remove(meeting-id) */
145
144
  existingCall.info = call.info;
146
145
  /* @conditional-compile-remove(teams-meeting-conference) */
147
146
  existingCall.meetingConference = call.meetingConference;
@@ -150,6 +149,12 @@ export class CallContext {
150
149
  draft.calls[latestCallId] = call;
151
150
  }
152
151
  });
152
+ /**
153
+ * Remove the incoming call that matches the call if there is one
154
+ */
155
+ if (this._state.incomingCalls[call.id]) {
156
+ this.removeIncomingCall(call.id);
157
+ }
153
158
  }
154
159
  removeCall(callId) {
155
160
  this.modifyState((draft) => {