easemob-websdk 4.0.9 → 4.1.0-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Easemob-chat.d.ts CHANGED
@@ -9,20 +9,30 @@ declare const easemobChat: EasemobChatStatic;
9
9
  export default easemobChat;
10
10
  export declare namespace EasemobChat {
11
11
  interface AsyncResult<T = any> {
12
+ /** Status of the request. */
12
13
  type: Code;
14
+ /** Data returned by successful request. */
13
15
  data?: T;
16
+ /** Data returned by successful request. */
14
17
  entities?: T;
18
+ /** The error message. */
15
19
  message?: string;
16
20
  [key: string]: any;
17
21
  }
18
22
 
23
+ /** The user ID. */
19
24
  type UserId = string;
20
25
 
21
26
  interface CommonRequestResult {
27
+ /** The result of request. */
22
28
  result: boolean;
29
+ /** Action. */
23
30
  action: string;
31
+ /** The reason of failure. */
24
32
  reason?: string;
33
+ /** The user ID. */
25
34
  user: string;
35
+ /** The group/chat room ID. */
26
36
  id: string;
27
37
  }
28
38
 
@@ -37,19 +47,13 @@ export declare namespace EasemobChat {
37
47
  [key: string]: string;
38
48
  }
39
49
 
50
+ /** @deprecated */
40
51
  interface RosterData {
41
52
  name: string;
42
53
  subscription: 'both';
43
54
  jid: Jid;
44
55
  }
45
56
 
46
- interface Host {
47
- protocol: string;
48
- domain: string;
49
- ip: string;
50
- port: string;
51
- }
52
-
53
57
  interface SendMsgResult {
54
58
  /** The message local ID. */
55
59
  localMsgId: string;
@@ -102,6 +106,7 @@ export declare namespace EasemobChat {
102
106
  | 'subscribed'
103
107
  | 'onPresenceStatusChange';
104
108
 
109
+ /** @deprecated */
105
110
  interface OnPresenceMsg {
106
111
  type: OnPresenceMsgType;
107
112
  to: string;
@@ -120,30 +125,39 @@ export declare namespace EasemobChat {
120
125
  | 'chatThreadJoin'
121
126
  | 'chatThreadLeave'
122
127
  | 'chatThreadNameUpdate';
128
+
123
129
  interface ThreadMultiDeviceInfo {
130
+ /** Event name of thread multi device event. */
124
131
  operation: multiDeviceEventType;
132
+ /** The message thread ID. */
125
133
  chatThreadId?: string;
134
+ /** The message thread name. */
126
135
  chatThreadName?: string;
136
+ /** The group ID to which the message thread belongs. */
127
137
  parentId?: string;
128
138
  }
129
139
 
130
- /**
131
- * The connection module is the module where the SDK creates long link, And all about links, friends, groups, and chat apis are all in this module
132
- *
133
- * @module connection
134
- */
135
-
136
140
  interface ConnectionParameters {
141
+ /** The unique application key registered in console. */
137
142
  appKey: string;
138
- apiUrl?: string;
139
- url?: string;
143
+ /** Whether to enable the delivery receipt function. - `true`: Enable; - (Default)`false`: Do not enable. */
140
144
  delivery?: boolean;
141
- isDebug?: boolean;
142
- isHttpDNS?: boolean;
145
+ /** Heartbeat interval, in milliseconds. */
143
146
  heartBeatWait?: number;
147
+ /** The unique ID of the login device is random by default and can be set by yourself. This parameter is required for multiple terminals and multiple devices. */
144
148
  deviceId?: string;
149
+ /** Whether to use your own upload function, for example, when uploading images and files to your server. - `true`: Use your own upload function; - (Default)`false`: Do not use your own upload function. */
145
150
  useOwnUploadFun?: boolean;
151
+ /** The maximum number of reconnection. */
146
152
  autoReconnectNumMax?: number;
153
+ /** Whether DNS is enabled or not. It is enabled by default. The private cloud should be turned off */
154
+ isHttpDNS?: boolean;
155
+ /** The URL of the specified REST server. This command is used when DNS is not enabled. Usually this API is used for specific customers and need to contact account manager to get it. */
156
+ apiUrl?: string;
157
+ /** The URL of the specified message server. This command is used when DNS is not enabled. Usually this API is used for specific customers and need to contact account manager to get it. */
158
+ url?: string;
159
+ /** Whether to use HTTPS only. By default, the browser determines whether to use HTTPS only according to the domain name. */
160
+ https?: boolean;
147
161
  }
148
162
 
149
163
  interface RegisterUserResult extends AsyncResult {
@@ -668,7 +682,7 @@ export declare namespace EasemobChat {
668
682
 
669
683
  interface TranslationResult {
670
684
  /** Translation results. */
671
- ranslations: {
685
+ translations: {
672
686
  /** Translated text. */
673
687
  text: string;
674
688
  /** The target language of translation. */
@@ -905,7 +919,7 @@ export declare namespace EasemobChat {
905
919
  interface ConversationSilentModeType {
906
920
  /** User push map. */
907
921
  user: {
908
- [propname: UserId]: SilentModeConversationType;
922
+ [propname: string]: SilentModeConversationType;
909
923
  };
910
924
  /** Group push map. */
911
925
  group: {
@@ -1015,147 +1029,178 @@ export declare namespace EasemobChat {
1015
1029
  reactionList: ReactionListItem[];
1016
1030
  }
1017
1031
 
1032
+ /**
1033
+ * The error code defined by SDK.
1034
+ * @module Code
1035
+ */
1018
1036
  enum Code {
1037
+ /** No error. */
1019
1038
  REQUEST_SUCCESS = 0,
1039
+ /** The server response times out. */
1020
1040
  REQUEST_TIMEOUT = -1,
1041
+ /** A general error. */
1021
1042
  REQUEST_UNKNOWN = -2,
1043
+ /** The parameter is invalid. */
1022
1044
  REQUEST_PARAMETER_ERROR = -3,
1023
- REQUEST_ABORT = -4,
1024
- WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR = 0,
1045
+ /** The request is canceled. */
1046
+ REQUEST_ABORT = -4, // 取消请求
1047
+ /** Login failed. */
1025
1048
  WEBIM_CONNCTION_OPEN_ERROR = 1,
1049
+ /** The user authentication fails. The reasons are as follows. The SDK is not initiated. The user is not login. */
1026
1050
  WEBIM_CONNCTION_AUTH_ERROR = 2,
1027
- WEBIM_CONNCTION_OPEN_USERGRID_ERROR = 3,
1028
- WEBIM_CONNCTION_ATTACH_ERROR = 4,
1029
- WEBIM_CONNCTION_ATTACH_USERGRID_ERROR = 5,
1030
- WEBIM_CONNCTION_REOPEN_ERROR = 6,
1031
- WEBIM_CONNCTION_SERVER_CLOSE_ERROR = 7,
1032
- WEBIM_CONNCTION_SERVER_ERROR = 8,
1033
- WEBIM_CONNCTION_IQ_ERROR = 9,
1034
- WEBIM_CONNCTION_PING_ERROR = 10,
1035
- WEBIM_CONNCTION_NOTIFYVERSION_ERROR = 11,
1051
+
1052
+ /** Fails to get the token. */
1036
1053
  WEBIM_CONNCTION_GETROSTER_ERROR = 12,
1037
- WEBIM_CONNCTION_CROSSDOMAIN_ERROR = 13,
1038
- WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES = 14,
1039
- WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR = 15,
1054
+ /** Websocket is disconnected */
1040
1055
  WEBIM_CONNCTION_DISCONNECTED = 16,
1056
+ /** A general error. */
1041
1057
  WEBIM_CONNCTION_AJAX_ERROR = 17,
1042
- WEBIM_CONNCTION_JOINROOM_ERROR = 18,
1043
- WEBIM_CONNCTION_GETROOM_ERROR = 19,
1044
- WEBIM_CONNCTION_GETROOMINFO_ERROR = 20,
1045
- WEBIM_CONNCTION_GETROOMMEMBER_ERROR = 21,
1046
- WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR = 22,
1047
- WEBIM_CONNCTION_LOAD_CHATROOM_ERROR = 23,
1048
- WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR = 24,
1049
- WEBIM_CONNCTION_JOINCHATROOM_ERROR = 25,
1050
- WEBIM_CONNCTION_QUITCHATROOM_ERROR = 26,
1058
+ /** The App Key is invalid. */
1051
1059
  WEBIM_CONNCTION_APPKEY_NOT_ASSIGN_ERROR = 27,
1060
+ /** The token is invalid. */
1052
1061
  WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR = 28,
1053
- WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR = 29,
1054
- WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR = 30,
1062
+ /** The callback inner error code while the message is successfully sent. */
1055
1063
  WEBIM_CONNCTION_CALLBACK_INNER_ERROR = 31,
1056
- WEBIM_CONNCTION_CLIENT_OFFLINE = 32,
1057
- WEBIM_CONNCTION_CLIENT_LOGOUT = 33,
1058
- WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR = 34,
1059
- WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP = 35,
1060
- WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP = 36,
1061
- WEBIM_CONNECTION_ACCEPT_JOIN_GROUP = 37,
1062
- WEBIM_CONNECTION_DECLINE_JOIN_GROUP = 38,
1064
+ /** The current user is offline. */
1065
+ WEBIM_CONNCTION_CLIENT_OFFLINE = 32, //32 = client offline
1066
+ /** The user is not logged in.*/
1063
1067
  WEBIM_CONNECTION_CLOSED = 39,
1068
+ /** The user authentication fails. */
1064
1069
  WEBIM_CONNECTION_ERROR = 40,
1070
+
1071
+ /** The upper limit is reached. */
1065
1072
  MAX_LIMIT = 50,
1073
+ /** The message is not found. */
1066
1074
  MESSAGE_NOT_FOUND = 51,
1075
+ /** Unauthorized operation. */
1067
1076
  NO_PERMISSION = 52,
1077
+ /** Unsupported Operation. */
1068
1078
  OPERATION_UNSUPPORTED = 53,
1069
- WEBIM_UPLOADFILE_BROWSER_ERROR = 100,
1079
+ /** The current operation object does not exist. */
1080
+ NOT_EXIST = 54,
1081
+ /** The uploading of the file failed. */
1070
1082
  WEBIM_UPLOADFILE_ERROR = 101,
1083
+ /** The current user is not logged in when uploading the file. */
1071
1084
  WEBIM_UPLOADFILE_NO_LOGIN = 102,
1072
- WEBIM_UPLOADFILE_NO_FILE = 103,
1085
+ /** File-downloading failed. */
1073
1086
  WEBIM_DOWNLOADFILE_ERROR = 200,
1074
- WEBIM_DOWNLOADFILE_NO_LOGIN = 201,
1075
- WEBIM_DOWNLOADFILE_BROWSER_ERROR = 202,
1087
+ /** User does not found. */
1076
1088
  USER_NOT_FOUND = 204,
1089
+ /** The user is logged in on another device. */
1077
1090
  WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE = 206,
1091
+ /** The user was removed. */
1078
1092
  WEBIM_CONNCTION_USER_REMOVED = 207,
1093
+ /** The password is renewed. */
1079
1094
  WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD = 216,
1095
+ /** The user was kicked off from another device. */
1080
1096
  WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE = 217,
1097
+ /** Global muted. */
1081
1098
  USER_MUTED_BY_ADMIN = 219,
1099
+ /**
1100
+ * The user is not on your contact list, and you cannot send messages to him or her.
1101
+ * Note: You can send messages to strangers by default. This error occurs only when you enable the function of allowing to send messages only to your contacts.
1102
+ */
1082
1103
  USER_NOT_FRIEND = 221,
1083
- WEBIM_MESSAGE_REC_TEXT = 300,
1084
- WEBIM_MESSAGE_REC_TEXT_ERROR = 301,
1085
- WEBIM_MESSAGE_REC_EMOTION = 302,
1086
- WEBIM_MESSAGE_REC_PHOTO = 303,
1087
- WEBIM_MESSAGE_REC_AUDIO = 304,
1088
- WEBIM_MESSAGE_REC_AUDIO_FILE = 305,
1089
- WEBIM_MESSAGE_REC_VEDIO = 306,
1090
- WEBIM_MESSAGE_REC_VEDIO_FILE = 307,
1091
- WEBIM_MESSAGE_REC_FILE = 308,
1092
- WEBIM_MESSAGE_SED_TEXT = 309,
1093
- WEBIM_MESSAGE_SED_EMOTION = 310,
1094
- WEBIM_MESSAGE_SED_PHOTO = 311,
1095
- WEBIM_MESSAGE_SED_AUDIO = 312,
1096
- WEBIM_MESSAGE_SED_AUDIO_FILE = 313,
1097
- WEBIM_MESSAGE_SED_VEDIO = 314,
1098
- WEBIM_MESSAGE_SED_VEDIO_FILE = 315,
1099
- WEBIM_MESSAGE_SED_FILE = 316,
1100
- WEBIM_MESSAGE_SED_ERROR = 317,
1101
- STATUS_INIT = 400,
1102
- STATUS_DOLOGIN_USERGRID = 401,
1103
- STATUS_DOLOGIN_IM = 402,
1104
- STATUS_OPENED = 403,
1105
- STATUS_CLOSING = 404,
1106
- STATUS_CLOSED = 405,
1107
- STATUS_ERROR = 406,
1104
+
1105
+ /** The server is busy. */
1108
1106
  SERVER_BUSY = 500,
1107
+ /** The message content contains illegal or sensitive words. */
1109
1108
  MESSAGE_INCLUDE_ILLEGAL_CONTENT = 501,
1109
+ /** The message was blocked. */
1110
1110
  MESSAGE_EXTERNAL_LOGIC_BLOCKED = 502,
1111
+ /** Unknown error. */
1111
1112
  SERVER_UNKNOWN_ERROR = 503,
1113
+ /** The message recall has exceeded the time limit.*/
1112
1114
  MESSAGE_RECALL_TIME_LIMIT = 504,
1115
+ /** The service is not enabled. */
1113
1116
  SERVICE_NOT_ENABLED = 505,
1117
+ /** The message fails to be delivered because the user is not on the allow list.*/
1114
1118
  SERVICE_NOT_ALLOW_MESSAGING = 506,
1119
+ /** The current user is muted. */
1115
1120
  SERVICE_NOT_ALLOW_MESSAGING_MUTE = 507,
1121
+ /** The message is blocked by the Moderation service. */
1116
1122
  MESSAGE_MODERATION_BLOCKED = 508,
1123
+ /** Group chat ID current limiting. */
1124
+ MESSAGE_CURRENT_LIMITING = 509,
1125
+ /** The group is not found. */
1117
1126
  GROUP_NOT_EXIST = 605,
1127
+ /** The user being operated is not in the group. */
1118
1128
  GROUP_NOT_JOINED = 602,
1129
+ /** The number of members in the group reaches the limit. */
1119
1130
  GROUP_MEMBERS_FULL = 606,
1131
+ /** Permission denied. */
1120
1132
  PERMISSION_DENIED = 603,
1133
+ /** Internal error. */
1121
1134
  WEBIM_LOAD_MSG_ERROR = 604,
1122
- GROUP_ALREADY_JOINED = 601,
1135
+ /** The current user has joined. */
1136
+ ALREADY_JOINED = 601,
1137
+ /** The maximum number of group members exceeds the limit during group creation. */
1123
1138
  GROUP_MEMBERS_LIMIT = 607,
1139
+ /** Group disabled */
1140
+ GROUP_IS_DISABLED = 608,
1141
+ /** Invalid token or App Key. */
1124
1142
  REST_PARAMS_STATUS = 700,
1143
+ /** The user being operated is not in the chatroom. */
1144
+ CHATROOM_NOT_JOINED = 702,
1145
+ /** The number of chatroom members reaches the limit.*/
1125
1146
  CHATROOM_MEMBERS_FULL = 704,
1147
+ /** The chatroom is not found. */
1126
1148
  CHATROOM_NOT_EXIST = 705,
1149
+ /** Websocket error. */
1127
1150
  SDK_RUNTIME_ERROR = 999,
1151
+ /** The parameter length exceeds the limit when posting custom presence status. */
1128
1152
  PRESENCE_PARAM_EXCEED = 1100,
1153
+ /** The Reaction already exists. */
1129
1154
  REACTION_ALREADY_ADDED = 1101,
1155
+ /** A Reaction is being created by multiple users at the same time. */
1130
1156
  REACTION_CREATING = 1102,
1157
+ /** The user does not have the permission for the Reaction operation. For example, the user who does not add the reaction attempts to delete it, or the user that is neither the sender nor recipient of the one-to-one message attempts to add the Reaction. */
1131
1158
  REACTION_OPERATION_IS_ILLEGAL = 1103,
1159
+ /** Invalid language code. */
1132
1160
  TRANSLATION_NOT_VALID = 1200,
1161
+ /** The translated text is too long. */
1133
1162
  TRANSLATION_TEXT_TOO_LONG = 1201,
1163
+ /** Failed to obtain the translation service. */
1134
1164
  TRANSLATION_FAILED = 1204,
1165
+ /** The chatThread is not found. */
1135
1166
  THREAD_NOT_EXIST = 1300,
1167
+ /** Chat thread already exists. */
1136
1168
  THREAD_ALREADY_EXIST = 1301,
1137
1169
  }
1138
1170
 
1139
1171
  /**
1140
- * @category Connection
1172
+ * The connection module is the module where the SDK creates long link, And all about links, friends, groups, and chat apis are all in this module
1173
+ *
1174
+ * @module connection
1141
1175
  */
1142
1176
  class Connection {
1177
+ /** @deprecated */
1143
1178
  isDebug: boolean;
1179
+ /** Whether to enable DNS to prevent DNS hijacking. - (Default)`true`: Enable; - `false`: Do not enable. */
1144
1180
  isHttpDNS: boolean;
1181
+ /** The heartbeat interval (in seconds). The default value is 30,000s. */
1145
1182
  heartBeatWait: number;
1183
+ /** The unique application key registered in console. */
1146
1184
  appKey: string;
1147
1185
  appName: string;
1148
1186
  orgName: string;
1149
1187
  token: string;
1188
+ /** The maximum number of reconnection. */
1150
1189
  autoReconnectNumMax: number;
1151
- autoReconnectNumTotal: number;
1190
+ private autoReconnectNumTotal: number;
1191
+ /** SDK version number. */
1152
1192
  version: string;
1193
+ /** The unique web device ID. By default, it is a random number. */
1153
1194
  deviceId: string;
1154
- osType: number;
1195
+ private osType: number;
1196
+ /** Whether to use your own upload function, for example, when uploading images and files to your server. - `true`: Use your own upload function; - (Default)`false`: Do not use your own upload function. */
1155
1197
  useOwnUploadFun: boolean;
1198
+ /** The URL of the specified REST server. This command is used when DNS is not enabled. Usually this API is used for specific customers and need to contact account manager to get it. */
1156
1199
  apiUrl: string;
1200
+ /** The URL of the specified message server. This command is used when DNS is not enabled. Usually this API is used for specific customers and need to contact account manager to get it. */
1157
1201
  url: string;
1158
1202
  https: boolean;
1203
+ /** The way to log in. */
1159
1204
  grantType: 'password' | 'accessToken' | 'agoraToken' | '';
1160
1205
  context: {
1161
1206
  jid: {
@@ -1177,16 +1222,14 @@ export declare namespace EasemobChat {
1177
1222
  _msgHash: {
1178
1223
  [key: string]: any;
1179
1224
  };
1180
- /**
1181
- * @since 4.0.1
1182
- */
1225
+
1183
1226
  eventHandler?: EventHandler;
1184
1227
  /**
1185
- * @deprecated 4.0.1
1228
+ * @deprecated
1186
1229
  */
1187
1230
  onOpened?: () => void;
1188
1231
  /**
1189
- * @deprecated 4.0.1
1232
+ * @deprecated
1190
1233
  */
1191
1234
  onPresence?: (msg: PresenceMsg) => void;
1192
1235
  onTextMessage?: (msg: TextMsgBody) => void;
@@ -1201,19 +1244,11 @@ export declare namespace EasemobChat {
1201
1244
  onDeliveredMessage?: (msg: DeliveryMsgBody) => void;
1202
1245
  onReadMessage?: (msg: ReadMsgBody) => void;
1203
1246
  onRecallMessage?: (msg: RecallMsgBody) => void;
1204
- onMutedMessage?: (msg: MuteMsgBody) => void;
1205
1247
  onChannelMessage?: (msg: ChannelMsgBody) => void;
1206
1248
  onError?: (error: ErrorEvent) => void;
1207
1249
  onOffline?: () => void;
1208
1250
  onOnline?: () => void;
1209
- onRoster?: (rosters: RosterData[]) => void;
1210
1251
  onStatisticMessage?: (msg: any) => void;
1211
- onCreateGroup?: (data: any) => void;
1212
- onBlacklistUpdate?: (list: {
1213
- [key: string]: {
1214
- name: string;
1215
- };
1216
- }) => void;
1217
1252
  onContactAgreed?: (msg: ContactMsgBody) => void;
1218
1253
  onContactRefuse?: (msg: ContactMsgBody) => void;
1219
1254
  onContactDeleted?: (msg: ContactMsgBody) => void;
@@ -1223,31 +1258,40 @@ export declare namespace EasemobChat {
1223
1258
  // eslint-disable-next-line no-undef
1224
1259
  [key: string]: any;
1225
1260
  constructor(options: ConnectionParameters);
1226
-
1261
+ /** Registers a user. */
1227
1262
  registerUser(
1228
1263
  this: Connection,
1229
1264
  params: {
1265
+ /** The User ID. */
1230
1266
  username: string;
1267
+ /** The password. */
1231
1268
  password: string;
1269
+ /** The display nickname. It is the display name in the iOS or Android notification. */
1232
1270
  nickname?: string;
1233
1271
  success?: (res: any) => void;
1234
1272
  error?: (err: ErrorEvent) => void;
1235
1273
  apiUrl?: string;
1236
1274
  }
1237
1275
  ): Promise<RegisterUserResult>;
1238
-
1276
+ /** Logs in. */
1239
1277
  open(parameters: {
1278
+ /** The User ID. */
1240
1279
  user: string;
1280
+ /** The password. */
1241
1281
  pwd?: string;
1282
+ /** Token required to connect to the message service. */
1242
1283
  accessToken?: string;
1284
+ /** The Agora token. */
1243
1285
  agoraToken?: string;
1244
1286
  success?: (res: any) => void;
1245
1287
  error?: (res: any) => void;
1246
1288
  }): Promise<LoginResult>;
1289
+ /** Checks the connection status. - `true`: Connected; - (Default)`false`: Not connected. */
1247
1290
  isOpened(): boolean;
1291
+ /** Closes the connection. */
1248
1292
  close(): void;
1249
- getChatToken(agoraToken: string): Promise<any>;
1250
- reconnect(): void;
1293
+ private getChatToken(agoraToken: string): Promise<any>;
1294
+ private reconnect(): void;
1251
1295
  /** send message */
1252
1296
  send(params: MessageBody): Promise<SendMsgResult>;
1253
1297
 
@@ -1262,7 +1306,9 @@ export declare namespace EasemobChat {
1262
1306
  getChatRooms(
1263
1307
  this: Connection,
1264
1308
  params: {
1309
+ /** The page number, starting from 1. */
1265
1310
  pagenum: number;
1311
+ /** The number of records per page. The default value is 20. */
1266
1312
  pagesize: number;
1267
1313
  success?: (res: AsyncResult<GetChatRoomsResult>) => any;
1268
1314
  error?: (error: ErrorEvent) => any;
@@ -1279,10 +1325,15 @@ export declare namespace EasemobChat {
1279
1325
  createChatRoom(
1280
1326
  this: Connection,
1281
1327
  params: {
1328
+ /** The chat room name. */
1282
1329
  name: string;
1330
+ /** The description of the chat room. */
1283
1331
  description: string;
1332
+ /** The maximum number of members in the chat room, including the chat room creator. The value is of integer type, 200 by default, and can not exceed 5,000. */
1284
1333
  maxusers: number;
1285
- members: UserId[];
1334
+ /** (Optional) The members in the chat room. An array of user IDs. If you set this parameter, ensure that the array contains at least one user. */
1335
+ members?: UserId[];
1336
+ /** The super admin token. */
1286
1337
  token: string;
1287
1338
  success?: (res: AsyncResult<CreateDeleteChatRoomResult>) => any;
1288
1339
  error?: (error: ErrorEvent) => any;
@@ -1299,7 +1350,9 @@ export declare namespace EasemobChat {
1299
1350
  destroyChatRoom(
1300
1351
  this: Connection,
1301
1352
  params: {
1353
+ /** The chat room ID */
1302
1354
  chatRoomId: string;
1355
+ /** The super admin token. */
1303
1356
  token: string;
1304
1357
  success?: (
1305
1358
  res: AsyncResult<CreateDeleteChatRoomResult>
@@ -1318,6 +1371,7 @@ export declare namespace EasemobChat {
1318
1371
  getChatRoomDetails(
1319
1372
  this: Connection,
1320
1373
  params: {
1374
+ /** The chat room ID. */
1321
1375
  chatRoomId: string;
1322
1376
  success?: (res: AsyncResult<GetChatRoomDetailsResult>) => void;
1323
1377
  error?: (error: ErrorEvent) => void;
@@ -1334,9 +1388,13 @@ export declare namespace EasemobChat {
1334
1388
  modifyChatRoom(
1335
1389
  this: Connection,
1336
1390
  params: {
1391
+ /** The chat room ID. */
1337
1392
  chatRoomId: string;
1393
+ /** The chat room name. */
1338
1394
  chatRoomName: string;
1395
+ /** The description of the chat room. */
1339
1396
  description: string;
1397
+ /** The maximum number of members in the chat room. */
1340
1398
  maxusers: number;
1341
1399
  success?: (res: AsyncResult<ModifyChatRoomResult>) => void;
1342
1400
  error?: (error: ErrorEvent) => void;
@@ -1347,7 +1405,9 @@ export declare namespace EasemobChat {
1347
1405
  removeSingleChatRoomMember(
1348
1406
  this: Connection,
1349
1407
  params: {
1408
+ /** The chat room ID. */
1350
1409
  chatRoomId: string;
1410
+ /** The member to be removed. */
1351
1411
  username: string;
1352
1412
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1353
1413
  error?: (error: ErrorEvent) => void;
@@ -1364,7 +1424,9 @@ export declare namespace EasemobChat {
1364
1424
  removeChatRoomMember(
1365
1425
  this: Connection,
1366
1426
  params: {
1427
+ /** The chat room ID. */
1367
1428
  chatRoomId: string;
1429
+ /** The member to be removed. */
1368
1430
  username: string;
1369
1431
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1370
1432
  error?: (error: ErrorEvent) => void;
@@ -1375,7 +1437,9 @@ export declare namespace EasemobChat {
1375
1437
  removeMultiChatRoomMember(
1376
1438
  this: Connection,
1377
1439
  params: {
1440
+ /** The chat room ID. */
1378
1441
  chatRoomId: string;
1442
+ /** The members to be removed. */
1379
1443
  users: string[];
1380
1444
  success?: (res: AsyncResult<CommonRequestResult[]>) => void;
1381
1445
  error?: (error: ErrorEvent) => void;
@@ -1392,7 +1456,9 @@ export declare namespace EasemobChat {
1392
1456
  removeChatRoomMembers(
1393
1457
  this: Connection,
1394
1458
  params: {
1459
+ /** The chat room ID. */
1395
1460
  chatRoomId: string;
1461
+ /** The members to be removed. */
1396
1462
  users: string[];
1397
1463
  success?: (res: AsyncResult<CommonRequestResult[]>) => void;
1398
1464
  error?: (error: ErrorEvent) => void;
@@ -1409,7 +1475,9 @@ export declare namespace EasemobChat {
1409
1475
  addUsersToChatRoom(
1410
1476
  this: Connection,
1411
1477
  params: {
1478
+ /** The chat room ID. */
1412
1479
  chatRoomId: string;
1480
+ /** The users to be added. */
1413
1481
  users: string[];
1414
1482
  success?: (res: AsyncResult<AddUsersToChatRoomResult>) => void;
1415
1483
  error?: (error: ErrorEvent) => void;
@@ -1426,7 +1494,9 @@ export declare namespace EasemobChat {
1426
1494
  joinChatRoom(
1427
1495
  this: Connection,
1428
1496
  params: {
1497
+ /** The chat room ID. */
1429
1498
  roomId: string;
1499
+ /** The reason for joining the chat room. It is optional. It is only used for groups. */
1430
1500
  message?: string;
1431
1501
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1432
1502
  error?: (error: ErrorEvent) => void;
@@ -1444,6 +1514,7 @@ export declare namespace EasemobChat {
1444
1514
  quitChatRoom(
1445
1515
  this: Connection,
1446
1516
  params: {
1517
+ /** The chat room ID. */
1447
1518
  roomId: string;
1448
1519
  success?: (res: AsyncResult<{ result: boolean }>) => void;
1449
1520
  error?: (error: ErrorEvent) => void;
@@ -1460,6 +1531,7 @@ export declare namespace EasemobChat {
1460
1531
  leaveChatRoom(
1461
1532
  this: Connection,
1462
1533
  params: {
1534
+ /** The chat room ID. */
1463
1535
  roomId: string;
1464
1536
  success?: (res: AsyncResult<{ result: boolean }>) => void;
1465
1537
  error?: (error: ErrorEvent) => void;
@@ -1470,8 +1542,11 @@ export declare namespace EasemobChat {
1470
1542
  listChatRoomMember(
1471
1543
  this: Connection,
1472
1544
  params: {
1545
+ /** The page number, starting from 1. */
1473
1546
  pageNum: number;
1547
+ /** The number of members per page. The value cannot exceed 1,000. */
1474
1548
  pageSize: number;
1549
+ /** The chat room ID. */
1475
1550
  chatRoomId: string;
1476
1551
  success?: (res: AsyncResult<{ member: string }[]>) => void;
1477
1552
  error?: (error: ErrorEvent) => void;
@@ -1488,8 +1563,11 @@ export declare namespace EasemobChat {
1488
1563
  listChatRoomMembers(
1489
1564
  this: Connection,
1490
1565
  params: {
1566
+ /** The page number, starting from 1. */
1491
1567
  pageNum: number;
1568
+ /** The number of members per page. The value cannot exceed 1,000. */
1492
1569
  pageSize: number;
1570
+ /** The chat room ID. */
1493
1571
  chatRoomId: string;
1494
1572
  success?: (res: AsyncResult<{ member: string }[]>) => void;
1495
1573
  error?: (error: ErrorEvent) => void;
@@ -1506,6 +1584,7 @@ export declare namespace EasemobChat {
1506
1584
  getChatRoomAdmin(
1507
1585
  this: Connection,
1508
1586
  params: {
1587
+ /** The chat room ID. */
1509
1588
  chatRoomId: string;
1510
1589
  success?: (res: AsyncResult<GetChatRoomAdminResult>) => void;
1511
1590
  error?: (error: ErrorEvent) => void;
@@ -1522,7 +1601,9 @@ export declare namespace EasemobChat {
1522
1601
  setChatRoomAdmin(
1523
1602
  this: Connection,
1524
1603
  params: {
1604
+ /** The chat room ID. */
1525
1605
  chatRoomId: string;
1606
+ /** The members to be set as admin. */
1526
1607
  username: string;
1527
1608
  success?: (res: AsyncResult<SetChatRoomAdminResult>) => void;
1528
1609
  error?: (error: ErrorEvent) => void;
@@ -1539,7 +1620,9 @@ export declare namespace EasemobChat {
1539
1620
  removeChatRoomAdmin(
1540
1621
  this: Connection,
1541
1622
  params: {
1623
+ /** The chat room ID. */
1542
1624
  chatRoomId: string;
1625
+ /** The admins to be removed. */
1543
1626
  username: string;
1544
1627
  success?: (res: AsyncResult<RemoveChatRoomAdminResult>) => void;
1545
1628
  error?: (error: ErrorEvent) => void;
@@ -1556,8 +1639,11 @@ export declare namespace EasemobChat {
1556
1639
  muteChatRoomMember(
1557
1640
  this: Connection,
1558
1641
  params: {
1642
+ /** The member to be muted in the chat room. */
1559
1643
  username: string;
1644
+ /** The mute duration in milliseconds. The value -1 indicates that the member is muted permanently. */
1560
1645
  muteDuration: number;
1646
+ /** The chat room ID. */
1561
1647
  chatRoomId: string;
1562
1648
  success?: (res: AsyncResult<MuteChatRoomMemberResult>) => void;
1563
1649
  error?: (error: ErrorEvent) => void;
@@ -1568,7 +1654,9 @@ export declare namespace EasemobChat {
1568
1654
  removeMuteChatRoomMember(
1569
1655
  this: Connection,
1570
1656
  params: {
1657
+ /** The chat room ID. */
1571
1658
  chatRoomId: string;
1659
+ /** The member to be unmuted. */
1572
1660
  username: string;
1573
1661
  success?: (
1574
1662
  res: AsyncResult<UnmuteChatRoomMemberResult[]>
@@ -1587,7 +1675,9 @@ export declare namespace EasemobChat {
1587
1675
  unmuteChatRoomMember(
1588
1676
  this: Connection,
1589
1677
  params: {
1678
+ /** The chat room ID. */
1590
1679
  chatRoomId: string;
1680
+ /** The member to be unmuted. */
1591
1681
  username: string;
1592
1682
  success?: (
1593
1683
  res: AsyncResult<UnmuteChatRoomMemberResult[]>
@@ -1600,6 +1690,7 @@ export declare namespace EasemobChat {
1600
1690
  getChatRoomMuted(
1601
1691
  this: Connection,
1602
1692
  params: {
1693
+ /** The chat room ID. */
1603
1694
  chatRoomId: string;
1604
1695
  success?: (
1605
1696
  res: AsyncResult<GetChatRoomMuteListResult[]>
@@ -1619,6 +1710,7 @@ export declare namespace EasemobChat {
1619
1710
  getChatRoomMuteList(
1620
1711
  this: Connection,
1621
1712
  params: {
1713
+ /** The chat room ID. */
1622
1714
  chatRoomId: string;
1623
1715
  success?: (
1624
1716
  res: AsyncResult<GetChatRoomMuteListResult[]>
@@ -1637,6 +1729,7 @@ export declare namespace EasemobChat {
1637
1729
  getChatRoomMutelist(
1638
1730
  this: Connection,
1639
1731
  params: {
1732
+ /** The chat room ID. */
1640
1733
  chatRoomId: string;
1641
1734
  success?: (
1642
1735
  res: AsyncResult<GetChatRoomMuteListResult[]>
@@ -1649,7 +1742,9 @@ export declare namespace EasemobChat {
1649
1742
  chatRoomBlockSingle(
1650
1743
  this: Connection,
1651
1744
  params: {
1745
+ /** The chat room ID. */
1652
1746
  chatRoomId: string;
1747
+ /** The member to be added to the blocklist. */
1653
1748
  username: string;
1654
1749
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1655
1750
  error?: (error: ErrorEvent) => void;
@@ -1666,7 +1761,9 @@ export declare namespace EasemobChat {
1666
1761
  blockChatRoomMember(
1667
1762
  this: Connection,
1668
1763
  params: {
1764
+ /** The chat room ID. */
1669
1765
  chatRoomId: string;
1766
+ /** The member to be added to the blocklist. */
1670
1767
  username: string;
1671
1768
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1672
1769
  error?: (error: ErrorEvent) => void;
@@ -1677,7 +1774,9 @@ export declare namespace EasemobChat {
1677
1774
  chatRoomBlockMulti(
1678
1775
  this: Connection,
1679
1776
  params: {
1777
+ /** The chat room ID. */
1680
1778
  chatRoomId: string;
1779
+ /** The members to be added to the blocklist. */
1681
1780
  usernames: string[];
1682
1781
  success?: (res: AsyncResult<CommonRequestResult[]>) => void;
1683
1782
  error?: (error: ErrorEvent) => void;
@@ -1694,7 +1793,9 @@ export declare namespace EasemobChat {
1694
1793
  blockChatRoomMembers(
1695
1794
  this: Connection,
1696
1795
  params: {
1796
+ /** The chat room ID. */
1697
1797
  chatRoomId: string;
1798
+ /** The members to be added to the blocklist. */
1698
1799
  usernames: string[];
1699
1800
  success?: (res: AsyncResult<CommonRequestResult[]>) => void;
1700
1801
  error?: (error: ErrorEvent) => void;
@@ -1705,7 +1806,9 @@ export declare namespace EasemobChat {
1705
1806
  removeChatRoomBlockSingle(
1706
1807
  this: Connection,
1707
1808
  params: {
1809
+ /** The chat room ID. */
1708
1810
  chatRoomId: string;
1811
+ /** The member to be removed from the blocklist. */
1709
1812
  username: string;
1710
1813
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1711
1814
  error?: (error: ErrorEvent) => void;
@@ -1722,7 +1825,9 @@ export declare namespace EasemobChat {
1722
1825
  unblockChatRoomMember(
1723
1826
  this: Connection,
1724
1827
  params: {
1828
+ /** The chat room ID. */
1725
1829
  chatRoomId: string;
1830
+ /** The member to be removed from the blocklist. */
1726
1831
  username: string;
1727
1832
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1728
1833
  error?: (error: ErrorEvent) => void;
@@ -1733,7 +1838,9 @@ export declare namespace EasemobChat {
1733
1838
  removeChatRoomBlockMulti(
1734
1839
  this: Connection,
1735
1840
  params: {
1841
+ /** The chat room ID. */
1736
1842
  chatRoomId: string;
1843
+ /** The array of members to be removed from the blocklist. */
1737
1844
  usernames: string[];
1738
1845
  success?: (res: AsyncResult<CommonRequestResult[]>) => void;
1739
1846
  error?: (error: ErrorEvent) => void;
@@ -1750,7 +1857,9 @@ export declare namespace EasemobChat {
1750
1857
  unblockChatRoomMembers(
1751
1858
  this: Connection,
1752
1859
  params: {
1860
+ /** The chat room ID. */
1753
1861
  chatRoomId: string;
1862
+ /** The array of members to be removed from the blocklist. */
1754
1863
  usernames: string[];
1755
1864
  success?: (res: AsyncResult<CommonRequestResult[]>) => void;
1756
1865
  error?: (error: ErrorEvent) => void;
@@ -1761,6 +1870,7 @@ export declare namespace EasemobChat {
1761
1870
  getChatRoomBlacklistNew(
1762
1871
  this: Connection,
1763
1872
  params: {
1873
+ /** The chat room ID. */
1764
1874
  chatRoomId: string;
1765
1875
  success?: (res: AsyncResult<UserId[]>) => void;
1766
1876
  error?: (error: ErrorEvent) => void;
@@ -1777,6 +1887,7 @@ export declare namespace EasemobChat {
1777
1887
  getChatRoomBlacklist(
1778
1888
  this: Connection,
1779
1889
  params: {
1890
+ /** The chat room ID. */
1780
1891
  chatRoomId: string;
1781
1892
  success?: (res: AsyncResult<UserId[]>) => void;
1782
1893
  error?: (error: ErrorEvent) => void;
@@ -1793,6 +1904,7 @@ export declare namespace EasemobChat {
1793
1904
  disableSendChatRoomMsg(
1794
1905
  this: Connection,
1795
1906
  params: {
1907
+ /** The chat room ID. */
1796
1908
  chatRoomId: string;
1797
1909
  success?: (
1798
1910
  res: AsyncResult<WhetherAbleSendChatRoomMsgResult>
@@ -1811,6 +1923,7 @@ export declare namespace EasemobChat {
1811
1923
  enableSendChatRoomMsg(
1812
1924
  this: Connection,
1813
1925
  params: {
1926
+ /** The chat room ID. */
1814
1927
  chatRoomId: string;
1815
1928
  success?: (
1816
1929
  res: AsyncResult<WhetherAbleSendChatRoomMsgResult>
@@ -1830,7 +1943,9 @@ export declare namespace EasemobChat {
1830
1943
  addUsersToChatRoomWhitelist(
1831
1944
  this: Connection,
1832
1945
  params: {
1946
+ /** The chat room ID. */
1833
1947
  chatRoomId: string;
1948
+ /** The members to be added to the allowlist. */
1834
1949
  users: string[];
1835
1950
  success?: (
1836
1951
  res: AsyncResult<
@@ -1851,7 +1966,9 @@ export declare namespace EasemobChat {
1851
1966
  addUsersToChatRoomAllowlist(
1852
1967
  this: Connection,
1853
1968
  params: {
1969
+ /** The chat room ID. */
1854
1970
  chatRoomId: string;
1971
+ /** The members to be added to the allowlist. */
1855
1972
  users: string[];
1856
1973
  success?: (
1857
1974
  res: AsyncResult<
@@ -1866,7 +1983,9 @@ export declare namespace EasemobChat {
1866
1983
  rmUsersFromChatRoomWhitelist(
1867
1984
  this: Connection,
1868
1985
  params: {
1986
+ /** The chat room ID. */
1869
1987
  chatRoomId: string;
1988
+ /** The members to be removed from the allowlist. */
1870
1989
  userName: string;
1871
1990
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1872
1991
  error?: (error: ErrorEvent) => void;
@@ -1884,7 +2003,9 @@ export declare namespace EasemobChat {
1884
2003
  removeChatRoomWhitelistMember(
1885
2004
  this: Connection,
1886
2005
  params: {
2006
+ /** The chat room ID. */
1887
2007
  chatRoomId: string;
2008
+ /** The members to be removed from the allowlist. */
1888
2009
  userName: string;
1889
2010
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1890
2011
  error?: (error: ErrorEvent) => void;
@@ -1901,7 +2022,9 @@ export declare namespace EasemobChat {
1901
2022
  removeChatRoomAllowlistMember(
1902
2023
  this: Connection,
1903
2024
  params: {
2025
+ /** The chat room ID. */
1904
2026
  chatRoomId: string;
2027
+ /** The members to be removed from the allowlist. */
1905
2028
  userName: string;
1906
2029
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1907
2030
  error?: (error: ErrorEvent) => void;
@@ -1919,6 +2042,7 @@ export declare namespace EasemobChat {
1919
2042
  getChatRoomWhitelist(
1920
2043
  this: Connection,
1921
2044
  params: {
2045
+ /** The chat room ID. */
1922
2046
  chatRoomId: string;
1923
2047
  success: (res: AsyncResult<UserId[]>) => void;
1924
2048
  error: (error: ErrorEvent) => void;
@@ -1935,6 +2059,7 @@ export declare namespace EasemobChat {
1935
2059
  getChatRoomAllowlist(
1936
2060
  this: Connection,
1937
2061
  params: {
2062
+ /** The chat room ID. */
1938
2063
  chatRoomId: string;
1939
2064
  success: (res: AsyncResult<UserId[]>) => void;
1940
2065
  error: (error: ErrorEvent) => void;
@@ -1952,7 +2077,9 @@ export declare namespace EasemobChat {
1952
2077
  isChatRoomWhiteUser(
1953
2078
  this: Connection,
1954
2079
  params: {
2080
+ /** The chat room ID. */
1955
2081
  chatRoomId: string;
2082
+ /** The member ID. */
1956
2083
  userName: string;
1957
2084
  success?: (res: AsyncResult<IsChatRoomWhiteUserResult>) => void;
1958
2085
  error?: (error: ErrorEvent) => void;
@@ -1969,7 +2096,9 @@ export declare namespace EasemobChat {
1969
2096
  isInChatRoomAllowlist(
1970
2097
  this: Connection,
1971
2098
  params: {
2099
+ /** The chat room ID. */
1972
2100
  chatRoomId: string;
2101
+ /** The member ID. */
1973
2102
  userName: string;
1974
2103
  success?: (res: AsyncResult<IsChatRoomWhiteUserResult>) => void;
1975
2104
  error?: (error: ErrorEvent) => void;
@@ -1986,6 +2115,7 @@ export declare namespace EasemobChat {
1986
2115
  fetchChatRoomAnnouncement(
1987
2116
  this: Connection,
1988
2117
  params: {
2118
+ /** The chat room ID. */
1989
2119
  roomId: string;
1990
2120
  success?: (
1991
2121
  res: AsyncResult<FetchChatRoomAnnouncementResult>
@@ -2004,7 +2134,9 @@ export declare namespace EasemobChat {
2004
2134
  updateChatRoomAnnouncement(
2005
2135
  this: Connection,
2006
2136
  params: {
2137
+ /** The chat room ID. */
2007
2138
  roomId: string;
2139
+ /** The announcement content. */
2008
2140
  announcement: string;
2009
2141
  success: (
2010
2142
  res: AsyncResult<UpdateChatRoomAnnouncementResult>
@@ -2023,11 +2155,17 @@ export declare namespace EasemobChat {
2023
2155
  uploadChatRoomSharedFile(
2024
2156
  this: Connection,
2025
2157
  params: {
2158
+ /** The chat room ID. */
2026
2159
  roomId: string;
2160
+ /** The shared file object to upload. */
2027
2161
  file: object;
2162
+ /** The upload progress callback. */
2028
2163
  onFileUploadProgress?: (data: any) => void;
2164
+ /** The upload completion callback. */
2029
2165
  onFileUploadComplete?: (data: any) => void;
2166
+ /** The upload failure callback. */
2030
2167
  onFileUploadError?: (data: any) => void;
2168
+ /** The upload cancellation callback. */
2031
2169
  onFileUploadCanceled?: (data: any) => void;
2032
2170
  }
2033
2171
  ): void;
@@ -2042,7 +2180,9 @@ export declare namespace EasemobChat {
2042
2180
  deleteChatRoomSharedFile(
2043
2181
  this: Connection,
2044
2182
  params: {
2183
+ /** The chat room ID. */
2045
2184
  roomId: string;
2185
+ /** The shared file ID. */
2046
2186
  fileId: string;
2047
2187
  success?: (
2048
2188
  res: AsyncResult<DeleteChatRoomSharedFileResult>
@@ -2062,6 +2202,7 @@ export declare namespace EasemobChat {
2062
2202
  fetchChatRoomSharedFileList(
2063
2203
  this: Connection,
2064
2204
  params: {
2205
+ /** The chat room ID. */
2065
2206
  roomId: string;
2066
2207
  success?: (
2067
2208
  res: AsyncResult<FetchChatRoomSharedFileListResult[]>
@@ -2080,6 +2221,7 @@ export declare namespace EasemobChat {
2080
2221
  getChatRoomSharedFilelist(
2081
2222
  this: Connection,
2082
2223
  params: {
2224
+ /** The chat room ID. */
2083
2225
  roomId: string;
2084
2226
  success?: (
2085
2227
  res: AsyncResult<FetchChatRoomSharedFileListResult[]>
@@ -2089,18 +2231,30 @@ export declare namespace EasemobChat {
2089
2231
  ): Promise<AsyncResult<FetchChatRoomSharedFileListResult[]>>;
2090
2232
 
2091
2233
  // Group API
2092
- /** @deprecated */
2234
+ /** @deprecated User {@link createGroup instead.} */
2093
2235
  createGroupNew(
2094
2236
  this: Connection,
2095
2237
  params: {
2238
+ /** The group information. */
2096
2239
  data: {
2240
+ /** The group name. */
2097
2241
  groupname: string;
2242
+ /** The description of the group. */
2098
2243
  desc: string;
2244
+ /** The array of member IDs to add to the group. These users will be added directly into the group and receive "operation: 'directJoined'" in the callback of onGroupEvent. */
2099
2245
  members: UserId[];
2246
+ /** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `listgroups`. */
2100
2247
  public: boolean;
2248
+ /** Whether a user requires the approval from the group admin to join the group. -`true`: Yes; -`false`: No.*/
2101
2249
  approval: boolean;
2250
+ /** Whether to allow group members to invite others to the group. `true`: Allow; `false`: Do not allow.*/
2102
2251
  allowinvites: boolean;
2252
+ /** Whether the invitee needs to accept the invitation before joining the group.
2253
+ - `true`: The invitee's consent is required. The default value is `true`.
2254
+ - `false`: The invitee will be directly added to the group without confirmation.
2255
+ */
2103
2256
  inviteNeedConfirm: boolean;
2257
+ /** The group max users. */
2104
2258
  maxusers: number;
2105
2259
  };
2106
2260
  success?: (res: AsyncResult<CreateGroupResult>) => void;
@@ -2109,33 +2263,45 @@ export declare namespace EasemobChat {
2109
2263
  ): Promise<AsyncResult<CreateGroupResult>>;
2110
2264
 
2111
2265
  /**
2112
- * Creates group
2113
- *
2114
- * ```typescript
2115
- * connection.createGroup({
2116
- data: {
2117
- groupname: 'groupname',
2118
- desc: 'this is my group',
2119
- members: ['user1', 'user2'],
2120
- public: true,
2121
- approval: false,
2122
- allowinvites: true,
2123
- inviteNeedConfirm: false
2124
- }
2125
- })
2126
- * ```
2127
- */
2266
+ * Creates group
2267
+ *
2268
+ * ```typescript
2269
+ * connection.createGroup({
2270
+ data: {
2271
+ groupname: 'groupname',
2272
+ desc: 'this is my group',
2273
+ members: ['user1', 'user2'],
2274
+ public: true,
2275
+ approval: false,
2276
+ allowinvites: true,
2277
+ inviteNeedConfirm: false
2278
+ }
2279
+ })
2280
+ * ```
2281
+ */
2128
2282
  createGroup(
2129
2283
  this: Connection,
2130
2284
  params: {
2285
+ /** The group information. */
2131
2286
  data: {
2287
+ /** The group name. */
2132
2288
  groupname: string;
2289
+ /** The description of the group. */
2133
2290
  desc: string;
2291
+ /** The array of member IDs to add to the group. These users will be added directly into the group and receive "operation: 'directJoined'" in the callback of onGroupEvent. */
2134
2292
  members: UserId[];
2293
+ /** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `listgroups`. */
2135
2294
  public: boolean;
2295
+ /** Whether a user requires the approval from the group admin to join the group. -`true`: Yes; -`false`: No.*/
2136
2296
  approval: boolean;
2297
+ /** Whether to allow group members to invite others to the group. `true`: Allow; `false`: Do not allow.*/
2137
2298
  allowinvites: boolean;
2299
+ /** Whether the invitee needs to accept the invitation before joining the group.
2300
+ - `true`: The invitee's consent is required. The default value is `true`.
2301
+ - `false`: The invitee will be directly added to the group without confirmation.
2302
+ */
2138
2303
  inviteNeedConfirm: boolean;
2304
+ /** The group max users. */
2139
2305
  maxusers: number;
2140
2306
  };
2141
2307
  success?: (res: AsyncResult<CreateGroupResult>) => void;
@@ -2143,10 +2309,11 @@ export declare namespace EasemobChat {
2143
2309
  }
2144
2310
  ): Promise<AsyncResult<CreateGroupResult>>;
2145
2311
 
2146
- /** @deprecated */
2312
+ /** @deprecated Use {@link blockGroupMessages instead.} */
2147
2313
  blockGroup(
2148
2314
  this: Connection,
2149
2315
  params: {
2316
+ /** The group ID. */
2150
2317
  groupId: string;
2151
2318
  success?: (res: AsyncResult<BlockGroupResult>) => void;
2152
2319
  error?: (error: ErrorEvent) => void;
@@ -2162,6 +2329,7 @@ export declare namespace EasemobChat {
2162
2329
  blockGroupMessages(
2163
2330
  this: Connection,
2164
2331
  params: {
2332
+ /** The group ID. */
2165
2333
  groupId: string;
2166
2334
  success?: (res: AsyncResult<BlockGroupResult>) => void;
2167
2335
  error?: (error: ErrorEvent) => void;
@@ -2179,7 +2347,9 @@ export declare namespace EasemobChat {
2179
2347
  listGroups(
2180
2348
  this: Connection,
2181
2349
  params: {
2350
+ /** The number of records per page. */
2182
2351
  limit: number;
2352
+ /** The cursor that specifies where to start to get data. If there will be data on the next page, this method will return the value of this field to indicate the position to start to get data of the next page. If it is null, the data of the first page will be fetched. */
2183
2353
  cursor?: string;
2184
2354
  success?: (res: AsyncResult<BaseGroupInfo[]>) => void;
2185
2355
  error?: (error: ErrorEvent) => void;
@@ -2196,7 +2366,9 @@ export declare namespace EasemobChat {
2196
2366
  getPublicGroups(
2197
2367
  this: Connection,
2198
2368
  params: {
2369
+ /** The number of records per page. */
2199
2370
  limit: number;
2371
+ /** The cursor that specifies where to start to get data. If there will be data on the next page, this method will return the value of this field to indicate the position to start to get data of the next page. If it is null, the data of the first page will be fetched. */
2200
2372
  cursor?: string;
2201
2373
  success?: (res: AsyncResult<BaseGroupInfo[]>) => void;
2202
2374
  error?: (error: ErrorEvent) => void;
@@ -2209,7 +2381,7 @@ export declare namespace EasemobChat {
2209
2381
  * ```typescript
2210
2382
  * connection.getGroup()
2211
2383
  * ```
2212
- * @deprecated
2384
+ * @deprecated Use {@link getJoinedGroups instead.}
2213
2385
  */
2214
2386
  getGroup(
2215
2387
  this: Connection,
@@ -2229,9 +2401,13 @@ export declare namespace EasemobChat {
2229
2401
  getJoinedGroups(
2230
2402
  this: Connection,
2231
2403
  params: {
2404
+ /** The current page number. */
2232
2405
  pageNum: number;
2406
+ /** The number of group per page. */
2233
2407
  pageSize: number;
2408
+ /** Whether the number of group members is required. */
2234
2409
  needAffiliations?: boolean;
2410
+ /** Whether the role of the account in the group is required. */
2235
2411
  needRole?: boolean;
2236
2412
  success?: (res: AsyncResult<BaseGroupInfo[]>) => void;
2237
2413
  error?: (error: ErrorEvent) => void;
@@ -2242,7 +2418,9 @@ export declare namespace EasemobChat {
2242
2418
  changeOwner(
2243
2419
  this: Connection,
2244
2420
  params: {
2421
+ /** The group ID. */
2245
2422
  groupId: string;
2423
+ /** The new group owner. */
2246
2424
  newOwner: UserId;
2247
2425
  success?: (res: AsyncResult<ChangeGroupOwnerResult>) => void;
2248
2426
  error?: (error: ErrorEvent) => void;
@@ -2259,7 +2437,9 @@ export declare namespace EasemobChat {
2259
2437
  changeGroupOwner(
2260
2438
  this: Connection,
2261
2439
  params: {
2440
+ /** The group ID. */
2262
2441
  groupId: string;
2442
+ /** The new group owner. */
2263
2443
  newOwner: UserId;
2264
2444
  success?: (res: AsyncResult<ChangeGroupOwnerResult>) => void;
2265
2445
  error?: (error: ErrorEvent) => void;
@@ -2275,6 +2455,7 @@ export declare namespace EasemobChat {
2275
2455
  getGroupInfo(
2276
2456
  this: Connection,
2277
2457
  params: {
2458
+ /** The group ID or group ID list. */
2278
2459
  groupId: string | string[];
2279
2460
  success?: (res: AsyncResult<GroupDetailInfo[]>) => void;
2280
2461
  error?: (error: ErrorEvent) => void;
@@ -2291,8 +2472,11 @@ export declare namespace EasemobChat {
2291
2472
  modifyGroup(
2292
2473
  this: Connection,
2293
2474
  params: {
2475
+ /** The Group ID. */
2294
2476
  groupId: string;
2477
+ /** The group name. */
2295
2478
  groupName: string;
2479
+ /** The group description. */
2296
2480
  description: string;
2297
2481
  success?: (res: AsyncResult<ModifyGroupResult>) => void;
2298
2482
  error?: (error: ErrorEvent) => void;
@@ -2303,8 +2487,11 @@ export declare namespace EasemobChat {
2303
2487
  listGroupMember(
2304
2488
  this: Connection,
2305
2489
  params: {
2490
+ /** The group ID。 */
2306
2491
  groupId: string;
2492
+ /** The page number, starting from 1. */
2307
2493
  pageNum: number;
2494
+ /** The number of members per page. The value cannot exceed 1000. */
2308
2495
  pageSize: number;
2309
2496
  success?: (res: AsyncResult<GroupMember[]>) => void;
2310
2497
  error?: (error: ErrorEvent) => void;
@@ -2321,8 +2508,11 @@ export declare namespace EasemobChat {
2321
2508
  listGroupMembers(
2322
2509
  this: Connection,
2323
2510
  params: {
2511
+ /** The group ID. */
2324
2512
  groupId: string;
2513
+ /** The page number, starting from 1. */
2325
2514
  pageNum: number;
2515
+ /** The number of members per page. The value cannot exceed 1000. */
2326
2516
  pageSize: number;
2327
2517
  success?: (res: AsyncResult<GroupMember[]>) => void;
2328
2518
  error?: (error: ErrorEvent) => void;
@@ -2338,17 +2528,20 @@ export declare namespace EasemobChat {
2338
2528
  getGroupAdmin(
2339
2529
  this: Connection,
2340
2530
  params: {
2531
+ /** The group ID. */
2341
2532
  groupId: string;
2342
2533
  success?: (res: AsyncResult<UserId[]>) => void;
2343
2534
  error?: (error: ErrorEvent) => void;
2344
2535
  }
2345
2536
  ): Promise<AsyncResult<UserId[]>>;
2346
2537
 
2347
- /** @deprecated */
2538
+ /** @deprecated Use {@link setGroupAdmin instead.} */
2348
2539
  setAdmin(
2349
2540
  this: Connection,
2350
2541
  params: {
2542
+ /** The group ID. */
2351
2543
  groupId: string;
2544
+ /** The ID of the user set as admin. */
2352
2545
  username: UserId;
2353
2546
  success?: (res: AsyncResult<SetGroupAdminResult>) => void;
2354
2547
  error?: (error: ErrorEvent) => void;
@@ -2365,7 +2558,9 @@ export declare namespace EasemobChat {
2365
2558
  setGroupAdmin(
2366
2559
  this: Connection,
2367
2560
  params: {
2561
+ /** The group ID. */
2368
2562
  groupId: string;
2563
+ /** The ID of the user set as admin. */
2369
2564
  username: UserId;
2370
2565
  success?: (res: AsyncResult<SetGroupAdminResult>) => void;
2371
2566
  error?: (error: ErrorEvent) => void;
@@ -2373,6 +2568,7 @@ export declare namespace EasemobChat {
2373
2568
  ): Promise<AsyncResult<SetGroupAdminResult>>;
2374
2569
 
2375
2570
  /**
2571
+ * @deprecated Use {@link removeGroupAdmin} instead.
2376
2572
  * Removes a group admin. Only the group owner can call this method. The user whose admin permissions are revoked will receive "operation: 'removeAdmin'" in the callback of onGroupEvent.
2377
2573
  *
2378
2574
  * ```typescript
@@ -2382,17 +2578,39 @@ export declare namespace EasemobChat {
2382
2578
  removeAdmin(
2383
2579
  this: Connection,
2384
2580
  params: {
2581
+ /** The group ID. */
2385
2582
  groupId: string;
2583
+ /** The ID of the user with admin privileges revoked. */
2386
2584
  username: string;
2387
2585
  success?: (res: AsyncResult<RemoveGroupAdminResult>) => void;
2388
2586
  error?: (error: ErrorEvent) => void;
2389
2587
  }
2390
2588
  ): Promise<AsyncResult<RemoveGroupAdminResult>>;
2391
2589
 
2392
- /** @deprecated */
2590
+ /**
2591
+ * Removes a group admin. Only the group owner can call this method. The user whose admin permissions are revoked will receive "operation: 'removeAdmin'" in the callback of onGroupEvent.
2592
+ *
2593
+ * ```typescript
2594
+ * connection.removeGroupAdmin({groupId: 'groupId', username: 'user1'})
2595
+ * ```
2596
+ */
2597
+ removeGroupAdmin(
2598
+ this: Connection,
2599
+ params: {
2600
+ /** The group ID. */
2601
+ groupId: string;
2602
+ /** The ID of the user with admin privileges revoked. */
2603
+ username: string;
2604
+ success?: (res: AsyncResult<RemoveGroupAdminResult>) => void;
2605
+ error?: (error: ErrorEvent) => void;
2606
+ }
2607
+ ): Promise<AsyncResult<RemoveGroupAdminResult>>;
2608
+
2609
+ /** @deprecated Use {@link destroyGroup instead.}*/
2393
2610
  dissolveGroup(
2394
2611
  this: Connection,
2395
2612
  params: {
2613
+ /** The group ID. */
2396
2614
  groupId: string;
2397
2615
  success?: (res: AsyncResult<DestroyGroupResult>) => void;
2398
2616
  error?: (error: ErrorEvent) => void;
@@ -2409,6 +2627,7 @@ export declare namespace EasemobChat {
2409
2627
  destroyGroup(
2410
2628
  this: Connection,
2411
2629
  params: {
2630
+ /** The group ID. */
2412
2631
  groupId: string;
2413
2632
  success?: (res: AsyncResult<DestroyGroupResult>) => void;
2414
2633
  error?: (error: ErrorEvent) => void;
@@ -2416,6 +2635,7 @@ export declare namespace EasemobChat {
2416
2635
  ): Promise<AsyncResult<DestroyGroupResult>>;
2417
2636
 
2418
2637
  /**
2638
+ * @deprecated Use {@link leaveGroup} instead.
2419
2639
  * Leaves the group. Group members will receive "operation: 'memberAbsence'" in the callback of onGroupEvent.
2420
2640
  *
2421
2641
  * ```typescript
@@ -2425,17 +2645,37 @@ export declare namespace EasemobChat {
2425
2645
  quitGroup(
2426
2646
  this: Connection,
2427
2647
  params: {
2648
+ /** The group ID. */
2428
2649
  groupId: string;
2429
2650
  success?: (res: AsyncResult<{ result: true }>) => void;
2430
2651
  error?: (error: ErrorEvent) => void;
2431
2652
  }
2432
2653
  ): Promise<AsyncResult<{ result: true }>>;
2433
2654
 
2434
- /** @deprecated */
2655
+ /**
2656
+ * Leaves the group. Group members will receive "operation: 'memberAbsence'" in the callback of onGroupEvent.
2657
+ *
2658
+ * ```typescript
2659
+ * connection.leaveGroup({groupId: 'groupId'})
2660
+ * ```
2661
+ */
2662
+ leaveGroup(
2663
+ this: Connection,
2664
+ params: {
2665
+ /** The group ID. */
2666
+ groupId: string;
2667
+ success?: (res: AsyncResult<{ result: true }>) => void;
2668
+ error?: (error: ErrorEvent) => void;
2669
+ }
2670
+ ): Promise<AsyncResult<{ result: true }>>;
2671
+
2672
+ /** @deprecated Use {@link inviteUsersToGroup} instead.*/
2435
2673
  inviteToGroup(
2436
2674
  this: Connection,
2437
2675
  params: {
2676
+ /** The group ID. */
2438
2677
  groupId: string;
2678
+ /** The array of invitee IDs. */
2439
2679
  users: UserId[];
2440
2680
  success?: (
2441
2681
  res: AsyncResult<InviteUsersToGroupResult[]>
@@ -2456,7 +2696,9 @@ export declare namespace EasemobChat {
2456
2696
  inviteUsersToGroup(
2457
2697
  this: Connection,
2458
2698
  params: {
2699
+ /** The group ID. */
2459
2700
  groupId: string;
2701
+ /** The array of invitee IDs. */
2460
2702
  users: UserId[];
2461
2703
  success?: (
2462
2704
  res: AsyncResult<InviteUsersToGroupResult[]>
@@ -2475,18 +2717,22 @@ export declare namespace EasemobChat {
2475
2717
  joinGroup(
2476
2718
  this: Connection,
2477
2719
  params: {
2720
+ /** The group ID. */
2478
2721
  groupId: string;
2722
+ /** The additional information of the request. */
2479
2723
  message: string;
2480
2724
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2481
2725
  error?: (error: ErrorEvent) => void;
2482
2726
  }
2483
2727
  ): Promise<AsyncResult<CommonRequestResult>>;
2484
2728
 
2485
- /** @deprecated */
2729
+ /** @deprecated Use {@link acceptGroupJoinRequest} instead. */
2486
2730
  agreeJoinGroup(
2487
2731
  this: Connection,
2488
2732
  params: {
2733
+ /** The ID of the user requesting to join the group. */
2489
2734
  applicant: UserId;
2735
+ /** The group ID. */
2490
2736
  groupId: string;
2491
2737
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2492
2738
  error?: (error: ErrorEvent) => void;
@@ -2503,19 +2749,24 @@ export declare namespace EasemobChat {
2503
2749
  acceptGroupJoinRequest(
2504
2750
  this: Connection,
2505
2751
  params: {
2752
+ /** The ID of the user requesting to join the group. */
2506
2753
  applicant: UserId;
2754
+ /** The group ID. */
2507
2755
  groupId: string;
2508
2756
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2509
2757
  error?: (error: ErrorEvent) => void;
2510
2758
  }
2511
2759
  ): Promise<AsyncResult<CommonRequestResult>>;
2512
2760
 
2513
- /** @deprecated */
2761
+ /** @deprecated Use {@link rejectGroupJoinRequest} instead. */
2514
2762
  rejectJoinGroup(
2515
2763
  this: Connection,
2516
2764
  params: {
2765
+ /** The ID of the user who sends the request to join the group. */
2517
2766
  applicant: UserId;
2767
+ /** The group ID. */
2518
2768
  groupId: string;
2769
+ /** The reason of declining. */
2519
2770
  reason: string;
2520
2771
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2521
2772
  error?: (error: ErrorEvent) => void;
@@ -2532,19 +2783,24 @@ export declare namespace EasemobChat {
2532
2783
  rejectGroupJoinRequest(
2533
2784
  this: Connection,
2534
2785
  params: {
2786
+ /** The ID of the user who sends the request to join the group. */
2535
2787
  applicant: UserId;
2788
+ /** The group ID. */
2536
2789
  groupId: string;
2790
+ /** The reason of declining. */
2537
2791
  reason: string;
2538
2792
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2539
2793
  error?: (error: ErrorEvent) => void;
2540
2794
  }
2541
2795
  ): Promise<AsyncResult<CommonRequestResult>>;
2542
2796
 
2543
- /** @deprecated */
2797
+ /** @deprecated Use {@link acceptGroupInvite} instead. */
2544
2798
  agreeInviteIntoGroup(
2545
2799
  this: Connection,
2546
2800
  params: {
2801
+ /** The user ID of the invitee. */
2547
2802
  invitee: UserId;
2803
+ /** The group ID. */
2548
2804
  groupId: string;
2549
2805
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2550
2806
  error?: (error: ErrorEvent) => void;
@@ -2561,23 +2817,27 @@ export declare namespace EasemobChat {
2561
2817
  acceptGroupInvite(
2562
2818
  this: Connection,
2563
2819
  params: {
2820
+ /** The user ID of the invitee. */
2564
2821
  invitee: UserId;
2822
+ /** The group ID. */
2565
2823
  groupId: string;
2566
2824
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2567
2825
  error?: (error: ErrorEvent) => void;
2568
2826
  }
2569
2827
  ): Promise<AsyncResult<CommonRequestResult>>;
2570
2828
 
2571
- /** @deprecated */
2829
+ /** @deprecated Use {@link rejectGroupInvite} instead. */
2572
2830
  rejectInviteIntoGroup(
2573
2831
  this: Connection,
2574
2832
  params: {
2833
+ /** The user ID of the invitee. */
2575
2834
  invitee: UserId;
2835
+ /** The group ID. */
2576
2836
  groupId: string;
2577
2837
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2578
2838
  error?: (error: ErrorEvent) => void;
2579
2839
  }
2580
- ): Promise<any>;
2840
+ ): Promise<AsyncResult<CommonRequestResult>>;
2581
2841
 
2582
2842
  /**
2583
2843
  * Declines a group invitation. If a group member invites a user to join a group, the invitee can call this method to decline the invitation.
@@ -2589,18 +2849,22 @@ export declare namespace EasemobChat {
2589
2849
  rejectGroupInvite(
2590
2850
  this: Connection,
2591
2851
  params: {
2852
+ /** The user ID of the invitee. */
2592
2853
  invitee: UserId;
2854
+ /** The group ID. */
2593
2855
  groupId: string;
2594
2856
  success?: (res: AsyncResult<CommonRequestResult>) => void;
2595
2857
  error?: (error: ErrorEvent) => void;
2596
2858
  }
2597
- ): Promise<any>;
2859
+ ): Promise<AsyncResult<CommonRequestResult>>;
2598
2860
 
2599
- /** @deprecated */
2861
+ /** @deprecated Use {@link removeGroupMember} instead. */
2600
2862
  removeSingleGroupMember(
2601
2863
  this: Connection,
2602
2864
  params: {
2865
+ /** The group ID. */
2603
2866
  groupId: string;
2867
+ /** The member ID to remove. */
2604
2868
  username: UserId;
2605
2869
  success?: (res: AsyncResult<RemoveGroupMemberResult>) => void;
2606
2870
  error?: (error: ErrorEvent) => void;
@@ -2617,18 +2881,22 @@ export declare namespace EasemobChat {
2617
2881
  removeGroupMember(
2618
2882
  this: Connection,
2619
2883
  params: {
2884
+ /** The group ID. */
2620
2885
  groupId: string;
2886
+ /** The member ID to remove. */
2621
2887
  username: UserId;
2622
2888
  success?: (res: AsyncResult<RemoveGroupMemberResult>) => void;
2623
2889
  error?: (error: ErrorEvent) => void;
2624
2890
  }
2625
2891
  ): Promise<AsyncResult<RemoveGroupMemberResult>>;
2626
2892
 
2627
- /** @deprecated */
2893
+ /** @deprecated Use {@link removeGroupMembers} instead. */
2628
2894
  removeMultiGroupMember(
2629
2895
  this: Connection,
2630
2896
  params: {
2897
+ /** The group ID. */
2631
2898
  groupId: string;
2899
+ /** The array of member IDs to remove. */
2632
2900
  users: UserId[];
2633
2901
  success?: (res: AsyncResult<RemoveGroupMemberResult[]>) => void;
2634
2902
  error?: (error: ErrorEvent) => void;
@@ -2645,19 +2913,24 @@ export declare namespace EasemobChat {
2645
2913
  removeGroupMembers(
2646
2914
  this: Connection,
2647
2915
  params: {
2916
+ /** The group ID. */
2648
2917
  groupId: string;
2918
+ /** The array of member IDs to remove. */
2649
2919
  users: UserId[];
2650
2920
  success?: (res: AsyncResult<RemoveGroupMemberResult[]>) => void;
2651
2921
  error?: (error: ErrorEvent) => void;
2652
2922
  }
2653
2923
  ): Promise<AsyncResult<RemoveGroupMemberResult[]>>;
2654
2924
 
2655
- /** @deprecated */
2925
+ /** @deprecated Use {@link muteGroupMember} instead. */
2656
2926
  mute(
2657
2927
  this: Connection,
2658
2928
  params: {
2929
+ /** The ID of the group member to mute. */
2659
2930
  username: UserId;
2931
+ /** The mute duration in milliseconds. The value `-1` indicates that the member is muted permanently.*/
2660
2932
  muteDuration: number;
2933
+ /** The group ID. */
2661
2934
  groupId: string;
2662
2935
  success?: (res: AsyncResult<MuteGroupMemberResult[]>) => void;
2663
2936
  error?: (error: ErrorEvent) => void;
@@ -2674,19 +2947,24 @@ export declare namespace EasemobChat {
2674
2947
  muteGroupMember(
2675
2948
  this: Connection,
2676
2949
  params: {
2950
+ /** The ID of the group member to mute. */
2677
2951
  username: UserId;
2952
+ /** The mute duration in milliseconds. The value `-1` indicates that the member is muted permanently.*/
2678
2953
  muteDuration: number;
2954
+ /** The group ID. */
2679
2955
  groupId: string;
2680
2956
  success?: (res: AsyncResult<MuteGroupMemberResult[]>) => void;
2681
2957
  error?: (error: ErrorEvent) => void;
2682
2958
  }
2683
2959
  ): Promise<AsyncResult<MuteGroupMemberResult[]>>;
2684
2960
 
2685
- /** @deprecated */
2961
+ /** @deprecated Use {@link unmuteGroupMember} instead. */
2686
2962
  removeMute(
2687
2963
  this: Connection,
2688
2964
  params: {
2965
+ /** The group ID. */
2689
2966
  groupId: string;
2967
+ /** The group member ID to unmute. */
2690
2968
  username: UserId;
2691
2969
  success?: (res: AsyncResult<UnmuteGroupMemberResult[]>) => void;
2692
2970
  error?: (error: ErrorEvent) => void;
@@ -2703,17 +2981,20 @@ export declare namespace EasemobChat {
2703
2981
  unmuteGroupMember(
2704
2982
  this: Connection,
2705
2983
  params: {
2984
+ /** The group ID. */
2706
2985
  groupId: string;
2986
+ /** The group member ID to unmute. */
2707
2987
  username: UserId;
2708
2988
  success?: (res: AsyncResult<UnmuteGroupMemberResult[]>) => void;
2709
2989
  error?: (error: ErrorEvent) => void;
2710
2990
  }
2711
2991
  ): Promise<AsyncResult<UnmuteGroupMemberResult[]>>;
2712
2992
 
2713
- /** @deprecated */
2993
+ /** @deprecated Use {@link getGroupMutelist} instead. */
2714
2994
  getMuted(
2715
2995
  this: Connection,
2716
2996
  params: {
2997
+ /** The group ID. */
2717
2998
  groupId: string;
2718
2999
  success?: (res: AsyncResult<GetGroupMuteListResult[]>) => void;
2719
3000
  error?: (error: ErrorEvent) => void;
@@ -2730,17 +3011,20 @@ export declare namespace EasemobChat {
2730
3011
  getGroupMuteList(
2731
3012
  this: Connection,
2732
3013
  params: {
3014
+ /** The group ID. */
2733
3015
  groupId: string;
2734
3016
  success?: (res: AsyncResult<GetGroupMuteListResult[]>) => void;
2735
3017
  error?: (error: ErrorEvent) => void;
2736
3018
  }
2737
3019
  ): Promise<AsyncResult<GetGroupMuteListResult[]>>;
2738
3020
 
2739
- /** @deprecated */
3021
+ /** @deprecated Use {@link blockGroupMember} instead. */
2740
3022
  groupBlockSingle(
2741
3023
  this: Connection,
2742
3024
  params: {
3025
+ /** The group ID. */
2743
3026
  groupId: string;
3027
+ /** User ID to be added to the blocklist. */
2744
3028
  username: UserId;
2745
3029
  success?: (res: AsyncResult<GroupRequestResult>) => void;
2746
3030
  error?: (error: ErrorEvent) => void;
@@ -2757,18 +3041,22 @@ export declare namespace EasemobChat {
2757
3041
  blockGroupMember(
2758
3042
  this: Connection,
2759
3043
  params: {
3044
+ /** The group ID. */
2760
3045
  groupId: string;
3046
+ /** User ID to be added to the blocklist. */
2761
3047
  username: UserId;
2762
3048
  success?: (res: AsyncResult<GroupRequestResult>) => void;
2763
3049
  error?: (error: ErrorEvent) => void;
2764
3050
  }
2765
3051
  ): Promise<AsyncResult<GroupRequestResult>>;
2766
3052
 
2767
- /** @deprecated */
3053
+ /** @deprecated Use {@link blockGroupMembers} instead. */
2768
3054
  groupBlockMulti(
2769
3055
  this: Connection,
2770
3056
  params: {
3057
+ /** The group ID. */
2771
3058
  groupId: string;
3059
+ /** The array of member's user IDs to be added to the blocklist. */
2772
3060
  usernames: UserId[];
2773
3061
  success?: (res: AsyncResult<GroupRequestResult[]>) => void;
2774
3062
  error?: (error: ErrorEvent) => void;
@@ -2785,18 +3073,22 @@ export declare namespace EasemobChat {
2785
3073
  blockGroupMembers(
2786
3074
  this: Connection,
2787
3075
  params: {
3076
+ /** The group ID. */
2788
3077
  groupId: string;
3078
+ /** The array of member's user IDs to be added to the blocklist. */
2789
3079
  usernames: UserId[];
2790
3080
  success?: (res: AsyncResult<GroupRequestResult[]>) => void;
2791
3081
  error?: (error: ErrorEvent) => void;
2792
3082
  }
2793
3083
  ): Promise<AsyncResult<GroupRequestResult[]>>;
2794
3084
 
2795
- /** @deprecated */
3085
+ /** @deprecated Use {@link unblockGroupMember} instead. */
2796
3086
  removeGroupBlockSingle(
2797
3087
  this: Connection,
2798
3088
  params: {
3089
+ /** The group ID. */
2799
3090
  groupId: string;
3091
+ /** The user ID of the member to be removed from the blocklist. */
2800
3092
  username: string;
2801
3093
  success?: (res: AsyncResult<GroupRequestResult>) => void;
2802
3094
  error?: (error: ErrorEvent) => void;
@@ -2813,18 +3105,22 @@ export declare namespace EasemobChat {
2813
3105
  unblockGroupMember(
2814
3106
  this: Connection,
2815
3107
  params: {
3108
+ /** The group ID. */
2816
3109
  groupId: string;
3110
+ /** The user ID of the member to be removed from the blocklist. */
2817
3111
  username: string;
2818
3112
  success?: (res: AsyncResult<GroupRequestResult>) => void;
2819
3113
  error?: (error: ErrorEvent) => void;
2820
3114
  }
2821
3115
  ): Promise<AsyncResult<GroupRequestResult>>;
2822
3116
 
2823
- /** @deprecated */
3117
+ /** @deprecated Use {@link unblockGroupMembers} instead. */
2824
3118
  removeGroupBlockMulti(
2825
3119
  this: Connection,
2826
3120
  params: {
3121
+ /** The group ID. */
2827
3122
  groupId: string;
3123
+ /** The array of members‘ user IDs to be removed from the group blocklist. */
2828
3124
  usernames: UserId[];
2829
3125
  success?: (res: AsyncResult<GroupRequestResult[]>) => void;
2830
3126
  error?: (error: ErrorEvent) => void;
@@ -2841,17 +3137,20 @@ export declare namespace EasemobChat {
2841
3137
  unblockGroupMembers(
2842
3138
  this: Connection,
2843
3139
  params: {
3140
+ /** The group ID. */
2844
3141
  groupId: string;
3142
+ /** The array of members‘ user IDs to be removed from the group blocklist. */
2845
3143
  usernames: UserId[];
2846
3144
  success?: (res: AsyncResult<GroupRequestResult[]>) => void;
2847
3145
  error?: (error: ErrorEvent) => void;
2848
3146
  }
2849
3147
  ): Promise<AsyncResult<GroupRequestResult[]>>;
2850
3148
 
2851
- /** @deprecated */
3149
+ /** @deprecated Use {@link getGroupBlocklist} instead. */
2852
3150
  getGroupBlacklistNew(
2853
3151
  this: Connection,
2854
3152
  params: {
3153
+ /** The group ID. */
2855
3154
  groupId: string;
2856
3155
  success?: (res: AsyncResult<UserId[]>) => void;
2857
3156
  error?: (error: ErrorEvent) => void;
@@ -2859,17 +3158,12 @@ export declare namespace EasemobChat {
2859
3158
  ): Promise<AsyncResult<UserId[]>>;
2860
3159
 
2861
3160
  /**
2862
- * Gets the group blocklist.
2863
- *
2864
- * ```typescript
2865
- * connection.getGroupBlacklist({groupId: 'groupId'})
2866
- * ```
2867
- * @hidden
2868
- * @deprecated
3161
+ * @deprecated Use {@link getGroupBlocklist} instead.
2869
3162
  */
2870
3163
  getGroupBlacklist(
2871
3164
  this: Connection,
2872
3165
  params: {
3166
+ /** The group ID. */
2873
3167
  groupId: string;
2874
3168
  success?: (res: AsyncResult<UserId[]>) => void;
2875
3169
  error?: (error: ErrorEvent) => void;
@@ -2886,6 +3180,7 @@ export declare namespace EasemobChat {
2886
3180
  getGroupBlocklist(
2887
3181
  this: Connection,
2888
3182
  params: {
3183
+ /** The group ID. */
2889
3184
  groupId: string;
2890
3185
  success?: (res: AsyncResult<UserId[]>) => void;
2891
3186
  error?: (error: ErrorEvent) => void;
@@ -2902,6 +3197,7 @@ export declare namespace EasemobChat {
2902
3197
  disableSendGroupMsg(
2903
3198
  this: Connection,
2904
3199
  params: {
3200
+ /** The group ID. */
2905
3201
  groupId: string;
2906
3202
  success?: (res: AsyncResult<{ mute: true }>) => void;
2907
3203
  error?: (error: ErrorEvent) => void;
@@ -2918,6 +3214,7 @@ export declare namespace EasemobChat {
2918
3214
  enableSendGroupMsg(
2919
3215
  this: Connection,
2920
3216
  params: {
3217
+ /** The group ID. */
2921
3218
  groupId: string;
2922
3219
  success?: (res: AsyncResult<{ mute: false }>) => void;
2923
3220
  error?: (error: ErrorEvent) => void;
@@ -2925,7 +3222,6 @@ export declare namespace EasemobChat {
2925
3222
  ): Promise<AsyncResult<{ mute: false }>>;
2926
3223
 
2927
3224
  /**
2928
- * @hidden
2929
3225
  * @deprecated Use {@link addUsersToGroupAllowlist} instead.
2930
3226
  * Adds members to the group allowlist. Members on the allowlist can still post messages even if they are muted in the group. Only the group admin or above can call this method. Members added to the allowlist will receive "operation: 'addUserToAllowlist'" in the callback of onGroupEvent.
2931
3227
  *
@@ -2936,7 +3232,9 @@ export declare namespace EasemobChat {
2936
3232
  addUsersToGroupWhitelist(
2937
3233
  this: Connection,
2938
3234
  params: {
3235
+ /** The group ID. */
2939
3236
  groupId: string;
3237
+ /** An array of member IDs to be added to the allowlist. */
2940
3238
  users: UserId[];
2941
3239
  success?: (res: AsyncResult<GroupRequestResult[]>) => void;
2942
3240
  error?: (error: ErrorEvent) => void;
@@ -2953,18 +3251,22 @@ export declare namespace EasemobChat {
2953
3251
  addUsersToGroupAllowlist(
2954
3252
  this: Connection,
2955
3253
  params: {
3254
+ /** The group ID. */
2956
3255
  groupId: string;
3256
+ /** An array of member IDs to be added to the allowlist. */
2957
3257
  users: UserId[];
2958
3258
  success?: (res: AsyncResult<GroupRequestResult[]>) => void;
2959
3259
  error?: (error: ErrorEvent) => void;
2960
3260
  }
2961
3261
  ): Promise<AsyncResult<GroupRequestResult[]>>;
2962
3262
 
2963
- /** @deprecated */
3263
+ /** @deprecated Use {@link removeGroupWhitelistMember} instead. */
2964
3264
  rmUsersFromGroupWhitelist(
2965
3265
  this: Connection,
2966
3266
  params: {
3267
+ /** The group ID. */
2967
3268
  groupId: string;
3269
+ /** The ID of the member to be removed from the group allowlist. */
2968
3270
  userName: UserId;
2969
3271
  success?: (res: AsyncResult<GroupRequestResult>) => void;
2970
3272
  error?: (error: ErrorEvent) => void;
@@ -2982,7 +3284,9 @@ export declare namespace EasemobChat {
2982
3284
  removeGroupWhitelistMember(
2983
3285
  this: Connection,
2984
3286
  params: {
3287
+ /** The group ID. */
2985
3288
  groupId: string;
3289
+ /** The ID of the member to be removed from the group allowlist. */
2986
3290
  userName: UserId;
2987
3291
  success?: (res: AsyncResult<GroupRequestResult>) => void;
2988
3292
  error?: (error: ErrorEvent) => void;
@@ -2999,7 +3303,9 @@ export declare namespace EasemobChat {
2999
3303
  removeGroupAllowlistMember(
3000
3304
  this: Connection,
3001
3305
  params: {
3306
+ /** The group ID. */
3002
3307
  groupId: string;
3308
+ /** The ID of the member to be removed from the group allowlist. */
3003
3309
  userName: UserId;
3004
3310
  success?: (res: AsyncResult<GroupRequestResult>) => void;
3005
3311
  error?: (error: ErrorEvent) => void;
@@ -3017,6 +3323,7 @@ export declare namespace EasemobChat {
3017
3323
  getGroupWhitelist(
3018
3324
  this: Connection,
3019
3325
  params: {
3326
+ /** The group ID. */
3020
3327
  groupId: string;
3021
3328
  success?: (res: AsyncResult<UserId[]>) => void;
3022
3329
  error?: (error: ErrorEvent) => void;
@@ -3033,17 +3340,20 @@ export declare namespace EasemobChat {
3033
3340
  getGroupAllowlist(
3034
3341
  this: Connection,
3035
3342
  params: {
3343
+ /** The group ID. */
3036
3344
  groupId: string;
3037
3345
  success?: (res: AsyncResult<UserId[]>) => void;
3038
3346
  error?: (error: ErrorEvent) => void;
3039
3347
  }
3040
3348
  ): Promise<AsyncResult<UserId[]>>;
3041
3349
 
3042
- /** @deprecated */
3350
+ /** @deprecated Use {@link isInGroupAllowlist} instead. */
3043
3351
  isGroupWhiteUser(
3044
3352
  this: Connection,
3045
3353
  params: {
3354
+ /** The group ID. */
3046
3355
  groupId: string;
3356
+ /** The user ID to query. */
3047
3357
  userName: UserId;
3048
3358
  success?: (res: AsyncResult<IsInGroupWhiteListResult>) => void;
3049
3359
  error?: (error: ErrorEvent) => void;
@@ -3061,7 +3371,9 @@ export declare namespace EasemobChat {
3061
3371
  isInGroupWhiteList(
3062
3372
  this: Connection,
3063
3373
  params: {
3374
+ /** The group ID. */
3064
3375
  groupId: string;
3376
+ /** The user ID to query. */
3065
3377
  userName: UserId;
3066
3378
  success?: (res: AsyncResult<IsInGroupWhiteListResult>) => void;
3067
3379
  error?: (error: ErrorEvent) => void;
@@ -3078,7 +3390,9 @@ export declare namespace EasemobChat {
3078
3390
  isInGroupAllowlist(
3079
3391
  this: Connection,
3080
3392
  params: {
3393
+ /** The group ID. */
3081
3394
  groupId: string;
3395
+ /** The user ID to query. */
3082
3396
  userName: UserId;
3083
3397
  success?: (res: AsyncResult<IsInGroupWhiteListResult>) => void;
3084
3398
  error?: (error: ErrorEvent) => void;
@@ -3095,7 +3409,9 @@ export declare namespace EasemobChat {
3095
3409
  getGroupMsgReadUser(
3096
3410
  this: Connection,
3097
3411
  params: {
3412
+ /** The group ID. */
3098
3413
  groupId: string;
3414
+ /** The ID of message to query. */
3099
3415
  msgId: string;
3100
3416
  success?: (res: AsyncResult<GetGroupMsgReadUserResult>) => void;
3101
3417
  error?: (error: ErrorEvent) => void;
@@ -3112,6 +3428,7 @@ export declare namespace EasemobChat {
3112
3428
  fetchGroupAnnouncement(
3113
3429
  this: Connection,
3114
3430
  params: {
3431
+ /** The group ID. */
3115
3432
  groupId: string;
3116
3433
  success?: (res: AsyncResult<{ announcement: string }>) => void;
3117
3434
  error?: (error: ErrorEvent) => void;
@@ -3128,7 +3445,9 @@ export declare namespace EasemobChat {
3128
3445
  updateGroupAnnouncement(
3129
3446
  this: Connection,
3130
3447
  params: {
3448
+ /** The group ID. */
3131
3449
  groupId: string;
3450
+ /** The group announcement. */
3132
3451
  announcement: string;
3133
3452
  success?: (
3134
3453
  res: AsyncResult<UpdateGroupAnnouncementResult>
@@ -3147,11 +3466,17 @@ export declare namespace EasemobChat {
3147
3466
  uploadGroupSharedFile(
3148
3467
  this: Connection,
3149
3468
  params: {
3469
+ /** The group ID. */
3150
3470
  groupId: string;
3471
+ /** The shared file object to upload. */
3151
3472
  file: object;
3473
+ /** The upload progress callback. */
3152
3474
  onFileUploadProgress?: (data: ProgressEvent) => void;
3475
+ /** The upload completion callback. */
3153
3476
  onFileUploadComplete?: (data: any) => void;
3477
+ /** The upload failure callback. */
3154
3478
  onFileUploadError?: (data: any) => void;
3479
+ /** The upload cancellation callback. */
3155
3480
  onFileUploadCanceled?: (data: any) => void;
3156
3481
  }
3157
3482
  ): void;
@@ -3166,7 +3491,9 @@ export declare namespace EasemobChat {
3166
3491
  deleteGroupSharedFile(
3167
3492
  this: Connection,
3168
3493
  params: {
3494
+ /** The group ID. */
3169
3495
  groupId: string;
3496
+ /** The shared file ID. */
3170
3497
  fileId: string;
3171
3498
  success?: (
3172
3499
  res: AsyncResult<DeleteGroupSharedFileResult>
@@ -3186,9 +3513,12 @@ export declare namespace EasemobChat {
3186
3513
  fetchGroupSharedFileList(
3187
3514
  this: Connection,
3188
3515
  params: {
3516
+ /** The group ID. */
3189
3517
  groupId: string;
3190
- pageNum?: number;
3191
- pageSize?: number;
3518
+ /** The page number, starting from 1. */
3519
+ pageNum: number;
3520
+ /** The number of members per page. The value cannot exceed 10. */
3521
+ pageSize: number;
3192
3522
  success?: (
3193
3523
  res: AsyncResult<FetchGroupSharedFileListResult>
3194
3524
  ) => void;
@@ -3206,9 +3536,12 @@ export declare namespace EasemobChat {
3206
3536
  getGroupSharedFilelist(
3207
3537
  this: Connection,
3208
3538
  params: {
3539
+ /** The group ID. */
3209
3540
  groupId: string;
3210
- pageNum?: number;
3211
- pageSize?: number;
3541
+ /** The page number, starting from 1. */
3542
+ pageNum: number;
3543
+ /** The number of members per page. The value cannot exceed 10. */
3544
+ pageSize: number;
3212
3545
  success?: (
3213
3546
  res: AsyncResult<FetchGroupSharedFileListResult>
3214
3547
  ) => void;
@@ -3226,8 +3559,11 @@ export declare namespace EasemobChat {
3226
3559
  downloadGroupSharedFile(
3227
3560
  this: Connection,
3228
3561
  params: {
3562
+ /** The group ID. */
3229
3563
  groupId: string;
3564
+ /** The shared file ID. */
3230
3565
  fileId: string;
3566
+ /** The secret key required to download the file. */
3231
3567
  secret?: string;
3232
3568
  onFileDownloadComplete?: (data: Blob) => void;
3233
3569
  onFileDownloadError?: (err: ErrorEvent) => void;
@@ -3266,15 +3602,6 @@ export declare namespace EasemobChat {
3266
3602
  }
3267
3603
  ): Promise<AsyncResult<UserId[]>>;
3268
3604
 
3269
- /** @deprecated */
3270
- getRoster(
3271
- this: Connection,
3272
- params?: {
3273
- success?: (res: RosterData[]) => void;
3274
- error?: (error: ErrorEvent) => void;
3275
- }
3276
- ): Promise<AsyncResult<UserId[]>>;
3277
-
3278
3605
  /**
3279
3606
  * Gets the contact list.
3280
3607
  *
@@ -3290,12 +3617,15 @@ export declare namespace EasemobChat {
3290
3617
  }
3291
3618
  ): Promise<AsyncResult<UserId[]>>;
3292
3619
 
3293
- /** @deprecated */
3620
+ /** @deprecated Use {@link uploadPushToken} instead. */
3294
3621
  uploadToken(
3295
3622
  this: Connection,
3296
3623
  params: {
3624
+ /** The device ID that identifies the device. Custom device IDs are allowed. */
3297
3625
  deviceId: string;
3626
+ /** The push token, which identifies a device during message push. Custom push tokens are allowed.*/
3298
3627
  deviceToken: string;
3628
+ /** The app ID for the push service, which is the senderID for Firebase Cloud Messaging (FCM) and "appId+#+AppKey" for the vivo push service. */
3299
3629
  notifierName: string;
3300
3630
  success?: (res: AsyncResult<UploadTokenResult>) => void;
3301
3631
  error?: (error: ErrorEvent) => void;
@@ -3312,8 +3642,11 @@ export declare namespace EasemobChat {
3312
3642
  uploadPushToken(
3313
3643
  this: Connection,
3314
3644
  params: {
3645
+ /** The device ID that identifies the device. Custom device IDs are allowed. */
3315
3646
  deviceId: string;
3647
+ /** The push token, which identifies a device during message push. Custom push tokens are allowed.*/
3316
3648
  deviceToken: string;
3649
+ /** The app ID for the push service, which is the senderID for Firebase Cloud Messaging (FCM) and "appId+#+AppKey" for the vivo push service. */
3317
3650
  notifierName: string;
3318
3651
  success?: (res: AsyncResult<UploadTokenResult>) => void;
3319
3652
  error?: (error: ErrorEvent) => void;
@@ -3344,10 +3677,10 @@ export declare namespace EasemobChat {
3344
3677
  * Gets the conversation list and the latest message under the conversation.
3345
3678
  *
3346
3679
  * ```typescript
3347
- * connection.getConversationList()
3680
+ * connection.getConversationlist()
3348
3681
  * ```
3349
3682
  */
3350
- getConversationList(
3683
+ getConversationlist(
3351
3684
  this: Connection,
3352
3685
  params?: {
3353
3686
  success?: (res: AsyncResult<SessionInfo[]>) => void;
@@ -3366,8 +3699,17 @@ export declare namespace EasemobChat {
3366
3699
  deleteSession(
3367
3700
  this: Connection,
3368
3701
  params: {
3702
+ /** The conversation ID: the peer's user ID or group ID. */
3369
3703
  channel: string;
3704
+ /** The conversation type.
3705
+ * - `singleChat`: one-to-one chat;
3706
+ * - `groupChat`: group chat.
3707
+ */
3370
3708
  chatType: 'singleChat' | 'groupChat';
3709
+ /** Whether to delete server roaming messages during conversation deletion.
3710
+ * - `true`: Yes;
3711
+ * - `false`: No.
3712
+ */
3371
3713
  deleteRoam: boolean;
3372
3714
  success?: (res: AsyncResult<DeleteSessionResult>) => void;
3373
3715
  error?: (error: ErrorEvent) => void;
@@ -3384,8 +3726,17 @@ export declare namespace EasemobChat {
3384
3726
  deleteConversation(
3385
3727
  this: Connection,
3386
3728
  params: {
3729
+ /** The conversation ID: the peer's user ID or group ID. */
3387
3730
  channel: string;
3731
+ /** The conversation type.
3732
+ * - `singleChat`: one-to-one chat;
3733
+ * - `groupChat`: group chat.
3734
+ */
3388
3735
  chatType: 'singleChat' | 'groupChat';
3736
+ /** Whether to delete server roaming messages during conversation deletion.
3737
+ * - `true`: Yes;
3738
+ * - `false`: No.
3739
+ */
3389
3740
  deleteRoam: boolean;
3390
3741
  success?: (res: AsyncResult<DeleteSessionResult>) => void;
3391
3742
  error?: (error: ErrorEvent) => void;
@@ -3432,7 +3783,9 @@ export declare namespace EasemobChat {
3432
3783
  */
3433
3784
  fetchUserInfoById(
3434
3785
  this: Connection,
3786
+ /** The array of IDs of users or user ID to query. */
3435
3787
  userId: UserId | UserId[],
3788
+ /** User properties to query. If the parameter is blank, query all. */
3436
3789
  properties?: ConfigurableKey[] | ConfigurableKey
3437
3790
  ): Promise<
3438
3791
  AsyncResult<{
@@ -3449,6 +3802,7 @@ export declare namespace EasemobChat {
3449
3802
  */
3450
3803
  updateCurrentUserNick(
3451
3804
  this: Connection,
3805
+ /** The nickname shown when a message push notification is received. */
3452
3806
  nick: string
3453
3807
  ): Promise<AsyncResult<BaseUserInfo[]>>;
3454
3808
 
@@ -3463,10 +3817,21 @@ export declare namespace EasemobChat {
3463
3817
  fetchHistoryMessages(
3464
3818
  this: Connection,
3465
3819
  options: {
3820
+ /** The user ID of the other party or the group ID. */
3466
3821
  queue: string;
3467
- start?: number | null;
3822
+ /** The starting message ID for this query. The default value is -1, which means to start retrieving from the latest message. */
3823
+ start?: number | string | null;
3824
+ /** The number of messages to retrieve each time. The default value is 20. */
3468
3825
  count?: number;
3826
+ /** Whether it is a group chat.
3827
+ * - `true`: Yes.
3828
+ * - (Default)`false`: No.
3829
+ */
3469
3830
  isGroup?: boolean;
3831
+ /** Whether to format messages.
3832
+ * - `true`: Yes.
3833
+ * - (Default)`false`: No.
3834
+ */
3470
3835
  format?: boolean;
3471
3836
  success?: (res: MessageBody[]) => void;
3472
3837
  fail?: (error: ErrorEvent) => void;
@@ -3525,7 +3890,7 @@ export declare namespace EasemobChat {
3525
3890
  */
3526
3891
  deleteContact(this: Connection, to: string): void;
3527
3892
 
3528
- /** @deprecated */
3893
+ /** @deprecated Use {@link acceptContactInvite} instead. */
3529
3894
  acceptInvitation(this: Connection, to: string): void;
3530
3895
 
3531
3896
  /**
@@ -3537,7 +3902,7 @@ export declare namespace EasemobChat {
3537
3902
  */
3538
3903
  acceptContactInvite(this: Connection, to: string): void;
3539
3904
 
3540
- /** @deprecated */
3905
+ /** @deprecated Use {@link declineContactInvite} instead. */
3541
3906
  declineInvitation(this: Connection, to: string): void;
3542
3907
 
3543
3908
  /**
@@ -3549,25 +3914,22 @@ export declare namespace EasemobChat {
3549
3914
  */
3550
3915
  declineContactInvite(this: Connection, to: string): void;
3551
3916
 
3552
- /** @deprecated */
3917
+ /** @deprecated Use {@link addUsersToBlocklist} instead. */
3553
3918
  addToBlackList(
3554
3919
  this: Connection,
3555
3920
  options: {
3921
+ /** The user ID. You can type a specific user ID to add a single user to the blocklist or type an array of user IDs, like ["user1","user2"], to add multiple users. */
3556
3922
  name: UserId | UserId[];
3557
3923
  }
3558
3924
  ): void;
3559
3925
 
3560
3926
  /**
3561
- * @deprecated
3562
- * Add contacts to your blacklist.
3563
- *
3564
- * ```typescript
3565
- * connection.addUsersToBlacklist({name: 'user1'})
3566
- * ```
3927
+ * @deprecated Use {@link addUsersToBlocklist} instead.
3567
3928
  */
3568
3929
  addUsersToBlacklist(
3569
3930
  this: Connection,
3570
3931
  options: {
3932
+ /** The user ID. You can type a specific user ID to add a single user to the blocklist or type an array of user IDs, like ["user1","user2"], to add multiple users. */
3571
3933
  name: UserId | UserId[];
3572
3934
  }
3573
3935
  ): void;
@@ -3582,29 +3944,27 @@ export declare namespace EasemobChat {
3582
3944
  addUsersToBlocklist(
3583
3945
  this: Connection,
3584
3946
  options: {
3947
+ /** The user ID. You can type a specific user ID to add a single user to the blocklist or type an array of user IDs, like ["user1","user2"], to add multiple users. */
3585
3948
  name: UserId | UserId[];
3586
3949
  }
3587
3950
  ): void;
3588
3951
 
3589
- /** @deprecated */
3952
+ /** @deprecated Use {@link removeUserFromBlackList} instead. */
3590
3953
  removeFromBlackList(
3591
3954
  this: Connection,
3592
3955
  options: {
3956
+ /** The user ID. You can type a specific user ID to remove a single user from the blocklist or type an array of user IDs, like ["user1","user2"], to remove multiple users. */
3593
3957
  name: UserId | UserId[];
3594
3958
  }
3595
3959
  ): void;
3596
3960
 
3597
3961
  /**
3598
- * @deprecated
3599
- * Removes friends from your blacklist
3600
- *
3601
- * ```typescript
3602
- * connection.removeUserFromBlackList({name: 'user1'})
3603
- * ```
3962
+ * @deprecated Use {@link removeUserFromBlackList} instead.
3604
3963
  */
3605
3964
  removeUserFromBlackList(
3606
3965
  this: Connection,
3607
3966
  options: {
3967
+ /** The user ID. You can type a specific user ID to remove a single user from the blocklist or type an array of user IDs, like ["user1","user2"], to remove multiple users. */
3608
3968
  name: UserId | UserId[];
3609
3969
  }
3610
3970
  ): void;
@@ -3619,22 +3979,11 @@ export declare namespace EasemobChat {
3619
3979
  removeUserFromBlocklist(
3620
3980
  this: Connection,
3621
3981
  options: {
3982
+ /** The user ID. You can type a specific user ID to remove a single user from the blocklist or type an array of user IDs, like ["user1","user2"], to remove multiple users. */
3622
3983
  name: UserId | UserId[];
3623
3984
  }
3624
3985
  ): void;
3625
3986
 
3626
- /** @deprecated*/
3627
- subscribe(
3628
- this: Connection,
3629
- options: { to: UserId; message?: string }
3630
- ): void;
3631
- /** @deprecated*/
3632
- subscribed(this: Connection, options: { to: UserId }): void;
3633
- /** @deprecated*/
3634
- unsubscribed(this: Connection, options: { to: UserId }): void;
3635
- /** @deprecated*/
3636
- removeRoster(this: Connection, options: { to: UserId }): void;
3637
-
3638
3987
  /**
3639
3988
  * Recalls a message.
3640
3989
  *
@@ -3645,21 +3994,52 @@ export declare namespace EasemobChat {
3645
3994
  recallMessage(
3646
3995
  this: Connection,
3647
3996
  option: {
3997
+ /** The ID of the message to be recalled. */
3648
3998
  mid: string;
3999
+ /** The recipient of the message. */
3649
4000
  to: UserId;
3650
- type?: 'chat' | 'groupchat' | 'chatroom'; // v3.0
3651
- chatType?: 'singleChat' | 'groupChat' | 'chatRoom'; // v4.0
4001
+ /** The chat type for SDK old:
4002
+ * - chat: one-to-one chat;
4003
+ * - groupchat: group chat;
4004
+ * - chatroom: chat room.
4005
+ */
4006
+ type?: 'chat' | 'groupchat' | 'chatroom';
4007
+ /** The chat type for SDK new:
4008
+ * - `singleChat`: one-to-one chat;
4009
+ * - `groupchat`: group chat;
4010
+ * - `chatroom`: chat room.
4011
+ */
4012
+ chatType?: 'singleChat' | 'groupChat' | 'chatRoom';
4013
+ /** Is it a message in the thread. */
3652
4014
  isChatThread?: boolean;
3653
4015
  success?: (res: number) => void;
3654
4016
  fail?: (error: ErrorEvent) => void;
3655
4017
  }
3656
4018
  ): Promise<SendMsgResult>;
3657
4019
 
3658
- // listen @since 3.0
4020
+ // listen @deprecated
3659
4021
  listen(this: Connection, parameters: ListenParameters): void;
3660
4022
 
3661
- // eventHandler @since 4.0
4023
+ /**
4024
+ * Adds listening events.
4025
+ *
4026
+ * ```typescript
4027
+ * connection.addEventHandler('customId', {
4028
+ * onTextMessage: (message) => {
4029
+ * console.log(message)
4030
+ * }
4031
+ * })
4032
+ * ```
4033
+ */
3662
4034
  addEventHandler(id: string, handler: EventHandlerType): void;
4035
+
4036
+ /**
4037
+ * Removes listening events.
4038
+ *
4039
+ * ```typescript
4040
+ * connection.removeEventHandler('customId')
4041
+ * ```
4042
+ */
3663
4043
  removeEventHandler(id: string): void;
3664
4044
 
3665
4045
  /**
@@ -3983,8 +4363,11 @@ export declare namespace EasemobChat {
3983
4363
  reportMessage(
3984
4364
  this: Connection,
3985
4365
  params: {
4366
+ /** The type of report. */
3986
4367
  reportType: string;
4368
+ /** The reason for reporting. */
3987
4369
  reportReason: string;
4370
+ /** ID of the message to be reported. */
3988
4371
  messageId: string;
3989
4372
  }
3990
4373
  ): Promise<void>;
@@ -4181,7 +4564,7 @@ export declare namespace EasemobChat {
4181
4564
  ): Promise<void>;
4182
4565
 
4183
4566
  /**
4184
- * @deprecated
4567
+ * @deprecated Use { getReactionlist } instead.
4185
4568
  * Gets the reaction list for the message.
4186
4569
  *
4187
4570
  * ```typescript
@@ -4245,27 +4628,727 @@ export declare namespace EasemobChat {
4245
4628
  pageSize?: number;
4246
4629
  }
4247
4630
  ): Promise<AsyncResult<GetReactionDetailResult>>;
4248
- }
4249
4631
 
4250
- /**
4251
- *
4252
- * @module eventHandler
4253
- */
4254
- type DispatchParameters =
4255
- | MessageBody
4256
- | OnPresenceMsg
4257
- | RosterData
4258
- | ErrorEvent
4259
- | MuteMsgBody
4260
- | ReceivedMsgBody
4261
- | RecallMsgBody
4262
- | ChannelMsgBody;
4632
+ /**
4633
+ * Creates a server.
4634
+ *
4635
+ * ```typescript
4636
+ * connection.createServer({name: 'serverName',icon: '',description: 'the description of the server',ext: 'ext'})
4637
+ * ```
4638
+ */
4639
+ createServer(
4640
+ this: Connection,
4641
+ params: {
4642
+ /** The server name. */
4643
+ name: string;
4644
+ /** The profile picture of the server. */
4645
+ icon?: string;
4646
+ /** The description of the server. */
4647
+ description?: string;
4648
+ /** The extension field. */
4649
+ ext?: string;
4650
+ }
4651
+ ): Promise<AsyncResult<ServerInfo>>;
4652
+ /**
4653
+ * Deletes a server.
4654
+ *
4655
+ * ```typescript
4656
+ * connection.destroyServer({serverId: 'serverId'})
4657
+ * ```
4658
+ */
4659
+ destroyServer(
4660
+ this: Connection,
4661
+ params: {
4662
+ /** The server ID. */
4663
+ serverId: string;
4664
+ }
4665
+ ): Promise<void>;
4263
4666
 
4264
- interface ReactionMessage {
4265
- /** The message sender. */
4266
- from: string;
4267
- /** The message recipient. */
4268
- to: string;
4667
+ /**
4668
+ * Updates server.
4669
+ *
4670
+ * ```typescript
4671
+ * connection.updateServer({serverId: 'serverId',name: 'name',icon: '',description: 'new description'})
4672
+ * ```
4673
+ */
4674
+ updateServer(
4675
+ this: Connection,
4676
+ params: {
4677
+ /** The server ID. */
4678
+ serverId: string;
4679
+ /** The server name. */
4680
+ name?: string;
4681
+ /** The profile picture of the server. */
4682
+ icon?: string;
4683
+ /** The description of the server. */
4684
+ description?: string;
4685
+ /** The extension field. */
4686
+ ext?: string;
4687
+ }
4688
+ ): Promise<AsyncResult<ServerInfo>>;
4689
+
4690
+ /**
4691
+ * Joins a server.
4692
+ *
4693
+ * ```typescript
4694
+ * connection.joinServer({serverId: 'serverId'})
4695
+ * ```
4696
+ */
4697
+ joinServer(
4698
+ this: Connection,
4699
+ params: {
4700
+ /** The server ID. */
4701
+ serverId: string;
4702
+ }
4703
+ ): Promise<AsyncResult<ServerInfo>>;
4704
+
4705
+ /**
4706
+ * Leaves the server.
4707
+ *
4708
+ * ```typescript
4709
+ * connection.leaveServer({serverId: 'serverId'})
4710
+ * ```
4711
+ */
4712
+ leaveServer(
4713
+ this: Connection,
4714
+ params: {
4715
+ /** The server ID. */
4716
+ serverId: string;
4717
+ }
4718
+ ): Promise<void>;
4719
+
4720
+ /**
4721
+ * Removes a member from the server.
4722
+ *
4723
+ * ```typescript
4724
+ * connection.removeServerMember({serverId: 'serverId',userId: 'userId})
4725
+ * ```
4726
+ */
4727
+ removeServerMember(
4728
+ this: Connection,
4729
+ params: {
4730
+ /** The server ID. */
4731
+ serverId: string;
4732
+ /** The user ID of the member to remove. */
4733
+ userId: string;
4734
+ }
4735
+ ): Promise<void>;
4736
+
4737
+ /**
4738
+ * Adds tags to server.
4739
+ *
4740
+ * ```typescript
4741
+ * connection.addServerTags({serverId: 'serverId',tags: ['A', 'B']})
4742
+ * ```
4743
+ */
4744
+ addServerTags(
4745
+ this: Connection,
4746
+ params: {
4747
+ /** The server ID. */
4748
+ serverId: string;
4749
+ /** The tag name list to add. The maximum length of the list is 10. */
4750
+ tags: string[];
4751
+ }
4752
+ ): Promise<AsyncResult<ServerTagList>>;
4753
+
4754
+ /**
4755
+ * Removes tags from server.
4756
+ *
4757
+ * ```typescript
4758
+ * connection.removeServerTags({serverId: 'serverId',tagIds: ['1', '2']})
4759
+ * ```
4760
+ */
4761
+ removeServerTags(
4762
+ this: Connection,
4763
+ params: {
4764
+ /** The server ID. */
4765
+ serverId: string;
4766
+ /** The tag ID list to remove. */
4767
+ tagIds: string[];
4768
+ }
4769
+ ): Promise<void>;
4770
+
4771
+ /**
4772
+ * Use the pagination to get the list of servers by the keyword.Only when the keyword is the full name of the server or the full name of the tag, the method will return results.
4773
+ *
4774
+ * ```typescript
4775
+ * connection.getServers({keyword: 'keyword'})
4776
+ * ```
4777
+ */
4778
+ getServers(
4779
+ this: Connection,
4780
+ params: {
4781
+ /** The key word. */
4782
+ keyword: string;
4783
+ /** The number of servers that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
4784
+ pageSize?: number;
4785
+ /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
4786
+ cursor?: string;
4787
+ }
4788
+ ): Promise<AsyncResult<ServerInfoList>>;
4789
+
4790
+ /**
4791
+ * Gets the list of joined servers with pagination.
4792
+ *
4793
+ * ```typescript
4794
+ * connection.getJoinedServers({pageSize: '10',cursor: ''})
4795
+ * ```
4796
+ */
4797
+ getJoinedServers(
4798
+ this: Connection,
4799
+ params: {
4800
+ /** The number of servers that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
4801
+ pageSize?: number;
4802
+ /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
4803
+ cursor?: string;
4804
+ }
4805
+ ): Promise<AsyncResult<ServerInfoList>>;
4806
+
4807
+ /**
4808
+ * Gets detail of the server.
4809
+ *
4810
+ * ```typescript
4811
+ * connection.getServerDetail({serverId: 'serverId'})
4812
+ * ```
4813
+ */
4814
+ getServerDetail(
4815
+ this: Connection,
4816
+ params: {
4817
+ /** The server ID. */
4818
+ serverId: string;
4819
+ }
4820
+ ): Promise<AsyncResult<ServerInfo>>;
4821
+
4822
+ /**
4823
+ * Gets members in the server with pagination.
4824
+ *
4825
+ * ```typescript
4826
+ * connection.getServerMembers({serverId: 'serverId',pageSize:20,cursor:'cursor'})
4827
+ * ```
4828
+ */
4829
+ getServerMembers(
4830
+ this: Connection,
4831
+ params: {
4832
+ /** The server ID. */
4833
+ serverId: string;
4834
+ /** The number of servers that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
4835
+ pageSize?: number;
4836
+ /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
4837
+ cursor?: string;
4838
+ }
4839
+ ): Promise<AsyncResult<ServerMemberData>>;
4840
+
4841
+ /**
4842
+ * Sets a server admin. Only the server owner can call this method.
4843
+ *
4844
+ * ```typescript
4845
+ * connection.setServerAdmin({serverId: 'serverId',userId:'userId'})
4846
+ * ```
4847
+ */
4848
+ setServerAdmin(
4849
+ this: Connection,
4850
+ params: {
4851
+ /** The server ID. */
4852
+ serverId: string;
4853
+ /** The user ID to set as admin. */
4854
+ userId: string;
4855
+ }
4856
+ ): Promise<void>;
4857
+
4858
+ /**
4859
+ * Removes a server admin. Only the server owner can call this method.
4860
+ *
4861
+ * ```typescript
4862
+ * connection.removeServerAdmin({serverId: 'serverId',userId:'userId'})
4863
+ * ```
4864
+ */
4865
+ removeServerAdmin(
4866
+ this: Connection,
4867
+ params: {
4868
+ /** The server ID. */
4869
+ serverId: string;
4870
+ /** The use ID to remove server admin privileges. */
4871
+ userId: string;
4872
+ }
4873
+ ): Promise<void>;
4874
+
4875
+ /**
4876
+ * Invites users into a server.
4877
+ *
4878
+ * ```typescript
4879
+ * connection.inviteUserToServer({serverId: 'serverId', userId: 'userId'})
4880
+ * ```
4881
+ */
4882
+
4883
+ inviteUserToServer(
4884
+ this: Connection,
4885
+ params: {
4886
+ /** The server ID. */
4887
+ serverId: string;
4888
+ /** The Invited user ID. */
4889
+ userId: string;
4890
+ /** A message inviting users to join the server. */
4891
+ message?: string;
4892
+ }
4893
+ ): Promise<void>;
4894
+
4895
+ /**
4896
+ * Accepts to the invitation to join the server.
4897
+ *
4898
+ * ```typescript
4899
+ * connection.acceptServerInvite({serverId: 'serverId',inviter: 'uid')
4900
+ * ```
4901
+ */
4902
+ acceptServerInvite(
4903
+ this: Connection,
4904
+ params: {
4905
+ /** The server ID. */
4906
+ serverId: string;
4907
+ /** The inviter user ID. */
4908
+ inviter: string;
4909
+ }
4910
+ ): Promise<AsyncResult<ServerInfo>>;
4911
+
4912
+ /**
4913
+ * Rejects to the invitation to join the server.
4914
+ *
4915
+ * ```typescript
4916
+ * connection.rejectServerInvite({serverId: 'serverId',inviter: 'uid')
4917
+ * ```
4918
+ */
4919
+ rejectServerInvite(
4920
+ this: Connection,
4921
+ params: {
4922
+ /** The server ID. */
4923
+ serverId: string;
4924
+ /** The inviter user ID. */
4925
+ inviter: string;
4926
+ }
4927
+ ): Promise<void>;
4928
+
4929
+ /**
4930
+ * Gets current user role in the server.
4931
+ *
4932
+ * ```typescript
4933
+ * connection.getServerRole({serverId: 'serverId'})
4934
+ * ```
4935
+ */
4936
+ getServerRole(
4937
+ this: Connection,
4938
+ params: {
4939
+ /** The server ID. */
4940
+ serverId: string;
4941
+ }
4942
+ ): Promise<AsyncResult<ServerRole>>;
4943
+
4944
+ /**
4945
+ * Checks whether the current member is in the server.
4946
+ *
4947
+ * ```typescript
4948
+ * connection.isInServer({serverId: 'serverId'})
4949
+ * ```
4950
+ */
4951
+ isInServer(
4952
+ this: Connection,
4953
+ params: {
4954
+ /** The server ID. */
4955
+ serverId: string;
4956
+ }
4957
+ ): Promise<AsyncResult<OperationResult>>;
4958
+
4959
+ /**
4960
+ * Gets the tag list of the current server.
4961
+ *
4962
+ * ```typescript
4963
+ * connection.getServerTags({serverId: 'serverId'})
4964
+ * ```
4965
+ */
4966
+ getServerTags(
4967
+ this: Connection,
4968
+ params: {
4969
+ /** The server ID. */
4970
+ serverId: string;
4971
+ }
4972
+ ): Promise<AsyncResult<ServerTagList>>;
4973
+
4974
+ /**
4975
+ * Creates a channel.
4976
+ *
4977
+ * ```typescript
4978
+ * connection.createChannel({
4979
+ * serverId: 'serverID',
4980
+ * isPublic: true,
4981
+ * name: 'channelName',
4982
+ * description: 'this is my channel',
4983
+ * ext: 'ext'
4984
+ * })
4985
+ * ```
4986
+ */
4987
+ createChannel(
4988
+ this: Connection,
4989
+ params: {
4990
+ /** The server ID. */
4991
+ serverId: string;
4992
+ /** Whether it is a public channel. Public channel: the channel that others can query by calling `getChannels`.
4993
+ * - (default)`true`: Yes.
4994
+ * - `false`: No.
4995
+ */
4996
+ isPublic?: boolean;
4997
+ /** The channel name. */
4998
+ name: string;
4999
+ /** The description of the channel. */
5000
+ description?: string;
5001
+ /** The users max amount of the channel.
5002
+ * - (default)`0`: 2,000.
5003
+ * - `1`: 20,000
5004
+ * - `2`: 100,000; */
5005
+ rank?: ChannelRank;
5006
+ /** The extension field. */
5007
+ ext?: string;
5008
+ }
5009
+ ): Promise<AsyncResult<ChannelInfo>>;
5010
+
5011
+ /**
5012
+ * Deletes a channel.
5013
+ *
5014
+ * ```typescript
5015
+ * connection.destroyChannel({serverId: 'serverId', channelId: 'channelId'})
5016
+ * ```
5017
+ */
5018
+ destroyChannel(
5019
+ this: Connection,
5020
+ params: {
5021
+ /** The server ID. */
5022
+ serverId: string;
5023
+ /** The channel ID. */
5024
+ channelId: string;
5025
+ }
5026
+ ): Promise<void>;
5027
+
5028
+ /**
5029
+ * Updates the channel information.
5030
+ *
5031
+ * Only the channel admin can call this method.
5032
+ *
5033
+ * ```typescript
5034
+ * connection.updateChannel({
5035
+ * serverId: 'serverId',
5036
+ * channelId: 'channelId',
5037
+ * name: 'the channel name',
5038
+ * description: 'the channel description',
5039
+ * })
5040
+ * ```
5041
+ */
5042
+ updateChannel(
5043
+ this: Connection,
5044
+ params: {
5045
+ /** The server ID. */
5046
+ serverId: string;
5047
+ /** The channel ID. */
5048
+ channelId: string;
5049
+ /** The channel name. */
5050
+ name?: string;
5051
+ /** The channel description. */
5052
+ description?: string;
5053
+ /** The users max amount of the channel.
5054
+ * - (default)`0`: 2,000.
5055
+ * - `1`: 20,000.
5056
+ * - `2`: 100,000.
5057
+ */
5058
+ rank?: ChannelRank;
5059
+ /** The extension field. */
5060
+ ext?: string;
5061
+ }
5062
+ ): Promise<AsyncResult<ChannelInfo>>;
5063
+
5064
+ /**
5065
+ * Gets the channel detail.
5066
+ *
5067
+ * ```typescript
5068
+ * connection.getChannelDetail({serverId: 'serverId', channelId: 'channelId'})
5069
+ * ```
5070
+ *
5071
+ */
5072
+ getChannelDetail(
5073
+ this: Connection,
5074
+ params: {
5075
+ /** The server ID. */
5076
+ serverId: string;
5077
+ /** The channel ID. */
5078
+ channelId: string;
5079
+ }
5080
+ ): Promise<AsyncResult<ChannelInfo>>;
5081
+
5082
+ /**
5083
+ * Joins the channel.
5084
+ *
5085
+ * ```typescript
5086
+ * connection.joinChannel({serverId: 'serverId', channelId: 'channelId'})
5087
+ * ```
5088
+ *
5089
+ */
5090
+ joinChannel(
5091
+ this: Connection,
5092
+ params: {
5093
+ /** The server ID. */
5094
+ serverId: string;
5095
+ /** The channel ID. */
5096
+ channelId: string;
5097
+ }
5098
+ ): Promise<AsyncResult<ChannelInfo>>;
5099
+
5100
+ /**
5101
+ * Leaves the channel.
5102
+ *
5103
+ * ```typescript
5104
+ * connection.leaveChannel({serverId: 'serverId', channelId: 'channelId'})
5105
+ * ```
5106
+ *
5107
+ */
5108
+ leaveChannel(
5109
+ this: Connection,
5110
+ params: {
5111
+ /** The server ID. */
5112
+ serverId: string;
5113
+ /** The channel ID. */
5114
+ channelId: string;
5115
+ }
5116
+ ): Promise<void>;
5117
+
5118
+ /**
5119
+ * Removes a member from the channel.
5120
+ *
5121
+ * ```typescript
5122
+ * connection.removeChannelMember({serverId: 'serverId', channelId: 'channelId',userId: 'userId'})
5123
+ * ```
5124
+ *
5125
+ */
5126
+ removeChannelMember(
5127
+ this: Connection,
5128
+ params: {
5129
+ /** The server ID. */
5130
+ serverId: string;
5131
+ /** The channel ID. */
5132
+ channelId: string;
5133
+ /** The user ID. */
5134
+ userId: string;
5135
+ }
5136
+ ): Promise<void>;
5137
+
5138
+ /**
5139
+ * Gets the list of visible channels with pagination.
5140
+ *
5141
+ * User can get the joined channels, while the admin and creator can get all private channels.
5142
+ *
5143
+ * ```typescript
5144
+ * connection.getVisiblePrivateChannels({pageSize: 10,cursor: ''})
5145
+ * ```
5146
+ *
5147
+ */
5148
+ getVisiblePrivateChannels(
5149
+ this: Connection,
5150
+ params: {
5151
+ /** The server ID. */
5152
+ serverId: string;
5153
+ /** The number of private channel id that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
5154
+ pageSize?: number;
5155
+ /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
5156
+ cursor?: string;
5157
+ }
5158
+ ): Promise<AsyncResult<ChannelInfoListResult>>;
5159
+
5160
+ /**
5161
+ * Gets the public channels list in the server with pagination.
5162
+ *
5163
+ * ```typescript
5164
+ * connection.getPublicChannels({pageSize: 10,cursor: ''})
5165
+ * ```
5166
+ *
5167
+ */
5168
+ getPublicChannels(
5169
+ this: Connection,
5170
+ params: {
5171
+ /** The server ID. */
5172
+ serverId: string;
5173
+ /** The number of public channel ID that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
5174
+ pageSize?: number;
5175
+ /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
5176
+ cursor?: string;
5177
+ }
5178
+ ): Promise<AsyncResult<ChannelInfoListResult>>;
5179
+
5180
+ /**
5181
+ * Gets members in the channel with pagination..
5182
+ *
5183
+ * ```typescript
5184
+ * connection.getChannelMembers({serverId:'serverId', channelId: 'channelId', pageSize: 10,cursor: ''})
5185
+ * ```
5186
+ *
5187
+ */
5188
+ getChannelMembers(
5189
+ this: Connection,
5190
+ params: {
5191
+ /** The server ID. */
5192
+ serverId: string;
5193
+ /** The channel ID. */
5194
+ channelId: string;
5195
+ /** The number of member that you expect to get on each page. The value range is [1,20] and the default value is `20`. */
5196
+ pageSize?: number;
5197
+ /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
5198
+ cursor?: string;
5199
+ }
5200
+ ): Promise<AsyncResult<ChannelMemberListResult>>;
5201
+
5202
+ /**
5203
+ * Invites users into a channel.
5204
+ *
5205
+ * ```typescript
5206
+ * connection.inviteUserToChannel({serverId: 'serverId',channelId: 'channelId',userId: 'userId'})
5207
+ * ```
5208
+ */
5209
+ inviteUserToChannel(
5210
+ this: Connection,
5211
+ params: {
5212
+ /** The server ID. */
5213
+ serverId: string;
5214
+ /** The channel ID. */
5215
+ channelId: string;
5216
+ /** The channel member ID. */
5217
+ userId: string;
5218
+ /** The invite message. */
5219
+ inviteMessage?: string;
5220
+ }
5221
+ ): Promise<void>;
5222
+
5223
+ /**
5224
+ * Accepts a channel request.
5225
+ *
5226
+ * ```typescript
5227
+ * connection.acceptChannelInvite({serverId: 'serverId',channelId: 'channelId',inviter:'inviter'})
5228
+ * ```
5229
+ */
5230
+ acceptChannelInvite(
5231
+ this: Connection,
5232
+ params: {
5233
+ /** The server ID. */
5234
+ serverId: string;
5235
+ /** The channel ID. */
5236
+ channelId: string;
5237
+ /** The inviter user ID. */
5238
+ inviter: string;
5239
+ }
5240
+ ): Promise<AsyncResult<ChannelInfo>>;
5241
+
5242
+ /**
5243
+ * Refuses a channel request.
5244
+ *
5245
+ * ```typescript
5246
+ * connection.rejectChannelInvite({serverId: 'serverId',channelId: 'channelId'})
5247
+ * ```
5248
+ */
5249
+ rejectChannelInvite(
5250
+ this: Connection,
5251
+ params: {
5252
+ /** The server ID. */
5253
+ serverId: string;
5254
+ /** The channel ID. */
5255
+ channelId: string;
5256
+ /** The inviter user ID. */
5257
+ inviter: string;
5258
+ }
5259
+ ): Promise<void>;
5260
+
5261
+ /**
5262
+ * Mutes a channel member.
5263
+ *
5264
+ * ```typescript
5265
+ * connection.muteChannelMember({serverId: 'serverId',channelId: 'channelId',userId: 'userId'})
5266
+ * ```
5267
+ */
5268
+ muteChannelMember(
5269
+ this: Connection,
5270
+ params: {
5271
+ /** The server ID. */
5272
+ serverId: string;
5273
+ /** The channel ID. */
5274
+ channelId: string;
5275
+ /** The channel member ID. */
5276
+ userId: string;
5277
+ /** The mute duration in milliseconds. The value `-1` indicates that the member is muted permanently.*/
5278
+ duration: number;
5279
+ }
5280
+ ): Promise<void>;
5281
+
5282
+ /**
5283
+ * Unmuted a channel member.
5284
+ *
5285
+ * ```typescript
5286
+ * connection.muteChannelMember({serverId: 'serverId',channelId: 'channelId',userId: 'userId'})
5287
+ * ```
5288
+ */
5289
+ unmuteChannelMember(
5290
+ this: Connection,
5291
+ params: {
5292
+ /** The server ID. */
5293
+ serverId: string;
5294
+ /** The channel ID. */
5295
+ channelId: string;
5296
+ /** The channel member ID. */
5297
+ userId: string;
5298
+ }
5299
+ ): Promise<void>;
5300
+
5301
+ /**
5302
+ * Gets the mute list of the channel.
5303
+ * Only the channel admin or creator can call this method.
5304
+ * ```typescript
5305
+ * connection.getChannelMutelist({channelId: 'channelId'})
5306
+ * ```
5307
+ */
5308
+ getChannelMutelist(
5309
+ this: Connection,
5310
+ params: {
5311
+ /** The server ID. */
5312
+ serverId: string;
5313
+ /** The channel ID. */
5314
+ channelId: string;
5315
+ }
5316
+ ): Promise<AsyncResult<ChannelMuteMemberListResult>>;
5317
+
5318
+ /**
5319
+ * Checks whether the current member is in the channel.
5320
+ *
5321
+ * ```typescript
5322
+ * connection.isInChannel({serverId: 'serverId', channelId: "channelId"})
5323
+ * ```
5324
+ */
5325
+ isInChannel(
5326
+ this: Connection,
5327
+ params: {
5328
+ /** The server ID. */
5329
+ serverId: string;
5330
+ /** The channel ID. */
5331
+ channelId: string;
5332
+ }
5333
+ ): Promise<AsyncResult<OperationResult>>;
5334
+ }
5335
+
5336
+ // ----- for EventHandler ------
5337
+
5338
+ type DispatchParameters =
5339
+ | MessageBody
5340
+ | OnPresenceMsg
5341
+ | RosterData
5342
+ | ErrorEvent
5343
+ | ReceivedMsgBody
5344
+ | RecallMsgBody
5345
+ | ChannelMsgBody;
5346
+
5347
+ interface ReactionMessage {
5348
+ /** The message sender. */
5349
+ from: string;
5350
+ /** The message recipient. */
5351
+ to: string;
4269
5352
  /** The conversation type. */
4270
5353
  chatType: 'singleChat' | 'groupChat';
4271
5354
  /** The reaction to be added to the message. The length is limited to 128 characters. */
@@ -4278,22 +5361,277 @@ export declare namespace EasemobChat {
4278
5361
 
4279
5362
  interface EventData {
4280
5363
  /** The type of operation. */
4281
- /** 操作类型。 */
4282
5364
  operation: string;
4283
5365
  /** The ID of a group or chatroom. */
4284
- /** 群组或者聊天室 ID。 */
4285
5366
  id: string;
4286
5367
  /** Message sender. */
4287
- /** 消息发送者。 */
4288
5368
  from: string;
4289
5369
  /** Message receiver. */
4290
- /** 消息接收者。 */
4291
5370
  to: string;
4292
5371
  /** Additional data for the operation event. */
4293
- /** 操作事件的其他数据。 */
4294
5372
  data?: any;
4295
5373
  }
4296
5374
 
5375
+ type ServerChangeType =
5376
+ | 'update'
5377
+ | 'destroy'
5378
+ | 'memberPresence'
5379
+ | 'memberAbsence'
5380
+ | 'inviteToJoin'
5381
+ | 'acceptInvite'
5382
+ | 'refuseInvite'
5383
+ | 'removed'
5384
+ | 'updateRole';
5385
+
5386
+ type ServerMultiDeviceEventType =
5387
+ | 'serverCreate'
5388
+ | 'serverDestroy'
5389
+ | 'serverUpdate'
5390
+ | 'serverJoin'
5391
+ | 'serverLeave'
5392
+ | 'serverRemoveMember'
5393
+ | 'serverInviteUser'
5394
+ | 'serverAcceptInvite'
5395
+ | 'serverRefuseInvite'
5396
+ | 'serverSetRole';
5397
+ interface CreateServerResult {
5398
+ /** The server ID. */
5399
+ serverId: string;
5400
+ /** The default channel ID. */
5401
+ defaultChannelId: string;
5402
+ }
5403
+ interface OperationResult {
5404
+ result: boolean;
5405
+ }
5406
+ interface ServerInfo {
5407
+ /** The server ID. */
5408
+ id: string;
5409
+ /** The server name. */
5410
+ name: string;
5411
+ /** The profile picture of the server. */
5412
+ icon?: string;
5413
+ /** The default channel ID. */
5414
+ defaultChannelId: string;
5415
+ /** The owner of the server. */
5416
+ owner: string;
5417
+ /** The description of the server. */
5418
+ description?: string;
5419
+ /** The tags list of the server. */
5420
+ tags?: ServerTag[];
5421
+ /** The extension field. */
5422
+ ext?: string;
5423
+ /** The Unix timestamp when the server created. The unit is millisecond. */
5424
+ created?: number;
5425
+ }
5426
+ interface ServerInfoList {
5427
+ /** The serer information list */
5428
+ list: ServerInfo[];
5429
+ /** The position from which to start getting data. At the first method call, if you set `cursor` to an empty string.*/
5430
+ cursor: string;
5431
+ }
5432
+
5433
+ interface ServerMember {
5434
+ /** The member ID. */
5435
+ userId: string;
5436
+ /** The member role. */
5437
+ role: RoleType;
5438
+ }
5439
+ interface ServerMemberData {
5440
+ /** The server member list. */
5441
+ list: ServerMember[];
5442
+ /** The position from which to start getting data. At the first method call*/
5443
+ cursor?: string;
5444
+ }
5445
+ interface ServerRole {
5446
+ role: RoleType;
5447
+ }
5448
+ type RoleType = 'owner' | 'moderator' | 'user';
5449
+
5450
+ interface ServerTag {
5451
+ /** The server tag ID. */
5452
+ tagId: string;
5453
+ /** The server tag name. */
5454
+ tagName: string;
5455
+ }
5456
+
5457
+ interface ServerTagList {
5458
+ /** The server tag list. */
5459
+ tags: ServerTag[];
5460
+ }
5461
+ interface ServerChangeInfo {
5462
+ /** The server ID. */
5463
+ serverId: string;
5464
+ /** The type of operation. */
5465
+ operation: ServerChangeType | ServerMultiDeviceEventType;
5466
+ /** The operator. */
5467
+ operator: string;
5468
+ /** The Unix timestamp when the event occurs. The unit is millisecond. */
5469
+ timestamp: number;
5470
+ /** The operated member ID. */
5471
+ userId?: string;
5472
+ /** The operated member IDs. */
5473
+ userIds?: string[];
5474
+ /** The user role. */
5475
+ role?: string;
5476
+ /** The server name. */
5477
+ name?: string;
5478
+ /** The description of the server. */
5479
+ description?: string;
5480
+ /** The extension field. */
5481
+ ext?: string;
5482
+ /** The profile picture of the server. */
5483
+ icon?: string;
5484
+ }
5485
+
5486
+ enum ChannelRank {
5487
+ /** 2,000 channel. */
5488
+ RANK_2000,
5489
+ /** 20000 channel. */
5490
+ RANK_20000,
5491
+ /** 100000 channel. */
5492
+ RANK_100000,
5493
+ }
5494
+ interface ChannelInfo {
5495
+ /** The server ID. */
5496
+ serverId: string;
5497
+ /** The channel ID. */
5498
+ channelId: string;
5499
+ /** The channel name. */
5500
+ name: string;
5501
+ /** The description of the channel. */
5502
+ description: string;
5503
+ /** The Unix timestamp when the server created. The unit is millisecond. */
5504
+ created?: number;
5505
+ /** Whether it is the default channel.
5506
+ * - `0`: No.
5507
+ * - `1`: Yes.
5508
+ */
5509
+ defaultChannel: 0 | 1;
5510
+ /** The users max amount of the channel.
5511
+ * - `0`(default): 2,000.
5512
+ * - `1`: 20,000.
5513
+ * - `2`: 100,000.
5514
+ */
5515
+ rank: ChannelRank;
5516
+ /** The extension field of the channel. */
5517
+ ext: string;
5518
+ /** Whether it is a public channel.
5519
+ * - `true`: Yes.
5520
+ * - `false`: No.
5521
+ */
5522
+ isPublic: boolean;
5523
+ /** Whether the invitee needs to accept the invitation before joining the group.
5524
+ - `true`: The invitee's consent is required.
5525
+ - `false`: The invitee will be directly added to the group without confirmation.
5526
+ */
5527
+ inviteNeedConfirm: boolean;
5528
+ }
5529
+
5530
+ interface ChannelInfoListResult {
5531
+ /** The channel information list. */
5532
+ list: ChannelInfo[];
5533
+ /** The position from which to start getting data. */
5534
+ cursor?: string;
5535
+ }
5536
+
5537
+ interface ChannelMuteMemberItem {
5538
+ /** The timestamp when the mute expires. */
5539
+ expire: number;
5540
+ /** The muted user ID */
5541
+ userId: string;
5542
+ }
5543
+ interface ChannelMuteMemberListResult {
5544
+ list: ChannelMuteMemberItem[];
5545
+ }
5546
+
5547
+ interface ChannelMemberListResult {
5548
+ /** The channel member list */
5549
+ list: ChannelMember[];
5550
+ /** The position from which to start getting data.*/
5551
+ cursor?: string;
5552
+ }
5553
+ type ChannelRole = 'owner' | 'moderator' | 'user';
5554
+
5555
+ interface ChannelMember {
5556
+ /** The member ID. */
5557
+ userId: string;
5558
+ /** The member role. */
5559
+ role: ChannelRole;
5560
+ }
5561
+
5562
+ type ChannelChangeType =
5563
+ | 'create'
5564
+ | 'destroy'
5565
+ | 'update'
5566
+ | 'memberAbsence'
5567
+ | 'memberPresence'
5568
+ | 'removed'
5569
+ | 'muteMember'
5570
+ | 'unmuteMember'
5571
+ | 'inviteToJoin'
5572
+ | 'acceptInvite'
5573
+ | 'rejectInvite'
5574
+ | 'directJoined';
5575
+
5576
+ type ChannelMultiDeviceEventType =
5577
+ | 'channelCreate'
5578
+ | 'channelDestroy'
5579
+ | 'channelUpdate'
5580
+ | 'channelJoin'
5581
+ | 'channelLeave'
5582
+ | 'channelRemoveMember'
5583
+ | 'channelInviteUser'
5584
+ | 'channelMuteMember'
5585
+ | 'channelUnMuteMember'
5586
+ | 'channelAcceptInvite'
5587
+ | 'channelRejectInvite';
5588
+
5589
+ interface InviteChannelServerInfo {
5590
+ /** The server ID. */
5591
+ /** 社区 ID。 */
5592
+ id: string;
5593
+ /** The profile picture of the server. */
5594
+ /** 社区头像。*/
5595
+ icon?: string;
5596
+ /** The server name. */
5597
+ /** 社区名称。 */
5598
+ name?: string;
5599
+ /** The description of the server. */
5600
+ /** 社区描述。 */
5601
+ description?: string;
5602
+ }
5603
+ interface ChannelChangeInfo {
5604
+ /** The type of operation. */
5605
+ /** 操作类型。 */
5606
+ operation: ChannelChangeType | ChannelMultiDeviceEventType;
5607
+ /** The channel ID. */
5608
+ /** 频道 ID。 */
5609
+ id: string;
5610
+ /** The channel name. */
5611
+ /** 频道名称。 */
5612
+ name?: string;
5613
+ /** The operator. */
5614
+ /** 操作者。 */
5615
+ operator: string;
5616
+ /** The operated object. */
5617
+ /** 被操作的对象。 */
5618
+ to: string;
5619
+ /** The invite message. */
5620
+ /** 邀请用户加入频道的消息。*/
5621
+ inviteMessage?: string;
5622
+ /** The invite channel server info. */
5623
+ /** 邀请加入频道的相关社区信息。*/
5624
+ serverInfo?: InviteChannelServerInfo;
5625
+ /** The description of the channel. */
5626
+ /** 频道描述。 */
5627
+ description?: string;
5628
+ }
5629
+
5630
+ type MultiDeviceData =
5631
+ | ThreadMultiDeviceInfo
5632
+ | ServerChangeInfo
5633
+ | ChannelChangeInfo;
5634
+
4297
5635
  type Event =
4298
5636
  | 'onOpened'
4299
5637
  | 'onPresence'
@@ -4309,12 +5647,10 @@ export declare namespace EasemobChat {
4309
5647
  | 'onDeliveredMessage'
4310
5648
  | 'onReadMessage'
4311
5649
  | 'onRecallMessage'
4312
- | 'onMutedMessage'
4313
5650
  | 'onChannelMessage'
4314
5651
  | 'onError'
4315
5652
  | 'onOffline'
4316
5653
  | 'onOnline'
4317
- | 'onRoster'
4318
5654
  | 'onStatisticMessage'
4319
5655
  | 'onContactAgreed'
4320
5656
  | 'onContactRefuse'
@@ -4333,54 +5669,99 @@ export declare namespace EasemobChat {
4333
5669
  | 'onChatThreadChange'
4334
5670
  | 'onMultiDeviceEvent'
4335
5671
  | 'onGroupEvent'
4336
- | 'onChatroomEvent';
5672
+ | 'onChatroomEvent'
5673
+ | 'onServerEvent'
5674
+ | 'onChannelEvent';
4337
5675
 
4338
5676
  interface EventHandlerType {
5677
+ /** @deprecated Use { onConnected } instead. */
4339
5678
  onOpened?: (msg: any) => void;
5679
+ /** @deprecated */
4340
5680
  onPresence?: (msg: OnPresenceMsg) => void;
5681
+ /** The callback to receive a text message. */
4341
5682
  onTextMessage?: (msg: TextMsgBody) => void;
5683
+ /** The callback to receive a image message. */
4342
5684
  onImageMessage?: (msg: ImgMsgBody) => void;
5685
+ /** The callback to receive a audio message. */
4343
5686
  onAudioMessage?: (msg: AudioMsgBody) => void;
5687
+ /** The callback to receive a video message. */
4344
5688
  onVideoMessage?: (msg: VideoMsgBody) => void;
5689
+ /** The callback to receive a file message. */
4345
5690
  onFileMessage?: (msg: FileMsgBody) => void;
5691
+ /** The callback to receive a location message. */
4346
5692
  onLocationMessage?: (msg: LocationMsgBody) => void;
5693
+ /** The callback to receive a command message. */
4347
5694
  onCmdMessage?: (msg: CmdMsgBody) => void;
5695
+ /** The callback to receive a custom message. */
4348
5696
  onCustomMessage?: (msg: CustomMsgBody) => void;
5697
+ /** The callback to receive a received ack. */
4349
5698
  onReceivedMessage?: (msg: ReceivedMsgBody) => void;
5699
+ /** The callback to receive a delivery ack. */
4350
5700
  onDeliveredMessage?: (msg: DeliveryMsgBody) => void;
5701
+ /** The callback to receive a read ack. */
4351
5702
  onReadMessage?: (msg: ReadMsgBody) => void;
5703
+ /** The callback to receive a recall message. */
4352
5704
  onRecallMessage?: (msg: RecallMsgBody) => void;
4353
- onMutedMessage?: (msg: MuteMsgBody) => void;
5705
+ /** The callback to receive a session read ack. */
4354
5706
  onChannelMessage?: (msg: ChannelMsgBody) => void;
5707
+ /** The callback to receive error. */
4355
5708
  onError?: (error: ErrorEvent) => void;
4356
- onOffline?: (msg: any) => void;
4357
- onOnline?: (msg: any) => void;
4358
- onRoster?: (rosters: RosterData[]) => void;
5709
+ /** The callback for network disconnection. */
5710
+ onOffline?: () => void;
5711
+ /** The callback for network connection. */
5712
+ onOnline?: () => void;
5713
+ /** The callback to receive a statistic message. */
4359
5714
  onStatisticMessage?: (msg: any) => void;
5715
+ /** The callback to accept contact request. */
4360
5716
  onContactAgreed?: (msg: ContactMsgBody) => void;
5717
+ /** The callback to refuse contact request. */
4361
5718
  onContactRefuse?: (msg: ContactMsgBody) => void;
5719
+ /** The callback to deleted a contact. */
4362
5720
  onContactDeleted?: (msg: ContactMsgBody) => void;
5721
+ /** The callback to added a contact. */
4363
5722
  onContactAdded?: (msg: ContactMsgBody) => void;
4364
- onTokenWillExpire?: (msg: any) => void;
4365
- onTokenExpired?: (msg: any) => void;
4366
- onContactInvited?: (msg: any) => void;
5723
+ /** The callback whose token is about to expire. */
5724
+ onTokenWillExpire?: () => void;
5725
+ /** The callback whose token has expired. */
5726
+ onTokenExpired?: () => void;
5727
+ /** The callback to contact request was received. */
5728
+ onContactInvited?: (msg: ContactMsgBody) => void;
5729
+ /** The callback for successful connection. */
4367
5730
  onConnected?: () => void;
5731
+ /** The callback for disconnected. */
4368
5732
  onDisconnected?: () => void;
5733
+ /** @deprecated Use { onGroupEvent } instead. */
4369
5734
  onGroupChange?: (msg: any) => void;
5735
+ /** @deprecated Use { onChatroomEvent } instead. */
4370
5736
  onChatroomChange?: (msg: any) => void;
5737
+ /** @deprecated */
4371
5738
  onContactChange?: (msg: any) => void;
5739
+ /** Occurs when the presence state of a subscribed user changes. */
4372
5740
  onPresenceStatusChange?: (msg: PresenceType[]) => void;
5741
+ /** The callback to receive a reaction message. */
4373
5742
  onChatThreadChange?: (msg: ThreadChangeInfo) => void;
4374
- onMultiDeviceEvent?: (msg: ThreadMultiDeviceInfo) => void;
5743
+ /** The callback to receive a multi device event. */
5744
+ onMultiDeviceEvent?: (msg: MultiDeviceData) => void;
5745
+ /** The callback to receive a reaction message. */
4375
5746
  onReactionChange?: (msg: ReactionMessage) => void;
5747
+ /** The callback to receive a group event. */
4376
5748
  onGroupEvent?: (eventData: EventData) => void;
5749
+ /** The callback to receive a chatroom event. */
4377
5750
  onChatroomEvent?: (eventData: EventData) => void;
5751
+ /** The callback to receive a server message. */
5752
+ onServerEvent?: (msg: ServerChangeInfo) => void;
5753
+ /** The callback to receive a channel message. */
5754
+ onChannelEvent?: (msg: ChannelChangeInfo) => void;
4378
5755
  }
4379
5756
 
4380
5757
  interface HandlerData {
4381
5758
  [key: string]: EventHandlerType;
4382
5759
  }
4383
5760
 
5761
+ /**
5762
+ * This is the module of the SDK that is responsible for registering listening events.
5763
+ * @module eventHandler
5764
+ */
4384
5765
  class EventHandler {
4385
5766
  handlerData: HandlerData;
4386
5767
  constructor(
@@ -4388,10 +5769,12 @@ export declare namespace EasemobChat {
4388
5769
  eventHandlerId: string,
4389
5770
  eventHandler: EventHandlerType
4390
5771
  );
5772
+ /** Adds listening events. */
4391
5773
  addEventHandler(
4392
5774
  eventHandlerId: string,
4393
5775
  eventHandler: EventHandlerType
4394
5776
  ): void;
5777
+ /** Removes listening events. */
4395
5778
  removeEventHandler(eventHandlerId: string): void;
4396
5779
  dispatch(
4397
5780
  this: EventHandler,
@@ -4419,15 +5802,11 @@ export declare namespace EasemobChat {
4419
5802
  onDeliveredMessage?: (msg: DeliveryMsgBody) => void;
4420
5803
  onReadMessage?: (msg: ReadMsgBody) => void;
4421
5804
  onRecallMessage?: (msg: RecallMsgBody) => void;
4422
- onMutedMessage?: (msg: MuteMsgBody) => void;
4423
5805
  onChannelMessage?: (msg: ChannelMsgBody) => void;
4424
5806
  onError?: (error: ErrorEvent) => void;
4425
5807
  onOffline?: () => void;
4426
5808
  onOnline?: () => void;
4427
- onRoster?: (rosters: RosterData[]) => void;
4428
5809
  onStatisticMessage?: () => void;
4429
- onCreateGroup?: () => void;
4430
- onBlacklistUpdate?: () => void;
4431
5810
  onContactAgreed?: (msg: ContactMsgBody) => void;
4432
5811
  onContactRefuse?: (msg: ContactMsgBody) => void;
4433
5812
  onContactDeleted?: (msg: ContactMsgBody) => void;
@@ -4438,25 +5817,34 @@ export declare namespace EasemobChat {
4438
5817
  onPresenceStatusChange?: (msg: PresenceType[]) => void;
4439
5818
  }
4440
5819
 
4441
- /**
4442
- * @module Error
4443
- */
5820
+ // ----- for Error -----
5821
+
4444
5822
  interface ErrorParameters {
5823
+ /** Error code. */
4445
5824
  type: Code;
5825
+ /** Error message. */
4446
5826
  message: string;
5827
+ /** Other data. */
4447
5828
  data?: any;
4448
5829
  }
5830
+
5831
+ /**
5832
+ * Error class
5833
+ * @module Error
5834
+ */
4449
5835
  class ErrorEvent {
5836
+ /** Error code. */
4450
5837
  type: Code;
5838
+ /** Error message. */
4451
5839
  message: string;
5840
+ /** Other data. */
4452
5841
  data?: any;
4453
5842
  constructor(parameters: ErrorParameters);
4454
5843
  static create(parameters: ErrorParameters): ErrorEvent;
4455
5844
  }
4456
5845
 
4457
- /**
4458
- * @module Logger
4459
- */
5846
+ // ---- for Logger ---
5847
+
4460
5848
  type DefaultLevel =
4461
5849
  | 'TRACE'
4462
5850
  | 'DEBUG'
@@ -4480,6 +5868,11 @@ export declare namespace EasemobChat {
4480
5868
  color: string;
4481
5869
  background: string;
4482
5870
  }
5871
+
5872
+ /**
5873
+ * SDK log function
5874
+ * @module Logger
5875
+ */
4483
5876
  class Logger {
4484
5877
  name: string;
4485
5878
  currentLevel: LevelNum;
@@ -4522,9 +5915,8 @@ export declare namespace EasemobChat {
4522
5915
  download(): void;
4523
5916
  }
4524
5917
 
4525
- /**
4526
- * @moudle message
4527
- */
5918
+ // --- for Message ---
5919
+
4528
5920
  type MessageType =
4529
5921
  | 'read'
4530
5922
  | 'delivery'
@@ -4540,9 +5932,13 @@ export declare namespace EasemobChat {
4540
5932
 
4541
5933
  type ChatType = 'singleChat' | 'groupChat' | 'chatRoom';
4542
5934
  interface FileObj {
5935
+ /** The file URL. */
4543
5936
  url: string;
5937
+ /** The file name. */
4544
5938
  filename: string;
5939
+ /** The file type. */
4545
5940
  filetype: string;
5941
+ /** The File object. */
4546
5942
  data: File;
4547
5943
  }
4548
5944
 
@@ -4562,6 +5958,18 @@ export declare namespace EasemobChat {
4562
5958
  isAddedBySelf?: boolean;
4563
5959
  }
4564
5960
 
5961
+ /** Message online state type. */
5962
+ enum ONLINESTATETYPE {
5963
+ /** Offline message. */
5964
+ OFFLINE = 0,
5965
+ /** Online message. */
5966
+ ONLINE = 1,
5967
+ /** Unknown state. */
5968
+ UNKNOWN = 2,
5969
+ /** Message online status is not enabled. */
5970
+ NONE = 3,
5971
+ }
5972
+
4565
5973
  interface PresenceMsg {
4566
5974
  type: OnPresenceMsgType;
4567
5975
  to: string;
@@ -4577,565 +5985,1046 @@ export declare namespace EasemobChat {
4577
5985
  }
4578
5986
 
4579
5987
  interface ReadMsgSetParameters {
5988
+ /** The message ID. */
4580
5989
  id: string;
5990
+ /** The recipient. */
4581
5991
  to: string;
5992
+ /** The sender, which can only be the current user and can not be changed. */
4582
5993
  from?: string;
5994
+ /** The session type. */
4583
5995
  chatType: 'singleChat' | 'groupChat';
4584
5996
  }
4585
5997
  interface ReadMsgBody extends ReadMsgSetParameters {
5998
+ /** The message type. */
4586
5999
  type: 'read';
6000
+ /** Session type. */
6001
+ chatType: 'singleChat' | 'groupChat';
6002
+ /** The ID of the read message */
4587
6003
  ackId?: string;
6004
+ /** The ID of the read message This parameter has the same value as ackId.*/
4588
6005
  mid?: string;
6006
+ /** The number of group members that have read the messages. */
4589
6007
  groupReadCount?: { [key: string]: number };
6008
+ /** The message content. */
4590
6009
  ackContent?: string;
4591
- chatType: 'singleChat' | 'groupChat';
6010
+ /** Whether the message is a thread message. */
4592
6011
  isChatThread?: boolean;
6012
+ /** Message online state type. */
6013
+ onlineState?: ONLINESTATETYPE;
4593
6014
  }
4594
6015
  interface ReadParameters {
6016
+ /** The message type. */
4595
6017
  type: 'read';
6018
+ /** The recipient. */
4596
6019
  id: string;
4597
6020
  }
4598
6021
 
4599
6022
  interface CreateReadMsgParameters {
6023
+ /** The recipient. */
4600
6024
  to: string;
6025
+ /** The sender, which can only be the current user and can not be changed. */
4601
6026
  from?: string;
6027
+ /** The message type. */
4602
6028
  type: 'read';
6029
+ /** The session type. */
6030
+ chatType: 'singleChat' | 'groupChat';
6031
+ /** The ID of the read message. */
4603
6032
  id: string;
6033
+ /** The message content. */
4604
6034
  ackContent?: string;
4605
- chatType: 'singleChat' | 'groupChat';
6035
+ /** Whether the message is a thread message. */
4606
6036
  isChatThread?: boolean;
4607
6037
  }
4608
6038
 
4609
6039
  interface DeliveryParameters {
6040
+ /** The ID of the delivery receipt. */
4610
6041
  id: string;
6042
+ /** The message type. */
4611
6043
  type: 'delivery';
4612
6044
  }
4613
6045
  interface DeliveryMsgSetParameters {
6046
+ /** The ID of the delivered message. This parameter has the same value as mid. */
4614
6047
  ackId: string;
6048
+ /** The recipient. */
4615
6049
  to: string;
6050
+ /** The sender, which can only be the current user and can not be changed. */
4616
6051
  from?: string;
4617
6052
  }
4618
6053
  interface DeliveryMsgBody {
6054
+ /** The ID of the delivery receipt. */
4619
6055
  id: string;
6056
+ /** The ID of the delivered message. */
4620
6057
  mid?: string;
6058
+ /** The ID of the delivered message. This parameter has the same value as mid. */
4621
6059
  ackId?: string;
6060
+ /** The message type. */
4622
6061
  type: 'delivery';
6062
+ /** The recipient. */
4623
6063
  to: string;
6064
+ /** The sender, which can only be the current user and can not be changed. */
4624
6065
  from?: string;
6066
+ /** Whether the message is a thread message. */
4625
6067
  isChatThread?: boolean;
6068
+ /** Message online state type. */
6069
+ onlineState?: ONLINESTATETYPE;
4626
6070
  }
4627
6071
 
4628
6072
  interface CreateDeliveryMsgParameters {
6073
+ /** The ID of the delivered message. */
4629
6074
  ackId: string;
6075
+ /** The message type. */
4630
6076
  type: 'delivery';
6077
+ /** The recipient. */
4631
6078
  to: string;
6079
+ /** The sender, which can only be the current user and can not be changed.*/
4632
6080
  from?: string;
6081
+ /** Whether the message is a thread message. */
4633
6082
  isChatThread?: boolean;
4634
6083
  }
4635
6084
 
4636
6085
  interface ChannelMsgSetParameters {
6086
+ /** The session type. */
4637
6087
  chatType: ChatType;
6088
+ /** The receipt. */
4638
6089
  to: string;
6090
+ /** The sender, which can only be the current user and can not be changed. */
4639
6091
  from?: string;
4640
6092
  }
4641
6093
 
4642
6094
  interface ChannelMsgBody extends ChannelMsgSetParameters {
6095
+ /** The message ID. */
4643
6096
  id: string;
6097
+ /** Whether it's group chat. */
4644
6098
  group?: string;
6099
+ /** The message type. */
4645
6100
  type: 'channel';
6101
+ /** Time. */
4646
6102
  time: number;
6103
+ /** Whether the message is a thread message. */
4647
6104
  isChatThread?: boolean;
6105
+ /** Message online state type. */
6106
+ onlineState?: ONLINESTATETYPE;
4648
6107
  }
6108
+
4649
6109
  interface ChannelParameters {
6110
+ /** The message type. */
4650
6111
  type: 'channel';
6112
+ /** The message ID. */
4651
6113
  id: string;
4652
6114
  }
4653
6115
 
4654
6116
  interface CreateChannelMsgParameters {
6117
+ /** The message type. */
4655
6118
  type: 'channel';
6119
+ /** The session type. */
4656
6120
  chatType: ChatType;
6121
+ /** The receipt. */
4657
6122
  to: string;
6123
+ /** The sender, which can only be the current user and can not be changed. */
4658
6124
  from?: string;
6125
+ /** Whether the message is a thread message. */
4659
6126
  isChatThread?: boolean;
4660
6127
  }
4661
6128
 
4662
6129
  interface TextParameters {
6130
+ /** The message type. */
4663
6131
  type: 'txt';
6132
+ /** The message ID. */
4664
6133
  id: string;
4665
6134
  }
6135
+
4666
6136
  interface TextMsgSetParameters {
6137
+ /** The session type. */
4667
6138
  chatType: ChatType;
6139
+ /** The recipient. */
4668
6140
  to: string;
6141
+ /** The message content. */
4669
6142
  msg: string;
6143
+ /** The sender, which can only be the current user and can not be changed.*/
4670
6144
  from?: string;
6145
+ /** @deprecated Whether the session type is chat room. */
4671
6146
  roomType?: boolean;
6147
+ /** The callback for message sending success. */
4672
6148
  success?: (data: SendMsgResult) => void;
6149
+ /** The callback for a message sending failure. */
4673
6150
  fail?: () => void;
6151
+ /** Message extension. */
4674
6152
  ext?: { [key: string]: any };
6153
+ /** Whether the message is a thread message. */
6154
+ isChatThread?: boolean;
4675
6155
  }
4676
6156
 
4677
6157
  interface TextMsgBody {
6158
+ /** The message ID. */
4678
6159
  id: string;
6160
+ /** The session type. */
4679
6161
  chatType: ChatType;
6162
+ /** The message type. */
4680
6163
  type: 'txt';
6164
+ /** The recipient. */
4681
6165
  to: string;
6166
+ /** The message content. */
4682
6167
  msg: string;
6168
+ /** The sender, which can only be the current user and can not be changed.*/
4683
6169
  from?: string;
6170
+ /** @deprecated Whether the session type is chat room. */
4684
6171
  roomType?: boolean;
6172
+ /** @deprecated Whether the session type is group. */
4685
6173
  group?: string;
6174
+ /** The callback for message sending success. */
4686
6175
  success?: (data: SendMsgResult) => void;
6176
+ /** The callback for a message sending failure. */
4687
6177
  fail?: () => void;
6178
+ /** Message extension. */
4688
6179
  ext?: { [key: string]: any };
6180
+ /** Whether read receipts are required during a group session. */
4689
6181
  msgConfig?: { allowGroupAck?: boolean; languages?: string[] };
6182
+ /** Message translation */
4690
6183
  translations?: TranslationResult;
6184
+ /** Time. */
4691
6185
  time: number;
6186
+ /** Whether the message is a thread message. */
4692
6187
  isChatThread?: boolean;
6188
+ /** The reaction to be added to the message. The length is limited to 128 characters. */
4693
6189
  reactions?: Reaction;
6190
+ /** The message thread. */
6191
+ chatThread?: ChatThread;
6192
+ /** The message thread overview. */
6193
+ chatThreadOverview?: ChatThreadOverview;
6194
+ /** Message online state type. */
6195
+ onlineState?: ONLINESTATETYPE;
4694
6196
  }
4695
6197
 
4696
6198
  interface CreateTextMsgParameters {
6199
+ /** The session type. */
4697
6200
  chatType: ChatType;
6201
+ /** The message type. */
4698
6202
  type: 'txt';
6203
+ /** The recipient. */
4699
6204
  to: string;
6205
+ /** The message content. */
4700
6206
  msg: string;
6207
+ /** The sender, which can only be the current user and can not be changed.*/
4701
6208
  from?: string;
6209
+ /** Message extension. */
4702
6210
  ext?: { [key: string]: any };
6211
+ /** Whether read receipts are required during a group session. */
4703
6212
  msgConfig?: { allowGroupAck?: boolean; languages?: string[] };
6213
+ /** Whether the message is a thread message. */
4704
6214
  isChatThread?: boolean;
4705
6215
  }
4706
6216
 
4707
6217
  interface CmdParameters {
6218
+ /** The message type. */
4708
6219
  type: 'cmd';
6220
+ /** The message ID. */
4709
6221
  id: string;
4710
6222
  }
4711
6223
  interface CmdMsgSetParameters {
6224
+ /** The session type. */
4712
6225
  chatType: ChatType;
6226
+ /** The recipient. */
4713
6227
  to: string;
6228
+ /** The command. */
4714
6229
  action: string;
6230
+ /** The sender, which can only be the current user and can not be changed.*/
4715
6231
  from?: string;
6232
+ /** @deprecated Whether the session type is chat room. */
4716
6233
  roomType?: boolean;
6234
+ /** The callback for message sending success. */
4717
6235
  success?: (data: SendMsgResult) => void;
6236
+ /** The callback for a message sending failure. */
4718
6237
  fail?: () => void;
6238
+ /** Message extension. */
4719
6239
  ext?: { [key: string]: any };
4720
6240
  }
4721
6241
 
4722
6242
  interface CmdMsgBody {
6243
+ /** The message ID. */
4723
6244
  id: string;
6245
+ /** The session type. */
4724
6246
  chatType: ChatType;
6247
+ /** The message type. */
4725
6248
  type: 'cmd';
6249
+ /** The recipient. */
4726
6250
  to: string;
6251
+ /** The command. */
4727
6252
  action: string;
6253
+ /** The sender, which can only be the current user and can not be changed.*/
4728
6254
  from?: string;
6255
+ /** @deprecated Whether the session type is chat room. */
4729
6256
  roomType?: boolean;
6257
+ /** @deprecated Whether the session type is group. */
4730
6258
  group?: string;
6259
+ /** The callback for message sending success. */
4731
6260
  success?: (data: SendMsgResult) => void;
6261
+ /** The callback for a message sending failure. */
4732
6262
  fail?: () => void;
6263
+ /** Message extension. */
4733
6264
  ext?: { [key: string]: any };
6265
+ /** Whether read receipts are required during a group session. */
4734
6266
  msgConfig?: { [key: string]: any };
6267
+ /** Time. */
4735
6268
  time: number;
6269
+ /** Whether the message is a thread message. */
4736
6270
  isChatThread?: boolean;
6271
+ /** The reaction to be added to the message. The length is limited to 128 characters. */
4737
6272
  reactions?: Reaction;
6273
+ /** The message thread. */
6274
+ chatThread?: ChatThread;
6275
+ /** The message thread overview. */
6276
+ chatThreadOverview?: ChatThreadOverview;
6277
+ /** Message online state type. */
6278
+ onlineState?: ONLINESTATETYPE;
4738
6279
  }
4739
6280
 
4740
6281
  interface CreateCmdMsgParameters {
6282
+ /** The message type. */
4741
6283
  type: 'cmd';
6284
+ /** The session type. */
4742
6285
  chatType: ChatType;
6286
+ /** The recipient. */
4743
6287
  to: string;
6288
+ /** The command. */
4744
6289
  action: string;
6290
+ /** The sender, which can only be the current user and can not be changed.*/
4745
6291
  from?: string;
6292
+ /** @deprecated Whether the session type is chat room. */
4746
6293
  roomType?: boolean;
6294
+ /** Message extension. */
4747
6295
  ext?: { [key: string]: any };
6296
+ /** Whether read receipts are required during a group session. */
4748
6297
  msgConfig?: { allowGroupAck: boolean };
6298
+ /** Whether the message is a thread message. */
4749
6299
  isChatThread?: boolean;
4750
6300
  }
4751
6301
 
4752
6302
  interface CustomParameters {
6303
+ /** The message type. */
4753
6304
  type: 'custom';
6305
+ /** The message ID. */
4754
6306
  id: string;
4755
6307
  }
4756
6308
  interface CustomMsgSetParameters {
6309
+ /** The session type. */
4757
6310
  chatType: ChatType;
6311
+ /** The recipient. */
4758
6312
  to: string;
6313
+ /** The custom event. */
4759
6314
  customEvent: string;
6315
+ /** The custom event extension. */
4760
6316
  customExts: { [key: string]: any };
6317
+ /** The sender, which can only be the current user and can not be changed.*/
4761
6318
  from?: string;
6319
+ /** @deprecated Whether the session type is chat room. */
4762
6320
  roomType?: boolean;
6321
+ /** The callback for message sending success. */
4763
6322
  success?: (data: SendMsgResult) => void;
6323
+ /** The callback for a message sending failure. */
4764
6324
  fail?: () => void;
6325
+ /** Message extension. */
4765
6326
  ext?: { [key: string]: any };
4766
6327
  }
4767
6328
 
4768
6329
  interface CustomMsgBody {
6330
+ /** The message ID. */
4769
6331
  id: string;
6332
+ /** The session type. */
4770
6333
  chatType: ChatType;
6334
+ /** The message type. */
4771
6335
  type: 'custom';
6336
+ /** The recipient. */
4772
6337
  to: string;
6338
+ /** The custom event. */
4773
6339
  customEvent: string;
6340
+ /** The custom event extension. */
4774
6341
  customExts: { [key: string]: any };
6342
+ /** The sender, which can only be the current user and can not be changed.*/
4775
6343
  from?: string;
6344
+ /** @deprecated Whether the session type is chat room. */
4776
6345
  roomType?: boolean;
6346
+ /** @deprecated Whether the session type is group. */
4777
6347
  group?: string;
4778
6348
  params?: { [key: string]: any };
6349
+ /** The callback for message sending success. */
4779
6350
  success?: (data: SendMsgResult) => void;
6351
+ /** The callback for a message sending failure. */
4780
6352
  fail?: () => void;
6353
+ /** Message extension. */
4781
6354
  ext?: { [key: string]: any };
6355
+ /** Whether read receipts are required during a group session. */
4782
6356
  msgConfig?: { [key: string]: any };
6357
+ /** Time. */
4783
6358
  time: number;
6359
+ /** Whether the message is a thread message. */
4784
6360
  isChatThread?: boolean;
6361
+ /** The reaction to be added to the message. The length is limited to 128 characters. */
4785
6362
  reactions?: Reaction;
6363
+ /** The message thread. */
6364
+ chatThread?: ChatThread;
6365
+ /** The message thread overview. */
6366
+ chatThreadOverview?: ChatThreadOverview;
6367
+ /** Message online state type. */
6368
+ onlineState?: ONLINESTATETYPE;
4786
6369
  }
4787
6370
 
4788
6371
  interface CreateCustomMsgParameters {
6372
+ /** The message type. */
4789
6373
  type: 'custom';
6374
+ /** The session type. */
4790
6375
  chatType: ChatType;
6376
+ /** The recipient. */
4791
6377
  to: string;
6378
+ /** The custom event. */
4792
6379
  customEvent: string;
6380
+ /** The custom event extension. */
4793
6381
  customExts: { [key: string]: any };
6382
+ /** The sender, which can only be the current user and can not be changed.*/
4794
6383
  from?: string;
6384
+ /** Message extension. */
4795
6385
  ext?: { [key: string]: any };
6386
+ /** Whether read receipts are required during a group session. */
4796
6387
  msgConfig?: { allowGroupAck: boolean };
6388
+ /** Whether the message is a thread message. */
4797
6389
  isChatThread?: boolean;
4798
6390
  }
4799
6391
 
4800
6392
  interface LocationParameters {
6393
+ /** The message type. */
4801
6394
  type: 'loc';
6395
+ /** The message ID. */
4802
6396
  id: string;
4803
6397
  }
6398
+
4804
6399
  interface LocationMsgSetParameters {
6400
+ /** The session type. */
4805
6401
  chatType: ChatType;
6402
+ /** The recipient. */
4806
6403
  to: string;
6404
+ /** The address. */
4807
6405
  addr: string;
6406
+ /** The building name. */
4808
6407
  buildingName: string;
6408
+ /** The latitude. */
4809
6409
  lat: number;
6410
+ /** The longitude. */
4810
6411
  lng: number;
6412
+ /** The sender, which can only be the current user and can not be changed. */
4811
6413
  from?: string;
6414
+ /** @deprecated Whether the session type is chat room. */
4812
6415
  roomType?: boolean;
6416
+ /** The callback for message sending success. */
4813
6417
  success?: (data: SendMsgResult) => void;
6418
+ /** The callback for a message sending failure. */
4814
6419
  fail?: () => void;
6420
+ /** The message extension. */
4815
6421
  ext?: { [key: string]: any };
4816
6422
  }
4817
6423
 
4818
6424
  interface LocationMsgBody {
6425
+ /** The message ID. */
4819
6426
  id: string;
6427
+ /** The session type. */
4820
6428
  chatType: ChatType;
6429
+ /** The message type. */
4821
6430
  type: 'loc';
6431
+ /** The recipient. */
4822
6432
  to: string;
6433
+ /** The address. */
4823
6434
  addr: string;
6435
+ /** The building name. */
4824
6436
  buildingName: string;
6437
+ /** The latitude. */
4825
6438
  lat: number;
6439
+ /** The longitude. */
4826
6440
  lng: number;
6441
+ /** The sender, which can only be the current user and can not be changed. */
4827
6442
  from?: string;
6443
+ /** @deprecated Whether the session type is chat room. */
4828
6444
  roomType?: boolean;
6445
+ /** @deprecated Whether the session type is group. */
4829
6446
  group?: string;
6447
+ /** The callback for message sending success. */
4830
6448
  success?: (data: SendMsgResult) => void;
6449
+ /** The callback for a message sending failure. */
4831
6450
  fail?: () => void;
6451
+ /** The message extension. */
4832
6452
  ext?: { [key: string]: any };
6453
+ /** Time. */
4833
6454
  time: number;
6455
+ /** Whether read receipts are required during a group session. */
4834
6456
  msgConfig?: { allowGroupAck: boolean };
6457
+ /** Whether the message is a thread message. */
4835
6458
  isChatThread?: boolean;
6459
+ /** The reaction to be added to the message. The length is limited to 128 characters. */
4836
6460
  reactions?: Reaction;
6461
+ /** The message thread. */
6462
+ chatThread?: ChatThread;
6463
+ /** The message thread overview. */
6464
+ chatThreadOverview?: ChatThreadOverview;
6465
+ /** Message online state type. */
6466
+ onlineState?: ONLINESTATETYPE;
4837
6467
  }
4838
6468
 
4839
6469
  interface CreateLocationMsgParameters {
6470
+ /** The message type. */
4840
6471
  type: 'loc';
6472
+ /** The session type. */
4841
6473
  chatType: ChatType;
6474
+ /** The recipient. */
4842
6475
  to: string;
6476
+ /** The address. */
4843
6477
  addr: string;
6478
+ /** The building name. */
4844
6479
  buildingName: string;
6480
+ /** The latitude. */
4845
6481
  lat: number;
6482
+ /** The longitude. */
4846
6483
  lng: number;
6484
+ /** The sender, which can only be the current user and can not be changed. */
4847
6485
  from?: string;
6486
+ /** The message extension. */
4848
6487
  ext?: { [key: string]: any };
6488
+ /** Whether read receipts are required during a group session. */
4849
6489
  msgConfig?: { allowGroupAck: boolean };
6490
+ /** Whether the message is a thread message. */
4850
6491
  isChatThread?: boolean;
4851
6492
  }
4852
6493
 
4853
6494
  interface FileParameters {
6495
+ /** The message type. */
4854
6496
  type: 'file';
6497
+ /** The message ID. */
4855
6498
  id: string;
4856
6499
  }
6500
+
6501
+ interface UploadFileResult {
6502
+ /** The file URL. */
6503
+ url: string;
6504
+ entities: {
6505
+ /** Secret required to download the file. */
6506
+ 'share-secret': string;
6507
+ /** the file category. */
6508
+ type: 'chatfile';
6509
+ /** Unique ID generated by the file on the server. */
6510
+ uuid: string;
6511
+ }[];
6512
+ [key: string]: any;
6513
+ }
6514
+
4857
6515
  interface FileMsgSetParameters {
6516
+ /** The session type. */
4858
6517
  chatType: ChatType;
6518
+ /** The file object. */
4859
6519
  file: FileObj;
6520
+ /** The file name. */
4860
6521
  filename?: string;
6522
+ /** The input ID of the file to be uploaded. */
4861
6523
  fileInputId?: string;
6524
+ /** The recipient. */
4862
6525
  to: string;
6526
+ /** The sender, which can only be the current user and can not be changed.*/
4863
6527
  from?: string;
6528
+ /** @deprecated Whether the session type is chat room. */
4864
6529
  roomType?: boolean;
6530
+ /** The callback for message sending success. */
4865
6531
  success?: (data: SendMsgResult) => void;
6532
+ /** The callback for a message sending failure. */
4866
6533
  fail?: () => void;
6534
+ /** The message extension. */
4867
6535
  ext?: { [key: string]: any };
6536
+ /** File upload address. */
4868
6537
  apiUrl?: string;
4869
- onFileUploadError?: (err: any) => void;
4870
- onFileUploadComplete?: (data: any) => void;
6538
+ /** The callback of a file upload error. */
6539
+ onFileUploadError?: (err: ErrorEvent) => void;
6540
+ /** The callback of file upload completion. */
6541
+ onFileUploadComplete?: (data: UploadFileResult) => void;
6542
+ /** The callback of the file upload progress. */
4871
6543
  onFileUploadProgress?: (data: ProgressEvent) => void;
6544
+ /** The message body. */
4872
6545
  body?: {
6546
+ /** The file URL. */
4873
6547
  url: string;
6548
+ /** The file type. */
4874
6549
  type: string;
6550
+ /** The file name. */
4875
6551
  filename: string;
4876
6552
  };
6553
+ /** Whether the message is a thread message. */
6554
+ isChatThread?: boolean;
4877
6555
  }
4878
6556
 
4879
6557
  interface FileMsgBody extends CreateFileMsgParameters {
6558
+ /** The message ID. */
4880
6559
  id: string;
6560
+ /** The message type. */
4881
6561
  type: 'file';
6562
+ /** @deprecated Whether the session type is group. */
4882
6563
  group?: string;
6564
+ /** The file URL. */
4883
6565
  url?: string;
6566
+ /** Secret required to download the file. */
4884
6567
  secret?: string;
4885
6568
  length?: number;
6569
+ /** The file size. */
4886
6570
  file_length?: number;
6571
+ /** The file type. */
4887
6572
  filetype?: string;
6573
+ /** AccessToken needed to download files */
4888
6574
  accessToken?: string;
6575
+ /** Whether read receipts are required during a group session. */
4889
6576
  msgConfig?: { allowGroupAck: boolean };
6577
+ /** Time. */
4890
6578
  time: number;
6579
+ /** The reaction to be added to the message. The length is limited to 128 characters. */
4891
6580
  reactions?: Reaction;
6581
+ /** The message thread. */
6582
+ chatThread?: ChatThread;
6583
+ /** The message thread overview. */
6584
+ chatThreadOverview?: ChatThreadOverview;
6585
+ /** Message online state type. */
6586
+ onlineState?: ONLINESTATETYPE;
6587
+ /** Whether the message is a thread message. */
6588
+ isChatThread?: boolean;
4892
6589
  }
4893
6590
 
4894
6591
  interface CreateFileMsgParameters {
6592
+ /** The message type. */
4895
6593
  type: 'file';
6594
+ /** The session type. */
4896
6595
  chatType: ChatType;
6596
+ /** The file object. */
4897
6597
  file: FileObj;
6598
+ /** The file name. */
4898
6599
  filename?: string;
6600
+ /** The input ID of the file to be uploaded. */
4899
6601
  fileInputId?: string;
6602
+ /** The recipient. */
4900
6603
  to: string;
6604
+ /** The sender, which can only be the current user and can not be changed.*/
4901
6605
  from?: string;
6606
+ /** The message extension. */
4902
6607
  ext?: { [key: string]: any };
6608
+ /** File upload address. */
4903
6609
  apiUrl?: string;
4904
- onFileUploadError?: (err: any) => void;
4905
- onFileUploadComplete?: (data: any) => void;
6610
+ /** The callback of a file upload error. */
6611
+ onFileUploadError?: (err: ErrorEvent) => void;
6612
+ /** The callback of file upload completion. */
6613
+ onFileUploadComplete?: (data: UploadFileResult) => void;
6614
+ /** The callback of the file upload progress. */
4906
6615
  onFileUploadProgress?: (data: ProgressEvent) => void;
6616
+ /** The message body. */
4907
6617
  body?: {
6618
+ /** The file URL. */
4908
6619
  url: string;
6620
+ /** The file type. */
4909
6621
  type: string;
6622
+ /** The file name. */
4910
6623
  filename: string;
4911
6624
  };
6625
+ /** Whether read receipts are required during a group session. */
4912
6626
  msgConfig?: { allowGroupAck: boolean };
6627
+ /** Whether the message is a thread message. */
4913
6628
  isChatThread?: boolean;
4914
6629
  }
4915
6630
 
4916
6631
  interface ImgParameters {
6632
+ /** The message type. */
4917
6633
  type: 'img';
6634
+ /** The message ID. */
4918
6635
  id: string;
4919
6636
  }
4920
6637
 
4921
6638
  interface ImgMsgSetParameters {
6639
+ /** The session type. */
4922
6640
  chatType: ChatType;
6641
+ /** The recipient. */
4923
6642
  to: string;
6643
+ /** The file object. */
4924
6644
  file?: FileObj;
6645
+ /** The image width. */
4925
6646
  width?: number;
6647
+ /** The image height. */
4926
6648
  height?: number;
6649
+ /** The input ID of the file to be uploaded. */
4927
6650
  fileInputId?: string;
6651
+ /** The sender, which can only be the current user and can not be changed.*/
4928
6652
  from?: string;
6653
+ /** @deprecated Whether the session type is chat room. */
4929
6654
  roomType?: boolean;
6655
+ /** @deprecated Whether the session type is group. */
4930
6656
  group?: string;
6657
+ /** The callback for message sending success. */
4931
6658
  success?: (data: SendMsgResult) => void;
6659
+ /** The callback for a message sending failure. */
4932
6660
  fail?: () => void;
6661
+ /** The message extension. */
4933
6662
  ext?: { [key: string]: any };
6663
+ /** The file URL. If the file is uploaded, you can directly use the URL. */
4934
6664
  url?: string;
4935
- onFileUploadError?: (error: any) => void;
4936
- onFileUploadComplete?: (data: any) => void;
6665
+ /** The callback of a file upload error. */
6666
+ onFileUploadError?: (err: ErrorEvent) => void;
6667
+ /** The callback of file upload completion. */
6668
+ onFileUploadComplete?: (data: UploadFileResult) => void;
6669
+ /** The callback of the file upload progress. */
4937
6670
  onFileUploadProgress?: (data: ProgressEvent) => void;
4938
- uploadError?: (error: any) => void;
4939
- uploadComplete?: (data: any) => void;
6671
+ /** Whether read receipts are required during a group session. */
4940
6672
  msgConfig?: { [key: string]: any };
6673
+ /** The message body. */
4941
6674
  body?: {
6675
+ /** The file URL. */
4942
6676
  url: string;
6677
+ /** The file type. */
4943
6678
  type: string;
6679
+ /** The file name. */
4944
6680
  filename: string;
4945
6681
  };
4946
6682
  }
4947
6683
 
4948
6684
  interface ImgMsgBody extends ImgMsgSetParameters {
6685
+ /** The message ID. */
4949
6686
  id: string;
6687
+ /** The message type. */
4950
6688
  type: 'img';
6689
+ /** Time. */
4951
6690
  time: number;
6691
+ /** Secret required to download the image. */
4952
6692
  secret?: string;
6693
+ /** The thumbnails of image. */
4953
6694
  thumb?: string;
6695
+ /** Secret required to download the thumbnails. */
4954
6696
  thumb_secret?: string;
6697
+ /** Whether the message is a thread message. */
4955
6698
  isChatThread?: boolean;
6699
+ /** The reaction to be added to the message. The length is limited to 128 characters. */
4956
6700
  reactions?: Reaction;
6701
+ /** The message thread. */
6702
+ chatThread?: ChatThread;
6703
+ /** The message thread overview. */
6704
+ chatThreadOverview?: ChatThreadOverview;
6705
+ /** Message online state type. */
6706
+ onlineState?: ONLINESTATETYPE;
4957
6707
  }
4958
6708
 
4959
6709
  interface CreateImgMsgParameters {
6710
+ /** The message type. */
4960
6711
  type: 'img';
6712
+ /** The session type. */
4961
6713
  chatType: ChatType;
6714
+ /** The file object. */
4962
6715
  file?: FileObj;
6716
+ /** The file URL. If the file is uploaded, you can directly use the URL. */
4963
6717
  url?: string;
6718
+ /** The image width. */
4964
6719
  width?: number;
6720
+ /** The image height. */
4965
6721
  height?: number;
6722
+ /** The recipient. */
4966
6723
  to: string;
6724
+ /** The sender, which can only be the current user and can not be changed.*/
4967
6725
  from?: string;
4968
- onFileUploadError?: (error: any) => void;
4969
- onFileUploadComplete?: (data: any) => void;
6726
+ /** The callback of a file upload error. */
6727
+ onFileUploadError?: (err: ErrorEvent) => void;
6728
+ /** The callback of file upload completion. */
6729
+ onFileUploadComplete?: (data: UploadFileResult) => void;
6730
+ /** The callback of the file upload progress. */
4970
6731
  onFileUploadProgress?: (data: ProgressEvent) => void;
4971
- uploadError?: (error: any) => void;
4972
- uploadComplete?: (data: any) => void;
6732
+ /** The message extension. */
4973
6733
  ext?: { [key: string]: any };
6734
+ /** The message body. */
4974
6735
  body?: {
6736
+ /** The file URL. */
4975
6737
  url: string;
6738
+ /** The file type. */
4976
6739
  type: string;
6740
+ /** The file name. */
4977
6741
  filename: string;
4978
6742
  };
6743
+ /** Whether read receipts are required during a group session. */
4979
6744
  msgConfig?: { allowGroupAck: boolean };
6745
+ /** Whether the message is a thread message. */
4980
6746
  isChatThread?: boolean;
4981
6747
  }
4982
6748
 
4983
6749
  interface AudioParameters {
6750
+ /** The message type. */
4984
6751
  type: 'audio';
6752
+ /** The message ID. */
4985
6753
  id: string;
4986
6754
  }
4987
6755
  interface AudioMsgSetParameters {
6756
+ /** The session type. */
4988
6757
  chatType: ChatType;
6758
+ /** The file object. */
4989
6759
  file: FileObj;
6760
+ /** The file name. */
4990
6761
  filename: string;
6762
+ /** The audio duration. */
4991
6763
  length?: number;
6764
+ /** The file size. */
4992
6765
  file_length?: number;
6766
+ /** The input ID of the file to be uploaded. */
4993
6767
  fileInputId?: string;
6768
+ /** The recipient. */
4994
6769
  to: string;
6770
+ /** The sender, which can only be the current user and can not be changed.*/
4995
6771
  from?: string;
6772
+ /** @deprecated Whether the session type is chat room. */
4996
6773
  roomType?: boolean;
6774
+ /** The callback for message sending success. */
4997
6775
  success?: (data: SendMsgResult) => void;
6776
+ /** The callback for a message sending failure. */
4998
6777
  fail?: () => void;
6778
+ /** The message extension. */
4999
6779
  ext?: { [key: string]: any };
6780
+ /** File upload address. */
5000
6781
  apiUrl?: string;
5001
- onFileUploadError?: (err: any) => void;
5002
- onFileUploadComplete?: (data: any) => void;
6782
+ /** The callback of a file upload error. */
6783
+ onFileUploadError?: (err: ErrorEvent) => void;
6784
+ /** The callback of file upload completion. */
6785
+ onFileUploadComplete?: (data: UploadFileResult) => void;
6786
+ /** The callback of the file upload progress. */
5003
6787
  onFileUploadProgress?: (data: ProgressEvent) => void;
6788
+ /** The message body. */
5004
6789
  body?: {
6790
+ /** The file URL. */
5005
6791
  url: string;
6792
+ /** The file type. */
5006
6793
  type: string;
6794
+ /** The file name. */
5007
6795
  filename: string;
5008
6796
  };
5009
6797
  }
5010
6798
 
5011
6799
  interface AudioMsgBody extends AudioMsgSetParameters {
6800
+ /** The message ID. */
5012
6801
  id: string;
6802
+ /** The message type. */
5013
6803
  type: 'audio';
6804
+ /** The audio file URL. */
5014
6805
  url?: string;
6806
+ /** Secret required to download the audio file. */
5015
6807
  secret?: string;
6808
+ /** The file type. */
5016
6809
  filetype?: string;
6810
+ /** AccessToken needed to download files */
5017
6811
  accessToken?: string;
6812
+ /** @deprecated Whether the session type is group. */
5018
6813
  group?: string;
6814
+ /** Whether read receipts are required during a group session. */
5019
6815
  msgConfig?: { [key: string]: any };
6816
+ /** Time. */
5020
6817
  time: number;
6818
+ /** Whether the message is a thread message. */
5021
6819
  isChatThread?: boolean;
6820
+ /** The reaction to be added to the message. The length is limited to 128 characters. */
5022
6821
  reactions?: Reaction;
6822
+ /** The message thread. */
6823
+ chatThread?: ChatThread;
6824
+ /** The message thread overview. */
6825
+ chatThreadOverview?: ChatThreadOverview;
6826
+ /** Message online state type. */
6827
+ onlineState?: ONLINESTATETYPE;
5023
6828
  }
5024
6829
 
5025
6830
  interface CreateAudioMsgParameters {
6831
+ /** The message type. */
5026
6832
  type: 'audio';
6833
+ /** The session type. */
5027
6834
  chatType: ChatType;
6835
+ /** The file object. */
5028
6836
  file: FileObj;
6837
+ /** The file name. */
5029
6838
  filename: string;
6839
+ /** The audio duration. */
5030
6840
  length?: number;
6841
+ /** The audio file length. */
5031
6842
  file_length?: number;
6843
+ /** The input ID of the file to be uploaded. */
5032
6844
  fileInputId?: string;
6845
+ /** The recipient. */
5033
6846
  to: string;
6847
+ /** The sender, which can only be the current user and can not be changed.*/
5034
6848
  from?: string;
5035
- roomType?: boolean;
5036
- success?: (data: SendMsgResult) => void;
5037
- fail?: () => void;
6849
+ /** The message extension. */
5038
6850
  ext?: { [key: string]: any };
5039
- apiUrl?: string;
5040
- onFileUploadError?: (err: any) => void;
5041
- onFileUploadComplete?: (data: any) => void;
6851
+ /** The callback of a file upload error. */
6852
+ onFileUploadError?: (err: ErrorEvent) => void;
6853
+ /** The callback of file upload completion. */
6854
+ onFileUploadComplete?: (data: UploadFileResult) => void;
6855
+ /** The callback of the file upload progress. */
5042
6856
  onFileUploadProgress?: (data: ProgressEvent) => void;
6857
+ /** The message body. */
5043
6858
  body?: {
6859
+ /** The file URL. */
5044
6860
  url: string;
6861
+ /** The file type. */
5045
6862
  type: string;
6863
+ /** The file name. */
5046
6864
  filename: string;
5047
6865
  };
6866
+ /** Whether read receipts are required during a group session. */
5048
6867
  msgConfig?: { allowGroupAck: boolean };
6868
+ /** Whether the message is a thread message. */
5049
6869
  isChatThread?: boolean;
5050
6870
  }
5051
6871
 
5052
6872
  interface VideoParameters {
6873
+ /** The message type. */
5053
6874
  type: 'video';
6875
+ /** The message ID. */
5054
6876
  id: string;
5055
6877
  }
5056
6878
  interface VideoMsgSetParameters {
6879
+ /** The session type. */
5057
6880
  chatType: ChatType;
6881
+ /** The file object. */
5058
6882
  file: FileObj;
6883
+ /** The file name. */
5059
6884
  filename: string;
6885
+ /** The video duration. */
5060
6886
  length?: number;
6887
+ /** The size of the video file. */
5061
6888
  file_length?: number;
6889
+ /** The input ID of the file to be uploaded. */
5062
6890
  fileInputId?: string;
6891
+ /** The recipient. */
5063
6892
  to: string;
6893
+ /** The sender, which can only be the current user and can not be changed. */
5064
6894
  from?: string;
6895
+ /** @deprecated Whether the session type is chat room. */
5065
6896
  roomType?: boolean;
6897
+ /** The callback for message sending success. */
5066
6898
  success?: (data: SendMsgResult) => void;
6899
+ /** The callback for a message sending failure. */
5067
6900
  fail?: () => void;
6901
+ /** The message extension. */
5068
6902
  ext?: { [key: string]: any };
6903
+ /** File upload address. */
5069
6904
  apiUrl?: string;
5070
- onFileUploadError?: (err: any) => void;
5071
- onFileUploadComplete?: (data: any) => void;
6905
+ /** The callback of a file upload error. */
6906
+ onFileUploadError?: (err: ErrorEvent) => void;
6907
+ /** The callback of file upload completion. */
6908
+ onFileUploadComplete?: (data: UploadFileResult) => void;
6909
+ /** The callback of the file upload progress. */
5072
6910
  onFileUploadProgress?: (data: ProgressEvent) => void;
6911
+ /** The message body. */
5073
6912
  body?: {
6913
+ /** The file URL. */
5074
6914
  url: string;
6915
+ /** The file type. */
5075
6916
  type: string;
6917
+ /** The file name. */
5076
6918
  filename: string;
5077
6919
  };
5078
6920
  }
5079
6921
 
5080
6922
  interface VideoMsgBody extends VideoMsgSetParameters {
6923
+ /** The message ID. */
5081
6924
  id: string;
6925
+ /** The message type. */
5082
6926
  type: 'video';
6927
+ /** The file URL. */
5083
6928
  url?: string;
6929
+ /** Secret required to download the video file. */
5084
6930
  secret?: string;
6931
+ /** The file type. */
5085
6932
  filetype?: string;
6933
+ /** AccessToken needed to download files */
5086
6934
  accessToken?: string;
6935
+ /** Whether read receipts are required during a group session. */
5087
6936
  msgConfig?: { [key: string]: any };
6937
+ /** @deprecated Whether the session type is group. */
5088
6938
  group?: string;
6939
+ /** Time. */
5089
6940
  time: number;
6941
+ /** Whether the message is a thread message. */
5090
6942
  isChatThread?: boolean;
6943
+ /** The reaction to be added to the message. The length is limited to 128 characters. */
5091
6944
  reactions?: Reaction;
6945
+ /** The message thread. */
6946
+ chatThread?: ChatThread;
6947
+ /** The message thread overview. */
6948
+ chatThreadOverview?: ChatThreadOverview;
6949
+ /** Message online state type. */
6950
+ onlineState?: ONLINESTATETYPE;
5092
6951
  }
5093
6952
 
5094
6953
  interface CreateVideoMsgParameters {
6954
+ /** The message type. */
5095
6955
  type: 'video';
6956
+ /** The session type. */
5096
6957
  chatType: ChatType;
6958
+ /** The file object. */
5097
6959
  file: FileObj;
6960
+ /** The file name. */
5098
6961
  filename: string;
6962
+ /** The video duration. */
5099
6963
  length?: number;
6964
+ /** The size of the video file. */
5100
6965
  file_length?: number;
6966
+ /** The input ID of the file to be uploaded. */
5101
6967
  fileInputId?: string;
6968
+ /** The recipient. */
5102
6969
  to: string;
6970
+ /** The sender, which can only be the current user and can not be changed. */
5103
6971
  from?: string;
6972
+ /** The message extension. */
5104
6973
  ext?: { [key: string]: any };
6974
+ /** File upload address. */
5105
6975
  apiUrl?: string;
5106
- onFileUploadError?: (err: any) => void;
5107
- onFileUploadComplete?: (data: any) => void;
6976
+ /** The callback of a file upload error. */
6977
+ onFileUploadError?: (err: ErrorEvent) => void;
6978
+ /** The callback of file upload completion. */
6979
+ onFileUploadComplete?: (data: UploadFileResult) => void;
6980
+ /** The callback of the file upload progress. */
5108
6981
  onFileUploadProgress?: (data: ProgressEvent) => void;
6982
+ /** The message body. */
5109
6983
  body?: {
6984
+ /** The file URL. */
5110
6985
  url: string;
6986
+ /** The file type. */
5111
6987
  type: string;
6988
+ /** The file name. */
5112
6989
  filename: string;
5113
6990
  };
6991
+ /** Whether read receipts are required during a group session. */
5114
6992
  msgConfig?: { allowGroupAck: boolean };
6993
+ /** Whether the message is a thread message. */
5115
6994
  isChatThread?: boolean;
5116
6995
  }
5117
6996
 
5118
6997
  interface ReceivedMsgBody {
6998
+ /** Locally generated message ID. */
5119
6999
  id: string;
7000
+ /** Message ID generated by the server. */
5120
7001
  mid: string;
7002
+ /** The recipient. */
5121
7003
  to: string;
5122
- time: number;
5123
7004
  }
5124
7005
 
5125
7006
  interface RecallMsgBody {
5126
- id?: string;
7007
+ /** The message ID. */
7008
+ id: string;
7009
+ /** The message sender. */
5127
7010
  from: string;
7011
+ /** The message receiver. */
5128
7012
  to: string;
7013
+ /** The ID of the message to be recalled. */
5129
7014
  mid: string;
7015
+ /** Message online state type. */
7016
+ onlineState?: ONLINESTATETYPE;
5130
7017
  }
5131
- interface MuteMsgBody {
5132
- mid: string;
5133
- }
7018
+
5134
7019
  interface ContactMsgBody {
7020
+ /** The message type, subscribe: request a contact, unsubscribed: cancel or refuse to add contact, subscribed: added contact successfully. */
7021
+ type: 'subscribe' | 'unsubscribed' | 'subscribed';
7022
+ /** The message receiver. */
5135
7023
  to: string;
7024
+ /** The message sender. */
5136
7025
  from: string;
5137
- status: string;
5138
- type: 'subscribed' | 'unsubscribed' | 'subscribe';
7026
+ /** Reason. */
7027
+ status?: string;
5139
7028
  }
5140
7029
 
5141
7030
  type NewMessageParamters =
@@ -5190,19 +7079,26 @@ export declare namespace EasemobChat {
5190
7079
  | VideoMsgBody
5191
7080
  | FileMsgBody;
5192
7081
 
7082
+ /**
7083
+ * Message class is used to create a message.
7084
+ * @module message
7085
+ */
5193
7086
  class Message {
7087
+ /** The message ID. */
5194
7088
  id: string;
7089
+ /** The message type. */
5195
7090
  type: MessageType;
5196
7091
  body?: MessageBody;
5197
7092
  constructor(type: MessageType, id?: string);
7093
+ /** @deprecated */
5198
7094
  static createOldMsg(options: NewMessageParamters): MessageBody;
7095
+ /** Create messages. */
5199
7096
  static create(options: CreateMsgType): MessageBody;
7097
+ /** @deprecated */
5200
7098
  set(options: MessageSetParameters): void;
5201
7099
  }
5202
7100
 
5203
- /**
5204
- * @moudle utils
5205
- */
7101
+ // ---- for Utils
5206
7102
 
5207
7103
  interface AjaxOptions {
5208
7104
  url: string;
@@ -5227,20 +7123,16 @@ export declare namespace EasemobChat {
5227
7123
  UNI = 'uni',
5228
7124
  }
5229
7125
  interface EnvInfo {
7126
+ /** Code running platform. */
5230
7127
  platform: PLATFORM;
7128
+ /** global variable. */
5231
7129
  global: any;
5232
7130
  }
5233
- interface Uri {
5234
- url: string;
5235
- filename: string;
5236
- filetype: string;
5237
- data: File | null;
5238
- }
5239
7131
  interface UploadFile {
5240
- onFileUploadProgress?: (msg: any) => void;
5241
- onFileUploadComplete?: (msg: any) => void;
5242
- onFileUploadError?: (msg: any) => void;
5243
- onFileUploadCanceled?: (msg: any) => void;
7132
+ onFileUploadProgress?: (data: ProgressEvent) => void;
7133
+ onFileUploadComplete?: (data: any) => void;
7134
+ onFileUploadError?: (error: ErrorEvent) => void;
7135
+ onFileUploadCanceled?: () => void;
5244
7136
  accessToken: string;
5245
7137
  appKey: string;
5246
7138
  apiUrl?: string;
@@ -5248,16 +7140,27 @@ export declare namespace EasemobChat {
5248
7140
  file: object;
5249
7141
  }
5250
7142
  interface DownloadParams {
7143
+ url: string;
5251
7144
  onFileDownloadComplete: (data: any) => void;
5252
- onFileDownloadError: (error: any) => void;
5253
- id: string;
5254
- secret: string;
7145
+ onFileDownloadError: (error: {
7146
+ type: Code;
7147
+ id: string;
7148
+ xhr: XMLHttpRequest;
7149
+ }) => void;
7150
+ id?: string;
7151
+ headers?: { [key: string]: any };
7152
+ secret?: string;
5255
7153
  [key: string]: any;
5256
7154
  }
7155
+
7156
+ /**
7157
+ * Some utility methods provided in SDK
7158
+ * @module utils
7159
+ */
5257
7160
  interface Utils {
5258
7161
  getUniqueId: () => string;
5259
7162
  ajax: (options: AjaxOptions) => Promise<any>;
5260
- getFileUrl: (fileInputId: string | HTMLInputElement) => Uri;
7163
+ getFileUrl: (fileInputId: string | HTMLInputElement) => FileObj;
5261
7164
  uploadFile: (options: UploadFile) => void;
5262
7165
  listenNetwork: (online: () => void, offline: () => void) => void;
5263
7166
  getEnvInfo: () => EnvInfo;