UNPKG

@cometchat/chat-uikit-react-native

Version:

Ready-to-use Chat UI Components for React Native

71 lines (70 loc) 2.44 kB
import { CometChat } from "@cometchat/chat-sdk-react-native"; import { JSX } from "react"; import { OutgoingCallStyle } from "./styles"; import { DeepPartial } from "../../shared/helper/types"; declare const CometChatCalls: any; /** * Props for the CometChatOutgoingCall component. * * @interface CometChatOutgoingCallInterface */ export interface CometChatOutgoingCallInterface { /** * The outgoing call object, can be a CometChat.Call or CometChat.CustomMessage. */ call?: CometChat.Call | CometChat.CustomMessage | any; /** * Action to be performed on click of the cancel/reject button. * Provides the CometChat.Call object as argument. */ onEndCallButtonPressed?: (call: CometChat.Call) => void; /** * Flag to disable sound for the call. */ disableSoundForCalls?: boolean; /** * Custom sound for the call. */ customSoundForCalls?: string; /** * Custom call settings builder instance. */ callSettingsBuilder?: typeof CometChatCalls.CallSettingsBuilder; /** * Custom style overrides for the outgoing call component. */ style?: DeepPartial<OutgoingCallStyle>; /** * Custom view for the title section. */ TitleView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element; /** * Custom view for the subtitle section. */ SubtitleView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element; /** * Custom view for the avatar section. */ AvatarView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element; /** * Custom view for the end call button. */ EndCallView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element; /** * Callback fired when an error occurs. * @param {CometChat.CometChatException} error - The error object. */ onError?: (error: CometChat.CometChatException) => void; } /** * CometChatOutgoingCall component. * * This component handles the UI for an outgoing call by playing sound, * rendering call details and providing an end call action. It listens to call events * to update the UI based on the call's state. * * @param {CometChatOutgoingCallInterface} props - Component configuration props. * @returns {JSX.Element} The rendered outgoing call UI. */ export declare const CometChatOutgoingCall: (props: CometChatOutgoingCallInterface) => JSX.Element; export {};