easemob-websdk 4.1.1 → 4.1.2

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
@@ -137,6 +137,21 @@ export declare namespace EasemobChat {
137
137
  parentId?: string;
138
138
  }
139
139
 
140
+ interface RoamingDeleteMultiDeviceInfo {
141
+ /** Event name of multi device event. */
142
+ operation: 'deleteRoaming';
143
+ /** The target user ID or group ID. */
144
+ conversationId: string;
145
+ /** The chat type. */
146
+ chatType: 'singleChat' | 'groupChat';
147
+ /** The client resource. */
148
+ resource: string;
149
+ }
150
+
151
+ type MultiDeviceEvent =
152
+ | ThreadMultiDeviceInfo
153
+ | RoamingDeleteMultiDeviceInfo;
154
+
140
155
  interface ConnectionParameters {
141
156
  /** The unique application key registered in console. */
142
157
  appKey: string;
@@ -566,6 +581,31 @@ export declare namespace EasemobChat {
566
581
  /** The time stamp of file upload. */
567
582
  created: number;
568
583
  }
584
+
585
+ interface GroupModifyInfo {
586
+ /** The name of a group. */
587
+ name?: string;
588
+ /** The description of a group. */
589
+ description?: string;
590
+ /** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `listgroups`. */
591
+ public?: boolean;
592
+ /** Whether a user requires the approval from the group owner or admin to join the group. -`true`: Yes; -`false`: No. */
593
+ approval?: boolean;
594
+ /** Whether to allow group members to invite others to join the group. */
595
+ allowInvites?: boolean;
596
+ /** The maximum number of group members */
597
+ maxUsers?: number;
598
+ /** Whether the invitee needs to accept the invitation before joining the group.
599
+ - `true`: The invitee's consent is required. The default value is `true`.
600
+ - `false`: The invitee will be directly added to the group without confirmation.
601
+ */
602
+ inviteNeedConfirm?: boolean;
603
+ /** Group detail extensions. */
604
+ ext?: string;
605
+ /** Last Modified Timestamp. */
606
+ lastModified?: number;
607
+ }
608
+
569
609
  // The group api result end.
570
610
 
571
611
  // The contact api start.
@@ -697,11 +737,6 @@ export declare namespace EasemobChat {
697
737
  };
698
738
  }
699
739
 
