easemob-websdk 4.0.7 → 4.0.9-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
@@ -644,7 +644,6 @@ export declare namespace EasemobChat {
644
644
 
645
645
  interface DeleteSessionResult {
646
646
  /** The result of request. */
647
- /** 请求结果。 */
648
647
  result: 'ok';
649
648
  }
650
649
  // The contact api result end.
@@ -742,92 +741,6 @@ export declare namespace EasemobChat {
742
741
  /** The expiration time of the presence subscription. */
743
742
  expire: number;
744
743
  }
745
-
746
- interface SilentModeConversationType {
747
- /** Silent mode type. */
748
- type: string;
749
- /** Silent mode duration, duration of Unix timestamp. */
750
- ignoreDuration: number;
751
- /** Silent mode interval. */
752
- ignoreInterval: string;
753
- }
754
-
755
- interface ConversationSilentModeType {
756
- /** User push map. */
757
- user: {
758
- [propname: UserId]: SilentModeConversationType;
759
- };
760
- /** Group push map. */
761
- group: {
762
- [propname: string]: SilentModeConversationType;
763
- };
764
- }
765
-
766
- interface TranslationLanguageType {
767
- /** Translation language. */
768
- language: string;
769
- }
770
-
771
- enum SILENTMODETYPE {
772
- /** All messsage. */
773
- ALL = 'ALL',
774
- /** @ messaage of myself. */
775
- AT = 'AT',
776
- /** None. */
777
- NONE = 'NONE',
778
- }
779
-
780
- enum CONVERSATIONTYPE {
781
- /** Single chat. */
782
- SINGLECHAT = 'singleChat',
783
- /** Group chat. */
784
- GROUPCHAT = 'groupChat',
785
- /** Chat room. */
786
- CHATROOM = 'chatRoom',
787
- }
788
-
789
- type ConversationListType = {
790
- /** Conversation id. */
791
- id: string;
792
- /** Conversation type. */
793
- type: string;
794
- };
795
-
796
- interface SilentModeRemindType {
797
- /** Silent mode type. */
798
- paramType: 0;
799
- /** Silent mode type. */
800
- remindType: SILENTMODETYPE;
801
- }
802
-
803
- interface SilentModeDuration {
804
- /** Silent mode type. */
805
- paramType: 1;
806
- /** Silent mode duration, duration of Unix timestamp. */
807
- duration: number;
808
- }
809
-
810
- interface SilentModeInterval {
811
- /** Silent mode type. */
812
- paramType: 2;
813
- /** Start time interval. */
814
- startTime: Interval;
815
- /** End time interval. */
816
- endTime: Interval;
817
- }
818
-
819
- type Interval = {
820
- /** Hours. */
821
- hours: number;
822
- /** Minutes. */
823
- minutes: number;
824
- };
825
-
826
- type SilentModeParamType =
827
- | SilentModeRemindType
828
- | SilentModeDuration
829
- | SilentModeInterval;
830
-
831
744
  interface ChatThread {
832
745
  /** The Message ID for creating thread. */
833
746
  messageId: string;
@@ -980,6 +893,91 @@ export declare namespace EasemobChat {
980
893
  unread_num: number;
981
894
  }
982
895
 
896
+ interface SilentModeConversationType {
897
+ /** Silent mode type. */
898
+ type: string;
899
+ /** Silent mode duration, duration of Unix timestamp. */
900
+ ignoreDuration: number;
901
+ /** Silent mode interval. */
902
+ ignoreInterval: string;
903
+ }
904
+
905
+ interface ConversationSilentModeType {
906
+ /** User push map. */
907
+ user: {
908
+ [propname: UserId]: SilentModeConversationType;
909
+ };
910
+ /** Group push map. */
911
+ group: {
912
+ [propname: string]: SilentModeConversationType;
913
+ };
914
+ }
915
+
916
+ interface TranslationLanguageType {
917
+ /** Translation language. */
918
+ language: string;
919
+ }
920
+
921
+ enum SILENTMODETYPE {
922
+ /** All message. */
923
+ ALL = 'ALL',
924
+ /** @ message of myself. */
925
+ AT = 'AT',
926
+ /** None. */
927
+ NONE = 'NONE',
928
+ }
929
+
930
+ enum CONVERSATIONTYPE {
931
+ /** Single chat. */
932
+ SINGLECHAT = 'singleChat',
933
+ /** Group chat. */
934
+ GROUPCHAT = 'groupChat',
935
+ /** Chat room. */
936
+ CHATROOM = 'chatRoom',
937
+ }
938
+
939
+ type ConversationListType = {
940
+ /** Conversation id. */
941
+ id: string;
942
+ /** Conversation type. */
943
+ type: string;
944
+ };
945
+
946
+ interface SilentModeRemindType {
947
+ /** Silent mode type. */
948
+ paramType: 0;
949
+ /** Silent mode type. */
950
+ remindType: SILENTMODETYPE;
951
+ }
952
+
953
+ interface SilentModeDuration {
954
+ /** Silent mode type. */
955
+ paramType: 1;
956
+ /** Silent mode duration, duration of Unix timestamp. */
957
+ duration: number;
958
+ }
959
+
960
+ interface SilentModeInterval {
961
+ /** Silent mode type. */
962
+ paramType: 2;
963
+ /** Start time interval. */
964
+ startTime: Interval;
965
+ /** End time interval. */
966
+ endTime: Interval;
967
+ }
968
+
969
+ type Interval = {
970
+ /** Hours. */
971
+ hours: number;
972
+ /** Minutes. */
973
+ minutes: number;
974
+ };
975
+
976
+ type SilentModeParamType =
977
+ | SilentModeRemindType
978
+ | SilentModeDuration
979
+ | SilentModeInterval;
980
+
983
981
  interface GetReactionDetailResult {
984
982
  /** The reaction to be added to the message. The length is limited to 128 characters. */
985
983
  reaction: string;
@@ -1362,7 +1360,6 @@ export declare namespace EasemobChat {
1362
1360
  * ```typescript
1363
1361
  * connection.removeChatRoomMember({chatRoomId: 'chatRoomId', username: 'username'})
1364
1362
  * ```
1365
- * @since v4.0.1
1366
1363
  */
1367
1364
  removeChatRoomMember(
1368
1365
  this: Connection,
@@ -1391,7 +1388,6 @@ export declare namespace EasemobChat {
1391
1388
  * ```typescript
1392
1389
  * connection.removeChatRoomMembers({chatRoomId: 'chatRoomId', users: ['user1', 'user2']})
1393
1390
  * ```
1394
- * @since v4.0.1
1395
1391
  */
1396
1392
  removeChatRoomMembers(
1397
1393
  this: Connection,
@@ -1421,7 +1417,7 @@ export declare namespace EasemobChat {
1421
1417
  ): Promise<AsyncResult<AddUsersToChatRoomResult>>;
1422
1418
 
1423
1419
  /**
1424
- * Joins the chat room. After joining successfully, others will receive type: 'memberjoinchatroomsuccess' in the onPresence callback.
1420
+ * Joins the chat room. After a user joins successfully, other members in the chat room will receive operation: 'memberPresence' in the onChatroomEvent callback.
1425
1421
  *
1426
1422
  * ```typescript
1427
1423
  * connection.joinChatRoom({roomId: 'roomId'})
@@ -1438,7 +1434,8 @@ export declare namespace EasemobChat {
1438
1434
  ): Promise<AsyncResult<CommonRequestResult>>;
1439
1435
 
1440
1436
  /**
1441
- * Exits chat room. And others will receive type: 'leaveChatRoom' in the onPresence callback.
1437
+ * @deprecated Use {@link leaveChatRoom} instead.
1438
+ * Exits chat room. And others will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1442
1439
  *
1443
1440
  * ```typescript
1444
1441
  * connection.quitChatRoom({roomId: 'roomId'})
@@ -1453,6 +1450,22 @@ export declare namespace EasemobChat {
1453
1450
  }
1454
1451
  ): Promise<AsyncResult<{ result: boolean }>>;
1455
1452
 
1453
+ /**
1454
+ * Exits chat room. And others will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1455
+ *
1456
+ * ```typescript
1457
+ * connection.leaveChatRoom({roomId: 'roomId'})
1458
+ * ```
1459
+ */
1460
+ leaveChatRoom(
1461
+ this: Connection,
1462
+ params: {
1463
+ roomId: string;
1464
+ success?: (res: AsyncResult<{ result: boolean }>) => void;
1465
+ error?: (error: ErrorEvent) => void;
1466
+ }
1467
+ ): Promise<AsyncResult<{ result: boolean }>>;
1468
+
1456
1469
  /** @deprecated */
1457
1470
  listChatRoomMember(
1458
1471
  this: Connection,
@@ -1466,12 +1479,11 @@ export declare namespace EasemobChat {
1466
1479
  ): Promise<AsyncResult<{ member: string }[]>>;
1467
1480
 
1468
1481
  /**
1469
- * The list of all the chat room members (paginated).
1482
+ * Lists all chat room members with pagination.
1470
1483
  *
1471
1484
  * ```typescript
1472
1485
  * connection.listChatRoomMembers({pageNum: 1, pageSize: 20, chatRoomId: 'chatRoomId'})
1473
1486
  * ```
1474
- * @since v4.0.1
1475
1487
  */
1476
1488
  listChatRoomMembers(
1477
1489
  this: Connection,
@@ -1485,7 +1497,7 @@ export declare namespace EasemobChat {
1485
1497
  ): Promise<AsyncResult<{ member: string }[]>>;
1486
1498
 
1487
1499
  /**
1488
- * Gets all admins in the chat room.
1500
+ * Gets all admins of the chat room.
1489
1501
  *
1490
1502
  * ```typescript
1491
1503
  * connection.getChatRoomAdmin({chatRoomId: 'chatRoomId'})
@@ -1501,7 +1513,7 @@ export declare namespace EasemobChat {
1501
1513
  ): Promise<AsyncResult<GetChatRoomAdminResult>>;
1502
1514
 
1503
1515
  /**
1504
- * Sets up chat room admins. Only the chatroom owner can call this method. The members who are set as administrators will receive type: 'addadmin' in the onPresence callback.
1516
+ * 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.
1505
1517
  *
1506
1518
  * ```typescript
1507
1519
  * connection.setChatRoomAdmin({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1518,7 +1530,7 @@ export declare namespace EasemobChat {
1518
1530
  ): Promise<AsyncResult<SetChatRoomAdminResult>>;
1519
1531
 
1520
1532
  /**
1521
- * Removes the chat room admins. Only the chatroom owner can call this method. The users whose administrator is removed will receive type: 'removeadmin' in the callback of onPresence.
1533
+ * 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.
1522
1534
  *
1523
1535
  * ```typescript
1524
1536
  * connection.removeChatRoomAdmin({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1535,12 +1547,11 @@ export declare namespace EasemobChat {
1535
1547
  ): Promise<AsyncResult<RemoveChatRoomAdminResult>>;
1536
1548
 
1537
1549
  /**
1538
- * Mutes chat room member. Only the chatroom owner can call this method. The members who are muted and others will receive type: 'addmute' in the onPresence callback.
1550
+ * 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.
1539
1551
  *
1540
1552
  * ```typescript
1541
1553
  * connection.muteChatRoomMember({username: 'user1', muteDuration: -1, chatRoomId: 'chatRoomId'})
1542
1554
  * ```
1543
- * @since 1.4.11
1544
1555
  */
1545
1556
  muteChatRoomMember(
1546
1557
  this: Connection,
@@ -1567,12 +1578,11 @@ export declare namespace EasemobChat {
1567
1578
  ): Promise<AsyncResult<UnmuteChatRoomMemberResult[]>>;
1568
1579
 
1569
1580
  /**
1570
- * Unmutes the chat room member. Only the chatroom owner can call this method. The members who are muted and others will receive type: 'removeMute' in the onPresence callback.
1581
+ * 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.
1571
1582
  *
1572
1583
  * ```typescript
1573
1584
  * connection.unmuteChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
1574
1585
  * `
1575
- * @since v4.0.1
1576
1586
  */
1577
1587
  unmuteChatRoomMember(
1578
1588
  this: Connection,
@@ -1599,13 +1609,12 @@ export declare namespace EasemobChat {
1599
1609
  ): Promise<AsyncResult<GetChatRoomMuteListResult[]>>;
1600
1610
 
1601
1611
  /**
1612
+ * @deprecated
1602
1613
  * Gets all members who are muted in the chat room.
1603
1614
  *
1604
1615
  * ```typescript
1605
1616
  * connection.getChatRoomMuteList({chatRoomId: 'chatRoomId'})
1606
1617
  * ```
1607
- *
1608
- * @since v4.0.1
1609
1618
  */
1610
1619
  getChatRoomMuteList(
1611
1620
  this: Connection,
@@ -1618,6 +1627,24 @@ export declare namespace EasemobChat {
1618
1627
  }
1619
1628
  ): Promise<AsyncResult<GetChatRoomMuteListResult[]>>;
1620
1629
 
1630
+ /**
1631
+ * Gets all members who are muted in the chat room.
1632
+ *
1633
+ * ```typescript
1634
+ * connection.getChatRoomMutelist({chatRoomId: 'chatRoomId'})
1635
+ * ```
1636
+ */
1637
+ getChatRoomMutelist(
1638
+ this: Connection,
1639
+ params: {
1640
+ chatRoomId: string;
1641
+ success?: (
1642
+ res: AsyncResult<GetChatRoomMuteListResult[]>
1643
+ ) => void;
1644
+ error?: (error: ErrorEvent) => void;
1645
+ }
1646
+ ): Promise<AsyncResult<GetChatRoomMuteListResult[]>>;
1647
+
1621
1648
  /** @deprecated */
1622
1649
  chatRoomBlockSingle(
1623
1650
  this: Connection,
@@ -1630,12 +1657,11 @@ export declare namespace EasemobChat {
1630
1657
  ): Promise<AsyncResult<CommonRequestResult>>;
1631
1658
 
1632
1659
  /**
1633
- * Adds a single user to the chat room blocklist. Only the chatroom owner or admin can call this method.
1660
+ * Adds a member to the chat room blocklist. Only the chat room owner or admin can call this method.
1634
1661
  *
1635
1662
  * ```typescript
1636
1663
  * connection.blockChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
1637
1664
  * ```
1638
- *@since v4.0.1
1639
1665
  */
1640
1666
  blockChatRoomMember(
1641
1667
  this: Connection,
@@ -1659,13 +1685,11 @@ export declare namespace EasemobChat {
1659
1685
  ): Promise<AsyncResult<CommonRequestResult[]>>;
1660
1686
 
1661
1687
  /**
1662
- * Adds users to the chat room blocklist. Only the chatroom owner or admin can call this method.
1688
+ * Adds members to the chat room blocklist. Only the chat room owner or admin can call this method.
1663
1689
  *
1664
1690
  * ```typescript
1665
1691
  * connection.blockChatRoomMembers({usernames: ['user1', 'user2'], chatRoomId: 'chatRoomId'})
1666
1692
  * ```
1667
- *
1668
- * @since v4.0.1
1669
1693
  */
1670
1694
  blockChatRoomMembers(
1671
1695
  this: Connection,
@@ -1694,7 +1718,6 @@ export declare namespace EasemobChat {
1694
1718
  * ```typescript
1695
1719
  * connection.unblockChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
1696
1720
  * ```
1697
- * @since v4.0.1
1698
1721
  */
1699
1722
  unblockChatRoomMember(
1700
1723
  this: Connection,
@@ -1723,8 +1746,6 @@ export declare namespace EasemobChat {
1723
1746
  * ```typescript
1724
1747
  * connection.unblockChatRoomMembers({chatRoomId: 'chatRoomId', usernames: ['user1', 'user2']})
1725
1748
  * ```
1726
- *
1727
- * @since v4.0.1
1728
1749
  */
1729
1750
  unblockChatRoomMembers(
1730
1751
  this: Connection,
@@ -1752,7 +1773,6 @@ export declare namespace EasemobChat {
1752
1773
  * ```typescript
1753
1774
  * connection.getChatRoomBlacklist({chatRoomId: 'chatRoomId'})
1754
1775
  * ```
1755
- * @since v4.0.1
1756
1776
  */
1757
1777
  getChatRoomBlacklist(
1758
1778
  this: Connection,
@@ -1782,7 +1802,7 @@ export declare namespace EasemobChat {
1782
1802
  ): Promise<AsyncResult<WhetherAbleSendChatRoomMsgResult>>;
1783
1803
 
1784
1804
  /**
1785
- * Unmutes all the members in the chat room. Only the chatroom owner or admin can call this method.
1805
+ * Unmute all the members in the chat room. Only the chatroom owner or admin can call this method.
1786
1806
  *
1787
1807
  * ```typescript
1788
1808
  * connection.enableSendChatRoomMsg({chatRoomId: 'chatRoomId'})
@@ -1795,12 +1815,13 @@ export declare namespace EasemobChat {
1795
1815
  success?: (
1796
1816
  res: AsyncResult<WhetherAbleSendChatRoomMsgResult>
1797
1817
  ) => void;
1798
- error?: (errror: ErrorEvent) => void;
1818
+ error?: (error: ErrorEvent) => void;
1799
1819
  }
1800
1820
  ): Promise<AsyncResult<WhetherAbleSendChatRoomMsgResult>>;
1801
1821
 
1802
1822
  /**
1803
- * Adds members to the allowlist of the chat room. Users added to the allow list of the chat room will receive in onPresence callback type: 'addUserToChatRoomWhiteList'.
1823
+ * @deprecated Use {@link addUsersToChatRoomAllowlist} instead.
1824
+ * Adds members to the allowlist of the chat room. Users added to the allow list of the chat room will receive "operation: 'addUserToAllowlist'" in the callback of onChatroomEvent.
1804
1825
  *
1805
1826
  * ```typescript
1806
1827
  * connection.addUsersToGroupWhitelist({groupId: 'groupId'})
@@ -1820,6 +1841,27 @@ export declare namespace EasemobChat {
1820
1841
  }
1821
1842
  ): Promise<AsyncResult<CommonRequestResult | CommonRequestResult[]>>;
1822
1843
 
1844
+ /**`
1845
+ * Adds members to the allowlist of the chat room. Users added to the allow list of the chat room will receive "operation: 'addUserToAllowlist'" in the callback of onChatroomEvent.
1846
+ *
1847
+ * ```typescript
1848
+ * connection.addUsersToChatRoomAllowlist({groupId: 'groupId'})
1849
+ * ```
1850
+ */
1851
+ addUsersToChatRoomAllowlist(
1852
+ this: Connection,
1853
+ params: {
1854
+ chatRoomId: string;
1855
+ users: string[];
1856
+ success?: (
1857
+ res: AsyncResult<
1858
+ CommonRequestResult | CommonRequestResult[]
1859
+ >
1860
+ ) => void;
1861
+ error?: (error: ErrorEvent) => void;
1862
+ }
1863
+ ): Promise<AsyncResult<CommonRequestResult | CommonRequestResult[]>>;
1864
+
1823
1865
  /** @deprecated */
1824
1866
  rmUsersFromChatRoomWhitelist(
1825
1867
  this: Connection,
@@ -1832,12 +1874,12 @@ export declare namespace EasemobChat {
1832
1874
  ): Promise<AsyncResult<CommonRequestResult>>;
1833
1875
 
1834
1876
  /**
1835
- * Removes members from the allowlist in the chatroom. Only the chatroom owner or admin can call this method. The users who are removed will receive in onPresence callback type: 'rmUserFromChatRoomWhiteList'.
1877
+ * @deprecated Use {@link removeChatRoomAllowlistMember} instead.
1878
+ * Removes members from the allowlist in the chatroom. Only the chatroom owner or admin can call this method. The users who are removed will receive "operation:'removeAllowlistMember'" in the callback of onChatroomEvent.
1836
1879
  *
1837
1880
  * ```typescript
1838
1881
  * connection.removeChatRoomWhitelistMember({chatRoomId: 'chatRoomId', userName: 'user1'})
1839
1882
  * `
1840
- * @since v4.0.1
1841
1883
  */
1842
1884
  removeChatRoomWhitelistMember(
1843
1885
  this: Connection,
@@ -1850,7 +1892,25 @@ export declare namespace EasemobChat {
1850
1892
  ): Promise<AsyncResult<CommonRequestResult>>;
1851
1893
 
1852
1894
  /**
1853
- * Gets the allowlist of the chat room. Only the chatroom owner or admin can call this method.
1895
+ * Removes members from the allowlist in the chatroom. Only the chatroom owner or admin can call this method. The users who are removed will receive "operation:'removeAllowlistMember'" in the callback of onChatroomEvent.
1896
+ *
1897
+ * ```typescript
1898
+ * connection.removeChatRoomAllowlistMember({chatRoomId: 'chatRoomId', userName: 'user1'})
1899
+ * `
1900
+ */
1901
+ removeChatRoomAllowlistMember(
1902
+ this: Connection,
1903
+ params: {
1904
+ chatRoomId: string;
1905
+ userName: string;
1906
+ success?: (res: AsyncResult<CommonRequestResult>) => void;
1907
+ error?: (error: ErrorEvent) => void;
1908
+ }
1909
+ ): Promise<AsyncResult<CommonRequestResult>>;
1910
+
1911
+ /**
1912
+ * @deprecated Use {@link getChatRoomAllowlist} instead.
1913
+ * Gets the allowlist of the chat room. Only the chat room owner or admin can call this method.
1854
1914
  *
1855
1915
  * ```typescript
1856
1916
  * connection.getChatRoomWhitelist({chatRoomId: 'chatRoomId'})
@@ -1866,7 +1926,24 @@ export declare namespace EasemobChat {
1866
1926
  ): Promise<AsyncResult<UserId[]>>;
1867
1927
 
1868
1928
  /**
1869
- * Queries whether chat room members are in the allowlist. Only the chatroom owner or admin can call this method. The chatroom members can query themselves.
1929
+ * Gets the allowlist of the chat room. Only the chat room owner or admin can call this method.
1930
+ *
1931
+ * ```typescript
1932
+ * connection.getChatRoomAllowlist({chatRoomId: 'chatRoomId'})
1933
+ * ```
1934
+ */
1935
+ getChatRoomAllowlist(
1936
+ this: Connection,
1937
+ params: {
1938
+ chatRoomId: string;
1939
+ success: (res: AsyncResult<UserId[]>) => void;
1940
+ error: (error: ErrorEvent) => void;
1941
+ }
1942
+ ): Promise<AsyncResult<UserId[]>>;
1943
+
1944
+ /**
1945
+ * @deprecated Use {@link isInChatRoomAllowlist} instead.
1946
+ * Checks whether chat room members are on the allowlist. Only the chat room owner or admin can call this method. The chat room members can check themselves.
1870
1947
  *
1871
1948
  * ```typescript
1872
1949
  * connection.isChatRoomWhiteUser({chatRoomId: 'chatRoomId', userName: 'user1'})
@@ -1883,20 +1960,37 @@ export declare namespace EasemobChat {
1883
1960
  ): Promise<AsyncResult<IsChatRoomWhiteUserResult>>;
1884
1961
 
1885
1962
  /**
1886
- * Gets the announcement of the chat room.
1963
+ * Checks whether chat room members are on the allowlist. Only the chat room owner or admin can call this method. The chat room members can check themselves.
1887
1964
  *
1888
1965
  * ```typescript
1889
- * connection.fetchChatRoomAnnouncement({roomId: 'roomId'})
1890
- * ```
1966
+ * connection.isInChatRoomAllowlist({chatRoomId: 'chatRoomId', userName: 'user1'})
1967
+ * `
1891
1968
  */
1892
- fetchChatRoomAnnouncement(
1969
+ isInChatRoomAllowlist(
1893
1970
  this: Connection,
1894
1971
  params: {
1895
- roomId: string;
1896
- success?: (
1897
- res: AsyncResult<FetchChatRoomAnnouncementResult>
1898
- ) => void;
1899
- error?: (error: ErrorEvent) => void;
1972
+ chatRoomId: string;
1973
+ userName: string;
1974
+ success?: (res: AsyncResult<IsChatRoomWhiteUserResult>) => void;
1975
+ error?: (error: ErrorEvent) => void;
1976
+ }
1977
+ ): Promise<AsyncResult<IsChatRoomWhiteUserResult>>;
1978
+
1979
+ /**
1980
+ * Gets the announcement of the chat room.
1981
+ *
1982
+ * ```typescript
1983
+ * connection.fetchChatRoomAnnouncement({roomId: 'roomId'})
1984
+ * ```
1985
+ */
1986
+ fetchChatRoomAnnouncement(
1987
+ this: Connection,
1988
+ params: {
1989
+ roomId: string;
1990
+ success?: (
1991
+ res: AsyncResult<FetchChatRoomAnnouncementResult>
1992
+ ) => void;
1993
+ error?: (error: ErrorEvent) => void;
1900
1994
  }
1901
1995
  ): Promise<AsyncResult<FetchChatRoomAnnouncementResult>>;
1902
1996
 
@@ -1920,12 +2014,11 @@ export declare namespace EasemobChat {
1920
2014
  ): Promise<AsyncResult<UpdateChatRoomAnnouncementResult>>;
1921
2015
 
1922
2016
  /**
1923
- * Uploads shared files to the chat room.
2017
+ * Uploads a shared file to the chat room.
1924
2018
  *
1925
2019
  * ```typescript
1926
2020
  * connection.uploadChatRoomSharedFile({roomId: 'roomId', file: 'file object', onFileUploadProgress: onFileUploadProgress, onFileUploadComplete: onFileUploadComplete,onFileUploadError:onFileUploadError,onFileUploadCanceled:onFileUploadCanceled})
1927
2021
  * ```
1928
- * @return Void
1929
2022
  */
1930
2023
  uploadChatRoomSharedFile(
1931
2024
  this: Connection,
@@ -1940,7 +2033,7 @@ export declare namespace EasemobChat {
1940
2033
  ): void;
1941
2034
 
1942
2035
  /**
1943
- * Deletes the chat room shared files.
2036
+ * Deletes a shared file of the chat room.
1944
2037
  *
1945
2038
  * ```typescript
1946
2039
  * connection.deleteChatRoomSharedFile({roomId: 'roomId', fileId: 'fileId'})
@@ -1959,6 +2052,7 @@ export declare namespace EasemobChat {
1959
2052
  ): Promise<AsyncResult<DeleteChatRoomSharedFileResult>>;
1960
2053
 
1961
2054
  /**
2055
+ * @deprecated Use {@link getChatRoomSharedFilelist}
1962
2056
  * Gets a list of shared files in the chat room.
1963
2057
  *
1964
2058
  * ```typescript
@@ -1976,6 +2070,24 @@ export declare namespace EasemobChat {
1976
2070
  }
1977
2071
  ): Promise<AsyncResult<FetchChatRoomSharedFileListResult[]>>;
1978
2072
 
2073
+ /**
2074
+ * Gets a list of shared files in the chat room.
2075
+ *
2076
+ * ```typescript
2077
+ * connection.getChatRoomSharedFilelist({roomId: 'roomId'})
2078
+ * ```
2079
+ */
2080
+ getChatRoomSharedFilelist(
2081
+ this: Connection,
2082
+ params: {
2083
+ roomId: string;
2084
+ success?: (
2085
+ res: AsyncResult<FetchChatRoomSharedFileListResult[]>
2086
+ ) => void;
2087
+ error?: (error: ErrorEvent) => void;
2088
+ }
2089
+ ): Promise<AsyncResult<FetchChatRoomSharedFileListResult[]>>;
2090
+
1979
2091
  // Group API
1980
2092
  /** @deprecated */
1981
2093
  createGroupNew(
@@ -2012,7 +2124,6 @@ export declare namespace EasemobChat {
2012
2124
  }
2013
2125
  })
2014
2126
  * ```
2015
- * @since v4.0.1
2016
2127
  */
2017
2128
  createGroup(
2018
2129
  this: Connection,
@@ -2043,11 +2154,10 @@ export declare namespace EasemobChat {
2043
2154
  ): Promise<AsyncResult<BlockGroupResult>>;
2044
2155
 
2045
2156
  /**
2046
- * Block group messages, Only valid for mobile terminal
2157
+ * Blocks group messages. This method is only valid for mobile devices.
2047
2158
  * ```typescript
2048
2159
  * connection.blockGroupMessages({groupId: 'groupId'})
2049
2160
  * ```
2050
- * @since v4.0.1
2051
2161
  */
2052
2162
  blockGroupMessages(
2053
2163
  this: Connection,
@@ -2059,12 +2169,12 @@ export declare namespace EasemobChat {
2059
2169
  ): Promise<AsyncResult<BlockGroupResult>>;
2060
2170
 
2061
2171
  /**
2062
- * Gets public groups (paginated).
2172
+ * @deprecated Use {@link getPublicGroups} instead.
2173
+ * Gets public groups with pagination.
2063
2174
  *
2064
2175
  * ```typescript
2065
2176
  * connection.listGroups({limit: 20, cursor: null})
2066
2177
  * ```
2067
- * @since 1.4.11
2068
2178
  */
2069
2179
  listGroups(
2070
2180
  this: Connection,
@@ -2076,13 +2186,29 @@ export declare namespace EasemobChat {
2076
2186
  }
2077
2187
  ): Promise<AsyncResult<BaseGroupInfo[]>>;
2078
2188
 
2189
+ /**
2190
+ * Gets public groups with pagination.
2191
+ *
2192
+ * ```typescript
2193
+ * connection.getPublicGroups({limit: 20, cursor: null})
2194
+ * ```
2195
+ */
2196
+ getPublicGroups(
2197
+ this: Connection,
2198
+ params: {
2199
+ limit: number;
2200
+ cursor?: string;
2201
+ success?: (res: AsyncResult<BaseGroupInfo[]>) => void;
2202
+ error?: (error: ErrorEvent) => void;
2203
+ }
2204
+ ): Promise<AsyncResult<BaseGroupInfo[]>>;
2205
+
2079
2206
  /**
2080
2207
  * Lists all the groups a user has joined.
2081
2208
  *
2082
2209
  * ```typescript
2083
2210
  * connection.getGroup()
2084
2211
  * ```
2085
- * @since 1.4.11
2086
2212
  * @deprecated
2087
2213
  */
2088
2214
  getGroup(
@@ -2105,6 +2231,8 @@ export declare namespace EasemobChat {
2105
2231
  params: {
2106
2232
  pageNum: number;
2107
2233
  pageSize: number;
2234
+ needAffiliations?: boolean;
2235
+ needRole?: boolean;
2108
2236
  success?: (res: AsyncResult<BaseGroupInfo[]>) => void;
2109
2237
  error?: (error: ErrorEvent) => void;
2110
2238
  }
@@ -2122,12 +2250,11 @@ export declare namespace EasemobChat {
2122
2250
  ): Promise<AsyncResult<ChangeGroupOwnerResult>>;
2123
2251
 
2124
2252
  /**
2125
- * Transfers group. Requires owner permission. Group members will receive type: 'changeowner' in the onpresence callback
2253
+ * Transfers a group. Only the group owner can call this method. Group members will receive "operation: 'changeOwner'" in the callback of onGroupEvent.
2126
2254
  *
2127
2255
  * ```typescript
2128
2256
  * connection.changeGroupOwner({groupId: 'groupId', newOwner: 'user1'})
2129
2257
  * ```
2130
- * @since v4.0.1
2131
2258
  */
2132
2259
  changeGroupOwner(
2133
2260
  this: Connection,
@@ -2140,23 +2267,22 @@ export declare namespace EasemobChat {
2140
2267
  ): Promise<AsyncResult<ChangeGroupOwnerResult>>;
2141
2268
 
2142
2269
  /**
2143
- * Gets group details
2270
+ * Gets specifications of the group.
2144
2271
  * ```typescript
2145
2272
  * connection.getGroupInfo({groupId: groupId})
2146
2273
  * ```
2147
- * @since 1.4.11
2148
2274
  */
2149
2275
  getGroupInfo(
2150
2276
  this: Connection,
2151
2277
  params: {
2152
- groupId: string;
2278
+ groupId: string | string[];
2153
2279
  success?: (res: AsyncResult<GroupDetailInfo[]>) => void;
2154
2280
  error?: (error: ErrorEvent) => void;
2155
2281
  }
2156
2282
  ): Promise<AsyncResult<GroupDetailInfo[]>>;
2157
2283
 
2158
2284
  /**
2159
- * Modifys group information, Administrator right is required.
2285
+ * Modifies group information. Only the group admin can call this method.
2160
2286
  *
2161
2287
  * ```typescript
2162
2288
  * connection.modifyGroup({groupId: 'groupId', groupName: 'groupName', description:'description'})
@@ -2186,12 +2312,11 @@ export declare namespace EasemobChat {
2186
2312
  ): Promise<AsyncResult<GroupMember[]>>;
2187
2313
 
2188
2314
  /**
2189
- * Lists all members of the group (paginated).
2315
+ * Lists all members of the group with pagination.
2190
2316
  *
2191
2317
  * ```typescript
2192
2318
  * connection.listGroupMembers({pageNum: 1, pageSize: 20, groupId: 'groupId'})
2193
2319
  * ```
2194
- * @since v4.0.1
2195
2320
  */
2196
2321
  listGroupMembers(
2197
2322
  this: Connection,
@@ -2205,11 +2330,10 @@ export declare namespace EasemobChat {
2205
2330
  ): Promise<AsyncResult<GroupMember[]>>;
2206
2331
 
2207
2332
  /**
2208
- * Gets all administrators in the group.
2333
+ * Gets all admins in the group.
2209
2334
  * ```typescript
2210
2335
  * connection.getGroupAdmin({groupId: 'groupId'})
2211
2336
  * ```
2212
- * @since 1.4.11
2213
2337
  */
2214
2338
  getGroupAdmin(
2215
2339
  this: Connection,
@@ -2232,12 +2356,11 @@ export declare namespace EasemobChat {
2232
2356
  ): Promise<AsyncResult<SetGroupAdminResult>>;
2233
2357
 
2234
2358
  /**
2235
- * Sets up group administrator, need group owner authority. Users who are set as administrators will receive type: 'addadmin' in the onPresence callback.
2359
+ * 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.
2236
2360
  *
2237
2361
  * ```typescript
2238
2362
  * connection.setGroupAdmin({groupId: 'groupId', username: 'user1'})
2239
2363
  * ```
2240
- * @since v4.0.1
2241
2364
  */
2242
2365
  setGroupAdmin(
2243
2366
  this: Connection,
@@ -2250,10 +2373,10 @@ export declare namespace EasemobChat {
2250
2373
  ): Promise<AsyncResult<SetGroupAdminResult>>;
2251
2374
 
2252
2375
  /**
2253
- * Removes the group administrator, need the permission of the group master. The user whose administrator is canceled will receive type: 'removeadmin' in the callback of onPresence.
2376
+ * 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.
2254
2377
  *
2255
2378
  * ```typescript
2256
- * connection.removeAdmin({gorupId: 'gorupId', username: 'user1'})
2379
+ * connection.removeAdmin({groupId: 'groupId', username: 'user1'})
2257
2380
  * ```
2258
2381
  */
2259
2382
  removeAdmin(
@@ -2277,12 +2400,11 @@ export declare namespace EasemobChat {
2277
2400
  ): Promise<AsyncResult<DestroyGroupResult>>;
2278
2401
 
2279
2402
  /**
2280
- * Destroys a group, need the permission of the group owner. Group members will receive type: 'deletegroupchat' in the callback of onPrenscence.
2403
+ * Destroys a group. Only the group owner can call this method. Group members will receive "operation: 'destroy'" in the callback of onGroupEvent.
2281
2404
  *
2282
2405
  * ```typescript
2283
2406
  * connection.destroyGroup({groupId: 'groupId'})
2284
2407
  * ```
2285
- * @since v4.0.1
2286
2408
  */
2287
2409
  destroyGroup(
2288
2410
  this: Connection,
@@ -2294,7 +2416,7 @@ export declare namespace EasemobChat {
2294
2416
  ): Promise<AsyncResult<DestroyGroupResult>>;
2295
2417
 
2296
2418
  /**
2297
- * Leaves the group, group members will receive type: 'leavegroup' in the callback of onPresence.
2419
+ * Leaves the group. Group members will receive "operation: 'memberAbsence'" in the callback of onGroupEvent.
2298
2420
  *
2299
2421
  * ```typescript
2300
2422
  * connection.quitGroup({groupId: 'groupId'})
@@ -2323,12 +2445,13 @@ export declare namespace EasemobChat {
2323
2445
  ): Promise<AsyncResult<InviteUsersToGroupResult[]>>;
2324
2446
 
2325
2447
  /**
2326
- * Invites users into group. The invited user will receive type: 'invite' in the callback of onPresence.
2448
+ * Invites users into a group.
2449
+ * Creates a group instance "inviteNeedConfirm:true", the invited users will receive "operation: 'inviteToJoin'" in the callback of onGroupEvent.
2450
+ * Creates a group instance "inviteNeedConfirm:false", the invited users will receive "operation: 'directJoined'" in the callback of onGroupEvent.
2327
2451
  *
2328
2452
  * ```typescript
2329
2453
  * connection.inviteUsersToGroup({groupId: 'groupId', users: ['user1', 'user2']})
2330
2454
  * ```
2331
- * @since v4.0.1
2332
2455
  */
2333
2456
  inviteUsersToGroup(
2334
2457
  this: Connection,
@@ -2343,12 +2466,11 @@ export declare namespace EasemobChat {
2343
2466
  ): Promise<AsyncResult<InviteUsersToGroupResult[]>>;
2344
2467
 
2345
2468
  /**
2346
- * Applys to join the group. The group owner and administrator will receive type: 'joingroupnotifications' in the onPresence callback
2469
+ * Applies to join the group. The group owner and admin will receive "operation: 'requestToJoin'" in the callback of onGroupEvent.
2347
2470
  *
2348
2471
  * ```typescript
2349
2472
  * connection.joinGroup({groupId: 'groupId', message: 'I want to join the group'})
2350
2473
  * ```
2351
- * @since 1.4.11
2352
2474
  */
2353
2475
  joinGroup(
2354
2476
  this: Connection,
@@ -2372,12 +2494,11 @@ export declare namespace EasemobChat {
2372
2494
  ): Promise<AsyncResult<CommonRequestResult>>;
2373
2495
 
2374
2496
  /**
2375
- * Allows user to join the group. Group owner or administrator permissions are required. Users who join the group will receive type: 'joinpublicgroupsuccess' in the callback of onPresence.
2497
+ * 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.
2376
2498
  *
2377
2499
  * ```typescript
2378
2500
  * connection.acceptGroupJoinRequest({applicant: 'user1', groupId: 'groupId'})
2379
2501
  * ```
2380
- * @since v4.0.1
2381
2502
  */
2382
2503
  acceptGroupJoinRequest(
2383
2504
  this: Connection,
@@ -2402,12 +2523,11 @@ export declare namespace EasemobChat {
2402
2523
  ): Promise<AsyncResult<CommonRequestResult>>;
2403
2524
 
2404
2525
  /**
2405
- * Refuses user to join the group. Group owner or administrator permissions are required.
2526
+ * Declines a group request. Only the group owner or admin can call this method.
2406
2527
  *
2407
2528
  * ```typescript
2408
2529
  * connection.rejectGroupJoinRequest({applicant: 'user1', groupId: 'groupId', reason: 'I do not like you'})
2409
2530
  * ```
2410
- * @since v4.0.1
2411
2531
  */
2412
2532
  rejectGroupJoinRequest(
2413
2533
  this: Connection,
@@ -2432,12 +2552,11 @@ export declare namespace EasemobChat {
2432
2552
  ): Promise<AsyncResult<CommonRequestResult>>;
2433
2553
 
2434
2554
  /**
2435
- * Accepts the group invitation. If others invite you to join the group, you can call this API and agree. The inviter will receive type: 'invite_accept' in the callback of onPresence, After joining successfully, group members will receive type: 'memberjoinpublicgroupsuccess' in the callback of onPresence.
2555
+ * 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.
2436
2556
  *
2437
2557
  * ```typescript
2438
2558
  * connection.acceptGroupInvite({invitee: 'myUserId', groupId: 'groupId'})
2439
2559
  * ```
2440
- * @since v4.0.1
2441
2560
  */
2442
2561
  acceptGroupInvite(
2443
2562
  this: Connection,
@@ -2461,12 +2580,11 @@ export declare namespace EasemobChat {
2461
2580
  ): Promise<any>;
2462
2581
 
2463
2582
  /**
2464
- * Rejects group invitation. Other user invite you to join the group, you can call this API to refuse.
2583
+ * 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.
2465
2584
  *
2466
2585
  * ```typescript
2467
2586
  * connection.rejectGroupInvite({invitee: 'myUserId', groupId: 'groupId'})
2468
2587
  * ```
2469
- * @since v4.0.1
2470
2588
  */
2471
2589
  rejectGroupInvite(
2472
2590
  this: Connection,
@@ -2490,12 +2608,11 @@ export declare namespace EasemobChat {
2490
2608
  ): Promise<AsyncResult<RemoveGroupMemberResult>>;
2491
2609
 
2492
2610
  /**
2493
- * Removes a group member. Group owner or administrator permission is required. The removed user will receive type: 'removedfromgroup' in the callback of onPresence, and other group members will receive type: 'leavegroup' in the callback of onPresence.
2611
+ * 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.
2494
2612
  *
2495
2613
  * ```typescript
2496
2614
  * connection.removeGroupMember({groupId: 'groupId', username: 'user1'})
2497
2615
  * ```
2498
- * @since v4.0.1
2499
2616
  */
2500
2617
  removeGroupMember(
2501
2618
  this: Connection,
@@ -2519,12 +2636,11 @@ export declare namespace EasemobChat {
2519
2636
  ): Promise<AsyncResult<RemoveGroupMemberResult[]>>;
2520
2637
 
2521
2638
  /**
2522
- * Removes group members. Group owner or administrator permission is required. The removed users will receive type: 'removedfromgroup' in the callback of onPresence, and other group members will receive type: 'leavegroup' in the callback of onPresence.
2639
+ * 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.
2523
2640
  *
2524
2641
  * ```typescript
2525
2642
  * connection.removeGroupMembers({groupId: 'groupId', users: ['user1', 'user2']})
2526
2643
  * ```
2527
- * @since v4.0.1
2528
2644
  */
2529
2645
  removeGroupMembers(
2530
2646
  this: Connection,
@@ -2549,12 +2665,11 @@ export declare namespace EasemobChat {
2549
2665
  ): Promise<AsyncResult<MuteGroupMemberResult[]>>;
2550
2666
 
2551
2667
  /**
2552
- * Mutes a group member. Group owner or administrator permission is required. Forbidden user and other users will receive type: 'addmute' in the onPresence callback.
2668
+ * 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.
2553
2669
  *
2554
2670
  * ```typescript
2555
2671
  * connection.muteGroupMember({username: 'user1', muteDuration: -1, groupId: 'groupId'})
2556
2672
  * ```
2557
- * @since v4.0.1
2558
2673
  */
2559
2674
  muteGroupMember(
2560
2675
  this: Connection,
@@ -2579,12 +2694,11 @@ export declare namespace EasemobChat {
2579
2694
  ): Promise<AsyncResult<UnmuteGroupMemberResult[]>>;
2580
2695
 
2581
2696
  /**
2582
- * Unmutes group member. Group owner or administrator permissions are required. Users who have been released and other users will receive type: 'removemute' in the callback of onPresence.
2697
+ * 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.
2583
2698
  *
2584
2699
  * ```typescript
2585
2700
  * connection.unmuteGroupMember({groupId: 'groupId', username: 'user1'})
2586
2701
  * ```
2587
- * @since v4.0.1
2588
2702
  */
2589
2703
  unmuteGroupMember(
2590
2704
  this: Connection,
@@ -2607,12 +2721,11 @@ export declare namespace EasemobChat {
2607
2721
  ): Promise<AsyncResult<GetGroupMuteListResult[]>>;
2608
2722
 
2609
2723
  /**
2610
- * Gets the group mute list.
2724
+ * Gets the mute list of the group.
2611
2725
  *
2612
2726
  * ```typescript
2613
2727
  * connection.getGroupMuteList({groupId: 'groupId'})
2614
2728
  * ```
2615
- * @since v4.0.1
2616
2729
  */
2617
2730
  getGroupMuteList(
2618
2731
  this: Connection,
@@ -2635,12 +2748,11 @@ export declare namespace EasemobChat {
2635
2748
  ): Promise<AsyncResult<GroupRequestResult>>;
2636
2749
 
2637
2750
  /**
2638
- * Adds a member to the group blacklist. Group owner or administrator permission is required, The user added to the blacklist will receive type: 'removedFromGroup' in the onPresence callback.
2751
+ * 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.
2639
2752
  *
2640
2753
  * ```typescript
2641
2754
  * connection.blockGroupMember({groupId: 'groupId', username: 'user1'})
2642
2755
  * ```
2643
- * @since v4.0.1
2644
2756
  */
2645
2757
  blockGroupMember(
2646
2758
  this: Connection,
@@ -2664,12 +2776,11 @@ export declare namespace EasemobChat {
2664
2776
  ): Promise<AsyncResult<GroupRequestResult[]>>;
2665
2777
 
2666
2778
  /**
2667
- * Adds group members to the group blacklist. Administrator rights required,Users added to the blacklist will receive type: 'removedFromGroup' in the onPresence callback.
2779
+ * 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.
2668
2780
  *
2669
2781
  * ```typescript
2670
2782
  * connection.blockGroupMembers({usernames: ['user1', 'user2'], groupId: 'groupId'})
2671
2783
  * ```
2672
- * @since v4.0.1
2673
2784
  */
2674
2785
  blockGroupMembers(
2675
2786
  this: Connection,
@@ -2693,12 +2804,11 @@ export declare namespace EasemobChat {
2693
2804
  ): Promise<AsyncResult<GroupRequestResult>>;
2694
2805
 
2695
2806
  /**
2696
- * Unblock a group member. Administrator rights required, Users who have been removed from the blacklist will receive type: 'allow' in the onPresence callback.
2807
+ * 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.
2697
2808
  *
2698
2809
  * ```typescript
2699
2810
  * connection.unblockGroupMember({groupId: 'groupId'})
2700
2811
  * ```
2701
- * @since v4.0.1
2702
2812
  */
2703
2813
  unblockGroupMember(
2704
2814
  this: Connection,
@@ -2722,12 +2832,11 @@ export declare namespace EasemobChat {
2722
2832
  ): Promise<AsyncResult<GroupRequestResult[]>>;
2723
2833
 
2724
2834
  /**
2725
- * Unblock the group members. Group owner or administrator permissions are required, Users who have been removed from the blacklist will receive type: 'allow' in the onPresence callback.
2835
+ * 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.
2726
2836
  *
2727
2837
  * ```typescript
2728
2838
  * connection.unblockGroupMembers({groupId: 'groupId', usernames: ['user1', 'user2']})
2729
2839
  * ```
2730
- * @since v4.0.1
2731
2840
  */
2732
2841
  unblockGroupMembers(
2733
2842
  this: Connection,
@@ -2750,12 +2859,13 @@ export declare namespace EasemobChat {
2750
2859
  ): Promise<AsyncResult<UserId[]>>;
2751
2860
 
2752
2861
  /**
2753
- * Gets group blacklist.
2862
+ * Gets the group blocklist.
2754
2863
  *
2755
2864
  * ```typescript
2756
2865
  * connection.getGroupBlacklist({groupId: 'groupId'})
2757
2866
  * ```
2758
- * @since v4.0.1
2867
+ * @hidden
2868
+ * @deprecated
2759
2869
  */
2760
2870
  getGroupBlacklist(
2761
2871
  this: Connection,
@@ -2767,7 +2877,23 @@ export declare namespace EasemobChat {
2767
2877
  ): Promise<AsyncResult<UserId[]>>;
2768
2878
 
2769
2879
  /**
2770
- * Mutes all members. All group members are prohibited from speaking. Operation permissions: group admin or above identity, Group members will receive type: 'muteGroup' in the onPresence callback.
2880
+ * Gets the group blocklist.
2881
+ *
2882
+ * ```typescript
2883
+ * connection.getGroupBlocklist({groupId: 'groupId'})
2884
+ * ```
2885
+ */
2886
+ getGroupBlocklist(
2887
+ this: Connection,
2888
+ params: {
2889
+ groupId: string;
2890
+ success?: (res: AsyncResult<UserId[]>) => void;
2891
+ error?: (error: ErrorEvent) => void;
2892
+ }
2893
+ ): Promise<AsyncResult<UserId[]>>;
2894
+
2895
+ /**
2896
+ * Mutes all members. Only the group admin or above can call this method. Group members will receive "operation: 'muteAllMembers'" in the callback of onGroupEvent.
2771
2897
  *
2772
2898
  * ```typescript
2773
2899
  * connection.disableSendGroupMsg({groupId: 'groupId'})
@@ -2783,7 +2909,7 @@ export declare namespace EasemobChat {
2783
2909
  ): Promise<AsyncResult<{ mute: true }>>;
2784
2910
 
2785
2911
  /**
2786
- * Unmutes all members. Operation permissions: group admin or above identity, Group members will receive type: 'rmgroupmute' in the callback of onpresence.
2912
+ * Unmute all members. Only the group admin or above can call this method. Group members will receive "operation: 'unmuteAllMembers'" in the callback of onGroupEvent.
2787
2913
  *
2788
2914
  * ```typescript
2789
2915
  * connection.enableSendGroupMsg({groupId: 'groupId'})
@@ -2799,7 +2925,9 @@ export declare namespace EasemobChat {
2799
2925
  ): Promise<AsyncResult<{ mute: false }>>;
2800
2926
 
2801
2927
  /**
2802
- * Adds members to the group whitelist. Members of the white list can continue to speak after the group bans. Operation authority: Group admin or above, Users added to the whitelist will receive type: 'addusertogroupwhitelist' in the callback of onPresence.
2928
+ * @hidden
2929
+ * @deprecated Use {@link addUsersToGroupAllowlist} instead.
2930
+ * 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.
2803
2931
  *
2804
2932
  * ```typescript
2805
2933
  * connection.addUsersToGroupWhitelist({groupId: 'groupId'})
@@ -2815,6 +2943,23 @@ export declare namespace EasemobChat {
2815
2943
  }
2816
2944
  ): Promise<AsyncResult<GroupRequestResult[]>>;
2817
2945
 
2946
+ /**
2947
+ * 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.
2948
+ *
2949
+ * ```typescript
2950
+ * connection.addUsersToGroupAllowlist({groupId: 'groupId'})
2951
+ * ```
2952
+ */
2953
+ addUsersToGroupAllowlist(
2954
+ this: Connection,
2955
+ params: {
2956
+ groupId: string;
2957
+ users: UserId[];
2958
+ success?: (res: AsyncResult<GroupRequestResult[]>) => void;
2959
+ error?: (error: ErrorEvent) => void;
2960
+ }
2961
+ ): Promise<AsyncResult<GroupRequestResult[]>>;
2962
+
2818
2963
  /** @deprecated */
2819
2964
  rmUsersFromGroupWhitelist(
2820
2965
  this: Connection,
@@ -2827,13 +2972,12 @@ export declare namespace EasemobChat {
2827
2972
  ): Promise<AsyncResult<GroupRequestResult>>;
2828
2973
 
2829
2974
  /**
2830
- * Remove the group whitelist member. Operation permissions: group admin or above identity, The user whose whitelist is removed will receive type:'rmUserFromGroupWhiteList' in the onPresence callback.
2975
+ * @deprecated Use {@link removeGroupAllowlistMember} instead.
2976
+ * 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.
2831
2977
  *
2832
2978
  * ```typescript
2833
2979
  * connection.removeGroupWhitelistMember({groupId: 'groupId', userName: 'user1'})
2834
2980
  * ```
2835
- *
2836
- * @since v4.0.1
2837
2981
  */
2838
2982
  removeGroupWhitelistMember(
2839
2983
  this: Connection,
@@ -2846,7 +2990,25 @@ export declare namespace EasemobChat {
2846
2990
  ): Promise<AsyncResult<GroupRequestResult>>;
2847
2991
 
2848
2992
  /**
2849
- * Gets group white list. Operation authority: admin or above.
2993
+ * 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.
2994
+ *
2995
+ * ```typescript
2996
+ * connection.removeGroupAllowlistMember({groupId: 'groupId', userName: 'user1'})
2997
+ * ```
2998
+ */
2999
+ removeGroupAllowlistMember(
3000
+ this: Connection,
3001
+ params: {
3002
+ groupId: string;
3003
+ userName: UserId;
3004
+ success?: (res: AsyncResult<GroupRequestResult>) => void;
3005
+ error?: (error: ErrorEvent) => void;
3006
+ }
3007
+ ): Promise<AsyncResult<GroupRequestResult>>;
3008
+
3009
+ /**
3010
+ * @deprecated Use {@link getGroupAllowlist} instead.
3011
+ * Gets the group allowlist. Only the group admin or above can call this method.
2850
3012
  *
2851
3013
  * ```typescript
2852
3014
  * connection.getGroupWhitelist({groupId: 'groupId'})
@@ -2861,6 +3023,22 @@ export declare namespace EasemobChat {
2861
3023
  }
2862
3024
  ): Promise<AsyncResult<UserId[]>>;
2863
3025
 
3026
+ /**
3027
+ * Gets the group allowlist. Only the group admin or above can call this method.
3028
+ *
3029
+ * ```typescript
3030
+ * connection.getGroupAllowlist({groupId: 'groupId'})
3031
+ * ```
3032
+ */
3033
+ getGroupAllowlist(
3034
+ this: Connection,
3035
+ params: {
3036
+ groupId: string;
3037
+ success?: (res: AsyncResult<UserId[]>) => void;
3038
+ error?: (error: ErrorEvent) => void;
3039
+ }
3040
+ ): Promise<AsyncResult<UserId[]>>;
3041
+
2864
3042
  /** @deprecated */
2865
3043
  isGroupWhiteUser(
2866
3044
  this: Connection,
@@ -2873,12 +3051,12 @@ export declare namespace EasemobChat {
2873
3051
  ): Promise<AsyncResult<IsInGroupWhiteListResult>>;
2874
3052
 
2875
3053
  /**
2876
- * Queries whether the group member is in white list. Operation permission: app admin can query all users; App users can query themselves.
3054
+ * @deprecated Use {@link isInGroupAllowlist} instead.
3055
+ * Checks whether the current member is on the allowlist. The app admin can check all users; app users can only check themselves.
2877
3056
  *
2878
3057
  * ```typescript
2879
3058
  * connection.isInGroupWhiteList({groupId: 'groupId', userName: 'user1'})
2880
3059
  * ```
2881
- * @since v4.0.1
2882
3060
  */
2883
3061
  isInGroupWhiteList(
2884
3062
  this: Connection,
@@ -2891,7 +3069,24 @@ export declare namespace EasemobChat {
2891
3069
  ): Promise<AsyncResult<IsInGroupWhiteListResult>>;
2892
3070
 
2893
3071
  /**
2894
- * Queries which users have read group message [Value-added function] needs to be opened separately.
3072
+ * Checks whether the current member is on the allowlist. The app admin can check all users; app users can only check themselves.
3073
+ *
3074
+ * ```typescript
3075
+ * connection.isInGroupAllowlist({groupId: 'groupId', userName: 'user1'})
3076
+ * ```
3077
+ */
3078
+ isInGroupAllowlist(
3079
+ this: Connection,
3080
+ params: {
3081
+ groupId: string;
3082
+ userName: UserId;
3083
+ success?: (res: AsyncResult<IsInGroupWhiteListResult>) => void;
3084
+ error?: (error: ErrorEvent) => void;
3085
+ }
3086
+ ): Promise<AsyncResult<IsInGroupWhiteListResult>>;
3087
+
3088
+ /**
3089
+ * Checks which members have read group message. This is a [value-added function] and .
2895
3090
  *
2896
3091
  * ```typescript
2897
3092
  * connection.getGroupMsgReadUser({groupId: 'groupId', msgId: 'msgId'})
@@ -2908,7 +3103,7 @@ export declare namespace EasemobChat {
2908
3103
  ): Promise<AsyncResult<GetGroupMsgReadUserResult>>;
2909
3104
 
2910
3105
  /**
2911
- * Gets group announcement
3106
+ * Gets the group announcement.
2912
3107
  *
2913
3108
  * ```typescript
2914
3109
  * connection.fetchGroupAnnouncement({groupId: 'groupId'})
@@ -2924,7 +3119,7 @@ export declare namespace EasemobChat {
2924
3119
  ): Promise<AsyncResult<{ announcement: string }>>;
2925
3120
 
2926
3121
  /**
2927
- * Updates group announcement.
3122
+ * Updates the group announcement.
2928
3123
  *
2929
3124
  * ```typescript
2930
3125
  * connection.updateGroupAnnouncement({groupId: 'groupId', announcement: 'hello'})
@@ -2943,7 +3138,7 @@ export declare namespace EasemobChat {
2943
3138
  ): Promise<AsyncResult<UpdateGroupAnnouncementResult>>;
2944
3139
 
2945
3140
  /**
2946
- * Uploads group shared file.
3141
+ * Uploads shared files to the group.
2947
3142
  *
2948
3143
  * ```typescript
2949
3144
  * connection.uploadGroupSharedFile({groupId: 'groupId', file: 'file object', onFileUploadProgress: onFileUploadProgress, onFileUploadComplete: onFileUploadComplete,onFileUploadError:onFileUploadError,onFileUploadCanceled:onFileUploadCanceled})
@@ -2962,7 +3157,7 @@ export declare namespace EasemobChat {
2962
3157
  ): void;
2963
3158
 
2964
3159
  /**
2965
- * Deletes group shared file
3160
+ * Deletes shared files of the group.
2966
3161
  *
2967
3162
  * ```typescript
2968
3163
  * connection.deleteGroupSharedFile({groupId: 'groupId', fileId: 'fileId'})
@@ -2981,7 +3176,8 @@ export declare namespace EasemobChat {
2981
3176
  ): Promise<AsyncResult<DeleteGroupSharedFileResult>>;
2982
3177
 
2983
3178
  /**
2984
- * Gets a list of group shared files.
3179
+ * @deprecated Use {@link getGroupSharedFilelist} instead.
3180
+ * Gets a list of shared files in the group.
2985
3181
  *
2986
3182
  * ```typescript
2987
3183
  * connection.fetchGroupSharedFileList({groupId: 'groupId'})
@@ -3000,6 +3196,26 @@ export declare namespace EasemobChat {
3000
3196
  }
3001
3197
  ): Promise<AsyncResult<FetchGroupSharedFileListResult>>;
3002
3198
 
3199
+ /**
3200
+ * Gets a list of shared files in the group.
3201
+ *
3202
+ * ```typescript
3203
+ * connection.getGroupSharedFilelist({groupId: 'groupId'})
3204
+ * ```
3205
+ */
3206
+ getGroupSharedFilelist(
3207
+ this: Connection,
3208
+ params: {
3209
+ groupId: string;
3210
+ pageNum?: number;
3211
+ pageSize?: number;
3212
+ success?: (
3213
+ res: AsyncResult<FetchGroupSharedFileListResult>
3214
+ ) => void;
3215
+ error?: (error: ErrorEvent) => void;
3216
+ }
3217
+ ): Promise<AsyncResult<FetchGroupSharedFileListResult>>;
3218
+
3003
3219
  /**
3004
3220
  * Down load group file.
3005
3221
  *
@@ -3020,7 +3236,8 @@ export declare namespace EasemobChat {
3020
3236
 
3021
3237
  // Contact API
3022
3238
  /**
3023
- * Gets friends blacklist.
3239
+ * @deprecated Use {@link getBlocklist} instead.
3240
+ * Gets the blocklist.
3024
3241
  *
3025
3242
  * ```typescript
3026
3243
  * connection.getBlacklist()
@@ -3034,6 +3251,21 @@ export declare namespace EasemobChat {
3034
3251
  }
3035
3252
  ): Promise<AsyncResult<UserId[]>>;
3036
3253
 
3254
+ /**
3255
+ * Gets the blocklist.
3256
+ *
3257
+ * ```typescript
3258
+ * connection.getBlocklist()
3259
+ * ```
3260
+ */
3261
+ getBlocklist(
3262
+ this: Connection,
3263
+ params?: {
3264
+ success?: (res: AsyncResult<UserId[]>) => void;
3265
+ error?: (error: ErrorEvent) => void;
3266
+ }
3267
+ ): Promise<AsyncResult<UserId[]>>;
3268
+
3037
3269
  /** @deprecated */
3038
3270
  getRoster(
3039
3271
  this: Connection,
@@ -3044,12 +3276,11 @@ export declare namespace EasemobChat {
3044
3276
  ): Promise<AsyncResult<UserId[]>>;
3045
3277
 
3046
3278
  /**
3047
- * Gets contacts.
3279
+ * Gets the contact list.
3048
3280
  *
3049
3281
  * ```typescript
3050
3282
  * connection.getContacts()
3051
3283
  * ```
3052
- * @since v4.0.1
3053
3284
  */
3054
3285
  getContacts(
3055
3286
  this: Connection,
@@ -3072,12 +3303,11 @@ export declare namespace EasemobChat {
3072
3303
  ): Promise<AsyncResult<UploadTokenResult>>;
3073
3304
 
3074
3305
  /**
3075
- * If you use the SDK on a native client and integrate third-party push functionality, you can call this method to upload the Token to the server.
3306
+ * Uploads the token to the server. This method is used when the SDK is used on a native client on which a third-party push service is to be integrated.
3076
3307
  *
3077
3308
  * ```typescript
3078
3309
  * connection.uploadPushToken({deviceId: 'deviceId', deviceToken: 'deviceToken', notifierName: 'notifierName'})
3079
3310
  * ```
3080
- * @since v4.0.1
3081
3311
  */
3082
3312
  uploadPushToken(
3083
3313
  this: Connection,
@@ -3091,7 +3321,8 @@ export declare namespace EasemobChat {
3091
3321
  ): Promise<AsyncResult<UploadTokenResult>>;
3092
3322
 
3093
3323
  /**
3094
- * Gets the session list.
3324
+ * @deprecated Use {@link getConversationlist} instead.
3325
+ * Gets the conversation list.
3095
3326
  *
3096
3327
  * ```typescript
3097
3328
  * connection.getSessionList()
@@ -3103,7 +3334,11 @@ export declare namespace EasemobChat {
3103
3334
  success?: (res: AsyncResult<SessionInfo[]>) => void;
3104
3335
  error?: (error: ErrorEvent) => void;
3105
3336
  }
3106
- ): Promise<AsyncResult<SessionInfo[]>>;
3337
+ ): Promise<
3338
+ AsyncResult<{
3339
+ channel_infos: SessionInfo[];
3340
+ }>
3341
+ >;
3107
3342
 
3108
3343
  /**
3109
3344
  * Gets the conversation list and the latest message under the conversation.
@@ -3121,6 +3356,7 @@ export declare namespace EasemobChat {
3121
3356
  ): Promise<AsyncResult<conversationList[]>>;
3122
3357
 
3123
3358
  /**
3359
+ * @deprecated Use Use {@link deleteConversation} instead.
3124
3360
  * Delete the session.
3125
3361
  *
3126
3362
  * ```typescript
@@ -3139,6 +3375,25 @@ export declare namespace EasemobChat {
3139
3375
  ): Promise<AsyncResult<DeleteSessionResult>>;
3140
3376
 
3141
3377
  /**
3378
+ * Deletes the conversation.
3379
+ *
3380
+ * ```typescript
3381
+ * connection.deleteConversation()
3382
+ * ```
3383
+ */
3384
+ deleteConversation(
3385
+ this: Connection,
3386
+ params: {
3387
+ channel: string;
3388
+ chatType: 'singleChat' | 'groupChat';
3389
+ deleteRoam: boolean;
3390
+ success?: (res: AsyncResult<DeleteSessionResult>) => void;
3391
+ error?: (error: ErrorEvent) => void;
3392
+ }
3393
+ ): Promise<AsyncResult<DeleteSessionResult>>;
3394
+
3395
+ /**
3396
+ * @deprecated Use {@link updateUserInfo} instead.
3142
3397
  * Updates own information.
3143
3398
  *
3144
3399
  * ```typescript
@@ -3154,7 +3409,22 @@ export declare namespace EasemobChat {
3154
3409
  ): Promise<AsyncResult<UpdateOwnUserInfoParams>>;
3155
3410
 
3156
3411
  /**
3157
- * Queres user information.
3412
+ * Modifies the user's attributes.
3413
+ *
3414
+ * ```typescript
3415
+ * connection.updateOwnUserInfo({nickname: 'Tom', avatarurl: 'avatarurl', mail: 'abc@gmail,com', ext: JSON.stringify({hobby: 'football'})})
3416
+ *
3417
+ * connection.updateUserInfo('nickname', 'Tom')
3418
+ * ```
3419
+ */
3420
+ updateUserInfo(
3421
+ this: Connection,
3422
+ params: UpdateOwnUserInfoParams | ConfigurableKey,
3423
+ value?: any
3424
+ ): Promise<AsyncResult<UpdateOwnUserInfoParams>>;
3425
+
3426
+ /**
3427
+ * Queries the user attributes.
3158
3428
  *
3159
3429
  * ```typescript
3160
3430
  * connection.fetchUserInfoById('user1') | fetchUserInfoById(['user1', 'user2'])
@@ -3163,11 +3433,15 @@ export declare namespace EasemobChat {
3163
3433
  fetchUserInfoById(
3164
3434
  this: Connection,
3165
3435
  userId: UserId | UserId[],
3166
- properties: ConfigurableKey[] | ConfigurableKey
3167
- ): Promise<AsyncResult<UpdateOwnUserInfoParams>>;
3436
+ properties?: ConfigurableKey[] | ConfigurableKey
3437
+ ): Promise<
3438
+ AsyncResult<{
3439
+ [key: string]: UpdateOwnUserInfoParams;
3440
+ }>
3441
+ >;
3168
3442
 
3169
3443
  /**
3170
- * When registering, you can set a nickname, which is used to display when pushing messages. You can call the following API to modify the nickname.
3444
+ * Changes the nickname shown when the message push notification is received. This nickname is specified during user registration and it's not the same as the nickname attribute of the user.
3171
3445
  *
3172
3446
  * ```typescript
3173
3447
  * connection.updateCurrentUserNick('Tom')
@@ -3179,6 +3453,7 @@ export declare namespace EasemobChat {
3179
3453
  ): Promise<AsyncResult<BaseUserInfo[]>>;
3180
3454
 
3181
3455
  /**
3456
+ * @deprecated Use {@link getHistoryMessages} instead.
3182
3457
  * Gets historical messages.
3183
3458
  *
3184
3459
  * ```typescript
@@ -3214,10 +3489,10 @@ export declare namespace EasemobChat {
3214
3489
  cursor?: number | string | null;
3215
3490
  /** The number of messages to retrieve each time. The default value is 20,The maximum value is 50. */
3216
3491
  pageSize?: number;
3217
- /** The chat type for SDK V4.0:
3492
+ /** The chat type:
3218
3493
  * - `singleChat`: one-to-one chat;
3219
- * - `groupchat`: group chat;
3220
- * - `chatroom`: chat room.
3494
+ * - `groupChat`: group chat;
3495
+ * - `chatRoom`: chat room.
3221
3496
  * - (Default)`singleChat`: No.
3222
3497
  */
3223
3498
  chatType?: 'singleChat' | 'groupChat' | 'chatRoom';
@@ -3233,7 +3508,7 @@ export declare namespace EasemobChat {
3233
3508
  ): Promise<HistoryMessages>;
3234
3509
 
3235
3510
  /**
3236
- * Adds Contact.
3511
+ * Adds a friend.
3237
3512
  *
3238
3513
  * ```typescript
3239
3514
  * connection.addContact('user1', 'I am Bob')
@@ -3242,7 +3517,7 @@ export declare namespace EasemobChat {
3242
3517
  addContact(this: Connection, to: string, message?: string): void;
3243
3518
 
3244
3519
  /**
3245
- * Deletes contact.
3520
+ * Deletes the contact.
3246
3521
  *
3247
3522
  * ```typescript
3248
3523
  * connection.deleteContact('user1')
@@ -3254,12 +3529,11 @@ export declare namespace EasemobChat {
3254
3529
  acceptInvitation(this: Connection, to: string): void;
3255
3530
 
3256
3531
  /**
3257
- * Accepting contact request
3532
+ * Accepts a friend request.
3258
3533
  *
3259
3534
  * ```typescript
3260
3535
  * connection.acceptContactInvite('user1')
3261
3536
  * ```
3262
- * @since v4.0.1
3263
3537
  */
3264
3538
  acceptContactInvite(this: Connection, to: string): void;
3265
3539
 
@@ -3267,12 +3541,11 @@ export declare namespace EasemobChat {
3267
3541
  declineInvitation(this: Connection, to: string): void;
3268
3542
 
3269
3543
  /**
3270
- * Declines contact invite.
3544
+ * Declines a friend request.
3271
3545
  *
3272
3546
  * ```typescript
3273
3547
  * connection.declineContactInvite('user1')
3274
3548
  * ```
3275
- * @since v4.0.1
3276
3549
  */
3277
3550
  declineContactInvite(this: Connection, to: string): void;
3278
3551
 
@@ -3285,12 +3558,12 @@ export declare namespace EasemobChat {
3285
3558
  ): void;
3286
3559
 
3287
3560
  /**
3561
+ * @deprecated
3288
3562
  * Add contacts to your blacklist.
3289
3563
  *
3290
3564
  * ```typescript
3291
3565
  * connection.addUsersToBlacklist({name: 'user1'})
3292
3566
  * ```
3293
- * @since v4.0.1
3294
3567
  */
3295
3568
  addUsersToBlacklist(
3296
3569
  this: Connection,
@@ -3299,6 +3572,20 @@ export declare namespace EasemobChat {
3299
3572
  }
3300
3573
  ): void;
3301
3574
 
3575
+ /**
3576
+ * Adds a contact to the blocklist.
3577
+ *
3578
+ * ```typescript
3579
+ * connection.addUsersToBlocklist({name: 'user1'})
3580
+ * ```
3581
+ */
3582
+ addUsersToBlocklist(
3583
+ this: Connection,
3584
+ options: {
3585
+ name: UserId | UserId[];
3586
+ }
3587
+ ): void;
3588
+
3302
3589
  /** @deprecated */
3303
3590
  removeFromBlackList(
3304
3591
  this: Connection,
@@ -3308,12 +3595,12 @@ export declare namespace EasemobChat {
3308
3595
  ): void;
3309
3596
 
3310
3597
  /**
3598
+ * @deprecated
3311
3599
  * Removes friends from your blacklist
3312
3600
  *
3313
3601
  * ```typescript
3314
3602
  * connection.removeUserFromBlackList({name: 'user1'})
3315
3603
  * ```
3316
- * @since v4.0.1
3317
3604
  */
3318
3605
  removeUserFromBlackList(
3319
3606
  this: Connection,
@@ -3322,6 +3609,20 @@ export declare namespace EasemobChat {
3322
3609
  }
3323
3610
  ): void;
3324
3611
 
3612
+ /**
3613
+ * Removes contacts from the blocklist.
3614
+ *
3615
+ * ```typescript
3616
+ * connection.removeUserFromBlocklist({name: 'user1'})
3617
+ * ```
3618
+ */
3619
+ removeUserFromBlocklist(
3620
+ this: Connection,
3621
+ options: {
3622
+ name: UserId | UserId[];
3623
+ }
3624
+ ): void;
3625
+
3325
3626
  /** @deprecated*/
3326
3627
  subscribe(
3327
3628
  this: Connection,
@@ -3335,7 +3636,7 @@ export declare namespace EasemobChat {
3335
3636
  removeRoster(this: Connection, options: { to: UserId }): void;
3336
3637
 
3337
3638
  /**
3338
- * Recall a message
3639
+ * Recalls a message.
3339
3640
  *
3340
3641
  * ```typescript
3341
3642
  * connection.recallMessage({mid: 'messageId', to: 'user1', type: 'singleChat', isChatThread: false})
@@ -3429,6 +3730,7 @@ export declare namespace EasemobChat {
3429
3730
  }): Promise<AsyncResult<PublishPresenceResult>>;
3430
3731
 
3431
3732
  /**
3733
+ * @deprecated Use {@link getSubscribedPresencelist} instead.
3432
3734
  * Uses pagination to get a list of users whose presence states you have subscribed to.
3433
3735
  *
3434
3736
  * ```typescript
@@ -3449,6 +3751,27 @@ export declare namespace EasemobChat {
3449
3751
  }
3450
3752
  ): Promise<AsyncResult<GetSubscribedPresenceListResult>>;
3451
3753
 
3754
+ /**
3755
+ * Uses pagination to get a list of users whose presence states you have subscribed to.
3756
+ *
3757
+ * ```typescript
3758
+ * connection.getSubscribedPresencelist({usernames: ['user1','user2']})
3759
+ * ```
3760
+ */
3761
+ getSubscribedPresencelist(
3762
+ this: Connection,
3763
+ params: {
3764
+ /** The current page number, starting from 1. */
3765
+ pageNum: number;
3766
+ /** The number of subscribers per page. */
3767
+ pageSize: number;
3768
+ success?: (
3769
+ res: AsyncResult<GetSubscribedPresenceListResult>
3770
+ ) => void;
3771
+ error?: (error: ErrorEvent) => void;
3772
+ }
3773
+ ): Promise<AsyncResult<GetSubscribedPresenceListResult>>;
3774
+
3452
3775
  /**
3453
3776
  * Gets the current presence state of users.
3454
3777
  *
@@ -3467,42 +3790,226 @@ export declare namespace EasemobChat {
3467
3790
  ): Promise<AsyncResult<SubscribePresenceResult>>;
3468
3791
 
3469
3792
  /**
3470
- * Reports a message.
3793
+ * Creates a chatThread.
3471
3794
  *
3472
3795
  * ```typescript
3473
- * reportMessage({reportType: 'adult', reportReason: 'reason', messageId: 'id'})
3796
+ * connection.createChatThread({parentId: 'parentId',name: 'threadName',messageId: 'messageId'})
3474
3797
  * ```
3475
3798
  */
3476
- reportMessage(
3799
+ createChatThread(
3477
3800
  this: Connection,
3478
3801
  params: {
3479
- reportType: string;
3480
- reportReason: string;
3802
+ /** Generally refers to the group ID. */
3803
+ parentId: string;
3804
+ /** The chatThread name. */
3805
+ name: string;
3806
+ /** The parent message ID. */
3481
3807
  messageId: string;
3482
3808
  }
3483
- ): Promise<void>;
3809
+ ): Promise<AsyncResult<CreateChatThreadResult>>;
3484
3810
 
3485
3811
  /**
3486
- * Set the DND Settings for the current login user.
3812
+ * Joins the chatThread.
3487
3813
  *
3488
3814
  * ```typescript
3489
- * connection.setSilentModeForAll({options: {paramType: 0, remindType: 'ALL'}})
3815
+ * connection.joinChatThread({chatThreadId: 'chatThreadId'})
3490
3816
  * ```
3491
3817
  */
3492
- setSilentModeForAll(
3818
+ joinChatThread(
3493
3819
  this: Connection,
3494
3820
  params: {
3495
- /** Options object include paramType,remindType,duration,startTime,endTime. */
3496
- options: SilentModeParamType;
3497
- success?: (
3498
- res: AsyncResult<SilentModeConversationType>
3499
- ) => void;
3500
- error?: (error: ErrorEvent) => void;
3821
+ /** The chatThread ID. */
3822
+ chatThreadId: string;
3501
3823
  }
3502
- ): Promise<AsyncResult<SilentModeConversationType>>;
3824
+ ): Promise<AsyncResult<JoinChatThreadResult>>;
3503
3825
 
3504
3826
  /**
3505
- * Get the DND Settings of the current user.
3827
+ * Leaves the chatThread.
3828
+ *
3829
+ * ```typescript
3830
+ * connection.leaveChatThread({chatThreadId: 'chatThreadId'})
3831
+ * ```
3832
+ */
3833
+ leaveChatThread(
3834
+ this: Connection,
3835
+ params: {
3836
+ /** The chatThread ID. */
3837
+ chatThreadId: string;
3838
+ }
3839
+ ): Promise<void>;
3840
+
3841
+ /**
3842
+ * Deletes the chatThread,group leader and administrator have this permission.
3843
+ *
3844
+ * ```typescript
3845
+ * connection.destroyChatThread({chatThreadId: 'chatThreadId'})
3846
+ * ```
3847
+ */
3848
+ destroyChatThread(
3849
+ this: Connection,
3850
+ params: {
3851
+ /** The chatThread ID. */
3852
+ chatThreadId: string;
3853
+ }
3854
+ ): Promise<void>;
3855
+
3856
+ /**
3857
+ * Modifies the chatThread name.
3858
+ *
3859
+ * ```typescript
3860
+ * connection.changeChatThreadName({chatThreadId: 'chatThreadId',name: 'name'})
3861
+ * ```
3862
+ */
3863
+ changeChatThreadName(
3864
+ this: Connection,
3865
+ params: {
3866
+ /** The chatThread ID. */
3867
+ chatThreadId: string;
3868
+ /** The chatThread name. */
3869
+ name: string;
3870
+ }
3871
+ ): Promise<AsyncResult<ChangeChatThreadName>>;
3872
+
3873
+ /**
3874
+ * Lists all members of the chatThread with pagination.
3875
+ *
3876
+ * ```typescript
3877
+ * connection.getChatThreadMembers({chatThreadId: 'chatThreadId',pageSize:20,cursor:'cursor'})
3878
+ * ```
3879
+ */
3880
+ getChatThreadMembers(
3881
+ this: Connection,
3882
+ params: {
3883
+ /** The Thread ID. */
3884
+ chatThreadId: string;
3885
+ /** The number of members per page. The default value is 20, and the maximum value is 50.*/
3886
+ pageSize?: number;
3887
+ /** 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 empty string, the data of the first page will be fetched.*/
3888
+ cursor?: string;
3889
+ }
3890
+ ): Promise<AsyncResult<ChatThreadMembers>>;
3891
+
3892
+ /**
3893
+ * Removes a member from the chatThread.
3894
+ *
3895
+ * ```typescript
3896
+ * connection.removeChatThreadMember({chatThreadId: 'chatThreadId',username:'username'})
3897
+ * ```
3898
+ */
3899
+ removeChatThreadMember(
3900
+ this: Connection,
3901
+ params: {
3902
+ /** The chatThread ID. */
3903
+ chatThreadId: string;
3904
+ /** The member ID to remove. */
3905
+ username: string;
3906
+ }
3907
+ ): Promise<AsyncResult<RemoveMemberResult>>;
3908
+
3909
+ /**
3910
+ * Gets the list of joined chatThreads with pagination.When parentId is not null, get the list of chatThread under the specified group.
3911
+ *
3912
+ * ```typescript
3913
+ * connection.getJoinedChatThreads({parentId: 'parentId',cursor: 'cursor',pageSize: 50})
3914
+ * ```
3915
+ */
3916
+ getJoinedChatThreads(
3917
+ this: Connection,
3918
+ params: {
3919
+ /** Generally refers to the group ID. */
3920
+ parentId?: string;
3921
+ /** The number of thread per page. The default value is 20, and the maximum value is 50. */
3922
+ pageSize?: number;
3923
+ /** 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.*/
3924
+ cursor?: string;
3925
+ }
3926
+ ): Promise<AsyncResult<ChatThreadDetail[]>>;
3927
+
3928
+ /**
3929
+ * Gets the thread list of the specified group with pagination.
3930
+ * ```typescript
3931
+ * connection.getChatThreads({parentId: 'parentId, cursor:'cursor' ,pageSize: 50})
3932
+ * ```
3933
+ */
3934
+ getChatThreads(
3935
+ this: Connection,
3936
+ params: {
3937
+ /** Generally refers to the group ID. */
3938
+ parentId: string;
3939
+ /** The number of thread per page. The default value is 20, and the maximum value is 50. */
3940
+ pageSize?: number;
3941
+ /** 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 empty string, the data of the first page will be fetched.*/
3942
+ cursor?: string;
3943
+ }
3944
+ ): Promise<AsyncResult<ChatThreadDetail[]>>;
3945
+
3946
+ /**
3947
+ * Gets the latest message content of the chatThread in batch,with a maximum of 20 messages.
3948
+ *
3949
+ * ```typescript
3950
+ * connection.getChatThreadLastMessage({chatThreadIds: ['chatThreadId1','chatThreadId2']})
3951
+ * ```
3952
+ */
3953
+ getChatThreadLastMessage(
3954
+ this: Connection,
3955
+ params: {
3956
+ /** The array of chatThread IDs to query.*/
3957
+ chatThreadIds: string[];
3958
+ }
3959
+ ): Promise<AsyncResult<ChatThreadLastMessage>>;
3960
+
3961
+ /**
3962
+ * Gets detail of the chatThread.
3963
+ *
3964
+ * ```typescript
3965
+ * connection.getChatThreadDetail({chatThreadId: 'chatThreadId'})
3966
+ * ```
3967
+ */
3968
+ getChatThreadDetail(
3969
+ this: Connection,
3970
+ params: {
3971
+ /** The chatThread ID. */
3972
+ chatThreadId: string;
3973
+ }
3974
+ ): Promise<AsyncResult<ChatThreadDetail>>;
3975
+
3976
+ /**
3977
+ * Reports a message.
3978
+ *
3979
+ * ```typescript
3980
+ * reportMessage({reportType: 'adult', reportReason: 'reason', messageId: 'id'})
3981
+ * ```
3982
+ */
3983
+ reportMessage(
3984
+ this: Connection,
3985
+ params: {
3986
+ reportType: string;
3987
+ reportReason: string;
3988
+ messageId: string;
3989
+ }
3990
+ ): Promise<void>;
3991
+
3992
+ /**
3993
+ * Set the DND Settings for the current login user.
3994
+ *
3995
+ * ```typescript
3996
+ * connection.setSilentModeForAll({options: {paramType: 0, remindType: 'ALL'}})
3997
+ * ```
3998
+ */
3999
+ setSilentModeForAll(
4000
+ this: Connection,
4001
+ params: {
4002
+ /** Options object include paramType,remindType,duration,startTime,endTime. */
4003
+ options: SilentModeParamType;
4004
+ success?: (
4005
+ res: AsyncResult<SilentModeConversationType>
4006
+ ) => void;
4007
+ error?: (error: ErrorEvent) => void;
4008
+ }
4009
+ ): Promise<AsyncResult<SilentModeConversationType>>;
4010
+
4011
+ /**
4012
+ * Get the DND Settings of the current user.
3506
4013
  *
3507
4014
  * ```typescript
3508
4015
  * connection.getSilentModeForAll()
@@ -3639,55 +4146,6 @@ export declare namespace EasemobChat {
3639
4146
  }
3640
4147
  ): Promise<AsyncResult<TranslationLanguageType>>;
3641
4148
 
3642
- /**
3643
- * Creates a chatThread.
3644
- *
3645
- * ```typescript
3646
- * connection.createChatThread({parentId: 'parentId',name: 'threadName',messageId: 'messageId'})
3647
- * ```
3648
- */
3649
- createChatThread(
3650
- this: Connection,
3651
- params: {
3652
- /** Generally refers to the group ID. */
3653
- parentId: string;
3654
- /** The chatThread name. */
3655
- name: string;
3656
- /** The parent message ID. */
3657
- messageId: string;
3658
- }
3659
- ): Promise<AsyncResult<CreateChatThreadResult>>;
3660
-
3661
- /**
3662
- * Joins the chatThread.
3663
- *
3664
- * ```typescript
3665
- * connection.joinChatThread({chatThreadId: 'chatThreadId'})
3666
- * ```
3667
- */
3668
- joinChatThread(
3669
- this: Connection,
3670
- params: {
3671
- /** The chatThread ID. */
3672
- chatThreadId: string;
3673
- }
3674
- ): Promise<AsyncResult<JoinChatThreadResult>>;
3675
-
3676
- /**
3677
- * Leaves the chatThread.
3678
- *
3679
- * ```typescript
3680
- * connection.leaveChatThread({chatThreadId: 'chatThreadId'})
3681
- * ```
3682
- */
3683
- leaveChatThread(
3684
- this: Connection,
3685
- params: {
3686
- /** The chatThread ID. */
3687
- chatThreadId: string;
3688
- }
3689
- ): Promise<void>;
3690
-
3691
4149
  /**
3692
4150
  * Adds a reaction to the message.
3693
4151
  *
@@ -3705,21 +4163,6 @@ export declare namespace EasemobChat {
3705
4163
  }
3706
4164
  ): Promise<void>;
3707
4165
 
3708
- /**
3709
- * Deletes the chatThread,group leader and administrator have this permission.
3710
- *
3711
- * ```typescript
3712
- * connection.destroyChatThread({chatThreadId: 'chatThreadId'})
3713
- * ```
3714
- */
3715
- destroyChatThread(
3716
- this: Connection,
3717
- params: {
3718
- /** The chatThread ID. */
3719
- chatThreadId: string;
3720
- }
3721
- ): Promise<void>;
3722
-
3723
4166
  /**
3724
4167
  * Removes a reaction from a message.
3725
4168
  *
@@ -3738,133 +4181,36 @@ export declare namespace EasemobChat {
3738
4181
  ): Promise<void>;
3739
4182
 
3740
4183
  /**
3741
- * Modifies the chatThread name.
3742
- *
3743
- * ```typescript
3744
- * connection.changeChatThreadName({chatThreadId: 'chatThreadId',name: 'name'})
3745
- * ```
3746
- */
3747
- changeChatThreadName(
3748
- this: Connection,
3749
- params: {
3750
- /** The chatThread ID. */
3751
- chatThreadId: string;
3752
- /** The chatThread name. */
3753
- name: string;
3754
- }
3755
- ): Promise<AsyncResult<ChangeChatThreadName>>;
3756
-
3757
- /**
3758
- * Lists all members of the chatThread with pagination.
3759
- *
3760
- * ```typescript
3761
- * connection.getChatThreadMembers({chatThreadId: 'chatThreadId',pageSize:20,cursor:'cursor'})
3762
- * ```
3763
- */
3764
- getChatThreadMembers(
3765
- this: Connection,
3766
- params: {
3767
- /** The Thread ID. */
3768
- chatThreadId: string;
3769
- /** The number of members per page. The default value is 20, and the maximum value is 50.*/
3770
- pageSize?: number;
3771
- /** 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 empty string, the data of the first page will be fetched.*/
3772
- cursor?: string;
3773
- }
3774
- ): Promise<AsyncResult<ChatThreadMembers>>;
3775
-
3776
- /**
3777
- * Removes a member from the chatThread.
3778
- *
3779
- * ```typescript
3780
- * connection.removeChatThreadMember({chatThreadId: 'chatThreadId',username:'username'})
3781
- * ```
3782
- */
3783
- removeChatThreadMember(
3784
- this: Connection,
3785
- params: {
3786
- /** The chatThread ID. */
3787
- chatThreadId: string;
3788
- /** The member ID to remove. */
3789
- username: string;
3790
- }
3791
- ): Promise<AsyncResult<RemoveMemberResult>>;
3792
-
3793
- /**
3794
- * Gets the list of joined chatThreads with pagination.When parentId is not null, get the list of chatThread under the specified group.
3795
- *
3796
- * ```typescript
3797
- * connection.getJoinedChatThreads({parentId: 'parentId',cursor: 'cursor',pageSize: 50})
3798
- * ```
3799
- */
3800
- getJoinedChatThreads(
3801
- this: Connection,
3802
- params: {
3803
- /** Generally refers to the group ID. */
3804
- parentId?: string;
3805
- /** The number of thread per page. The default value is 20, and the maximum value is 50. */
3806
- pageSize?: number;
3807
- /** 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.*/
3808
- cursor?: string;
3809
- }
3810
- ): Promise<AsyncResult<ChatThreadDetail[]>>;
3811
-
3812
- /**
3813
- * Gets the thread list of the specified group with pagination.
3814
- * ```typescript
3815
- * connection.getChatThreads({parentId: 'parentId, cursor:'cursor' ,pageSize: 50})
3816
- * ```
3817
- */
3818
- getChatThreads(
3819
- this: Connection,
3820
- params: {
3821
- /** Generally refers to the group ID. */
3822
- parentId: string;
3823
- /** The number of thread per page. The default value is 20, and the maximum value is 50. */
3824
- pageSize?: number;
3825
- /** 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 empty string, the data of the first page will be fetched.*/
3826
- cursor?: string;
3827
- }
3828
- ): Promise<AsyncResult<ChatThreadDetail[]>>;
3829
-
3830
- /**
3831
- * Gets the latest message content of the chatThread in batch,with a maximum of 20 messages.
3832
- *
3833
- * ```typescript
3834
- * connection.getChatThreadLastMessage({chatThreadIds: ['chatThreadId1','chatThreadId2']})
3835
- * ```
3836
- */
3837
- getChatThreadLastMessage(
3838
- this: Connection,
3839
- params: {
3840
- /** The array of chatThread IDs to query.*/
3841
- chatThreadIds: string[];
3842
- }
3843
- ): Promise<AsyncResult<ChatThreadLastMessage>>;
3844
-
3845
- /**
3846
- * Gets detail of the chatThread.
4184
+ * @deprecated
4185
+ * Gets the reaction list for the message.
3847
4186
  *
3848
4187
  * ```typescript
3849
- * connection.getChatThreadDetail({chatThreadId: 'chatThreadId'})
4188
+ * connection.getReactionList({chatType: 'chatType', messageId: 'messageId'})
3850
4189
  * ```
3851
4190
  */
3852
- getChatThreadDetail(
4191
+ getReactionList(
3853
4192
  this: Connection,
3854
4193
  params: {
3855
- /** The chatThread ID. */
3856
- chatThreadId: string;
4194
+ /** The conversation type:
4195
+ * - singleChat;
4196
+ * - groupChat;
4197
+ */
4198
+ chatType: 'singleChat' | 'groupChat';
4199
+ /** The message ID. */
4200
+ messageId: string | Array<string>;
4201
+ /** The group ID. */
4202
+ groupId?: string;
3857
4203
  }
3858
- ): Promise<AsyncResult<ChatThreadDetail>>;
4204
+ ): Promise<AsyncResult<GetReactionListResult[]>>;
3859
4205
 
3860
4206
  /**
3861
- * Gets the reaction list for the message.
4207
+ * Gets the reaction list for the message.
3862
4208
  *
3863
4209
  * ```typescript
3864
- * connection.getReactionList({chatType: 'chatType', messageId: 'messageId'})
4210
+ * connection.getReactionlist({chatType: 'chatType', messageId: 'messageId'})
3865
4211
  * ```
3866
4212
  */
3867
- getReactionList(
4213
+ getReactionlist(
3868
4214
  this: Connection,
3869
4215
  params: {
3870
4216
  /** The conversation type:
@@ -3930,6 +4276,24 @@ export declare namespace EasemobChat {
3930
4276
  ts: number;
3931
4277
  }
3932
4278
 
4279
+ interface EventData {
4280
+ /** The type of operation. */
4281
+ /** 操作类型。 */
4282
+ operation: string;
4283
+ /** The ID of a group or chatroom. */
4284
+ /** 群组或者聊天室 ID。 */
4285
+ id: string;
4286
+ /** Message sender. */
4287
+ /** 消息发送者。 */
4288
+ from: string;
4289
+ /** Message receiver. */
4290
+ /** 消息接收者。 */
4291
+ to: string;
4292
+ /** Additional data for the operation event. */
4293
+ /** 操作事件的其他数据。 */
4294
+ data?: any;
4295
+ }
4296
+
3933
4297
  type Event =
3934
4298
  | 'onOpened'
3935
4299
  | 'onPresence'
@@ -3964,7 +4328,12 @@ export declare namespace EasemobChat {
3964
4328
  | 'onGroupChange'
3965
4329
  | 'onChatroomChange'
3966
4330
  | 'onContactChange'
3967
- | 'onPresenceStatusChange';
4331
+ | 'onPresenceStatusChange'
4332
+ | 'onReactionChange'
4333
+ | 'onChatThreadChange'
4334
+ | 'onMultiDeviceEvent'
4335
+ | 'onGroupEvent'
4336
+ | 'onChatroomEvent';
3968
4337
 
3969
4338
  interface EventHandlerType {
3970
4339
  onOpened?: (msg: any) => void;
@@ -4004,6 +4373,8 @@ export declare namespace EasemobChat {
4004
4373
  onChatThreadChange?: (msg: ThreadChangeInfo) => void;
4005
4374
  onMultiDeviceEvent?: (msg: ThreadMultiDeviceInfo) => void;
4006
4375
  onReactionChange?: (msg: ReactionMessage) => void;
4376
+ onGroupEvent?: (eventData: EventData) => void;
4377
+ onChatroomEvent?: (eventData: EventData) => void;
4007
4378
  }
4008
4379
 
4009
4380
  interface HandlerData {
@@ -4031,7 +4402,7 @@ export declare namespace EasemobChat {
4031
4402
 
4032
4403
  /**
4033
4404
  * @module listen
4034
- * @deprecated v4.0.1
4405
+ * @deprecated
4035
4406
  */
4036
4407
  interface ListenParameters {
4037
4408
  onOpened?: () => void;