easemob-websdk 4.0.9 → 4.1.0-beta2

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/Easemob-chat.d.ts +1338 -267
  3. package/Easemob-chat.js +1 -3
  4. package/chatroom/chatroom.d.ts +590 -0
  5. package/chatroom/chatroom.js +1 -0
  6. package/contact/contact.d.ts +322 -0
  7. package/contact/contact.js +1 -0
  8. package/group/group.d.ts +645 -0
  9. package/group/group.js +1 -0
  10. package/message/audio.d.ts +140 -0
  11. package/message/channel.d.ts +58 -0
  12. package/message/cmd.d.ts +102 -0
  13. package/message/custom.d.ts +94 -0
  14. package/message/delivery.d.ts +53 -0
  15. package/message/file.d.ts +134 -0
  16. package/message/img.d.ts +150 -0
  17. package/message/index.d.ts +147 -0
  18. package/message/location.d.ts +98 -0
  19. package/message/read.d.ts +61 -0
  20. package/message/text.d.ts +107 -0
  21. package/message/video.d.ts +140 -0
  22. package/miniCore/miniCore.d.ts +148 -0
  23. package/miniCore/miniCore.js +1 -0
  24. package/package.json +1 -1
  25. package/presence/presence.d.ts +67 -0
  26. package/presence/presence.js +1 -0
  27. package/readme.md +15 -11
  28. package/silent/silent.d.ts +110 -0
  29. package/silent/silent.js +1 -0
  30. package/thread/thread.d.ts +157 -0
  31. package/thread/thread.js +1 -0
  32. package/translation/translation.d.ts +28 -0
  33. package/translation/translation.js +1 -0
  34. package/types/chatRoomApi.d.ts +198 -0
  35. package/types/common.d.ts +56 -0
  36. package/types/engineCore.d.ts +83 -0
  37. package/types/error.d.ts +12 -0
  38. package/types/eventHandler.d.ts +201 -0
  39. package/types/groupApi.d.ts +235 -0
  40. package/types/indexApi.d.ts +134 -0
  41. package/types/presenceApi.d.ts +66 -0
  42. package/types/reactionApi.d.ts +74 -0
  43. package/types/restApis.d.ts +6 -0
  44. package/types/silentModeApi.d.ts +90 -0
  45. package/types/threadApi.d.ts +169 -0
  46. package/types/translation.d.ts +25 -0
