@cometchat/chat-sdk-react-native
Version:
A complete chat solution.
1,331 lines (1,234 loc) • 208 kB
TypeScript
import * as React from 'react';
export namespace CometChatNotifications{
/**
* Function to get preferences set for the logged-in user.
* @returns {Promise<PushPreferences>}
* @memberof CometChatNotifications
* @deprecated
*
* This method is deprecated as of version 4.0.10 due to newer method 'fetchPreferences'. It will be removed in subsequent versions.
*/
export function fetchPushPreferences(): Promise<PushPreferences>;
/**
* Function to get preferences set for the logged-in user.
* @returns {Promise<NotificationPreferences>}
* @memberof CometChatNotifications
*/
export function fetchPreferences(): Promise<NotificationPreferences>;
/**
* Function to update preferences for the logged-in user.
* @param {PushPreferences} pushPreferences
* @returns {Promise<PushPreferences>}
* @memberof CometChatNotifications
* @deprecated
*
* This method is deprecated as of version 4.0.10 due to newer method 'updatePreferences'. It will be removed in subsequent versions.
*/
export function updatePushPreferences(pushPreferences: PushPreferences): Promise<PushPreferences>;
/**
* Function to update preferences for the logged-in user.
* @param {NotificationPreferences} notificationPreferences
* @returns {Promise<NotificationPreferences>}
* @memberof CometChatNotifications
*/
export function updatePreferences(notificationPreferences: NotificationPreferences): Promise<NotificationPreferences>;
/**
* Function to reset preferences for the logged-in user.
* @returns {Promise<PushPreferences>}
* @memberof CometChatNotifications
* @deprecated
*
* This method is deprecated as of version 4.0.10 due to newer method 'resetPreferences'. It will be removed in subsequent versions.
*/
export function resetPushPreferences(): Promise<PushPreferences>;
/**
* Function to reset preferences for the logged-in user.
* @returns {Promise<NotificationPreferences>}
* @memberof CometChatNotifications
*/
export function resetPreferences(): Promise<NotificationPreferences>;
/**
* Function to register push token for the current authToken of the logged-in user.
* @returns {Promise<string>}
* @param {string} pushToken
* @param {PushPlatforms} platform
* @param {string} providerId - Optional, default value is `default`.
* @memberof CometChatNotifications
*/
export function registerPushToken(pushToken: string, platform: PushPlatforms, providerId?: string): Promise<string>;
/**
* Function to unregister push token registered for the current authToken of the logged-in user.
* @returns {Promise<string>}
* @memberof CometChatNotifications
*/
export function unregisterPushToken(): Promise<string>;
/**
* Function to mute conversations for the logged-in user.
* @returns {Promise<string>}
* @param {MutedConversation[]} mutedConversations
* @memberof CometChatNotifications
*/
export function muteConversations(mutedConversations: MutedConversation[]): Promise<string>;
/**
* Function to unmute conversations for the logged-in user.
* @returns {Promise<string>}
* @param {UnmutedConversation[]} unmutedConversations
* @memberof CometChatNotifications
*/
export function unmuteConversations(unmutedConversations: UnmutedConversation[]): Promise<string>;
/**
* Function to retrieve list of muted conversations for the logged-in user.
* @returns {Promise<MutedConversation[]>}
* @memberof CometChatNotifications
*/
export function getMutedConversations(): Promise<MutedConversation[]>;
/**
* Function to update timezone for the logged-in user.
* @returns {Promise<string>}
* @param {string} timezone
* @memberof CometChatNotifications
*/
export function updateTimezone(timezone: String): Promise<string>;
/**
* Function to get timezone for the logged-in user.
* @returns {Promise<{timezone: string} | string>} A promise that resolves to an object containing the timezone or a string in case of an error.
* @memberof CometChatNotifications
*/
export function getTimezone(): Promise<
| {
timezone: string;
}
| string
>;
export enum MessagesOptions {
DONT_SUBSCRIBE,
SUBSCRIBE_TO_ALL,
SUBSCRIBE_TO_MENTIONS
}
export enum RepliesOptions {
DONT_SUBSCRIBE,
SUBSCRIBE_TO_ALL,
SUBSCRIBE_TO_MENTIONS
}
export enum ReactionsOptions {
DONT_SUBSCRIBE,
SUBSCRIBE_TO_REACTIONS_ON_OWN_MESSAGES,
SUBSCRIBE_TO_REACTIONS_ON_ALL_MESSAGES
}
export enum MemberActionsOptions {
DONT_SUBSCRIBE,
SUBSCRIBE
}
export enum DNDOptions {
DISABLED,
ENABLED
}
export enum DayOfWeek {
MONDAY = "monday",
TUESDAY = "tuesday",
WEDNESDAY = "wednesday",
THURSDAY = "thursday",
FRIDAY = "friday",
SATURDAY = "saturday",
SUNDAY = "sunday"
}
export enum MutedConversationType {
ONE_ON_ONE = "oneOnOne",
GROUP = "group"
}
export enum PushPlatforms {
FCM_REACT_NATIVE_ANDROID = "fcm_react_native_android",
FCM_REACT_NATIVE_IOS = "fcm_react_native_ios",
APNS_REACT_NATIVE_DEVICE = "apns_react_native_device",
APNS_REACT_NATIVE_VOIP = "apns_react_native_voip"
}
export const APIConstants: {
KEY_GROUP_PREFERENCES: string;
KEY_GROUP_MESSAGES: string;
KEY_GROUP_REACTIONS: string;
KEY_GROUP_REPLIES: string;
KEY_GROUP_MEMBER_ADDED: string;
KEY_GROUP_MEMBER_LEFT: string;
KEY_GROUP_MEMBER_JOINED: string;
KEY_GROUP_MEMBER_KICKED: string;
KEY_GROUP_MEMBER_BANNED: string;
KEY_GROUP_MEMBER_UNBANNED: string;
KEY_GROUP_MEMBER_SCOPE_CHANGED: string;
KEY_MUTE_PREFERENCES: string;
KEY_MUTE_DND: string;
KEY_MUTE_SCHEDULE: string;
KEY_ONE_ON_ONE_PREFERENCES: string;
KEY_ONE_ON_ONE_MESSAGES: string;
KEY_ONE_ON_ONE_REACTIONS: string;
KEY_ONE_ON_ONE_REPLIES: string;
KEY_USE_PRIVACY_TEMPLATE: string;
KEY_PROVIDER_ID: string;
KEY_TIMEZONE: string;
KEY_PLATFORM: string;
KEY_FCM_TOKEN: string;
KEY_CONVERSATIONS: string;
KEY_GET_PREFERENCES: string;
KEY_UPDATE_PREFERENCES: string;
KEY_RESET_PREFERENCES: string;
KEY_REGISTER_TOKEN: string;
KEY_UNREGISTER_TOKEN: string;
KEY_MUTE_CONVERSATIONS: string;
KEY_UNMUTE_CONVERSATIONS: string;
KEY_GET_MUTED_CONVERSATIONS: string;
KEY_MUTED_CONVERSATIONS: string;
KEY_FROM: string;
KEY_TO: string;
KEY_GET_TIMEZONE: string;
KEY_UPDATE_TIMEZONE: string;
};
export const APIResponseConstants: {
TOKEN_REGISTER_SUCCESS: string;
TOKEN_REGISTER_ERROR: string;
TOKEN_UNREGISTER_SUCCESS: string;
TOKEN_UNREGISTER_ERROR: string;
MUTE_CONVERSATION_SUCCESS: string;
MUTE_CONVERSATION_ERROR: string;
UNMUTE_CONVERSATION_SUCCESS: string;
UNMUTE_CONVERSATION_ERROR: string;
TIMEZONE_UPDATE_SUCCESS: string;
TIMEZONE_UPDATE_ERROR: string;
TIMEZONE_FETCH_ERROR: string;
};
export const DEFAULT_PROVIDER_ID = "default";
export class DaySchedule {
constructor(from: number, to: number, dnd: boolean);
/**
* Get the from value of Day Schedule.
* @returns {number}
*/
getFrom(): number;
/**
* @param {number} from
* Set the from value of Day Schedule.
*/
setFrom(from: number): void;
/**
* Get the to value of Day Schedule.
* @returns {number}
*/
getTo(): number;
/**
* @param {number} to
* Set the to value of Day Schedule.
*/
setTo(to: number): void;
/**
* Get the value of DND of Day Schedule.
* @returns {boolean}
*/
getDND(): boolean;
/**
* @param {boolean} dnd
* Set the value of DND of Day Schedule.
*/
setDND(dnd: boolean): void;
}
/**
*
* @module GroupPreferences
*/
export class GroupPreferences {
/**
* Get the messages preferences for groups.
* @returns {MessagesOptions}
*/
getMessagesPreference(): MessagesOptions;
/**
* Get the replies preferences for groups.
* @returns {RepliesOptions}
*/
getRepliesPreference(): RepliesOptions;
/**
* Get the reactions preferences for groups.
* @returns {ReactionsOptions}
*/
getReactionsPreference(): ReactionsOptions;
/**
* Get the member left preferences for groups.
* @returns {MemberActionsOptions}
*/
getMemberLeftPreference(): MemberActionsOptions;
/**
* Get the member added preferences for groups.
* @returns {MemberActionsOptions}
*/
getMemberAddedPreference(): MemberActionsOptions;
/**
* Get the member joined preferences for groups.
* @returns {MemberActionsOptions}
*/
getMemberJoinedPreference(): MemberActionsOptions;
/**
* Get the member kicked preferences for groups.
* @returns {MemberActionsOptions}
*/
getMemberKickedPreference(): MemberActionsOptions;
/**
* Get the member banned preferences for groups.
* @returns {MemberActionsOptions}
*/
getMemberBannedPreference(): MemberActionsOptions;
/**
* Get the member unbanned preferences for groups.
* @returns {MemberActionsOptions}
*/
getMemberUnbannedPreference(): MemberActionsOptions;
/**
* Get the member scope change preferences for groups.
* @returns {MemberActionsOptions}
*/
getMemberScopeChangedPreference(): MemberActionsOptions;
/**
* @param {MessagesOptions} messagesPreference
* Set messages preference for groups.
*/
setMessagesPreference(messagesPreference: MessagesOptions): void;
/**
* @param {RepliesOptions} repliesPreference
* Set replies preference for groups.
*/
setRepliesPreference(repliesPreference: RepliesOptions): void;
/**
* @param {ReactionsOptions} reactionsPreference
* Set reactions preference for groups.
*/
setReactionsPreference(reactionsPreference: ReactionsOptions): void;
/**
* @param {MemberActionsOptions} memberLeftPreference
* Set member left preference for groups.
*/
setMemberLeftPreference(memberLeftPreference: MemberActionsOptions): void;
/**
* @param {MemberActionsOptions} memberAddedPreference
* Set member added preference for groups.
*/
setMemberAddedPreference(memberAddedPreference: MemberActionsOptions): void;
/**
* @param {MemberActionsOptions} memberJoinedPreference
* Set member joined preference for groups.
*/
setMemberJoinedPreference(memberJoinedPreference: MemberActionsOptions): void;
/**
* @param {MemberActionsOptions} memberKickedPreference
* Set member kicked preference for groups.
*/
setMemberKickedPreference(memberKickedPreference: MemberActionsOptions): void;
/**
* @param {MemberActionsOptions} memberBannedPreference
* Set member banned preference for groups.
*/
setMemberBannedPreference(memberBannedPreference: MemberActionsOptions): void;
/**
* @param {MemberActionsOptions} memberUnbannedPreference
* Set member unbanned preference for groups.
*/
setMemberUnbannedPreference(memberUnbannedPreference: MemberActionsOptions): void;
/**
* @param {MemberActionsOptions} memberScopeChangedPreference
* Set member scope change preference for groups.
*/
setMemberScopeChangedPreference(memberScopeChangedPreference: MemberActionsOptions): void;
/**
* @param {Object} jsonData
* Convert JSON object to GroupPreferences.
*/
static fromJSON(jsonData: Object): GroupPreferences;
}
export class MutedConversation {
/**
* Get the id of muted conversation
* @returns {string}
*/
getId(): string;
/**
* Set the id of muted conversation
* @param {string} id
*/
setId(id: string): void;
/**
* Get the conversation type of muted conversation.
* @returns {ConversationsType}
*/
getType(): ConversationsType;
/**
* Set the conversation type of muted conversation.
* @param {ConversationsType} type
*/
setType(type: ConversationsType): void;
/**
* Get the date until which the conversation should be muted.
* @returns {number}
*/
getUntil(): number;
/**
* Set the date until which the conversation should be muted.
* @param {number} until
*/
setUntil(until: number): void;
}
export class MutePreferences {
/**
* Get the DND preferences.
* @returns {DNDOptions}
*/
getDNDPreference(): DNDOptions;
/**
* @param {DNDOptions} dndPreferences
* Set DND preferences.
*/
setDNDPreference(dndPreferences: DNDOptions): void;
/**
* Get the schedule preferences.
* @returns {Map<DayOfWeek, DaySchedule>}
*/
getSchedulePreference(): Map<DayOfWeek, DaySchedule>;
/**
* @param {Map<DayOfWeek, DaySchedule>} schedule
* Set the schedule preferences.
*/
setSchedulePreference(schedule: Map<DayOfWeek, DaySchedule>): void;
/**
* Get the schedule for a day.
* @returns {DaySchedule}
*/
getScheduleFor(day: DayOfWeek): DaySchedule;
/**
* @param {DayOfWeek} day
* @param {DaySchedule} schedule
* Set the schedule for a day.
*/
setScheduleFor(day: DayOfWeek, schedule: DaySchedule): void;
/**
* @param {Object} jsonData
* Convert JSON object to MutePreferences.
*/
static fromJSON(jsonData: Object): MutePreferences;
}
export class OneOnOnePreferences {
/**
* Get the reactions preferences for groups.
* @returns {ReactionsOptions}
*/
getReactionsPreference(): ReactionsOptions;
/**
* @param {ReactionsOptions} reactionsPreference
* Set reactions preference for groups.
*/
setReactionsPreference(reactionsPreference: ReactionsOptions): void;
/**
* Get the replies preferences for groups.
* @returns {RepliesOptions}
*/
getRepliesPreference(): RepliesOptions;
/**
* @param {RepliesOptions} repliesPreference
* Set replies preference for groups.
*/
setRepliesPreference(repliesPreference: RepliesOptions): void;
/**
* Get the messages preferences for groups.
* @returns {MessagesOptions}
*/
getMessagesPreference(): MessagesOptions;
/**
* @param {MessagesOptions} messagesPreference
* Set messages preference for groups.
*/
setMessagesPreference(messagesPreference: MessagesOptions): void;
/**
* @param {Object} jsonData
* Convert JSON object to OneOnOnePreferences.
*/
static fromJSON(jsonData: Object): OneOnOnePreferences;
}
/**
* @deprecated This class is deprecated as of version 4.0.10 due to newer class 'NotificationPreferences'.
* It will be removed in subsequent versions.
*/
export class PushPreferences {
/**
* Get the OneOnOne preferences.
* @returns {OneOnOnePreferences}
*/
getOneOnOnePreferences(): OneOnOnePreferences;
/**
* @param {OneOnOnePreferences} oneOnOnePreferences
* Set the OneOnOne preferences.
*/
setOneOnOnePreferences(oneOnOnePreferences: OneOnOnePreferences): void;
/**
* Get the Muted preferences.
* @returns {MutePreferences}
*/
getMutePreferences(): MutePreferences;
/**
* @param {MutePreferences} mutePreferences
* Set the Mute preferences.
*/
setMutePreferences(mutePreferences: MutePreferences): void;
/**
* Get the Group preferences.
* @returns {GroupPreferences}
*/
getGroupPreferences(): GroupPreferences;
/**
* @param {GroupPreferences} groupPreferences
* Set the Group preferences.
*/
setGroupPreferences(groupPreferences: GroupPreferences): void;
/**
* Returns whether to use privacy template or not.
* @returns {boolean}
*/
getUsePrivacyTemplate(): boolean;
/**
* @param {boolean} usePrivacyTemplate
* Set whether to use privacy template or not.
*/
setUsePrivacyTemplate(usePrivacyTemplate: boolean): void;
/**
* @param {Object} jsonData
* Convert JSON object to PushPreferences.
*/
static fromJSON(jsonData: Object): PushPreferences;
}
export class NotificationPreferences {
/**
* Get the OneOnOne preferences.
* @returns {OneOnOnePreferences}
*/
getOneOnOnePreferences(): OneOnOnePreferences;
/**
* @param {OneOnOnePreferences} oneOnOnePreferences
* Set the OneOnOne preferences.
*/
setOneOnOnePreferences(oneOnOnePreferences: OneOnOnePreferences): void;
/**
* Get the Muted preferences.
* @returns {MutePreferences}
*/
getMutePreferences(): MutePreferences;
/**
* @param {MutePreferences} mutePreferences
* Set the Mute preferences.
*/
setMutePreferences(mutePreferences: MutePreferences): void;
/**
* Get the Group preferences.
* @returns {GroupPreferences}
*/
getGroupPreferences(): GroupPreferences;
/**
* @param {GroupPreferences} groupPreferences
* Set the Group preferences.
*/
setGroupPreferences(groupPreferences: GroupPreferences): void;
/**
* Returns whether to use privacy template or not.
* @returns {boolean}
*/
getUsePrivacyTemplate(): boolean;
/**
* @param {boolean} usePrivacyTemplate
* Set whether to use privacy template or not.
*/
setUsePrivacyTemplate(usePrivacyTemplate: boolean): void;
/**
* @param {Object} jsonData
* Convert JSON object to NotificationPreferences.
*/
static fromJSON(jsonData: Object): NotificationPreferences;
}
export class UnmutedConversation {
/**
* Get the id of unmuted conversation
* @returns {string}
*/
getId(): string;
/**
* Set the id of unmuted conversation
* @param {string} id
*/
setId(id: string): void;
/**
* Get the conversation type of unmuted conversation.
* @returns {ConversationsType}
*/
getType(): ConversationsType;
/**
* Set the conversation type of unmuted conversation.
* @param {ConversationsType} type
*/
setType(type: ConversationsType): void;
}
}
export namespace CometChat {
let USER_STATUS: {
ONLINE: string;
OFFLINE: string;
};
let MESSAGE_TYPE: {
TEXT: string;
MEDIA: string;
IMAGE: string;
VIDEO: string;
AUDIO: string;
FILE: string;
CUSTOM: string;
};
let CATEGORY_MESSAGE: string;
let CATEGORY_ACTION: string;
let CATEGORY_CALL: string;
let CATEGORY_CUSTOM: string;
let CATEGORY_INTERACTIVE: string;
let ACTION_TYPE: {
MEMBER_ADDED: string;
MEMBER_JOINED: string;
MEMBER_LEFT: string;
MEMBER_KICKED: string;
MEMBER_BANNED: string;
MEMBER_UNBANNED: string;
MEMBER_INVITED: string;
MEMBER_SCOPE_CHANGED: string;
MESSAGE_EDITED: string;
MESSSAGE_DELETED: string;
TYPE_USER: string;
TYPE_GROUP: string;
TYPE_GROUP_MEMBER: string;
};
let CALL_MODE: {
DEFAULT: string,
SPOTLIGHT: string,
SINGLE: string,
};
let AUDIO_MODE: {
SPEAKER: string,
EARPIECE: string,
BLUETOOTH: string,
HEADPHONES: string
};
let CALL_TYPE: {
AUDIO: string;
VIDEO: string;
};
let RECEIVER_TYPE: {
USER: string;
GROUP: string;
};
let CALL_STATUS: {
INITIATED: string;
ONGOING: string;
UNANSWERED: string;
REJECTED: string;
BUSY: string;
CANCELLED: string;
ENDED: string;
};
let SORT_BY: {
NAME: string;
STATUS: string;
}
let SORT_ORDER: {
ASCENDING: string;
DESCENDING: string;
}
let appSettings: AppSettings;
/**
* Getter for appId.
* @internal
* @returns
* @memberof CometChat
*/
export function getAppId(): string;
/**
* Getter for apiKey.
* @internal
* @returns
* @memberof CometChat
*/
export function getApiKey(): string;
/**------------------------------------*
* Core apis *
*-------------------------------------**/
/**
* Initialize the CometChat app with appId & Object of AppSettings Class.
* @param {string} appId
* @param {AppSettings} appSettings
* @returns {CometChat}
* @memberof CometChat
*/
export function init(appId: any, appSettings: AppSettings): Promise<boolean>;
/**
* Function to check whether CometChat class initialized before.
* @returns {boolean}
* @memberof CometChat
*/
export function isInitialized(): boolean;
/**
* Function to register the FCM token for Push Notification.
* @param {string} token
* @param {JSON Object} Settings
* @returns {Promise<string>}
* @memberof CometChat
*/
export function registerTokenForPushNotification(token: string, settings?: {}): Promise<string>;
/**
* Login funtion will authenticate user provided as an argument. There are two ways to login:
* 1. using UID and authKey (unsecure way)
* 2. using authToken (secure way)
* @param {...string[]} args
* @returns {User | CometChatException}
* @memberof CometChat
*/
export function login(...args: any): Promise<User>;
/**-------------------------------------------------------------------*
* Message related functions provided by CometChat class *
*--------------------------------------------------------------------**/
/**
* Function to send message.
* @param {TextMessage | MediaMessage | CustomMessage | InteractiveMessage |any} message
* @returns {Message | any}
* @memberof CometChat
*/
export function sendMessage(message: TextMessage | MediaMessage | CustomMessage | InteractiveMessage |any): Promise<TextMessage | MediaMessage | CustomMessage | InteractiveMessage | BaseMessage>;
/**
* Function to send a message to user.
* @internal
* @param {*} message Object
* @returns
* @memberof CometChat
*/
export function sendDirectMessage(message: Object): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
/**
* Function to send a message to group.
* @internal
* @param {*} message
* @returns
* @memberof CometChat
*/
export function sendGroupMessage(message: any): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
/**
* Function to send a media message.
* @param {MediaMessage} message
* @returns {Message | any}
* @memberof CometChat
*/
export function sendMediaMessage(message: Object): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
/**
* Function to send a custom message.
* @param {CustomMessage} message
* @returns {Message | any}
* @memberof CometChat
*/
export function sendCustomMessage(message: CustomMessage): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
/**
*
* Function to send a interactive message.
* @param {InteractiveMessage} message
* @returns {Message | any}
* @memberof CometChat
*/
export function sendInteractiveMessage(message: InteractiveMessage): Promise<TextMessage | BaseMessage | MediaMessage | CustomMessage>;
/**
* Function to get the last delivered message id from local storage.
* @returns {any}
* @memberof CometChat
*/
export function getLastDeliveredMessageId(): Promise<any>;
/**
* Function to send start typing notification to the provided uid/ guid.
* @param {TypingIndicator | any} typingNotification
* @memberof CometChat
*/
export function startTyping(typingNotification: TypingIndicator | any): void;
/**
* Function to send stop typing notification to the provided uid/ guid.
* @param {TypingIndicator | any} typingNotification
* @memberof CometChat
*/
export function endTyping(typingNotification: TypingIndicator | any): void;
/**
* Mark all messages upto a specified message id as read. There are two ways markAsRead works:
* 1. message
* 2. messageID, receiverID, receiverType, senderID
* @param {...string[]} args
* @memberof CometChat
*/
export function markAsRead(...args: any): any;
/**
* Mark all messages upto a specified message id as delivered. There are two ways markAsDelivered works:
* 1. message
* 2. messageID, receiverID, receiverType, senderID
* @param {...string[]} args
* @memberof CometChat
*/
export function markAsDelivered(...args: any): any;
/**
* Mark all the messages after the specified message id as unread.
* @param {TextMessage | MediaMessage | CustomMessage | BaseMessage | any} message
* @returns {Promise<string>}
* @memberof CometChat
**/
export function markAsUnread(message: TextMessage | MediaMessage | CustomMessage | any): Promise<string | CometChatException>;
/**
* Send a transient message.
* @param {string} uid
* @param {string} receiverType
* @memberof CometChat
*/
export function sendTransientMessage(transientMessage: TransientMessage): void;
/**
* Function to fetch message details for the provided messageID.
* @param {string | any} messageId
* @returns {Message | any}
* @memberof CometChat
*/
export function getMessageDetails(messageId: string | any): Promise<TextMessage | MediaMessage | CustomMessage | InteractiveMessage |BaseMessage>;
/**
* Function to fetch message receipt details for the provided messageID.
* @param {string | any} messageId
* @returns {MessageReceipt[]}
* @memberof CometChat
*/
export function getMessageReceipts(messageId: string | any): Promise<MessageReceipt[]>;
/**
* Function to fetch unread message count.
* @param {boolean} doHideMessages
* @returns {Object}
* @memberof CometChat
*/
export function getUnreadMessageCount(doHideMessages?: boolean): Promise<Object>;
/**
* Function to fetch unread message count for all users.
* @param {boolean} doHideMessages
* @returns {Object}
* @memberof CometChat
*/
export function getUnreadMessageCountForAllUsers(doHideMessages?: boolean): Promise<Object>;
/**
* Function to fetch unread message count for all groups.
* @param {boolean} doHideMessages
* @returns {Object}
* @memberof CometChat
*/
export function getUnreadMessageCountForAllGroups(doHideMessages?: boolean): Promise<Object>;
/**
* Function to fetch unread message count for a particular UID.
* @param {string} UID
* @param {boolean} doHideMessages
* @returns {Object}
* @memberof CometChat
*/
export function getUnreadMessageCountForUser(UID: string, doHideMessages?: boolean): Promise<Object>;
/**
* Function to fetch unread message count for a particular GUID.
* @param {string} GUID
* @param {boolean} doHideMessages
* @returns {Object}
* @memberof CometChat
*/
export function getUnreadMessageCountForGroup(GUID: string, doHideMessages?: boolean): Promise<Object>;
/**
* Function to add reaction for the provided messageID.
* @param {string | any} messageId
* @param {string} reaction
* @returns {Promise<Object>}
* @memberof CometChat
*/
export function addReaction(messageId: string | any, reaction: string): Promise<BaseMessage>;
/**
* Function to remove reaction for the provided messageID.
* @param {string | any} messageId
* @param {string} reaction
* @returns {Promise<Object>}
* @memberof CometChat
*/
export function removeReaction(messageId: string | any, reaction: string): Promise<BaseMessage>;
/**
* Funtion to edit a message.
* @param {BaseMessage} message
* @returns {Promise<BaseMessage>}
* @memberof CometChat
*/
export function editMessage(message: BaseMessage): Promise<BaseMessage>;
/**
* Funtion to delete a message.
* @param {string} messageId
* @returns {Promise<BaseMessage>}
* @memberof CometChat
*/
export function deleteMessage(messageId: string): Promise<BaseMessage>;
/**---------------------------------------------------------------------------------------*
* Online User/Group Member count related functions provided by CometChat class *
*----------------------------------------------------------------------------------------**/
/**
* This function will return online user count.
* @returns {Promise<number>}
* @memberof CometChat
*/
export function getOnlineUserCount(): Promise<number>;
/**
* This function will return online group members count for given GUIDs.
* @param {String[]} groups
* @returns {Promise<number>}
* @memberof CometChat
*/
export function getOnlineGroupMemberCount(groups: String[]): Promise<Object>;
/**-------------------------------------------------------------------*
* User related functions provided by CometChat class *
*--------------------------------------------------------------------**/
/**
* Function to create a user.
* @param {User | any} user
* @param {string} apiKey
* @returns {Promise<User>}
* @memberof CometChat
*/
export function createUser(user: User | any, apiKey: string): Promise<User>;
/**
*
* Function to update the already existing user and returns the result with updated user.
* @param {User | any} user
* @param {string} apiKey
* @returns {Promise<User>}
* @memberof CometChat
*/
export function updateUser(user: User | any, apiKey: string): Promise<User>;
/**
*
* Function to update the logged-in user and returns the result with updated user
* @param {User} user
* @returns Promise<User>
* @memberof CometChat
*/
export function updateCurrentUserDetails(user: User | any): Promise<User>;
/**
* Function to get the information for the uid provided as an argument
* @param {string} uid
* @returns {Promise<User>}
* @memberof CometChat
*/
export function getUser(uid: any): Promise<User>;
/**
*
* This function will return logged in user from local storage.
* @returns {Promise<User | null>}
* @memberof CometChat
*/
export function getLoggedinUser(): Promise<User | null>;
/**
* Function to block users.
* @param {String[]} blockedUids
* @returns
* @memberof CometChat
*/
export function blockUsers(blockedUids: String[]): Promise<Object>;
/**
* Function to unblock users.
* @param {String[]} blockedUids
* @returns
* @memberof CometChat
*/
export function unblockUsers(blockedUids: String[]): Promise<Object>;
/**-------------------------------------------------------------------*
* Conversation related functions provided by CometChat class *
*--------------------------------------------------------------------**/
/**
* Function to fetch conversation for a specific user/group.
* @param {string} conversationWith
* @param {string} conversationType
* @returns {Promise<Conversation>}
* @memberof CometChat
*/
export function getConversation(conversationWith: string, conversationType: string): Promise<Conversation>;
/**
* Function to tag a conversation for a specific user/group.
* @param {string} conversationWith
* @param {string} conversationType
* @param {Array<String>} tags
* @returns {Promise<Conversation>}
* @memberof CometChat
*/
export function tagConversation(conversationWith: string, conversationType: string, tags: Array<String>): Promise<Conversation>;
/**
* function to delete conversation for a specific user/group.
* @param {string} conversationWith
* @param {string} conversationType
* @returns Promise<string>
* @memberof CometChat
*/
export function deleteConversation(conversationWith: string, conversationType: string): Promise<string>;
/**-------------------------------------------------------------------*
* Group related functions provided by CometChat class *
*--------------------------------------------------------------------**/
/**
* Function to create a group.
* @param {Group} group
* @returns {Promise<Group>}
* @memberof CometChat
*/
export function createGroup(group: Group | any): Promise<Group>;
/**
* Function to fetch details of a group.
* @param {string | Object} guid
* @returns {Promise<Group>}
* @memberof CometChat
*/
export function getGroup(guid: string | Object): Promise<Group>;
/**
* Function to join a public group.
* @param {guid} guid
* @param {GroupType} type
* @param {string} password
* @returns {Promise<Group>}
* @memberof CometChat
*/
export function joinGroup(grp: any, type?: GroupType, password?: string): Promise<Group>;
/**
* Function to update a group.
* @param {Group} group
* @returns {Promise<Group>}
* @memberof CometChat
*/
export function updateGroup(group: any): Promise<Group>;
/**
* Function to delete a group.
* @param {string} guid
* @returns {Promise<boolean>}
* @memberof CometChat
*/
export function deleteGroup(guid: string): Promise<boolean>;
/**
* Function to leave a group.
* @param {string} guid
* @returns {Promise}
* @memberof CometChat
*/
export function leaveGroup(guid: string): Promise<boolean>;
/**
* Function to kick a member from a group.
* @param {string} guid
* @param {string} uid
* @returns {Promise<boolean>}
* @memberof CometChat
*/
export function kickGroupMember(guid: string, uid: string): Promise<boolean>;
/**
* Function to change the scope of a member in a group.
* @param {string} guid
* @param {string} uid
* @param {GroupMemberScope} scope
* @returns {Promise<boolean>}
* @memberof CometChat
*/
export function updateGroupMemberScope(guid: string, uid: string, scope: GroupMemberScope): Promise<boolean>;
/**
* Function to ban a group member from a group.
* @param {string} guid
* @param {string} uid
* @returns {Promise<boolean>}
* @memberof CometChat
*/
export function banGroupMember(guid: string, uid: string): Promise<boolean>;
/**
* Function to unban a group member from a group.
* @param {string} guid
* @param {string} uid
* @returns {Promise<boolean>}
* @memberof CometChat
*/
export function unbanGroupMember(guid: string, uid: string): Promise<boolean>;
/**
* Function to add members in a group. This function can also be used to ban a group member from a group.
* @param {string} guid
* @param {Array<GroupMember>} groupMembers
* @param {Array<String>} bannedMembersList
* @returns {Promise<Object>}
* @memberof CometChat
*/
export function addMembersToGroup(guid: string, groupMembers: Array<GroupMember>, bannedMembersList: Array<string>): Promise<Object>;
/**
*
* Function to transfer ownership of a group.
* @param {string} guid
* @param {string} uid
* @returns {Promise<string>}
* @memberof CometChat
*/
export function transferGroupOwnership(guid: string, uid: string): Promise<string>;
/**
* Function to create a group and add/ban members in/from that group.
* @param {Group} group
* @param {Array<GroupMember>} members
* @param {Array<String>} banMembers
* @returns {Promise<Object>}
* @memberof CometChat
*/
export function createGroupWithMembers(group: Group, members: Array<GroupMember>, banMembers: Array<string>): Promise<Object>;
/**-------------------------------------------------------------------*
* Call related functions provided by CometChat class *
*--------------------------------------------------------------------**/
/**
* Function to initiate a user/group call.
* @param {Call} call
* @returns {Promise<Call>}
* @memberof CometChat
*/
export function initiateCall(call: Call | any): Promise<Call>;
/**
* Function to accept an incoming user/group call.
* @param {string} sessionid
* @returns {Promise<Call>}
* @memberof CometChat
*/
export function acceptCall(sessionid: string): Promise<Call>;
/**
* Function to reject an incoming call or cancel an outgoing call.
* @param {string} sessionId
* @param {string} status
* @returns {Promise<Call>}
* @memberof CometChat
*/
export function rejectCall(sessionId: string, status: any): Promise<Call>;
/**
* Function to end an ongoing call.
* @param {string} sessionid
* @param {boolean} isInternal - Optional
* @returns {Promise<Call>}
* @memberof CometChat
*/
export function endCall(sessionid: string, isInternal?: boolean): Promise<Call>;
/**
* Function to get the active call.
* @returns {Call}
* @memberof CometChat
*/
export function getActiveCall(): Call;
/**
* Function to clear any active call.
* @returns {void}
* @memberof CometChat
*/
export function clearActiveCall(): void
/**
* Function to start a call.
* @param {CallSettings} callSettings
* @memberof CometChat
*/
export function startCall(callSettings: CallSettings): void;
/**
* Function to fetch participant count of an ongoing call.
* @param {string} sessionId
* @param {string} type
* @returns {Promise<number>}
* @memberof CometChat
*/
export function getCallParticipantCount(sessionId: string, type: string): Promise<number>;
/**-------------------------------------------------------------------------------------------------------*
* Events listeners setting and removing . *
*--------------------------------------------------------------------------------------------------------**/
/**
* Function to add a Connection Listner.
* @param {string} name
* @param {ConnectionListener} connectionListener
* @memberof CometChat
*/
export function addConnectionListener(name: string, connectionListener: ConnectionListener): void;
/**
* Function to remove a Connection Listner.
* @param {string} name
* @memberof CometChat
*/
export function removeConnectionListener(name: string): void;
/**
* Function to add a Message Listner.
* @param {string} name
* @param {MessageListener} messageListener
* @memberof CometChat
*/
export function addMessageListener(name: string, messageListener: MessageListener): void;
/**
* Function to remove a Message Listner.
* @param {string} name
* @memberof CometChat
*/
export function removeMessageListener(name: string): void;
/**
*
* Function to add a Call Listener.
* @param {string} name
* @param {CallListener} callListener
* @memberof CometChat
*/
export function addCallListener(name: string, callListener: CallListener): void;
/**
* Function to remove a Call Listener.
* @param {string} name
* @memberof CometChat
*/
export function removeCallListener(name: string): void;
/**
* Function to add a User Listener.
* @param {string} name
* @param {UserListener} userListener
* @memberof CometChat
*/
export function addUserListener(name: string, userListener: UserListener): void;
/**
* Function to remove a User Listener.
* @param {string} name
* @memberof CometChat
*/
export function removeUserListener(name: string): void;
/**
* Function to add a Group Listener.
* @param {string} name
* @param {GroupListener} groupListener
* @memberof CometChat
*/
export function addGroupListener(name: string, groupListener: GroupListener): void;
/**
*
* Function to remove a Group Listener.
* @param {string} name
* @memberof CometChat
*/
export function removeGroupListener(name: string): void;
/**
* Function to add a Login Listener.
*
* @param {string} name
* @param {LoginListener} loginListener
* @memberof CometChat
*/
export function addLoginListener(name: string, loginListener: LoginListener): void;
/**
* Function to remove a Login Listener.
*
* @param {string} name
* @memberof CometChat
*/
export function removeLoginListener(name: string): void;
/**
* Get the current connection status
* @returns {string}
* @memberof CometChat
*/
export function getConnectionStatus(): string;
/**
* Returns a boolean value which indicates if the extension is enabled or not.
* @param {string} extensionId
* @returns {Promise<boolean>}
* @memberof CometChat
*/
export function isExtensionEnabled(extensionId: string): Promise<boolean>;
/**
* Returns an object of CCExtension Class which has the details of the extension.
*
* @param {string} extensionId
* @returns {Promise<CCExtension>