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

@azure/communication-react package

CallError

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

ChatError

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

接口

ActiveErrorMessage

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

AdapterError

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

AdapterState

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

BaseCompositeProps

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

BaseCustomStyles

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

CallAdapter

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

CallAdapterCallManagement

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

CallAdapterCallOperations

用于管理当前呼叫的功能。

CallAdapterDeviceManagement

用于管理呼叫中的设备的功能。

CallAdapterSubscribers

调用可订阅的复合事件。

CallAgentProviderProps

用于初始化 CallAgentProvider 的参数

CallAgentState

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

CallAndChatLocator

用于在 createAzureCommunicationCallWithChatAdapter 中使用的参数,用于将呼叫与关联的聊天线程联接。

CallClientProviderProps

用于初始化 CallClientProvider 的参数

CallClientState

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

CallCompositeProps

CallComposite 的 Props。

CallCompositeStrings

CallComposite 直接使用的字符串。

此字符串是组件库中组件使用的字符串的补充。

CallProviderProps

用于初始化 CallProvider 的参数

CallState

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

CallWithChatAdapter

CallWithChatComposite 适配器接口。

CallWithChatAdapterManagement

用于通过聊天管理当前呼叫的功能。

CallWithChatAdapterState

CallWithChat 状态是有状态聊天和有状态呼叫客户端的组合,具有某些特定于 CallWithChat 复合的状态。

CallWithChatAdapterSubscriptions

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

CallWithChatAdapterUiState

CallWithChatComposite 相关的 UI 状态。

CallWithChatClientState

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

CallWithChatCompositeProps

CallWithChatComposite 所需的属性

CallWithChatCompositeStrings

CallWithChatComposite 直接使用的字符串。

此字符串是组件库中组件使用的字符串的补充。

CallWithChatControlOptions

CallWithChatComposite 调用控件以显示或隐藏调用控件栏上的按钮。

CallingHandlers

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

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

CallingTheme

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

CameraButtonContextualMenuStyles

CameraButton 菜单的样式。

CameraButtonProps

CameraButton 组件的属性。

CameraButtonStrings

可重写的 CameraButton 字符串。

CameraButtonStyles

CameraButton 的样式

ChatAdapterSubscribers

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

ChatAdapterThreadManagement

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

ChatCompositeProps

ChatComposite 的 Props。

ChatCompositeStrings

ChatComposite 直接使用的字符串。

此字符串是组件库中组件使用的字符串的补充。

ChatMessage

聊天消息。

CommonCallAdapter

CallComposite 适配器接口。

CommonCallingHandlers

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

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

ComponentLocale

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

ComponentStrings

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

CompositeLocale

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

CompositeStrings

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

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

ContentSystemMessage

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

ControlBarButtonProps

ControlBarButton 的属性。

ControlBarButtonStrings

可重写的 ControlBarButton 字符串。

ControlBarProps

ControlBar 的属性。

CreateVideoStreamViewResult

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

CustomMessage

自定义消息类型。

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

DevicesButtonContextualMenuStyles

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

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

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

ParticipantAddedSystemMessage

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

ParticipantItemProps

ParticipantItem 的道具。

ParticipantItemStrings

可重写的 ParticipantItem 字符串。

ParticipantItemStyles

ParticipantItem 的 Fluent 样式。

ParticipantListItemStyles

ParticipantListParticipantItem 的样式。

ParticipantListStyles

ParticipantList 的样式。

ParticipantRemovedSystemMessage

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

ParticipantsButtonContextualMenuStyles

“参与者”按钮菜单的样式。

ParticipantsButtonProps

ParticipantsButton 的道具。

ParticipantsButtonStrings

可重写的 ParticipantsButton 字符串。

ParticipantsButtonStyles

为参与者设置样式 属性按钮

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>。 此属性将添加到 StatefulCallClientcreateView 公开的状态,并由 disposeView 删除。

VideoTileProps

VideoTile 的 Props。

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

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

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

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

ChatCompositeIcons

可为 ChatComposite 重写的图标。

ChatCompositeOptions

ChatComposite 的可选功能。

ChatErrorBarSelector

ErrorBar 组件的选择器类型。

ChatErrorTarget

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

ChatErrors

来自聊天 SDK 的 API 调用导致的错误。

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

ChatHandlers

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

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

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-chat%23ChatClient>的<xref:%40azure%2Fcommunication-calling%23CallClient>集中式状态。

另请参阅: CallClientStateChatClientState

Common

返回 2 种类型的相交类型

CommonProperties

返回 2 种类型的相交属性

CommunicationParticipant

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

ComponentIcons

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

ComponentProps

usePropsFor 的帮助程序类型。

CompositeIcons

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

有关更多有针对性的类型,请参阅 ChatCompositeIconsCallCompositeIconsCallWithChatCompositeIcons