@@ -0,0 +1,645 @@
1
+ import * as GroupTypes from '../types/groupApi';
2
+ import { AsyncResult, UserId, CommonRequestResult } from '../types/common';
3
+ export interface GroupApi {
4
+ /**
5
+ * Creates a group instance.
6
+ *
7
+ * ```typescript
8
+ * connection.createGroup({
9
+ * data: {
10
+ * groupname: 'groupname',
11
+ * desc: 'this is my group',
12
+ * members: ['user1', 'user2'],
13
+ * public: true,
14
+ * approval: false,
15
+ * allowinvites: true,
16
+ * inviteNeedConfirm: false
17
+ * }
18
+ * })
19
+ * ```
20
+ */
21
+ createGroup(params: {
22
+ /** The group information. */
23
+ data: {
24
+ /** The group name. */
25
+ groupname: string;
26
+ /** The description of the group. */
27
+ desc: string;
28
+ /** 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. */
29
+ members: UserId[];
30
+ /** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `listgroups`. */
31
+ public: boolean;
32
+ /** Whether a user requires the approval from the group admin to join the group. -`true`: Yes; -`false`: No.*/
33
+ approval: boolean;
34
+ /** Whether to allow group members to invite others to the group. `true`: Allow; `false`: Do not allow.*/
35
+ allowinvites: boolean;
36
+ /** Whether the invitee needs to accept the invitation before joining the group.
37
+ - `true`: The invitee's consent is required. The default value is `true`.
38
+ - `false`: The invitee will be directly added to the group without confirmation.
39
+ */
40
+ inviteNeedConfirm: boolean;
41
+ /** The group max users. */
42
+ maxusers: number;
43
+ };
44
+ }): Promise<AsyncResult<GroupTypes.CreateGroupResult>>;
45
+
46
+ /**
47
+ * Blocks group messages. This method is only valid for mobile devices.
48
+ * ```typescript
49
+ * connection.blockGroupMessages({groupId: 'groupId'})
50
+ * ```
51
+ */
52
+ blockGroupMessages(params: {
53
+ /** The group ID. */
54
+ groupId: string;
55
+ }): Promise<AsyncResult<GroupTypes.BlockGroupResult>>;
56
+
57
+ /**
58
+ * Gets public groups with pagination.
59
+ *
60
+ * ```typescript
61
+ * connection.getPublicGroups({limit: 20, cursor: null})
62
+ * ```
63
+ */
64
+ getPublicGroups(params: {
65
+ /** The number of records per page. */
66
+ limit: number;
67
+ /** 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.*/
68
+ cursor?: string;
69
+ }): Promise<AsyncResult<GroupTypes.BaseGroupInfo[]>>;
70
+
71
+ /**
72
+ * Lists all the groups a user has joined.
73
+ *
74
+ * ```typescript
75
+ * connection.getJoinedGroups({
76
+ * pageNum: 1,
77
+ * pageSize: 500
78
+ * })
79
+ * ```
80
+ */
81
+ getJoinedGroups(params: {
82
+ /** The current page number. */
83
+ pageNum: number;
84
+ /** The number of group per page. */
85
+ pageSize: number;
86
+ /** Whether the number of group members is required. */
87
+ needAffiliations?: boolean;
88
+ /** Whether the role of the account in the group is required. */
89
+ needRole?: boolean;
90
+ }): Promise<AsyncResult<GroupTypes.BaseGroupInfo[]>>;
91
+
92
+ /**
93
+ * Transfers a group. Only the group owner can call this method. Group members will receive "operation: 'changeOwner'" in the callback of onGroupEvent.
94
+ *
95
+ * ```typescript
96
+ * connection.changeGroupOwner({groupId: 'groupId', newOwner: 'user1'})
97
+ * ```
98
+ */
99
+ changeGroupOwner(params: {
100
+ /** The group ID. */
101
+ groupId: string;
102
+ /** The new group owner. */
103
+ newOwner: UserId;
104
+ }): Promise<AsyncResult<GroupTypes.ChangeGroupOwnerResult>>;
105
+
106
+ /**
107
+ * Gets specifications of the group.
108
+ * ```typescript
109
+ * connection.getGroupInfo({groupId: groupId})
110
+ * ```
111
+ */
112
+ getGroupInfo(params: {
113
+ /** The group ID or group ID list. */
114
+ groupId: string | string[];
115
+ }): Promise<AsyncResult<GroupTypes.GroupDetailInfo[]>>;
116
+
117
+ /**
118
+ * Modifies group information. Only the group admin can call this method.
119
+ *
120
+ * ```typescript
121
+ * connection.modifyGroup({groupId: 'groupId', groupName: 'groupName', description:'description'})
122
+ * ```
123
+ */
124
+ modifyGroup(params: {
125
+ /** The Group ID. */
126
+ groupId: string;
127
+ /** The group name. */
128
+ groupName: string;
129
+ /** The group description. */
130
+ description: string;
131
+ }): Promise<AsyncResult<GroupTypes.ModifyGroupResult>>;
132
+
133
+ /**
134
+ * Lists all members of the group with pagination.
135
+ *
136
+ * ```typescript
137
+ * connection.listGroupMembers({pageNum: 1, pageSize: 20, groupId: 'groupId'})
138
+ * ```
139
+ */
140
+ listGroupMembers(params: {
141
+ /** The group ID。 */
142
+ groupId: string;
143
+ /** The page number, starting from 1. */
144
+ pageNum: number;
145
+ /** The number of members per page. The value cannot exceed 1000. */
146
+ pageSize: number;
147
+ }): Promise<AsyncResult<GroupTypes.GroupMember[]>>;
148
+
149
+ /**
150
+ * Gets all admins in the group.
151
+ * ```typescript
152
+ * connection.getGroupAdmin({groupId: 'groupId'})
153
+ * ```
154
+ *
155
+ */
156
+ getGroupAdmin(params: {
157
+ /** The group ID。 */
158
+ groupId: string;
159
+ }): Promise<AsyncResult<UserId[]>>;
160
+
161
+ /**
162
+ * Sets a group admin. Only the group owner can call this method. The user set as an admin will receive "operation: 'setAdmin'" in the callback of onGroupEvent.
163
+ *
164
+ * ```typescript
165
+ * connection.setGroupAdmin({groupId: 'groupId', username: 'user1'})
166
+ * ```
167
+ */
168
+ setGroupAdmin(params: {
169
+ /** The group ID. */
170
+ groupId: string;
171
+ /** The ID of the user set as admin. */
172
+ username: UserId;
173
+ }): Promise<AsyncResult<GroupTypes.SetGroupAdminResult>>;
174
+
175
+ /**
176
+ * 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.
177
+ *
178
+ * ```typescript
179
+ * connection.removeGroupAdmin({groupId: 'groupId', username: 'user1'})
180
+ * ```
181
+ */
182
+ removeGroupAdmin(params: {
183
+ /** The group ID. */
184
+ groupId: string;
185
+ /** The ID of the user with admin privileges revoked. */
186
+ username: string;
187
+ }): Promise<AsyncResult<GroupTypes.RemoveGroupAdminResult>>;
188
+
189
+ /**
190
+ * Destroys a group. Only the group owner can call this method. Group members will receive "operation: 'destroy'" in the callback of onGroupEvent.
191
+ *
192
+ * ```typescript
193
+ * connection.destroyGroup({groupId: 'groupId'})
194
+ * ```
195
+ */
196
+ destroyGroup(params: {
197
+ /** The group id. */
198
+ groupId: string;
199
+ }): Promise<AsyncResult<GroupTypes.DestroyGroupResult>>;
200
+
201
+ /**
202
+ * Leaves the group. Group members will receive "operation: 'memberAbsence'" in the callback of onGroupEvent.
203
+ *
204
+ * ```typescript
205
+ * connection.leaveGroup({groupId: 'groupId'})
206
+ * ```
207
+ */
208
+ leaveGroup(params: {
209
+ /** The group ID. */
210
+ groupId: string;
211
+ }): Promise<
212
+ AsyncResult<{
213
+ result: true;
214
+ }>
215
+ >;
216
+
217
+ /**
218
+ * Invites users into a group.
219
+ * Creates a group instance "inviteNeedConfirm:true", the invited users will receive "operation: 'inviteToJoin'" in the callback of onGroupEvent.
220
+ * Creates a group instance "inviteNeedConfirm:false", the invited users will receive "operation: 'directJoined'" in the callback of onGroupEvent.
221
+ *
222
+ * ```typescript
223
+ * connection.inviteUsersToGroup({groupId: 'groupId', users: ['user1', 'user2']})
224
+ * ```
225
+ */
226
+
227
+ inviteUsersToGroup(params: {
228
+ /** The group ID. */
229
+ groupId: string;
230
+ /** The array of invitee IDs. */
231
+ users: UserId[];
232
+ }): Promise<AsyncResult<GroupTypes.InviteUsersToGroupResult[]>>;
233
+
234
+ /**
235
+ * Applies to join the group. The group owner and admin will receive "operation: 'requestToJoin'" in the callback of onGroupEvent.
236
+ *
237
+ * ```typescript
238
+ * connection.joinGroup({groupId: 'groupId', message: 'I want to join the group'})
239
+ * ```
240
+ *
241
+ */
242
+
243
+ joinGroup(params: {
244
+ /** The group ID. */
245
+ groupId: string;
246
+ /** The additional information of the request. */
247
+ message: string;
248
+ }): Promise<AsyncResult<CommonRequestResult>>;
249
+
250
+ /**
251
+ * Accepts a group request. Only the group owner or admin can call this method. The user joining the group will receive "operation: 'acceptRequest'" in the callback of onGroupEvent.
252
+ *
253
+ * ```typescript
254
+ * connection.acceptGroupJoinRequest({applicant: 'user1', groupId: 'groupId'})
255
+ * ```
256
+ */
257
+ acceptGroupJoinRequest(params: {
258
+ /** The ID of the user requesting to join the group. */
259
+ applicant: UserId;
260
+ /** The group ID. */
261
+ groupId: string;
262
+ }): Promise<AsyncResult<CommonRequestResult>>;
263
+
264
+ /**
265
+ * Declines a group request. Only the group owner or admin can call this method.
266
+ *
267
+ * ```typescript
268
+ * connection.rejectGroupJoinRequest({applicant: 'user1', groupId: 'groupId', reason: 'I do not like you'})
269
+ * ```
270
+ */
271
+ rejectGroupJoinRequest(params: {
272
+ /** The ID of the user who sends the request to join the group. */
273
+ applicant: UserId;
274
+ /** The group ID. */
275
+ groupId: string;
276
+ /** The reason of declining. */
277
+ reason: string;
278
+ }): Promise<AsyncResult<CommonRequestResult>>;
279
+
280
+ /**
281
+ * Accepts a group invitation. If a group member invites a user to join the group, the invitee can call this method to accept the invitation. The inviter will receive "operation: 'acceptInvite'" in the callback of onGroupEvent. The user who joins the group successfully will receive "operation: 'memberPresence'" in the callback of onGroupEvent.
282
+ *
283
+ * ```typescript
284
+ * connection.acceptGroupInvite({invitee: 'myUserId', groupId: 'groupId'})
285
+ * ```
286
+ */
287
+ acceptGroupInvite(params: {
288
+ /** The user ID of the invitee. */
289
+ invitee: UserId;
290
+ /** The group ID. */
291
+ groupId: string;
292
+ }): Promise<AsyncResult<CommonRequestResult>>;
293
+
294
+ /**
295
+ * 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.
296
+ *
297
+ * ```typescript
298
+ * connection.rejectGroupInvite({invitee: 'myUserId', groupId: 'groupId'})
299
+ * ```
300
+ */
301
+ rejectGroupInvite(params: {
302
+ /** The user ID of the invitee. */
303
+ invitee: UserId;
304
+ /** The group ID. */
305
+ groupId: string;
306
+ }): Promise<AsyncResult<CommonRequestResult>>;
307
+
308
+ /**
309
+ * Removes a member from the group. Only the group owner or admin can call this method. The removed member will receive "operation: 'removeMember' in the callback of onGroupEvent, and other group members will receive "operation: 'memberAbsence' in the callback of onGroupEvent.
310
+ *
311
+ * ```typescript
312
+ * connection.removeGroupMember({groupId: 'groupId', username: 'user1'})
313
+ * ```
314
+ */
315
+ removeGroupMember(params: {
316
+ /** The group ID. */
317
+ groupId: string;
318
+ /** The member ID to remove. */
319
+ username: UserId;
320
+ }): Promise<AsyncResult<GroupTypes.RemoveGroupMemberResult>>;
321
+
322
+ /**
323
+ * Removes members from the group. Only the group owner or admin can call this method. The removed members will receive "operation: 'removeMember'" in the callback of onGroupEvent, and other group members will receive "operation: 'memberAbsence' in the callback of onGroupEvent.
324
+ *
325
+ * ```typescript
326
+ * connection.removeGroupMembers({groupId: 'groupId', users: ['user1', 'user2']})
327
+ * ```
328
+ */
329
+ removeGroupMembers(params: {
330
+ /** The group ID. */
331
+ groupId: string;
332
+ /** The array of member IDs to remove. */
333
+ users: UserId[];
334
+ }): Promise<AsyncResult<GroupTypes.RemoveGroupMemberResult[]>>;
335
+
336
+ /**
337
+ * Mutes a group member. Only the group owner or admin can call this method. The muted member and other members will receive "operation:'muteMember'" in the callback of onGroupEvent.
338
+ *
339
+ * ```typescript
340
+ * connection.muteGroupMember({username: 'user1', muteDuration: -1, groupId: 'groupId'})
341
+ * ```
342
+ */
343
+ muteGroupMember(params: {
344
+ /** The ID of the group member to mute. */
345
+ username: UserId;
346
+ /** The mute duration in milliseconds. The value `-1` indicates that the member is muted permanently.*/
347
+ muteDuration: number;
348
+ /** The group ID. */
349
+ groupId: string;
350
+ }): Promise<AsyncResult<GroupTypes.MuteGroupMemberResult[]>>;
351
+
352
+ /**
353
+ * Unmute a group member. Only the group owner or admin can call this method. All members, including the muted, will receive "operation: 'unmuteMember'" in the callback of onGroupEvent.
354
+ *
355
+ * ```typescript
356
+ * connection.unmuteGroupMember({groupId: 'groupId', username: 'user1'})
357
+ * ```
358
+ */
359
+ unmuteGroupMember(params: {
360
+ /** The group ID. */
361
+ groupId: string;
362
+ /** The group member ID to unmute. */
363
+ username: UserId;
364
+ }): Promise<AsyncResult<GroupTypes.UnmuteGroupMemberResult[]>>;
365
+
366
+ /**
367
+ * Gets the mute list of the group.
368
+ * Only the group admin or above can call this method.
369
+ * ```typescript
370
+ * connection.getGroupMutelist({groupId: 'groupId'})
371
+ * ```
372
+ */
373
+ getGroupMutelist(params: {
374
+ /** The group ID. */
375
+ groupId: string;
376
+ }): Promise<AsyncResult<GroupTypes.GetGroupMuteListResult[]>>;
377
+
378
+ /**
379
+ * Adds a member to the group blocklist. Only the group owner or admin can call this method. The member added to the blocklist will receive "operation: 'removeMember'" in the callback of onGroupEvent.
380
+ *
381
+ * ```typescript
382
+ * connection.blockGroupMember({groupId: 'groupId', username: 'user1'})
383
+ * ```
384
+ */
385
+ blockGroupMember(params: {
386
+ /** The group ID. */
387
+ groupId: string;
388
+ /** User ID to be added to the blocklist. */
389
+ username: UserId;
390
+ }): Promise<AsyncResult<GroupTypes.GroupRequestResult>>;
391
+
392
+ /**
393
+ * Adds members to the group blocklist in bulk. Only the group admin can call this method. Members added to the blocklist will receive "operation: 'removeMember'" in the callback of onGroupEvent.
394
+ *
395
+ * ```typescript
396
+ * connection.blockGroupMembers({usernames: ['user1', 'user2'], groupId: 'groupId'})
397
+ * ```
398
+ */
399
+ blockGroupMembers(params: {
400
+ /** The group ID. */
401
+ groupId: string;
402
+ /** The array of member's user IDs to be added to the blocklist. */
403
+ usernames: UserId[];
404
+ }): Promise<AsyncResult<GroupTypes.GroupRequestResult[]>>;
405
+
406
+ /**
407
+ * Removes a member from the group blocklist. Only the group admin can call this method. Members who have been removed from the blocklist will receive "operation: 'unblockMember'" in the callback of onGroupEvent.
408
+ *
409
+ * ```typescript
410
+ * connection.unblockGroupMember({groupId: 'groupId', username: 'user'})
411
+ * ```
412
+ */
413
+ unblockGroupMember(params: {
414
+ /** The group ID. */
415
+ groupId: string;
416
+ /** The user ID of the member to be removed from the blocklist. */
417
+ username: string;
418
+ }): Promise<AsyncResult<GroupTypes.GroupRequestResult>>;
419
+
420
+ /**
421
+ * Removes members from the group blocklist in bulk. Only the group owner or admin can call this method. Members who are removed from the blocklist will receive "operation: 'unblockMember'" in the callback of onGroupEvent.
422
+ *
423
+ * ```typescript
424
+ * connection.unblockGroupMembers({groupId: 'groupId', usernames: ['user1', 'user2']})
425
+ * ```
426
+ */
427
+ unblockGroupMembers(params: {
428
+ /** The group ID. */
429
+ groupId: string;
430
+ /** The array of members‘ user IDs to be removed from the group blocklist. */
431
+ usernames: UserId[];
432
+ }): Promise<AsyncResult<GroupTypes.GroupRequestResult[]>>;
433
+
434
+ /**
435
+ * Gets the group blocklist.
436
+ *
437
+ * ```typescript
438
+ * connection.getGroupBlocklist({groupId: 'groupId'})
439
+ * ```
440
+ */
441
+ getGroupBlocklist(params: {
442
+ /** The group ID. */
443
+ groupId: string;
444
+ }): Promise<AsyncResult<UserId[]>>;
445
+
446
+ /**
447
+ * Mutes all members. Only the group admin or above can call this method. Group members will receive "operation: 'muteAllMembers'" in the callback of onGroupEvent.
448
+ *
449
+ * ```typescript
450
+ * connection.disableSendGroupMsg({groupId: 'groupId'})
451
+ * ```
452
+ */
453
+ disableSendGroupMsg(params: {
454
+ /** The group ID. */
455
+ groupId: string;
456
+ }): Promise<
457
+ AsyncResult<{
458
+ mute: true;
459
+ }>
460
+ >;
461
+
462
+ /**
463
+ * Unmute all members. Only the group admin or above can call this method. Group members will receive "operation: 'unmuteAllMembers'" in the callback of onGroupEvent.
464
+ *
465
+ * ```typescript
466
+ * connection.enableSendGroupMsg({groupId: 'groupId'})
467
+ * ```
468
+ */
469
+ enableSendGroupMsg(params: {
470
+ /** The group ID. */
471
+ groupId: string;
472
+ }): Promise<
473
+ AsyncResult<{
474
+ mute: false;
475
+ }>
476
+ >;
477
+
478
+ /**
479
+ * 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.
480
+ *
481
+ * ```typescript
482
+ * connection.addUsersToGroupAllowlist({groupId: 'groupId'})
483
+ * ```
484
+ */
485
+ addUsersToGroupAllowlist(params: {
486
+ /** The group ID. */
487
+ groupId: string;
488
+ /** An array of member IDs to be added to the allowlist. */
489
+ users: UserId[];
490
+ }): Promise<AsyncResult<GroupTypes.GroupRequestResult[]>>;
491
+
492
+ /**
493
+ * Removes a member from the group allowlist. Only the group admin or above can call this method. The user that is removed from the group allowlist will receive "operation:'removeAllowlistMember'" in the callback of onGroupEvent.
494
+ *
495
+ * ```typescript
496
+ * connection.removeGroupAllowlistMember({groupId: 'groupId', userName: 'user1'})
497
+ * ```
498
+ */
499
+ removeGroupAllowlistMember(params: {
500
+ /** The group ID. */
501
+ groupId: string;
502
+ /** The ID of the member to be removed from the group allowlist. */
503
+ userName: UserId;
504
+ }): Promise<AsyncResult<GroupTypes.GroupRequestResult>>;
505
+
506
+ /**
507
+ * Gets the group allowlist. Only the group admin or above can call this method.
508
+ *
509
+ * ```typescript
510
+ * connection.getGroupAllowlist({groupId: 'groupId'})
511
+ * ```
512
+ */
513
+ getGroupAllowlist(params: {
514
+ /** The group ID. */
515
+ groupId: string;
516
+ }): Promise<AsyncResult<UserId[]>>;
517
+
518
+ /**
519
+ * Checks whether the current member is on the allowlist. The app admin can check all users; app users can only check themselves.
520
+ *
521
+ * ```typescript
522
+ * connection.isInGroupAllowlist({groupId: 'groupId', userName: 'user1'})
523
+ * ```
524
+ */
525
+ isInGroupAllowlist(params: {
526
+ /** The group ID. */
527
+ groupId: string;
528
+ /** The user ID to query. */
529
+ userName: UserId;
530
+ }): Promise<AsyncResult<GroupTypes.IsInGroupWhiteListResult>>;
531
+
532
+ /**
533
+ * Checks which members have read group message. This is a [value-added function] and .
534
+ *
535
+ * ```typescript
536
+ * connection.getGroupMsgReadUser({groupId: 'groupId', msgId: 'msgId'})
537
+ * ```
538
+ */
539
+ getGroupMsgReadUser(params: {
540
+ /** The group ID. */
541
+ groupId: string;
542
+ /** The ID of message to query. */
543
+ msgId: string;
544
+ }): Promise<AsyncResult<GroupTypes.GetGroupMsgReadUserResult>>;
545
+
546
+ /**
547
+ * Gets the group announcement.
548
+ *
549
+ * ```typescript
550
+ * connection.fetchGroupAnnouncement({groupId: 'groupId'})
551
+ * ```
552
+ */
553
+ fetchGroupAnnouncement(params: {
554
+ /** The group ID. */
555
+ groupId: string;
556
+ }): Promise<
557
+ AsyncResult<{
558
+ /** The group announcement. */
559
+ announcement: string;
560
+ }>
561
+ >;
562
+
563
+ /**
564
+ * Updates the group announcement.
565
+ *
566
+ * ```typescript
567
+ * connection.updateGroupAnnouncement({groupId: 'groupId', announcement: 'hello'})
568
+ * ```
569
+ */
570
+ updateGroupAnnouncement(params: {
571
+ /** The group ID. */
572
+ groupId: string;
573
+ /** The group announcement. */
574
+ announcement: string;
575
+ }): Promise<AsyncResult<GroupTypes.UpdateGroupAnnouncementResult>>;
576
+
577
+ /**
578
+ * Uploads shared files to the group.
579
+ *
580
+ * ```typescript
581
+ * connection.uploadGroupSharedFile({groupId: 'groupId', file: 'file object', onFileUploadProgress: onFileUploadProgress, onFileUploadComplete: onFileUploadComplete,onFileUploadError:onFileUploadError,onFileUploadCanceled:onFileUploadCanceled})
582
+ * ```
583
+ */
584
+ uploadGroupSharedFile(params: {
585
+ /** The group ID. */
586
+ groupId: string;
587
+ /** The shared file object to upload. */
588
+ file: object;
589
+ /** The upload progress callback. */
590
+ onFileUploadProgress?: (data: ProgressEvent) => void;
591
+ /** The upload completion callback. */
592
+ onFileUploadComplete?: (data: any) => void;
593
+ /** The upload failure callback. */
594
+ onFileUploadError?: (data: any) => void;
595
+ /** The upload cancellation callback. */
596
+ onFileUploadCanceled?: (data: any) => void;
597
+ }): void;
598
+
599
+ /**
600
+ * Deletes shared files of the group.
601
+ *
602
+ * ```typescript
603
+ * connection.deleteGroupSharedFile({groupId: 'groupId', fileId: 'fileId'})
604
+ * ```
605
+ */
606
+ deleteGroupSharedFile(params: {
607
+ /** The group ID. */
608
+ groupId: string;
609
+ /** The shared file ID. */
610
+ fileId: string;
611
+ }): Promise<AsyncResult<GroupTypes.DeleteGroupSharedFileResult>>;
612
+
613
+ /**
614
+ * Gets a list of shared files in the group.
615
+ *
616
+ * ```typescript
617
+ * connection.getGroupSharedFilelist({groupId: 'groupId'})
618
+ * ```
619
+ */
620
+ getGroupSharedFilelist(params: {
621
+ /** The group ID. */
622
+ groupId: string;
623
+ /** The page number, starting from 1. */
624
+ pageNum: number;
625
+ /** The number of members per page. The value cannot exceed 10. */
626
+ pageSize: number;
627
+ }): Promise<AsyncResult<GroupTypes.FetchGroupSharedFileListResult>>;
628
+
629
+ /**
630
+ * Down load group file.
631
+ * ```typescript
632
+ * connection.downloadGroupSharedFile({groupId: 'groupId', fileId: 'fileId', onFileDownloadComplete: (data)=>{console.log(data)}})
633
+ * ```
634
+ */
635
+ downloadGroupSharedFile(params: {
636
+ /** The group ID. */
637
+ groupId: string;
638
+ /** The shared file ID. */
639
+ fileId: string;
640
+ /** The secret key required to download the file. */
641
+ secret?: string;
642
+ onFileDownloadComplete?: (data: Blob) => void;
643
+ onFileDownloadError?: (err: ErrorEvent) => void;
644
+ }): void;
645
+ }