@cometchat/chat-uikit-react-native
Version:
Ready-to-use Chat UI Components for React Native
51 lines (50 loc) • 2.5 kB
TypeScript
import { CometChat } from "@cometchat/chat-sdk-react-native";
import { IncomingCallStyle } from "./style";
import { DeepPartial } from "../../shared/helper/types";
import { JSX } from "react";
declare const CometChatCalls: any;
/**
* Props for the CometChatIncomingCall component.
*
* @interface CometChatIncomingCallInterface
*/
export interface CometChatIncomingCallInterface {
/** The incoming call object, which can be a Call or a CustomMessage */
call: CometChat.Call | CometChat.CustomMessage | any;
/** Custom view for the entire call item */
ItemView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element;
/** Custom view for the title section of the call item */
TitleView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element;
/** Custom view for the subtitle section of the call item */
SubtitleView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element;
/** Custom view for the leading section of the call item */
LeadingView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element;
/** Custom view for the trailing section of the call item */
TrailingView?: (call: CometChat.Call | CometChat.CustomMessage) => JSX.Element;
/** Flag to disable sound for incoming calls */
disableSoundForCalls?: boolean;
/** Path or identifier for a custom sound to play for incoming calls */
customSoundForCalls?: string;
/** Callback fired when the call is accepted */
onAccept?: (message: CometChat.BaseMessage) => void;
/** Callback fired when the call is declined */
onDecline: (message: CometChat.BaseMessage) => void;
/** Callback fired when an error occurs */
onError?: (e: CometChat.CometChatException) => void;
/** Optional custom call settings builder */
callSettingsBuilder?: typeof CometChatCalls.CallSettingsBuilder;
/** Custom style overrides for the incoming call component */
style?: DeepPartial<IncomingCallStyle>;
}
/**
* CometChatIncomingCall component.
*
* This component handles incoming calls by playing a sound, offering accept/decline buttons,
* and showing an ongoing call screen if accepted. Custom views for various parts of the call UI
* can be provided via props.
*
* @param {CometChatIncomingCallInterface} props - Component configuration props.
* @returns {JSX.Element} The rendered incoming call UI.
*/
export declare const CometChatIncomingCall: (props: CometChatIncomingCallInterface) => JSX.Element;
export {};