UNPKG

zego-zim-miniprogram

Version:

ZEGO ZIM SDK for mini program

1,369 lines 97.8 kB
import { ZIMErrorCode } from './ZIMErrorCode'; /** Connection state. */ export declare enum ZIMConnectionState { /** todo */ Disconnected = 0, /** todo */ Connecting = 1, /** todo */ Connected = 2, /** todo */ Reconnecting = 3 } export declare enum ZIMConnectionEvent { Success = 0, ActiveLogin = 1, LoginTimeout = 2, LoginInterrupted = 3, KickedOut = 4, TokenExpired = 5, Unregistered = 6 } export declare enum ZIMConversationEvent { Added = 0, Updated = 1, Disabled = 2, Deleted = 3 } export declare enum ZIMConversationNotificationStatus { Notify = 1, DoNotDisturb = 2 } export declare enum ZIMConversationType { Unknown = -1, Peer = 0, Room = 1, Group = 2, CommunityChannel = 3 } /** Synchronization status of the conversation list and the server */ export declare enum ZIMConversationSyncState { /** Conversation list synchronization start status */ Started = 0, /** Conversation list synchronization completion status */ Finished = 1, /** The synchronization of the conversation list failed. The synchronization failure may be caused by network reasons. */ Failed = 2 } /** Conversation pin query filter type. */ export declare enum ZIMConversationPinnedFilter { /** Both pinned and unpinned conversations can be queried. */ All = 0, /** Only pinned conversations can be queried. */ OnlyPinned = 1, /** Only unpinned conversations can be queried. */ OnlyUnpinned = 2 } /** Conversation search mode. */ export declare enum ZIMConversationSearchMode { /** Query the corresponding conversation by searching for messages that meet the criteria. */ MatchMessage = 0, /** Query the corresponding conversation by searching for the conversation name. */ MatchConversationName = 1 } export declare enum ZIMMediaFileType { OriginalFile = 1, LargeImage = 2, Thumbnail = 3, VideoFirstFrame = 4 } export declare enum ZIMMessageDirection { Send = 0, Receive = 1 } export declare enum ZIMMessageOrder { Descending = 0, Ascending = 1 } export declare enum ZIMMessagePriority { Low = 1, Medium = 2, High = 3 } export declare enum ZIMMessageReceiptStatus { Unknown = -1, None = 0, Processing = 1, Done = 2, Expired = 3, Failed = 4 } export declare enum ZIMMessageRevokeStatus { Unknown = -1, SelfRevoke = 0, SystemRevoke = 1, ServerAPIRevoke = 2, GroupAdminRevoke = 3, GroupOwnerRevoke = 4, AuditRejectRevoke = 5 } export declare enum ZIMMessageSentStatus { Sending = 0, Success = 1, Failed = 2 } export declare enum ZIMMessageType { Unknown = 0, Text = 1, Command = 2, Multiple = 10, Image = 11, File = 12, Audio = 13, Video = 14, Barrage = 20, System = 30, Revoke = 31, Tips = 32, Combine = 100, Custom = 200 } export declare enum ZIMRevokeType { Unknown = -1, TwoWay = 0, OneWay = 1 } /** Tips message event */ export declare enum ZIMTipsMessageEvent { Unknown = 0, GroupCreated = 1, GroupDismissed = 2, GroupJoined = 3, GroupInvited = 4, GroupLeft = 5, GroupKickedOut = 6, GroupInfoChanged = 7, GroupMemberInfoChanged = 8, GroupMessagePinned = 9, CommunityCreated = 101, CommunityJoined = 103, CommunityInvited = 104, CommunityChannelCreated = 151 } /** Tips message event */ export declare enum ZIMTipsMessageChangeInfoType { Unknown = 0, GroupDataChanged = 1, GroupNoticeChanged = 2, GroupNameChanged = 3, GroupAvatarUrlChanged = 4, GroupMuteChanged = 5, GroupOwnerTransferred = 10, GroupMemberRoleChanged = 11, GroupMemberMuteChanged = 12, GroupMessagePinInfoChanged = 21 } /** Message mentioned type */ export declare enum ZIMMessageMentionedType { Unknown = 0, MentionMe = 1, MentionAll = 2, MentionAllAndMe = 3 } /** Message deleted type */ export declare enum ZIMMessageDeleteType { MessageListDeleted = 0, ConversationAllMessagesDeleted = 1, AllConversationMessagesDeleted = 2 } export declare enum ZIMMessageRepliedInfoState { Normal = 0, Deleted = 1, NotFound = 2 } export declare enum ZIMMessagePinStatus { NotPinned = 0, Pinned = 1, Updated = 2 } /** User operation action for message reactions. */ export declare enum ZIMMessageReactionUserChangeAction { /** Add message reaction. */ Added = 0, /** Delete message reaction. */ Deleted = 1 } export declare enum ZIMRoomEvent { Success = 0, NetworkInterrupted = 1, NetworkDisconnected = 2, RoomNotExist = 3, ActiveCreate = 4, CreateFailed = 5, ActiveEnter = 6, EnterFailed = 7, KickedOut = 8, ConnectTimeout = 9, KickedOutByOtherDevice = 10, ActiveSwitch = 11, SwitchFailed = 12 } export declare enum ZIMRoomState { Disconnected = 0, Connecting = 1, Connected = 2 } export declare enum ZIMRoomAttributesUpdateAction { Set = 0, Delete = 1 } export declare enum ZIMRoomMemberAttributesUpdateAction { Set = 0 } export declare enum ZIMGroupState { Quit = 0, Enter = 1 } export declare enum ZIMGroupEvent { /** Unknown event. */ Unknown = -1, Created = 1, Dismissed = 2, Joined = 3, Invited = 4, Left = 5, KickedOut = 6 } export declare enum ZIMGroupMemberEvent { /** Unknown event. */ Unknown = -1, Joined = 1, Left = 2, KickedOut = 4, Invited = 5 } export declare enum ZIMGroupMemberState { Quit = 0, Enter = 1 } export declare enum ZIMGroupMessageNotificationStatus { Notify = 1, Disturb = 2 } export declare enum ZIMGroupAttributesUpdateAction { Set = 0, Delete = 1 } export declare enum ZIMGroupMuteMode { None = 0, Normal = 1, All = 2, Custom = 3 } export declare enum ZIMGroupJoinMode { Any = 0, Auth = 1, Forbid = 2 } export declare enum ZIMGroupInviteMode { Any = 0, Admin = 1 } export declare enum ZIMGroupBeInviteMode { None = 0, Auth = 1 } export declare enum ZIMGroupEnterType { Unknown = 0, Created = 1, JoinApply = 2, Joined = 3, Invited = 4, InviteApply = 5 } export declare enum ZIMGroupApplicationType { Unknown = -1, None = 0, Join = 1, Invite = 2, BeInvite = 3 } export declare enum ZIMGroupApplicationState { Unknown = -1, Waiting = 1, Accepted = 2, Rejected = 3, Expired = 4, Disabled = 5 } export declare enum ZIMGroupApplicationListChangeAction { Added = 0 } export declare enum ZIMCallInvitationMode { Unknown = -1, General = 0, Advanced = 1 } export declare enum ZIMCallState { Unknown = -1, Started = 1, Ended = 2 } export declare enum ZIMCallUserState { Unknown = -1, Inviting = 0, Accepted = 1, Rejected = 2, Cancelled = 3, Offline = 4, Received = 5, Timeout = 6, Quit = 7, Ended = 8, NotYetReceived = 9, BeCancelled = 10 } export declare enum ZIMFriendListChangeAction { Added = 0, Deleted = 1 } export declare enum ZIMFriendApplicationListChangeAction { Added = 0, Deleted = 1 } export declare enum ZIMFriendApplicationType { Unknown = -1, None = 0, Received = 1, Sent = 2, Both = 3 } export declare enum ZIMFriendApplicationState { Unknown = -1, Waiting = 1, Accepted = 2, Rejected = 3, Expired = 4, Disabled = 5 } export declare enum ZIMFriendRelationCheckType { Both = 0, Single = 1 } export declare enum ZIMFriendDeleteType { Both = 0, Single = 1 } export declare enum ZIMUserRelationType { Unknown = 0, SingleNo = 1, SingleHave = 2, BothAllNo = 3, BothSelfHave = 4, BothOtherHave = 5, BothAllHave = 6 } export declare enum ZIMBlacklistChangeAction { Added = 0, Removed = 1 } export declare enum ZIMCXHandleType { Generic = 1, PhoneNumber = 2, EmailAddress = 3 } export declare enum ZIMGeofencingType { None = 0, Include = 1, Exclude = 2 } export declare enum ZIMPlatformType { Win = 1, IPhoneOS = 2, Android = 3, MacOS = 4, Linux = 5, Web = 6, MiniProgram = 7, IPadOS = 9, OHOS = 10, Unknown = 32 } export declare enum ZIMUserOnlineStatus { Online = 0, Offline = 1, Logout = 2, Unknown = 99 } export declare enum ZIMMessageQueryMode { General = 0, PreferServer = 1, OnlyLocal = 2 } /** * Error infomation * * Description: Error infomation. */ export interface ZIMError { /** Description: The storage path of the log files. Refer to the official website document for the default path. */ code: ZIMErrorCode; /** Description: Error infomation description. */ message: string; } /** * ZIM application configuration, including AppID and AppSign. */ export interface ZIMAppConfig { /** Description:AppID, please go to the ZEGO official website console to apply for it. Required: Required. */ appID: number; } /** * Log configuration * * Log configuration */ export interface ZIMLogConfig { logLevel: 'debug' | 'info' | 'warn' | 'error' | 'report' | 'disable'; } /** * User information object. * * Description: Identifies a unique user. * Caution: Note that the userID must be unique under the same appID, otherwise mutual kicks out will occur.It is strongly recommended that userID corresponds to the user ID of the business APP,that is, a userID and a real user are fixed and unique, and should not be passed to the SDK in a random userID.Because the unique and fixed userID allows ZEGO technicians to quickly locate online problems. */ export interface ZIMUserInfo { /** User ID, a string with a maximum length of 32 bytes or less. It is customized by the developer. Only support numbers, English characters and '!', '#', '$', '%', '&', '(', ')', '+', '-', ':', ';', '<', '=', '.', '>', '?', '@', '[', ']', '^', '_', '{', '}', '|', '~'. */ userID: string; /** Description: User name, defined by you. For version 2.0.0 and onwards, the string has a maximum length of 256 bytes.Required: Not required.Privacy reminder: Please do not provide sensitive personal information, including but not limited to mobile phone numbers, ID card numbers, passport numbers, and real names. */ userName: string; /** User avatar URL */ userAvatarUrl: string; /** User extended data. This field is currently only available in room related interfaces. */ userExtendedData: string; } /** * User full information object. * * Description: Identifies a unique user. * Caution: Note that the userID must be unique under the same appID, otherwise mutual kicks out will occur.It is strongly recommended that userID corresponds to the user ID of the business APP,that is, a userID and a real user are fixed and unique, and should not be passed to the SDK in a random userID.Because the unique and fixed userID allows ZEGO technicians to quickly locate online problems. */ export interface ZIMUserFullInfo { /** Description: User basic information. */ baseInfo: ZIMUserInfo; /** @deprecated Deprecated in version 2.13.0. To obtain the URL of a user\'s avatar, please refer to userAvatarUrl from the baseInfo. */ userAvatarUrl: string; /** @deprecated Deprecated in version 3.0.0. To obtain the extended data of a user, please refer to userExtendedData from the baseInfo. */ extendedData: string; } export interface ZIMUserOfflinePushRule { onlinePlatforms: ZIMPlatformType[]; notToReceiveOfflinePushPlatforms: ZIMPlatformType[]; } export interface ZIMUserRule { offlinePushRule: ZIMUserOfflinePushRule; } /** * User status. */ export interface ZIMUserStatus { userID: string; onlineStatus: ZIMUserOnlineStatus; onlinePlatforms: ZIMPlatformType[]; customStatus: string; customStatusExpiredTime: number; lastUpdateTime: number; lastOnlineStatusUpdateTime: number; lastCustomStatusUpdateTime: number; } /** * User status subscription configuration. */ export interface ZIMUserStatusSubscription { userStatus: ZIMUserStatus; subscribeExpiredTime: number; } /** * Self user information object. */ export interface ZIMSelfUserInfo { userFullInfo: ZIMUserFullInfo; userRule: ZIMUserRule; userStatus: ZIMUserStatus; } /** * User status subscription configuration. */ export interface ZIMUserStatusSubscribeConfig { /** Subscription duration, in minutes. */ subscriptionDuration: number; } /** * User status subscription table query configuration. */ export interface ZIMSubscribedUserStatusQueryConfig { /** List of user IDs to query. */ userIDs: string[]; } /** * todo * * todo */ export interface ZIMErrorUserInfo { userID: string; reason: number; } /** * Configuration of login-related parameters. * * Supported version: 2.13.0 and above. * Description: Login-related parameters. * Use cases: Used to set different parameters during login. */ export interface ZIMLoginConfig { /** Description: User name.Use cases: Used in the scenario where user nickname is modified during login, leave it blank if no change is needed.Required: No. */ userName: string; /** Description: Token carried during login.Use cases: Only pass this parameter in the scenario where token is used for authentication.Required: No. */ token: string; /** Description: Whether it is offline login.Use cases: Set this parameter to true when performing offline login.Required: No.Default value: false. */ isOfflineLogin: boolean; /** Description: Custom status.Use cases: Only pass this parameter when you need to customize the user status during login.Required: No. */ customStatus: string; customStatusDuration: number; } /** * Logout parameter configuration. * * Supported versions: 2.28.0 and later. * Detailed description: Parameters related to logout. * Business scenario: Used to configure specific behaviors during logout. */ export interface ZIMLogoutConfig { /** Whether to clear the current user’s local DB data when logging out. Default: [false]. */ isClearDB: boolean; } /** * User information query configuration. * * Detailed description: User information query configuration, you can choose to query from the local or from the server. Query the unlimited frequency constraints from the local, and query the limited frequency constraints from the server. You can only query the detailed configuration of 10 users within 10 s. */ export interface ZIMUsersInfoQueryConfig { /** Detail description: Whether to query user details from the server. Query the unlimited frequency constraints from the local, and query the limited frequency constraints from the server. You can only query the detailed configuration of 10 users within 10 s.Required: not required.Default: false. */ isQueryFromServer: boolean; } /** * The private message template is currently only applicable to the OPPO manufacturer. * * The private message template is currently only applicable to the OPPO manufacturer. */ export interface ZIMOfflinePushPrivateMessageTemplate { /** Description: The private message template ID is currently only applicable to OPPO manufacturers. Please fill in the template ID preset in the OPPO Open Platform console. */ templateID: string; /** Description: To replace the content of the preset title field in the template, a json string needs to be filled in, such as "{"user_name":" Li Hua "}". */ titleParameters: string; /** Description: To replace the content of the preset fields in the template, a json string needs to be filled in, such as "{"city":" Shenzhen "}". */ contentParameters: string; } /** * Provides information about the iOS VoIP offline push. * * Provides information about the iOS VoIP offline push. */ export interface ZIMVoIPConfig { /** Description: The type of contact information for the VoIP caller, by default, is generic. */ iOSVoIPHandleType: ZIMCXHandleType; /** Description: The contact information of the VoIP caller. It is related to iOSVoIPHandleType. When iOSVoIPHandleType is PhoneNumber, the Value is a sequence of digits; when iOSVoIPHandleType is EmailAddress, the Value is an email address; when the contact information is of other types, the Value typically follows some domain-specific format, such as a username, numeric ID, or URL. */ iOSVoIPHandleValue: string; /** Description: Video call or not. The default value is audio */ iOSVoIPHasVideo: boolean; } /** * Description: Offline push configuration. * * Details: Configuration before sending offline push. */ export interface ZIMPushConfig { /** Description: Used to set the push title.Required: Not required. */ title: string; /** Description: Used to set offline push content.Required: Not required. */ content: string; /** Description: This parameter is used to set the pass-through field of offline push.Required: Not required. */ payload: string; /** Description: Offline push advanced configuration for mapping console Settings, with the maximum of 32 characters and defined by yourself.Required: Not required. */ resourcesID: string; /** Description: Used to set the thread ID of offline push.Required: Not required. */ threadID: string; /** Description: Push whether to carry corner information switch. */ enableBadge: boolean; /** Description: The incremental index number carried by the push. */ badgeIncrement: number; /** Description: If you use Flutter, RN ZPNs, offline push receiving device has iOS and uses VoIP push type, you can customize some VoIP options with this parameter. */ voIPConfig?: ZIMVoIPConfig; /** Description: If you use OPPO Push, you can carry the push template through this field. */ privateMessageTemplate?: ZIMOfflinePushPrivateMessageTemplate; } /** * Configuration for adding reactions. */ export interface ZIMMessageReactionAddConfig { /** Description: When this value is greater than 0, the same user is allowed to react multiple times with the same reaction type, and the counts from those reactions will be accumulated. */ increaseCount: number; } /** * reaction user information. * * Detail description: A class describing reaction user. */ export interface ZIMMessageReactionUserInfo { /** Description: user ID */ userID: string; } /** * message reaction infos * * Description: message reaction infos. */ export interface ZIMMessageReaction { /** Description: Type of reaction, defined by you, with a maximum length of 32 bytes. */ reactionType: string; /** Description: conversationID. */ conversationID: string; /** Description: conversation type. */ conversationType: ZIMConversationType; /** Detail description: reaction message ID. */ messageID: string; /** Description: The reaction users number. */ totalCount: number; /** Description: The reaciton users if included myself. */ isSelfIncluded: boolean; /** Description: Reaction user info list. */ userList: ZIMMessageReactionUserInfo[]; /** Detailed description: The sum count of reaction. */ sumCount: number; } /** * message reaction infos * * Description: message reaction infos. */ export interface ZIMMessageReactionSimpleInfo { /** Description: Type of reaction, defined by you, with a maximum length of 32 bytes. */ reactionType: string; /** Detailed description: The sum count of reaction. */ sumCount: number; } /** * message reaction user full information. * * Detail description: A class describing reaction user. */ export interface ZIMMessageReactionUserFullInfo { /** Description: user ID */ userID: string; /** Description: A list of summary information for the current user’s reactions under this message. */ reactions: ZIMMessageReactionSimpleInfo[]; } /** * User operation change information for message reactions. * * Description: A class that describes reaction change information. */ export interface ZIMMessageReactionUserChangeInfo { userID: string; reactionType: string; action: ZIMMessageReactionUserChangeAction; /** Description: The sum count for the current reaction type. */ sumCount: number; } /** * message reaction change information. * * Description: A class that describes reaction change information. */ export interface ZIMMessageReactionChangeInfo { /** Description: The message object containing updated reaction information, which can be used to directly replace the old data held by the developer. */ message: ZIMMessage; /** Description: A list of user reaction operation changes under the current message. */ userChangeInfoList: ZIMMessageReactionUserChangeInfo[]; } /** * Message lite information. * * Detailed description: Message lite information. */ export interface ZIMMessageLiteInfo { /** Description: Message type. */ type: ZIMMessageType; } /** * Text message lite information. */ export interface ZIMTextMessageLiteInfo extends ZIMMessageLiteInfo { /** Description: Text message content. */ message: string; type: ZIMMessageType.Text; } /** * Custom message lite information. */ export interface ZIMCustomMessageLiteInfo extends ZIMMessageLiteInfo { /** Description: Custom message content. */ message: string; /** Description: Custom message search content. */ searchedContent: string; /** Description: Custom message sub-type. */ subType: number; type: ZIMMessageType.Custom; } /** * Combine message lite information. */ export interface ZIMCombineMessageLiteInfo extends ZIMMessageLiteInfo { /** Description: Combine message title. */ title: string; /** Description: Combine message summary. */ summary: string; type: ZIMMessageType.Combine; } /** * Revoke message lite information. */ export interface ZIMRevokeMessageLiteInfo extends ZIMMessageLiteInfo { type: ZIMMessageType.Revoke; } /** * Media message lite information. */ export interface ZIMMediaMessageLiteInfo extends ZIMMessageLiteInfo { /** Description: Media file size. */ fileSize?: number; /** Description: Media file name. */ fileName?: string; /** Description: Media file local path. */ fileLocalPath?: string; /** Description: Media file download address. */ fileDownloadUrl?: string; } /** * Image message lite information. */ export interface ZIMImageMessageLiteInfo extends ZIMMediaMessageLiteInfo { /** Description: Original image width. */ originalImageWidth?: number; /** Description: Original image height. */ originalImageHeight?: number; /** Description: Large image width. */ largeImageWidth?: number; /** Description: Large image height. */ largeImageHeight?: number; /** Description: Large image download address. */ largeImageDownloadUrl?: string; /** Description: Thumbnail image width. */ thumbnailWidth?: number; /** Description: Thumbnail image height. */ thumbnailHeight?: number; /** Description: Thumbnail image download address. */ thumbnailDownloadUrl?: string; type: ZIMMessageType.Image; } /** * File message lite information. */ export interface ZIMFileMessageLiteInfo extends ZIMMediaMessageLiteInfo { type: ZIMMessageType.File; } /** * Audio message lite information. */ export interface ZIMAudioMessageLiteInfo extends ZIMMediaMessageLiteInfo { /** Description: Audio duration. */ audioDuration: number; type: ZIMMessageType.Audio; } /** * Video message lite information. */ export interface ZIMVideoMessageLiteInfo extends ZIMMediaMessageLiteInfo { /** Description: Video duration. */ videoDuration: number; /** Description: Video first frame width. */ videoFirstFrameWidth: number; /** Description: Video first frame height. */ videoFirstFrameHeight?: number; /** Description: Video first frame download address. */ videoFirstFrameDownloadUrl?: string; type: ZIMMessageType.Video; } /** * Multiple messages lite information. */ export interface ZIMMultipleMessageLiteInfo extends ZIMMessageLiteInfo { /** Description: Message list. */ messageInfoList: ZIMMessageLiteInfo[]; type: ZIMMessageType.Multiple; } /** * Message replied information. */ export interface ZIMMessageRepliedInfo { /** Description: Message replied state. */ state: ZIMMessageRepliedInfoState; /** Description: Replied message lite information. */ messageInfo: ZIMMessageLiteInfo; /** Description: Sender user ID of the replied message. */ senderUserID: string; /** Description: Sent time of the replied message. */ sentTime: number; /** Description: ID of the replied message. */ messageID: string; /** Description: Sequence number of the replied message. */ messageSeq: number; } /** * Base class of message object * * Description: Identifies the basic parameters of a message.Caution: Some of the parameters, such as Message ID, only have values ​​during the callback.Developers do not need to assign values ​​to these parameters when they actively create this object for sending messages. */ export interface ZIMMessage { /** Identifies the type of this message. */ type: ZIMMessageType; /** Description: The unique ID that identifies this message.Use cases: Can be used to index other messages.Caution: When the developer actively creates a message, there is no need to modify this parameter.This parameter only has a value during callback. */ messageID?: string; /** Description: SDK locally generated MessageID, developers do not need to pay attention to. */ localMessageID?: string; /** Description: The sequence number of the message. */ messageSeq?: number; /** Description:Displays the userID of the sender of this message. */ senderUserID?: string; /** Description: Conversation ID. Ids of the same conversation type are unique. */ conversationID?: string; /** Description: The type of conversation to which the message belongs. */ conversationType?: ZIMConversationType; /** Description: Used to describe whether a message is sent or received. */ direction?: ZIMMessageDirection; /** Description: Describes the sending status of a message. */ sentStatus?: ZIMMessageSentStatus; /** Description: Identifies the sending time of a messageUse cases: Used to present the sending time of a message, and can be used for message sorting.Caution: This is a standard UNIX timestamp, in milliseconds. */ timestamp?: number; /** Description:The larger the orderKey, the newer the message, and can be used for ordering messages. */ orderKey?: number; /** Detail description: Describes whether the message is a message inserted by the developer through [insertMessageToLocalDB].Default: false. */ isUserInserted?: boolean; /** Detailed Description: Describe the receipt status of the messageBusiness scenario: used to determine the status of the current message in the receipt message */ receiptStatus?: ZIMMessageReceiptStatus; /** Description: message extension field Use cases: You can add extended fields to the message and send it to the peer Required: no Caution:the length is 1k, you can contact technical support for configuration Available since: 2.6.0 or higher */ extendedData?: string; /** Description: The expandable message field visible only on this end can store additional information locally, Through [updateMessageLocalExtendedData] change and currently has a length limit of 128K. If you have special requirements, please contact ZEGO technical support for configuration. */ localExtendedData?: string; /** Description: Message statement list, which can carry data strongly related to users such as emoji expressions and voting information. */ reactions?: ZIMMessageReaction[]; /** Description: Whether the message is pushed by all employees. Required: Internal assignment. */ isBroadcastMessage?: boolean; /** Description: Whether to mention everyone. It can be presented as "@User". Use cases: For example, it can be used in sending messages. Required: No. Caution: This value does not add the "@User" to the message text. Developers need to implement it themselves. Available since: 2.14.0 or above */ mentionedUserIDs?: string[]; /** Description: Whether to mention everyone. It can be presented as "@Everyone". Use cases: For example, it can be used in groups or rooms. Required: No. Default value: false. Recommended value: Set to true if you need to mention everyone. Caution: This value does not add the "@Everyone" to the message text. Developers need to implement it themselves. Available since: 2.14.0 or above */ isMentionAll?: boolean; /** Description: Message reply information. */ repliedInfo?: ZIMMessageRepliedInfo; /** Description: Root replied count. */ rootRepliedCount?: number; isServerMessage?: boolean; /** Description: The userID of the message editor. */ editorUserID?: string; /** Description: The time of message editing. */ editedTime?: number; /** Indicates whether the message is a group-targeted message. */ isGroupTargetedMessage?: boolean; /** Description: The userID of the message pinner. */ pinnedUserID?: string; /** Description: The time of message pinning. */ pinnedTime?: number; } /** * Base class for media message objects. * * Detail description: Identifies a media message. * Note: This base class is the basis of all media messages and contains the properties required by media messages. */ export interface ZIMMediaMessage extends ZIMMessage { /** Detail description: The local path of the media message. Required: If a local file is sent, this parameter must be set by the sender. Otherwise, the message fails to be sent. */ fileLocalPath?: string; /** Detail description: The external download url of the media message is used for the developer to transparently transmit the media file to other users by filling in this URL when the developer uploads the media file to his own server.Required or not: If an external URL is sent, this parameter is mandatory on the sender end. */ fileDownloadUrl?: string; /** Detail description: The unique ID of the media file. Required or not: The sender does not need to fill in, this value is generated by the SDK. */ fileUID?: string; /** Detail description: The filename of the media file. Required or not: If you are sending an external URL, you need to fill in this value and include the file extension. If a local file is sent, the value is optional. */ fileName?: string; /** Detail description: The size of the media file. Required or not: The sender does not need to fill in, this value is generated by the SDK. */ fileSize?: number; } /** * Normal text message object. * * Description: Identifies the basic parameters of a message. * Caution: If the Type parameter of the base class is Text during callback, you can force the base class message object to be of this type. */ export interface ZIMTextMessage extends ZIMMessage { /** The content of the text message. */ message: string; type: ZIMMessageType.Text; } /** * System text message object. * * Detail description: Identifies a system text message. * Note: If the Type parameter of the base class is System during the callback, the base class message object can be cast to this class. * * @deprecated Deprecated since ZIM 2.8.0, please use [ZIMCustomMessage] instead. */ export interface ZIMSystemMessage extends ZIMMessage { /** Detailed description: The content of the message, which supports UTF-8 strings. */ message: string; type: ZIMMessageType.System; } /** * Custom message object. * * todo */ export interface ZIMCustomMessage extends ZIMMessage { /** The content of the text message. */ message: string; /** Description: The search content of the message. */ searchedContent?: string; /** Description: The subtype of the message, which is used by customers to customize the usage of different custom messages. Required: The sender is required, otherwise the message will fail to be sent. */ subType: number; type: ZIMMessageType.Custom; } /** * Custom binary message object. * * Description: Identifies a binary message. * Caution: If the Type parameter of the base class is Custom during callback, you can force the base class message object to be of this type. */ export interface ZIMCommandMessage extends ZIMMessage { /** The content of the custom message. */ message: Uint8Array; type: ZIMMessageType.Command; } /** * Barrage message class. * * Description: The barrage message class does not appear in the session and does not store historical messages. */ export interface ZIMBarrageMessage extends ZIMMessage { /** Description: The content of the barrage message. */ message: string; type: ZIMMessageType.Barrage; } /** * Image message object. * * Description: Identifies the basic parameters of a message. * Caution: If the Type parameter of the base class is Image during callback, you can force the base class message object to be of this type. */ export interface ZIMImageMessage extends ZIMMediaMessage { /** Detail description: Thumbnail external download URL of the image file. When developers upload thumbnails to their own servers, the SDK can pass through this field to other users. Required or not: optional on the sender side, this field will only take effect when fileDownloadUrl is filled in. */ thumbnailDownloadUrl?: string; /** Detail description: large Image external download URL of the image file. When developers upload large Images to their own servers, the SDK can pass through this field to other users.Required or not: optional on the sender side, this field will only take effect when fileDownloadUrl is filled in. */ largeImageDownloadUrl?: string; /** Detailed description: The width of the original image. */ originalImageWidth?: number; /** Detailed description: The height of the original image. */ originalImageHeight?: number; /** Detailed description: The width of the large image. */ largeImageWidth?: number; /** Detailed description: The height of the large image. */ largeImageHeight?: number; /** Detailed description: The width of the thumbnail. */ thumbnailWidth?: number; /** Detailed description: The height of the thumbnail. */ thumbnailHeight?: number; type: ZIMMessageType.Image; } /** * File message object. * * Description: Identifies the basic parameters of a message. * Caution: If the Type parameter of the base class is File during callback,you can force the base class message object to be of this type. */ export interface ZIMFileMessage extends ZIMMediaMessage { type: ZIMMessageType.File; } /** * Audio message object. * * Description: Identifies the basic parameters of a message. * Caution: If the Type parameter of the base class is Audio during callback, you can force the base class message object to be of this type. */ export interface ZIMAudioMessage extends ZIMMediaMessage { /** Detail description: The duration of the audio file. Required: Required by the sender, if not filled, the audio message will fail to be sent When sending local audio messages. */ audioDuration: number; type: ZIMMessageType.Audio; } /** * Video message object. * * todo */ export interface ZIMVideoMessage extends ZIMMediaMessage { /** Detail description: The duration of the video file. Required: Required by the sender, if not filled, the video message will fail to be sent when sending local video messages. */ videoDuration: number; /** Detail description: Video first frame external download URL of the video file. When developers upload thumbnails to their own servers, the SDK can pass through this field to other users. Required or not: optional on the sender side, this field will only take effect when fileDownloadUrl is filled in. */ videoFirstFrameDownloadUrl?: string; /** Detailed description: The width of the first frame of the video. */ videoFirstFrameWidth?: number; /** Detailed description: The height of the first frame of the video. */ videoFirstFrameHeight?: number; type: ZIMMessageType.Video; } /** * Base class for revoke message objects. * * Detail description: Identifies a revoke message. * Note: This base class is the basis of all revoke messages and contains the properties required by revoke messages. */ export interface ZIMRevokeMessage extends ZIMMessage { /** Detail description: revoke type. */ revokeType: ZIMRevokeType; /** Detail description: revoke timestamp. */ revokeTimestamp: number; /** Detail description: operated user ID. */ operatedUserID: string; /** Description: original message type */ originalMessageType: ZIMMessageType; /** Detail description: original text message content, if the message to be revoked is not a text message, this field is empty. */ originalTextMessageContent: string; /** Detail description: revoke extended data. */ revokeExtendedData: string; /** Detail description: revoke status. */ revokeStatus: ZIMMessageRevokeStatus; type: ZIMMessageType.Revoke; } /** * Base class for combine message objects. * * Detail description: Identifies a combine message. * Note: This base class is the basis of all combine messages and contains the properties required by combine messages. * Available since: 2.14.0 and above. */ export interface ZIMCombineMessage extends ZIMMessage { /** Detail description: Combine message title. */ title: string; /** Detail description: The summary of combine message. */ summary: string; /** Detail description: Combine ID, internal used */ combineID?: string; /** List of child messages */ messageList: ZIMMessage[]; type: ZIMMessageType.Combine; } /** * Tips message. */ export interface ZIMTipsMessage extends ZIMMessage { /** Detail description: Tips event type. */ event: ZIMTipsMessageEvent; /** Detail description: Operated user information. */ operatedUser: ZIMUserInfo; /** Detail description: Target user list. */ targetUserList: ZIMUserInfo[]; /** Detail description: Change information. */ changeInfo?: ZIMTipsMessageChangeInfo; type: ZIMMessageType.Tips; } /** * Multiple message. */ export interface ZIMMultipleMessage extends ZIMMessage { /** Detail description: List of content in the multiple message. */ messageInfoList: ZIMMessageLiteInfo[]; /** Detail description: List of failed index in the multiple message. */ failedIndexList?: number[]; type: ZIMMessageType.Multiple; } /** * Message root replied information. */ export interface ZIMMessageRootRepliedInfo { /** Description: Message replied state. */ state: ZIMMessageRepliedInfoState; /** Description: Root message. */ message?: ZIMMessage; /** Description: Sender user ID of the root message. */ senderUserID: string; /** Description: Sent time of the root message. */ sentTime: number; /** Description: Root replied count. */ repliedCount: number; } /** * Message root replied count information. */ export interface ZIMMessageRootRepliedCountInfo { /** Description: Message ID. */ messageID: string; /** Description: Conversation ID. */ conversationID: string; /** Description: Conversation type. */ conversationType: ZIMConversationType; /** Description: Root replied count. */ count: number; } /** * message mention information. * * message mention information. */ export interface ZIMMessageMentionedInfo { /** Description: Message ID, used to match the notification information to which message it belongs toRequired or not: Developers do not need to fill in. */ messageID: string; /** Description: Message sequence number, used to match the notification information to which message it belongs toRequired or not: Developers do not need to fill in. */ messageSeq: number; /** Description: From which user. Required: Developers do not need to fill in. */ fromUserID: string; /** Details Description: Type of notification, used to distinguish between reminding oneself and reminding everyone. Required: Developers do not need to fill in. */ type: ZIMMessageMentionedType; } /** * Additional information when receiving messages. */ export interface ZIMMessageReceivedInfo { /** Description: Whether it is an offline message. */ isOfflineMessage: boolean; } /** * Configurations related to sending messages. * * Description: Configurations related to sending messages. */ export interface ZIMMessageSendConfig { /** Description: Configures the offline push function, If Android or iOS platform is integrated, it is strongly recommended to configure this. Required: Not mandatory. */ pushConfig?: ZIMPushConfig; /** Enumeration value used to set message priority. Required: Must mandatory. */ priority: ZIMMessagePriority; /** Detailed description: When sending a message, whether the message has a receipt.Business scenario: use when you need to bring a receipt for a message.Required: not required.Default value: false. */ hasReceipt?: boolean; /** todo */ isNotifyMentionedUsers?: boolean; /** todo */ isRetrySend?: boolean; /** When sending messages that would otherwise affect the other party's unread count, should they no longer be counted as unread by the other party? Whether required: Not required. Default value: false. */ disableUnreadMessageCount?: boolean; /** Whether to allow some sub-messages to fail to send when sending a multiple message. Whether required: Not required. Default value: false. */ isAllowMultipleMessagePartialFailed?: boolean; } /** * Example Query message configuration. * * Description: Example Query the configurations of messages. */ export interface ZIMMessageQueryConfig { /** Description: Query the anchor point of the message. Required: This parameter is not required for the first query but is required for subsequent paging queries. */ nextMessage?: ZIMMessage; /** Description: Number of query messages. Required: not required. */ count: number; /** Description: Indicates whether the query is in reverse order. Required: not required. Default value: false. */ reverse: boolean; mode: ZIMMessageQueryMode; } /** * Revoke configurations related to messages. * * Description: Revoke configurations related to messages. */ export interface ZIMMessageRevokeConfig { /** Description: Configures the offline push function, If Android or iOS platform is integrated, it is strongly recommended to configure this. Required: Not required. */ pushConfig?: ZIMPushConfig; /** Description: revoking additional messages. Required: Not required. */ revokeExtendedData?: string; } /** * Delete message configuration. * * Description: Delete configurations related to messages. */ export interface ZIMMessageDeleteConfig { /** Description: Whether to remove flags for server messages. Required: not required. Default value: false. */ isAlsoDeleteServerMessage: boolean; } /** * The notification callback when the message is sent, you can get the relevant information before the message object is sent through this notification * * Detailed description: Through this notification, developers can obtain relevant information before the message object is sent, such as localMessageID, etc. * Business scenario: When developers need to record and cache relevant information before sending a message, they can obtain it by listening to the notification. * Note: If no monitoring is required, it can be passed null. */ export interface ZIMMessageSendNotification { /** Detail description: After the message falls into the local DB, the notification will be called back before the message is sent to the server. Business scenario: This interface can be used when the developer needs to obtain the relevant information in the message in advance before sending the message. Required: not required. If no monitoring is required, it can be passed empty. Default: empty. */ onMessageAttached?: ZIMMessageAttachedResult; /** Description: Media file upload progress. */ onMediaUploadingProgress?: ZIMMediaUploadingProgress; /** Description: Multiple media file upload progress. */ onMultipleMediaUploadingProgress?: ZIMMultipleMediaUploadingProgress; } /** * todo * * todo */ export interface ZIMMediaMessageSendNotification { /** Detail description: After the message falls into the local DB, the notification will be called back before the message is sent to the server. Business scenario: This interface can be used when the developer needs to obtain the relevant information in the message in advance before sending the message. Required: not required. If no monitoring is required, it can be passed empty. Default: empty. */ onMessageAttached?: ZIMMessageAttachedResult; onMediaUploadingProgress?: ZIMMediaUploadingProgress; } /** * receipt information. * * Detailed description: receipt information. */ export interface ZIMMessageReceiptInfo { /** Detail description: receipt status. */ status: ZIMMessageReceiptStatus; /** Detailed Description: Message ID. Business scenario: Developers can match the loaded message list according to this ID. Is it required: No, SDK fills in. */ messageID: string; conversationID: string; conversationType: ZIMConversationType; /** Description: Number of read members. */ readMemberCount: number; /** Description: Number of unread members. */ unreadMemberCount: number; /** Description: Whether it is self-operated by multi-terminal. */ isSelfOperated: boolean; /** Description: All the recipients have read the timestamp of that moment. */ readTime: number; } /** * Configuration for querying reaction user list * * Description: When querying reaction member, you need to configure this object. */ export interface ZIMMessageReactionUserQueryConfig { /** Description: The flag of the paging query. For the first query, set this field to an empty string. If the "nextFlag" field of the [ZIMMessageReactionUserListQueriedCallback] callback is not an empty string, it needs to be set here to continue the query on the next page.Required: Not required. */ nextFlag: number; /** Description: How many members are retrieved in one query, 100 at most.Caution: To obtain members in pages to reduce overhead, it is recommended to obtain within 20 members at a time. If the value is 0, the SDK will query 100 members by default.Required: Required. */ count: number; /** Description: reaction type, defined by you. */ reactionType: string; } /** * todo * * todo */ export interface ZIMMessageSentStatusChangeInfo { status: ZIMMessageSentStatus; message: ZIMMessage; reason: string; } /** * todo * * todo */ export interface ZIMMessageSearchConfig { nextMessage?: ZIMMessage; count: number; order: ZIMMessageOrder; keywords: string[]; messageTypes: ZIMMessageType[]; subMessageTypes: number[]; senderUserIDs: string[]; startTime: number; endTime: number; } /** * todo * * todo */ export interface ZIMMessageRepliedListQueryConfig { nextFlag: number; count: number; } /** * todo * * todo */ export interface ZIMMessageEditConfig { } /** * todo * * todo */ export interface ZIMSendingMessageCancelConfig { } /** * Pinning message configuration */ export interface ZIMMessagePinConfig { /** When the number of pinned messages exceeds the limit, replacing older pinned messages in the pinned list during the next pin operation is not allowed. The default value is [false]. */ disableAutoReplace: boolean; } /** * todo * * todo */ export interface ZIMTipsMessageChangeInfo { type: ZIMTipsMessageChangeInfoType; } /** * todo * * todo */ export interface ZIMTipsMessageGroupChangeInfo extends ZIMTipsMessageChangeInfo { groupDataFlag: number; groupName: string; groupNotice: string; groupAvatarUrl: string; groupMutedInfo?: ZIMGroupMuteInfo; } /** * todo * * todo */ export interface ZIMTipsMessageGroupMemberChangeInfo extends ZIMTipsMessageChangeInfo { memberRole: number; muteExpiredTime: number; /** Detailed description: tips message generated when the original group owner leaves the group and causes a change in the group owner. This field is true and indicates a newly created group owner. */ groupNewOwner?: ZIMGroupMemberSimpleInfo; } /** * todo * * todo */ export interface ZIMTipsMessagePinStatusChangeInfo extends ZIMTipsMessageChangeInfo { isPinned: boolean; } /** * Message pin status change. */ export interface ZIMMessagePinStatusChangeInfo { /** Message pin status */ pinStatus: ZIMMessagePinStatus; /** The message object whose pin status changed. */ message: ZIMMessage; } /** * todo * * todo */ export interface ZIMConversation { conversationID: string; type: ZIMConversationType; conversationName: string; conversationAvatarUrl: string; /** todo */ conversationAlias: string; notificationStatus: ZIMConversationNotificationStatus; unreadMessageCount: number; readMessageSeq: number; lastMessage?: ZIMMessage; orderKey: number; isPinned: boolean; /** Description: The timestamp of conversation pinned. */ pinnedTime: number; mentionedInfoList: ZIMMessageMentionedInfo[]; draft: string; marks: number[]; } /** * Conversation base i