700
- interface PublishPresenceResult {
701
- /** The result of publish. */
702
- result: 'ok';
703
- }
704
-
705
740
  interface SubscribePresence {
706
741
  /** The expiration time of the presence subscription. */
707
742
  expiry: number;
@@ -1485,7 +1520,10 @@ export declare namespace EasemobChat {
1485
1520
  ): Promise<AsyncResult<AddUsersToChatRoomResult>>;
1486
1521
 
1487
1522
  /**
1488
- * Joins the chat room. After a user joins successfully, other members in the chat room will receive operation: 'memberPresence' in the onChatroomEvent callback.
1523
+ * Joins the chat room.
1524
+ *
1525
+ * @note
1526
+ * After a user joins successfully, other members in the chat room will receive operation: 'memberPresence' in the onChatroomEvent callback.
1489
1527
  *
1490
1528
  * ```typescript
1491
1529
  * connection.joinChatRoom({roomId: 'roomId'})
@@ -1496,7 +1534,7 @@ export declare namespace EasemobChat {
1496
1534
  params: {
1497
1535
  /** The chat room ID. */
1498
1536
  roomId: string;
1499
- /** The reason for joining the chat room. It is optional. It is only used for groups. */
1537
+ /** The reason for joining the chat room. Not enabled. */
1500
1538
  message?: string;
1501
1539
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1502
1540
  error?: (error: ErrorEvent) => void;
@@ -1505,7 +1543,13 @@ export declare namespace EasemobChat {
1505
1543
 
1506
1544
  /**
1507
1545
  * @deprecated Use {@link leaveChatRoom} instead.
1508
- * Exits chat room. And others will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1546
+ * Exits the chat room.
1547
+ *
1548
+ * @note
1549
+ * When a member exits the chat room, other members will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1550
+ *
1551
+ * ```typescript
1552
+ * connection.leaveChatRoom({roomId: 'roomId'}
1509
1553
  *
1510
1554
  * ```typescript
1511
1555
  * connection.quitChatRoom({roomId: 'roomId'})
@@ -1522,7 +1566,10 @@ export declare namespace EasemobChat {
1522
1566
  ): Promise<AsyncResult<{ result: boolean }>>;
1523
1567
 
1524
1568
  /**
1525
- * Exits chat room. And others will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1569
+ * Exits the chat room.
1570
+ *
1571
+ * @note
1572
+ * When a member exits the chat room, other members will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1526
1573
  *
1527
1574
  * ```typescript
1528
1575
  * connection.leaveChatRoom({roomId: 'roomId'})
@@ -1592,7 +1639,10 @@ export declare namespace EasemobChat {
1592
1639
  ): Promise<AsyncResult<GetChatRoomAdminResult>>;
1593
1640
 
1594
1641
  /**
1595
- * Sets a user as chat room admin. Only the chat room owner can call this method. The members who are set as admins will receive "operation: 'setAdmin'" in the callback of onChatroomEvent.
1642
+ * Sets a member as the chat room admin.
1643
+ *
1644
+ * @note
1645
+ * Only the chat room owner can call this method. The new admin will receive "operation: 'setAdmin'" in the callback of `onChatroomEvent`.
1596
1646
  *
1597
1647
  * ```typescript
1598
1648
  * connection.setChatRoomAdmin({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1611,7 +1661,10 @@ export declare namespace EasemobChat {
1611
1661
  ): Promise<AsyncResult<SetChatRoomAdminResult>>;
1612
1662
 
1613
1663
  /**
1614
- * Removes chat room admins. Only the chat room owner can call this method. The users whose admin privileges are removed will receive "operation: 'removeAdmin'" in the callback of onChatroomEvent.
1664
+ * Removes chat room admins.
1665
+ *
1666
+ * @note
1667
+ * Only the chat room owner can call this method. The users whose admin privileges are removed will receive "operation: 'removeAdmin'" in the callback of `onChatroomEvent`.
1615
1668
  *
1616
1669
  * ```typescript
1617
1670
  * connection.removeChatRoomAdmin({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1630,7 +1683,10 @@ export declare namespace EasemobChat {
1630
1683
  ): Promise<AsyncResult<RemoveChatRoomAdminResult>>;
1631
1684
 
1632
1685
  /**
1633
- * Mutes chat room member. Only the chat room owner can call this method. The muted member and other members will receive "operation:'muteMember'" in the callback of onChatroomEvent.
1686
+ * Mutes chat room member.
1687
+ *
1688
+ * @note
1689
+ * Only the chat room owner or admins can call this method. The muted member and other admins will receive "operation:'muteMember'" in the callback of `onChatroomEvent`.
1634
1690
  *
1635
1691
  * ```typescript
1636
1692
  * connection.muteChatRoomMember({username: 'user1', muteDuration: -1, chatRoomId: 'chatRoomId'})
@@ -1641,7 +1697,7 @@ export declare namespace EasemobChat {
1641
1697
  params: {
1642
1698
  /** The member to be muted in the chat room. */
1643
1699
  username: string;
1644
- /** The mute duration in milliseconds. The value -1 indicates that the member is muted permanently. */
1700
+ /** The mute duration in milliseconds. The value `-1` indicates that the member is muted permanently. */
1645
1701
  muteDuration: number;
1646
1702
  /** The chat room ID. */
1647
1703
  chatRoomId: string;
@@ -1650,7 +1706,17 @@ export declare namespace EasemobChat {
1650
1706
  }
1651
1707
  ): Promise<AsyncResult<MuteChatRoomMemberResult>>;
1652
1708
 
1653
- /** @deprecated */
1709
+ /**
1710
+ * @deprecated Use {@link unmuteChatRoomMember} instead.
1711
+ * Unmutes the chat room member.
1712
+ *
1713
+ * @note
1714
+ * Only the chat room owner or admins can call this method. The members who are unmuted and other admins will receive "operation: 'unmuteMember'" in the callback of onChatroomEvent.
1715
+ *
1716
+ * ```typescript
1717
+ * connection.removeMuteChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
1718
+ * ```
1719
+ */
1654
1720
  removeMuteChatRoomMember(
1655
1721
  this: Connection,
1656
1722
  params: {
@@ -1666,11 +1732,14 @@ export declare namespace EasemobChat {
1666
1732
  ): Promise<AsyncResult<UnmuteChatRoomMemberResult[]>>;
1667
1733
 
1668
1734
  /**
1669
- * Unmute the chat room member. Only the chatroom owner can call this method. The members who are muted and others will receive "operation: 'unmuteMember'" in the callback of onChatroomEvent.
1735
+ * Unmutes the chat room member.
1736
+ *
1737
+ * @note
1738
+ * Only the chat room owner can call this method. The members who are unmuted and other admins will receive "operation: 'unmuteMember'" in the callback of onChatroomEvent.
1670
1739
  *
1671
1740
  * ```typescript
1672
1741
  * connection.unmuteChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
1673
- * `
1742
+ * ```
1674
1743
  */
1675
1744
  unmuteChatRoomMember(
1676
1745
  this: Connection,
@@ -1738,7 +1807,14 @@ export declare namespace EasemobChat {
1738
1807
  }
1739
1808
  ): Promise<AsyncResult<GetChatRoomMuteListResult[]>>;
1740
1809
 
1741
- /** @deprecated */
1810
+ /**
1811
+ * @deprecated Use {@link blockChatRoomMember} instead.
1812
+ * Adds a member to the the block list of the chat room. Only the chat room owner or admin can call this method.
1813
+ *
1814
+ * ```typescript
1815
+ * connection.chatRoomBlockSingle({chatRoomId: 'chatRoomId', username: 'user1'})
1816
+ * ```
1817
+ */
1742
1818
  chatRoomBlockSingle(
1743
1819
  this: Connection,
1744
1820
  params: {
@@ -1752,7 +1828,7 @@ export declare namespace EasemobChat {
1752
1828
  ): Promise<AsyncResult<CommonRequestResult>>;
1753
1829
 
1754
1830
  /**
1755
- * Adds a member to the chat room blocklist. Only the chat room owner or admin can call this method.
1831
+ * Adds a member to the the block list of the chat room. Only the chat room owner or admin can call this method.
1756
1832
  *
1757
1833
  * ```typescript
1758
1834
  * connection.blockChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1784,7 +1860,7 @@ export declare namespace EasemobChat {
1784
1860
  ): Promise<AsyncResult<CommonRequestResult[]>>;
1785
1861
 
1786
1862
  /**
1787
- * Adds members to the chat room blocklist. Only the chat room owner or admin can call this method.
1863
+ * Adds members to the block list of the chat room. Only the chat room owner or admin can call this method.
1788
1864
  *
1789
1865
  * ```typescript
1790
1866
  * connection.blockChatRoomMembers({usernames: ['user1', 'user2'], chatRoomId: 'chatRoomId'})
@@ -1816,7 +1892,7 @@ export declare namespace EasemobChat {
1816
1892
  ): Promise<AsyncResult<CommonRequestResult>>;
1817
1893
 
1818
1894
  /**
1819
- * Removes an individual user from the chat room blocklist. Only the chatroom owner or admin can call this method.
1895
+ * Removes a member from the block list of the chat room. Only the chat room owner or admin can call this method.
1820
1896
  *
1821
1897
  * ```typescript
1822
1898
  * connection.unblockChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1827,7 +1903,7 @@ export declare namespace EasemobChat {
1827
1903
  params: {
1828
1904
  /** The chat room ID. */
1829
1905
  chatRoomId: string;
1830
- /** The member to be removed from the blocklist. */
1906
+ /** The member to be removed from the block list. */
1831
1907
  username: string;
1832
1908
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1833
1909
  error?: (error: ErrorEvent) => void;
@@ -1848,7 +1924,10 @@ export declare namespace EasemobChat {
1848
1924
  ): Promise<AsyncResult<CommonRequestResult[]>>;
1849
1925
 
1850
1926
  /**
1851
- * Removes members from the chat room blocklist. Only the chatroom owner or admin can call this method.
1927
+ * Removes a member from the the block list of the chat room.
1928
+ *
1929
+ * @note
1930
+ * Only the chat room owner or admin can call this method.
1852
1931
  *
1853
1932
  * ```typescript
1854
1933
  * connection.unblockChatRoomMembers({chatRoomId: 'chatRoomId', usernames: ['user1', 'user2']})
@@ -1878,7 +1957,7 @@ export declare namespace EasemobChat {
1878
1957
  ): Promise<AsyncResult<UserId[]>>;
1879
1958
 
1880
1959
  /**
1881
- * Gets the blocklist of the chat room.
1960
+ * Gets the block list of the chat room.
1882
1961
  *
1883
1962
  * ```typescript
1884
1963
  * connection.getChatRoomBlacklist({chatRoomId: 'chatRoomId'})
@@ -2256,6 +2335,8 @@ export declare namespace EasemobChat {
2256
2335
  inviteNeedConfirm: boolean;
2257
2336
  /** The group max users. */
2258
2337
  maxusers: number;
2338
+ /** Group detail extensions which can be in the JSON format to contain more group information. */
2339
+ ext?: string;
2259
2340
  };
2260
2341
  success?: (res: AsyncResult<CreateGroupResult>) => void;
2261
2342
  error?: (error: ErrorEvent) => void;
@@ -2303,6 +2384,8 @@ export declare namespace EasemobChat {
2303
2384
  inviteNeedConfirm: boolean;
2304
2385
  /** The group max users. */
2305
2386
  maxusers: number;
2387
+ /** Group detail extensions which can be in the JSON format to contain more group information. */
2388
+ ext?: string;
2306
2389
  };
2307
2390
  success?: (res: AsyncResult<CreateGroupResult>) => void;
2308
2391
  error?: (error: ErrorEvent) => void;
@@ -2394,20 +2477,44 @@ export declare namespace EasemobChat {
2394
2477
  /**
2395
2478
  * Lists all the groups a user has joined.
2396
2479
  *
2480
+ * @note
2481
+ * If either `needAffiliations` or `needAffiliations` is set, when you get data with pagination, the current page number (pageNum) starts from 0 and you can get a maximum of 20 groups (pageSize) on each page.
2482
+ *
2483
+ * If neither of the parameters is set, when you get data with pagination, the current page number (pageNum) starts from 1 and you can get a maximum of 500 groups (pageSize) on each page.
2484
+ *
2397
2485
  * ```typescript
2398
- * connection.getJoinedGroups()
2486
+ * connection.getJoinedGroups({
2487
+ * pageNum: 1,
2488
+ * pageSize: 500,
2489
+ * needAffiliations: false,
2490
+ * needRole: false
2491
+ * })
2399
2492
  * ```
2400
2493
  */
2401
2494
  getJoinedGroups(
2402
2495
  this: Connection,
2403
2496
  params: {
2404
- /** The current page number. */
2497
+ /**
2498
+ * If either `needAffiliations` or `needAffiliations` is set, when you get data with pagination, the current page number (pageNum) starts from 0.
2499
+ *
2500
+ * If neither of the parameters is set, when you get data with pagination, the current page number (pageNum) starts from 1.
2501
+ * */
2405
2502
  pageNum: number;
2406
- /** The number of group per page. */
2503
+ /**
2504
+ * If either `needAffiliations` or `needAffiliations` is set, when you get data with pagination, you can get a maximum of 20 groups (pageSize) on each page.
2505
+ *
2506
+ * If neither of the parameters is set, when you get data with pagination, you can get a maximum of 500 groups (pageSize) on each page.
2507
+ * */
2407
2508
  pageSize: number;
2408
- /** Whether the number of group members is required. */
2509
+ /** Whether the number of group members is required.
2510
+ * `true`: Yes;
2511
+ * (Default)`false`: No.
2512
+ */
2409
2513
  needAffiliations?: boolean;
2410
- /** Whether the role of the account in the group is required. */
2514
+ /** Whether the role of the current user in the group is required.
2515
+ * `true`: Yes;
2516
+ * (Default)`false`: No.
2517
+ */
2411
2518
  needRole?: boolean;
2412
2519
  success?: (res: AsyncResult<BaseGroupInfo[]>) => void;
2413
2520
  error?: (error: ErrorEvent) => void;
@@ -2475,9 +2582,11 @@ export declare namespace EasemobChat {
2475
2582
  /** The Group ID. */
2476
2583
  groupId: string;
2477
2584
  /** The group name. */
2478
- groupName: string;
2585
+ groupName?: string;
2479
2586
  /** The group description. */
2480
- description: string;
2587
+ description?: string;
2588
+ /** Group detail extensions which can be in the JSON format to contain more group information. */
2589
+ ext?: string;
2481
2590
  success?: (res: AsyncResult<ModifyGroupResult>) => void;
2482
2591
  error?: (error: ErrorEvent) => void;
2483
2592
  }
@@ -3872,6 +3981,33 @@ export declare namespace EasemobChat {
3872
3981
  }
3873
3982
  ): Promise<HistoryMessages>;
3874
3983
 
3984
+ /**
3985
+ * Delete roaming messages.
3986
+ *
3987
+ * ```typescript
3988
+ * connection.removeHistoryMessages({targetId: 'userId', chatType: 'singleChat', time: Date.now()})
3989
+ *
3990
+ * connection.removeHistoryMessages({targetId: 'userId', chatType: 'singleChat', messageIds: ['messageId']})
3991
+ * ```
3992
+ */
3993
+ removeHistoryMessages(
3994
+ this: Connection,
3995
+ options: {
3996
+ /** The ID of the peer user or group. */
3997
+ targetId: string;
3998
+ /**
3999
+ * conversation type:
4000
+ * - `singleChat`: single chat;
4001
+ * - `groupChat`: group chat.
4002
+ */
4003
+ chatType: 'singleChat' | 'groupChat';
4004
+ /** List of message IDs to be deleted, The number of IDs cannot exceed 20. */
4005
+ messageIds?: Array<string>;
4006
+ /** The starting point in time to delete the message. */
4007
+ beforeTimeStamp?: number;
4008
+ }
4009
+ ): Promise<void>;
4010
+
3875
4011
  /**
3876
4012
  * Adds a friend.
3877
4013
  *
@@ -4075,9 +4211,9 @@ export declare namespace EasemobChat {
4075
4211
  publishPresence(params: {
4076
4212
  /** The extension description information of the presence state. It can be set as nil. */
4077
4213
  description: string;
4078
- success?: (res: AsyncResult<PublishPresenceResult>) => void;
4214
+ success?: () => void;
4079
4215
  error?: (error: ErrorEvent) => void;
4080
- }): Promise<AsyncResult<PublishPresenceResult>>;
4216
+ }): Promise<void>;
4081
4217
 
4082
4218
  /**
4083
4219
  * Subscribes to a user's presence states. If the subscription succeeds, the subscriber will receive the callback when the user's presence state changes.
@@ -4105,9 +4241,9 @@ export declare namespace EasemobChat {
4105
4241
  unsubscribePresence(params: {
4106
4242
  /** The array of IDs of users whose presence states you want to unsubscribe from. */
4107
4243
  usernames: UserId[];
4108
- success?: (res: AsyncResult<PublishPresenceResult>) => void;
4244
+ success?: () => void;
4109
4245
  error?: (error: ErrorEvent) => void;
4110
- }): Promise<AsyncResult<PublishPresenceResult>>;
4246
+ }): Promise<void>;
4111
4247
 
