UNPKG

communication-react-19

Version:

React library for building modern communication user experiences utilizing Azure Communication Services (React 19 compatible fork)

69 lines 4.88 kB
/// <reference types="react" /> import { CameraButton, EndCallButton, ErrorBar, MicrophoneButton, DevicesButton, ParticipantList, ScreenShareButton, VideoGallery, CaptionsSettingsModal, CaptionsBanner, StartCaptionsButton } from "../../../react-components/src"; import { IncomingCallStack } from "../../../react-components/src"; import { NotificationStack } from "../../../react-components/src"; import { Dialpad } from "../../../react-components/src"; import { HoldButton } from "../../../react-components/src"; import { RaiseHandButton } from "../../../react-components/src"; import { RaiseHandButtonSelector } from '../callControlSelectors'; import { CameraButtonSelector, MicrophoneButtonSelector, DevicesButtonSelector, ScreenShareButtonSelector } from '../callControlSelectors'; import { HoldButtonSelector } from '../callControlSelectors'; import { VideoGallerySelector } from '../videoGallerySelector'; import { ParticipantListSelector } from '../participantListSelector'; import { ParticipantsButtonSelector } from '../participantsButtonSelector'; import { Common } from "../../../acs-ui-common/src"; import { AreEqual } from "../../../acs-ui-common/src"; import { ParticipantsButton } from "../../../react-components/src"; import { ErrorBarSelector } from '../errorBarSelector'; import { CommonCallingHandlers } from '../handlers/createCommonHandlers'; import { ReactionButton } from "../../../react-components/src"; import { _ComponentCallingHandlers } from '../handlers/createHandlers'; import { NotificationStackSelector } from '../notificationStackSelector'; import { IncomingCallStackSelector } from '../incomingCallStackSelector'; import { CaptionSettingsSelector, CaptionsBannerSelector, StartCaptionsButtonSelector } from '../captionsSelector'; /** * Primary hook to get all hooks necessary for a calling Component. * * Most straightforward usage of calling components looks like: * * @example * ``` * import { ParticipantList, usePropsFor } from '@azure/communication-react'; * * const App = (): JSX.Element => { * // ... code to setup Providers ... * * return <ParticipantList {...usePropsFor(ParticipantList)}/> * } * ``` * * @public */ export declare const usePropsFor: <Component extends (props: any) => JSX.Element>(component: Component) => GetSelector<Component> extends (props: any) => any ? ReturnType<GetSelector<Component>> & Common<CommonCallingHandlers & _ComponentCallingHandlers, Parameters<Component>[0]> : undefined; /** * A type for trivial selectors that return no data. * * Used as a default return value if {@link usePropsFor} is called for a component that requires no data. * * @public */ export type EmptySelector = () => Record<string, never>; /** * Specific type of the selector applicable to a given Component. * * @public */ export type GetSelector<Component extends (props: any) => JSX.Element | undefined> = AreEqual<Component, typeof VideoGallery> extends true ? VideoGallerySelector : AreEqual<Component, typeof DevicesButton> extends true ? DevicesButtonSelector : AreEqual<Component, typeof MicrophoneButton> extends true ? MicrophoneButtonSelector : AreEqual<Component, typeof CameraButton> extends true ? CameraButtonSelector : AreEqual<Component, typeof ScreenShareButton> extends true ? ScreenShareButtonSelector : AreEqual<Component, typeof ParticipantList> extends true ? ParticipantListSelector : AreEqual<Component, typeof ParticipantsButton> extends true ? ParticipantsButtonSelector : AreEqual<Component, typeof EndCallButton> extends true ? EmptySelector : AreEqual<Component, typeof ErrorBar> extends true ? ErrorBarSelector : AreEqual<Component, typeof Dialpad> extends true ? EmptySelector : AreEqual<Component, typeof HoldButton> extends true ? HoldButtonSelector : AreEqual<Component, typeof NotificationStack> extends true ? NotificationStackSelector : AreEqual<Component, typeof IncomingCallStack> extends true ? IncomingCallStackSelector : AreEqual<Component, typeof ReactionButton> extends true ? RaiseHandButtonSelector : AreEqual<Component, typeof CaptionsSettingsModal> extends true ? CaptionSettingsSelector : AreEqual<Component, typeof CaptionsBanner> extends true ? CaptionsBannerSelector : AreEqual<Component, typeof StartCaptionsButton> extends true ? StartCaptionsButtonSelector : AreEqual<Component, typeof RaiseHandButton> extends true ? EmptySelector : undefined; /** * Get the selector for a specified component. * * Useful when implementing a custom component that utilizes the providers * exported from this library. * * @public */ export declare const getSelector: <Component extends (props: any) => JSX.Element | undefined>(component: Component) => GetSelector<Component>; /** * Selector for new components that are conditionally compiled. Comment out when there is no CC'd components */ //# sourceMappingURL=usePropsFor.d.ts.map