你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

@azure/communication-react package

CallError

从失败的有状态 API 方法引发的错误。

ChatError

从 StatefulChatClient 方法失败 引发的错误。

接口

ActiveErrorMessage

要通过 ErrorBar显示的活动错误消息。

AdapterError

通过错误事件报告并存储在适配器状态中的错误。

AdapterState

与复合适配器状态交互的功能。

BaseCompositeProps

从此库导出的所有复合的通用属性。

BaseCustomStyles

从此库导出的所有组件的基本 Fluent 样式属性。

CallAdapter

特定于 Azure 通信标识的适配器接口,用于扩展 CommonCallAdapter

CallAdapterCallManagement

用于管理当前呼叫或启动新呼叫的功能

CallAdapterCallOperations

用于管理当前调用的功能。

CallAdapterDeviceManagement

用于在通话中管理设备的功能。

CallAdapterSubscribers

调用可订阅的复合事件。

CallAgentProviderProps

用于初始化 CallAgentProvider的参数。

CallAgentState

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23CallAgent>,但调用将直接移动到 CallClientState 的子级,此处不包含。 调用代理的状态代理的原因是提供对 displayName 的访问权限。 我们不会平展 CallAgent.displayName 并将其置于 CallClientState 中,因为 displayName 实际上依赖于 CallAgent 的创建/存在才可用是不明确的。

CallAndChatLocator

createAzureCommunicationCallWithChatAdapter 中用于联接与关联聊天线程的通话的参数。

CallClientProviderProps

用于初始化 CallClientProvider的参数。

CallClientState

StatefulCallClient代理的所有状态数据的容器。 如果已创建 callAgent,则会自动提供调用、callsEnded、incomingCalls 和 incomingCallsEnded 状态。 deviceManager 最初将为空,直到填充到 DeviceManagerState。 userId 状态作为开发人员的便利提供,由开发人员完全控制并设置。

CallCompositeProps

CallComposite的道具。

CallCompositeStrings

CallComposite 直接使用的字符串

除了组件库中的组件使用的字符串外, 这些字符串。

CallProviderProps

用于初始化 CallProvider的参数。

CallState

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23Call>。 StatefulCallClient 将自动检索呼叫的状态,并将其添加到由 StatefulCallClient公开的状态。

CallWithChatAdapter

CallWithChatComposite 适配器接口。

CallWithChatAdapterManagement

使用聊天管理当前呼叫的功能。

CallWithChatAdapterState

CallWithChat State 是有状态聊天和有状态呼叫客户端的组合,其状态仅特定于 CallWithChat 复合。

CallWithChatAdapterSubscriptions

可在 CallWithChatAdapter中订阅的呼叫和聊天事件。

CallWithChatAdapterUiState

CallWithChatComposite相关的 UI 状态。

CallWithChatClientState

来自驱动 CallWithChatComposite的后端服务的状态。

CallWithChatCompositeProps

CallWithChatComposite 所需的属性

CallWithChatCompositeStrings

CallWithChatComposite 使用的字符串。

除了组件库中的组件使用的字符串外, 这些字符串。

CallWithChatControlOptions

CallWithChatComposite 呼叫控件以显示或隐藏呼叫控件栏上的按钮。

CallingHandlers

包含调用组件所需的所有处理程序的对象。

从此包调用相关组件可以从此对象中选取相关处理程序。 请参阅 <xref:useHandlers> 和 usePropsFor

CallingTheme

通过在此库中调用相关组件使用的自定义 Fluent 主题托盘。

CameraButtonContextualMenuStyles

CameraButton 菜单的样式。

CameraButtonProps

CameraButton 组件的属性。

CameraButtonStrings

可以重写的 CameraButton 的字符串。

CameraButtonStyles

CameraButton 样式

ChatAdapterSubscribers

可以订阅的聊天复合事件。

ChatAdapterThreadManagement

用于管理当前聊天线程的功能。

ChatCompositeProps

ChatComposite的道具。

ChatCompositeStrings

ChatComposite 直接使用的字符串。

除了组件库中的组件使用的字符串外, 这些字符串。

ChatMessage

聊天消息。

CommonCallAdapter

CallComposite 适配器接口。

CommonCallingHandlers

包含调用组件所需的所有处理程序的对象。

从此包调用相关组件可以从此对象中选取相关处理程序。 请参阅 <xref:useHandlers> 和 usePropsFor

ComponentLocale

从此库导出的所有组件的区域设置信息。

ComponentStrings

从此库导出的所有组件使用的字符串。

CompositeLocale

从此库导出的所有复合的区域设置信息。

CompositeStrings

直接在复合中使用的字符串。

这些字符串由复合直接使用,而不是由包含的组件使用。

ContentSystemMessage

包含仲裁内容的系统消息。

ControlBarButtonProps

ControlBarButton的道具。

ControlBarButtonStrings

可以重写的 ControlBarButton 字符串。

ControlBarProps

ControlBar的道具。

CreateVideoStreamViewResult

创建本地或远程 VideoStream 后返回的对象。 这包含用于作流的呈现的帮助程序函数。

CustomMessage

自定义消息类型。

默认情况下不会呈现自定义消息,但应用程序可以为它们提供自定义呈现器。

DevicesButtonContextualMenuStyles

DevicesButton 菜单的样式。

DevicesButtonProps

DevicesButton的道具。

DevicesButtonStrings

可以重写的 DevicesButton 字符串。

DevicesButtonStyles

“设备”按钮菜单项的样式。

DiagnosticsCallFeatureState

仅 <xref:%40azure%2Fcommunication-calling%23DiagnosticsCallFeature>的状态代理。

Disposable

用于正确释放复合的功能。

EndCallButtonProps

EndCallButton的道具。

EndCallButtonStrings

可以重写的 EndCallButton 的字符串。

ErrorBarProps

ErrorBar的属性。

除了以下项,ErrorBar 将所有 <xref:%40fluentui%2Freact%23IMessageBarProps> 转发到基础 <xref:%40fluentui%2Freact%23MessageBar>。

ErrorBarStrings

ErrorBar中 UI 上可能显示的所有字符串。

FluentThemeProviderProps

FluentThemeProvider的道具。

GridLayoutProps

GridLayout的道具。

GridLayoutStyles

GridLayout 组件样式。

HorizontalGalleryStyles

<xref:HorizontalGallery> 组件样式。

IncomingCallState

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23IncomingCall>。 StatefulCallClient 将自动检测传入呼叫,并将其状态添加到由 StatefulCallClient公开的状态。

JumpToNewMessageButtonProps

<xref:MessageThreadProps.onRenderJumpToNewMessageButton>的参数。

LocalVideoCameraCycleButtonProps
LocalVideoStreamState

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23LocalVideoStream>。

MediaDiagnosticsState

仅 <xref:%40azure%2Fcommunication-calling%23MediaDiagnostics>的状态代理。

MessageCommon

所有消息类型的常见属性。

MessageStatusIndicatorProps

MessageStatusIndicator的道具。

MessageStatusIndicatorStrings

