你当前正在访问 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 |
除了组件库中的组件使用的字符串外, 这些字符串。 |
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 | |
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 | |
MessageStatusIndicatorStrings |
可以重写的 MessageStatusIndicator 字符串。 |
MessageThreadStrings |
可以重写的 MessageThread 字符串。 |
MessageThreadStyles |
MessageThread的 Fluent 样式。 |
MicrophoneButtonContextualMenuStyles |
MicrophoneButton 菜单的样式。 |
MicrophoneButtonProps |
MicrophoneButton的道具。 |
MicrophoneButtonStrings |
可以重写的 MicrophoneButton 字符串。 |
MicrophoneButtonStyles | |
NetworkDiagnosticsState |
仅 <xref:%40azure%2Fcommunication-calling%23NetworkDiagnostics>的状态代理。 |
OptionsDevice |
DevicesButton 浮出控件中的设备,例如相机、麦克风或扬声器。 |
ParticipantAddedSystemMessage |
一条系统消息,通知参与者已添加到聊天线程。 |
ParticipantItemProps |
ParticipantItem的道具。 |
ParticipantItemStrings |
可以重写的 ParticipantItem 字符串。 |
ParticipantItemStyles |
ParticipantItem的 Fluent 样式。 |
ParticipantListItemStyles | |
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 | |
ScreenShareButtonStrings |
可以重写的 ScreenShareButton 字符串。 |
SendBoxProps |
SendBox的道具。 |
SendBoxStrings |
可以重写的 SendBox 字符串。 |
SendBoxStylesProps |
<xref:Sendbox>的 Fluent 样式。 |
StatefulCallClient |
定义允许有状态使用 CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> 的方法。 该接口提供对代理状态的访问,并允许注册状态更改事件的处理程序。 有关状态定义,请参阅 CallClientState。 状态更改事件由:
|
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 样式。 |
类型别名
函数
Call |
存储 <xref:%40azure%2Fcommunication-calling%23CallAgent>的 <xref:React.Context>。 必须用 CallAgentProvider包装来自此包的调用组件。 |
Call |
存储 StatefulCallClient的 <xref:React.Context>。 必须用 CallClientProvider包装来自此包的调用组件。 |
Call |
用于调用体验的可自定义 UI 复合。 |
Call |
存储 <xref:%40azure%2Fcommunication-calling%23Call>的 <xref:React.Context>。 必须用 CallProvider包装来自此包的调用组件。 |
Call |
CallWithChatComposite 汇集了关键组件,提供现成的聊天体验的完整呼叫。 |
Camera |
用于打开/关闭相机的按钮。 可与 ControlBar一起使用。 |
Chat |
存储 StatefulChatClient的 <xref:React.Context>。 此包中的聊天组件必须用 ChatClientProvider包装。 |
Chat |
聊天体验的可自定义 UI 复合。 |
Chat |
存储 <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>的 <xref:React.Context>。 此包中的聊天组件必须用 ChatThreadClientProvider包装。 |
Control |
用于调用控件的各种按钮的容器。 将此库中的各种调用控件按钮(例如,CameraButton)或你自己的 ControlBarButton 实例直接用于。 |
Control |
ControlBar的默认按钮样式。 使用此组件可创建自定义按钮,这些按钮的样式与其他 UI 库提供的按钮相同。 |
Devices |
用于打开控制设备选项的菜单的按钮。 可与 ControlBar一起使用。 |
End |
用于结束正在进行的呼叫的按钮。 可与 ControlBar一起使用。 |
Error |
用于在 UI 上显示错误消息的组件。 可以显示的所有字符串都接受为 字符串,以便本地化字符串。 activeErrorMessages选择了活动错误。 此组件在内部跟踪用户关闭。
使用 <xref:%40fluentui%2Freact%23MessageBar> UI 元素。 |
Fluent |
提供程序,用于在此库的 react 组件中应用 Fluent 主题。 |
Grid |
用于在通话中布置音频/视频参与者磁贴的组件。 |
Localization |
提供程序为此库的 react 组件提供本地化字符串。 |
Message |
显示已发送消息状态的组件。 添加对应于消息状态的图标和工具提示。 |
Message |
|
Microphone |
用于打开/关闭麦克风的按钮。 可与 ControlBar一起使用。 |
Participant |
用于呈现呼叫或聊天参与者的组件。 显示参与者的头像、displayName 和状态以及可选图标和上下文菜单。 |
Participant |
用于呈现所有呼叫或聊天参与者的组件。 默认情况下,每个参与者都呈现 ParticipantItem。 请参阅要重写 <xref:ParticipantListProps.onRenderParticipant>。 |
Participants |
用于显示包含通话或聊天参与者的菜单的按钮。 可与 ControlBar一起使用。 此按钮包含通过其属性 |
Screen |
用于启动/停止屏幕共享的按钮。 可与 ControlBar一起使用。 |
Send |
用于键入和发送消息的组件。 支持在用户开始输入文本时发送键入通知。 支持文本输入字段下方的可选消息。 |
Stream |
用于将包含视频流的 HTMLElement 转换为 JSX 元素的实用工具组件。 用于将无外设调用 API 返回的 HTMLElement 转换为可呈现为 VideoTile的组件。 |
Typing |
在聊天线程中的一个或多个参与者键入时通知本地用户的组件。 |
Video |
VideoGallery 表示特定呼叫的视频磁贴布局。 它为本地用户以及已加入呼叫的每个远程参与者显示 VideoTile。 |
Video |
用于为单个呼叫参与者呈现视频流的组件。 与 VideoGallery中的 GridLayout 一起使用。 |
create |
创建 Azure 通信服务支持的 CallAdapter。 这是此库提供 CallAdapter 的默认实现。 注意: |
create |
使用提供的 StatefulCallClient创建 CallAdapter。 如果要保留对 StatefulCallClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationCallAdapter。 |
create |
创建 Azure 通信服务支持的 CallWithChatAdapter,以插入 CallWithChatComposite。 |
create |
使用提供的 StatefulChatClient 和 StatefulCallClient创建 CallWithChatAdapter。 如果要保留对 StatefulChatClient 和 StatefulCallClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationCallWithChatAdapter。 |
create |
创建由 Azure 通信服务支持的 ChatAdapter。 这是此库提供 ChatAdapter 的默认实现。 |
create |
使用提供的 StatefulChatClient创建 ChatAdapter。 如果要保留对 StatefulChatClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationChatAdapter。 |
create |
为团队呼叫创建 CallHandlers 的默认实现。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
create |
创建 ChatHandlers的默认实现。 实现利用从此库导出的提供程序的自定义组件时非常有用。 返回的对象被备忘录化,以避免在用作 React 组件属性时重新呈现。 |
create |
通过使用 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>(等),以便正确代理其状态更改。 |
create |
通过使用 ProxyChatClient <xref:%40azure%2Fcommunication-chat%23ChatClient> 代理 ChatClient <xref:%40azure%2Fcommunication-chat%23ChatClient> 创建有状态 ChatClient StatefulChatClient <xref:ProxyChatClient>,然后允许以声明性方式访问状态。 |
from |
|
get |
获取指定组件的选择器。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
get |
获取指定组件的选择器。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
to |
<xref:%40azure%2Fcommunication-common%23CommunicationIdentifier>的字符串表示形式。 CommunicationIdentifier 的此字符串表示形式保证为唯一通信用户稳定。 因此
|
use |
一个自定义 React 挂钩,用于简化 CallAdapter的创建。 类似于 createAzureCommunicationCallAdapter,但需在内部异步创建适配器。 允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。 请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。 |
use |
一个自定义 React 挂钩,用于简化 CallWithChatAdapter的创建。 类似于 createAzureCommunicationCallWithChatAdapter,但需在内部异步创建适配器。 允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。 请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。 |
use |
一个自定义 React 挂钩,用于简化 ChatAdapter的创建。 类似于 createAzureCommunicationChatAdapter,但需在内部处理适配器的异步创建。 允许未定义参数,以便可以遵循挂钩规则,并在创建参数时传入参数。 仅当定义所有参数时,才会创建适配器。 请注意,必须记录参数,以避免在每个呈现上重新创建适配器。 有关典型使用示例,请参阅情景手册。 |
use |
挂钩从提供程序获取 <xref:%40azure%2Fcommunication-calling%23Call>。 实现利用从此库导出的提供程序的自定义组件时非常有用。 以前必须使用 CallProvider 和 Call 对象才能使用此挂钩 |
use |
挂钩从提供程序获取 <xref:%40azure%2Fcommunication-calling%23CallAgent>。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
use |
挂钩从提供程序获取 StatefulCallClient。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
use |
挂钩从提供程序获取 StatefulChatClient。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
use |
挂钩从提供程序获取 <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
use |
挂钩从提供程序获取 StatefulDeviceManager。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
use |
从此库获取 React 组件所需的所有挂钩的主要挂钩。 若要调用此挂钩,组件需要包装在这些提供程序下:
组件的最直接用法如下所示: 示例
|
use |
挂钩以获取指定组件的选择器。 实现利用从此库导出的提供程序的自定义组件时非常有用。 |
use |
用于访问主题的 React 挂钩 |
函数详细信息
CallAgentProvider(CallAgentProviderProps)
存储 <xref:%40azure%2Fcommunication-calling%23CallAgent>的 <xref:React.Context>。
必须用 CallAgentProvider包装来自此包的调用组件。
function CallAgentProvider(props: CallAgentProviderProps): Element
参数
- props
- CallAgentProviderProps
返回
Element
CallClientProvider(CallClientProviderProps)
存储 StatefulCallClient的 <xref:React.Context>。
必须用 CallClientProvider包装来自此包的调用组件。
function CallClientProvider(props: CallClientProviderProps): Element
参数
- props
- CallClientProviderProps
返回
Element
CallComposite(CallCompositeProps)
用于调用体验的可自定义 UI 复合。
function CallComposite(props: CallCompositeProps): Element
参数
- props
- CallCompositeProps
返回
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
参数
- props
- CallProviderProps
返回
Element
CallWithChatComposite(CallWithChatCompositeProps)
CallWithChatComposite 汇集了关键组件,提供现成的聊天体验的完整呼叫。
function CallWithChatComposite(props: CallWithChatCompositeProps): Element
参数
返回
Element
CameraButton(CameraButtonProps)
用于打开/关闭相机的按钮。
可与 ControlBar一起使用。
function CameraButton(props: CameraButtonProps): Element
参数
- props
- CameraButtonProps
返回
Element
ChatClientProvider(ChatClientProviderProps)
存储 StatefulChatClient的 <xref:React.Context>。
此包中的聊天组件必须用 ChatClientProvider包装。
function ChatClientProvider(props: ChatClientProviderProps): Element
参数
- props
- ChatClientProviderProps
返回
Element
ChatComposite(ChatCompositeProps)
聊天体验的可自定义 UI 复合。
function ChatComposite(props: ChatCompositeProps): Element
参数
- props
- ChatCompositeProps
返回
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
参数
- props
- ControlBarProps
返回
Element
ControlBarButton(ControlBarButtonProps)
ControlBar的默认按钮样式。
使用此组件可创建自定义按钮,这些按钮的样式与其他 UI 库提供的按钮相同。
function ControlBarButton(props: ControlBarButtonProps): Element
参数
- props
- ControlBarButtonProps
返回
Element
DevicesButton(DevicesButtonProps)
用于打开控制设备选项的菜单的按钮。
可与 ControlBar一起使用。
function DevicesButton(props: DevicesButtonProps): Element
参数
- props
- DevicesButtonProps
返回
Element
EndCallButton(EndCallButtonProps)
用于结束正在进行的呼叫的按钮。
可与 ControlBar一起使用。
function EndCallButton(props: EndCallButtonProps): Element
参数
- props
- EndCallButtonProps
返回
Element
ErrorBar(ErrorBarProps)
用于在 UI 上显示错误消息的组件。 可以显示的所有字符串都接受为 字符串,以便本地化字符串。 activeErrorMessages选择了活动错误。
此组件在内部跟踪用户关闭。
- 具有关联时间戳的错误:如果在关闭后发生错误,则再次在 UI 上显示该错误。
- 没有时间戳的错误:在错误从属性中消失之前,错误将被消除。 如果错误递归,则显示在 UI 中。
使用 <xref:%40fluentui%2Freact%23MessageBar> UI 元素。
function ErrorBar(props: ErrorBarProps): Element
参数
- props
- ErrorBarProps
返回
Element
FluentThemeProvider(FluentThemeProviderProps)
提供程序,用于在此库的 react 组件中应用 Fluent 主题。
function FluentThemeProvider(props: FluentThemeProviderProps): Element
参数
- props
- FluentThemeProviderProps
返回
Element
注解
此库中的组件主要来自 Fluent UI、控件以及 Fluent React Northstar 控件。 此提供程序处理向基础 Fluent UI 控件以及 Fluent React Northstar 控件提供的任何主题。
GridLayout(GridLayoutProps)
用于在通话中布置音频/视频参与者磁贴的组件。
function GridLayout(props: GridLayoutProps): Element
参数
- props
- GridLayoutProps
返回
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
图标、JumpToNewMessageButton
、LoadPreviousMessagesButton
以及这些控件的行为来自定义 MessageThread
。
MessageThread
在内部使用来自 @fluentui/react-northstar
的 Chat
& Chat.Message
组件。 可以在 查看有关这些两个组件的详细信息。
返回
Element
MicrophoneButton(MicrophoneButtonProps)
用于打开/关闭麦克风的按钮。
可与 ControlBar一起使用。
function MicrophoneButton(props: MicrophoneButtonProps): Element
参数
- props
- MicrophoneButtonProps
返回
Element
ParticipantItem(ParticipantItemProps)
用于呈现呼叫或聊天参与者的组件。
显示参与者的头像、displayName 和状态以及可选图标和上下文菜单。
function ParticipantItem(props: ParticipantItemProps): Element
参数
- props
- ParticipantItemProps
返回
Element
ParticipantList(ParticipantListProps)
用于呈现所有呼叫或聊天参与者的组件。
默认情况下,每个参与者都呈现 ParticipantItem。 请参阅要重写 <xref:ParticipantListProps.onRenderParticipant>。
function ParticipantList(props: ParticipantListProps): Element
参数
- props
- ParticipantListProps
返回
Element
ParticipantsButton(ParticipantsButtonProps)
用于显示包含通话或聊天参与者的菜单的按钮。
可与 ControlBar一起使用。
此按钮包含通过其属性 menuProps
定义的下拉菜单项。 默认情况下,它可以将包含完整列表的远程参与者数显示为子菜单,以及将所有参与者设为静音的选项,以及复制呼叫邀请 URL 的复制到剪贴板按钮。
可以完全重新定义此 menuProps
,其属性的类型 IContextualMenuProps。
function ParticipantsButton(props: ParticipantsButtonProps): Element
参数
- props
- ParticipantsButtonProps
返回
Element
ScreenShareButton(ScreenShareButtonProps)
用于启动/停止屏幕共享的按钮。
可与 ControlBar一起使用。
function ScreenShareButton(props: ScreenShareButtonProps): Element
参数
- props
- ScreenShareButtonProps
返回
Element
SendBox(SendBoxProps)
用于键入和发送消息的组件。
支持在用户开始输入文本时发送键入通知。 支持文本输入字段下方的可选消息。
function SendBox(props: SendBoxProps): Element
参数
- props
- SendBoxProps
返回
Element
StreamMedia(StreamMediaProps)
用于将包含视频流的 HTMLElement 转换为 JSX 元素的实用工具组件。
用于将无外设调用 API 返回的 HTMLElement 转换为可呈现为 VideoTile的组件。
function StreamMedia(props: StreamMediaProps): Element
参数
- props
- StreamMediaProps
返回
Element
TypingIndicator(TypingIndicatorProps)
在聊天线程中的一个或多个参与者键入时通知本地用户的组件。
function TypingIndicator(props: TypingIndicatorProps): Element
参数
- props
- TypingIndicatorProps
返回
Element
VideoGallery(VideoGalleryProps)
VideoGallery 表示特定呼叫的视频磁贴布局。 它为本地用户以及已加入呼叫的每个远程参与者显示 VideoTile。
function VideoGallery(props: VideoGalleryProps): Element
参数
- props
- VideoGalleryProps
返回
Element
VideoTile(VideoTileProps)
用于为单个呼叫参与者呈现视频流的组件。
与 VideoGallery中的 GridLayout 一起使用。
function VideoTile(props: VideoTileProps): Element
参数
- props
- VideoTileProps
返回
Element
createAzureCommunicationCallAdapter(AzureCommunicationCallAdapterArgs)
创建 Azure 通信服务支持的 CallAdapter。
这是此库提供 CallAdapter 的默认实现。
注意:displayName
最多可以包含 256 个字符。
function createAzureCommunicationCallAdapter(__namedParameters: AzureCommunicationCallAdapterArgs): Promise<CallAdapter>
参数
- __namedParameters
- AzureCommunicationCallAdapterArgs
返回
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
- locator
- CallAdapterLocator
返回
Promise<CallAdapter>
createAzureCommunicationCallWithChatAdapter(AzureCommunicationCallWithChatAdapterArgs)
创建 Azure 通信服务支持的 CallWithChatAdapter,以插入 CallWithChatComposite。
function createAzureCommunicationCallWithChatAdapter(__namedParameters: AzureCommunicationCallWithChatAdapterArgs): Promise<CallWithChatAdapter>
参数
- __namedParameters
- AzureCommunicationCallWithChatAdapterArgs
返回
Promise<CallWithChatAdapter>
createAzureCommunicationCallWithChatAdapterFromClients(AzureCommunicationCallWithChatAdapterFromClientArgs)
使用提供的 StatefulChatClient 和 StatefulCallClient创建 CallWithChatAdapter。
如果要保留对 StatefulChatClient 和 StatefulCallClient的引用,则很有用。 请考虑为更简单的 API 使用 createAzureCommunicationCallWithChatAdapter。
function createAzureCommunicationCallWithChatAdapterFromClients(__namedParameters: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise<CallWithChatAdapter>
参数
- __namedParameters
- AzureCommunicationCallWithChatAdapterFromClientArgs
返回
Promise<CallWithChatAdapter>
createAzureCommunicationChatAdapter(AzureCommunicationChatAdapterArgs)
创建由 Azure 通信服务支持的 ChatAdapter。
这是此库提供 ChatAdapter 的默认实现。
function createAzureCommunicationChatAdapter(__namedParameters: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter>
参数
- __namedParameters
- AzureCommunicationChatAdapterArgs
返回
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
参数
- options
- StatefulChatClientOptions
返回
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
参数
- identifier
- CommunicationIdentifier
返回
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
参数
- args
-
Partial<AzureCommunicationCallAdapterArgs>
- 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
参数
- args
- 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
参数
- args
-
Partial<AzureCommunicationChatAdapterArgs>
- 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 组件所需的所有挂钩的主要挂钩。
若要调用此挂钩,组件需要包装在这些提供程序下:
对于聊天组件:ChatClientProvider 和 ChatThreadClientProvider。
对于呼叫组件:CallClientProvider、CallAgentProvider 和 CallAgentProvider。
组件的最直接用法如下所示:
示例
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