ControlBarButtonStyles

所有 ControlBarButton 实现的样式。

ControlBarLayout

显示 ControlBar 的布局。

CreateViewResult

createView 返回结果。

CustomAvatarOptions

可以注入函数的选项, onRender 用于自定义 Avatar (Persona) 组件。

DeviceManagerState

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

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 的 Props。

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

参与者列表的道具。

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:React.Context> 个 <xref:%40azure%2Fcommunication-calling%23CallAgent>,用于存储 。

从此包调用组件必须使用 CallAgentProvider 包装。

CallClientProvider(CallClientProviderProps)

<xref:React.Context>一个 ,用于存储 StatefulCallClient

必须用 CallClientProvider 包装此包中调用组件。

CallComposite(CallCompositeProps)

用于通话体验的可自定义 UI 组合。

CallProvider(CallProviderProps)

一 <xref:React.Context> 个 <xref:%40azure%2Fcommunication-calling%23Call>,用于存储 。

从此包调用组件必须使用 CallProvider 包装。

CallWithChatComposite(CallWithChatCompositeProps)

CallWithChatComposite 将关键组件汇集在一起,以提供现成的聊天体验的完整通话。

CameraButton(CameraButtonProps)

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

可与 ControlBar 一起使用。

ChatClientProvider(ChatClientProviderProps)

存储 <xref:React.Context>StatefulChatClient 的

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

ChatComposite(ChatCompositeProps)

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

ChatThreadClientProvider(ChatThreadClientProviderProps)

一 <xref:React.Context> 个 <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>,用于存储 。

必须使用 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 的引用,则很有用。 考虑将 createAzureCommunicationCallAdapter 用于更简单的 API。

createAzureCommunicationCallWithChatAdapter(AzureCommunicationCallWithChatAdapterArgs)

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

createAzureCommunicationCallWithChatAdapterFromClients(AzureCommunicationCallWithChatAdapterFromClientArgs)

使用提供的 StatefulChatClient 和 StatefulCallClient 创建 CallWithChatAdapter

如果要保留对 StatefulChatClient 和 StatefulCallClient 的引用,则很有用。 请考虑将 createAzureCommunicationCallWithChatAdapter 用于更简单的 API。

createAzureCommunicationChatAdapter(AzureCommunicationChatAdapterArgs)

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

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

createAzureCommunicationChatAdapterFromClient(StatefulChatClient, ChatThreadClient)

使用提供的 StatefulChatClient 创建 ChatAdapter

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

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

为团队通话创建 CallingHandlers 的默认实现。

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

createDefaultChatHandlers(StatefulChatClient, ChatThreadClient)

创建 ChatHandlers 的默认实现。

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

返回的对象在用作React组件的属性时,会进行备注,以避免重新呈现。

createStatefulCallClient(StatefulCallClientArgs, StatefulCallClientOptions)

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

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

createStatefulChatClient(StatefulChatClientArgs, StatefulChatClientOptions)

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

fromFlatCommunicationIdentifier(string)

toFlatCommunicationIdentifier 的反向操作。

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:React.Context> 个 <xref:%40azure%2Fcommunication-calling%23CallAgent>,用于存储 。

从此包调用组件必须使用 CallAgentProvider 包装。

function CallAgentProvider(props: CallAgentProviderProps): Element

参数

返回

Element

CallClientProvider(CallClientProviderProps)

<xref:React.Context>一个 ,用于存储 StatefulCallClient

必须用 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:React.Context> 个 <xref:%40azure%2Fcommunication-calling%23Call>,用于存储 。

从此包调用组件必须使用 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)

存储 <xref:React.Context>StatefulChatClient 的

必须使用 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:React.Context> 个 <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>,用于存储 。

必须使用 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内部使用 Chat 中的 @fluentui/react-northstar& 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 的引用,则很有用。 考虑将 createAzureCommunicationCallAdapter 用于更简单的 API。

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)

使用提供的 StatefulChatClient 和 StatefulCallClient 创建 CallWithChatAdapter

如果要保留对 StatefulChatClient 和 StatefulCallClient 的引用,则很有用。 请考虑将 createAzureCommunicationCallWithChatAdapter 用于更简单的 API。

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 的引用,则很有用。 请考虑将 createAzureCommunicationChatAdapter 用于更简单的 API。

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

参数

chatClient
StatefulChatClient
chatThreadClient
ChatThreadClient

返回

Promise<ChatAdapter>

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

为团队通话创建 CallingHandlers 的默认实现。

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

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

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

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

参数

返回

createStatefulChatClient(StatefulChatClientArgs, StatefulChatClientOptions)

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

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

参数

返回

fromFlatCommunicationIdentifier(string)

toFlatCommunicationIdentifier 的反向操作。

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