可以重写的 MessageStatusIndicator 字符串。

MessageThreadStrings

可以重写的 MessageThread 字符串。

MessageThreadStyles

MessageThread的 Fluent 样式。

MicrophoneButtonContextualMenuStyles

MicrophoneButton 菜单的样式。

MicrophoneButtonProps

MicrophoneButton的道具。

MicrophoneButtonStrings

可以重写的 MicrophoneButton 字符串。

MicrophoneButtonStyles

MicrophoneButton 样式

NetworkDiagnosticsState

仅 <xref:%40azure%2Fcommunication-calling%23NetworkDiagnostics>的状态代理。

OptionsDevice

DevicesButton 浮出控件中的设备,例如相机、麦克风或扬声器。

ParticipantAddedSystemMessage

一条系统消息,通知参与者已添加到聊天线程。

ParticipantItemProps

ParticipantItem的道具。

ParticipantItemStrings

可以重写的 ParticipantItem 字符串。

ParticipantItemStyles

ParticipantItem的 Fluent 样式。

ParticipantListItemStyles

ParticipantListParticipantItem的样式。

ParticipantListStyles

ParticipantList的样式。

ParticipantRemovedSystemMessage

系统消息,通知参与者已从聊天线程中删除。

ParticipantsButtonContextualMenuStyles

ParticipantsButton 菜单的样式。

ParticipantsButtonProps

参与者按钮的道具。

ParticipantsButtonStrings

可以重写的 ParticipantsButton 字符串。

ParticipantsButtonStyles

ParticipantsButton的样式属性。

RecordingCallFeature

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23RecordingCallFeature>。 StatefulCallClient 将自动侦听呼叫的录制状态,并相应地更新 StatefulCallClient 公开的状态。

RemoteParticipantState

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23RemoteParticipant>。 StatefulCallClient 将自动检索 RemoteParticipants 并将其状态添加到由 StatefulCallClient公开的状态。

RemoteVideoStreamState

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23RemoteVideoStream>。

ScreenShareButtonProps

ScreenShareButton的道具。

ScreenShareButtonStrings

可以重写的 ScreenShareButton 字符串。

SendBoxProps

SendBox的道具。

SendBoxStrings

可以重写的 SendBox 字符串。

SendBoxStylesProps

<xref:Sendbox>的 Fluent 样式。

StatefulCallClient

定义允许有状态使用 CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> 的方法。 该接口提供对代理状态的访问,并允许注册状态更改事件的处理程序。 有关状态定义,请参阅 CallClientState

状态更改事件由:

  • 从 <xref:%40azure%2Fcommunication-calling%23DeviceManager> API 返回的数据。
  • 从 <xref:%40azure%2Fcommunication-calling%23CallAgent> API 返回的数据。
  • 自动附加到各种 Azure 通信调用对象的侦听器:
    • CallAgent “incomingCall”
    • CallAgent “callsUpdated”
    • DeviceManager “videoDevicesUpdated”
    • DeviceManager 'audioDevicesUpdated
    • DeviceManager “selectedMicrophoneChanged”
    • DeviceManager “selectedSpeakerChanged”
    • 调用“stateChanged”
    • 调用“idChanged”
    • 调用“isMutedChanged”
    • 调用“isScreenSharingOnChanged”
    • 调用“remoteParticipantsUpdated”
    • 调用“localVideoStreamsUpdated”
    • IncomingCall “callEnded”
    • RemoteParticipant 'stateChanged'
    • RemoteParticipant 'isMutedChanged'
    • RemoteParticipant 'displayNameChanged'
    • RemoteParticipant 'isSpeakingChanged'
    • RemoteParticipant 'videoStreamsUpdated'
    • RemoteVideoStream “isAvailableChanged”
    • TranscriptionCallFeature 'isTranscriptionActiveChanged'
    • RecordingCallFeature “isRecordingActiveChanged”
StatefulChatClient