4112
4248
  /**
4113
4249
  * @deprecated Use {@link getSubscribedPresencelist} instead.
@@ -4633,7 +4769,7 @@ export declare namespace EasemobChat {
4633
4769
  * Get the chat room all properties.
4634
4770
  *
4635
4771
  * ```typescript
4636
- * connection.getChatRoomAttributes({chatRoomId: 'roomId')
4772
+ * connection.getChatRoomAttributes({chatRoomId: 'roomId', attributeKeys:['attributeKey1'])
4637
4773
  * ```
4638
4774
  */
4639
4775
  getChatRoomAttributes(
@@ -4658,7 +4794,7 @@ export declare namespace EasemobChat {
4658
4794
  params: {
4659
4795
  /** The chat room ID. */
4660
4796
  chatRoomId: string;
4661
- /** The attributes. */
4797
+ /** The map of custom chat room attributes. */
4662
4798
  attributes: {
4663
4799
  [key: string]: string;
4664
4800
  };
@@ -4666,7 +4802,7 @@ export declare namespace EasemobChat {
4666
4802
  * (Default)`true`: Yes.
4667
4803
  * `false`: No. */
4668
4804
  autoDelete?: boolean;
4669
- /** Whether to allow a member to overwrite the chat room attribute set by another member.
4805
+ /** Whether to allow a member to overwrite custom chat room attributes set by others.
4670
4806
  * `true`: Yes.
4671
4807
  * (Default)`false`: No. */
4672
4808
  isForced?: boolean;
@@ -4674,7 +4810,7 @@ export declare namespace EasemobChat {
4674
4810
  ): Promise<AsyncResult<ChatroomAttributes>>;
4675
4811
 
4676
4812
  /**
4677
- * Set chat room properties individually.
4813
+ * Sets a custom chat room attribute.
4678
4814
  *
4679
4815
  * ```typescript
4680
4816
  * connection.setChatroomAttribute({chatRoomId: 'roomId', attributeKey:"key1", attributeValue:"value1", autoDelete: true, isForced: false})
@@ -4685,9 +4821,15 @@ export declare namespace EasemobChat {
4685
4821
  params: {
4686
4822
  /** The chat room ID. */
4687
4823
  chatRoomId: string;
4688
- /** The custom attribute key. */
4824
+ /**
4825
+ * The chat room attribute key. A single key cannot exceed 128 characters; the total number of keys in a chat room cannot exceed 100. The following character sets are supported:
4826
+ * - 26 lowercase English letters (a-z)
4827
+ * - 26 uppercase English letters (A-Z)
4828
+ * - 10 numbers (0-9)
4829
+ * - "_", "-", "."
4830
+ */
4689
4831
  attributeKey: string;
4690
- /** The custom attribute value. */
4832
+ /** The chat room attribute value. The attribute value can contain a maximum of 4096 characters. The total length of custom chat room attributes cannot exceed 10 GB for each app.*/
4691
4833
  attributeValue: string;
4692
4834
  /**
4693
4835
  * Whether to delete chat room attributes set by the member when he or she exits the chat room.
@@ -4705,7 +4847,7 @@ export declare namespace EasemobChat {
4705
4847
  ): Promise<void>;
4706
4848
 
4707
4849
  /**
4708
- * Batch remove chat room attributes.
4850
+ * Removes custom chat room attributes.
4709
4851
  *
4710
4852
  * ```typescript
4711
4853
  * connection.removeChatRoomAttributes({chatRoomId: 'roomId', attributeKeys: ['key1','key2',...], isForced: false })
@@ -4716,10 +4858,9 @@ export declare namespace EasemobChat {
4716
4858
  params: {
4717
4859
  /** The chat room ID. */
4718
4860
  chatRoomId: string;
4719
- /** The key of the chat room attribute to delete. */
4720
- attributeKey: string;
4721
- /**
4722
- * Whether to allow a member to delete any chat room attribute set by any member.
4861
+ /** The maximum number of keys to delete is 10. */
4862
+ attributeKeys: Array<string>;
4863
+ /** Whether to allow chat room members to delete all of the chat room attributes.
4723
4864
  * - `true`: Yes;
4724
4865
  * - (Default)`false`: No.
4725
4866
  */
@@ -4739,9 +4880,13 @@ export declare namespace EasemobChat {
4739
4880
  params: {
4740
4881
  /** The chat room ID. */
4741
4882
  chatRoomId: string;
4742
- /** Delete attribute key. */
4883
+ /** The key of the chat room attribute to delete. */
4743
4884
  attributeKey: string;
4744
- /** remove chatRoom attributes (Allow to delete all contents of the chat room). */
4885
+ /**
4886
+ * Whether to allow a member to delete any chat room attribute set by any member.
4887
+ * - `true`: Yes;
4888
+ * - (Default)`false`: No.
4889
+ */
4745
4890
  isForced?: boolean;
4746
4891
  }
4747
4892
  ): Promise<void>;
@@ -4780,10 +4925,9 @@ export declare namespace EasemobChat {
4780
4925
  id: string;
4781
4926
  /** Message sender. */
4782
4927
  from: string;
4783
- /** Message receiver. */
4928
+ /** Additional data for the operation event. */
4784
4929
  data?: any;
4785
- /** ChatRoom Attributes. */
4786
- /** 聊天室属性。 */
4930
+ /** ChatRoom attributes. */
4787
4931
  attributes?: {
4788
4932
  [key: string]: string;
4789
4933
  };
@@ -4845,6 +4989,119 @@ export declare namespace EasemobChat {
4845
4989
  | 'onGroupEvent'
4846
4990
  | 'onChatroomEvent';
4847
4991
 
4992
+ interface GroupEvent {
4993
+ /** The type of operation. <br/>
4994
+ * destroy: Occurs when the group was destroyed.<br/>
4995
+ * requestToJoin: Occurs when someone applied to join the group. Only the group owner and administrator will receive this event. <br/>
4996
+ * acceptRequest: Occurs when your group adding application is approved. Only the person who applies for group will receive this event.<br/>
4997
+ * inviteToJoin: Occurs when you receive an invitation to join a group. <br/>
4998
+ * acceptInvite: Occurs when someone accepted your invitation to join the group. <br/>
4999
+ * rejectInvite: Occurs when someone refused your invitation to join the group. <br/>
5000
+ * removeMember: Occurs when you are removed from a group or added to block list. Only the removed person receives this event.<br/>
5001
+ * unblockMember: Occurs when being removed from the block list. Only the removed person receives this event.<br/>
5002
+ * updateInfo: Occurs when modifying group. <br/>
5003
+ * memberPresence: Occurs when someone joined the group. <br/>
5004
+ * memberAbsence: Occurs when someone leaved the group. <br/>
5005
+ * directJoined: Occurs when you are directly pulled into the group and no consent is required. <br/>
5006
+ * changeOwner: Occurs when transferring group. Only new and old group owners can receive this event. <br/>
5007
+ * setAdmin: Occurs when being set as administrator. Only the person who is set to administrator can receive this event.<br/>
5008
+ * removeAdmin: Occurs when you are removed as an administrator. Only the removed person can receive this event. <br/>
5009
+ * muteMember: Occurs when you are muted. Only the person who is muted can receive this event. <br/>
5010
+ * unmuteMember: Occurs when you are unmuted. Only the person who is unmuted can receive this event. <br/>
5011
+ * updateAnnouncement: Occurs when the group announcement was updated. <br/>
5012
+ * deleteAnnouncement: Occurs when the group announcement was deleted. <br/>
5013
+ * uploadFile: Occurs when a shared file is uploaded. <br/>
5014
+ * deleteFile: Occurs when a shared file is deleted. <br/>
5015
+ * addUserToAllowlist: Occurs when being added to the allow list. <br/>
5016
+ * removeAllowlistMember: Occurs when being removed from the allow list. <br/>
5017
+ * muteAllMembers: Occurs when the group was set with a ban for all members. <br/>
5018
+ * unmuteAllMembers: Occurs when the group lifted the ban. <br/>
5019
+ */
5020
+ operation:
5021
+ | 'destroy'
5022
+ | 'removeMember'
5023
+ | 'unblockMember'
5024
+ | 'updateInfo'
5025
+ | 'memberPresence'
5026
+ | 'memberAbsence'
5027
+ | 'setAdmin'
5028
+ | 'removeAdmin'
5029
+ | 'muteMember'
5030
+ | 'unmuteMember'
5031
+ | 'updateAnnouncement'
5032
+ | 'deleteAnnouncement'
5033
+ | 'uploadFile'
5034
+ | 'deleteFile'
5035
+ | 'addUserToAllowlist'
5036
+ | 'removeAllowlistMember'
5037
+ | 'muteAllMembers'
5038
+ | 'unmuteAllMembers'
5039
+ | 'updateChatRoomAttributes'
5040
+ | 'removeChatRoomAttributes';
5041
+ /** The ID of a group. */
5042
+ id: string;
5043
+ /** Message sender. */
5044
+ from: string;
5045
+ /** The name of a group. */
5046
+ name?: string;
5047
+ /** The modified group info. */
5048
+ detail?: GroupModifyInfo;
5049
+ }
5050
+
5051
+ interface ChatroomEvent {
5052
+ /** The type of operation. <br/>
5053
+ * destroy: Occurs when the chat room was destroyed.<br/>
5054
+ * removeMember: Occurs when you are removed from a chat room or added to block list. Only the removed person receives this event.<br/>
5055
+ * unblockMember: Occurs when being removed from the block list. Only the removed person receives this event.<br/>
5056
+ * updateInfo: Occurs when modifying chat room. <br/>
5057
+ * memberPresence: Occurs when someone joined the chat room. <br/>
5058
+ * memberAbsence: Occurs when someone leaved the chat room. <br/>
5059
+ * setAdmin: Occurs when being set as administrator. Only the person who is set to administrator can receive this event.<br/>
5060
+ * removeAdmin: Occurs when you are removed as an administrator. Only the removed person can receive this event. <br/>
5061
+ * muteMember: Occurs when you are muted. Only the person who is muted can receive this event. <br/>
5062
+ * unmuteMember: Occurs when you are unmuted. Only the person who is unmuted can receive this event. <br/>
5063
+ * updateAnnouncement: Occurs when the chat room announcement was updated. <br/>
5064
+ * deleteAnnouncement: Occurs when the chat room announcement was deleted. <br/>
5065
+ * uploadFile: Occurs when a shared file is uploaded. <br/>
5066
+ * deleteFile: Occurs when a shared file is deleted. <br/>
5067
+ * addUserToAllowlist: Occurs when being added to the allow list. <br/>
5068
+ * removeAllowlistMember: Occurs when being removed from the allow list. <br/>
5069
+ * muteAllMembers: Occurs when the chat room was set with a ban for all members. <br/>
5070
+ * unmuteAllMembers: Occurs when the chat room lifted the ban. <br/>
5071
+ * updateChatRoomAttributes: Occurs when the chat room attributes are updated. <br/>
5072
+ * removeChatRoomAttributes: when the chat room attributes are deleted. <br/>
5073
+ */
5074
+ operation:
5075
+ | 'destroy'
5076
+ | 'removeMember'
5077
+ | 'unblockMember'
5078
+ | 'updateInfo'
5079
+ | 'memberPresence'
5080
+ | 'memberAbsence'
5081
+ | 'setAdmin'
5082
+ | 'removeAdmin'
5083
+ | 'muteMember'
5084
+ | 'unmuteMember'
5085
+ | 'updateAnnouncement'
5086
+ | 'deleteAnnouncement'
5087
+ | 'uploadFile'
5088
+ | 'deleteFile'
5089
+ | 'addUserToAllowlist'
5090
+ | 'removeAllowlistMember'
5091
+ | 'muteAllMembers'
5092
+ | 'unmuteAllMembers'
5093
+ | 'updateChatRoomAttributes'
5094
+ | 'removeChatRoomAttributes';
5095
+ /** The ID of a chatroom. */
5096
+ id: string;
5097
+ /** Message sender. */
5098
+ from: string;
5099
+ /** The name of a chatroom. */
5100
+ name?: string;
5101
+ /** ChatRoom Attributes. */
5102
+ attributes?: Array<string> | { [key: string]: string };
5103
+ }
5104
+
4848
5105
  interface EventHandlerType {
4849
5106
  /** @deprecated Use { onConnected } instead. */
4850
5107
  onOpened?: (msg: any) => void;
@@ -4913,13 +5170,13 @@ export declare namespace EasemobChat {
4913
5170
  /** The callback to receive a reaction message. */
4914
5171
  onChatThreadChange?: (msg: ThreadChangeInfo) => void;
4915
5172
  /** The callback to receive a multi device event. */
4916
- onMultiDeviceEvent?: (msg: ThreadMultiDeviceInfo) => void;
5173
+ onMultiDeviceEvent?: (msg: MultiDeviceEvent) => void;
4917
5174
  /** The callback to receive a reaction message. */
4918
5175
  onReactionChange?: (msg: ReactionMessage) => void;
4919
5176
  /** The callback to receive a group event. */
4920
- onGroupEvent?: (eventData: EventData) => void;
5177
+ onGroupEvent?: (eventData: GroupEvent) => void;
4921
5178
  /** The callback to receive a chatroom event. */
4922
- onChatroomEvent?: (eventData: EventData) => void;
5179
+ onChatroomEvent?: (eventData: ChatroomEvent) => void;
4923
5180
  }
4924
5181
 
4925
5182
  interface HandlerData {
@@ -5150,6 +5407,7 @@ export declare namespace EasemobChat {
5150
5407
  owner?: string;
5151
5408
  reason?: string;
5152
5409
  kicked?: string;
5410
+ detail?: GroupModifyInfo;
5153
5411
  }
5154
5412
 
5155
5413
  interface ReadMsgSetParameters {
@@ -5361,6 +5619,8 @@ export declare namespace EasemobChat {
5361
5619
  chatThreadOverview?: ChatThreadOverview;
5362
5620
  /** Message online state type. */
5363
5621
  onlineState?: ONLINESTATETYPE;
5622
+ /** Message priority. */
5623
+ priority?: MessagePriority;
5364
5624
  }
5365
5625
 
5366
5626
  interface CreateTextMsgParameters {
@@ -5380,6 +5640,8 @@ export declare namespace EasemobChat {
5380
5640
  msgConfig?: { allowGroupAck?: boolean; languages?: string[] };
5381
5641
  /** Whether the message is a thread message. */
5382
5642
  isChatThread?: boolean;
5643
+ /** Message priority. */
5644
+ priority?: MessagePriority;
5383
5645
  }
5384
5646
 
5385
5647
  interface CmdParameters {
@@ -5444,6 +5706,8 @@ export declare namespace EasemobChat {
5444
5706
  chatThreadOverview?: ChatThreadOverview;
5445
5707
  /** Message online state type. */
5446
5708
  onlineState?: ONLINESTATETYPE;
5709
+ /** Message priority. */
5710
+ priority?: MessagePriority;
5447
5711
  }
5448
5712
 
5449
5713
  interface CreateCmdMsgParameters {
@@ -5465,6 +5729,8 @@ export declare namespace EasemobChat {
5465
5729
  msgConfig?: { allowGroupAck: boolean };
5466
5730
  /** Whether the message is a thread message. */
5467
5731
  isChatThread?: boolean;
5732
+ /** Message priority. */
5733
+ priority?: MessagePriority;
5468
5734
  }
5469
5735
 
5470
5736
  interface CustomParameters {
@@ -5534,6 +5800,8 @@ export declare namespace EasemobChat {
5534
5800
  chatThreadOverview?: ChatThreadOverview;
5535
5801
  /** Message online state type. */
5536
5802
  onlineState?: ONLINESTATETYPE;
5803
+ /** Message priority. */
5804
+ priority?: MessagePriority;
5537
5805
  }
5538
5806
 
5539
5807
  interface CreateCustomMsgParameters {
@@ -5555,6 +5823,8 @@ export declare namespace EasemobChat {
5555
5823
  msgConfig?: { allowGroupAck: boolean };
5556
5824
  /** Whether the message is a thread message. */
5557
5825
  isChatThread?: boolean;
5826
+ /** Message priority. */
5827
+ priority?: MessagePriority;
5558
5828
  }
5559
5829
 
5560
5830
  interface LocationParameters {
@@ -5632,6 +5902,8 @@ export declare namespace EasemobChat {
5632
5902
  chatThreadOverview?: ChatThreadOverview;
5633
5903
  /** Message online state type. */
5634
5904
  onlineState?: ONLINESTATETYPE;
5905
+ /** Message priority. */
5906
+ priority?: MessagePriority;
5635
5907
  }
5636
5908
 
5637
5909
  interface CreateLocationMsgParameters {
@@ -5657,6 +5929,8 @@ export declare namespace EasemobChat {
5657
5929
  msgConfig?: { allowGroupAck: boolean };
5658
5930
  /** Whether the message is a thread message. */
5659
5931
  isChatThread?: boolean;
5932
+ /** Message priority. */
5933
+ priority?: MessagePriority;
5660
5934
  }
5661
5935
 
5662
5936
  interface FileParameters {
@@ -5754,6 +6028,8 @@ export declare namespace EasemobChat {
5754
6028
  onlineState?: ONLINESTATETYPE;
5755
6029
  /** Whether the message is a thread message. */
5756
6030
  isChatThread?: boolean;
6031
+ /** Message priority. */
6032
+ priority?: MessagePriority;
5757
6033
  }
5758
6034
 
5759
6035
  interface CreateFileMsgParameters {
@@ -5794,6 +6070,8 @@ export declare namespace EasemobChat {
5794
6070
  msgConfig?: { allowGroupAck: boolean };
5795
6071
  /** Whether the message is a thread message. */
5796
6072
  isChatThread?: boolean;
6073
+ /** Message priority. */
6074
+ priority?: MessagePriority;
5797
6075
  }
5798
6076
 
5799
6077
  interface ImgParameters {
@@ -5872,6 +6150,8 @@ export declare namespace EasemobChat {
5872
6150
  chatThreadOverview?: ChatThreadOverview;
5873
6151
  /** Message online state type. */
5874
6152
  onlineState?: ONLINESTATETYPE;
6153
+ /** Message priority. */
6154
+ priority?: MessagePriority;
5875
6155
  }
5876
6156
 
5877
6157
  interface CreateImgMsgParameters {
@@ -5912,6 +6192,8 @@ export declare namespace EasemobChat {
5912
6192
  msgConfig?: { allowGroupAck: boolean };
5913
6193
  /** Whether the message is a thread message. */
5914
6194
  isChatThread?: boolean;
6195
+ /** Message priority. */
6196
+ priority?: MessagePriority;
5915
6197
  }
5916
6198
 
5917
6199
  interface AudioParameters {
@@ -5993,6 +6275,8 @@ export declare namespace EasemobChat {
5993
6275
  chatThreadOverview?: ChatThreadOverview;
5994
6276
  /** Message online state type. */
5995
6277
  onlineState?: ONLINESTATETYPE;
6278
+ /** Message priority. */
6279
+ priority?: MessagePriority;
5996
6280
  }
5997
6281
 
5998
6282
  interface CreateAudioMsgParameters {
@@ -6035,6 +6319,8 @@ export declare namespace EasemobChat {
6035
6319
  msgConfig?: { allowGroupAck: boolean };
6036
6320
  /** Whether the message is a thread message. */
6037
6321
  isChatThread?: boolean;
6322
+ /** Message priority. */
6323
+ priority?: MessagePriority;
6038
6324
  }
6039
6325
 
6040
6326
  interface VideoParameters {
@@ -6116,6 +6402,8 @@ export declare namespace EasemobChat {
6116
6402
  chatThreadOverview?: ChatThreadOverview;
6117
6403
  /** Message online state type. */
6118
6404
  onlineState?: ONLINESTATETYPE;
6405
+ /** Message priority. */
6406
+ priority?: MessagePriority;
6119
6407
  }
6120
6408
 
6121
6409
  interface CreateVideoMsgParameters {
@@ -6160,6 +6448,8 @@ export declare namespace EasemobChat {
6160
6448
  msgConfig?: { allowGroupAck: boolean };
6161
6449
  /** Whether the message is a thread message. */
6162
6450
  isChatThread?: boolean;
6451
+ /** Message priority. */
6452
+ priority?: MessagePriority;
6163
6453
  }
6164
6454
 
6165
6455
  interface ReceivedMsgBody {
@@ -6246,7 +6536,10 @@ export declare namespace EasemobChat {
6246
6536
  | AudioMsgBody
6247
6537
  | VideoMsgBody
6248
6538
  | FileMsgBody;
6249
-
6539
+ type MessagePriority = 'high' | 'normal' | 'low';
6540
+ interface PriorityExt {
6541
+ chatroom_msg_tag: number;
6542
+ }
6250
6543
  /**
6251
6544
  * Message class is used to create a message.
6252
6545
  * @module message