zego-zim-web
Version:
ZEGO ZIM SDK for Web
1,322 lines • 174 kB
TypeScript
import { ZIMErrorCode } from './ZIMErrorCode';
/** Connection state. */
export declare enum ZIMConnectionState {
/** Unconnected state, enter this state before logging in and after logging out. */
Disconnected = 0,
/** The state that the connection is being requested. It will enter this state after successful execution login function. */
Connecting = 1,
/** The state that is successfully connected. */
Connected = 2,
/** The connection is being reconnected. */
Reconnecting = 3
}
/** The event that caused the connection status to change. */
export declare enum ZIMConnectionEvent {
/** Success. */
Success = 0,
/** The user actively logs in. */
ActiveLogin = 1,
/** Connection timed out. */
LoginTimeout = 2,
/** The network connection is temporarily interrupted. */
LoginInterrupted = 3,
/** Being kicked out. */
KickedOut = 4,
/** Detail description: Disconnected due to expired login token. */
TokenExpired = 5,
/** The user account was unregistered. */
Unregistered = 6
}
/** conversation changed event. */
export declare enum ZIMConversationEvent {
/** A new conversation was added. */
Added = 0,
/** The conversation was updated. */
Updated = 1,
/** The conversation was disabled. */
Disabled = 2,
/** The conversation was deleted. */
Deleted = 3
}
/** Conversation list change action. */
export declare enum ZIMConversationListChangeAction {
/** A conversation was added to the list. */
Added = 0,
/** A conversation was deleted from the list. */
Deleted = 1,
/** A conversation in the list was updated. */
Updated = 2
}
/** Enumeration of conversation notification status. */
export declare enum ZIMConversationNotificationStatus {
/** Message notifications are enabled. */
Notify = 1,
/** Do not disturb mode is enabled. */
DoNotDisturb = 2
}
/** Conversation type. */
export declare enum ZIMConversationType {
/** Unknown conversation type. */
Unknown = -1,
/** Conversation type peer. */
Peer = 0,
/** Conversation type room. */
Room = 1,
/** Conversation type group. */
Group = 2,
/** Community channel conversation type. */
CommunityChannel = 3
}
/** Identifies the SDK's state in syncing conversation list from 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
}
/** When a user queries the session list, it serves as a filter item for the top session of the query. */
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
}
/** Conversational 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
}
/** Media file type */
export declare enum ZIMMediaFileType {
/** Original file type, suitable for original images, audio files, and video files. After calling [downloadMediaFile], the SDK will update the fileLocalPath property in ZIMFileMessage. */
OriginalFile = 1,
/** Large image type. After calling [downloadMediaFile], the SDK will update the largeImageLocalPath property in [ZIMImageMessage]. */
LargeImage = 2,
/** Image thumbnail type. After calling [downloadMediaFile], the SDK will update the thumbnailLocalPath property in [ZIMImageMessage]. */
Thumbnail = 3,
/** The type of the first frame of the video. After calling [downloadMediaFile], the SDK will update the videoFirstFrameLocalPath property in [ZIMVideoMessage]. */
VideoFirstFrame = 4
}
/** the direction of the message. */
export declare enum ZIMMessageDirection {
/** The message was sent by the local user. */
Send = 0,
/** The message was received by the local user. */
Receive = 1
}
/** Message order. */
export declare enum ZIMMessageOrder {
/** Represents message list in descending order (message list order is from new to old). */
Descending = 0,
/** Represents message list in ascending order (message list order is from old to new). */
Ascending = 1
}
/** The priority of the message. */
export declare enum ZIMMessagePriority {
/** Low priority. */
Low = 1,
/** Medium priority. */
Medium = 2,
/** High priority. */
High = 3
}
/** . */
export declare enum ZIMMessageQueryMode {
/** General mode. In this mode, the SDK automatically determines whether it needs to request merged message data from the server. This mode is recommended for most common scenarios. */
General = 0,
/** Server-priority query mode. */
PreferServer = 1,
/** Local-messages-only query mode. */
OnlyLocal = 2
}
/** The status of the receipt */
export declare enum ZIMMessageReceiptStatus {
/** Unknown receipt status. */
Unknown = -1,
/** Not a receipt. */
None = 0,
/** Receipt in progress. */
Processing = 1,
/** Receipt completed. */
Done = 2,
/** Receipt has expired. */
Expired = 3,
/** Receipt failed. */
Failed = 4
}
/** Message revoke status */
export declare enum ZIMMessageRevokeStatus {
/** Unknown revoke status. */
Unknown = -1,
/** The message was revoked by the sender. */
SelfRevoke = 0,
/** The message was revoked by the system. */
SystemRevoke = 1,
/** The message was revoked via the server API. */
ServerAPIRevoke = 2,
/** The message was revoked by a group administrator. */
GroupAdminRevoke = 3,
/** The message was revoked by the group owner. */
GroupOwnerRevoke = 4,
/** Revoked for audit reject. */
AuditRejectRevoke = 5
}
/** The status of the message being sent. */
export declare enum ZIMMessageSentStatus {
/** The message is being sent. */
Sending = 0,
/** The message was sent successfully. */
Success = 1,
/** The message failed to send. */
Failed = 2
}
/** The type of the message. */
export declare enum ZIMMessageType {
/** Unknown message. */
Unknown = 0,
/** Normal text message. */
Text = 1,
/** Custom binary message. */
Command = 2,
/** Multiple messages can be used to send multiple messages of text, rich media files, and custom messages. */
Multiple = 10,
/** Image message. */
Image = 11,
/** File message. */
File = 12,
/** Audio message. */
Audio = 13,
/** Video message. */
Video = 14,
/** Barrage message. */
Barrage = 20,
/** Reovked message. */
Revoke = 31,
/** Tips message. */
Tips = 32,
/** Combined message. */
Combine = 100,
/** Custom message. */
Custom = 200
}
/** The type of the revoke message. */
export declare enum ZIMRevokeType {
/** Unknown revoke type. */
Unknown = -1,
/** Two-way revoke: the message is deleted for both sender and recipient. */
TwoWay = 0,
/** One-way revoke: the message is deleted for the sender only. */
OneWay = 1
}
/** Event of tips message. */
export declare enum ZIMTipsMessageEvent {
/** Unknown tips message event. */
Unknown = 0,
/** The group was created. */
GroupCreated = 1,
/** The group was dismissed. */
GroupDismissed = 2,
/** A member joined the group. */
GroupJoined = 3,
/** A member was invited to join the group. */
GroupInvited = 4,
/** A member left the group. */
GroupLeft = 5,
/** A member was kicked out of the group. */
GroupKickedOut = 6,
/** The group information was changed. */
GroupInfoChanged = 7,
/** The group member information was changed. */
GroupMemberInfoChanged = 8,
/** A group message was pinned. */
GroupMessagePinned = 9,
/** The community was created. */
CommunityCreated = 101,
/** A member joined the community. */
CommunityJoined = 103,
/** A member was invited to join the community. */
CommunityInvited = 104,
/** A community channel was created. */
CommunityChannelCreated = 151
}
/** Type of additional information for tips messages. */
export declare enum ZIMTipsMessageChangeInfoType {
/** Unknown change info type. */
Unknown = 0,
/** Group name, group avatar, and group notice have multiple changes. */
GroupDataChanged = 1,
/** Group notice change event. */
GroupNoticeChanged = 2,
/** Group name change event. */
GroupNameChanged = 3,
/** Group avatar change event. */
GroupAvatarUrlChanged = 4,
/** Group mute info change event. */
GroupMuteChanged = 5,
/** Group owner transfer event. */
GroupOwnerTransferred = 10,
/** Group member role change event. */
GroupMemberRoleChanged = 11,
/** The group member mute status changed. */
GroupMemberMuteChanged = 12,
/** Group messages are pinned or unpinned event. */
GroupMessagePinInfoChanged = 21
}
/** The type of the revoke message. */
export declare enum ZIMMessageMentionedType {
/** Unknown mention type. */
Unknown = 0,
/** mention me */
MentionMe = 1,
/** mention all user */
MentionAll = 2,
/** mention all user and mention me */
MentionAllAndMe = 3
}
/** Message deleted type */
export declare enum ZIMMessageDeleteType {
/** Selected messages were deleted. */
MessageListDeleted = 0,
/** All messages in the conversation were deleted. */
ConversationAllMessagesDeleted = 1,
/** All messages across all conversations were deleted. */
AllConversationMessagesDeleted = 2
}
/** The state of the source message to be replied. */
export declare enum ZIMMessageRepliedInfoState {
/** normal state. */
Normal = 0,
/** deleted state. */
Deleted = 1,
/** Not found. The original message may have expired on the server or is not visible to the current user. */
NotFound = 2
}
/** Enumeration of message pinned status. */
export declare enum ZIMMessagePinStatus {
/** The message is not pinned. */
NotPinned = 0,
/** The message is pinned. */
Pinned = 1,
/** The message pin status was updated. */
Updated = 2
}
/** User operation action for message reactions. */
export declare enum ZIMMessageReactionUserChangeAction {
/** Add message reaction. */
Added = 0,
/** Delete message reaction. */
Deleted = 1
}
/** The event that caused the room connection status to change. */
export declare enum ZIMRoomEvent {
/** Success. */
Success = 0,
/** The network in the room is temporarily interrupted. */
NetworkInterrupted = 1,
/** The network in the room is disconnected. */
NetworkDisconnected = 2,
/** The room not exist. */
RoomNotExist = 3,
/** The user actively creates a room. */
ActiveCreate = 4,
/** Failed to create room. */
CreateFailed = 5,
/** The user starts to enter the room. */
ActiveEnter = 6,
/** user failed to enter the room. */
EnterFailed = 7,
/** user was kicked out of the room. */
KickedOut = 8,
/** The connection to the room timed out. */
ConnectTimeout = 9,
/** Multi-device logins into the same room will result in the user being kicked out of the room. */
KickedOutByOtherDevice = 10,
/** Switch room. */
ActiveSwitch = 11,
/** Switch room failed. */
SwitchFailed = 12
}
/** Used to indicate the user's connection status to the room. */
export declare enum ZIMRoomState {
/** Indicates that the connection to the room is interrupted, and the [createRoom], [joinRoom], and [enterRoom] fails. If the network is disconnected for a long time, the heartbeat of the room times out, the background notifies the user that he has been kicked out of the room, or the logout will throw this status. */
Disconnected = 0,
/** connecting indicates that the connection between a room and a room is in the connecting state. When the create, join, or enter room connection is not returned, this state is thrown when the network is disconnected. */
Connecting = 1,
/** connected indicates that the device is properly connected to the room. If create, join, or enter room succeeds, the state will be thrown if the network is disconnected and the room heartbeat does not time out. */
Connected = 2
}
/** Room attributes update action. */
export declare enum ZIMRoomAttributesUpdateAction {
/** Set action. */
Set = 0,
/** Delete the room attributes. */
Delete = 1
}
/** The action type for room member attribute updates. */
export declare enum ZIMRoomMemberAttributesUpdateAction {
/** Set the room member attributes. */
Set = 0
}
/** group status. */
export declare enum ZIMGroupState {
/** The local user has left the group. */
Quit = 0,
/** The local user has entered the group. */
Enter = 1
}
/** Group events. */
export declare enum ZIMGroupEvent {
/** Unknown event. */
Unknown = -1,
/** The group was created. */
Created = 1,
/** The group was dismissed. */
Dismissed = 2,
/** A member joined the group. */
Joined = 3,
/** A member was invited to join the group. */
Invited = 4,
/** A member left the group. */
Left = 5,
/** A member was kicked out of the group. */
KickedOut = 6
}
/** Group member events. */
export declare enum ZIMGroupMemberEvent {
/** Unknown event. */
Unknown = -1,
/** A member joined the group. */
Joined = 1,
/** A member left the group. */
Left = 2,
/** A member was kicked out of the group. */
KickedOut = 4,
/** A member was invited to join the group. */
Invited = 5
}
/** group membership status. */
export declare enum ZIMGroupMemberState {
/** The member has left the group. */
Quit = 0,
/** The member has entered the group. */
Enter = 1
}
/** Enumeration of group notification status. */
export declare enum ZIMGroupMessageNotificationStatus {
/** Message notifications are enabled. */
Notify = 1,
/** Do not disturb mode is enabled. */
DoNotDisturb = 2
}
/** Group attributes update action. */
export declare enum ZIMGroupAttributesUpdateAction {
/** Set action. */
Set = 0,
/** Delete the group attributes. */
Delete = 1
}
/** Group mute mode. */
export declare enum ZIMGroupMuteMode {
/** Unmute. */
None = 0,
/** Group normal members mute mode. */
Normal = 1,
/** Group all members mute mode. */
All = 2,
/** Customize group mute mode */
Custom = 3
}
/** Verification mode for joining the group. */
export declare enum ZIMGroupJoinMode {
/** Anyone can join the group directly. */
Any = 0,
/** Requires group owner or administrator approval. */
Auth = 1,
/** Joining the group is prohibited. */
Forbid = 2
}
/** Verification mode for invite to the group. */
export declare enum ZIMGroupInviteMode {
/** Everyone in the group can invite. */
Any = 0,
/** Only group owners or administrators can invite. */
Admin = 1
}
/** Verification mode for being invited to the group. */
export declare enum ZIMGroupBeInviteMode {
/** The invitees enter the group directly. */
None = 0,
/** The invitee's consent is required to join the group. */
Auth = 1
}
/** Group enter type. */
export declare enum ZIMGroupEnterType {
/** Unknown enter type. */
Unknown = 0,
/** The user created the group. */
Created = 1,
/** The user joined the group via an application. */
JoinApply = 2,
/** The user actively joined the group. */
Joined = 3,
/** The user was invited to join the group. */
Invited = 4,
/** The user joined the group via invitation application. */
InviteApply = 5
}
/** Group application type. */
export declare enum ZIMGroupApplicationType {
/** Unknown group application type. */
Unknown = -1,
/** None. */
None = 0,
/** Join type. */
Join = 1,
/** Invite type. */
Invite = 2,
/** Be invite type. */
BeInvite = 3
}
/** Group application state. */
export declare enum ZIMGroupApplicationState {
/** Unknown group application state. */
Unknown = -1,
/** Awaiting response. */
Waiting = 1,
/** Accepted. */
Accepted = 2,
/** Rejected. */
Rejected = 3,
/** Expired. */
Expired = 4,
/** Disabled */
Disabled = 5
}
/** Group application list update action. */
export declare enum ZIMGroupApplicationListChangeAction {
/** Add action. */
Added = 0
}
/** Call invitation mode. */
export declare enum ZIMCallInvitationMode {
/** Unknown type, as a guaranteed enumeration value. */
Unknown = -1,
/** general. */
General = 0,
/** advanced */
Advanced = 1
}
/** call status. */
export declare enum ZIMCallState {
/** Unknown call state. */
Unknown = -1,
/** The call has started. */
Started = 1,
/** The call has ended. */
Ended = 2
}
/** Call user status. */
export declare enum ZIMCallUserState {
/** unknown */
Unknown = -1,
/** inviting. */
Inviting = 0,
/** accepted. */
Accepted = 1,
/** rejected. */
Rejected = 2,
/** cancelled. */
Cancelled = 3,
/** received. */
Received = 5,
/** timeout. */
Timeout = 6,
/** quit. */
Quit = 7,
/** ended. */
Ended = 8,
/** Not received. */
NotYetReceived = 9,
/** Be cancelled. */
BeCancelled = 10
}
/** User type. */
export declare enum ZIMUserInfoType {
/** Basic user type. */
BasicUser = 1,
/** Room member type. */
RoomMember = 2,
/** Group member type. */
GroupMember = 3,
/** Group member brief info type. */
GroupSimpleMember = 4,
/** Friend type. */
Friend = 5,
/** Community member type. */
CommunityMember = 6,
/** Community member brief info type. */
CommunitySimpleMember = 7
}
/** friend list update action. */
export declare enum ZIMFriendListChangeAction {
/** Add action. */
Added = 0,
/** Delete action. */
Deleted = 1
}
/** friend application list update action. */
export declare enum ZIMFriendApplicationListChangeAction {
/** Add action. */
Added = 0,
/** Delete action. */
Deleted = 1
}
/** Friend application type. */
export declare enum ZIMFriendApplicationType {
/** Unknown friend application type. */
Unknown = -1,
/** Friend application type none. */
None = 0,
/** Applications received. */
Received = 1,
/** Application sent. */
Sent = 2,
/** Both parties sent friend applications to each other. */
Both = 3
}
/** Friend application state. */
export declare enum ZIMFriendApplicationState {
/** Unknown friend application state. */
Unknown = -1,
/** Awaiting response. */
Waiting = 1,
/** Accepted. */
Accepted = 2,
/** Rejected. */
Rejected = 3,
/** The friend application has expired. */
Expired = 4,
/** The friend application is disabled. */
Disabled = 5
}
/** Check the friend relationship type. */
export declare enum ZIMFriendRelationCheckType {
/** Check the friend relationship from both sides. */
Both = 0,
/** Check the friend relationship from one side only. */
Single = 1
}
/** Delete friend type. */
export declare enum ZIMFriendDeleteType {
/** Delete the friend from both sides. */
Both = 0,
/** Delete the friend from one side only. */
Single = 1
}
/** Friend relationship type. */
export declare enum ZIMUserRelationType {
/** Unknown relation type. */
Unknown = 0,
/** No friendship from the user's perspective. */
SingleNo = 1,
/** Friendship exists from the user's perspective. */
SingleHave = 2,
/** No friendship from either side. */
BothAllNo = 3,
/** The user has added the other as a friend, but not vice versa. */
BothSelfHave = 4,
/** The other party has added the user as a friend, but not vice versa. */
BothOtherHave = 5,
/** Both parties are friends with each other. */
BothAllHave = 6
}
/** blacklist update action. */
export declare enum ZIMBlacklistChangeAction {
/** Add action. */
Added = 0,
/** Removed action. */
Removed = 1
}
/** Type of contact information for the VoIP initiator. */
export declare enum ZIMCXHandleType {
/** Generic handle type. */
Generic = 1,
/** Phone number handle type. */
PhoneNumber = 2,
/** Email address handle type. */
EmailAddress = 3
}
/** Geofencing type. */
export declare enum ZIMGeofencingType {
/** The default type. */
None = 0,
/** Federated mode. */
Include = 1,
/** Exclusion mode. */
Exclude = 2
}
/** Platform on which the SDK runs. */
export declare enum ZIMPlatformType {
/** Windows. */
Win = 1,
/** iOS. */
IPhoneOS = 2,
/** Android. */
Android = 3,
/** MacOS. */
MacOS = 4,
/** Linux. */
Linux = 5,
/** Web. */
Web = 6,
/** Mini program. */
MiniProgram = 7,
/** iPad. */
IPadOS = 9,
/** HarmonyOS (OHOS) platform. */
OHOS = 10,
/** Platforms not mentioned above. */
Unknown = 32
}
/** User online status. */
export declare enum ZIMUserOnlineStatus {
/** Online. The user is in this state when the user is logged in and the network status is good. */
Online = 0,
/** Offline. The user does not call logout to actively logout because the network is disconnected, the app is killed, the background is withdrawn, and the screen is locked. The user will be in this state after the long background link is disconnected. */
Offline = 1,
/** Log out. User active logout will be in this state. */
Logout = 2,
/** Unknown status. Guaranteed enumeration. */
Unknown = 99
}
/** The action type for list changes. */
export declare enum ZIMListChangeAction {
/** An item was added. */
Added = 0,
/** An item was deleted. */
Deleted = 1
}
/** The action type for community list changes. */
export declare enum ZIMCommunityListChangeAction {
/** A community was added. */
Added = 0,
/** A community was deleted. */
Deleted = 1,
/** A community was updated. */
Updated = 2
}
/** The enter type for community members. */
export declare enum ZIMCommunityMemberEnterType {
/** Unknown enter type. */
Unknown = 0,
/** The member joined when the community was created. */
CommunityCreated = 1,
/** The member actively joined the community. */
CommunityJoined = 2,
/** The member was invited to join the community. */
CommunityInvited = 3
}
/** The state change type for community members. */
export declare enum ZIMCommunityMemberChangeState {
/** The member exited the community. */
Exited = 0,
/** The member entered the community. */
Entered = 1
}
/** The action type for community member status changes. */
export declare enum ZIMCommunityMemberChangeAction {
/** Unknown action. */
Unknown = 0,
/** The member actively joined the community. */
Joined = 1,
/** The member was invited to join the community. */
Invited = 2,
/** The member actively left the community. */
Left = 3,
/** The member was kicked out of the community. */
KickedOut = 4
}
/** The type of community channel. */
export declare enum ZIMCommunityChannelType {
/** Unknown channel. */
Unknown = -1,
/** Default channel, automatically created when the community is created. */
General = 0,
/** Public channel, visible to all members of the community. */
Public = 1,
/** Private channel, visible only to specific members. */
Private = 2
}
/** The action type for community channel list changes. */
export declare enum ZIMCommunityChannelListChangeAction {
/** A community channel was added. */
Added = 0,
/** A community channel was deleted. */
Deleted = 1,
/** A community channel was updated. */
Updated = 2
}
/** The mute mode for community channels. */
export declare enum ZIMCommunityChannelMuteMode {
/** No mute mode. */
None = 0,
/** Normal mute mode; only administrators and the owner can speak. */
Normal = 1,
/** All members are muted. */
All = 2,
/** Custom mute mode. */
Custom = 3
}
/** The mute type for community members. */
export declare enum ZIMCommunityMemberMuteType {
/** Not muted. */
None = 0,
/** Muted at the community level. */
Community = 1,
/** Muted at the community channel level. */
Channel = 2
}
/** The notification status for community messages. */
export declare enum ZIMCommunityMessageNotificationStatus {
/** Message notifications are enabled. */
Notify = 1,
/** Do not disturb mode is enabled. */
DoNotDisturb = 2
}
/** Community member role */
export declare enum ZIMCommunityMemberRole {
/** Community Owner. */
Owner = 1,
/** Community Admin. */
Admin = 2,
/** Community Member. */
Member = 3
}
/**
* 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
*
* Description: Configure the storage path of log files and the maximum log file size.
*/
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 Type. This field is used to identify which subclass the current entity belongs to. */
type: ZIMUserInfoType;
}
/**
* 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;
}
/**
* Data class of the user's offline push rule.
*
* Description: Data class of the user's offline push rule.
*/
export interface ZIMUserOfflinePushRule {
/** With the data in the class member variables notToReceiveOfflinePushPlatforms collocation is used. OnlinePlatforms specified platform, online notToReceiveOfflinePushPlatforms specified platform will not receive offline push. */
onlinePlatforms: ZIMPlatformType[];
/** With the data in the class member variables onlinePlatforms collocation is used. OnlinePlatforms specified platform, online notToReceiveOfflinePushPlatforms specified platform will not receive offline push. */
notToReceiveOfflinePushPlatforms: ZIMPlatformType[];
}
/**
* User rule configuration.
*/
export interface ZIMUserRule {
/** The user's current rule information. */
offlinePushRule: ZIMUserOfflinePushRule;
}
/**
* User status data
*
* Description: Contains data about the user's online status.
*/
export interface ZIMUserStatus {
/** A unique identifier for a single user. */
userID: string;
/** Enumeration that represents the current online status of the user. */
onlineStatus: ZIMUserOnlineStatus;
/** The list of online platforms of the current user can be used to display the online platforms of the user, such as iPhone online and PC online. Please refer to ZIMPlatform for the meanings of the numbers. */
onlinePlatforms: ZIMPlatformType[];
/** User-defined status. The default maximum value is 64 bytes. The default expiration time is 1 day. At login, if the field is an empty string (which is the default), the current user's custom state is not modified. */
customStatus: string;
/** Expired timestamp of the custom status. */
customStatusExpiredTime: number;
/** Timestamp when user onlineStatus or customStatus was last changed, whichever is the greater. */
lastUpdateTime: number;
/** The timestamp of the last change of the user onlineStatus, which can be used to show that the user was offline/logged in before xxx minutes. */
lastOnlineStatusUpdateTime: number;
/** The timestamp when User customStatus was last changed, which can be used to show when the custom status was last changed. */
lastCustomStatusUpdateTime: number;
}
/**
* User status subscription information. Contains the user's online status, a list of online platforms, subscription expiration time stamps, and more.
*
* Available since: 2.18.0
* Description: User status subscription information. Contains the user's online status, a list of online platforms, subscription expiration time stamps, and more.
*/
export interface ZIMUserStatusSubscription {
/** The online status of the user. */
userStatus: ZIMUserStatus;
/** The timestamp when the user's subscription expired. */
subscribeExpiredTime: number;
}
/**
* Carry user information and rules of the current user.
*
* Description: Carry user information and rules of the current user.
*/
export interface ZIMSelfUserInfo {
/** Personal information of the current user. */
userFullInfo: ZIMUserFullInfo;
/** Rules for the current user, setting information. */
userRule: ZIMUserRule;
/** The online status of the user. */
userStatus: ZIMUserStatus;
}
/**
* subscribeUsersStatus Configuration items of the online status interface for subscribing users in batches.
*
* Description: subscribeUsersStatus Configuration items of the online status interface for subscribing users in batches.
*/
export interface ZIMUserStatusSubscribeConfig {
/** Subscription duration, in minutes. */
subscriptionDuration: number;
}
/**
* QuerySubscribedUserStatusList query subscription list interface configuration items.
*
* Description: QuerySubscribedUserStatusList query subscription list interface configuration items.
*/
export interface ZIMSubscribedUserStatusQueryConfig {
/** List of user IDs to query. */
userIDs: string[];
}
/**
* User custom status update configuration.
*
* Available since: 2.29.0 and above.
* Description: Update user custom status parameters.
*/
export interface ZIMUserCustomStatusUpdateConfig {
/** Duration of user custom status. */
duration: number;
}
/**
* Error user information class.
*
* Description: Used to show the failed user and the reason for the failure.
*/
export interface ZIMErrorUserInfo {
/** 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 Reason for the query failure. */
reason: number;
}
/**
* Configuration of login-related parameters.
*
* Available since: 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;
/** Description: Expired duration of the custom status. */
customStatusDuration: number;
}
/**
* Configuration of logout-related parameters.
*
* Available since: 2.28.0 and later.
* Description: Parameters related to logout.
* Use cases: 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.
*
* 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.
*
* Description: According to [OPUSH DMS template check ability to access instructions](https://open.oppomobile.com/documentation/page/info?id=12391), OPPO in new message classification on the basis of the new push DMS templates, After you have configured the private message template in the OPPO console, if you need to apply the corresponding template during push notifications, you can assign a value to the privateMessageTemplate in ZIMPushConfig.
*/
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.
*
* Description: 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.
*
* Description: 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;
}
/**
* Add configuration for message reactions.
*
* Description: Configuration class for adding message 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.
*
* 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;
/** Detail description: message sequence. */
messageSeq: number;
/** 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.
*
* 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 {
/** user ID. */
userID: string;
/** Type of reaction, defined by you, with a maximum length of 32 bytes. */
reactionType: string;
/** reaction change action. */
action: ZIMMessageReactionUserChangeAction;
/** Description: The sum count for the current reaction type. */
sumCount: number;
}
/**
* Base class of message lite info object.
*
* Description: Identifies the basic parameters of a message.
*/
export interface ZIMMessageLiteInfo {
/** Description: Message type. */
type: ZIMMessageType;
}
/**
* Normal text message lite info object.
*/
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;
}
/**
* Base class for combine message lite info objects.
*/
export interface ZIMCombineMessageLiteInfo extends ZIMMessageLiteInfo {
/** Description: Combine message title. */
title: string;
/** Description: Combine message summary. */
summary: string;
type: ZIMMessageType.Combine;
}
/**
* Base class for revoke message lite info objects.
*/
export interface ZIMRevokeMessageLiteInfo extends ZIMMessageLiteInfo {
type: ZIMMessageType.Revoke;
}
/**
* Base class for media message lite info objects.
*/
export interface ZIMMediaMessageLiteInfo extends ZIMMessageLiteInfo {
/** Description: Media file size. */
fileSize?: number;
/** Description: Media file name. */
fileName?: string;
/** Description: Media file local path. */
fileLocalPath?: File;
/** 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;
}
/**
* The reply message refers to the information of the source message.
*/
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;
/** Whether the message was sent by the server. */
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;
/*