@azure/communication-react package
Classes
CallError |
Error thrown from failed stateful API methods. |
ChatError |
Error thrown from failed StatefulChatClient methods. |
Interfaces
ActiveErrorMessage |
Active error messages to be shown via ErrorBar. |
AdapterError |
Error reported via error events and stored in adapter state. |
AdapterState |
Functionality for interfacing with Composite adapter state. |
BaseCompositeProps |
Properties common to all composites exported from this library. |
BaseCustomStyles |
Basic fluent styles props for all components exported from this libray. |
CallAdapter |
An Adapter interface specific for Azure Communication identity which extends CommonCallAdapter. |
CallAdapterCallManagement |
Functionality for managing the current call or start a new call |
CallAdapterCallOperations |
Functionality for managing the current call. |
CallAdapterDeviceManagement |
Functionality for managing devices within a call. |
CallAdapterSubscribers |
Call composite events that can be subscribed to. |
CallAgentProviderProps |
Arguments to initialize a CallAgentProvider. |
CallAgentState |
State only version of <xref:%40azure%2Fcommunication-calling%23CallAgent> except calls is moved to be a child directly of CallClientState and not included here. The reason to have CallAgent's state proxied is to provide access to displayName. We don't flatten CallAgent.displayName and put it in CallClientState because it would be ambiguious that displayName is actually reliant on the creation/existence of CallAgent to be available. |
CallAndChatLocator |
Arguments for use in createAzureCommunicationCallWithChatAdapter to join a Call with an associated Chat thread. |
CallClientProviderProps |
Arguments to initialize a CallClientProvider. |
CallClientState |
Container for all of the state data proxied by StatefulCallClient. The calls, callsEnded, incomingCalls, and incomingCallsEnded states will be automatically provided if a callAgent has been created. The deviceManager will be empty initially until populated see DeviceManagerState. The userId state is provided as a convenience for the developer and is completely controled and set by the developer. |
CallCompositeProps |
Props for CallComposite. |
CallCompositeStrings |
Strings used by the CallComposite directly. This strings are in addition to those used by the components from the component library. |
CallProviderProps |
Arguments to initialize a CallProvider. |
CallState |
State only version of <xref:%40azure%2Fcommunication-calling%23Call>. StatefulCallClient will automatically retrieve Call's state and add it to the state exposed by StatefulCallClient. |
CallWithChatAdapter |
CallWithChatComposite Adapter interface. |
CallWithChatAdapterManagement |
Functionality for managing the current call with chat. |
CallWithChatAdapterState |
CallWithChat State is a combination of Stateful Chat and Stateful Calling clients with some state specific to the CallWithChat Composite only. |
CallWithChatAdapterSubscriptions |
Call and Chat events that can be subscribed to in the CallWithChatAdapter. |
CallWithChatAdapterUiState |
UI state pertaining to the CallWithChatComposite. |
CallWithChatClientState |
State from the backend services that drives CallWithChatComposite. |
CallWithChatCompositeProps |
Props required for the CallWithChatComposite |
CallWithChatCompositeStrings |
Strings used by the CallWithChatComposite directly. This strings are in addition to those used by the components from the component library. |
CallWithChatControlOptions |
CallWithChatComposite Call controls to show or hide buttons on the calling control bar. |
CallingHandlers |
Object containing all the handlers required for calling components. Calling related components from this package are able to pick out relevant handlers from this object. See <xref:useHandlers> and usePropsFor. |
CallingTheme |
Custom Fluent theme pallete used by calling related components in this library. |
CameraButtonContextualMenuStyles |
Styles for the CameraButton menu. |
CameraButtonProps |
Props for CameraButton component. |
CameraButtonStrings |
Strings of CameraButton that can be overridden. |
CameraButtonStyles |
Styles for CameraButton |
ChatAdapterSubscribers |
Chat composite events that can be subscribed to. |
ChatAdapterThreadManagement |
Functionality for managing the current chat thread. |
ChatCompositeProps |
Props for ChatComposite. |
ChatCompositeStrings |
Strings used by the ChatComposite directly. This strings are in addition to those used by the components from the component library. |
ChatMessage |
A chat message. |
CommonCallAdapter |
CallComposite Adapter interface. |
CommonCallingHandlers |
Object containing all the handlers required for calling components. Calling related components from this package are able to pick out relevant handlers from this object. See <xref:useHandlers> and usePropsFor. |
ComponentLocale |
Locale information for all components exported from this library. |
ComponentStrings |
Strings used by all components exported from this library. |
CompositeLocale |
Locale information for all composites exported from this library. |
CompositeStrings |
Strings used in the composites directly. These strings are used by the composites directly, instead of by the contained components. |
ContentSystemMessage |
A system message with arbitary content. |
ControlBarButtonProps |
Props for ControlBarButton. |
ControlBarButtonStrings |
Strings of ControlBarButton that can be overridden. |
ControlBarProps |
Props for ControlBar. |
CreateVideoStreamViewResult |
Object returned after creating a local or remote VideoStream. This contains helper functions to manipulate the render of the stream. |
CustomMessage |
A custom message type. Custom messages are not rendered by default, but applications can provide custom renderers for them. |
DevicesButtonContextualMenuStyles |
Styles for the DevicesButton menu. |
DevicesButtonProps |
Props for DevicesButton. |
DevicesButtonStrings |
Strings of DevicesButton that can be overridden. |
DevicesButtonStyles |
Styles for the Devices button menu items. |
DiagnosticsCallFeatureState |
State only proxy for <xref:%40azure%2Fcommunication-calling%23DiagnosticsCallFeature>. |
Disposable |
Functionality for correctly disposing a Composite. |
EndCallButtonProps |
Props for EndCallButton. |
EndCallButtonStrings |
Strings of EndCallButton that can be overridden. |
ErrorBarProps |
Props for ErrorBar. In addition to the following, ErrorBar forwards all <xref:%40fluentui%2Freact%23IMessageBarProps> to the underlying <xref:%40fluentui%2Freact%23MessageBar>. |
ErrorBarStrings |
All strings that may be shown on the UI in the ErrorBar. |
FluentThemeProviderProps |
Props for FluentThemeProvider. |
GridLayoutProps |
Props for GridLayout. |
GridLayoutStyles |
GridLayout Component Styles. |
HorizontalGalleryStyles |
<xref:HorizontalGallery> Component Styles. |
IncomingCallState |
State only version of <xref:%40azure%2Fcommunication-calling%23IncomingCall>. StatefulCallClient will automatically detect incoming calls and add their state to the state exposed by StatefulCallClient. |
JumpToNewMessageButtonProps |
Arguments for <xref:MessageThreadProps.onRenderJumpToNewMessageButton>. |
LocalVideoCameraCycleButtonProps | |
LocalVideoStreamState |
State only version of <xref:%40azure%2Fcommunication-calling%23LocalVideoStream>. |
MediaDiagnosticsState |
State only proxy for <xref:%40azure%2Fcommunication-calling%23MediaDiagnostics>. |
MessageCommon |
Common properties of all message types. |
MessageStatusIndicatorProps |
Props for MessageStatusIndicator. |
MessageStatusIndicatorStrings |
Strings of MessageStatusIndicator that can be overridden. |
MessageThreadStrings |
Strings of MessageThread that can be overridden. |
MessageThreadStyles |
Fluent styles for MessageThread. |
MicrophoneButtonContextualMenuStyles |
Styles for the MicrophoneButton menu. |
MicrophoneButtonProps |
Props for MicrophoneButton. |
MicrophoneButtonStrings |
Strings of MicrophoneButton that can be overridden. |
MicrophoneButtonStyles |
Styles for MicrophoneButton |
NetworkDiagnosticsState |
State only proxy for <xref:%40azure%2Fcommunication-calling%23NetworkDiagnostics>. |
OptionsDevice |
A device, e.g. camera, microphone, or speaker, in the DevicesButton flyout. |
ParticipantAddedSystemMessage |
A system message notifying that a participant was added to the chat thread. |
ParticipantItemProps |
Props for ParticipantItem. |
ParticipantItemStrings |
Strings of ParticipantItem that can be overridden. |
ParticipantItemStyles |
Fluent styles for ParticipantItem. |
ParticipantListItemStyles |
Styles for the ParticipantList ParticipantItem. |
ParticipantListStyles |
Styles for the ParticipantList. |
ParticipantRemovedSystemMessage |
A system message notifying that a participant was removed from the chat thread. |
ParticipantsButtonContextualMenuStyles |
Styles for the ParticipantsButton menu. |
ParticipantsButtonProps |
Props for ParticipantsButton. |
ParticipantsButtonStrings |
Strings of ParticipantsButton that can be overridden. |
ParticipantsButtonStyles |
Styles Props for ParticipantsButton. |
RecordingCallFeature |
State only version of <xref:%40azure%2Fcommunication-calling%23RecordingCallFeature>. StatefulCallClient will automatically listen for recording state of the call and update the state exposed by StatefulCallClient accordingly. |
RemoteParticipantState |
State only version of <xref:%40azure%2Fcommunication-calling%23RemoteParticipant>. StatefulCallClient will automatically retrieve RemoteParticipants and add their state to the state exposed by StatefulCallClient. |
RemoteVideoStreamState |
State only version of <xref:%40azure%2Fcommunication-calling%23RemoteVideoStream>. |
ScreenShareButtonProps |
Props for ScreenShareButton. |
ScreenShareButtonStrings |
Strings of ScreenShareButton that can be overridden. |
SendBoxProps |
Props for SendBox. |
SendBoxStrings |
Strings of SendBox that can be overridden. |
SendBoxStylesProps |
Fluent styles for <xref:Sendbox>. |
StatefulCallClient |
Defines the methods that allow CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> to be used statefully. The interface provides access to proxied state and also allows registering a handler for state change events. For state definition see CallClientState. State change events are driven by:
|
StatefulChatClient |
Defines the methods that allow {@Link @azure/communication-chat#ChatClient} to be used with a centralized generated state. The interface provides access to proxied state and also allows registering a handler for state change events. |
StatefulDeviceManager |
Defines the additional methods added by the stateful on top of <xref:%40azure%2Fcommunication-calling%23DeviceManager>. |
StreamMediaProps |
Props for StreamMedia. |
SystemMessageCommon |
Common properties of all system messages. |
TopicUpdatedSystemMessage |
A system message notifying that the chat thread topic was updated. |
TranscriptionCallFeature |
State only version of <xref:%40azure%2Fcommunication-calling%23TranscriptionCallFeature>. StatefulCallClient will automatically listen for transcription state of the call and update the state exposed by StatefulCallClient accordingly. |
TypingIndicatorProps |
Props for TypingIndicator. |
TypingIndicatorStrings |
Strings of TypingIndicator that can be overridden. |
TypingIndicatorStylesProps |
Fluent styles for TypingIndicator. |
VideoGalleryProps |
Props for VideoGallery. |
VideoGalleryRemoteParticipant |
The state of a remote participant in the VideoGallery. |
VideoGalleryStream |
Video stream of a participant in VideoGallery. |
VideoGalleryStrings |
All strings that may be shown on the UI in the VideoGallery. |
VideoGalleryStyles |
VideoGallery Component Styles. |
VideoStreamOptions |
Options to control how video streams are rendered. |
VideoStreamRendererViewState |
State only version of <xref:%40azure%2Fcommunication-calling%23VideoStreamRendererView>. This property is added to the state exposed by StatefulCallClient by createView and removed by disposeView. |
VideoTileProps |
Props for VideoTile. |
VideoTileStylesProps |
Fluent styles for VideoTile. |
Type Aliases
AdapterErrors |
Adapters stores the latest error for each operation in the state.
|
AreEqual |
Compare if 2 react components are exact equal, result type will be true/false |
AreParamEqual |
Compare if props of 2 react components are equal, result type will be true/false |
AreTypeEqual |
Compare if two types are equal, result type will be true/false |
AvatarPersonaData |
Custom data attributes for displaying avatar for a user. |
AvatarPersonaDataCallback |
Callback function used to provide custom data to build an avatar for a user. |
AzureCommunicationCallAdapterArgs |
Arguments for creating the Azure Communication Services implementation of CallAdapter. Note: |
AzureCommunicationCallWithChatAdapterArgs |
Arguments for createAzureCommunicationCallWithChatAdapter |
AzureCommunicationCallWithChatAdapterFromClientArgs |
Arguments for <xref:createAzureCommunicationCallWithChatAdapterFromClient> |
AzureCommunicationChatAdapterArgs |
Arguments for creating the Azure Communication Services implementation of ChatAdapter. |
CallAdapterCallEndedEvent |
Payload for CallEndedListener containing details on the ended call. |
CallAdapterClientState |
CommonCallAdapter state inferred from Azure Communication Services backend. |
CallAdapterLocator |
Locator used by createAzureCommunicationCallAdapter to locate the call to join |
CallAdapterState |
CommonCallAdapter state. |
CallAdapterUiState |
CommonCallAdapter state for pure UI purposes. |
CallCompositeIcons |
Icons that can be overridden for CallComposite. |
CallCompositeOptions |
Optional features of the CallComposite. |
CallCompositePage |
Major UI screens shown in the CallComposite. |
CallControlDisplayType |
Control bar display type for CallComposite. |
CallControlOptions |
Customization options for the control bar in calling experience. |
CallEndedListener |
Callback for CallAdapterSubscribers 'callEnded' event. |
CallErrorBarSelector |
Selector type for ErrorBar component. |
CallErrorTarget |
String literal type for all permissible keys in {@Link CallErrors}. |
CallErrors |
Errors teed from API calls to the Calling SDK. Each property in the object stores the latest error for a particular SDK API method. Errors from this object can be cleared using the <xref:newClearCallErrorsModifier>. Additionally, errors are automatically cleared when:
|
CallIdChangedListener |
Callback for CallAdapterSubscribers 'callIdChanged' event. |
CallParticipantListParticipant |
Calling participant's state, as reflected in the UI components. |
CallWithChatCompositeIcons |
Icons that can be overridden for CallWithChatComposite. |
CallWithChatCompositeOptions |
Optional features of the CallWithChatComposite. |
CallWithChatEvent |
Events fired off by the CallWithChatAdapter. |
CallingBaseSelectorProps |
Common props used to reference calling declarative client state. |
CallingReturnProps |
Helper type for usePropsFor. |
CameraButtonSelector |
Selector type for CameraButton component. |
ChatAdapter |
ChatComposite Adapter interface. |
ChatAdapterState |
ChatAdapter state. |
ChatAdapterUiState |
ChatAdapter state for pure UI purposes. |
ChatBaseSelectorProps |
Common props for selectors for ChatClientState. |
ChatClientProviderProps |
Arguments to initialize a ChatClientProvider. |
ChatClientState |
Centralized state for <xref:%40azure%2Fcommunication-chat%23ChatClient>. |
ChatCompositeClientState |
ChatAdapter state inferred from Azure Communication Services backend. |
ChatCompositeIcons |
Icons that can be overridden for ChatComposite. |
ChatCompositeOptions |
Optional features of the ChatComposite. |
ChatErrorBarSelector |
Selector type for ErrorBar component. |
ChatErrorTarget |
String literal type for all permissible keys in ChatErrors. |
ChatErrors |
Errors teed from API calls to the Chat SDK. Each property in the object stores the latest error for a particular SDK API method. |
ChatHandlers |
Object containing all the handlers required for chat components. Chat related components from this package are able to pick out relevant handlers from this object. See <xref:useHandlers> and usePropsFor. |
ChatMessageWithStatus |
An extension to <xref:%40azure%2Fcommunication-chat%23ChatMessage> that stores client-side only metadata for chat messages. TODO: The name has bitrotted. Rename me. |
ChatParticipantListSelector |
Selector type for ParticipantList component. |
ChatReturnProps |
Helper type for usePropsFor. |
ChatThreadClientProviderProps |
Arguments to initialize a ChatThreadClientProvider. |
ChatThreadClientState |
Centralized state for <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>. |
ChatThreadProperties |
Properties of a chat thread. We define a minimal one that helps us hide the different types used by underlying API. |
ClientState |
Centralized state for <xref:%40azure%2Fcommunication-calling%23CallClient> or <xref:%40azure%2Fcommunication-chat%23ChatClient>. See also: CallClientState, ChatClientState. |
Common |
Return intersect type of 2 types |
CommonProperties |
Return intersect properties of 2 types |
CommunicationParticipant |
A Chat or Calling participant's state, as reflected in the UI. |
ComponentIcons |
Icons used by the React components exported from this library. |
ComponentProps |
Helper type for usePropsFor. |
CompositeIcons |
Icons that can be overridden in one of the composites exported by this library. See ChatCompositeIcons, CallCompositeIcons and CallWithChatCompositeIcons for more targeted types. |
ControlBarButtonStyles |
Styles for all ControlBarButton implementations. |
ControlBarLayout |
Present layouts for the ControlBar. |
CreateViewResult |
Return result from createView. |
CustomAvatarOptions |
Options that can be injected into the |
DeviceManagerState |
This type is meant to encapsulate all the state inside <xref:%40azure%2Fcommunication-calling%23DeviceManager>. For optional parameters they may not be available until permission is granted by the user. The cameras, microphones, speakers, and deviceAccess states will be empty until the corresponding <xref:%40azure%2Fcommunication-calling%23DeviceManager>'s getCameras, getMicrophones, getSpeakers, and askDevicePermission APIs are called and completed. |
DevicesButtonSelector |
Selector type for DevicesButton component. |
DiagnosticChangedEventListner |
Callback for CallAdapterSubscribers 'diagnosticChanged' event. |
DisplayNameChangedListener |
Callback for CallAdapterSubscribers 'displayNameChanged' event. |
EmptySelector |
A type for trivial selectors that return no data. Used as a default return value if usePropsFor is called for a component that requires no data. |
ErrorType |
All errors that can be shown in the ErrorBar. |
GetCallingSelector |
Specific type of the selector applicable to a given Component. |
GetChatSelector |
Specific type of the selector applicable to a given Component. |
IsLocalScreenSharingActiveChangedListener |
Callback for CallAdapterSubscribers 'isLocalScreenSharingActiveChanged' event. |
IsMutedChangedListener |
Callback for CallAdapterSubscribers 'isMuted' event. |
IsSpeakingChangedListener |
Callback for CallAdapterSubscribers 'isSpeakingChanged' event. |
LoadingState |
Whether the stream is loading or not. |
LocalizationProviderProps |
Props for LocalizationProvider. |
MediaDiagnosticChangedEvent |
Payload for DiagnosticChangedEventListner where there is a change in a media diagnostic. |
Message |
Discriminated union of all messages. The |
MessageAttachedStatus |
Indicate whether a chat message should be displayed merged with the message before / after it. Useful to merge many messages from the same sender into a single message bubble. |
MessageContentType |
Supported types of chat message content. |
MessageProps |
Props to render a single message. See MessageRenderer. |
MessageReadListener |
Callback for ChatAdapterSubscribers 'messageRead' event. |
MessageReceivedListener |
Callback for ChatAdapterSubscribers 'messageReceived' event. |
MessageRenderer |
A component to render a single message. |
MessageSentListener |
Callback for ChatAdapterSubscribers 'messageSent' event. |
MessageStatus |
Client-side state of a sent message. Includes transitional states that occur before message delivery is confirmed from the backend. |
MessageThreadProps |
Props for MessageThread. |
MessageThreadSelector |
Selector type for MessageThread component. |
MicrophoneButtonSelector |
Selector type for MicrophoneButton component. |
NetworkDiagnosticChangedEvent |
Payload for DiagnosticChangedEventListner where there is a change in a network diagnostic. |
OnRenderAvatarCallback |
A custom rendered callback that allows users to customize the rendering of a Persona Component. |
ParticipantListParticipant |
Participants displayed in a ParticipantList. |
ParticipantListProps |
Props for ParticipantList. |
ParticipantListSelector |
Selector type for ParticipantList component. |
ParticipantMenuItemsCallback |
A callback for providing custom menu items for each participant in ParticipantList. |
ParticipantState |
The connection state of a call participant. |
ParticipantsAddedListener |
Callback for ChatAdapterSubscribers 'participantsAdded' event. |
ParticipantsButtonSelector |
Selector type for ParticipantsButton component. |
ParticipantsJoinedListener |
Callback for CallAdapterSubscribers 'participantsJoined' event. |
ParticipantsLeftListener |
Callback for CallAdapterSubscribers 'participantsLeft' event. |
ParticipantsRemovedListener |
Callback for ChatAdapterSubscribers 'participantsRemoved' event. |
ReadReceiptsBySenderId |
An array of key value pairs that stores each sender's display name and last read message |
ScreenShareButtonSelector |
Selector type for ScreenShareButton component. |
Selector |
An optimized selector that refines ClientState updates into props for React Components in this library. |
SendBoxSelector |
Selector type for SendBox component. |
StatefulCallClientArgs |
Arguments to construct the StatefulCallClient. |
StatefulCallClientOptions |
Options to construct the StatefulCallClient with. |
StatefulChatClientArgs |
Arguments to construct the StatefulChatClient. |
StatefulChatClientOptions |
Options to construct the StatefulChatClient. |
SystemMessage |
Discriminated union of all system messages. The |
TopicChangedListener |
Callback for ChatAdapterSubscribers 'topicChanged' event. |
TypingIndicatorSelector |
Selector type for TypingIndicator component. |
UpdateMessageCallback |
Callback function run when a message is updated. |
VideoGalleryLayout | |
VideoGalleryLocalParticipant |
The state of the local participant in the VideoGallery. |
VideoGalleryParticipant |
The state of a participant in the VideoGallery. |
VideoGallerySelector |
Selector type for VideoGallery component. |
ViewScalingMode |
Scaling mode of a VideoGalleryStream. |
Functions
Call |
A <xref:React.Context> that stores a <xref:%40azure%2Fcommunication-calling%23CallAgent>. Calling components from this package must be wrapped with a CallAgentProvider. |
Call |
A <xref:React.Context> that stores a StatefulCallClient. Calling components from this package must be wrapped with a CallClientProvider. |
Call |
A customizable UI composite for calling experience. |
Call |
A <xref:React.Context> that stores a <xref:%40azure%2Fcommunication-calling%23Call>. Calling components from this package must be wrapped with a CallProvider. |
Call |
CallWithChatComposite brings together key components to provide a full call with chat experience out of the box. |
Camera |
A button to turn camera on / off. Can be used with ControlBar. |
Chat |
A <xref:React.Context> that stores a StatefulChatClient. Chat components from this package must be wrapped with a ChatClientProvider. |
Chat |
A customizable UI composite for the chat experience. |
Chat |
A <xref:React.Context> that stores a <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>. Chat components from this package must be wrapped with a ChatThreadClientProvider. |
Control |
A container for various buttons for call controls. Use with various call control buttons in this library, e.g., CameraButton, or your own instances of ControlBarButton directly. |
Control |
Default button styled for the ControlBar. Use this component create custom buttons that are styled the same as other buttons provided by the UI Library. |
Devices |
A button to open a menu that controls device options. Can be used with ControlBar. |
End |
A button to end an ongoing call. Can be used with ControlBar. |
Error |
A component to show error messages on the UI. All strings that can be shown are accepted as the strings so that they can be localized. Active errors are selected by activeErrorMessages. This component internally tracks dismissed by the user.
Uses <xref:%40fluentui%2Freact%23MessageBar> UI element. |
Fluent |
Provider to apply a Fluent theme across this library's react components. |
Grid |
A component to lay out audio / video participants tiles in a call. |
Localization |
Provider to provide localized strings for this library's react components. |
Message |
Component to display the status of a sent message. Adds an icon and tooltip corresponding to the message status. |
Message |
|
Microphone |
A button to turn microphone on / off. Can be used with ControlBar. |
Participant |
Component to render a calling or chat participant. Displays the participant's avatar, displayName and status as well as optional icons and context menu. |
Participant |
Component to render all calling or chat participants. By default, each participant is rendered with ParticipantItem. See <xref:ParticipantListProps.onRenderParticipant> to override. |
Participants |
A button to show a menu with calling or chat participants. Can be used with ControlBar. This button contains dropdown menu items defined through its property |
Screen |
A button to start / stop screen sharing. Can be used with ControlBar. |
Send |
Component for typing and sending messages. Supports sending typing notification when user starts entering text. Supports an optional message below the text input field. |
Stream |
Utility component to convert an HTMLElement with a video stream into a JSX element. Use to convert an HTMLElement returned by headless calling API into a component that can be rendered as a VideoTile. |
Typing |
Component to notify local user when one or more participants in the chat thread are typing. |
Video |
VideoGallery represents a layout of video tiles for a specific call. It displays a VideoTile for the local user as well as for each remote participant who has joined the call. |
Video |
A component to render the video stream for a single call participant. Use with GridLayout in a VideoGallery. |
create |
Create a CallAdapter backed by Azure Communication Services. This is the default implementation of CallAdapter provided by this library. Note: |
create |
Create a CallAdapter using the provided StatefulCallClient. Useful if you want to keep a reference to StatefulCallClient. Consider using createAzureCommunicationCallAdapter for a simpler API. |
create |
Create a CallWithChatAdapter backed by Azure Communication services to plug into the CallWithChatComposite. |
create |
Create a CallWithChatAdapter using the provided StatefulChatClient and StatefulCallClient. Useful if you want to keep a reference to StatefulChatClient and StatefulCallClient. Consider using createAzureCommunicationCallWithChatAdapter for a simpler API. |
create |
Create a ChatAdapter backed by Azure Communication Services. This is the default implementation of ChatAdapter provided by this library. |
create |
Create a ChatAdapter using the provided StatefulChatClient. Useful if you want to keep a reference to StatefulChatClient. Consider using createAzureCommunicationChatAdapter for a simpler API. |
create |
Create the default implementation of CallingHandlers for teams call. Useful when implementing a custom component that utilizes the providers exported from this library. |
create |
Create the default implementation of ChatHandlers. Useful when implementing a custom component that utilizes the providers exported from this library. Returned object is memoized to avoid rerenders when used as props for React Components. |
create |
Creates a StatefulCallClient StatefulCallClient by proxying CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> with ProxyCallClient <xref:ProxyCallClient> which then allows access to state in a declarative way. It is important to use the <xref:%40azure%2Fcommunication-calling%23DeviceManager> and <xref:%40azure%2Fcommunication-calling%23CallAgent> and <xref:%40azure%2Fcommunication-calling%23Call> (and etc.) that are obtained from the StatefulCallClient in order for their state changes to be proxied properly. |
create |
Creates a stateful ChatClient StatefulChatClient by proxying ChatClient <xref:%40azure%2Fcommunication-chat%23ChatClient> with ProxyChatClient <xref:ProxyChatClient> which then allows access to state in a declarative way. |
from |
Reverse operation of toFlatCommunicationIdentifier. |
get |
Get the selector for a specified component. Useful when implementing a custom component that utilizes the providers exported from this library. |
get |
Get the selector for a specified component. Useful when implementing a custom component that utilizes the providers exported from this library. |
to |
A string representation of a <xref:%40azure%2Fcommunication-common%23CommunicationIdentifier>. This string representation of CommunicationIdentifier is guaranteed to be stable for a unique Communication user. Thus,
|
use |
A custom React hook to simplify the creation of CallAdapter. Similar to createAzureCommunicationCallAdapter, but takes care of asynchronous creation of the adapter internally. Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments as they are created. The adapter is only created when all arguments are defined. Note that you must memoize the arguments to avoid recreating adapter on each render. See storybook for typical usage examples. |
use |
A custom React hook to simplify the creation of CallWithChatAdapter. Similar to createAzureCommunicationCallWithChatAdapter, but takes care of asynchronous creation of the adapter internally. Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments as they are created. The adapter is only created when all arguments are defined. Note that you must memoize the arguments to avoid recreating adapter on each render. See storybook for typical usage examples. |
use |
A custom React hook to simplify the creation of ChatAdapter. Similar to createAzureCommunicationChatAdapter, but takes care of asynchronous creation of the adapter internally. Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments as they are created. The adapter is only created when all arguments are defined. Note that you must memoize the arguments to avoid recreating adapter on each render. See storybook for typical usage examples. |
use |
Hook to obtain <xref:%40azure%2Fcommunication-calling%23Call> from the provider. Useful when implementing a custom component that utilizes the providers exported from this library. you must have previously used the CallProvider with a Call object to use this hook |
use |
Hook to obtain <xref:%40azure%2Fcommunication-calling%23CallAgent> from the provider. Useful when implementing a custom component that utilizes the providers exported from this library. |
use |
Hook to obtain StatefulCallClient from the provider. Useful when implementing a custom component that utilizes the providers exported from this library. |
use |
Hook to obtain StatefulChatClient from the provider. Useful when implementing a custom component that utilizes the providers exported from this library. |
use |
Hook to obtain <xref:%40azure%2Fcommunication-chat%23ChatThreadClient> from the provider. Useful when implementing a custom component that utilizes the providers exported from this library. |
use |
Hook to obtain StatefulDeviceManager from the provider. Useful when implementing a custom component that utilizes the providers exported from this library. |
use |
Primary hook to get all hooks necessary for a React Component from this library. To call this hook, the component requires to be wrapped under these providers:
Most straightforward usage of a components looks like: Example
|
use |
Hook to obtain a selector for a specified component. Useful when implementing a custom component that utilizes the providers exported from this library. |
use |
React hook to access theme |
Function Details
CallAgentProvider(CallAgentProviderProps)
A <xref:React.Context> that stores a <xref:%40azure%2Fcommunication-calling%23CallAgent>.
Calling components from this package must be wrapped with a CallAgentProvider.
function CallAgentProvider(props: CallAgentProviderProps): Element
Parameters
- props
- CallAgentProviderProps
Returns
Element
CallClientProvider(CallClientProviderProps)
A <xref:React.Context> that stores a StatefulCallClient.
Calling components from this package must be wrapped with a CallClientProvider.
function CallClientProvider(props: CallClientProviderProps): Element
Parameters
- props
- CallClientProviderProps
Returns
Element
CallComposite(CallCompositeProps)
A customizable UI composite for calling experience.
function CallComposite(props: CallCompositeProps): Element
Parameters
- props
- CallCompositeProps
Returns
Element
Remarks
Call composite min width/height are as follow:
- mobile: 17.5rem x 21rem (280px x 336px, with default rem at 16px)
- desktop: 30rem x 22rem (480px x 352px, with default rem at 16px)
CallProvider(CallProviderProps)
A <xref:React.Context> that stores a <xref:%40azure%2Fcommunication-calling%23Call>.
Calling components from this package must be wrapped with a CallProvider.
function CallProvider(props: CallProviderProps): Element
Parameters
- props
- CallProviderProps
Returns
Element
CallWithChatComposite(CallWithChatCompositeProps)
CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.
function CallWithChatComposite(props: CallWithChatCompositeProps): Element
Parameters
Returns
Element
CameraButton(CameraButtonProps)
A button to turn camera on / off.
Can be used with ControlBar.
function CameraButton(props: CameraButtonProps): Element
Parameters
- props
- CameraButtonProps
Returns
Element
ChatClientProvider(ChatClientProviderProps)
A <xref:React.Context> that stores a StatefulChatClient.
Chat components from this package must be wrapped with a ChatClientProvider.
function ChatClientProvider(props: ChatClientProviderProps): Element
Parameters
- props
- ChatClientProviderProps
Returns
Element
ChatComposite(ChatCompositeProps)
A customizable UI composite for the chat experience.
function ChatComposite(props: ChatCompositeProps): Element
Parameters
- props
- ChatCompositeProps
Returns
Element
Remarks
Chat composite min width and height are respectively 17.5rem and 20rem (280px and 320px, with default rem at 16px)
ChatThreadClientProvider(ChatThreadClientProviderProps)
A <xref:React.Context> that stores a <xref:%40azure%2Fcommunication-chat%23ChatThreadClient>.
Chat components from this package must be wrapped with a ChatThreadClientProvider.
function ChatThreadClientProvider(props: ChatThreadClientProviderProps): Element
Parameters
Returns
Element
ControlBar(ControlBarProps)
A container for various buttons for call controls.
Use with various call control buttons in this library, e.g., CameraButton, or your own instances of ControlBarButton directly.
function ControlBar(props: ControlBarProps): Element
Parameters
- props
- ControlBarProps
Returns
Element
ControlBarButton(ControlBarButtonProps)
Default button styled for the ControlBar.
Use this component create custom buttons that are styled the same as other buttons provided by the UI Library.
function ControlBarButton(props: ControlBarButtonProps): Element
Parameters
- props
- ControlBarButtonProps
Returns
Element
DevicesButton(DevicesButtonProps)
A button to open a menu that controls device options.
Can be used with ControlBar.
function DevicesButton(props: DevicesButtonProps): Element
Parameters
- props
- DevicesButtonProps
Returns
Element
EndCallButton(EndCallButtonProps)
A button to end an ongoing call.
Can be used with ControlBar.
function EndCallButton(props: EndCallButtonProps): Element
Parameters
- props
- EndCallButtonProps
Returns
Element
ErrorBar(ErrorBarProps)
A component to show error messages on the UI. All strings that can be shown are accepted as the strings so that they can be localized. Active errors are selected by activeErrorMessages.
This component internally tracks dismissed by the user.
- Errors that have an associated timestamp: The error is shown on the UI again if it occurs after being dismissed.
- Errors that do not have a timestamp: The error is dismissed until it disappears from the props. If the error recurs, it is shown in the UI.
Uses <xref:%40fluentui%2Freact%23MessageBar> UI element.
function ErrorBar(props: ErrorBarProps): Element
Parameters
- props
- ErrorBarProps
Returns
Element
FluentThemeProvider(FluentThemeProviderProps)
Provider to apply a Fluent theme across this library's react components.
function FluentThemeProvider(props: FluentThemeProviderProps): Element
Parameters
- props
- FluentThemeProviderProps
Returns
Element
Remarks
Components in this library are composed primarily from Fluent UI, controls, and also from Fluent React Northstar controls. This provider handles applying any theme provided to both the underlying Fluent UI controls, as well as the Fluent React Northstar controls.
GridLayout(GridLayoutProps)
A component to lay out audio / video participants tiles in a call.
function GridLayout(props: GridLayoutProps): Element
Parameters
- props
- GridLayoutProps
Returns
Element
LocalizationProvider(LocalizationProviderProps)
Provider to provide localized strings for this library's react components.
function LocalizationProvider(props: LocalizationProviderProps): Element
Parameters
Returns
Element
Remarks
Components will be provided localized strings in English (US) by default if this provider is not used.
MessageStatusIndicator(MessageStatusIndicatorProps)
Component to display the status of a sent message.
Adds an icon and tooltip corresponding to the message status.
function MessageStatusIndicator(props: MessageStatusIndicatorProps): Element
Parameters
Returns
Element
MessageThread(MessageThreadProps)
MessageThread
allows you to easily create a component for rendering chat messages, handling scrolling behavior of new/old messages and customizing icons & controls inside the chat thread.
function MessageThread(props: MessageThreadProps): Element
Parameters
- props
- MessageThreadProps
of type MessageThreadProps
Users will need to provide at least chat messages and userId to render the MessageThread
component.
Users can also customize MessageThread
by passing in their own Avatar, MessageStatusIndicator
icon, JumpToNewMessageButton
, LoadPreviousMessagesButton
and the behavior of these controls.
MessageThread
internally uses the Chat
& Chat.Message
component from @fluentui/react-northstar
. You can checkout the details about these two components.
Returns
Element
MicrophoneButton(MicrophoneButtonProps)
A button to turn microphone on / off.
Can be used with ControlBar.
function MicrophoneButton(props: MicrophoneButtonProps): Element
Parameters
- props
- MicrophoneButtonProps
Returns
Element
ParticipantItem(ParticipantItemProps)
Component to render a calling or chat participant.
Displays the participant's avatar, displayName and status as well as optional icons and context menu.
function ParticipantItem(props: ParticipantItemProps): Element
Parameters
- props
- ParticipantItemProps
Returns
Element
ParticipantList(ParticipantListProps)
Component to render all calling or chat participants.
By default, each participant is rendered with ParticipantItem. See <xref:ParticipantListProps.onRenderParticipant> to override.
function ParticipantList(props: ParticipantListProps): Element
Parameters
- props
- ParticipantListProps
Returns
Element
ParticipantsButton(ParticipantsButtonProps)
A button to show a menu with calling or chat participants.
Can be used with ControlBar.
This button contains dropdown menu items defined through its property menuProps
. By default, it can display the number of remote participants with the full list
as sub-menu and an option to mute all participants, as well as a copy-to-clipboard button to copy the call invitation URL.
This menuProps
can be fully redefined and its property is of type IContextualMenuProps.
function ParticipantsButton(props: ParticipantsButtonProps): Element
Parameters
- props
- ParticipantsButtonProps
Returns
Element
ScreenShareButton(ScreenShareButtonProps)
A button to start / stop screen sharing.
Can be used with ControlBar.
function ScreenShareButton(props: ScreenShareButtonProps): Element
Parameters
- props
- ScreenShareButtonProps
Returns
Element
SendBox(SendBoxProps)
Component for typing and sending messages.
Supports sending typing notification when user starts entering text. Supports an optional message below the text input field.
function SendBox(props: SendBoxProps): Element
Parameters
- props
- SendBoxProps
Returns
Element
StreamMedia(StreamMediaProps)
Utility component to convert an HTMLElement with a video stream into a JSX element.
Use to convert an HTMLElement returned by headless calling API into a component that can be rendered as a VideoTile.
function StreamMedia(props: StreamMediaProps): Element
Parameters
- props
- StreamMediaProps
Returns
Element
TypingIndicator(TypingIndicatorProps)
Component to notify local user when one or more participants in the chat thread are typing.
function TypingIndicator(props: TypingIndicatorProps): Element
Parameters
- props
- TypingIndicatorProps
Returns
Element
VideoGallery(VideoGalleryProps)
VideoGallery represents a layout of video tiles for a specific call. It displays a VideoTile for the local user as well as for each remote participant who has joined the call.
function VideoGallery(props: VideoGalleryProps): Element
Parameters
- props
- VideoGalleryProps
Returns
Element
VideoTile(VideoTileProps)
A component to render the video stream for a single call participant.
Use with GridLayout in a VideoGallery.
function VideoTile(props: VideoTileProps): Element
Parameters
- props
- VideoTileProps
Returns
Element
createAzureCommunicationCallAdapter(AzureCommunicationCallAdapterArgs)
Create a CallAdapter backed by Azure Communication Services.
This is the default implementation of CallAdapter provided by this library.
Note: displayName
can be a maximum of 256 characters.
function createAzureCommunicationCallAdapter(__namedParameters: AzureCommunicationCallAdapterArgs): Promise<CallAdapter>
Parameters
- __namedParameters
- AzureCommunicationCallAdapterArgs
Returns
Promise<CallAdapter>
createAzureCommunicationCallAdapterFromClient(StatefulCallClient, CallAgent, CallAdapterLocator)
Create a CallAdapter using the provided StatefulCallClient.
Useful if you want to keep a reference to StatefulCallClient. Consider using createAzureCommunicationCallAdapter for a simpler API.
function createAzureCommunicationCallAdapterFromClient(callClient: StatefulCallClient, callAgent: CallAgent, locator: CallAdapterLocator): Promise<CallAdapter>
Parameters
- callClient
- StatefulCallClient
- callAgent
- CallAgent
- locator
- CallAdapterLocator
Returns
Promise<CallAdapter>
createAzureCommunicationCallWithChatAdapter(AzureCommunicationCallWithChatAdapterArgs)
Create a CallWithChatAdapter backed by Azure Communication services to plug into the CallWithChatComposite.
function createAzureCommunicationCallWithChatAdapter(__namedParameters: AzureCommunicationCallWithChatAdapterArgs): Promise<CallWithChatAdapter>
Parameters
- __namedParameters
- AzureCommunicationCallWithChatAdapterArgs
Returns
Promise<CallWithChatAdapter>
createAzureCommunicationCallWithChatAdapterFromClients(AzureCommunicationCallWithChatAdapterFromClientArgs)
Create a CallWithChatAdapter using the provided StatefulChatClient and StatefulCallClient.
Useful if you want to keep a reference to StatefulChatClient and StatefulCallClient. Consider using createAzureCommunicationCallWithChatAdapter for a simpler API.
function createAzureCommunicationCallWithChatAdapterFromClients(__namedParameters: AzureCommunicationCallWithChatAdapterFromClientArgs): Promise<CallWithChatAdapter>
Parameters
- __namedParameters
- AzureCommunicationCallWithChatAdapterFromClientArgs
Returns
Promise<CallWithChatAdapter>
createAzureCommunicationChatAdapter(AzureCommunicationChatAdapterArgs)
Create a ChatAdapter backed by Azure Communication Services.
This is the default implementation of ChatAdapter provided by this library.
function createAzureCommunicationChatAdapter(__namedParameters: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter>
Parameters
- __namedParameters
- AzureCommunicationChatAdapterArgs
Returns
Promise<ChatAdapter>
createAzureCommunicationChatAdapterFromClient(StatefulChatClient, ChatThreadClient)
Create a ChatAdapter using the provided StatefulChatClient.
Useful if you want to keep a reference to StatefulChatClient. Consider using createAzureCommunicationChatAdapter for a simpler API.
function createAzureCommunicationChatAdapterFromClient(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient): Promise<ChatAdapter>
Parameters
- chatClient
- StatefulChatClient
- chatThreadClient
- ChatThreadClient
Returns
Promise<ChatAdapter>
createDefaultCallingHandlers(StatefulCallClient, undefined | CallAgent, undefined | StatefulDeviceManager, undefined | Call)
Create the default implementation of CallingHandlers for teams call.
Useful when implementing a custom component that utilizes the providers exported from this library.
function createDefaultCallingHandlers(callClient: StatefulCallClient, callAgent: undefined | CallAgent, deviceManager: undefined | StatefulDeviceManager, call: undefined | Call): CallingHandlers
Parameters
- callClient
- StatefulCallClient
- callAgent
-
undefined | CallAgent
- deviceManager
-
undefined | StatefulDeviceManager
- call
-
undefined | Call
Returns
createDefaultChatHandlers(StatefulChatClient, ChatThreadClient)
Create the default implementation of ChatHandlers.
Useful when implementing a custom component that utilizes the providers exported from this library.
Returned object is memoized to avoid rerenders when used as props for React Components.
function createDefaultChatHandlers(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient): ChatHandlers
Parameters
- chatClient
- StatefulChatClient
- chatThreadClient
- ChatThreadClient
Returns
createStatefulCallClient(StatefulCallClientArgs, StatefulCallClientOptions)
Creates a StatefulCallClient StatefulCallClient by proxying CallClient <xref:%40azure%2Fcommunication-calling%23CallClient> with ProxyCallClient <xref:ProxyCallClient> which then allows access to state in a declarative way.
It is important to use the <xref:%40azure%2Fcommunication-calling%23DeviceManager> and <xref:%40azure%2Fcommunication-calling%23CallAgent> and <xref:%40azure%2Fcommunication-calling%23Call> (and etc.) that are obtained from the StatefulCallClient in order for their state changes to be proxied properly.
function createStatefulCallClient(args: StatefulCallClientArgs, options?: StatefulCallClientOptions): StatefulCallClient
Parameters
Returns
createStatefulChatClient(StatefulChatClientArgs, StatefulChatClientOptions)
Creates a stateful ChatClient StatefulChatClient by proxying ChatClient <xref:%40azure%2Fcommunication-chat%23ChatClient> with ProxyChatClient <xref:ProxyChatClient> which then allows access to state in a declarative way.
function createStatefulChatClient(args: StatefulChatClientArgs, options?: StatefulChatClientOptions): StatefulChatClient
Parameters
- options
- StatefulChatClientOptions
Returns
fromFlatCommunicationIdentifier(string)
Reverse operation of toFlatCommunicationIdentifier.
function fromFlatCommunicationIdentifier(id: string): CommunicationIdentifier
Parameters
- id
-
string
Returns
getCallingSelector<Component>(Component)
Get the selector for a specified component.
Useful when implementing a custom component that utilizes the providers exported from this library.
function getCallingSelector<Component>(component: Component): GetCallingSelector<Component>
Parameters
- component
-
Component
Returns
GetCallingSelector<Component>
getChatSelector<Component>(Component)
Get the selector for a specified component.
Useful when implementing a custom component that utilizes the providers exported from this library.
function getChatSelector<Component>(component: Component): GetChatSelector<Component>
Parameters
- component
-
Component
Returns
GetChatSelector<Component>
toFlatCommunicationIdentifier(CommunicationIdentifier)
A string representation of a <xref:%40azure%2Fcommunication-common%23CommunicationIdentifier>.
This string representation of CommunicationIdentifier is guaranteed to be stable for a unique Communication user. Thus,
- it can be used to persist a user's identity in external databases.
- it can be used as keys into a Map to store data for the user.
function toFlatCommunicationIdentifier(identifier: CommunicationIdentifier): string
Parameters
- identifier
- CommunicationIdentifier
Returns
string
useAzureCommunicationCallAdapter(Partial<AzureCommunicationCallAdapterArgs>, (adapter: CallAdapter) => Promise<CallAdapter>, (adapter: CallAdapter) => Promise<void>)
A custom React hook to simplify the creation of CallAdapter.
Similar to createAzureCommunicationCallAdapter, but takes care of asynchronous creation of the adapter internally.
Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments as they are created. The adapter is only created when all arguments are defined.
Note that you must memoize the arguments to avoid recreating adapter on each render. See storybook for typical usage examples.
function useAzureCommunicationCallAdapter(args: Partial<AzureCommunicationCallAdapterArgs>, afterCreate?: (adapter: CallAdapter) => Promise<CallAdapter>, beforeDispose?: (adapter: CallAdapter) => Promise<void>): undefined | CallAdapter
Parameters
- args
-
Partial<AzureCommunicationCallAdapterArgs>
- afterCreate
-
(adapter: CallAdapter) => Promise<CallAdapter>
- beforeDispose
-
(adapter: CallAdapter) => Promise<void>
Returns
undefined | CallAdapter
useAzureCommunicationCallWithChatAdapter(Partial<AzureCommunicationCallWithChatAdapterArgs>, (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>, (adapter: CallWithChatAdapter) => Promise<void>)
A custom React hook to simplify the creation of CallWithChatAdapter.
Similar to createAzureCommunicationCallWithChatAdapter, but takes care of asynchronous creation of the adapter internally.
Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments as they are created. The adapter is only created when all arguments are defined.
Note that you must memoize the arguments to avoid recreating adapter on each render. See storybook for typical usage examples.
function useAzureCommunicationCallWithChatAdapter(args: Partial<AzureCommunicationCallWithChatAdapterArgs>, afterCreate?: (adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>, beforeDispose?: (adapter: CallWithChatAdapter) => Promise<void>): undefined | CallWithChatAdapter
Parameters
- args
- afterCreate
-
(adapter: CallWithChatAdapter) => Promise<CallWithChatAdapter>
- beforeDispose
-
(adapter: CallWithChatAdapter) => Promise<void>
Returns
undefined | CallWithChatAdapter
useAzureCommunicationChatAdapter(Partial<AzureCommunicationChatAdapterArgs>, (adapter: ChatAdapter) => Promise<ChatAdapter>, (adapter: ChatAdapter) => Promise<void>)
A custom React hook to simplify the creation of ChatAdapter.
Similar to createAzureCommunicationChatAdapter, but takes care of asynchronous creation of the adapter internally.
Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments as they are created. The adapter is only created when all arguments are defined.
Note that you must memoize the arguments to avoid recreating adapter on each render. See storybook for typical usage examples.
function useAzureCommunicationChatAdapter(args: Partial<AzureCommunicationChatAdapterArgs>, afterCreate?: (adapter: ChatAdapter) => Promise<ChatAdapter>, beforeDispose?: (adapter: ChatAdapter) => Promise<void>): undefined | ChatAdapter
Parameters
- args
-
Partial<AzureCommunicationChatAdapterArgs>
- afterCreate
-
(adapter: ChatAdapter) => Promise<ChatAdapter>
- beforeDispose
-
(adapter: ChatAdapter) => Promise<void>
Returns
undefined | ChatAdapter
useCall()
Hook to obtain <xref:%40azure%2Fcommunication-calling%23Call> from the provider.
Useful when implementing a custom component that utilizes the providers exported from this library.
you must have previously used the CallProvider with a Call object to use this hook
function useCall(): undefined | Call
Returns
undefined | Call
useCallAgent()
Hook to obtain <xref:%40azure%2Fcommunication-calling%23CallAgent> from the provider.
Useful when implementing a custom component that utilizes the providers exported from this library.
function useCallAgent(): undefined | CallAgent
Returns
undefined | CallAgent
useCallClient()
Hook to obtain StatefulCallClient from the provider.
Useful when implementing a custom component that utilizes the providers exported from this library.
function useCallClient(): StatefulCallClient
Returns
useChatClient()
Hook to obtain StatefulChatClient from the provider.
Useful when implementing a custom component that utilizes the providers exported from this library.
function useChatClient(): StatefulChatClient
Returns
useChatThreadClient()
Hook to obtain <xref:%40azure%2Fcommunication-chat%23ChatThreadClient> from the provider.
Useful when implementing a custom component that utilizes the providers exported from this library.
function useChatThreadClient(): ChatThreadClient
Returns
useDeviceManager()
Hook to obtain StatefulDeviceManager from the provider.
Useful when implementing a custom component that utilizes the providers exported from this library.
function useDeviceManager(): undefined | StatefulDeviceManager
Returns
undefined | StatefulDeviceManager
usePropsFor<Component>(Component, "chat" | "calling")
Primary hook to get all hooks necessary for a React Component from this library.
To call this hook, the component requires to be wrapped under these providers:
For chat components: ChatClientProvider and ChatThreadClientProvider.
For calling components: CallClientProvider, CallAgentProvider and CallAgentProvider.
Most straightforward usage of a components looks like:
Example
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>
Parameters
- component
-
Component
- type
-
"chat" | "calling"
Returns
ComponentProps<Component>
useSelector<ParamT>(ParamT, (ParamT extends Selector ? Parameters<ParamT>[1] : undefined), "chat" | "calling")
Hook to obtain a selector for a specified component.
Useful when implementing a custom component that utilizes the providers exported from this library.
function useSelector<ParamT>(selector: ParamT, selectorProps?: (ParamT extends Selector ? Parameters<ParamT>[1] : undefined), type?: "chat" | "calling"): (ParamT extends Selector ? ReturnType<ParamT> : undefined)
Parameters
- selector
-
ParamT
- selectorProps
-
(ParamT extends Selector ? Parameters<ParamT>[1] : undefined)
- type
-
"chat" | "calling"
Returns
(ParamT extends Selector ? ReturnType<ParamT> : undefined)
useTheme()
React hook to access theme
function useTheme(): Theme
Returns
Theme