easemob-websdk 4.1.1 → 4.1.3-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
@@ -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.
@@ -579,13 +619,13 @@ export declare namespace EasemobChat {
579
619
  /** The phone number. */
580
620
  phone?: string;
581
621
  /** Gender. */
582
- gender?: string | number | boolean;
622
+ gender?: string;
583
623
  /** Sign. */
584
624
  sign?: string;
585
625
  /** Birthday. */
586
626
  birth?: string;
587
627
  /** Extension. */
588
- ext?: { [key: string]: string | number | boolean };
628
+ ext?: string;
589
629
  }
590
630
 
591
631
  /** Configurable field. */
@@ -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;
@@ -898,7 +933,7 @@ export declare namespace EasemobChat {
898
933
  /** The Historical messages. */
899
934
  messages: MessageBody[];
900
935
  }
901
- interface conversationList {
936
+ interface ConversationList {
902
937
  /** The conversation ID. */
903
938
  channel_id: string;
904
939
  /** Overview of the latest news. */
@@ -906,7 +941,10 @@ export declare namespace EasemobChat {
906
941
  /** The number of unread messages. */
907
942
  unread_num: number;
908
943
  }
909
-
944
+ interface ConversationInfo {
945
+ /** The conversation list. */
946
+ channel_infos: ConversationList[];
947
+ }
910
948
  interface SilentModeConversationType {
911
949
  /** Silent mode type. */
912
950
  type: string;
@@ -1485,7 +1523,10 @@ export declare namespace EasemobChat {
1485
1523
  ): Promise<AsyncResult<AddUsersToChatRoomResult>>;
1486
1524
 
1487
1525
  /**
1488
- * Joins the chat room. After a user joins successfully, other members in the chat room will receive operation: 'memberPresence' in the onChatroomEvent callback.
1526
+ * Joins the chat room.
1527
+ *
1528
+ * @note
1529
+ * After a user joins successfully, other members in the chat room will receive operation: 'memberPresence' in the onChatroomEvent callback.
1489
1530
  *
1490
1531
  * ```typescript
1491
1532
  * connection.joinChatRoom({roomId: 'roomId'})
@@ -1496,7 +1537,7 @@ export declare namespace EasemobChat {
1496
1537
  params: {
1497
1538
  /** The chat room ID. */
1498
1539
  roomId: string;
1499
- /** The reason for joining the chat room. It is optional. It is only used for groups. */
1540
+ /** The reason for joining the chat room. Not enabled. */
1500
1541
  message?: string;
1501
1542
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1502
1543
  error?: (error: ErrorEvent) => void;
@@ -1505,7 +1546,13 @@ export declare namespace EasemobChat {
1505
1546
 
1506
1547
  /**
1507
1548
  * @deprecated Use {@link leaveChatRoom} instead.
1508
- * Exits chat room. And others will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1549
+ * Exits the chat room.
1550
+ *
1551
+ * @note
1552
+ * When a member exits the chat room, other members will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1553
+ *
1554
+ * ```typescript
1555
+ * connection.leaveChatRoom({roomId: 'roomId'}
1509
1556
  *
1510
1557
  * ```typescript
1511
1558
  * connection.quitChatRoom({roomId: 'roomId'})
@@ -1522,7 +1569,10 @@ export declare namespace EasemobChat {
1522
1569
  ): Promise<AsyncResult<{ result: boolean }>>;
1523
1570
 
1524
1571
  /**
1525
- * Exits chat room. And others will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1572
+ * Exits the chat room.
1573
+ *
1574
+ * @note
1575
+ * When a member exits the chat room, other members will receive "operation: 'memberAbsence'" in the callback of onChatroomEvent.
1526
1576
  *
1527
1577
  * ```typescript
1528
1578
  * connection.leaveChatRoom({roomId: 'roomId'})
@@ -1592,7 +1642,10 @@ export declare namespace EasemobChat {
1592
1642
  ): Promise<AsyncResult<GetChatRoomAdminResult>>;
1593
1643
 
1594
1644
  /**
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.
1645
+ * Sets a member as the chat room admin.
1646
+ *
1647
+ * @note
1648
+ * Only the chat room owner can call this method. The new admin will receive "operation: 'setAdmin'" in the callback of `onChatroomEvent`.
1596
1649
  *
1597
1650
  * ```typescript
1598
1651
  * connection.setChatRoomAdmin({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1611,7 +1664,10 @@ export declare namespace EasemobChat {
1611
1664
  ): Promise<AsyncResult<SetChatRoomAdminResult>>;
1612
1665
 
1613
1666
  /**
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.
1667
+ * Removes chat room admins.
1668
+ *
1669
+ * @note
1670
+ * 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
1671
  *
1616
1672
  * ```typescript
1617
1673
  * connection.removeChatRoomAdmin({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1630,7 +1686,10 @@ export declare namespace EasemobChat {
1630
1686
  ): Promise<AsyncResult<RemoveChatRoomAdminResult>>;
1631
1687
 
1632
1688
  /**
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.
1689
+ * Mutes chat room member.
1690
+ *
1691
+ * @note
1692
+ * 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
1693
  *
1635
1694
  * ```typescript
1636
1695
  * connection.muteChatRoomMember({username: 'user1', muteDuration: -1, chatRoomId: 'chatRoomId'})
@@ -1641,7 +1700,7 @@ export declare namespace EasemobChat {
1641
1700
  params: {
1642
1701
  /** The member to be muted in the chat room. */
1643
1702
  username: string;
1644
- /** The mute duration in milliseconds. The value -1 indicates that the member is muted permanently. */
1703
+ /** The mute duration in milliseconds. The value `-1` indicates that the member is muted permanently. */
1645
1704
  muteDuration: number;
1646
1705
  /** The chat room ID. */
1647
1706
  chatRoomId: string;
@@ -1650,7 +1709,17 @@ export declare namespace EasemobChat {
1650
1709
  }
1651
1710
  ): Promise<AsyncResult<MuteChatRoomMemberResult>>;
1652
1711
 
1653
- /** @deprecated */
1712
+ /**
1713
+ * @deprecated Use {@link unmuteChatRoomMember} instead.
1714
+ * Unmutes the chat room member.
1715
+ *
1716
+ * @note
1717
+ * 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.
1718
+ *
1719
+ * ```typescript
1720
+ * connection.removeMuteChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
1721
+ * ```
1722
+ */
1654
1723
  removeMuteChatRoomMember(
1655
1724
  this: Connection,
1656
1725
  params: {
@@ -1666,11 +1735,14 @@ export declare namespace EasemobChat {
1666
1735
  ): Promise<AsyncResult<UnmuteChatRoomMemberResult[]>>;
1667
1736
 
1668
1737
  /**
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.
1738
+ * Unmutes the chat room member.
1739
+ *
1740
+ * @note
1741
+ * 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
1742
  *
1671
1743
  * ```typescript
1672
1744
  * connection.unmuteChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
1673
- * `
1745
+ * ```
1674
1746
  */
1675
1747
  unmuteChatRoomMember(
1676
1748
  this: Connection,
@@ -1738,7 +1810,14 @@ export declare namespace EasemobChat {
1738
1810
  }
1739
1811
  ): Promise<AsyncResult<GetChatRoomMuteListResult[]>>;
1740
1812
 
1741
- /** @deprecated */
1813
+ /**
1814
+ * @deprecated Use {@link blockChatRoomMember} instead.
1815
+ * Adds a member to the the block list of the chat room. Only the chat room owner or admin can call this method.
1816
+ *
1817
+ * ```typescript
1818
+ * connection.chatRoomBlockSingle({chatRoomId: 'chatRoomId', username: 'user1'})
1819
+ * ```
1820
+ */
1742
1821
  chatRoomBlockSingle(
1743
1822
  this: Connection,
1744
1823
  params: {
@@ -1752,7 +1831,7 @@ export declare namespace EasemobChat {
1752
1831
  ): Promise<AsyncResult<CommonRequestResult>>;
1753
1832
 
1754
1833
  /**
1755
- * Adds a member to the chat room blocklist. Only the chat room owner or admin can call this method.
1834
+ * Adds a member to the the block list of the chat room. Only the chat room owner or admin can call this method.
1756
1835
  *
1757
1836
  * ```typescript
1758
1837
  * connection.blockChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1784,7 +1863,7 @@ export declare namespace EasemobChat {
1784
1863
  ): Promise<AsyncResult<CommonRequestResult[]>>;
1785
1864
 
1786
1865
  /**
1787
- * Adds members to the chat room blocklist. Only the chat room owner or admin can call this method.
1866
+ * Adds members to the block list of the chat room. Only the chat room owner or admin can call this method.
1788
1867
  *
1789
1868
  * ```typescript
1790
1869
  * connection.blockChatRoomMembers({usernames: ['user1', 'user2'], chatRoomId: 'chatRoomId'})
@@ -1816,7 +1895,7 @@ export declare namespace EasemobChat {
1816
1895
  ): Promise<AsyncResult<CommonRequestResult>>;
1817
1896
 
1818
1897
  /**
1819
- * Removes an individual user from the chat room blocklist. Only the chatroom owner or admin can call this method.
1898
+ * Removes a member from the block list of the chat room. Only the chat room owner or admin can call this method.
1820
1899
  *
1821
1900
  * ```typescript
1822
1901
  * connection.unblockChatRoomMember({chatRoomId: 'chatRoomId', username: 'user1'})
@@ -1827,7 +1906,7 @@ export declare namespace EasemobChat {
1827
1906
  params: {
1828
1907
  /** The chat room ID. */
1829
1908
  chatRoomId: string;
1830
- /** The member to be removed from the blocklist. */
1909
+ /** The member to be removed from the block list. */
1831
1910
  username: string;
1832
1911
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1833
1912
  error?: (error: ErrorEvent) => void;
@@ -1848,7 +1927,10 @@ export declare namespace EasemobChat {
1848
1927
  ): Promise<AsyncResult<CommonRequestResult[]>>;
1849
1928
 
1850
1929
  /**
1851
- * Removes members from the chat room blocklist. Only the chatroom owner or admin can call this method.
1930
+ * Removes a member from the the block list of the chat room.
1931
+ *
1932
+ * @note
1933
+ * Only the chat room owner or admin can call this method.
1852
1934
  *
1853
1935
  * ```typescript
1854
1936
  * connection.unblockChatRoomMembers({chatRoomId: 'chatRoomId', usernames: ['user1', 'user2']})
@@ -1878,7 +1960,7 @@ export declare namespace EasemobChat {
1878
1960
  ): Promise<AsyncResult<UserId[]>>;
1879
1961
 
1880
1962
  /**
1881
- * Gets the blocklist of the chat room.
1963
+ * Gets the block list of the chat room.
1882
1964
  *
1883
1965
  * ```typescript
1884
1966
  * connection.getChatRoomBlacklist({chatRoomId: 'chatRoomId'})
@@ -2105,6 +2187,21 @@ export declare namespace EasemobChat {
2105
2187
  }
2106
2188
  ): Promise<AsyncResult<IsChatRoomWhiteUserResult>>;
2107
2189
 
2190
+ /**
2191
+ * Check whether you are on the chat room mute list.
2192
+ *
2193
+ * ```typescript
2194
+ * connection.isInChatRoomMutelist({chatRoomId: 'chatRoomId'})
2195
+ * ```
2196
+ */
2197
+ isInChatRoomMutelist(
2198
+ this: any,
2199
+ params: {
2200
+ /** The chat room ID. */
2201
+ chatRoomId: string;
2202
+ }
2203
+ ): Promise<boolean>;
2204
+
2108
2205
  /**
2109
2206
  * Gets the announcement of the chat room.
2110
2207
  *
@@ -2256,6 +2353,8 @@ export declare namespace EasemobChat {
2256
2353
  inviteNeedConfirm: boolean;
2257
2354
  /** The group max users. */
2258
2355
  maxusers: number;
2356
+ /** Group detail extensions which can be in the JSON format to contain more group information. */
2357
+ ext?: string;
2259
2358
  };
2260
2359
  success?: (res: AsyncResult<CreateGroupResult>) => void;
2261
2360
  error?: (error: ErrorEvent) => void;
@@ -2303,6 +2402,8 @@ export declare namespace EasemobChat {
2303
2402
  inviteNeedConfirm: boolean;
2304
2403
  /** The group max users. */
2305
2404
  maxusers: number;
2405
+ /** Group detail extensions which can be in the JSON format to contain more group information. */
2406
+ ext?: string;
2306
2407
  };
2307
2408
  success?: (res: AsyncResult<CreateGroupResult>) => void;
2308
2409
  error?: (error: ErrorEvent) => void;
@@ -2394,20 +2495,44 @@ export declare namespace EasemobChat {
2394
2495
  /**
2395
2496
  * Lists all the groups a user has joined.
2396
2497
  *
2498
+ * @note
2499
+ * 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.
2500
+ *
2501
+ * 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.
2502
+ *
2397
2503
  * ```typescript
2398
- * connection.getJoinedGroups()
2504
+ * connection.getJoinedGroups({
2505
+ * pageNum: 1,
2506
+ * pageSize: 500,
2507
+ * needAffiliations: false,
2508
+ * needRole: false
2509
+ * })
2399
2510
  * ```
2400
2511
  */
2401
2512
  getJoinedGroups(
2402
2513
  this: Connection,
2403
2514
  params: {
2404
- /** The current page number. */
2515
+ /**
2516
+ * If either `needAffiliations` or `needAffiliations` is set, when you get data with pagination, the current page number (pageNum) starts from 0.
2517
+ *
2518
+ * If neither of the parameters is set, when you get data with pagination, the current page number (pageNum) starts from 1.
2519
+ * */
2405
2520
  pageNum: number;
2406
- /** The number of group per page. */
2521
+ /**
2522
+ * 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.
2523
+ *
2524
+ * 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.
2525
+ * */
2407
2526
  pageSize: number;
2408
- /** Whether the number of group members is required. */
2527
+ /** Whether the number of group members is required.
2528
+ * `true`: Yes;
2529
+ * (Default)`false`: No.
2530
+ */
2409
2531
  needAffiliations?: boolean;
2410
- /** Whether the role of the account in the group is required. */
2532
+ /** Whether the role of the current user in the group is required.
2533
+ * `true`: Yes;
2534
+ * (Default)`false`: No.
2535
+ */
2411
2536
  needRole?: boolean;
2412
2537
  success?: (res: AsyncResult<BaseGroupInfo[]>) => void;
2413
2538
  error?: (error: ErrorEvent) => void;
@@ -2475,9 +2600,11 @@ export declare namespace EasemobChat {
2475
2600
  /** The Group ID. */
2476
2601
  groupId: string;
2477
2602
  /** The group name. */
2478
- groupName: string;
2603
+ groupName?: string;
2479
2604
  /** The group description. */
2480
- description: string;
2605
+ description?: string;
2606
+ /** Group detail extensions which can be in the JSON format to contain more group information. */
2607
+ ext?: string;
2481
2608
  success?: (res: AsyncResult<ModifyGroupResult>) => void;
2482
2609
  error?: (error: ErrorEvent) => void;
2483
2610
  }
@@ -3399,6 +3526,21 @@ export declare namespace EasemobChat {
3399
3526
  }
3400
3527
  ): Promise<AsyncResult<IsInGroupWhiteListResult>>;
3401
3528
 
3529
+ /**
3530
+ * Check whether you are on the group mute list.
3531
+ *
3532
+ * ```typescript
3533
+ * connection.isInGroupMutelist({groupId: 'groupId'})
3534
+ * ```
3535
+ */
3536
+ isInGroupMutelist(
3537
+ this: Connection,
3538
+ params: {
3539
+ /** The group ID. */
3540
+ groupId: string;
3541
+ }
3542
+ ): Promise<boolean>;
3543
+
3402
3544
  /**
3403
3545
  * Checks which members have read group message. This is a [value-added function] and .
3404
3546
  *
@@ -3683,10 +3825,14 @@ export declare namespace EasemobChat {
3683
3825
  getConversationlist(
3684
3826
  this: Connection,
3685
3827
  params?: {
3686
- success?: (res: AsyncResult<SessionInfo[]>) => void;
3828
+ /** The page number, starting from 1. */
3829
+ pageNum?: number;
3830
+ /** The number of conversation per page. The value cannot exceed 20. */
3831
+ pageSize?: number;
3832
+ success?: (res: AsyncResult<ConversationInfo>) => void;
3687
3833
  error?: (error: ErrorEvent) => void;
3688
3834
  }
3689
- ): Promise<AsyncResult<conversationList[]>>;
3835
+ ): Promise<AsyncResult<ConversationInfo>>;
3690
3836
 
3691
3837
  /**
3692
3838
  * @deprecated Use Use {@link deleteConversation} instead.
@@ -3756,7 +3902,7 @@ export declare namespace EasemobChat {
3756
3902
  updateOwnUserInfo(
3757
3903
  this: Connection,
3758
3904
  params: UpdateOwnUserInfoParams | ConfigurableKey,
3759
- value?: any
3905
+ value?: string
3760
3906
  ): Promise<AsyncResult<UpdateOwnUserInfoParams>>;
3761
3907
 
3762
3908
  /**
@@ -3771,7 +3917,7 @@ export declare namespace EasemobChat {
3771
3917
  updateUserInfo(
3772
3918
  this: Connection,
3773
3919
  params: UpdateOwnUserInfoParams | ConfigurableKey,
3774
- value?: any
3920
+ value?: string
3775
3921
  ): Promise<AsyncResult<UpdateOwnUserInfoParams>>;
3776
3922
 
3777
3923
  /**
@@ -3872,6 +4018,33 @@ export declare namespace EasemobChat {
3872
4018
  }
3873
4019
  ): Promise<HistoryMessages>;
3874
4020
 
4021
+ /**
4022
+ * Delete roaming messages.
4023
+ *
4024
+ * ```typescript
4025
+ * connection.removeHistoryMessages({targetId: 'userId', chatType: 'singleChat', time: Date.now()})
4026
+ *
4027
+ * connection.removeHistoryMessages({targetId: 'userId', chatType: 'singleChat', messageIds: ['messageId']})
4028
+ * ```
4029
+ */
4030
+ removeHistoryMessages(
4031
+ this: Connection,
4032
+ options: {
4033
+ /** The ID of the peer user or group. */
4034
+ targetId: string;
4035
+ /**
4036
+ * conversation type:
4037
+ * - `singleChat`: single chat;
4038
+ * - `groupChat`: group chat.
4039
+ */
4040
+ chatType: 'singleChat' | 'groupChat';
4041
+ /** List of message IDs to be deleted, The number of IDs cannot exceed 20. */
4042
+ messageIds?: Array<string>;
4043
+ /** The starting point in time to delete the message. */
4044
+ beforeTimeStamp?: number;
4045
+ }
4046
+ ): Promise<void>;
4047
+
3875
4048
  /**
3876
4049
  * Adds a friend.
3877
4050
  *
@@ -4075,9 +4248,9 @@ export declare namespace EasemobChat {
4075
4248
  publishPresence(params: {
4076
4249
  /** The extension description information of the presence state. It can be set as nil. */
4077
4250
  description: string;
4078
- success?: (res: AsyncResult<PublishPresenceResult>) => void;
4251
+ success?: () => void;
4079
4252
  error?: (error: ErrorEvent) => void;
4080
- }): Promise<AsyncResult<PublishPresenceResult>>;
4253
+ }): Promise<void>;
4081
4254
 
4082
4255
  /**
4083
4256
  * 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 +4278,9 @@ export declare namespace EasemobChat {
4105
4278
  unsubscribePresence(params: {
4106
4279
  /** The array of IDs of users whose presence states you want to unsubscribe from. */
4107
4280
  usernames: UserId[];
4108
- success?: (res: AsyncResult<PublishPresenceResult>) => void;
4281
+ success?: () => void;
4109
4282
  error?: (error: ErrorEvent) => void;
4110
- }): Promise<AsyncResult<PublishPresenceResult>>;
4283
+ }): Promise<void>;
4111
4284
 