定义允许 {@Link @azure/communication-chat#ChatClient} 与集中式生成状态一起使用的方法。

该接口提供对代理状态的访问,并允许注册状态更改事件的处理程序。

StatefulDeviceManager

定义由有状态在 <xref:%40azure%2Fcommunication-calling%23DeviceManager>之上添加的其他方法。

StreamMediaProps

StreamMedia的道具。

SystemMessageCommon

所有系统消息的常见属性。

TopicUpdatedSystemMessage

一条系统消息,通知聊天线程主题已更新。

TranscriptionCallFeature

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23TranscriptionCallFeature>。 StatefulCallClient 将自动侦听呼叫的听录状态,并相应地更新由 StatefulCallClient 公开的状态。

TypingIndicatorProps

TypeIndicator的道具。

TypingIndicatorStrings

可以重写的 TypeIndicator 字符串。

TypingIndicatorStylesProps

TypingIndicator的 Fluent 样式。

VideoGalleryProps

VideoGallery的道具。

VideoGalleryRemoteParticipant

VideoGallery中远程参与者的状态。

VideoGalleryStream

VideoGallery中参与者的视频流。

VideoGalleryStrings

VideoGallery中 UI 上可能显示的所有字符串。

VideoGalleryStyles

VideoGallery 组件样式。

VideoStreamOptions

用于控制视频流的呈现方式的选项。

VideoStreamRendererViewState

仅状态版本的 <xref:%40azure%2Fcommunication-calling%23VideoStreamRendererView>。 此属性通过 createView 添加到 StatefulCallClient 公开的状态,并通过 disposeView删除。

VideoTileProps

VideoTile的道具。

VideoTileStylesProps

VideoTile的 Fluent 样式。

类型别名

AdapterErrors

适配器存储状态中每个作的最新错误。

target 是适配器为每个唯一作定义的适配器字符串。

AreEqual

比较 2 个 react 组件是否完全相等,结果类型为 true/false

AreParamEqual

比较 2 个 react 组件的属性是否相等,结果类型为 true/false

AreTypeEqual

比较两种类型是否相等,结果类型为 true/false

AvatarPersonaData

用于显示用户的头像的自定义数据属性。

AvatarPersonaDataCallback

用于提供自定义数据的回调函数,用于为用户生成头像。

AzureCommunicationCallAdapterArgs

创建 CallAdapter的 Azure 通信服务实现的参数。

注意:displayName 最多可以包含 256 个字符。

AzureCommunicationCallWithChatAdapterArgs

createAzureCommunicationCallWithChatAdapter 的参数

AzureCommunicationCallWithChatAdapterFromClientArgs

<xref:createAzureCommunicationCallWithChatAdapterFromClient> 的参数

AzureCommunicationChatAdapterArgs

创建 ChatAdapter的 Azure 通信服务实现的参数。

CallAdapterCallEndedEvent

CallEndedListener 的有效负载 包含结束调用的详细信息。

CallAdapterClientState

CommonCallAdapter 从 Azure 通信服务后端推断的状态。

CallAdapterLocator

createAzureCommunicationCallAdapter 用于查找要加入的调用的定位符

CallAdapterState

CommonCallAdapter 状态。

CallAdapterUiState

出于纯 UI 目的,CommonCallAdapter 状态。

CallCompositeIcons

可替代 CallComposite的图标。

CallCompositeOptions

CallComposite的可选功能。

CallCompositePage

CallComposite中显示的主要 UI 屏幕。

CallControlDisplayType

CallComposite的控制栏显示类型。

CallControlOptions

调用体验中控件栏的自定义选项。

CallEndedListener

CallAdapterSubscribers“callEnded”事件的回调。

CallErrorBarSelector

ErrorBar 组件的选择器类型。

CallErrorTarget

{@Link CallErrors} 中所有允许的键的字符串文本类型。

CallErrors

从 API 调用到调用 SDK 时出现的错误。

对象中的每个属性存储特定 SDK API 方法的最新错误。

可以使用 <xref:newClearCallErrorsModifier>清除此对象中的错误。 此外,在以下情况下会自动清除错误:

  • 状态已清除。
  • 对相关 API 方法的后续调用成功。 有关可能自动清除错误时间的详细信息,请参阅各个有状态客户端方法的文档。
CallIdChangedListener

CallAdapterSubscribers“callIdChanged”事件的回调。

CallParticipantListParticipant

调用参与者的状态,如 UI 组件所示。

CallWithChatCompositeIcons

可为 CallWithChatComposite重写的图标。

CallWithChatCompositeOptions

CallWithChatComposite的可选功能。

CallWithChatEvent

CallWithChatAdapter触发的事件。

CallingBaseSelectorProps

用于引用调用声明性客户端状态的常见属性。

CallingReturnProps

的帮助程序类型 usePropsFor

CameraButtonSelector

CameraButton 组件的选择器类型。

ChatAdapter

ChatComposite 适配器接口。

ChatAdapterState

ChatAdapter 状态。

ChatAdapterUiState

出于纯 UI 目的,ChatAdapter 状态。

ChatBaseSelectorProps

ChatClientState选择器的常见属性。

ChatClientProviderProps

用于初始化 ChatClientProvider的参数。

ChatClientState

<xref:%40azure%2Fcommunication-chat%23ChatClient>的集中状态。

ChatCompositeClientState

ChatAdapter 从 Azure 通信服务后端推断的状态。

ChatCompositeIcons

可为 ChatComposite重写的图标。

ChatCompositeOptions

ChatComposite的可选功能。

ChatErrorBarSelector

ErrorBar 组件的选择器类型。

ChatErrorTarget

ChatErrors中所有允许的键的字符串文本类型。

ChatErrors

从 API 调用聊天 SDK 发来的错误。

对象中的每个属性存储特定 SDK API 方法的最新错误。

ChatHandlers

包含聊天组件所需的所有处理程序的对象。

此包中的聊天相关组件能够从此对象中选取相关处理程序。 请参阅 <xref:useHandlers> 和 usePropsFor

ChatMessageWithStatus

用于存储聊天消息的客户端仅元数据的 <xref:%40azure%2Fcommunication-chat%23ChatMessage> 的扩展。

TODO:名称已比特。 重命名我。

ChatParticipantListSelector

ParticipantList 组件的选择器类型。

ChatReturnProps

的帮助程序类型 usePropsFor

ChatThreadClientProviderProps

用于初始化 ChatThreadClientProvider的参数。

ChatThreadClientState

<xref:%40azure%2Fcommunication-chat%23ChatThreadClient>的集中状态。

ChatThreadProperties

聊天线程的属性。

我们定义了一个最小的定义,可帮助我们隐藏基础 API 使用的不同类型的类型。

ClientState

<xref:%40azure%2Fcommunication-calling%23CallClient> 或 <xref:%40azure%2Fcommunication-chat%23ChatClient>的集中状态。

另请参阅:CallClientStateChatClientState

Common

返回 2 种类型的相交类型

CommonProperties

返回 2 种类型的相交属性

CommunicationParticipant

聊天或通话参与者的状态,如 UI 中所示。

ComponentIcons

从此库导出的 React 组件使用的图标。

ComponentProps

的帮助程序类型 usePropsFor

CompositeIcons

可在此库导出的其中一个复合体中重写的图标。

有关更多目标类型,请参阅 ChatCompositeIconsCallCompositeIconsCallWithChatCompositeIcons

ControlBarButtonStyles

所有 ControlBarButton 实现的样式。

ControlBarLayout

显示 ControlBar的布局。

CreateViewResult

createView返回结果。

CustomAvatarOptions

可以注入到 onRender 函数中以自定义虚拟形象(Persona)组件的选项。

DeviceManagerState

此类型旨在封装 <xref:%40azure%2Fcommunication-calling%23DeviceManager>中的所有状态。 对于可选参数,在用户授予权限之前,这些参数可能不可用。 相机、麦克风、扬声器和设备Access 状态将为空,直到调用并完成相应的 <xref:%40azure%2Fcommunication-calling%23DeviceManager>getCameras、getMicrophones、getSpeakers 和 askDevicePermission API。

DevicesButtonSelector

DevicesButton 组件的选择器类型。

DiagnosticChangedEventListner

CallAdapterSubscribers“diagnosticChanged”事件的回调。

DisplayNameChangedListener

CallAdapterSubscribers “displayNameChanged” 事件的回调。

EmptySelector

不返回任何数据的简单选择器的类型。

如果 对不需要任何数据的组件调用 usePropsFor,则用作默认返回值。

ErrorType

ErrorBar中显示的所有错误。

GetCallingSelector

适用于给定组件的选择器的特定类型。

GetChatSelector

适用于给定组件的选择器的特定类型。

IsLocalScreenSharingActiveChangedListener

CallAdapterSubscribers 的回调“isLocalScreenSharingActiveChanged”事件。

IsMutedChangedListener

CallAdapterSubscribers“isMuted”事件的回调。

IsSpeakingChangedListener

CallAdapterSubscribers “isSpeakingChanged” 事件的回调。

LoadingState

流是否正在加载。

LocalizationProviderProps

LocalizationProvider的道具。

MediaDiagnosticChangedEvent

DiagnosticChangedEventListner 的有效负载 媒体诊断中存在更改。

Message

所有消息的歧视联合。

messageType 领域专门研究联合变体。

MessageAttachedStatus

指示是否应在聊天消息之前/之后显示与消息合并。

用于将来自同一发件人的许多邮件合并到单个邮件气泡中。

MessageContentType

支持的聊天消息内容类型。

MessageProps

用于呈现单个消息的道具。

请参阅 MessageRenderer

MessageReadListener

ChatAdapterSubscribers“messageRead”事件的回调。

MessageReceivedListener

ChatAdapterSubscribers“messageReceived”事件的回调。

MessageRenderer

用于呈现单个消息的组件。

MessageSentListener

ChatAdapterSubscribers“messageSent”事件的回调。

MessageStatus

已发送消息的客户端状态。

包括从后端确认消息传送之前发生的过渡状态。

MessageThreadProps

MessageThread的道具。

MessageThreadSelector

MessageThread 组件的选择器类型。

MicrophoneButtonSelector

MicrophoneButton 组件的选择器类型。

NetworkDiagnosticChangedEvent

DiagnosticChangedEventListner 的有效负载 网络诊断中存在更改。

OnRenderAvatarCallback

一个自定义呈现的回调,允许用户自定义角色组件的呈现。

ParticipantListParticipant

参与者显示在 ParticipantList中。

ParticipantListProps

ParticipantList的道具。

ParticipantListSelector

ParticipantList 组件的选择器类型。

ParticipantMenuItemsCallback

一个回调,用于为 ParticipantList中的每个参与者提供自定义菜单项。

ParticipantState

呼叫参与者的连接状态。

ParticipantsAddedListener

ChatAdapterSubscribers“participantsAdded”事件的回调。

ParticipantsButtonSelector

ParticipantsButton 组件的选择器类型。

ParticipantsJoinedListener

CallAdapterSubscribers“participantsJoined”事件的回调。

ParticipantsLeftListener

CallAdapterSubscribers“participantsLeft”事件的回调。

ParticipantsRemovedListener

ChatAdapterSubscribers“participantsRemoved”事件的回调。

ReadReceiptsBySenderId

一个键值对数组,用于存储每个发送方的显示名称和上次阅读消息

ScreenShareButtonSelector

ScreenShareButton 组件的选择器类型。

Selector

优化选择器,用于优化 ClientState 更新到此库中 React 组件的属性中。

SendBoxSelector

SendBox 组件的选择器类型。

StatefulCallClientArgs

用于构造 StatefulCallClient 的参数。

StatefulCallClientOptions

用于构造 StatefulCallClient 的选项。

StatefulChatClientArgs

用于构造 StatefulChatClient的参数。

StatefulChatClientOptions

用于构造 StatefulChatClient的选项。

SystemMessage

区分所有系统消息的联合。

systemMessageType 领域专门研究联合变体。

TopicChangedListener

ChatAdapterSubscribers“topicChanged”事件的回调。

TypingIndicatorSelector

TypeIndicator 组件的选择器类型。

UpdateMessageCallback

更新消息时运行回调函数。

VideoGalleryLayout
VideoGalleryLocalParticipant

VideoGallery中本地参与者的状态。

VideoGalleryParticipant

VideoGallery 中参与者的状态

VideoGallerySelector

VideoGallery 组件的选择器类型。

ViewScalingMode

VideoGalleryStream的缩放模式。

函数

CallAgentProvider(CallAgentProviderProps)

存储 <xref:%40azure%2Fcommunication-calling%23CallAgent>的 <xref:React.Context>。

必须用 CallAgentProvider包装来自此包的调用组件。

CallClientProvider(CallClientProviderProps)

存储 StatefulCallClient的 <xref:React.Context>。

必须用 CallClientProvider包装来自此包的调用组件。

CallComposite(CallCompositeProps)

用于调用体验的可自定义 UI 复合。

CallProvider(CallProviderProps)

存储 <xref:%40azure%2Fcommunication-calling%23Call>的 <xref:React.Context>。

必须用 CallProvider包装来自此包的调用组件。

CallWithChatComposite(CallWithChatCompositeProps)

CallWithChatComposite 汇集了关键组件,提供现成的聊天体验的完整呼叫。

CameraButton(CameraButtonProps)

用于打开/关闭相机的按钮。

可与 ControlBar一起使用。

ChatClientProvider(ChatClientProviderProps)

存储 StatefulChatClient的 <xref:React.Context>。

此包中的聊天组件必须用 ChatClientProvider包装。

ChatComposite(ChatCompositeProps)

聊天体验的可自定义 UI 复合。

ChatThreadClientProvider(ChatThreadClientProviderProps)

存储 <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>的 <xref:React.Context>。

此包中的聊天组件必须用 ChatThreadClientProvider包装。

ControlBar(ControlBarProps)

用于调用控件的各种按钮的容器。

将此库中的各种调用控件按钮(例如,CameraButton)或你自己的 ControlBarButton 实例直接用于

ControlBarButton(ControlBarButtonProps)

ControlBar的默认按钮样式。

使用此组件可创建自定义按钮,这些按钮的样式与其他 UI 库提供的按钮相同。

DevicesButton(DevicesButtonProps)

用于打开控制设备选项的菜单的按钮。

可与 ControlBar一起使用。

EndCallButton(EndCallButtonProps)

用于结束正在进行的呼叫的按钮。

可与 ControlBar一起使用。

ErrorBar(ErrorBarProps)

用于在 UI 上显示错误消息的组件。 可以显示的所有字符串都接受为 字符串,以便本地化字符串。 activeErrorMessages选择了活动错误。

此组件在内部跟踪用户关闭。

  • 具有关联时间戳的错误:如果在关闭后发生错误,则再次在 UI 上显示该错误。
  • 没有时间戳的错误:在错误从属性中消失之前,错误将被消除。 如果错误递归,则显示在 UI 中。

使用 <xref:%40fluentui%2Freact%23MessageBar> UI 元素。

FluentThemeProvider(FluentThemeProviderProps)

提供程序,用于在此库的 react 组件中应用 Fluent 主题。

GridLayout(GridLayoutProps)

用于在通话中布置音频/视频参与者磁贴的组件。

LocalizationProvider(LocalizationProviderProps)

提供程序为此库的 react 组件提供本地化字符串。

MessageStatusIndicator(MessageStatusIndicatorProps)

显示已发送消息状态的组件。

添加对应于消息状态的图标和工具提示。

MessageThread(MessageThreadProps)

MessageThread 使你能够轻松创建一个组件来呈现聊天消息、处理新旧消息的滚动行为以及自定义 & 聊天线程中的控件的图标。

MicrophoneButton(MicrophoneButtonProps)

用于打开/关闭麦克风的按钮。

可与 ControlBar一起使用。

ParticipantItem(ParticipantItemProps)

用于呈现呼叫或聊天参与者的组件。

显示参与者的头像、displayName 和状态以及可选图标和上下文菜单。

ParticipantList(ParticipantListProps)

用于呈现所有呼叫或聊天参与者的组件。

默认情况下,每个参与者都呈现 ParticipantItem。 请参阅要重写 <xref:ParticipantListProps.onRenderParticipant>。

ParticipantsButton(ParticipantsButtonProps)

用于显示包含通话或聊天参与者的菜单的按钮。

可与 ControlBar一起使用。

此按钮包含通过其属性 menuProps定义的下拉菜单项。 默认情况下,它可以将包含完整列表的远程参与者数显示为子菜单,以及将所有参与者设为静音的选项,以及复制呼叫邀请 URL 的复制到剪贴板按钮。 可以完全重新定义此 menuProps,其属性的类型 IContextualMenuProps

ScreenShareButton(ScreenShareButtonProps)

用于启动/停止屏幕共享的按钮。

可与 ControlBar一起使用。

SendBox(SendBoxProps)

用于键入和发送消息的组件。

支持在用户开始输入文本时发送键入通知。 支持文本输入字段下方的可选消息。

StreamMedia(StreamMediaProps)

用于将包含视频流的 HTMLElement 转换为 JSX 元素的实用工具组件。

用于将无外设调用 API 返回的 HTMLElement 转换为可呈现为 VideoTile的组件。

TypingIndicator(TypingIndicatorProps)

在聊天线程中的一个或多个参与者键入时通知本地用户的组件。

VideoGallery(VideoGalleryProps)

VideoGallery 表示特定呼叫的视频磁贴布局。 它为本地用户以及已加入呼叫的每个远程参与者显示 VideoTile

VideoTile(VideoTileProps)

用于为单个呼叫参与者呈现视频流的组件。

VideoGallery中的 GridLayout 一起使用。

createAzureCommunicationCallAdapter(AzureCommunicationCallAdapterArgs)

创建 Azure 通信服务支持的 CallAdapter

这是此库提供 CallAdapter 的默认实现。

注意:displayName 最多可以包含 256 个字符。

createAzureCommunicationCallAdapterFromClient(StatefulCallClient, CallAgent, CallAdapterLocator)

使用提供的 StatefulCallClient创建 CallAdapter

如果要保留对 StatefulCallClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationCallAdapter

createAzureCommunicationCallWithChatAdapter(AzureCommunicationCallWithChatAdapterArgs)

创建 Azure 通信服务支持的 CallWithChatAdapter,以插入 CallWithChatComposite

createAzureCommunicationCallWithChatAdapterFromClients(AzureCommunicationCallWithChatAdapterFromClientArgs)

使用提供的 StatefulChatClientStatefulCallClient创建 CallWithChatAdapter

如果要保留对 StatefulChatClientStatefulCallClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationCallWithChatAdapter

createAzureCommunicationChatAdapter(AzureCommunicationChatAdapterArgs)

创建由 Azure 通信服务支持的 ChatAdapter

这是此库提供 ChatAdapter 的默认实现。

createAzureCommunicationChatAdapterFromClient(StatefulChatClient, ChatThreadClient)

使用提供的 StatefulChatClient创建 ChatAdapter

如果要保留对 StatefulChatClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationChatAdapter

createDefaultCallingHandlers(StatefulCallClient, undefined | CallAgent, undefined | StatefulDeviceManager, undefined | Call)

为团队呼叫创建 CallHandlers 的默认实现。

实现利用从此库导出的提供程序的自定义组件时非常有用。

createDefaultChatHandlers(StatefulChatClient, ChatThreadClient)

创建 ChatHandlers的默认实现。

实现利用从此库导出的提供程序的自定义组件时非常有用。

返回的对象被备忘录化,以避免在用作 React 组件属性时重新呈现。

createStatefulCallClient(StatefulCallClientArgs, StatefulCallClientOptions)

通过使用 ProxyCallClient <xref:%40azure%2Fcommunication-calling%23CallClient> 代理 CallClient <xref:ProxyCallClient> 来创建 StatefulCallClient StatefulCallClient,然后允许以声明性方式访问状态。

请务必使用从 StatefulCallClient 获取的 <xref:%40azure%2Fcommunication-calling%23DeviceManager> 和 <xref:%40azure%2Fcommunication-calling%23CallAgent> 和 <xref:%40azure%2Fcommunication-calling%23Call>(等),以便正确代理其状态更改。

createStatefulChatClient(StatefulChatClientArgs, StatefulChatClientOptions)

通过使用 ProxyChatClient <xref:%40azure%2Fcommunication-chat%23ChatClient> 代理 ChatClient <xref:%40azure%2Fcommunication-chat%23ChatClient> 创建有状态 ChatClient StatefulChatClient <xref:ProxyChatClient>,然后允许以声明性方式访问状态。

fromFlatCommunicationIdentifier(string)

到FlatCommunicationIdentifier的反向作。

getCallingSelector<Component>(Component)

获取指定组件的选择器。

实现利用从此库导出的提供程序的自定义组件时非常有用。

getChatSelector<Component>(Component)

获取指定组件的选择器。

实现利用从此库导出的提供程序的自定义组件时非常有用。

toFlatCommunicationIdentifier(CommunicationIdentifier)

<xref:%40azure%2Fcommunication-common%23CommunicationIdentifier>的字符串表示形式。

CommunicationIdentifier 的此字符串表示形式保证为唯一通信用户稳定。 因此

  • 它可用于在外部数据库中保留用户的标识。
  • 它可用作 Map 中的键,以存储用户的数据。
useAzureCommunicationCallAdapter(Partial<AzureCommunicationCallAdapterArgs>, (adapter: CallAdapter) => Promise<CallAdapter>, (adapter: CallAdapter) => Promise<void>)

一个自定义 React 挂钩,用于简化 CallAdapter的创建。

类似于 createAzureCommunicationCallAdapter,但需在内部异步创建适配器。

允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。

请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。

useAzureCommunicationCallWithChatAdapter(Partial<AzureCommunicationCallWithChatAdapterArgs>, (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>, (adapter: CallWithChatAdapter) => Promise<void>)

一个自定义 React 挂钩,用于简化 CallWithChatAdapter的创建。

类似于 createAzureCommunicationCallWithChatAdapter,但需在内部异步创建适配器。

允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。

请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。

useAzureCommunicationChatAdapter(Partial<AzureCommunicationChatAdapterArgs>, (adapter: ChatAdapter) => Promise<ChatAdapter>, (adapter: ChatAdapter) => Promise<void>)

一个自定义 React 挂钩,用于简化 ChatAdapter的创建。

类似于 createAzureCommunicationChatAdapter,但需在内部处理适配器的异步创建。

允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。

请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。

useCall()

挂钩从提供程序获取 <xref:%40azure%2Fcommunication-calling%23Call>。

实现利用从此库导出的提供程序的自定义组件时非常有用。

以前必须使用 CallProvider 和 Call 对象才能使用此挂钩

useCallAgent()

挂钩从提供程序获取 <xref:%40azure%2Fcommunication-calling%23CallAgent>。

实现利用从此库导出的提供程序的自定义组件时非常有用。

useCallClient()

挂钩从提供程序获取 StatefulCallClient

实现利用从此库导出的提供程序的自定义组件时非常有用。

useChatClient()

挂钩从提供程序获取 StatefulChatClient

实现利用从此库导出的提供程序的自定义组件时非常有用。

useChatThreadClient()

挂钩从提供程序获取 <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>。

实现利用从此库导出的提供程序的自定义组件时非常有用。

useDeviceManager()

挂钩从提供程序获取 StatefulDeviceManager

实现利用从此库导出的提供程序的自定义组件时非常有用。

usePropsFor<Component>(Component, "chat" | "calling")

从此库获取 React 组件所需的所有挂钩的主要挂钩。

若要调用此挂钩,组件需要包装在这些提供程序下:

  1. 对于聊天组件:ChatClientProviderChatThreadClientProvider

  2. 对于呼叫组件:CallClientProviderCallAgentProviderCallAgentProvider

组件的最直接用法如下所示:

示例

    import { ParticipantList, usePropsFor } from '@azure/communication-react';

    const App = (): JSX.Element => {
        // ... code to setup Providers ...

        return <ParticipantList {...usePropsFor(ParticipantList)}/>
    }
useSelector<ParamT>(ParamT, (ParamT extends Selector ? Parameters<ParamT>[1] : undefined), "chat" | "calling")

挂钩以获取指定组件的选择器。

实现利用从此库导出的提供程序的自定义组件时非常有用。

useTheme()

用于访问主题的 React 挂钩

函数详细信息

CallAgentProvider(CallAgentProviderProps)

存储 <xref:%40azure%2Fcommunication-calling%23CallAgent>的 <xref:React.Context>。

必须用 CallAgentProvider包装来自此包的调用组件。

function CallAgentProvider(props: CallAgentProviderProps): Element

参数

返回

Element

CallClientProvider(CallClientProviderProps)

存储 StatefulCallClient的 <xref:React.Context>。

必须用 CallClientProvider包装来自此包的调用组件。

function CallClientProvider(props: CallClientProviderProps): Element

参数

返回

Element

CallComposite(CallCompositeProps)

用于调用体验的可自定义 UI 复合。

function CallComposite(props: CallCompositeProps): Element

参数

返回

Element

注解

调用复合最小宽度/高度如下所示:

  • mobile: 17.5rem x 21rem (280px x 336px,默认 rem 为 16px)
  • 桌面:30rem x 22rem (480px x 352px,默认 rem 为 16px)

CallProvider(CallProviderProps)

存储 <xref:%40azure%2Fcommunication-calling%23Call>的 <xref:React.Context>。

必须用 CallProvider包装来自此包的调用组件。

function CallProvider(props: CallProviderProps): Element

参数

返回

Element

CallWithChatComposite(CallWithChatCompositeProps)

CallWithChatComposite 汇集了关键组件,提供现成的聊天体验的完整呼叫。

function CallWithChatComposite(props: CallWithChatCompositeProps): Element

参数

返回

Element

CameraButton(CameraButtonProps)

用于打开/关闭相机的按钮。

可与 ControlBar一起使用。

function CameraButton(props: CameraButtonProps): Element

参数

返回

Element

ChatClientProvider(ChatClientProviderProps)

存储 StatefulChatClient的 <xref:React.Context>。

此包中的聊天组件必须用 ChatClientProvider包装。

function ChatClientProvider(props: ChatClientProviderProps): Element

参数

返回

Element

ChatComposite(ChatCompositeProps)

聊天体验的可自定义 UI 复合。

function ChatComposite(props: ChatCompositeProps): Element

参数

返回

Element

注解

聊天复合最小宽度和高度分别为 17.5rem 和 20rem(280px 和 320px),默认 rem 为 16px)

ChatThreadClientProvider(ChatThreadClientProviderProps)

存储 <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>的 <xref:React.Context>。

此包中的聊天组件必须用 ChatThreadClientProvider包装。

function ChatThreadClientProvider(props: ChatThreadClientProviderProps): Element

参数

返回

Element

ControlBar(ControlBarProps)

用于调用控件的各种按钮的容器。

将此库中的各种调用控件按钮(例如,CameraButton)或你自己的 ControlBarButton 实例直接用于

function ControlBar(props: ControlBarProps): Element

参数

返回

Element

ControlBarButton(ControlBarButtonProps)

ControlBar的默认按钮样式。

使用此组件可创建自定义按钮,这些按钮的样式与其他 UI 库提供的按钮相同。

function ControlBarButton(props: ControlBarButtonProps): Element

参数

返回

Element

DevicesButton(DevicesButtonProps)

用于打开控制设备选项的菜单的按钮。

可与 ControlBar一起使用。

function DevicesButton(props: DevicesButtonProps): Element

参数

返回

Element

EndCallButton(EndCallButtonProps)

用于结束正在进行的呼叫的按钮。

可与 ControlBar一起使用。

function EndCallButton(props: EndCallButtonProps): Element

参数

返回

Element

ErrorBar(ErrorBarProps)

用于在 UI 上显示错误消息的组件。 可以显示的所有字符串都接受为 字符串,以便本地化字符串。 activeErrorMessages选择了活动错误。

此组件在内部跟踪用户关闭。

  • 具有关联时间戳的错误:如果在关闭后发生错误,则再次在 UI 上显示该错误。
  • 没有时间戳的错误:在错误从属性中消失之前,错误将被消除。 如果错误递归,则显示在 UI 中。

使用 <xref:%40fluentui%2Freact%23MessageBar> UI 元素。

function ErrorBar(props: ErrorBarProps): Element

参数

返回

Element

FluentThemeProvider(FluentThemeProviderProps)

提供程序,用于在此库的 react 组件中应用 Fluent 主题。

function FluentThemeProvider(props: FluentThemeProviderProps): Element

参数

返回

Element

注解

此库中的组件主要来自 Fluent UI、控件以及 Fluent React Northstar 控件。 此提供程序处理向基础 Fluent UI 控件以及 Fluent React Northstar 控件提供的任何主题。

GridLayout(GridLayoutProps)

用于在通话中布置音频/视频参与者磁贴的组件。

function GridLayout(props: GridLayoutProps): Element

参数

返回

Element

LocalizationProvider(LocalizationProviderProps)

提供程序为此库的 react 组件提供本地化字符串。

function LocalizationProvider(props: LocalizationProviderProps): Element

参数

返回

Element

注解

如果未使用此提供程序,则默认情况下会提供英语(美国)的本地化字符串。

MessageStatusIndicator(MessageStatusIndicatorProps)

显示已发送消息状态的组件。

添加对应于消息状态的图标和工具提示。

function MessageStatusIndicator(props: MessageStatusIndicatorProps): Element

参数

返回

Element

MessageThread(MessageThreadProps)

MessageThread 使你能够轻松创建一个组件来呈现聊天消息、处理新旧消息的滚动行为以及自定义 & 聊天线程中的控件的图标。

function MessageThread(props: MessageThreadProps): Element

参数

props
MessageThreadProps

MessageThreadProps 类型

用户至少需要提供聊天消息和 userId 才能呈现 MessageThread 组件。 用户还可以通过传入自己的虚拟形象、MessageStatusIndicator 图标、JumpToNewMessageButtonLoadPreviousMessagesButton 以及这些控件的行为来自定义 MessageThread

MessageThread 在内部使用来自 @fluentui/react-northstarChat & Chat.Message 组件。 可以在 查看有关这些两个组件的详细信息。

返回

Element

MicrophoneButton(MicrophoneButtonProps)

用于打开/关闭麦克风的按钮。

可与 ControlBar一起使用。

function MicrophoneButton(props: MicrophoneButtonProps): Element

参数

返回

Element

ParticipantItem(ParticipantItemProps)

用于呈现呼叫或聊天参与者的组件。

显示参与者的头像、displayName 和状态以及可选图标和上下文菜单。

function ParticipantItem(props: ParticipantItemProps): Element

参数

返回

Element

ParticipantList(ParticipantListProps)

用于呈现所有呼叫或聊天参与者的组件。

默认情况下,每个参与者都呈现 ParticipantItem。 请参阅要重写 <xref:ParticipantListProps.onRenderParticipant>。

function ParticipantList(props: ParticipantListProps): Element

参数

返回

Element

ParticipantsButton(ParticipantsButtonProps)

用于显示包含通话或聊天参与者的菜单的按钮。

可与 ControlBar一起使用。

此按钮包含通过其属性 menuProps定义的下拉菜单项。 默认情况下,它可以将包含完整列表的远程参与者数显示为子菜单,以及将所有参与者设为静音的选项,以及复制呼叫邀请 URL 的复制到剪贴板按钮。 可以完全重新定义此 menuProps,其属性的类型 IContextualMenuProps

function ParticipantsButton(props: ParticipantsButtonProps): Element

参数

返回

Element

ScreenShareButton(ScreenShareButtonProps)

用于启动/停止屏幕共享的按钮。

可与 ControlBar一起使用。

function ScreenShareButton(props: ScreenShareButtonProps): Element

参数

返回

Element

SendBox(SendBoxProps)

用于键入和发送消息的组件。

支持在用户开始输入文本时发送键入通知。 支持文本输入字段下方的可选消息。

function SendBox(props: SendBoxProps): Element

参数

props
SendBoxProps

返回

Element

StreamMedia(StreamMediaProps)

用于将包含视频流的 HTMLElement 转换为 JSX 元素的实用工具组件。

用于将无外设调用 API 返回的 HTMLElement 转换为可呈现为 VideoTile的组件。

function StreamMedia(props: StreamMediaProps): Element

参数

返回

Element

TypingIndicator(TypingIndicatorProps)

在聊天线程中的一个或多个参与者键入时通知本地用户的组件。

function TypingIndicator(props: TypingIndicatorProps): Element

参数

返回

Element

VideoGallery(VideoGalleryProps)

VideoGallery 表示特定呼叫的视频磁贴布局。 它为本地用户以及已加入呼叫的每个远程参与者显示 VideoTile

function VideoGallery(props: VideoGalleryProps): Element

参数

返回

Element

VideoTile(VideoTileProps)

用于为单个呼叫参与者呈现视频流的组件。

VideoGallery中的 GridLayout 一起使用。

function VideoTile(props: VideoTileProps): Element

参数

返回

Element

createAzureCommunicationCallAdapter(AzureCommunicationCallAdapterArgs)

创建 Azure 通信服务支持的 CallAdapter

这是此库提供 CallAdapter 的默认实现。

注意:displayName 最多可以包含 256 个字符。

function createAzureCommunicationCallAdapter(__namedParameters: AzureCommunicationCallAdapterArgs): Promise<CallAdapter>

参数

返回

Promise<CallAdapter>

createAzureCommunicationCallAdapterFromClient(StatefulCallClient, CallAgent, CallAdapterLocator)

使用提供的 StatefulCallClient创建 CallAdapter

如果要保留对 StatefulCallClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationCallAdapter

function createAzureCommunicationCallAdapterFromClient(callClient: StatefulCallClient, callAgent: CallAgent, locator: CallAdapterLocator): Promise<CallAdapter>

参数

callClient
StatefulCallClient
callAgent
CallAgent

返回

Promise<CallAdapter>

createAzureCommunicationCallWithChatAdapter(AzureCommunicationCallWithChatAdapterArgs)

创建 Azure 通信服务支持的 CallWithChatAdapter,以插入 CallWithChatComposite

function createAzureCommunicationCallWithChatAdapter(__namedParameters: AzureCommunicationCallWithChatAdapterArgs): Promise<CallWithChatAdapter>

参数

返回

createAzureCommunicationCallWithChatAdapterFromClients(AzureCommunicationCallWithChatAdapterFromClientArgs)

使用提供的 StatefulChatClientStatefulCallClient创建 CallWithChatAdapter

如果要保留对 StatefulChatClientStatefulCallClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationCallWithChatAdapter

function createAzureCommunicationCallWithChatAdapterFromClients(__namedParameters: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise<CallWithChatAdapter>

参数

返回

createAzureCommunicationChatAdapter(AzureCommunicationChatAdapterArgs)

创建由 Azure 通信服务支持的 ChatAdapter

这是此库提供 ChatAdapter 的默认实现。

function createAzureCommunicationChatAdapter(__namedParameters: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter>

参数

返回

Promise<ChatAdapter>

createAzureCommunicationChatAdapterFromClient(StatefulChatClient, ChatThreadClient)

使用提供的 StatefulChatClient创建 ChatAdapter

如果要保留对 StatefulChatClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationChatAdapter

function createAzureCommunicationChatAdapterFromClient(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient): Promise<ChatAdapter>

参数

chatClient
StatefulChatClient
chatThreadClient
ChatThreadClient

返回

Promise<ChatAdapter>

createDefaultCallingHandlers(StatefulCallClient, undefined | CallAgent, undefined | StatefulDeviceManager, undefined | Call)

为团队呼叫创建 CallHandlers 的默认实现。

实现利用从此库导出的提供程序的自定义组件时非常有用。

function createDefaultCallingHandlers(callClient: StatefulCallClient, callAgent: undefined | CallAgent, deviceManager: undefined | StatefulDeviceManager, call: undefined | Call): CallingHandlers

参数

callClient
StatefulCallClient
callAgent

undefined | CallAgent

deviceManager

undefined | StatefulDeviceManager

call

undefined | Call

返回

createDefaultChatHandlers(StatefulChatClient, ChatThreadClient)

创建 ChatHandlers的默认实现。

实现利用从此库导出的提供程序的自定义组件时非常有用。

返回的对象被备忘录化,以避免在用作 React 组件属性时重新呈现。

function createDefaultChatHandlers(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient): ChatHandlers

参数

chatClient
StatefulChatClient
chatThreadClient
ChatThreadClient

返回

createStatefulCallClient(StatefulCallClientArgs, StatefulCallClientOptions)

通过使用 ProxyCallClient <xref:%40azure%2Fcommunication-calling%23CallClient> 代理 CallClient <xref:ProxyCallClient> 来创建 StatefulCallClient StatefulCallClient,然后允许以声明性方式访问状态。

请务必使用从 StatefulCallClient 获取的 <xref:%40azure%2Fcommunication-calling%23DeviceManager> 和 <xref:%40azure%2Fcommunication-calling%23CallAgent> 和 <xref:%40azure%2Fcommunication-calling%23Call>(等),以便正确代理其状态更改。

function createStatefulCallClient(args: StatefulCallClientArgs, options?: StatefulCallClientOptions): StatefulCallClient

参数

返回

createStatefulChatClient(StatefulChatClientArgs, StatefulChatClientOptions)

通过使用 ProxyChatClient <xref:%40azure%2Fcommunication-chat%23ChatClient> 代理 ChatClient <xref:%40azure%2Fcommunication-chat%23ChatClient> 创建有状态 ChatClient StatefulChatClient <xref:ProxyChatClient>,然后允许以声明性方式访问状态。

function createStatefulChatClient(args: StatefulChatClientArgs, options?: StatefulChatClientOptions): StatefulChatClient

参数

返回

fromFlatCommunicationIdentifier(string)

到FlatCommunicationIdentifier的反向作。

function fromFlatCommunicationIdentifier(id: string): CommunicationIdentifier

参数

id

string

返回

getCallingSelector<Component>(Component)

获取指定组件的选择器。

实现利用从此库导出的提供程序的自定义组件时非常有用。

function getCallingSelector<Component>(component: Component): GetCallingSelector<Component>

参数

component

Component

返回

GetCallingSelector<Component>

getChatSelector<Component>(Component)

获取指定组件的选择器。

实现利用从此库导出的提供程序的自定义组件时非常有用。

function getChatSelector<Component>(component: Component): GetChatSelector<Component>

参数

component

Component

返回

GetChatSelector<Component>

toFlatCommunicationIdentifier(CommunicationIdentifier)

<xref:%40azure%2Fcommunication-common%23CommunicationIdentifier>的字符串表示形式。

CommunicationIdentifier 的此字符串表示形式保证为唯一通信用户稳定。 因此

  • 它可用于在外部数据库中保留用户的标识。
  • 它可用作 Map 中的键,以存储用户的数据。
function toFlatCommunicationIdentifier(identifier: CommunicationIdentifier): string

参数

返回

string

useAzureCommunicationCallAdapter(Partial<AzureCommunicationCallAdapterArgs>, (adapter: CallAdapter) => Promise<CallAdapter>, (adapter: CallAdapter) => Promise<void>)

一个自定义 React 挂钩,用于简化 CallAdapter的创建。

类似于 createAzureCommunicationCallAdapter,但需在内部异步创建适配器。

允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。

请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。

function useAzureCommunicationCallAdapter(args: Partial<AzureCommunicationCallAdapterArgs>, afterCreate?: (adapter: CallAdapter) => Promise<CallAdapter>, beforeDispose?: (adapter: CallAdapter) => Promise<void>): undefined | CallAdapter

参数

afterCreate

(adapter: CallAdapter) => Promise<CallAdapter>

beforeDispose

(adapter: CallAdapter) => Promise<void>

返回

undefined | CallAdapter

useAzureCommunicationCallWithChatAdapter(Partial<AzureCommunicationCallWithChatAdapterArgs>, (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>, (adapter: CallWithChatAdapter) => Promise<void>)

一个自定义 React 挂钩,用于简化 CallWithChatAdapter的创建。

类似于 createAzureCommunicationCallWithChatAdapter,但需在内部异步创建适配器。

允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。

请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。

function useAzureCommunicationCallWithChatAdapter(args: Partial<AzureCommunicationCallWithChatAdapterArgs>, afterCreate?: (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>, beforeDispose?: (adapter: CallWithChatAdapter) => Promise<void>): undefined | CallWithChatAdapter

参数

afterCreate

(adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>

beforeDispose

(adapter: CallWithChatAdapter) => Promise<void>

返回

undefined | CallWithChatAdapter

useAzureCommunicationChatAdapter(Partial<AzureCommunicationChatAdapterArgs>, (adapter: ChatAdapter) => Promise<ChatAdapter>, (adapter: ChatAdapter) => Promise<void>)

一个自定义 React 挂钩,用于简化 ChatAdapter的创建。

类似于 createAzureCommunicationChatAdapter,但需在内部处理适配器的异步创建。

允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。

请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。

function useAzureCommunicationChatAdapter(args: Partial<AzureCommunicationChatAdapterArgs>, afterCreate?: (adapter: ChatAdapter) => Promise<ChatAdapter>, beforeDispose?: (adapter: ChatAdapter) => Promise<void>): undefined | ChatAdapter

参数

afterCreate

(adapter: ChatAdapter) => Promise<ChatAdapter>

beforeDispose

(adapter: ChatAdapter) => Promise<void>

返回

undefined | ChatAdapter

useCall()

挂钩从提供程序获取 <xref:%40azure%2Fcommunication-calling%23Call>。

实现利用从此库导出的提供程序的自定义组件时非常有用。

以前必须使用 CallProvider 和 Call 对象才能使用此挂钩

function useCall(): undefined | Call

返回

undefined | Call

useCallAgent()

挂钩从提供程序获取 <xref:%40azure%2Fcommunication-calling%23CallAgent>。

实现利用从此库导出的提供程序的自定义组件时非常有用。

function useCallAgent(): undefined | CallAgent

返回

undefined | CallAgent

useCallClient()

挂钩从提供程序获取 StatefulCallClient

实现利用从此库导出的提供程序的自定义组件时非常有用。

function useCallClient(): StatefulCallClient

返回

useChatClient()

挂钩从提供程序获取 StatefulChatClient

实现利用从此库导出的提供程序的自定义组件时非常有用。

function useChatClient(): StatefulChatClient

返回

useChatThreadClient()

挂钩从提供程序获取 <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>。

实现利用从此库导出的提供程序的自定义组件时非常有用。

function useChatThreadClient(): ChatThreadClient

返回

useDeviceManager()

挂钩从提供程序获取 StatefulDeviceManager

实现利用从此库导出的提供程序的自定义组件时非常有用。

function useDeviceManager(): undefined | StatefulDeviceManager

返回

undefined | StatefulDeviceManager

usePropsFor<Component>(Component, "chat" | "calling")

从此库获取 React 组件所需的所有挂钩的主要挂钩。

若要调用此挂钩,组件需要包装在这些提供程序下:

  1. 对于聊天组件:ChatClientProviderChatThreadClientProvider

  2. 对于呼叫组件:CallClientProviderCallAgentProviderCallAgentProvider

组件的最直接用法如下所示:

示例

    import { ParticipantList, usePropsFor } from '@azure/communication-react';

    const App = (): JSX.Element => {
        // ... code to setup Providers ...

        return <ParticipantList {...usePropsFor(ParticipantList)}/>
    }
function usePropsFor<Component>(component: Component, type?: "chat" | "calling"): ComponentProps<Component>

参数

component

Component

type

"chat" | "calling"

返回

ComponentProps<Component>

useSelector<ParamT>(ParamT, (ParamT extends Selector ? Parameters<ParamT>[1] : undefined), "chat" | "calling")

挂钩以获取指定组件的选择器。

实现利用从此库导出的提供程序的自定义组件时非常有用。

function useSelector<ParamT>(selector: ParamT, selectorProps?: (ParamT extends Selector ? Parameters<ParamT>[1] : undefined), type?: "chat" | "calling"): (ParamT extends Selector ? ReturnType<ParamT> : undefined)

参数

selector

ParamT

selectorProps

(ParamT extends Selector ? Parameters<ParamT>[1] : undefined)

type

"chat" | "calling"

返回

(ParamT extends Selector ? ReturnType<ParamT> : undefined)

useTheme()

用于访问主题的 React 挂钩

function useTheme(): Theme

返回

Theme