UNPKG

@cometchat/chat-uikit-react-native

Version:

Ready-to-use Chat UI Components for React Native

54 lines (53 loc) 1.99 kB
import { CometChat } from "@cometchat/chat-sdk-react-native"; import { IconName } from "../shared/icons/Icon"; export declare class CallUtils { /** * Checks if the given initiator is the same as the logged in user. * * @param initiator - The call initiator. * @param loggedInUser - The logged in user. * @returns True if the initiator is the logged in user. */ private static isInitiator; /** * Retrieves the call status along with an appropriate icon. * * @param message - The call message. * @param loggedInUser - The logged in user. * @returns An object containing callMessageText and selectedIcon. */ static getCallStatus(message: CometChat.BaseMessage, loggedInUser: CometChat.User): { callMessageText: string; selectedIcon: IconName; }; /** * Determines if the given call is a missed call. * * @param call - The call object. * @param loggedInUser - The logged in user. * @returns True if it's a missed call. */ static isMissedCall(call: CometChat.Call, loggedInUser: CometChat.User): boolean; /** * Returns a call status string for displaying in call logs. * * @param call - The call object. * @param loggedInUser - The logged in user. * @returns "outgoing", "incoming", or "missed". */ static getCallStatusForCallLogs(call: CometChat.Call, loggedInUser: CometChat.User): "outgoing" | "incoming" | "missed"; /** * Converts minutes to a formatted string (hours, minutes, seconds). * * @param minutes - The time in minutes. * @returns A formatted string. */ static convertMinutesToHoursMinutesSeconds(minutes: number): string; /** * Converts seconds to a formatted string (hours, minutes, seconds). * * @param seconds - The time in seconds. * @returns A formatted string. */ static convertSecondsToHoursMinutesSeconds(seconds: number): string; }