4112
4285
  /**
4113
4286
  * @deprecated Use {@link getSubscribedPresencelist} instead.
@@ -4633,7 +4806,7 @@ export declare namespace EasemobChat {
4633
4806
  * Get the chat room all properties.
4634
4807
  *
4635
4808
  * ```typescript
4636
- * connection.getChatRoomAttributes({chatRoomId: 'roomId')
4809
+ * connection.getChatRoomAttributes({chatRoomId: 'roomId', attributeKeys:['attributeKey1'])
4637
4810
  * ```
4638
4811
  */
4639
4812
  getChatRoomAttributes(
@@ -4658,7 +4831,7 @@ export declare namespace EasemobChat {
4658
4831
  params: {
4659
4832
  /** The chat room ID. */
4660
4833
  chatRoomId: string;
4661
- /** The attributes. */
4834
+ /** The map of custom chat room attributes. */
4662
4835
  attributes: {
4663
4836
  [key: string]: string;
4664
4837
  };
@@ -4666,7 +4839,7 @@ export declare namespace EasemobChat {
4666
4839
  * (Default)`true`: Yes.
4667
4840
  * `false`: No. */
4668
4841
  autoDelete?: boolean;
4669
- /** Whether to allow a member to overwrite the chat room attribute set by another member.
4842
+ /** Whether to allow a member to overwrite custom chat room attributes set by others.
4670
4843
  * `true`: Yes.
4671
4844
  * (Default)`false`: No. */
4672
4845
  isForced?: boolean;
@@ -4674,7 +4847,7 @@ export declare namespace EasemobChat {
4674
4847
  ): Promise<AsyncResult<ChatroomAttributes>>;
4675
4848
 
4676
4849
  /**
4677
- * Set chat room properties individually.
4850
+ * Sets a custom chat room attribute.
4678
4851
  *
4679
4852
  * ```typescript
4680
4853
  * connection.setChatroomAttribute({chatRoomId: 'roomId', attributeKey:"key1", attributeValue:"value1", autoDelete: true, isForced: false})
@@ -4685,9 +4858,15 @@ export declare namespace EasemobChat {
4685
4858
  params: {
4686
4859
  /** The chat room ID. */
4687
4860
  chatRoomId: string;
4688
- /** The custom attribute key. */
4861
+ /**
4862
+ * 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:
4863
+ * - 26 lowercase English letters (a-z)
4864
+ * - 26 uppercase English letters (A-Z)
4865
+ * - 10 numbers (0-9)
4866
+ * - "_", "-", "."
4867
+ */
4689
4868
  attributeKey: string;
4690
- /** The custom attribute value. */
4869
+ /** 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
4870
  attributeValue: string;
4692
4871
  /**
4693
4872
  * Whether to delete chat room attributes set by the member when he or she exits the chat room.
@@ -4705,7 +4884,7 @@ export declare namespace EasemobChat {
4705
4884
  ): Promise<void>;
4706
4885
 
4707
4886
  /**
4708
- * Batch remove chat room attributes.
4887
+ * Removes custom chat room attributes.
4709
4888
  *
4710
4889
  * ```typescript
4711
4890
  * connection.removeChatRoomAttributes({chatRoomId: 'roomId', attributeKeys: ['key1','key2',...], isForced: false })
@@ -4716,10 +4895,9 @@ export declare namespace EasemobChat {
4716
4895
  params: {
4717
4896
  /** The chat room ID. */
4718
4897
  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.
4898
+ /** The maximum number of keys to delete is 10. */
4899
+ attributeKeys: Array<string>;
4900
+ /** Whether to allow chat room members to delete all of the chat room attributes.
4723
4901
  * - `true`: Yes;
4724
4902
  * - (Default)`false`: No.
4725
4903
  */
@@ -4739,9 +4917,13 @@ export declare namespace EasemobChat {
4739
4917
  params: {
4740
4918
  /** The chat room ID. */
4741
4919
  chatRoomId: string;
4742
- /** Delete attribute key. */
4920
+ /** The key of the chat room attribute to delete. */
4743
4921
  attributeKey: string;
4744
- /** remove chatRoom attributes (Allow to delete all contents of the chat room). */
4922
+ /**
4923
+ * Whether to allow a member to delete any chat room attribute set by any member.
4924
+ * - `true`: Yes;
4925
+ * - (Default)`false`: No.
4926
+ */
4745
4927
  isForced?: boolean;
4746
4928
  }
4747
4929
  ): Promise<void>;
@@ -4780,10 +4962,9 @@ export declare namespace EasemobChat {
4780
4962
  id: string;
4781
4963
  /** Message sender. */
4782
4964
  from: string;
4783
- /** Message receiver. */
4965
+ /** Additional data for the operation event. */
4784
4966
  data?: any;
4785
- /** ChatRoom Attributes. */
4786
- /** 聊天室属性。 */
4967
+ /** ChatRoom attributes. */
4787
4968
  attributes?: {
4788
4969
  [key: string]: string;
4789
4970
  };
@@ -4845,6 +5026,126 @@ export declare namespace EasemobChat {
4845
5026
  | 'onGroupEvent'
4846
5027
  | 'onChatroomEvent';
4847
5028
 
5029
+ interface GroupEvent {
5030
+ /** The type of operation. <br/>
5031
+ * create: Occurs when the current user created a group on another device.<br/>
5032
+ * destroy: Occurs when the group was destroyed.<br/>
5033
+ * requestToJoin: Occurs when someone applied to join the group. Only the group owner and administrator will receive this event. <br/>
5034
+ * acceptRequest: Occurs when your group adding application is approved. Only the person who applies for group will receive this event.<br/>
5035
+ * inviteToJoin: Occurs when you receive an invitation to join a group. <br/>
5036
+ * acceptInvite: Occurs when someone accepted your invitation to join the group. <br/>
5037
+ * rejectInvite: Occurs when someone refused your invitation to join the group. <br/>
5038
+ * removeMember: Occurs when you are removed from a group or added to block list. Only the removed person receives this event.<br/>
5039
+ * unblockMember: Occurs when being removed from the block list. Only the removed person receives this event.<br/>
5040
+ * updateInfo: Occurs when modifying group. <br/>
5041
+ * memberPresence: Occurs when someone joined the group. <br/>
5042
+ * memberAbsence: Occurs when someone leaved the group. <br/>
5043
+ * directJoined: Occurs when you are directly pulled into the group and no consent is required. <br/>
5044
+ * changeOwner: Occurs when transferring group. Only new and old group owners can receive this event. <br/>
5045
+ * setAdmin: Occurs when being set as administrator. Only the person who is set to administrator can receive this event.<br/>
5046
+ * removeAdmin: Occurs when you are removed as an administrator. Only the removed person can receive this event. <br/>
5047
+ * muteMember: Occurs when you are muted. Only the person who is muted can receive this event. <br/>
5048
+ * unmuteMember: Occurs when you are unmuted. Only the person who is unmuted can receive this event. <br/>
5049
+ * updateAnnouncement: Occurs when the group announcement was updated. <br/>
5050
+ * deleteAnnouncement: Occurs when the group announcement was deleted. <br/>
5051
+ * uploadFile: Occurs when a shared file is uploaded. <br/>
5052
+ * deleteFile: Occurs when a shared file is deleted. <br/>
5053
+ * addUserToAllowlist: Occurs when being added to the allow list. <br/>
5054
+ * removeAllowlistMember: Occurs when being removed from the allow list. <br/>
5055
+ * muteAllMembers: Occurs when the group was set with a ban for all members. <br/>
5056
+ * unmuteAllMembers: Occurs when the group lifted the ban. <br/>
5057
+ */
5058
+ operation:
5059
+ | 'create'
5060
+ | 'destroy'
5061
+ | 'requestToJoin'
5062
+ | 'acceptRequest'
5063
+ | 'inviteToJoin'
5064
+ | 'acceptInvite'
5065
+ | 'rejectInvite'
5066
+ | 'removeMember'
5067
+ | 'unblockMember'
5068
+ | 'updateInfo'
5069
+ | 'memberPresence'
5070
+ | 'memberAbsence'
5071
+ | 'directJoined'
5072
+ | 'changeOwner'
5073
+ | 'setAdmin'
5074
+ | 'removeAdmin'
5075
+ | 'muteMember'
5076
+ | 'unmuteMember'
5077
+ | 'updateAnnouncement'
5078
+ | 'deleteAnnouncement'
5079
+ | 'uploadFile'
5080
+ | 'deleteFile'
5081
+ | 'addUserToAllowlist'
5082
+ | 'removeAllowlistMember'
5083
+ | 'muteAllMembers'
5084
+ | 'unmuteAllMembers';
5085
+ /** The ID of a group. */
5086
+ id: string;
5087
+ /** Message sender. */
5088
+ from: string;
5089
+ /** The name of a group. */
5090
+ name?: string;
5091
+ /** The modified group info. */
5092
+ detail?: GroupModifyInfo;
5093
+ }
5094
+
5095
+ interface ChatroomEvent {
5096
+ /** The type of operation. <br/>
5097
+ * destroy: Occurs when the chat room was destroyed.<br/>
5098
+ * removeMember: Occurs when you are removed from a chat room or added to block list. Only the removed person receives this event.<br/>
5099
+ * unblockMember: Occurs when being removed from the block list. Only the removed person receives this event.<br/>
5100
+ * updateInfo: Occurs when modifying chat room. <br/>
5101
+ * memberPresence: Occurs when someone joined the chat room. <br/>
5102
+ * memberAbsence: Occurs when someone leaved the chat room. <br/>
5103
+ * setAdmin: Occurs when being set as administrator. Only the person who is set to administrator can receive this event.<br/>
5104
+ * removeAdmin: Occurs when you are removed as an administrator. Only the removed person can receive this event. <br/>
5105
+ * muteMember: Occurs when you are muted. Only the person who is muted can receive this event. <br/>
5106
+ * unmuteMember: Occurs when you are unmuted. Only the person who is unmuted can receive this event. <br/>
5107
+ * updateAnnouncement: Occurs when the chat room announcement was updated. <br/>
5108
+ * deleteAnnouncement: Occurs when the chat room announcement was deleted. <br/>
5109
+ * uploadFile: Occurs when a shared file is uploaded. <br/>
5110
+ * deleteFile: Occurs when a shared file is deleted. <br/>
5111
+ * addUserToAllowlist: Occurs when being added to the allow list. <br/>
5112
+ * removeAllowlistMember: Occurs when being removed from the allow list. <br/>
5113
+ * muteAllMembers: Occurs when the chat room was set with a ban for all members. <br/>
5114
+ * unmuteAllMembers: Occurs when the chat room lifted the ban. <br/>
5115
+ * updateChatRoomAttributes: Occurs when the chat room attributes are updated. <br/>
5116
+ * removeChatRoomAttributes: when the chat room attributes are deleted. <br/>
5117
+ */
5118
+ operation:
5119
+ | 'destroy'
5120
+ | 'removeMember'
5121
+ | 'unblockMember'
5122
+ | 'updateInfo'
5123
+ | 'memberPresence'
5124
+ | 'memberAbsence'
5125
+ | 'setAdmin'
5126
+ | 'removeAdmin'
5127
+ | 'muteMember'
5128
+ | 'unmuteMember'
5129
+ | 'updateAnnouncement'
5130
+ | 'deleteAnnouncement'
5131
+ | 'uploadFile'
5132
+ | 'deleteFile'
5133
+ | 'addUserToAllowlist'
5134
+ | 'removeAllowlistMember'
5135
+ | 'muteAllMembers'
5136
+ | 'unmuteAllMembers'
5137
+ | 'updateChatRoomAttributes'
5138
+ | 'removeChatRoomAttributes';
5139
+ /** The ID of a chatroom. */
5140
+ id: string;
5141
+ /** Message sender. */
5142
+ from: string;
5143
+ /** The name of a chatroom. */
5144
+ name?: string;
5145
+ /** ChatRoom Attributes. */
5146
+ attributes?: Array<string> | { [key: string]: string };
5147
+ }
5148
+
4848
5149
  interface EventHandlerType {
4849
5150
  /** @deprecated Use { onConnected } instead. */
4850
5151
  onOpened?: (msg: any) => void;
@@ -4913,13 +5214,13 @@ export declare namespace EasemobChat {
4913
5214
  /** The callback to receive a reaction message. */
4914
5215
  onChatThreadChange?: (msg: ThreadChangeInfo) => void;
4915
5216
  /** The callback to receive a multi device event. */
4916
- onMultiDeviceEvent?: (msg: ThreadMultiDeviceInfo) => void;
5217
+ onMultiDeviceEvent?: (msg: MultiDeviceEvent) => void;
4917
5218
  /** The callback to receive a reaction message. */
4918
5219
  onReactionChange?: (msg: ReactionMessage) => void;
4919
5220
  /** The callback to receive a group event. */
4920
- onGroupEvent?: (eventData: EventData) => void;
5221
+ onGroupEvent?: (eventData: GroupEvent) => void;
4921
5222
  /** The callback to receive a chatroom event. */
4922
- onChatroomEvent?: (eventData: EventData) => void;
5223
+ onChatroomEvent?: (eventData: ChatroomEvent) => void;
4923
5224
  }
4924
5225
 
4925
5226
  interface HandlerData {
@@ -5150,6 +5451,7 @@ export declare namespace EasemobChat {
5150
5451
  owner?: string;
5151
5452
  reason?: string;
5152
5453
  kicked?: string;
5454
+ detail?: GroupModifyInfo;
5153
5455
  }
5154
5456
 
5155
5457
  interface ReadMsgSetParameters {
@@ -5361,6 +5663,8 @@ export declare namespace EasemobChat {
5361
5663
  chatThreadOverview?: ChatThreadOverview;
5362
5664
  /** Message online state type. */
5363
5665
  onlineState?: ONLINESTATETYPE;
5666
+ /** Message priority. */
5667
+ priority?: MessagePriority;
5364
5668
  }
5365
5669
 
5366
5670
  interface CreateTextMsgParameters {
@@ -5380,6 +5684,8 @@ export declare namespace EasemobChat {
5380
5684
  msgConfig?: { allowGroupAck?: boolean; languages?: string[] };
5381
5685
  /** Whether the message is a thread message. */
5382
5686
  isChatThread?: boolean;
5687
+ /** Message priority. */
5688
+ priority?: MessagePriority;
5383
5689
  }
5384
5690
 
5385
5691
  interface CmdParameters {
@@ -5444,6 +5750,8 @@ export declare namespace EasemobChat {
5444
5750
  chatThreadOverview?: ChatThreadOverview;
5445
5751
  /** Message online state type. */
5446
5752
  onlineState?: ONLINESTATETYPE;
5753
+ /** Message priority. */
5754
+ priority?: MessagePriority;
5447
5755
  }
5448
5756
 
5449
5757
  interface CreateCmdMsgParameters {
@@ -5465,6 +5773,8 @@ export declare namespace EasemobChat {
5465
5773
  msgConfig?: { allowGroupAck: boolean };
5466
5774
  /** Whether the message is a thread message. */
5467
5775
  isChatThread?: boolean;
5776
+ /** Message priority. */
5777
+ priority?: MessagePriority;
5468
5778
  }
5469
5779
 
5470
5780
  interface CustomParameters {
@@ -5534,6 +5844,8 @@ export declare namespace EasemobChat {
5534
5844
  chatThreadOverview?: ChatThreadOverview;
5535
5845
  /** Message online state type. */
5536
5846
  onlineState?: ONLINESTATETYPE;
5847
+ /** Message priority. */
5848
+ priority?: MessagePriority;
5537
5849
  }
5538
5850
 
5539
5851
  interface CreateCustomMsgParameters {
@@ -5555,6 +5867,8 @@ export declare namespace EasemobChat {
5555
5867
  msgConfig?: { allowGroupAck: boolean };
5556
5868
  /** Whether the message is a thread message. */
5557
5869
  isChatThread?: boolean;
5870
+ /** Message priority. */
5871
+ priority?: MessagePriority;
5558
5872
  }
5559
5873
 
5560
5874
  interface LocationParameters {
@@ -5632,6 +5946,8 @@ export declare namespace EasemobChat {
5632
5946
  chatThreadOverview?: ChatThreadOverview;
5633
5947
  /** Message online state type. */
5634
5948
  onlineState?: ONLINESTATETYPE;
5949
+ /** Message priority. */
5950
+ priority?: MessagePriority;
5635
5951
  }
5636
5952
 
5637
5953
  interface CreateLocationMsgParameters {
@@ -5657,6 +5973,8 @@ export declare namespace EasemobChat {
5657
5973
  msgConfig?: { allowGroupAck: boolean };
5658
5974
  /** Whether the message is a thread message. */
5659
5975
  isChatThread?: boolean;
5976
+ /** Message priority. */
5977
+ priority?: MessagePriority;
5660
5978
  }
5661
5979
 
5662
5980
  interface FileParameters {
@@ -5754,6 +6072,8 @@ export declare namespace EasemobChat {
5754
6072
  onlineState?: ONLINESTATETYPE;
5755
6073
  /** Whether the message is a thread message. */
5756
6074
  isChatThread?: boolean;
6075
+ /** Message priority. */
6076
+ priority?: MessagePriority;
5757
6077
  }
5758
6078
 
5759
6079
  interface CreateFileMsgParameters {
@@ -5794,6 +6114,8 @@ export declare namespace EasemobChat {
5794
6114
  msgConfig?: { allowGroupAck: boolean };
5795
6115
  /** Whether the message is a thread message. */
5796
6116
  isChatThread?: boolean;
6117
+ /** Message priority. */
6118
+ priority?: MessagePriority;
5797
6119
  }
5798
6120
 
5799
6121
  interface ImgParameters {
@@ -5872,6 +6194,8 @@ export declare namespace EasemobChat {
5872
6194
  chatThreadOverview?: ChatThreadOverview;
5873
6195
  /** Message online state type. */
5874
6196
  onlineState?: ONLINESTATETYPE;
6197
+ /** Message priority. */
6198
+ priority?: MessagePriority;
5875
6199
  }
5876
6200
 
5877
6201
  interface CreateImgMsgParameters {
@@ -5912,6 +6236,8 @@ export declare namespace EasemobChat {
5912
6236
  msgConfig?: { allowGroupAck: boolean };
5913
6237
  /** Whether the message is a thread message. */
5914
6238
  isChatThread?: boolean;
6239
+ /** Message priority. */
6240
+ priority?: MessagePriority;
5915
6241
  }
5916
6242
 
5917
6243
  interface AudioParameters {
@@ -5993,6 +6319,8 @@ export declare namespace EasemobChat {
5993
6319
  chatThreadOverview?: ChatThreadOverview;
5994
6320
  /** Message online state type. */
5995
6321
  onlineState?: ONLINESTATETYPE;
6322
+ /** Message priority. */
6323
+ priority?: MessagePriority;
5996
6324
  }
5997
6325
 
5998
6326
  interface CreateAudioMsgParameters {
@@ -6035,6 +6363,8 @@ export declare namespace EasemobChat {
6035
6363
  msgConfig?: { allowGroupAck: boolean };
6036
6364
  /** Whether the message is a thread message. */
6037
6365
  isChatThread?: boolean;
6366
+ /** Message priority. */
6367
+ priority?: MessagePriority;
6038
6368
  }
6039
6369
 
6040
6370
  interface VideoParameters {
@@ -6116,6 +6446,8 @@ export declare namespace EasemobChat {
6116
6446
  chatThreadOverview?: ChatThreadOverview;
6117
6447
  /** Message online state type. */
6118
6448
  onlineState?: ONLINESTATETYPE;
6449
+ /** Message priority. */
6450
+ priority?: MessagePriority;
6119
6451
  }
6120
6452
 
6121
6453
  interface CreateVideoMsgParameters {
@@ -6160,6 +6492,8 @@ export declare namespace EasemobChat {
6160
6492
  msgConfig?: { allowGroupAck: boolean };
6161
6493
  /** Whether the message is a thread message. */
6162
6494
  isChatThread?: boolean;
6495
+ /** Message priority. */
6496
+ priority?: MessagePriority;
6163
6497
  }
6164
6498
 
6165
6499
  interface ReceivedMsgBody {
@@ -6246,7 +6580,10 @@ export declare namespace EasemobChat {
6246
6580
  | AudioMsgBody
6247
6581
  | VideoMsgBody
6248
6582
  | FileMsgBody;
6249
-
6583
+ type MessagePriority = 'high' | 'normal' | 'low';
6584
+ interface PriorityExt {
6585
+ chatroom_msg_tag: number;
6586
+ }
6250
6587
  /**
6251
6588
  * Message class is used to create a message.
6252
6589
  * @module message