zego-zim-web
Version:
ZEGO ZIM SDK for Web
598 lines • 160 kB
TypeScript
import { ZIMAppConfig, ZIMBlacklistCheckedResult, ZIMBlacklistQueriedResult, ZIMBlacklistQueryConfig, ZIMBlacklistUsersAddedResult, ZIMBlacklistUsersRemovedResult, ZIMCallAcceptanceSentResult, ZIMCallAcceptConfig, ZIMCallCancelConfig, ZIMCallCancelSentResult, ZIMCallEndConfig, ZIMCallEndSentResult, ZIMCallingInvitationSentResult, ZIMCallingInviteConfig, ZIMCallInvitationListQueriedResult, ZIMCallInvitationQueryConfig, ZIMCallInvitationSentResult, ZIMCallInviteConfig, ZIMCallJoinConfig, ZIMCallJoinSentResult, ZIMCallQuitConfig, ZIMCallQuitSentResult, ZIMCallRejectConfig, ZIMCallRejectionSentResult, ZIMCombineMessage, ZIMCombineMessageDetailQueriedResult, ZIMCommunityAttributesOperatedResult, ZIMCommunityAvatarUrlUpdatedResult, ZIMCommunityChannelAttributesOperatedResult, ZIMCommunityChannelAvatarUrlUpdatedResult, ZIMCommunityChannelCreateConfig, ZIMCommunityChannelCreatedResult, ZIMCommunityChannelDismissedResult, ZIMCommunityChannelInfo, ZIMCommunityChannelListQueriedResult, ZIMCommunityChannelListQueryConfig, ZIMCommunityChannelMuteConfig, ZIMCommunityChannelNameUpdatedResult, ZIMCommunityChannelNoticeUpdatedResult, ZIMCommunityChannelsInfoQueriedResult, ZIMCommunityChannelsMutedResult, ZIMCommunityCreateConfig, ZIMCommunityCreatedResult, ZIMCommunityDismissedResult, ZIMCommunityInfo, ZIMCommunityInfoQueriedResult, ZIMCommunityJoinedResult, ZIMCommunityLeftResult, ZIMCommunityListQueriedResult, ZIMCommunityListQueryConfig, ZIMCommunityMemberListQueriedResult, ZIMCommunityMemberListQueryConfig, ZIMCommunityMemberMuteConfig, ZIMCommunityMemberRoleUpdatedResult, ZIMCommunityMembersKickedResult, ZIMCommunityMembersMutedResult, ZIMCommunityMembersQueriedResult, ZIMCommunityMessageNotificationStatus, ZIMCommunityNameUpdatedResult, ZIMCommunityNoticeUpdatedResult, ZIMCommunityNotificationStatusSetResult, ZIMCommunityOwnerTransferredResult, ZIMCommunityUsersInvitedResult, ZIMConversationBaseInfo, ZIMConversationDeleteConfig, ZIMConversationDeletedResult, ZIMConversationDraftSetResult, ZIMConversationFilterOption, ZIMConversationListQueriedResult, ZIMConversationMarkSetResult, ZIMConversationMessageReceiptReadSentResult, ZIMConversationNotificationStatus, ZIMConversationNotificationStatusSetResult, ZIMConversationPinnedListQueriedResult, ZIMConversationPinnedStateUpdatedResult, ZIMConversationQueriedResult, ZIMConversationQueryConfig, ZIMConversationSearchConfig, ZIMConversationsSearchedResult, ZIMConversationTotalUnreadMessageCountQueriedResult, ZIMConversationTotalUnreadMessageCountQueryConfig, ZIMConversationType, ZIMConversationUnreadMessageCountClearedResult, ZIMFriendAddConfig, ZIMFriendAddedResult, ZIMFriendAliasUpdatedResult, ZIMFriendApplicationAcceptConfig, ZIMFriendApplicationAcceptedResult, ZIMFriendApplicationListQueriedResult, ZIMFriendApplicationListQueryConfig, ZIMFriendApplicationRejectConfig, ZIMFriendApplicationRejectedResult, ZIMFriendApplicationSendConfig, ZIMFriendApplicationSentResult, ZIMFriendAttributesUpdatedResult, ZIMFriendDeleteConfig, ZIMFriendListQueriedResult, ZIMFriendListQueryConfig, ZIMFriendRelationCheckConfig, ZIMFriendsDeletedResult, ZIMFriendSearchConfig, ZIMFriendsInfoQueriedResult, ZIMFriendsRelationCheckedResult, ZIMFriendsSearchedResult, ZIMGeofencingType, ZIMGroupAdvancedConfig, ZIMGroupAliasUpdatedResult, ZIMGroupApplicationListQueriedResult, ZIMGroupApplicationListQueryConfig, ZIMGroupAttributesOperatedResult, ZIMGroupAttributesQueriedResult, ZIMGroupAvatarUrlUpdatedResult, ZIMGroupBeInviteMode, ZIMGroupBeInviteModeUpdatedResult, ZIMGroupCreatedResult, ZIMGroupDismissedResult, ZIMGroupInfo, ZIMGroupInfoQueriedResult, ZIMGroupInviteApplicationAcceptConfig, ZIMGroupInviteApplicationAcceptedResult, ZIMGroupInviteApplicationRejectConfig, ZIMGroupInviteApplicationRejectedResult, ZIMGroupInviteApplicationSendConfig, ZIMGroupInviteApplicationsSentResult, ZIMGroupInviteMode, ZIMGroupInviteModeUpdatedResult, ZIMGroupJoinApplicationAcceptConfig, ZIMGroupJoinApplicationAcceptedResult, ZIMGroupJoinApplicationRejectConfig, ZIMGroupJoinApplicationRejectedResult, ZIMGroupJoinApplicationSendConfig, ZIMGroupJoinApplicationSentResult, ZIMGroupJoinedResult, ZIMGroupJoinMode, ZIMGroupJoinModeUpdatedResult, ZIMGroupLeftResult, ZIMGroupListQueriedResult, ZIMGroupListQueryConfig, ZIMGroupMemberCountQueriedResult, ZIMGroupMemberInfoQueriedResult, ZIMGroupMemberKickedResult, ZIMGroupMemberListQueriedResult, ZIMGroupMemberMuteConfig, ZIMGroupMemberMutedListQueriedResult, ZIMGroupMemberNicknameUpdatedResult, ZIMGroupMemberQueryConfig, ZIMGroupMemberRoleUpdatedResult, ZIMGroupMemberSearchConfig, ZIMGroupMembersMutedResult, ZIMGroupMembersSearchedResult, ZIMGroupMessageReceiptMemberListQueriedResult, ZIMGroupMessageReceiptMemberQueryConfig, ZIMGroupMuteConfig, ZIMGroupMutedResult, ZIMGroupNameUpdatedResult, ZIMGroupNoticeUpdatedResult, ZIMGroupOwnerTransferredResult, ZIMGroupSearchConfig, ZIMGroupsSearchedResult, ZIMGroupUsersInvitedResult, ZIMLogConfig, ZIMLoginConfig, ZIMLogoutConfig, ZIMMessage, ZIMMessageDeleteConfig, ZIMMessageDeletedResult, ZIMMessageEditConfig, ZIMMessageEditedResult, ZIMMessageInsertedResult, ZIMMessageLocalExtendedDataUpdatedResult, ZIMMessagePinConfig, ZIMMessageQueriedResult, ZIMMessageQueryConfig, ZIMMessageReactionAddConfig, ZIMMessageReactionAddedResult, ZIMMessageReactionDeletedResult, ZIMMessageReactionUserListQueriedResult, ZIMMessageReactionUserQueryConfig, ZIMMessageReceiptsInfoQueriedResult, ZIMMessageReceiptsReadSentResult, ZIMMessageRepliedListQueriedResult, ZIMMessageRepliedListQueryConfig, ZIMMessageRevokeConfig, ZIMMessageRevokedResult, ZIMMessageSearchConfig, ZIMMessageSendConfig, ZIMMessageSendNotification, ZIMMessageSentResult, ZIMMessagesGlobalSearchedResult, ZIMMessagesSearchedResult, ZIMPinnedMessageListQueriedResult, ZIMRoomAdvancedConfig, ZIMRoomAllLeftResult, ZIMRoomAttributesBatchOperatedResult, ZIMRoomAttributesBatchOperationConfig, ZIMRoomAttributesDeleteConfig, ZIMRoomAttributesOperatedResult, ZIMRoomAttributesQueriedResult, ZIMRoomAttributesSetConfig, ZIMRoomCreatedResult, ZIMRoomEnteredResult, ZIMRoomInfo, ZIMRoomJoinedResult, ZIMRoomLeftResult, ZIMRoomMemberAttributesListQueriedResult, ZIMRoomMemberAttributesQueryConfig, ZIMRoomMemberAttributesSetConfig, ZIMRoomMemberQueriedResult, ZIMRoomMemberQueryConfig, ZIMRoomMembersAttributesOperatedResult, ZIMRoomMembersAttributesQueriedResult, ZIMRoomMembersQueriedResult, ZIMRoomOnlineMemberCountQueriedResult, ZIMRoomSwitchedResult, ZIMSelfUserInfoQueriedResult, ZIMSendingMessageCancelConfig, ZIMSubscribedUserStatusListQueriedResult, ZIMSubscribedUserStatusQueryConfig, ZIMTokenRenewedResult, ZIMUserAvatarUrlUpdatedResult, ZIMUserCustomStatusUpdateConfig, ZIMUserCustomStatusUpdatedResult, ZIMUserExtendedDataUpdatedResult, ZIMUserNameUpdatedResult, ZIMUserOfflinePushRule, ZIMUserOfflinePushRuleUpdatedResult, ZIMUsersInfoQueriedResult, ZIMUsersInfoQueryConfig, ZIMUsersStatusQueriedResult, ZIMUsersStatusSubscribedResult, ZIMUsersStatusUnsubscribedResult, ZIMUserStatusSubscribeConfig } from './ZIMDefines';
import { ZIMEventHandler } from './ZIMEventHandler';
export declare abstract class ZIM {
/**
* Gets the SDK's version number.
*
* Available since: 1.1.0.
* Description: Get the SDK version.
* Use cases:
* 1. When the SDK is running, the developer finds that it does not match the expected situation and submits the problem and related logs to the ZEGO technical staff for locating. The ZEGO technical staff may need the information of the engine version to assist in locating the problem.
* 2. Developers can also collect this information as the version information of the engine used by the app, so that the SDK corresponding to each version of the app on the line.
* When to call: It can be called at any time.
*/
static getVersion(): string;
/**
* Create a ZIM instance.
*
* Available since: 2.3.0 and above.
* Description: Create a ZIM instance for subsequent calls to other member functions.
* When to call: Before calling other member functions, you must call this API to create a ZIM example.
* Restrictions: Currently only one instance is supported, repeated calls will return [null].
* Caution:
* 1. Currently, the [create] function can only create one instance at most. If it is called multiple times, only the first one will return a valid instance, and the rest will be [null]. The developer should save the ZIM instance by himself, and ensure that the life cycle of the instance is available in the process of using the ZIM business function; or after calling [create], he can use [getInstance] to obtain its singleton object and call other member functions.
* 2. If you use this function to create an instance, you must pass in both AppID and AppSign (exclude Web platform).
* Scope of impact: Failure to call this function will prevent other member functions from being called.
* Platform differences: When calling this function on the Android platform, in addition to the appID, the Application class object must also be passed in.
*
* @param appConfig ZIMAppConfig
*/
static create(appConfig: ZIMAppConfig): ZIM | null;
/**
* Get the ZIM singleton object.
*
* Available since: 2.3.0 and above.
* Description: Get the ZIM singleton object for subsequent calls to other member functions.
* When to call: You must call [create] to create an instance before calling this function to obtain a singleton object, otherwise it will return [null].
* Related APIs: [create].
*/
static getInstance(): ZIM | null;
/**
* Set ZIM advanced configuration.
*
* When you need to customize the set advanced configurations, you need to call this function.
* It must be set before calling [create] to take effect. If it is set after [create], it will take effect at the next [create].
*
* @param key Configuration Key
* @param value Configuration value
*/
static setAdvancedConfig(key: string, value: string): void;
/**
* Set geofence-related configurations.
*
* Available since: 2.12.0 and above.
* Description: Geofencing means that instant messaging data transmission is limited to a certain area to meet regional data privacy and security regulations, that is, to restrict access to communication services in a specific area.
* When to call: The [setGeofencingConfig] interface needs to be called before the [create] interface.
* Restrictions: If you need to use this function, please contact ZEGO technical support.
* Caution: If you need to update geo fencing information, please call the [destroy] interface to destroy the current ZIM instance, and then call this interface.
*
* @param areaList Geofencing area list
* @param type Geofencing type
*/
static setGeofencingConfig(areaList: number[], type: ZIMGeofencingType): boolean;
/**
* Set log related configuration.
*
* Available since: 1.1.0 and above.
* Description: Set log related configuration, including log path and log size. Since there is a default log path inside the SDK, unless the developer has a strong need to customize the log path, it is generally not recommended that customers set it by themselves.
* Default value:
* Android: /storage/Android/data/[packageName]/files/ZIMLogs
* iOS: ~/Library/Caches/ZIMLogs
* macOS: (sandbox) ~/Library/Containers/[Bundle ID]/Data/Library/Caches/ZIMLogs /; (non-sandbox) ~/Library/Caches/ZIMLogs
* Windows: C:/Users/[Your UserName]/AppData/[App Name]ZEGO.SDK/ZIMLogs
* When to call: It must be called before [create].
* Caution: If the developer calls after [create], the SDK will save this configuration until the next time [create] takes effect.
* Life cycle: Set before calling [create], and take effect when calling [create]. If the developer does not set a new log configuration in the next [create], the previous configuration will still take effect.
* Platform differences: The default path of different platforms is different, please refer to the default value.
* Related APIs: For details, please refer to https://doc-zh.zego.im/faq/IM_sdkLog?product=IM&platform=all.
*
* @param config Custom log configuration
*/
abstract setLogConfig(config: ZIMLogConfig): void;
/**
* Destroy the ZIM instance.
*
* Available since: 1.1.0 and above.
* Description: Release the resources used by the ZIM instance. This function must be called to release the occupied memory resources when ZIM is no longer needed, otherwise a memory leak may occur.
* When to call: call when ZIM is no longer needed, usually before emptying the ZIM object.
* Caution: After calling this function, ZIM internal functions can no longer be used, and all callback notifications will no longer be triggered. If you need to continue using the ZIM function, please call [create] again to create a new instance.
*/
abstract destroy(): void;
/**
* Set the event notification callbacks that need to be handled. If the eventHandler is set to [null], all the callbacks set previously will be cleared.
*
* Available since: 1.1.0 and above.
* Description: Set event notification callback, pass [null] to clear the set callback.
* When to call: After calling [create] to create an instance, this function must be called through the instance.
* Caution: If the developer calls this function multiple times, it will **overwrite** the callback set by the last call to this function.
* Life cycle: Set this function after calling [create], and you can receive ZIM-related event notifications normally; after calling [destroy], you will no longer receive any event notifications.
*
* @param type Event type
* @param listener Event callback
*/
abstract on<K extends keyof ZIMEventHandler>(type: K, listener: ZIMEventHandler[K]): void;
/**
* Remove event notification callback.
*
* Available since: 1.1.0 and above.
* Description: Remove event notification callback.
* When to call: After calling [create] to create an instance, this function must be called through the instance.
* Caution: If the developer calls this function multiple times, it will **overwrite** the callback set by the last call to this function.
* Life cycle: Set this function after calling [create], and you can receive ZIM-related event notifications normally; after calling [destroy], you will no longer receive any event notifications.
*
* @param type Event type
*/
abstract off<K extends keyof ZIMEventHandler>(type: K): void;
/**
* Upload log and call after setting up log path.
*
* Available since: 1.2.0 and above.
* Description: By default, the SDK will create and print log files in the default directory of the App. By default, the maximum value of each log file is 5MB, and the three log files are written in a cycle. When this function is called, the SDK automatically packages and uploads the log file to the ZEGO server.
* Use cases: Developers can provide business "feedback" channels in the App. When user feedback problems belong to ZEGO SDK, they can call this function to upload the local log information of SDK and contact ZEGO technical support to help locate user problems.
* When to call: It must be after calling [create] to create an instance.
* Restrictions: If this interface is invoked repeatedly within 10 minutes, only the last invocation takes effect.
* Caution: If you call [destory] or exit the App too quickly after calling this interface to upload logs, it may fail. You are advised to wait a few seconds and then call [destory] or exit the App after receiving the callback for successful upload.
* Related callbacks: Developers can get the upload results through the callback parameter.
*/
abstract uploadLog(): Promise<void>;
/**
* Login, you must log in before using all functions.
*
* Available since: 2.13.0 and above.
* Description: Log in to the ZIM service. [login] is the most important step of the ZIM function. You need to log in before using any other functions.
* When to call: This function must be called after calling [create] to create an instance and before calling other instance functions.
* Caution: Before using ZIM's single chat, room, message sending and receiving functions, you must first call this function to log in, and the UI can be displayed to the user through the login result.
* Privacy statement: remind users not to pass in sensitive information involving personal privacy in the userID parameter, including but not limited to mobile phone number, ID number, passport number, real name, etc.
* Related callbacks: In addition to getting the login result in the callback parameter, the developer will also receive the [onConnectionStateChanged] callback during the login request and after the login is successful/failed to determine the current user's login status.
* FAQ: How is the RTC login different from ZEGO's? RTC login refers to the login to the room, ZIM login to the account.
* References: For details, please refer to Authentication (https://docs.zegocloud.com/article/13772).
*
* @param userID Used to identify user information, the unique ID of the user.
* @param config Various parameters used for specific login actions.
*/
abstract login(userID: string, config: ZIMLoginConfig): Promise<void>;
/**
* Logout parameter configuration.
*
* Available since: 1.1.0 or above.
* Description: Log out of the ZIM service.
* Use cases: This function must be called from the instance after it has been created by calling [create].
* When to call: After invoking [logout], you can no longer use ZIM's chat, room, send and receive, and other functions. To use the ZIM service again, the developer must call [login] to login again.
* Caution: Upon logout, the developer will receive the [onConnectionStateChanged] callback with the login state being [Disconnected].
*/
abstract logout(config?: ZIMLogoutConfig): void;
/**
* Update the authentication token.
*
* Available since: 1.1.0 or above.
* Description: Update the authentication token so that the authentication token can be updated in time after it expires, so as to continue to use ZIM functions normally.
* Use cases: When you need to create a multi-person chat scene, you can create and join a room by this API.
* When to call: This function must be called through the instance after calling [create] to create the instance.
* Life cycle: The life cycle of this function depends on the validity period of the authentication token, which is determined by the developer business.
* References: For details, please refer to the Token generation documentation.
* Caution: After the developer receives the [onTokenWillExpire] callback, the developer needs to request the authentication server to regenerate a token in time.
*
* @param token The token issued by the developer's business server, used to ensure security. The generation rules are detailed in ZEGO document website.
*/
abstract renewToken(token: string): Promise<ZIMTokenRenewedResult>;
/**
* Call the experimental API.
*
* ZEGO provides some technical previews or special customization functions in ZIM business through this API. If you need to get the use of the function or the details, please consult ZEGO technical support.
*
* @param params Parameters in the format of a JSON string, please consult ZEGO technical support for details.
*/
abstract callExperimentalAPI(params: string): Promise<string>;
/**
* Update user's user name.
*
* Available since: 2.2.0 or above.
* Description: After user logs in, calling this interface could update the user's own user name.
* When to call: After the user is logged in.
* Caution: This interface does not support modifying user names in rooms.
* Privacy statement: Try not to pass in sensitive information involving personal privacy, including but not limited to mobile phone numbers, ID numbers, passport numbers, real names, etc.
* Related callbacks: [ZIMUserNameUpdatedCallback].
* Related APIs: [updateUserExtendedData] and [queryUsersInfo].
*
* @param userName User name , It is customized by the developer. For version 2.0.0 and onwards, the string has a maximum length of 256 bytes.
*/
abstract updateUserName(userName: string): Promise<ZIMUserNameUpdatedResult>;
/**
* Update user's avatar URL.
*
* Available since: 2.3.0 and above.
* Description: After the user logs in, calling this interface can set or update the user's own user avatar URL.
* When to call: After the user logs in.
* Caution: The user avatar itself needs to be stored by the developer, and ZIM only saves its user information as a pass-through URL.
* Restrictions: There is no limit on special characters and a maximum of 500 bytes.
* Related callbacks: [ZIMUserAvatarUrlUpdatedCallback].
* Related APIs: [queryUsersInfo].
*
* @param userAvatarUrl User avatar URL wanted to changed to.
*/
abstract updateUserAvatarUrl(userAvatarUrl: string): Promise<ZIMUserAvatarUrlUpdatedResult>;
/**
* Update user's user extended data.
*
* Available since: 2.2.0 or above.
* Description: After user logs in, calling this interface could update the user's own user extended data.
* When to call: After the user is logged in.
* Privacy statement: Try not to pass in sensitive information involving personal privacy, including but not limited to mobile phone numbers, ID numbers, passport numbers, real names, etc.
* Related callbacks: [ onUserNameUpdatedCallback ].
* Related APIs: [updateUserName] and [ queryUsersInfo ].
*
* @param extendedData User extended data wanted to changed to .
*/
abstract updateUserExtendedData(extendedData: string): Promise<ZIMUserExtendedDataUpdatedResult>;
/**
* Update user's custom rule of offline push.
*
* Available since: 2.15.0 and later versions.
* Description: This interface is used to modify the custom rule of offline push for the current user.
* Use cases: For example, in the multi-terminal login scenario, the developer hopes that when the desktop is online, the mobile terminal does not want to receive offline push. In this scenario, the interface can be invoked to achieve this function.
* When to call: You can call it after you log in and the network is in good condition.
* Caution: After the interface is successfully invoked, all ends will receive onUserRuleUpdate notifying the user that the rule has been updated.
* Related callbacks: onUserRuleUpdate、ZIMUserOfflinePushRuleUpdatedCallback
* Related APIs: querySelfUserInfo
*
* @param offlinePushRule The user pushes the rule information offline, and the interface will be fully updated with the member properties of the input object each time the interface is called.
*/
abstract updateUserOfflinePushRule(offlinePushRule: ZIMUserOfflinePushRule): Promise<ZIMUserOfflinePushRuleUpdatedResult>;
/**
* Update user's custom status.
*
* Use cases: After login, call the interface to modify the current user's custom status as 'do not disturb', 'busy' and other states.
* When to call: After an online login and a network connection exists.
* Related callbacks: After the interface is successfully invoked to update the user-defined status, other devices that are logged in to multiple devices and users who subscribe to the current user status through subscribeUsersStatus receive onUserStatusUpdated and updates the user-defined status of the current user.
*
* @param customStatus User custom status.
* @param config Config of user custom status.
*/
abstract updateUserCustomStatus(customStatus: string, config?: ZIMUserCustomStatusUpdateConfig): Promise<ZIMUserCustomStatusUpdatedResult>;
/**
* Update the number of iOS offline notification badges.
*
* Available since: 2.28.0 or above.
* Description: This API updates the APP badge count on the current user’s mobile clients. It applies to the user on mobile devices where they have logged in.
* Use cases: In multi-device login scenarios, after the developer clears unread counts (or when unread counts change) on desktop or web, and wants mobile users’ APP badge counts to reflect and sync to the corresponding value, this API can be called to achieve that.
* When to call: After login, with a good network connection, and when the total unread count changes. It only needs to be called on non-mobile platforms that do not support ZPNs (such as desktop and web).
* Caution: After a successful call, the APP badge value will be updated to the specified value on all offline mobile clients where the user has logged in.
* Related callbacks: [ZIMUserBadgeUpdatedCallback].
*
* @param badge The user’s expected APP badge value.
*/
abstract updateUserBadge(badge: number): Promise<void>;
/**
* Query user information.
*
* Available since: 2.3.0 or above.
* Description: Through this interface, you can query and obtain the corresponding UserInfo by userID.
* When to call: It is available only after calling [create] to create the instance and then calling [login] to login.
* Related callbacks: [ZIMUsersInfoQueriedCallback].
* Restrictions: No more than 10 userids can be queried by invoking the interface at a time. If the interface is invoked multiple times within 10 seconds, the total number of userids queried cannot exceed 10.
*
* @param userIDs userID list.
* @param config Query user information configuration.
*/
abstract queryUsersInfo(userIDs: string[], config: ZIMUsersInfoQueryConfig): Promise<ZIMUsersInfoQueriedResult>;
/**
* Query the user statuses of other users.
*
* Available since: 2.18.0
* Description: Query the user statuses of other users.
* Use cases: When you do not need to continuously follow the user statuses of certain users but only need to obtain their user statuses once, you can use this method.
* When to call: Can be called after login and when the network conditions are good.
* Caution: The query targets can not include unregistered users.
* Related callbacks: ZIMUsersStatusQueriedCallback.
*
* @param userIDs User ID list.
*/
abstract queryUsersStatus(userIDs: string[]): Promise<ZIMUsersStatusQueriedResult>;
/**
* Query user information and user rules.
*
* Available since: 2.15.0 .
* Description: Query information about the current user and user rules. In offline state, you can query local data.
* Use cases: If you need to display the user information and rules, you can invoke the query, for example, to enter the personal page of the current user.
* When to call: Call after login.
* Restrictions: ZIMSelfUserInfoQueriedCallback、userInfoUpdated、userRuleUpdated
*/
abstract querySelfUserInfo(): Promise<ZIMSelfUserInfoQueriedResult>;
/**
* Subscribe to the user status of other users
*
* Available since: 2.18.0
* Description: Subscribing to the user status of other users through this interface.
* Use cases: When you enter the group/room/friends list and need to know which room/group members/friends are online, subscribe through this interface. When the user status of these users is updated successfully, the [onUserStatusUpdated] interface is updated.
* When to call: Can be called when the login is successful and the network conditions are good.
* Restrictions: The maximum number of subscribers is 100. By default, a single user can subscribe to a maximum of 3000 users. When the number of subscribers reaches the upper limit, the new subscribers will overwrite the original subscribers.
* Caution: You cannot subscribe to the current login user through this interface. The subscribed user must be registered.
* Related callbacks: [ZIMUsersStatusSubscribedCallback],[onUserStatusUpdated]
* Related APIs: [unsubscribeUsersStatus]
*
* @param userIDs User ID list.
* @param config Configuration for subscribing to user status.
*/
abstract subscribeUsersStatus(userIDs: string[], config: ZIMUserStatusSubscribeConfig): Promise<ZIMUsersStatusSubscribedResult>;
/**
* This command is used to batch unsubscribe the target users in the current user subscription list.
*
* Available since: 2.18.0
* Description: Batch unsubscribe the target user in the current user subscription list.
* Use cases: In non-multi-terminal login scenarios, when you leave a room or group, if you no longer follow the user status of the room or group members for a short period of time, and you have subscribed to the user status of the room or group members when you enter the room or group, you can unsubscribe through this interface.
* When to call: Called after login and when the network is in good condition.
* Restrictions: The maximum number of userids passed in at a time is 100.
* Caution: You cannot cancel a user that is not in the current user subscription list.
* Related callbacks: ZIMUsersStatusUnsubscribedCallback.
* Related APIs: subscribeUsersStatus、queryUsersStatus、querySubscribedUserStatusList.
*
* @param userIDs User ID list.
*/
abstract unsubscribeUsersStatus(userIDs: string[]): Promise<ZIMUsersStatusUnsubscribedResult>;
/**
* This command is used to query the user status subscription list of the current user.
*
* Available since: 2.18.0
* Description: This command is used to query the user status subscription list of the current user.
* Use cases: Through this interface, you can obtain the local cache of the user status subscription list of the current user, so that you can know which users the current user has subscribed to, obtain the subscription expiration time of the subscriber, and obtain the status data of the subscriber when it changed last time.
* When to call: It can be called after login, regardless of network status.
* Restrictions: The data obtained is the local cache of the SDK. When the network conditions are good after login, the SDK periodically synchronizes data to the background.
* Related callbacks: ZIMSubscribedUserStatusListQueriedCallback、subscribeUsersStatus、unsubscribeUsersStatus.
* Related APIs: subscribeUsersStatus、unsubscribeUsersStatus.
*
* @param config Configuration for querying subscribed user status list.
*/
abstract querySubscribedUserStatusList(config: ZIMSubscribedUserStatusQueryConfig): Promise<ZIMSubscribedUserStatusListQueriedResult>;
/**
* Query the conversation list.
*
* Use cases: This interface can be invoked to get the data source when you need to display an existing message session after logging in.
* When to call: Can be invoked after login.
* Caution: NextConversation is the riveting point of the query message, which can be null for the first query. In subsequent query, the earliest conversation can be used as nextConversation to query earlier sessions. In paging query, Count in ZIMConversationQueryConfig fill each pull the number of sessions.
* Related callbacks: ZIMConversationListQueriedCallback.
* Related APIs: deleteConversation Deletes the session. clearConversationUnreadMessageCount clear session readings.
*
* @param config Configuration for session queries.
* @param option Filter options for session queries.
*/
abstract queryConversationList(config: ZIMConversationQueryConfig, option?: ZIMConversationFilterOption): Promise<ZIMConversationListQueriedResult>;
/**
* Query a conversation by conversation ID and conversation type.
*
* Available since: 2.8.0 and above.
* Description: This method displays the session list of the logged in user.
* Use cases: When you need to know the relevant information of the specified conversation, you can call this interface to obtain the data source.
* When to call: Can be invoked after login.
* Restrictions: There is no limit to the frequency of use, available after login, unavailable after logout.
* Related callbacks: [ZIMConversationQueriedCallback].
*
* @param conversationID Conversation ID.
* @param conversationType Conversation type.
*/
abstract queryConversation(conversationID: string, conversationType: ZIMConversationType): Promise<ZIMConversationQueriedResult>;
/**
* Query the conversation pinned list.
*
* Available since: 2.8.0 and above.
* Description: This method displays the pinned conversation list of the logged in user.
* Use cases: This interface can be invoked to get the data source when you need to display an existing pinned message conversation after logging in.
* When to call: Can be invoked after login.
* Restrictions: There is no limit to the frequency of use, available after login, unavailable after logout.
* Caution: NextConversation is the riveting point of the query message, which can be null for the first query. In subsequent query, the earliest conversation can be used as nextConversation to query earlier sessions. In paging query, Count in [ZIMConversationQueryConfig] fill each pull the number of sessions.
*
* @param config Configuration for session queries.
*/
abstract queryConversationPinnedList(config: ZIMConversationQueryConfig): Promise<ZIMConversationPinnedListQueriedResult>;
/**
* Modify the conversation pinned state.
*
* Available since: 2.8.0 and above.
* Description: This method can modify the pinned state of the specified conversation of the logged-in user.
* Use cases: You can call this interface when you need to modify the pinned state of a conversation.
* When to call: Can be invoked after login.
* Restrictions: Available after login, unavailable after logout.
* Related callbacks: [ZIMConversationPinnedStateUpdatedCallback].
*
* @param isPinned Whether the conversation is pinned, true is pinned, false is unpinned.
* @param conversationID Conversation ID.
* @param conversationType Conversation type.
*/
abstract updateConversationPinnedState(isPinned: boolean, conversationID: string, conversationType: ZIMConversationType): Promise<ZIMConversationPinnedStateUpdatedResult>;
/**
* delete the conversation.
*
* Available since: 2.0.0 and above.
* Description: This interface is invoked when a session needs to be deleted. All members in the session can invoke this interface.
* Use cases: You can invoke this interface implementation to delete an entire session when it is no longer needed.
* When to call: his parameter is invoked when a session needs to be deleted and can be invoked after a ZIM instance is created. The call takes effect after login and becomes invalid after logout.
* Scope of impact: A successful call triggers the deleteConversation callback. If the deleted conversation contains unread messages, the [onConversationTotalUnreadMessageCountUpdated] callback is triggered.
* Related callbacks: [ZIMConversationDeletedCallback]
*
* @param conversationID conversationID.
* @param conversationType conversationtype.
* @param config delete the session's configuration.
*/
abstract deleteConversation(conversationID: string, conversationType: ZIMConversationType, config: ZIMConversationDeleteConfig): Promise<ZIMConversationDeletedResult>;
/**
* delete all conversations.
*
* Available since: 2.12.0 and above.
* Description: This interface is invoked when all conversations needs to be deleted. All members in conversations can invoke this interface.
* Use cases: If you want to delete all conversations when they are no longer needed, you can call this interface implementation.
* When to call: his parameter is invoked when conversations needs to be deleted and can be invoked after a ZIM instance is created. The call takes effect after login and becomes invalid after logout.
* Scope of impact: If deleted conversations include unread message will trigger the [onConversationTotalUnreadMessageCountUpdated] callback, the call is successful at login, and the other end will trigger [onConversationsAllDeleted] callback.
* Related callbacks: [ZIMConversationsAllDeletedCallback]
*
* @param config delete all conversation's configuration.
*/
abstract deleteAllConversations(config: ZIMConversationDeleteConfig): Promise<void>;
/**
* clear session unreads.
*
* Available since: 2.0.0 and above.
* Description: Used to clear unread for the current user target session.
* Use cases: This interface is called when a chat page is entered from a session and the original message readings of the session need to be cleared.
* When to call: Called when a target needs to be cleared without readings.
* Restrictions: Valid after login, invalid after logout.
* Scope of impact: Calling this method will trigger a total readings not updated callback [conversationTotalUnreadMessageCountUpdated], would trigger a session to update callbacks [conversationChanged].
* Related callbacks: [ZIMConversationUnreadMessageCountClearedCallback].
* Related APIs: [conversationTotalUnreadMessageCountUpdated]、[conversationChanged].
*
* @param conversationID conversationID.
* @param conversationType conversation type.
*/
abstract clearConversationUnreadMessageCount(conversationID: string, conversationType: ZIMConversationType): Promise<ZIMConversationUnreadMessageCountClearedResult>;
/**
* clear all conversations unreads.
*
* Available since: 2.12.0 and above.
* Description: Used to clear unread for all conversations.
* Use cases: You can call this interface when you need to clear all unread conversations to zero.
* When to call: Called when all conversation readings need to be cleared.
* Restrictions: Valid after login, invalid after logout.
* Scope of impact: Calling this method will trigger a total readings not updated callback [onConversationTotalUnreadMessageCountUpdated].
* Related callbacks: [ZIMConversationTotalUnreadMessageCountClearedCallback].
* Related APIs: [onConversationTotalUnreadMessageCountUpdated].
*/
abstract clearConversationTotalUnreadMessageCount(): Promise<void>;
/**
* Query the conversations total unread message count by config.
*
* Available since: 2.17.0 and above.
* Description: his method can query the total number of unread messages in the conversations of the logged-in user according to the configuration items.
* Use cases: This interface can be invoked to get the data source when you need to display an existing message conversation after logging in.
* When to call: Can be called after logging in.
* Restrictions: There is no limit on the frequency of use; it is available after logging in and not available after logging out.
* Related callbacks: [ZIMConversationTotalUnreadMessageCountQueriedCallback].
*
* @param config Configuration for querying the total unread count of the conversation.
*/
abstract queryConversationTotalUnreadMessageCount(config: ZIMConversationTotalUnreadMessageCountQueryConfig): Promise<ZIMConversationTotalUnreadMessageCountQueriedResult>;
/**
* Set the conversation notification state.
*
* Available since: 2.0.0 and above.
* Description: This method enables DND by selecting whether the unread of the target session is updated when a message is received. For conversations where Do Not Disturb is enabled, offline push notifications for that conversation are generally not received, unless the conversation is a group chat, the message sender has mentioned the current user, and the isNotifyMentionedUsers property in ZIMMessageSendConfig is set to true. In that case, the user will receive offline push notifications for that conversation.
* Use cases: If the user selects MESSAGE DO not Disturb (DND), the user can call the corresponding method.
* Default value: Message DND is disabled by default.
* When to call: If the target session exists after login, invoke this interface if you want to enable the DND status of the target session.
* Restrictions: Valid after login, invalid after logout.
* Scope of impact: After the DND state is enabled, receiving messages is not triggered [conversationTotalUnreadMessageCountUpdated]。
* Related callbacks: [ZIMConversationNotificationStatusSetCallback]。
* Related APIs: [conversationTotalUnreadMessageCountUpdated]。
*
* @param status the session notification state.
* @param conversationID Conversation ID. Currently, only "group" conversations and "peer"(only for 2.14.0 or above version) conversations can be set by notification state.
* @param conversationType Conversation type, such as peer, group, etc.
*/
abstract setConversationNotificationStatus(status: ZIMConversationNotificationStatus, conversationID: string, conversationType: ZIMConversationType): Promise<ZIMConversationNotificationStatusSetResult>;
/**
* Sets all received receipts for the conversation as read.
*
* Available since: 2.5.0 and above.
* Description: Set all received receipts of the conversation to be read.
* Use cases: Set all received receipt messages in the entire conversation to be read, and the sender of the message receipt in the conversation will receive the [onConversationMessageReceiptChanged] callback from ZIMEventHandler.
* When to call: It can be called after login. It is recommended to call before entering the message list page. In the message list page, it is recommended to call [sendMessageReceiptsRead] to batch set the messages that need to be read.
* Caution: Only single chat conversation are allowed.
* Related callbacks: [ZIMConversationMessageReceiptReadSentCallback].
* Related APIs: [sendMessageReceiptsRead], [sendMessage].
*
* @param conversationID Conversation ID.
* @param conversationType Conversation type, such as peer, group, etc.
*/
abstract sendConversationMessageReceiptRead(conversationID: string, conversationType: ZIMConversationType): Promise<ZIMConversationMessageReceiptReadSentResult>;
/**
* Set a conversation draft.
*
* Available since: 2.14.0 and above.
* Description: When you need to set a draft for a session, call this interface, and members of the session can call this interface.
* Use cases: This interface can be invoked when you need to temporarily save the text message that the user is editing but has not yet sent.
* When to call: Call when you need to set session draft, call after creating ZIM instance, take effect after login, invalid after logout.
* Scope of impact: A successful call triggers the [onConversationchanged] callback.
* Related callbacks: [ZIMConversationDraftSetCallback]
*
* @param draft Drafts that need to be set.
* @param conversationID Conversation ID.
* @param conversationType Conversation type, such as peer, group, etc.
*/
abstract setConversationDraft(draft: string, conversationID: string, conversationType: ZIMConversationType): Promise<ZIMConversationDraftSetResult>;
/**
* Set the conversation marked status.
*
* Available since: 2.17.0 and above.
* Description: This method can set marks for the conversation.
* Use cases: When you need to implement custom business logic based on conversation marks.
* Default value: The conversation marks defaults to empty.
* When to call: When logged in and a valid conversation exists, if you want to set or unset mark for the target conversation, call this interface.
* Restrictions: The range for setting marks is [1, 20]. A maximum of 100 conversations are supported for marking at one time.
* Related callbacks: [ZIMConversationMarkSetCallback]。
*
* @param markType Mark value that needs to be set.
* @param enable Whether to enable the mark value.
* @param conversationInfos Conversation information list that needs to be set.
*/
abstract setConversationMark(markType: number, enable: boolean, conversationInfos: ZIMConversationBaseInfo[]): Promise<ZIMConversationMarkSetResult>;
/**
* Search local conversations on local messages.
*
* Available since: 2.9.0 and above.
* Description: This method is used for searching local conversations based on local messages.
* Use cases: When there is a need to search conversations using keywords or other conditions, this API can be called for searching.
* When to call: It should be invoked when there is a requirement to search conversations using keywords or other conditions.
* Restrictions: effective after logging in and becomes invalid after logging out. Searching is not supported in room scenarios (conversationType=1).
* Related callbacks: [ZIMConversationsSearchedCallback].
*
* @param config Global search conversation config.
*/
abstract searchLocalConversations(config: ZIMConversationSearchConfig): Promise<ZIMConversationsSearchedResult>;
/**
* send message.
*
* Available since: 2.4.0 and above.
* Description: This method can be used to send messages in single chat, room and group chat.
* Use cases: When you need to send message to the target user, target message room, and target group chat after logging in, send it through this interface.
* When to call: It can be called after login.
* Restrictions: The interval between sending messages should be greater than 100ms. Available after login, unavailable after logout.
* Related callbacks: [ZIMMessageSentCallback], [ZIMMessageSendNotification], [onReceivePeerMessage], [onReceiveRoomMessage], [onReceiveGroupMessage], [onConversationChanged], [onConversationTotalUnreadMessageCountUpdated].
* Related APIs: [queryHistoryMessage], [deleteAllMessage], [deleteMessages],[sendMediaMessage].
*
* @param message The message to be sent.
* @param toConversationID The conversation ID the message needs to be sent.
* @param conversationType The conversation type the message needs to be sent.
* @param config Related configuration for sending messages.
* @param notification Related notifications when messages are sent.
*/
abstract sendMessage(message: ZIMMessage, toConversationID: string, conversationType: ZIMConversationType, config: ZIMMessageSendConfig, notification?: ZIMMessageSendNotification): Promise<ZIMMessageSentResult>;
/**
* Query historical messages.
*
* Available since: 2.0.0 and above.
* Description: This method is used to query historical messages.
* Use cases: When you need to obtain past historical messages, you can call this interface to query historical messages by paging.
* When to call: Called when historical messages need to be queried.
* Restrictions: Effective after login, invalid after logout. In the default room scenario (conversationType=1), offline message is disabled. If you need to enable it, please contact the corresponding technical support.
* Related callbacks: [ZIMMessageQueriedCallback].
*
* @param conversationID The session ID of the queried historical message.
* @param conversationType conversation type.
* @param config Query the configuration of historical messages.
*/
abstract queryHistoryMessage(conversationID: string, conversationType: ZIMConversationType, config: ZIMMessageQueryConfig): Promise<ZIMMessageQueriedResult>;
/**
* Query messages based on the message seq list.
*
* Available since: 2.19.0 and above.
*
* @param messageSeqs The list of message sequence numbers to query.
* @param conversationID The session ID of the queried message.
* @param conversationType conversation type.
*/
abstract queryMessages(messageSeqs: number[], conversationID: string, conversationType: ZIMConversationType): Promise<ZIMMessageQueriedResult>;
/**
* delete message.
*
* Available since: 2.0.0 and above.
* Description: This method implements the function of deleting messages.
* Use cases: The user needs to delete a message. When the user does not need to display a message, this method can be used to delete it.
* When to call: Called when the message needs to be deleted.
* Caution: The impact of deleting messages is limited to this account.
* Restrictions: Effective after login.
* Scope of impact: If the deleted message is the latest message of the session, the [conversationChanged] callback will be triggered, and if the message is unread, the [conversationTotalUnreadMessageCountUpdated] callback will be triggered.
* Related callbacks: [ZIMMessageDeletedCallback]、[conversationChanged]、[conversationTotalUnreadMessageCountUpdated].
*
* @param messageList List of deleted messages.
* @param conversationID The session ID of the deleted message.
* @param conversationType conversation type.
* @param config Delete the configuration of the message.
*/
abstract deleteMessages(messageLis