@rongcloud/engine 4.4.9 → 5.0.0-alpha.3

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/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCEngine - v4.4.9
3
- * CommitId - 23d6f4e445f77284cb9e4b70a6df4c90326928db
4
- * Fri Sep 24 2021 17:12:40 GMT+0800 (China Standard Time)
2
+ * RCEngine - v5.0.0-alpha.3
3
+ * CommitId - 3e5a7cf4e97602af42b8933af7de690b0db08c21
4
+ * Mon Sep 27 2021 18:25:16 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -337,6 +337,19 @@ interface IChrmKVEntry {
337
337
  type?: number;
338
338
  isDeleted?: boolean;
339
339
  }
340
+ interface IChrmKVEntries {
341
+ entries: {
342
+ key: string;
343
+ value?: string;
344
+ }[];
345
+ notificationExtra?: string;
346
+ isOverwrite?: boolean;
347
+ isAutoDelete?: boolean;
348
+ timestamp?: number;
349
+ userId?: string;
350
+ type?: number;
351
+ isDeleted?: boolean;
352
+ }
340
353
  interface IServerConversationStatus {
341
354
  conversationType: number;
342
355
  targetId: string;
@@ -395,6 +408,17 @@ declare enum ChatroomEntryType {
395
408
  DELETE = 2
396
409
  }
397
410
 
411
+ declare enum MessageDirection {
412
+ /**
413
+ * 己方发送消息
414
+ */
415
+ SEND = 1,
416
+ /**
417
+ * 己方接收消息
418
+ */
419
+ RECEIVE = 2
420
+ }
421
+
398
422
  interface IGooglePushConfig {
399
423
  /**
400
424
  * 分组ID
@@ -494,6 +518,155 @@ interface IPushConfig {
494
518
  templateId: string;
495
519
  }
496
520
 
521
+ /**
522
+ * 已读回执数据结构
523
+ */
524
+ interface IMessageReader {
525
+ readTime: number;
526
+ userId: string;
527
+ }
528
+ interface IMessageReaderResponse {
529
+ totalMemberCount: number;
530
+ list: IMessageReader[];
531
+ }
532
+ interface ILocalReadReceiptInfo {
533
+ hasRespond?: boolean;
534
+ readerInfo?: {
535
+ [userId: string]: number;
536
+ };
537
+ readCount?: number;
538
+ totalCount?: number;
539
+ }
540
+ interface IReadReceiptInfo {
541
+ /**
542
+ * 是否已经发送已读回执
543
+ */
544
+ hasRespond?: boolean;
545
+ /**
546
+ * 已阅读用户列表(不准确)
547
+ */
548
+ readerList?: IMessageReader[];
549
+ /**
550
+ * 阅读人数(不准确)
551
+ */
552
+ readCount?: number;
553
+ /**
554
+ * 群组总人数(不准确)
555
+ */
556
+ totalCount?: number;
557
+ }
558
+ /**
559
+ * 从服务端接收到的消息数据
560
+ */
561
+ interface IReceivedMessage {
562
+ /**
563
+ * 会话的业务标识
564
+ */
565
+ channelId?: string;
566
+ /**
567
+ * 会话类型
568
+ * * 1: 单聊
569
+ * * 3: 群聊
570
+ * * 4: 聊天室
571
+ * * 5: 客服会话
572
+ * * 6: 系统消息
573
+ * * 7: 默认关注的公众号
574
+ * * 8: 手动关注的公众号
575
+ * * 9: RTCLib 房间
576
+ */
577
+ conversationType: ConversationType;
578
+ /**
579
+ * 会话 targetId
580
+ */
581
+ targetId: string;
582
+ /**
583
+ * 消息发送者的用户 Id
584
+ */
585
+ senderUserId: string;
586
+ /**
587
+ * 消息内容
588
+ */
589
+ content: any;
590
+ /**
591
+ * 消息结构名称,即消息类型
592
+ * @example RC:TxtMsg
593
+ */
594
+ messageType: string;
595
+ /**
596
+ * 服务端存储的消息 Id
597
+ */
598
+ messageUId: string;
599
+ /**
600
+ * 消息方向是发出 or 收取
601
+ */
602
+ messageDirection: MessageDirection;
603
+ /**
604
+ * 是否为离线消息
605
+ */
606
+ isOffLineMessage: boolean;
607
+ /**
608
+ * 消息在服务器端的发送时间
609
+ */
610
+ sentTime: number;
611
+ /**
612
+ * 消息接收时间,该时间通过消息的 `sentTime` 值在本地进行计算得出,不推荐使用
613
+ * @description 当 isOffLineMessage 为 true 时,该值无效
614
+ */
615
+ receivedTime: number;
616
+ /**
617
+ * 是否存储
618
+ * @default true
619
+ */
620
+ isPersited: boolean;
621
+ /**
622
+ * 是否计数
623
+ * @default true
624
+ */
625
+ isCounted: boolean;
626
+ /**
627
+ * 是否为 @ 消息
628
+ */
629
+ isMentioned: boolean;
630
+ /**
631
+ * 消息是否静默
632
+ * @description 静默消息不会发送 Push 信息和本地通知提醒
633
+ */
634
+ disableNotification: boolean;
635
+ /**
636
+ * 是否是状态消息
637
+ */
638
+ isStatusMessage: boolean;
639
+ /**
640
+ * 是否支持消息扩展存储
641
+ */
642
+ canIncludeExpansion: boolean;
643
+ /**
644
+ * 消息携带的扩展存储
645
+ */
646
+ expansion: {
647
+ [key: string]: any;
648
+ } | null;
649
+ /**
650
+ * 消息接收状态
651
+ */
652
+ receivedStatus: number;
653
+ /**
654
+ * CPP 独有字段 消息本地 ID
655
+ */
656
+ messageId?: number;
657
+ /**
658
+ * CPP 独有字段 消息发送状态
659
+ */
660
+ sentStatus?: number;
661
+ /**
662
+ * 已读回执信息(导航配置grpRRVer=1时群组类型消息内存在, 其他情况为undefined)
663
+ */
664
+ readReceiptInfo?: IReadReceiptInfo;
665
+ /**
666
+ * 推送扩展
667
+ */
668
+ pushConfig?: IPushConfig;
669
+ }
497
670
  interface IUserProfile {
498
671
  /**
499
672
  * 用户 ID
@@ -512,6 +685,35 @@ interface IUserProfile {
512
685
  */
513
686
  extra?: string;
514
687
  }
688
+ interface IRecallMsgOptions {
689
+ /**
690
+ * 会话组织机构标识
691
+ * 默认值未 空字符串
692
+ */
693
+ channelId: string;
694
+ /**
695
+ * 发送消息携带的用户信息
696
+ */
697
+ user?: IUserProfile;
698
+ /**
699
+ * Push 信息
700
+ */
701
+ pushContent?: string;
702
+ /**
703
+ * 原消息体
704
+ */
705
+ oriContent?: any;
706
+ /**
707
+ * 是否发送静默消息
708
+ * @description
709
+ * 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
710
+ */
711
+ disableNotification?: boolean;
712
+ /**
713
+ * 移动端推送配置
714
+ */
715
+ pushConfig?: IPushConfig;
716
+ }
515
717
  /**
516
718
  * 发送消息时的可选项信息
517
719
  */
@@ -615,6 +817,55 @@ interface ISendMsgOptions {
615
817
  */
616
818
  channelId?: string;
617
819
  }
820
+ interface IInsertMsgOptions {
821
+ senderUserId: string;
822
+ messageType: string;
823
+ content: string;
824
+ messageDirection: number;
825
+ readStatus?: number;
826
+ sentStatus?: number;
827
+ sentTime?: number;
828
+ searchContent?: string;
829
+ isUnread?: boolean;
830
+ messageUId?: string;
831
+ disableNotification?: boolean;
832
+ canIncludeExpansion?: boolean;
833
+ expansionMsg?: string;
834
+ channelId: string;
835
+ }
836
+ interface ISendExMsgOptions {
837
+ channelId: string;
838
+ conversationType: ConversationType;
839
+ targetId: string;
840
+ /**
841
+ * 消息 ID
842
+ */
843
+ messageUId: string;
844
+ /**
845
+ * 原始消息是否支持扩展的字段
846
+ */
847
+ canIncludeExpansion: boolean;
848
+ /**
849
+ * 删除的 keys
850
+ */
851
+ keys?: string[];
852
+ /**
853
+ * 扩展对象
854
+ */
855
+ expansion?: {
856
+ [key: string]: string;
857
+ };
858
+ /**
859
+ * 是否删除所有扩展
860
+ */
861
+ removeAll?: boolean;
862
+ /**
863
+ * 原始消息的扩展
864
+ */
865
+ originExpansion?: {
866
+ [key: string]: string;
867
+ } | null;
868
+ }
618
869
 
619
870
  /**
620
871
  * TODO: 确定对外暴露的必要性
@@ -895,10 +1146,14 @@ declare enum ErrorCode {
895
1146
  MSG_ROAMING_SERVICE_UNAVAILABLE = 33007,
896
1147
  MSG_INSERT_ERROR = 33008,
897
1148
  MSG_DEL_ERROR = 33009,
1149
+ /**
1150
+ * 标签已存在
1151
+ */
1152
+ TAG_EXISTS = 33101,
898
1153
  /**
899
1154
  * 标签不存在
900
1155
  */
901
- TAG_NOT_EXIST = 33101,
1156
+ TAG_NOT_EXIST = 33100,
902
1157
  /**
903
1158
  * 会话中不存在此标签
904
1159
  */
@@ -974,6 +1229,10 @@ declare enum ErrorCode {
974
1229
  * 开启`禁止把已在线客户端踢下线`开关后,该错误码标识已有同类型端在线,禁止链接
975
1230
  */
976
1231
  HAS_OHTER_SAME_CLIENT_ON_LINE = 35010,
1232
+ /**
1233
+ * 上传文件失败
1234
+ */
1235
+ UPLOAD_FILE_FAILED = 35020,
977
1236
  /**
978
1237
  * 加入聊天室Id为空
979
1238
  */
@@ -1112,7 +1371,11 @@ declare enum ErrorCode {
1112
1371
  /**
1113
1372
  * VoIP 不可用
1114
1373
  */
1115
- VOIP_NOT_AVALIABLE = 18
1374
+ VOIP_NOT_AVALIABLE = 18,
1375
+ /**
1376
+ * 聊天室批量设置kv部分不成功
1377
+ */
1378
+ CHATROOM_KV_STORE_NOT_ALL_SUCCESS = 23428
1116
1379
  }
1117
1380
 
1118
1381
  /**
@@ -1172,17 +1435,6 @@ declare enum RTCIdentityChangeType {
1172
1435
  ViewerToAnchor = 2
1173
1436
  }
1174
1437
 
1175
- declare enum MessageDirection {
1176
- /**
1177
- * 己方发送消息
1178
- */
1179
- SEND = 1,
1180
- /**
1181
- * 己方接收消息
1182
- */
1183
- RECEIVE = 2
1184
- }
1185
-
1186
1438
  /**
1187
1439
  * 序列化、反序列化数据通道
1188
1440
  */
@@ -1343,6 +1595,7 @@ declare class DataCodec {
1343
1595
  * 聊天室 KV 存储
1344
1596
  */
1345
1597
  encodeModifyChatRoomKV(chrmId: string, entry: IChrmKVEntry, currentUserId: string): any;
1598
+ encodeModifyChatRoomKVS(chrmId: string, entryOptions: IChrmKVEntries, currentUserId: string): any;
1346
1599
  /**
1347
1600
  * KV 存储拉取
1348
1601
  */
@@ -1409,7 +1662,6 @@ declare class DataCodec {
1409
1662
  * 全量 URI
1410
1663
  */
1411
1664
  encodeUserSetRTCData(message: any, valueInfo: string, objectName: string, mcuValInfo: string): any;
1412
- encodeUserSetRTCCDNUris(objectName: string, CDNUris: string): any;
1413
1665
  /**
1414
1666
  * 用户属性获取
1415
1667
  */
@@ -1548,6 +1800,16 @@ interface IAsyncRes<T = any> {
1548
1800
  * 通过 `Promise.resolve` 来处理预期内的异常,进而通过 Uncatch Promise Error 暴露预期外的异常
1549
1801
  */
1550
1802
  declare type IPromiseResult<T> = Promise<IAsyncRes<T>>;
1803
+ interface IConnectResult {
1804
+ /**
1805
+ * 连接错误码
1806
+ */
1807
+ code: ErrorCode;
1808
+ /**
1809
+ * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
1810
+ */
1811
+ userId?: string;
1812
+ }
1551
1813
 
1552
1814
  interface IDataChannelWatcher {
1553
1815
  /**
@@ -1813,157 +2075,6 @@ declare enum NotificationStatus {
1813
2075
  CLOSE = 2
1814
2076
  }
1815
2077
 
1816
- /**
1817
- * 已读回执数据结构
1818
- */
1819
- interface IMessageReader {
1820
- readTime: number;
1821
- userId: string;
1822
- }
1823
- interface IMessageReaderResponse {
1824
- totalMemberCount: number;
1825
- list: IMessageReader[];
1826
- }
1827
- interface ILocalReadReceiptInfo {
1828
- hasRespond?: boolean;
1829
- readerInfo?: {
1830
- [userId: string]: number;
1831
- };
1832
- readCount?: number;
1833
- totalCount?: number;
1834
- }
1835
- interface IReadReceiptInfo {
1836
- /**
1837
- * 是否已经发送已读回执
1838
- */
1839
- hasRespond?: boolean;
1840
- /**
1841
- * 已阅读用户列表(不准确)
1842
- */
1843
- readerList?: IMessageReader[];
1844
- /**
1845
- * 阅读人数(不准确)
1846
- */
1847
- readCount?: number;
1848
- /**
1849
- * 群组总人数(不准确)
1850
- */
1851
- totalCount?: number;
1852
- }
1853
-
1854
- /**
1855
- * 从服务端接收到的消息数据
1856
- */
1857
- interface IReceivedMessage {
1858
- /**
1859
- * 会话的业务标识
1860
- */
1861
- channelId?: string;
1862
- /**
1863
- * 会话类型
1864
- * * 1: 单聊
1865
- * * 3: 群聊
1866
- * * 4: 聊天室
1867
- * * 5: 客服会话
1868
- * * 6: 系统消息
1869
- * * 7: 默认关注的公众号
1870
- * * 8: 手动关注的公众号
1871
- * * 9: RTCLib 房间
1872
- */
1873
- conversationType: ConversationType;
1874
- /**
1875
- * 会话 targetId
1876
- */
1877
- targetId: string;
1878
- /**
1879
- * 消息发送者的用户 Id
1880
- */
1881
- senderUserId: string;
1882
- /**
1883
- * 消息内容
1884
- */
1885
- content: any;
1886
- /**
1887
- * 消息结构名称,即消息类型
1888
- * @example RC:TxtMsg
1889
- */
1890
- messageType: string;
1891
- /**
1892
- * 服务端存储的消息 Id
1893
- */
1894
- messageUId: string;
1895
- /**
1896
- * 消息方向是发出 or 收取
1897
- */
1898
- messageDirection: MessageDirection;
1899
- /**
1900
- * 是否为离线消息
1901
- */
1902
- isOffLineMessage: boolean;
1903
- /**
1904
- * 消息在服务器端的发送时间
1905
- */
1906
- sentTime: number;
1907
- /**
1908
- * 消息接收时间,该时间通过消息的 `sentTime` 值在本地进行计算得出,不推荐使用
1909
- * @description 当 isOffLineMessage 为 true 时,该值无效
1910
- */
1911
- receivedTime: number;
1912
- /**
1913
- * 是否存储
1914
- * @default true
1915
- */
1916
- isPersited: boolean;
1917
- /**
1918
- * 是否计数
1919
- * @default true
1920
- */
1921
- isCounted: boolean;
1922
- /**
1923
- * 是否为 @ 消息
1924
- */
1925
- isMentioned: boolean;
1926
- /**
1927
- * 消息是否静默
1928
- * @description 静默消息不会发送 Push 信息和本地通知提醒
1929
- */
1930
- disableNotification: boolean;
1931
- /**
1932
- * 是否是状态消息
1933
- */
1934
- isStatusMessage: boolean;
1935
- /**
1936
- * 是否支持消息扩展存储
1937
- */
1938
- canIncludeExpansion: boolean;
1939
- /**
1940
- * 消息携带的扩展存储
1941
- */
1942
- expansion: {
1943
- [key: string]: any;
1944
- } | null;
1945
- /**
1946
- * 消息接收状态
1947
- */
1948
- receivedStatus: number;
1949
- /**
1950
- * CPP 独有字段 消息本地 ID
1951
- */
1952
- messageId?: number;
1953
- /**
1954
- * CPP 独有字段 消息发送状态
1955
- */
1956
- sentStatus?: number;
1957
- /**
1958
- * 已读回执信息(导航配置grpRRVer=1时群组类型消息内存在, 其他情况为undefined)
1959
- */
1960
- readReceiptInfo?: IReadReceiptInfo;
1961
- /**
1962
- * 推送扩展
1963
- */
1964
- pushConfig?: IPushConfig;
1965
- }
1966
-
1967
2078
  /**
1968
2079
  * 从服务器拉取到的会话数据结构
1969
2080
  */
@@ -2031,7 +2142,6 @@ interface IReceivedConversation {
2031
2142
  interface IReceivedConversationByTag extends IReceivedConversation {
2032
2143
  isTopInTag: boolean;
2033
2144
  }
2034
-
2035
2145
  /**
2036
2146
  * 设置会话状态 参数 信息
2037
2147
  */
@@ -2042,61 +2152,227 @@ interface ISetConversationStatusOptions {
2042
2152
  notificationStatus?: number;
2043
2153
  channelId?: string;
2044
2154
  }
2045
-
2046
- interface IChatroomUser {
2047
- /**
2048
- * 用户 id
2049
- */
2050
- id: string;
2155
+ interface IUpdatedConversation {
2156
+ updatedItems: {
2157
+ [key: string]: {
2158
+ time: number;
2159
+ val: any;
2160
+ };
2161
+ };
2162
+ conversationType: number;
2163
+ targetId: string;
2164
+ latestMessage?: IReceivedMessage;
2165
+ unreadMessageCount?: number;
2166
+ hasMentioned?: boolean;
2167
+ mentionedInfo?: {
2168
+ /**
2169
+ * `@ 类型,其中 1 为 @ 所有人,2 为 @ 部分人`
2170
+ */
2171
+ type: 1 | 2;
2172
+ /**
2173
+ * 被 @ 的用户 Id 列表,仅在 `type` 为 `2` 时有效
2174
+ */
2175
+ userIdList: string[];
2176
+ };
2177
+ lastUnreadTime?: number;
2178
+ notificationStatus?: number;
2179
+ isTop?: boolean;
2051
2180
  /**
2052
- * 加入聊天室的时间
2053
- */
2054
- time: number;
2181
+ * 会话标识
2182
+ */
2183
+ channelId?: string;
2184
+ tags?: IUpdatedConversation[];
2055
2185
  }
2056
2186
 
2057
- interface IChatroomInfo {
2058
- /**
2059
- * 成员列表
2060
- * @todo 需确认数组元素的数据结构
2061
- */
2062
- userInfos: IChatroomUser[];
2063
- /**
2064
- * 房间内总人数
2065
- */
2066
- userCount: number;
2187
+ /**
2188
+ * 聊天室成员进入和退出状态
2189
+ */
2190
+ declare enum ChatroomUserChangeType {
2191
+ QUIT = 0,
2192
+ JOIN = 1
2067
2193
  }
2068
2194
 
2069
- interface IUploadAuth {
2195
+ interface IChatroomEntryListenerData {
2070
2196
  /**
2071
- * 七牛 token 有效期
2197
+ * 更新的键
2072
2198
  */
2073
- deadline: number;
2199
+ key: string;
2074
2200
  /**
2075
- * 七牛上传 token
2201
+ * 更新的值
2076
2202
  */
2077
- token: string;
2203
+ value: string;
2078
2204
  /**
2079
- * 百度上传 token
2205
+ * 更新的时间
2080
2206
  */
2081
- bosToken: string;
2207
+ timestamp: number;
2082
2208
  /**
2083
- * 百度上传 header Date
2209
+ * 更新的聊天室 ID
2084
2210
  */
2085
- bosDate: string;
2211
+ chatroomId: string;
2086
2212
  /**
2087
- * 百度上传路径
2213
+ * 更新类型
2088
2214
  */
2089
- path: string;
2090
- /**
2091
- * 上传文件名,阿里上传获取下载地址时,必须使用上传文件名,所以需抛出到业务端
2092
- */
2093
- fileName: string;
2215
+ type: ChatroomEntryType;
2216
+ }
2217
+ interface IChatroomRejoinedFailed {
2094
2218
  /**
2095
- * 阿里云 oss 的 AccessKeyId
2096
- */
2097
- osskeyId: string;
2219
+ * 自动重新加入的聊天室 ID
2220
+ */
2221
+ chatroomId: string;
2098
2222
  /**
2099
- * 阿里云 oss post 请求表单域中的字段 policy
2223
+ * 自动重新加入失败的 code
2224
+ */
2225
+ errorCode: number;
2226
+ }
2227
+ interface IChatroomRejoinedSuccessed {
2228
+ /**
2229
+ * 自动重新加入的聊天室 ID
2230
+ */
2231
+ chatroomId: string;
2232
+ /**
2233
+ * 自动重新加入的聊天室拉取消息的数量
2234
+ */
2235
+ count: number;
2236
+ }
2237
+ interface IChatroomUserChangeInfo {
2238
+ users: {
2239
+ [userId: string]: ChatroomUserChangeType;
2240
+ };
2241
+ chatroomId: string;
2242
+ }
2243
+ declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
2244
+ /**
2245
+ * 聊天室信息
2246
+ */
2247
+ interface IChatroomListenerData {
2248
+ /**
2249
+ * SDK 内部重连聊天室信息
2250
+ */
2251
+ rejoinedRoom?: IChatroomRejoinedInfo;
2252
+ /**
2253
+ * 监听到的聊天室 KV 更新
2254
+ */
2255
+ updatedEntries?: IChatroomEntryListenerData[];
2256
+ /**
2257
+ * 登录退出的用户通知
2258
+ */
2259
+ userChange?: IChatroomUserChangeInfo;
2260
+ /**
2261
+ * 聊天室销毁
2262
+ */
2263
+ chatroomDestroyed?: string;
2264
+ }
2265
+ interface IChatroomEntry {
2266
+ /**
2267
+ * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2268
+ */
2269
+ key: string;
2270
+ /**
2271
+ * 属性对应的值, 最大长度 4096 字符
2272
+ */
2273
+ value: string;
2274
+ /**
2275
+ * 设置成功后是否发送通知消息
2276
+ */
2277
+ isSendNotification?: boolean;
2278
+ /**
2279
+ * RC:chrmKVNotiMsg 消息中携带的附加信息
2280
+ */
2281
+ notificationExtra?: string;
2282
+ /**
2283
+ * 用户退出聊天室时是否清除此属性
2284
+ */
2285
+ isAutoDelete?: boolean;
2286
+ }
2287
+ interface IChatroomUser {
2288
+ /**
2289
+ * 用户 id
2290
+ */
2291
+ id: string;
2292
+ /**
2293
+ * 加入聊天室的时间
2294
+ */
2295
+ time: number;
2296
+ }
2297
+ interface IChatroomInfo {
2298
+ /**
2299
+ * 成员列表
2300
+ * @todo 需确认数组元素的数据结构
2301
+ */
2302
+ userInfos: IChatroomUser[];
2303
+ /**
2304
+ * 房间内总人数
2305
+ */
2306
+ userCount: number;
2307
+ }
2308
+ interface IRemoveChatRoomEntryOption {
2309
+ /**
2310
+ * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2311
+ */
2312
+ key: string;
2313
+ /**
2314
+ * 删除成功后是否发送通知消息
2315
+ */
2316
+ isSendNotification?: boolean;
2317
+ /**
2318
+ * RC:chrmKVNotiMsg 消息中携带的附加信息
2319
+ */
2320
+ notificationExtra?: string;
2321
+ }
2322
+ interface IChatroomEntries {
2323
+ /**
2324
+ * entries ,要设置的属性列表
2325
+ * key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2326
+ * value 属性对应的值, 最大长度 4096 字符
2327
+ */
2328
+ entries: {
2329
+ key: string;
2330
+ value: string;
2331
+ }[];
2332
+ /**
2333
+ * 设置成功后是否发送通知消息
2334
+ */
2335
+ /**
2336
+ * RC:chrmKVNotiMsg 消息中携带的附加信息
2337
+ */
2338
+ notificationExtra?: string;
2339
+ /**
2340
+ * 用户退出聊天室时是否清除此属性
2341
+ */
2342
+ isAutoDelete?: boolean;
2343
+ }
2344
+
2345
+ interface IUploadAuth {
2346
+ /**
2347
+ * 七牛 token 有效期
2348
+ */
2349
+ deadline: number;
2350
+ /**
2351
+ * 七牛上传 token
2352
+ */
2353
+ token: string;
2354
+ /**
2355
+ * 百度上传 token
2356
+ */
2357
+ bosToken: string;
2358
+ /**
2359
+ * 百度上传 header Date
2360
+ */
2361
+ bosDate: string;
2362
+ /**
2363
+ * 百度上传路径
2364
+ */
2365
+ path: string;
2366
+ /**
2367
+ * 上传文件名,阿里上传获取下载地址时,必须使用上传文件名,所以需抛出到业务端
2368
+ */
2369
+ fileName: string;
2370
+ /**
2371
+ * 阿里云 oss 的 AccessKeyId
2372
+ */
2373
+ osskeyId: string;
2374
+ /**
2375
+ * 阿里云 oss post 请求表单域中的字段 policy
2100
2376
  */
2101
2377
  ossPolicy: string;
2102
2378
  /**
@@ -2166,6 +2442,15 @@ interface IExpansionListenerData {
2166
2442
  deletedExpansion?: IDeletedExpansion;
2167
2443
  }
2168
2444
 
2445
+ interface IRTCRoomInfo {
2446
+ roomId: string;
2447
+ roomData: unknown[];
2448
+ userCount: number;
2449
+ list: unknown[];
2450
+ }
2451
+ interface IRtcTokenData {
2452
+ rtcToken: string;
2453
+ }
2169
2454
  interface IRTCUsers {
2170
2455
  users: {
2171
2456
  [userId: string]: {
@@ -2176,29 +2461,12 @@ interface IRTCUsers {
2176
2461
  };
2177
2462
  };
2178
2463
  }
2179
-
2180
- interface IRtcTokenData {
2181
- rtcToken: string;
2182
- }
2183
-
2184
- interface KVString {
2185
- [key: string]: string;
2186
- }
2187
-
2188
- interface IRTCRoomInfo {
2189
- roomId: string;
2190
- roomData: unknown[];
2191
- userCount: number;
2192
- list: unknown[];
2193
- }
2194
-
2195
2464
  interface IJoinRTCRoomData extends IRTCUsers {
2196
2465
  token: string;
2197
2466
  sessionId: string;
2198
- roomInfo: {
2199
- key: string;
2200
- value: string;
2201
- }[];
2467
+ }
2468
+ interface KVString {
2469
+ [key: string]: string;
2202
2470
  }
2203
2471
 
2204
2472
  /**
@@ -2250,249 +2518,211 @@ declare enum UploadMethod {
2250
2518
  STC = 4
2251
2519
  }
2252
2520
 
2253
- interface IRecallMsgOptions {
2254
- /**
2255
- * 会话组织机构标识
2256
- * 默认值未 空字符串
2257
- */
2258
- channelId: string;
2259
- /**
2260
- * 发送消息携带的用户信息
2261
- */
2262
- user?: IUserProfile;
2521
+ /**
2522
+ * 导航信息数据就结构
2523
+ */
2524
+ interface INaviInfo {
2263
2525
  /**
2264
- * Push 信息
2265
- */
2266
- pushContent?: string;
2526
+ * Navi 数据请求响应码,200 为成功请求
2527
+ */
2528
+ code: number;
2267
2529
  /**
2268
- * 原消息体
2269
- */
2270
- oriContent?: any;
2530
+ * 获取 Navi 数据失败时的提示信息
2531
+ */
2532
+ errorMessage?: string;
2271
2533
  /**
2272
- * 是否发送静默消息
2273
- * @description
2274
- * 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
2275
- */
2276
- disableNotification?: boolean;
2534
+ * 获取 Navi 数据失败时的请求 url 信息
2535
+ */
2536
+ url?: string;
2277
2537
  /**
2278
- * 移动端推送配置
2279
- */
2280
- pushConfig?: IPushConfig;
2281
- }
2282
-
2283
- interface IInsertMsgOptions {
2284
- senderUserId: string;
2285
- messageType: string;
2286
- content: string;
2287
- messageDirection: number;
2288
- readStatus?: number;
2289
- sentStatus?: number;
2290
- sentTime?: number;
2291
- searchContent?: string;
2292
- isUnread?: boolean;
2293
- messageUId?: string;
2294
- disableNotification?: boolean;
2295
- canIncludeExpansion?: boolean;
2296
- expansionMsg?: string;
2297
- channelId: string;
2298
- }
2299
-
2300
- interface IChatroomEntry {
2538
+ * 请求导航数据时使用的协议:http / https
2539
+ * @description 该字段为 SDK 内增加的字段,导航接口数据中不存在
2540
+ */
2541
+ protocol: 'http' | 'https';
2301
2542
  /**
2302
- * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2543
+ * 获取导航时使用的 userId,小程序不走导航,故拿不到 userId
2303
2544
  */
2304
- key: string;
2545
+ userId?: string;
2305
2546
  /**
2306
- * 属性对应的值, 最大长度 4096 字符
2547
+ * CMP 服务 Websocket 连接地址,包含域名与端口,不含 ws 或 wss 协议头
2548
+ * @example a.domain.com:443
2307
2549
  */
2308
- value: string;
2550
+ server: string;
2309
2551
  /**
2310
- * 设置成功后是否发送通知消息
2552
+ * 备用 CMP 服务地址,包含域名与端口,不含 ws 或 wss 协议头,多个备用地址以 ',' 分割
2553
+ * @example a.domain.com:443,b.domain.com:443
2311
2554
  */
2312
- isSendNotification?: boolean;
2555
+ backupServer?: string;
2313
2556
  /**
2314
- * RC:chrmKVNotiMsg 消息中携带的附加信息
2557
+ * 备用 CMP 服务地址,POST 请求 TCP 连接返回的是 bs 字段,非 backupServer 字段
2315
2558
  */
2316
- notificationExtra?: string;
2559
+ bs?: string;
2317
2560
  /**
2318
- * 用户退出聊天室时是否清除此属性
2561
+ * RTC 服务配置,其值可能为 null、无效字符串、有效 JSON 字符串
2562
+ * 1. 公有云未开通音视频时,值为 null
2563
+ * 2. 私有云无配置时为 `{ "strategy": 0 }`
2319
2564
  */
2320
- isAutoDelete?: boolean;
2321
- }
2322
-
2323
- interface IRemoveChatRoomEntryOption {
2565
+ voipCallInfo: string | null;
2324
2566
  /**
2325
- * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2567
+ * 聊天室 kv 存储开关
2568
+ * @todo 需确认详细有效值
2569
+ * @description 公有云独有配置
2326
2570
  */
2327
- key: string;
2571
+ kvStorage: number;
2328
2572
  /**
2329
- * 删除成功后是否发送通知消息
2573
+ * HttpDNS 功能开关,在 web 端无效
2574
+ * @description 公有云独有配置
2330
2575
  */
2331
- isSendNotification?: boolean;
2576
+ openHttpDNS: boolean;
2332
2577
  /**
2333
- * RC:chrmKVNotiMsg 消息中携带的附加信息
2578
+ * 历史消息云存储功能开关
2579
+ * @description
2580
+ * 1. 公有云通过 `developer.rongcloud.cn` 管理后台 `单群聊消息云端存储` 功能开关进行配置
2581
+ * 2. 私有云默认为 `true`
2334
2582
  */
2335
- notificationExtra?: string;
2336
- }
2337
-
2338
- interface IChatroomEntryListenerData {
2583
+ historyMsg: boolean;
2339
2584
  /**
2340
- * 更新的键
2341
- */
2342
- key: string;
2585
+ * 聊天室历史消息开关
2586
+ * @description
2587
+ * 1. 私有云对聊天室功能支持有限,默认为 `false`
2588
+ * 2. TODO: 公有云配置待确认
2589
+ */
2590
+ chatroomMsg: boolean;
2343
2591
  /**
2344
- * 更新的值
2345
- */
2346
- value: string;
2592
+ * 文件服务器地址
2593
+ * @description
2594
+ * 1. 公有云下,该地址为七牛云服务器地址
2595
+ * 2. 私有云下,该地址为私有云自研文件服务器地址
2596
+ */
2597
+ uploadServer: string;
2347
2598
  /**
2348
- * 更新的时间
2349
- */
2350
- timestamp: number;
2599
+ * 实时位置共享配置,web 端无需处理
2600
+ */
2601
+ location: null | string;
2351
2602
  /**
2352
- * 更新的聊天室 ID
2353
- */
2354
- chatroomId: string;
2603
+ * 实时日志上传开关
2604
+ * @todo 需确认有效值及作用
2605
+ */
2606
+ monitor: number;
2355
2607
  /**
2356
- * 更新类型
2357
- */
2358
- type: ChatroomEntryType;
2359
- }
2360
- interface IChatroomRejoinedFailed {
2608
+ * 是否允许加入多聊天室开关
2609
+ */
2610
+ joinMChrm: boolean;
2361
2611
  /**
2362
- * 自动重新加入的聊天室 ID
2363
- */
2364
- chatroomId: string;
2612
+ * 是否开启公众号功能:`0` 为未开启,`1` 为已开启
2613
+ */
2614
+ openMp: 0 | 1;
2365
2615
  /**
2366
- * 自动重新加入失败的 code
2367
- */
2368
- errorCode: number;
2369
- }
2370
- interface IChatroomRejoinedSuccessed {
2616
+ * 是否开启用户级配置,若开启,需连接成功后立即拉取实时配置,0 | 1
2617
+ * @description
2618
+ * 配置来源:
2619
+ * 1. 导航
2620
+ * 2. 服务端实时下发
2621
+ * 已有配置字段:
2622
+ * 1. Lan. 推送使用的语言设置,用户端可自定义修改. Web 端未做设置, 只做接收
2623
+ * 2. ShPushSwit. 推送是否显示详情设置,用户端可自定义修改. Web 端未做设置, 只做接收
2624
+ * 3. MobPushSwit: Web/PC 在线,移动端不在线是否发送推送开关,用户端可自定义修改. Web 端未做设置, 只做接收
2625
+ * 4. OffMsgDur: 离线消息保存天数,设置天数不可大于App级对应配置,用户端可自定义修改. Web 端未做设置, 只做接收
2626
+ * 5. VoipInfo: 音视频相关配置,用户端不可自定义修改. 由服务端决定,与导航下发格式一致
2627
+ * @todo 需确认公有云与私有云区别
2628
+ */
2629
+ openUS: 0 | 1;
2371
2630
  /**
2372
- * 自动重新加入的聊天室 ID
2373
- */
2374
- chatroomId: string;
2631
+ * 群离线消息最大下发条数,`0` 为关闭
2632
+ * @description 公有云独有配合
2633
+ */
2634
+ grpMsgLimit: number;
2375
2635
  /**
2376
- * 自动重新加入的聊天室拉取消息的数量
2377
- */
2378
- count: number;
2379
- }
2380
- declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
2381
- /**
2382
- * 聊天室信息
2383
- */
2384
- interface IChatroomListenerData {
2636
+ * 消息加密开关,0 为关闭
2637
+ * @todo
2638
+ * 1. 确定其控制的功能
2639
+ * 2. 确定 web 相关性
2640
+ */
2641
+ isFormatted: number;
2385
2642
  /**
2386
- * SDK 内部重连聊天室信息
2387
- */
2388
- rejoinedRoom?: IChatroomRejoinedInfo;
2643
+ * GIF 动图大小限制,默认 2048 KB
2644
+ */
2645
+ gifSize: number;
2389
2646
  /**
2390
- * 监听到的聊天室 KV 更新
2391
- */
2392
- updatedEntries?: IChatroomEntryListenerData[];
2393
- }
2394
-
2395
- interface IUpdatedConversation {
2396
- updatedItems: {
2397
- [key: string]: {
2398
- time: number;
2399
- val: any;
2400
- };
2401
- };
2402
- conversationType: number;
2403
- targetId: string;
2404
- latestMessage?: IReceivedMessage;
2405
- unreadMessageCount?: number;
2406
- hasMentioned?: boolean;
2407
- mentionedInfo?: {
2408
- /**
2409
- * `@ 类型,其中 1 为 @ 所有人,2 为 @ 部分人`
2410
- */
2411
- type: 1 | 2;
2412
- /**
2413
- * 被 @ 的用户 Id 列表,仅在 `type` 为 `2` 时有效
2414
- */
2415
- userIdList: string[];
2416
- };
2417
- lastUnreadTime?: number;
2418
- notificationStatus?: number;
2419
- isTop?: boolean;
2647
+ * 上传小视频时长限制,单位:秒
2648
+ * @description 公有云字段,即私有云配置中的 `uploadVideoTimeLimit`
2649
+ */
2650
+ videoTimes?: number;
2420
2651
  /**
2421
- * 会话标识
2422
- */
2423
- channelId?: string;
2424
- tags?: IUpdatedConversation[];
2425
- }
2426
-
2427
- declare class PluginContext {
2428
- protected readonly _context: APIContext;
2429
- constructor(_context: APIContext);
2652
+ * 上传小视频时长限制,单位:秒
2653
+ * @description 私有云字段,即公有云配置中的 `videoTimes`
2654
+ */
2655
+ uploadVideoTimeLimit?: number;
2430
2656
  /**
2431
- * 接收 IM 服务推送的消息,并通过返回 boolean 值决定此消息是否拦截
2432
- * @param message
2433
- * @returns 当返回值为 true,接收的消息将终止继续传递
2657
+ * 实时日志上传开关:`0` 为关闭,`1` 为开启
2434
2658
  */
2435
- onmessage?(message: IReceivedMessage): boolean;
2659
+ logSwitch: number;
2436
2660
  /**
2437
- * 用户主动断开连接的事件通知
2661
+ * 实时日志上传策略
2662
+ * @example `'{ "url": "logcollection.ronghub.com", "level": 1,"itv": 6, "times": 5 }'`
2438
2663
  */
2439
- ondisconnect?(): void;
2664
+ logPolicy: string;
2440
2665
  /**
2441
- * 接收 IM 连接状态变更通知
2442
- * @param status
2666
+ * 百度 BOS 存储服务地址
2667
+ * @description 公有云独有配置
2668
+ * @example `gz.bcebos.com`
2443
2669
  */
2444
- onconnectionstatechange?(status: ConnectionStatus): void;
2670
+ bosAddr?: string;
2445
2671
  /**
2446
- * IM 客户端销毁通知
2672
+ * 阿里上传配置,字符串数组,数组顺序代表 七牛、百度、阿里云 上传权重
2673
+ * @example "[{"qiniu":"upload.qiniup.com","p":"1"},{"baidu":"gz.bcebos.com","p":"2"},{"aliyun":"oss-cn-beijing.aliyuncs.com","p":"3"}]"
2447
2674
  */
2448
- ondestroy?(): void;
2675
+ ossConfig?: string;
2449
2676
  /**
2450
- * RTC 数据通知
2451
- * @param roomdId 数据对应的房间 Id
2452
- * @param data 通知数据为 key:value 方式
2453
- * @description
2454
- * 目前仅通知:主播加入、退出房间的人员列表变更,发布、取消发布资源列表变更
2455
- */
2456
- onrtcdatachange?(data: IServerRTCRoomEntry[], roomdId?: string): void;
2677
+ * 私有云专有属性,可用来判断当前环境是公有云还是私有云,私有云环境下该值为 `1`
2678
+ */
2679
+ type?: number;
2457
2680
  /**
2458
- * 获取 `@rongcloud/engine` 包版本
2681
+ * @deprecated 已废弃
2459
2682
  */
2460
- getCoreVersion(): string;
2683
+ compDays: number;
2461
2684
  /**
2462
- * 获取当前运行中的 IMLib 版本号
2685
+ * @deprecated 已废弃
2463
2686
  */
2464
- getAPIVersion(): string;
2687
+ msgAck: unknown;
2465
2688
  /**
2466
- * 获取当前应用的 appkey
2689
+ * @deprecated 已废弃
2467
2690
  */
2468
- getAppkey(): string;
2691
+ activeServer: string;
2469
2692
  /**
2470
- * 获取当前已连接用户的 userId
2471
- * 用户连接建立之前及 disconnect 之后,该方法返回 '' 值
2693
+ * @deprecated 已废弃
2472
2694
  */
2473
- getCurrentId(): string;
2695
+ qnAddr: string;
2474
2696
  /**
2475
- * 获取当前连接状态
2697
+ * @deprecated 已废弃
2476
2698
  */
2477
- getConnectionStatus(): ConnectionStatus;
2478
- getDeviceId(): string;
2699
+ extkitSwitch: number;
2479
2700
  /**
2480
- * 发送消息
2701
+ * @deprecated 已废弃
2481
2702
  */
2482
- sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
2703
+ alone: boolean;
2483
2704
  /**
2484
- * 消息注册
2485
- * @description 消息注册需在应用初始化完成前进行
2486
- * @param objectName 消息类型,如:RC:TxtMsg
2487
- * @param isPersited 是否存储
2488
- * @param isCounted 是否技术
2489
- * @param searchProps 搜索字段,只在搭配协议栈使用时有效
2705
+ * @deprecated 已废弃
2490
2706
  */
2491
- registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
2707
+ voipServer: string;
2492
2708
  /**
2493
- * 获取服务时间
2709
+ * 离线日志上报地址
2710
+ * @deprecated 已废弃
2494
2711
  */
2495
- getServerTime(): number;
2712
+ offlinelogserver: string;
2713
+ /**
2714
+ * 在线日志上报地址
2715
+ * @deprecated 已废弃
2716
+ */
2717
+ onlinelogserver?: string;
2718
+ /**
2719
+ * 链路加密字段,内容为 JSON 字符串,仅限 C++ 可用
2720
+ */
2721
+ crypto?: string;
2722
+ /**
2723
+ * 群组回执开关, 1: 打开,0(或者没有): 关闭
2724
+ */
2725
+ grpRRVer?: number;
2496
2726
  }
2497
2727
 
2498
2728
  declare enum ReceivedStatus {
@@ -2667,12 +2897,24 @@ declare enum MessageType {
2667
2897
  /**
2668
2898
  * 接受群已读回执更新消息(导航开关grpRRVer为1时使用)
2669
2899
  */
2670
- GROUP_READ_RECEIPT_REQUEST = "RC:RRMsg"
2671
- }
2672
-
2673
- /**
2674
- * 群组 @ 类型
2675
- */
2900
+ GROUP_READ_RECEIPT_REQUEST = "RC:RRMsg",
2901
+ /**
2902
+ * 用户加入聊天室
2903
+ */
2904
+ CHATROOM_JOIN = "RC:ChrmJoinNtf",
2905
+ /**
2906
+ * 用户退出聊天室
2907
+ */
2908
+ CHATROOM_LEFT = "RC:ChrmQuitNtf",
2909
+ /**
2910
+ * 用户加入退出聊天室的集合
2911
+ */
2912
+ CHATROOM_MERGE_CHANGE = "RC:ChrmMemChange"
2913
+ }
2914
+
2915
+ /**
2916
+ * 群组 @ 类型
2917
+ */
2676
2918
  declare enum MentionedType {
2677
2919
  /**
2678
2920
  * 所有人
@@ -2727,1357 +2969,1162 @@ declare enum LogType {
2727
2969
  }
2728
2970
 
2729
2971
  /**
2730
- * 导航信息数据就结构
2972
+ * 拓展方法定义,便于 electron-solution 实现时保持接口类型推导可用
2731
2973
  */
2732
- interface INaviInfo {
2974
+ interface IExtraMethod {
2975
+ getConversationsByPage(conversationTypes: ConversationType[], sentTime: number, count: number, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
2976
+ getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: 0 | 1, tag: string): Promise<IAsyncRes<{
2977
+ list: IReceivedMessage[];
2978
+ hasMore: boolean;
2979
+ }>>;
2980
+ updateMessageReceiptStatus(conersationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<boolean>>;
2981
+ }
2982
+
2983
+ /**
2984
+ * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
2985
+ */
2986
+ interface IEngine {
2733
2987
  /**
2734
- * Navi 数据请求响应码,200 为成功请求
2988
+ * 建立连接
2989
+ * @param token
2990
+ * @param naviInfo
2735
2991
  */
2736
- code: number;
2992
+ connect(token: string, naviInfo: INaviInfo, versionInfo: string): Promise<ErrorCode>;
2737
2993
  /**
2738
- * 获取 Navi 数据失败时的提示信息
2994
+ * 上报版本信息
2995
+ * @param version
2739
2996
  */
2740
- errorMessage?: string;
2997
+ reportSDKInfo(version: {
2998
+ [name: string]: string;
2999
+ }): void;
2741
3000
  /**
2742
- * 获取 Navi 数据失败时的请求 url 信息
3001
+ * 连接时间
2743
3002
  */
2744
- url?: string;
3003
+ getConnectedTime(): number;
2745
3004
  /**
2746
- * 请求导航数据时使用的协议:http / https
2747
- * @description 该字段为 SDK 内增加的字段,导航接口数据中不存在
3005
+ * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
3006
+ * 对于未实现的方法,接口响应 Unsupport 错误码
3007
+ * @param method
3008
+ * @param args
2748
3009
  */
2749
- protocol: 'http' | 'https';
3010
+ callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
2750
3011
  /**
2751
- * 获取导航时使用的 userId,小程序不走导航,故拿不到 userId
3012
+ * 获取历史消息
3013
+ * @param conversationType
3014
+ * @param targetId
3015
+ * @param timestamp
3016
+ * @param count
3017
+ * @param order
2752
3018
  */
2753
- userId?: string;
3019
+ getHistoryMessage(conversationType: ConversationType, targetId: string,
2754
3020
  /**
2755
- * CMP 服务 Websocket 连接地址,包含域名与端口,不含 ws 或 wss 协议头
2756
- * @example a.domain.com:443
3021
+ * 拉取时间戳,值为 `0` 表示从当前时间拉取
2757
3022
  */
2758
- server: string;
3023
+ timestamp: number,
2759
3024
  /**
2760
- * 备用 CMP 服务地址,包含域名与端口,不含 ws 或 wss 协议头,多个备用地址以 ',' 分割
2761
- * @example a.domain.com:443,b.domain.com:443
3025
+ * 获取条数, 有效值 `1` - `20`
2762
3026
  */
2763
- backupServer?: string;
3027
+ count: number,
2764
3028
  /**
2765
- * 备用 CMP 服务地址,POST 请求 TCP 连接返回的是 bs 字段,非 backupServer 字段
3029
+ * @description
3030
+ * 1. `0` 表示升序,获取消息发送时间比传入 `sentTime` 小 的消息
3031
+ * 2. `1` 表示降序,获取消息发送时间比传入 `sentTime` 大 的消息
2766
3032
  */
2767
- bs?: string;
3033
+ order: 0 | 1,
2768
3034
  /**
2769
- * RTC 服务配置,其值可能为 null、无效字符串、有效 JSON 字符串
2770
- * 1. 公有云未开通音视频时,值为 null
2771
- * 2. 私有云无配置时为 `{ "strategy": 0 }`
2772
- */
2773
- voipCallInfo: string | null;
3035
+ * 会话的业务标识
3036
+ */
3037
+ channelId: string,
2774
3038
  /**
2775
- * 聊天室 kv 存储开关
2776
- * @todo 需确认详细有效值
2777
- * @description 公有云独有配置
3039
+ * 消息类型
2778
3040
  */
2779
- kvStorage: number;
3041
+ objectName: string): IPromiseResult<{
3042
+ list: IReceivedMessage[];
3043
+ hasMore: boolean;
3044
+ }>;
2780
3045
  /**
2781
- * HttpDNS 功能开关,在 web 端无效
2782
- * @description 公有云独有配置
2783
- */
2784
- openHttpDNS: boolean;
3046
+ * 删除历史消息 通过 messageUId
3047
+ */
3048
+ deleteRemoteMessage(conversationType: ConversationType, targetId: string,
2785
3049
  /**
2786
- * 历史消息云存储功能开关
2787
3050
  * @description
2788
- * 1. 公有云通过 `developer.rongcloud.cn` 管理后台 `单群聊消息云端存储` 功能开关进行配置
2789
- * 2. 私有云默认为 `true`
2790
- */
2791
- historyMsg: boolean;
3051
+ * message messageUId、setTime、messageDirection 为必须参数
3052
+ */
3053
+ messages: {
3054
+ messageUId: string;
3055
+ sentTime: number;
3056
+ messageDirection: MessageDirection;
3057
+ }[],
2792
3058
  /**
2793
- * 聊天室历史消息开关
2794
- * @description
2795
- * 1. 私有云对聊天室功能支持有限,默认为 `false`
2796
- * 2. TODO: 公有云配置待确认
2797
- */
2798
- chatroomMsg: boolean;
3059
+ * 会话的业务标识
3060
+ */
3061
+ channelId: string): Promise<ErrorCode>;
3062
+ recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
2799
3063
  /**
2800
- * 文件服务器地址
2801
- * @description
2802
- * 1. 公有云下,该地址为七牛云服务器地址
2803
- * 2. 私有云下,该地址为私有云自研文件服务器地址
2804
- */
2805
- uploadServer: string;
3064
+ * 删除历史消息 通过 时间戳
3065
+ * @param timestamp 小于等于传入时间戳的消息均删除
3066
+ */
3067
+ deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number,
2806
3068
  /**
2807
- * 实时位置共享配置,web 端无需处理
2808
- */
2809
- location: null | string;
3069
+ * 会话的业务标识
3070
+ */
3071
+ channelId: string): Promise<ErrorCode>;
2810
3072
  /**
2811
- * 实时日志上传开关
2812
- * @todo 需确认有效值及作用
3073
+ * 获取会话列表
3074
+ * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
2813
3075
  */
2814
- monitor: number;
3076
+ getConversationList(
2815
3077
  /**
2816
- * 是否允许加入多聊天室开关
3078
+ * 拉取数量, 有效值 0 - 1000, 默认 300
2817
3079
  */
2818
- joinMChrm: boolean;
3080
+ count: number,
2819
3081
  /**
2820
- * 是否开启公众号功能:`0` 为未开启,`1` 为已开启
3082
+ * 会话类型
3083
+ * @todo 待确认是否生效
2821
3084
  */
2822
- openMp: 0 | 1;
3085
+ conversationType?: ConversationType,
2823
3086
  /**
2824
- * 是否开启用户级配置,若开启,需连接成功后立即拉取实时配置,0 | 1
2825
- * @description
2826
- * 配置来源:
2827
- * 1. 导航
2828
- * 2. 服务端实时下发
2829
- * 已有配置字段:
2830
- * 1. Lan. 推送使用的语言设置,用户端可自定义修改. Web 端未做设置, 只做接收
2831
- * 2. ShPushSwit. 推送是否显示详情设置,用户端可自定义修改. Web 端未做设置, 只做接收
2832
- * 3. MobPushSwit: Web/PC 在线,移动端不在线是否发送推送开关,用户端可自定义修改. Web 端未做设置, 只做接收
2833
- * 4. OffMsgDur: 离线消息保存天数,设置天数不可大于App级对应配置,用户端可自定义修改. Web 端未做设置, 只做接收
2834
- * 5. VoipInfo: 音视频相关配置,用户端不可自定义修改. 由服务端决定,与导航下发格式一致
2835
- * @todo 需确认公有云与私有云区别
2836
- */
2837
- openUS: 0 | 1;
3087
+ * 起始时间
3088
+ */
3089
+ startTime?: number,
2838
3090
  /**
2839
- * 群离线消息最大下发条数,`0` 为关闭
2840
- * @description 公有云独有配合
2841
- */
2842
- grpMsgLimit: number;
3091
+ * 获取顺序
3092
+ */
3093
+ order?: 0 | 1,
2843
3094
  /**
2844
- * 消息加密开关,0 为关闭
2845
- * @todo
2846
- * 1. 确定其控制的功能
2847
- * 2. 确定 web 相关性
2848
- */
2849
- isFormatted: number;
3095
+ * 会话的业务标识
3096
+ */
3097
+ channelId?: string): IPromiseResult<IReceivedConversation[]>;
2850
3098
  /**
2851
- * GIF 动图大小限制,默认 2048 KB
2852
- */
2853
- gifSize: number;
3099
+ * 获取指定会话
3100
+ */
3101
+ getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
2854
3102
  /**
2855
- * 上传小视频时长限制,单位:秒
2856
- * @description 公有云字段,即私有云配置中的 `uploadVideoTimeLimit`
3103
+ * 删除会话
3104
+ * @description 该删除操作会删除服务器端存储的会话数据
3105
+ * @param conversationType
3106
+ * @param targetId
2857
3107
  */
2858
- videoTimes?: number;
3108
+ removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
2859
3109
  /**
2860
- * 上传小视频时长限制,单位:秒
2861
- * @description 私有云字段,即公有云配置中的 `videoTimes`
3110
+ * 获取所有会话未读数
3111
+ * @param channelId 多组织 Id
3112
+ * @param conversationTypes
3113
+ * @param includeMuted 包含已设置免打扰的会话
2862
3114
  */
2863
- uploadVideoTimeLimit?: number;
3115
+ getAllConversationUnreadCount(channelId: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
2864
3116
  /**
2865
- * 实时日志上传开关:`0` 为关闭,`1` 为开启
3117
+ * 获取指定会话未读数
2866
3118
  */
2867
- logSwitch: number;
3119
+ getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
2868
3120
  /**
2869
- * 实时日志上传策略
2870
- * @example `'{ "url": "logcollection.ronghub.com", "level": 1,"itv": 6, "times": 5 }'`
3121
+ * 清除指定会话未读数
2871
3122
  */
2872
- logPolicy: string;
3123
+ clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
2873
3124
  /**
2874
- * 百度 BOS 存储服务地址
2875
- * @description 公有云独有配置
2876
- * @example `gz.bcebos.com`
3125
+ * 获取第一个未读消息
2877
3126
  */
2878
- bosAddr?: string;
3127
+ getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
2879
3128
  /**
2880
- * 阿里上传配置,字符串数组,数组顺序代表 七牛、百度、阿里云 上传权重
2881
- * @example "[{"qiniu":"upload.qiniup.com","p":"1"},{"baidu":"gz.bcebos.com","p":"2"},{"aliyun":"oss-cn-beijing.aliyuncs.com","p":"3"}]"
3129
+ * 设置/保存指定会话消息草稿
3130
+ * @draft 草稿内容
2882
3131
  */
2883
- ossConfig?: string;
3132
+ saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
2884
3133
  /**
2885
- * 私有云专有属性,可用来判断当前环境是公有云还是私有云,私有云环境下该值为 `1`
3134
+ * 获取指定会话消息草稿
2886
3135
  */
2887
- type?: number;
3136
+ getConversationMessageDraft(conversationType: ConversationType, targetId: string): IPromiseResult<string>;
2888
3137
  /**
2889
- * @deprecated 已废弃
3138
+ * 清除指定会话消息草稿
2890
3139
  */
2891
- compDays: number;
3140
+ clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
2892
3141
  /**
2893
- * @deprecated 已废弃
3142
+ * 从服务端拉取会话状态
2894
3143
  */
2895
- msgAck: unknown;
3144
+ pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
2896
3145
  /**
2897
- * @deprecated 已废弃
3146
+ * 批量设置会话 置顶、免打扰
2898
3147
  */
2899
- activeServer: string;
3148
+ batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
3149
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): IPromiseResult<IReceivedMessage>;
2900
3150
  /**
2901
- * @deprecated 已废弃
3151
+ * 断开连接
2902
3152
  */
2903
- qnAddr: string;
3153
+ disconnect(): void;
2904
3154
  /**
2905
- * @deprecated 已废弃
3155
+ * 拉取用户级配置数据
2906
3156
  */
2907
- extkitSwitch: number;
3157
+ pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
2908
3158
  /**
2909
- * @deprecated 已废弃
3159
+ * 消息注册
3160
+ * @description
3161
+ * 消息注册需在应用初始化完成前进行,否则在搭配 C++ 协议栈使用时,
3162
+ * 本端发出的消息将不默认作为未知消息处理,不存储、不计数
3163
+ * @param objectName 消息类型,如:RC:TxtMsg
3164
+ * @param isPersited 是否存储
3165
+ * @param isCounted 是否技术
3166
+ * @param searchProps 搜索字段,只在搭配协议栈使用时有效
2910
3167
  */
2911
- alone: boolean;
3168
+ registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
2912
3169
  /**
2913
- * @deprecated 已废弃
2914
- */
2915
- voipServer: string;
3170
+ * 加入聊天室
3171
+ * @param count 拉取消息数量
3172
+ */
3173
+ joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
2916
3174
  /**
2917
- * 离线日志上报地址
2918
- * @deprecated 已废弃
2919
- */
2920
- offlinelogserver: string;
3175
+ * 加入已存在的聊天室
3176
+ * @param count 拉取消息数量
3177
+ */
3178
+ joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
2921
3179
  /**
2922
- * 在线日志上报地址
2923
- * @deprecated 已废弃
2924
- */
2925
- onlinelogserver?: string;
3180
+ * 退出聊天室
3181
+ */
3182
+ quitChatroom(chatroomId: string): Promise<ErrorCode>;
2926
3183
  /**
2927
- * 链路加密字段,内容为 JSON 字符串,仅限 C++ 可用
2928
- */
2929
- crypto?: string;
3184
+ * 获取聊天室信息
3185
+ * @param count 获取人数, 范围 0 - 20
3186
+ * @param order 排序方式, 1 正序, 2 倒序
3187
+ */
3188
+ getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
2930
3189
  /**
2931
- * 群组回执开关, 1: 打开,0(或者没有): 关闭
2932
- */
2933
- grpRRVer?: number;
2934
- }
2935
-
2936
- /**
2937
- * 拓展方法定义,便于 electron-solution 实现时保持接口类型推导可用
2938
- */
2939
- interface IExtraMethod {
2940
- getConversationsByPage(conversationTypes: ConversationType[], sentTime: number, count: number, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
2941
- getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: 0 | 1, tag: string): Promise<IAsyncRes<{
3190
+ * 获取聊天室历史消息
3191
+ */
3192
+ getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
2942
3193
  list: IReceivedMessage[];
2943
3194
  hasMore: boolean;
2944
- }>>;
2945
- updateMessageReceiptStatus(conersationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<boolean>>;
2946
- }
2947
-
2948
- /**
2949
- * typing相关接口
2950
- */
2951
-
2952
- /**
2953
- * typing信息
2954
- */
2955
- interface ITypingUser {
2956
- userId: string;
2957
- timestamp: number;
2958
- messageType: string;
2959
- }
2960
- /**
2961
- * 内存存储typing,key为conversationType_targetId
2962
- */
2963
- interface ITypingInfo {
2964
- [key: string]: Array<ITypingUser>;
2965
- }
2966
- /**
2967
- * typing通知消息接口
2968
- */
2969
- interface ITypingMessage {
2970
- targetId: string;
2971
- conversationType: ConversationType;
2972
- channelId?: string;
2973
- list: Array<ITypingUser>;
2974
- }
2975
-
2976
- interface IConnectResult {
3195
+ }>;
2977
3196
  /**
2978
- * 连接错误码
2979
- */
2980
- code: ErrorCode;
3197
+ * 设置聊天室属性
3198
+ */
3199
+ setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
2981
3200
  /**
2982
- * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
3201
+ * 批量设置聊天室属性
2983
3202
  */
2984
- userId?: string;
2985
- }
2986
- declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
2987
- declare type IConnectionStatusListener = (status: ConnectionStatus) => void;
2988
- declare type IConversationStateListener = (conversation: IUpdatedConversation[]) => void;
2989
- declare type IChatroomListener = (state: IChatroomListenerData) => void;
2990
- declare type IRTCInnerListener = {
2991
- message?: IMessageListnenr;
2992
- status?: IConnectionStatusListener;
2993
- };
2994
- declare type IExpansionListener = (data: IExpansionListenerData) => void;
2995
- declare type ITagListener = () => void;
2996
- declare type IConversationTagListener = () => void;
2997
- declare type ItypingStateListener = (data: ITypingMessage[]) => void;
2998
- interface ISendExMsgOptions {
2999
- channelId: string;
3000
- conversationType: ConversationType;
3001
- targetId: string;
3203
+ setChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<ErrorCode>;
3002
3204
  /**
3003
- * 消息 ID
3205
+ * 强制设置聊天室属性
3004
3206
  */
3005
- messageUId: string;
3207
+ forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3006
3208
  /**
3007
- * 原始消息是否支持扩展的字段
3209
+ * 删除聊天室属性
3008
3210
  */
3009
- canIncludeExpansion: boolean;
3211
+ removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3010
3212
  /**
3011
- * 删除的 keys
3213
+ * 批量删除聊天室属性
3214
+ */
3215
+ removeChatroomEntries(chatroomId: string, entries: IChrmKVEntries): Promise<ErrorCode>;
3216
+ /**
3217
+ * 强制删除聊天室属性
3012
3218
  */
3013
- keys?: string[];
3219
+ forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3014
3220
  /**
3015
- * 扩展对象
3221
+ * 获取聊天室 key 对应 value
3016
3222
  */
3017
- expansion?: {
3223
+ getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
3224
+ /**
3225
+ * 获取聊天室所有 key value
3226
+ */
3227
+ getAllChatroomEntry(chatroomId: string): IPromiseResult<{
3018
3228
  [key: string]: string;
3019
- };
3229
+ }>;
3020
3230
  /**
3021
- * 是否删除所有扩展
3231
+ * 获取上传认证信息
3232
+ * @description
3233
+ * 若不传 fileName 百度上传认证字段(bosToken、bosDate、path)均返回 null
3022
3234
  */
3023
- removeAll?: boolean;
3235
+ getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
3024
3236
  /**
3025
- * 原始消息的扩展
3237
+ * 获取文件上传后下载地址
3026
3238
  */
3027
- originExpansion?: {
3028
- [key: string]: string;
3029
- } | null;
3030
- }
3031
- interface IWatcher {
3032
- message?: IMessageListnenr;
3033
- connectionState?: IConnectionStatusListener;
3034
- conversationState?: IConversationStateListener;
3035
- chatroomState?: IChatroomListener;
3036
- expansion?: IExpansionListener;
3239
+ getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName?: string, originName?: string): IPromiseResult<{
3240
+ downloadUrl: string;
3241
+ }>;
3037
3242
  /**
3038
- * 为兼容老版本 RTCLib 与 CallLib 接收消息的方式,新版本消息走插件机制
3039
- */
3040
- rtcInnerWatcher?: IRTCInnerListener;
3243
+ * 创建标签
3244
+ * @param tag 标签
3245
+ */
3246
+ createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3041
3247
  /**
3042
- * 标签的增删改监听
3248
+ * 删除标签
3249
+ * @param tagId 标签id
3250
+ */
3251
+ removeTag(tagId: string): IPromiseResult<IAsyncRes>;
3252
+ /**
3253
+ * 编辑标签
3254
+ * @param tag 标签
3255
+ */
3256
+ updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3257
+ /**
3258
+ * 获取标签列表
3043
3259
  */
3044
- tag?: ITagListener;
3260
+ getTagList(): IPromiseResult<Array<ITagInfo>>;
3045
3261
  /**
3046
- * 会话中标签状态变更监听
3262
+ * 添加会话到标签(给多个会话增加标签)
3263
+ * @param tagId 标签id
3264
+ * @param conversations 要添加的会话列表
3047
3265
  */
3048
- conversationTagChanged?: IConversationTagListener;
3266
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
3049
3267
  /**
3050
- * 输入状态变更监听
3268
+ * 删除标签中的会话(从多个会话中批量删除指定标签)
3269
+ * @param tagId 标签id
3270
+ * @param conversations 要删除的会话列表
3051
3271
  */
3052
- typingState?: ItypingStateListener;
3272
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
3053
3273
  /**
3054
- * 是否拉取完毕添加通知
3274
+ * 删除会话中的标签(从单一会话中批量删除标签)
3275
+ * @param conversationType 会话类型
3276
+ * @param targetId 会话id
3277
+ * @param tagIds 要删除的标签列表
3055
3278
  */
3056
- pullFinished?: ITagListener;
3057
- }
3058
- interface IPluginGenerator<API, InitOption> {
3279
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
3059
3280
  /**
3060
- * 只读插件标识
3281
+ * 获取标签下的会话列表
3282
+ * @param tagId 标签id
3061
3283
  */
3062
- readonly tag: string;
3284
+ getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): IPromiseResult<IReceivedConversationByTag[]>;
3063
3285
  /**
3064
- * 版本号
3286
+ * 获取标签下的未读消息数
3287
+ * @param tagId 标签id
3288
+ * @param containMuted 是否包含免打扰会话
3065
3289
  */
3066
- readonly version?: string;
3290
+ getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
3067
3291
  /**
3068
- * 插件名称
3292
+ * 设置标签中会话置顶
3293
+ * @param conversation 会话
3069
3294
  */
3070
- readonly name?: string;
3295
+ setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
3071
3296
  /**
3072
- * 插件安装前的环境检测,通过返回 boolean 值确认插件是否可运行
3297
+ * 获取会话里的标签
3298
+ * @param config
3073
3299
  */
3074
- verify(runtime: IRuntime): boolean;
3300
+ getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
3075
3301
  /**
3076
- * 插件初始化
3077
- * @param context 插件调用上下文,用于实现插件的消息注册、消息首发等
3078
- * @param runtime 运行时实例,用于标识最终的运行时平台
3079
- * @param options 初始化参数
3302
+ * 发送群组消息已读回执
3303
+ * 导航下发已读回执开关为 true 时调用
3080
3304
  */
3081
- setup(context: PluginContext, runtime: IRuntime, options: InitOption): API;
3082
- }
3083
- interface IAPIContextOption {
3305
+ sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
3084
3306
  /**
3085
- * 应用 appkey
3307
+ * 获取群组消息已读列表
3086
3308
  */
3087
- appkey: string;
3309
+ getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
3088
3310
  /**
3089
- * IMLib 版本号
3311
+ * 获取服务器时间
3090
3312
  */
3091
- apiVersion: string;
3313
+ getServerTime(): number;
3092
3314
  /**
3093
- * 自定义导航地址:
3094
- * 1. 私有云环境下该值为必填项
3095
- * 2. 当存在自定义导航地址时,SDK 内部默认地址将无效
3096
- * 3. 当存在自定义导航地址时,地址 url 中需包含 http/https 协议头,否则视为无效值
3097
- * 4. 建立 ws/wss 连接前的 ping 接口使用的协议与导航 url 中的协议相同
3098
- * 5. 建立 websocket 建立连接时将根据 ping 接口使用的 http/https 协议来确定使用 ws/wss 协议
3099
- * 6. 动态导航使用的协议头将与自定义导航地址相同
3100
- * 7. 公有云默认使用 https 协议
3315
+ * 获取设备ID
3101
3316
  */
3102
- navigators: string[];
3317
+ getDeviceId(): string;
3103
3318
  /**
3104
- * (参数已废弃)~~c++ 协议栈数据库地址~~
3105
- * @deprecated
3319
+ * 设置用户在线状态监听器
3106
3320
  */
3107
- dbPath?: string;
3321
+ setUserStatusListener(config: {
3322
+ userIds: string[];
3323
+ }, listener: Function): void;
3108
3324
  /**
3109
- * 小程序的 CMP 代理地址
3110
- */
3111
- miniCMPProxy: string[];
3112
- /**
3113
- * 指定默认使用的连接类型
3114
- */
3115
- connectionType: 'websocket' | 'comet';
3116
- /**
3117
- * 修改 engine log 打印等级
3118
- */
3119
- logLevel?: LogLevel;
3120
- /**
3121
- * 修改默认的 log 输出函数
3122
- */
3123
- logStdout?: (logLevel: LogLevel, content: string) => void;
3124
- /**
3125
- * (已废弃)私有云标识
3126
- * @deprecated
3127
- */
3128
- isEnterPrise?: boolean;
3129
- /**
3130
- * typing状态过期时间
3131
- */
3132
- typingExpireTime?: number;
3133
- /**
3134
- * 是否打开 IndexDB 存储,默认为 true
3135
- */
3136
- indexDBSwitch?: boolean;
3137
- /**
3138
- * 是否校验证书,默认为 true
3139
- */
3140
- checkCA?: boolean;
3141
- }
3142
- declare class APIContext {
3143
- private _runtime;
3144
- private static _context?;
3145
- static init(runtime: IRuntime, options: IAPIContextOption): APIContext;
3146
- static destroy(): void;
3147
- private _token;
3148
- /**
3149
- * 插件队列,用于逐一派发消息与信令
3150
- */
3151
- private _pluginContextQueue;
3152
- /**
3153
- * 插件实例Map,用于重复初始化时返回实例
3154
- */
3155
- private _pluginInstanseMap;
3156
- private readonly _engine;
3157
- /**
3158
- * 核心库版本号,后期与 4.0 IM SDK 版本号保持一致
3159
- */
3160
- readonly coreVersion: string;
3161
- readonly appkey: string;
3162
- readonly apiVersion: string;
3163
- private readonly _options;
3164
- private _versionInfo;
3165
- private _typingInfo;
3166
- /**
3167
- * 内部连接状态标识,为 ture 时不允许调用 reconnect 方法
3168
- */
3169
- private _isInternalConnected;
3170
- constructor(_runtime: IRuntime, options: IAPIContextOption);
3171
- /**
3172
- * 安装使用插件,并初始化插件实例
3173
- * @param plugin
3174
- * @param options
3175
- */
3176
- install<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
3177
- private _connectionStatus;
3178
- private _canRedirectConnect;
3325
+ * 设置当前用户在线状态
3326
+ */
3327
+ setUserStatus(status: number): Promise<ErrorCode>;
3179
3328
  /**
3180
- * 重定向后,递归调用 connect
3181
- */
3182
- private _handleRedirect;
3329
+ * 订阅用户在线状态
3330
+ */
3331
+ subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
3183
3332
  /**
3184
- * 连接状态变更回调
3185
- * @param message
3186
- */
3187
- private _connectionStatusListener;
3188
- private _messageReceiver;
3333
+ * 获取用户状态
3334
+ */
3335
+ getUserStatus(userId: string): IPromiseResult<{
3336
+ status: string;
3337
+ }>;
3189
3338
  /**
3190
- * 聊天室相关信息监听
3339
+ * 清空所有会话
3191
3340
  */
3192
- private _chatroomInfoListener;
3341
+ clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
3193
3342
  /**
3194
- * 会话监听相关
3343
+ * 加入黑名单
3195
3344
  */
3196
- private _conversationInfoListener;
3345
+ addToBlacklist(userId: string): Promise<ErrorCode>;
3197
3346
  /**
3198
- * 消息扩展监听相关
3347
+ * 将指定用户移除黑名单
3199
3348
  */
3200
- private _expansionInfoListener;
3349
+ removeFromBlacklist(userId: string): Promise<ErrorCode>;
3201
3350
  /**
3202
- * 标签增删改监听
3203
- */
3204
- private _tagListener;
3351
+ * 获取黑名单列表
3352
+ */
3353
+ getBlacklist(): IPromiseResult<string[]>;
3205
3354
  /**
3206
- * 会话标签状态监听
3207
- */
3208
- private _conversationTagListener;
3209
- private _typingStatusListener;
3210
- private _pullFinishedLister;
3355
+ * 获取指定人员在黑名单中的状态
3356
+ */
3357
+ getBlacklistStatus(userId: string): IPromiseResult<string>;
3211
3358
  /**
3212
- * rtc 数据变更通知 pluginContext
3213
- */
3214
- private _rtcDataChange;
3359
+ * 向本地插入一条消息,不发送到服务器
3360
+ */
3361
+ insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
3215
3362
  /**
3216
- * 业务层事件监听器挂载点
3217
- */
3218
- private _watcher;
3363
+ * 删除本地消息
3364
+ */
3365
+ deleteMessages(timestamps: number[]): Promise<ErrorCode>;
3219
3366
  /**
3220
- * 添加事件监听
3221
- * @param options
3222
- */
3223
- assignWatcher(watcher: IWatcher): void;
3367
+ * 通过时间戳删除本地消息
3368
+ */
3369
+ deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
3224
3370
  /**
3225
- * 向内存中添加 typing 信息
3226
- * 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
3227
- */
3228
- private _addTypingInfo;
3229
- private _typingInternalTimer;
3230
- private _typingExpireTime;
3231
- private _typingChangedList;
3371
+ * 清空会话下历史消息
3372
+ */
3373
+ clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3232
3374
  /**
3233
- * 启动定时移除typing
3234
- */
3235
- private _startCheckTypingInfo;
3236
- getConnectedTime(): number;
3237
- getServerTime(): number;
3238
- getDeviceId(): string;
3239
- getCurrentUserId(): string;
3240
- getConnectionStatus(): ConnectionStatus;
3375
+ * 获取消息
3376
+ */
3377
+ getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
3241
3378
  /**
3242
- * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
3243
- * @param token
3244
- * @param refreshNavi 是否需要重新请求导航,当值为 `false` 时,优先使用有效缓存导航,若缓存失效则重新获取导航
3245
- */
3246
- connect(token: string, refreshNavi?: boolean): Promise<IConnectResult>;
3379
+ * 设置消息内容
3380
+ */
3381
+ setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
3247
3382
  /**
3248
- * 拉取实时配置 web 端需更新 voipCall 字段
3249
- */
3250
- private _pullUserSettings;
3251
- disconnect(): Promise<void>;
3252
- reconnect(): Promise<IConnectResult>;
3253
- private _getTokenWithoutNavi;
3383
+ * 设置消息搜索字段
3384
+ */
3385
+ setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
3254
3386
  /**
3255
- * 获取当前缓存的导航数据
3256
- */
3257
- getInfoFromCache(): INaviInfo | null;
3387
+ * 通过关键字搜索会话
3388
+ */
3389
+ searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3258
3390
  /**
3259
- * 消息注册
3260
- * @description 消息注册需在应用初始化完成前进行
3261
- * @param objectName 消息类型,如:RC:TxtMsg
3262
- * @param isPersited 是否存储
3263
- * @param isCounted 是否技术
3264
- * @param searchProps 搜索字段,只在搭配协议栈使用时有效
3265
- */
3266
- registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
3391
+ * 按内容搜索会话内的消息
3392
+ */
3393
+ searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
3394
+ messages: IReceivedMessage[];
3395
+ count: number;
3396
+ }>;
3267
3397
  /**
3268
- * 发送消息
3269
- * @param conversationType
3270
- * @param targetId
3271
- * @param objectName
3272
- * @param content
3273
- * @param options
3274
- */
3275
- sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): Promise<IAsyncRes<IReceivedMessage>>;
3398
+ * 获取会话下所有未读的 @ 消息
3399
+ */
3400
+ getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
3276
3401
  /**
3277
- * 发送扩展消息
3278
- * @param messageUId 消息 Id
3279
- * @param keys 需要删除的 key
3280
- * @param expansion 设置的扩展
3402
+ * 设置消息发送状态
3281
3403
  */
3282
- sendExpansionMessage(options: ISendExMsgOptions): Promise<IAsyncRes<ErrorCode>>;
3404
+ setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
3283
3405
  /**
3284
- * 发送群组消息已读回执
3285
- * 导航下发已读回执开关为 true 时调用
3286
- * @param targetId 群组会话id
3287
- * @param messageUIds 消息id
3288
- */
3289
- sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
3406
+ * 设置消息接收状态
3407
+ */
3408
+ setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
3290
3409
  /**
3291
- * 获取群组消息已读列表
3292
- * @param targetId
3293
- * @param messageUIds
3294
- */
3295
- getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
3410
+ * 删除时间戳前的未读数
3411
+ */
3412
+ clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
3296
3413
  /**
3297
- * 反初始化,清空所有监听及计时器
3298
- */
3299
- private _destroy;
3414
+ * 获取会话免打扰状态
3415
+ */
3416
+ getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
3300
3417
  /**
3301
- * @param conversationType
3302
- * @param targetId 会话 Id
3303
- * @param timestamp 拉取时间戳
3304
- * @param count 拉取条数
3305
- * @param order 1 正序拉取,0 为倒序拉取
3306
- * @param channelId
3307
- * @param objectName
3308
- */
3309
- getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp?: number, count?: number, order?: 0 | 1, channelId?: string, objectName?: string): Promise<IAsyncRes<{
3418
+ * 协议栈获取远端历史消息
3419
+ */
3420
+ getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
3310
3421
  list: IReceivedMessage[];
3311
3422
  hasMore: boolean;
3312
- }>>;
3313
- /**
3314
- * 获取会话列表
3315
- * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
3316
- */
3317
- getConversationList(count?: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
3318
- /**
3319
- * 获取单一会话数据
3320
- * @param conversationType
3321
- * @param targetId
3322
- * @param channelId
3323
- */
3324
- getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
3325
- /**
3326
- * 删除会话
3327
- */
3328
- removeConversation(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3329
- /**
3330
- * 清除会话消息未读数
3331
- */
3332
- clearUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3423
+ }>;
3424
+ joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
3425
+ quitRTCRoom(roomId: string): Promise<ErrorCode>;
3426
+ rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
3427
+ getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
3428
+ getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
3429
+ getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
3430
+ setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
3431
+ removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
3432
+ setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
3433
+ name: string;
3434
+ content: string;
3435
+ }): Promise<ErrorCode>;
3333
3436
  /**
3334
- * 获取指定会话消息未读数
3437
+ * 全量订阅资源修改
3438
+ * @param roomId 房间 Id
3439
+ * @param message 向前兼容的消息内容
3440
+ * @param valueInfo 全量资源数据
3441
+ * @param objectName 全量 URI 消息名
3335
3442
  */
3336
- getUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<number>>;
3443
+ setRTCTotalRes(roomId: string, message: {
3444
+ name: string;
3445
+ content: string;
3446
+ }, valueInfo: string, objectName: string, mcuValInfo: string): Promise<ErrorCode>;
3447
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
3448
+ removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
3449
+ name: string;
3450
+ content: string;
3451
+ }): Promise<ErrorCode>;
3452
+ setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
3453
+ getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
3454
+ getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
3455
+ setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
3456
+ getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
3457
+ }
3458
+
3459
+ interface IExpansionMsgContent {
3337
3460
  /**
3338
- * 获取所有会话未读数
3339
- * @param channelId 多组织 Id
3340
- * @param conversationTypes
3341
- * @param includeMuted 包含已设置免打扰的会话
3342
- */
3343
- getTotalUnreadCount(channelId: string, conversationTypes?: ConversationType[], includeMuted?: boolean): Promise<IAsyncRes<number>>;
3461
+ * 消息扩展的对象
3462
+ */
3463
+ put?: {
3464
+ [key: string]: string;
3465
+ };
3344
3466
  /**
3345
- * 获取第一个未读消息
3346
- */
3347
- getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<IReceivedMessage | null>>;
3348
- setConversationStatus(conversationType: ConversationType, targetId: string, isTop?: boolean, notificationStatus?: 1 | 2, channelId?: string): Promise<ErrorCode>;
3349
- saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
3350
- getConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<IAsyncRes<string>>;
3351
- clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
3352
- recallMessage(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
3467
+ * 删除的 keys
3468
+ */
3469
+ del?: string[];
3353
3470
  /**
3354
- * 删除远端消息
3355
- * @param conversationType
3356
- * @param targetId
3357
- * @param list
3358
- */
3359
- deleteRemoteMessage(conversationType: ConversationType, targetId: string, list: {
3360
- messageUId: string;
3361
- sentTime: number;
3362
- messageDirection: MessageDirection;
3363
- }[], channelId?: string): Promise<ErrorCode>;
3471
+ * messageUId
3472
+ */
3473
+ mid: string;
3364
3474
  /**
3365
- * 根据时间戳删除指定时间之前的
3366
- * @param conversationType
3367
- * @param targetId
3368
- * @param timestamp
3369
- */
3370
- deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
3475
+ * 是否删除所有, 有效值:0、1 . ( 后续如有需要, API Layer 层可使用)
3476
+ */
3477
+ removeAll?: number;
3478
+ }
3479
+
3480
+ /**
3481
+ * typing相关接口
3482
+ */
3483
+
3484
+ /**
3485
+ * typing信息
3486
+ */
3487
+ interface ITypingUser {
3488
+ userId: string;
3489
+ timestamp: number;
3490
+ messageType: string;
3491
+ }
3492
+ /**
3493
+ * 内存存储typing,key为conversationType_targetId
3494
+ */
3495
+ interface ITypingInfo {
3496
+ [key: string]: Array<ITypingUser>;
3497
+ }
3498
+ /**
3499
+ * typing通知消息接口
3500
+ */
3501
+ interface ITypingMessage {
3502
+ targetId: string;
3503
+ conversationType: ConversationType;
3504
+ channelId?: string;
3505
+ list: Array<ITypingUser>;
3506
+ }
3507
+
3508
+ interface IPluginGenerator<API, InitOption> {
3371
3509
  /**
3372
- * 加入聊天室,若聊天室不存在则创建聊天室
3373
- * @param roomId 聊天室房间 Id
3374
- * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
3510
+ * 只读插件标识
3375
3511
  */
3376
- joinChatroom(roomId: string, count?: number): Promise<ErrorCode>;
3512
+ readonly tag: string;
3377
3513
  /**
3378
- * 加入聊天室,若聊天室不存在则抛出异常
3379
- * @param roomId 聊天室房间 Id
3380
- * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
3514
+ * 版本号
3381
3515
  */
3382
- joinExistChatroom(roomId: string, count?: number): Promise<ErrorCode>;
3516
+ readonly version?: string;
3383
3517
  /**
3384
- * 退出聊天室
3385
- * @param roomId
3518
+ * 插件名称
3386
3519
  */
3387
- quitChatroom(roomId: string): Promise<ErrorCode>;
3520
+ readonly name?: string;
3388
3521
  /**
3389
- * 获取聊天室房间数据
3390
- * @description count 或 order 有一个为 0 时,只返回成员总数,不返回成员列表信息
3391
- * @param roomId 聊天室 Id
3392
- * @param count 获取房间人员列表数量,最大有效值 `20`,最小值未 `0`,默认为 0
3393
- * @param order 人员排序方式,`1` 为正序,`2` 为倒序,默认为 0
3522
+ * 插件安装前的环境检测,通过返回 boolean 值确认插件是否可运行
3394
3523
  */
3395
- getChatroomInfo(roomId: string, count?: number, order?: 0 | 1 | 2): Promise<IAsyncRes<IChatroomInfo>>;
3524
+ verify(runtime: IRuntime): boolean;
3396
3525
  /**
3397
- * 在指定聊天室中设置自定义属性
3398
- * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3399
- * @param roomId 聊天室房间 id
3400
- * @param entry 属性信息
3526
+ * 插件初始化
3527
+ * @param context 插件调用上下文,用于实现插件的消息注册、消息首发等
3528
+ * @param runtime 运行时实例,用于标识最终的运行时平台
3529
+ * @param options 初始化参数
3401
3530
  */
3402
- setChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3531
+ setup(context: PluginContext, runtime: IRuntime, options: InitOption): API;
3532
+ }
3533
+
3534
+ declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
3535
+ declare type IMessagesListnenr = (messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean) => void;
3536
+ declare type IConnectionStatusListener = (status: ConnectionStatus) => void;
3537
+ declare type IConversationStateListener = (conversation: IUpdatedConversation[]) => void;
3538
+ declare type IChatroomListener = (state: IChatroomListenerData) => void;
3539
+ declare type IRTCInnerListener = {
3540
+ message?: IMessageListnenr;
3541
+ status?: IConnectionStatusListener;
3542
+ };
3543
+ declare type IExpansionListener = (data: IExpansionListenerData) => void;
3544
+ declare type ITagListener = () => void;
3545
+ declare type IConversationTagListener = (conversationType: ConversationType, targetId: string, conversationTags: {
3546
+ tags: ILocalTagStatus;
3547
+ }) => void;
3548
+ declare type ItypingStateListener = (data: ITypingMessage[]) => void;
3549
+ interface IWatcher {
3550
+ message?: IMessageListnenr;
3551
+ batchMessage?: IMessagesListnenr;
3552
+ connectionState?: IConnectionStatusListener;
3553
+ conversationState?: IConversationStateListener;
3554
+ chatroomState?: IChatroomListener;
3555
+ expansion?: IExpansionListener;
3403
3556
  /**
3404
- * 在指定聊天室中强制增加 / 修改任意聊天室属性
3405
- * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3406
- * @param roomId 聊天室房间 id
3407
- * @param entry 属性信息
3557
+ * 为兼容老版本 RTCLib 与 CallLib 接收消息的方式,新版本消息走插件机制
3408
3558
  */
3409
- forceSetChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3559
+ rtcInnerWatcher?: IRTCInnerListener;
3410
3560
  /**
3411
- * 删除聊天室属性
3412
- * @description 该方法仅限于删除自己设置的聊天室属性
3413
- * @param roomId 聊天室房间 id
3414
- * @param entry 要移除的属性信息
3561
+ * 标签的增删改监听
3415
3562
  */
3416
- removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3563
+ tag?: ITagListener;
3417
3564
  /**
3418
- * 强制删除任意聊天室属性
3419
- * @description 该方法仅限于删除自己设置的聊天室属性
3420
- * @param roomId 聊天室房间 id
3421
- * @param entry 要移除的属性信息
3565
+ * 会话中标签状态变更监听
3422
3566
  */
3423
- forceRemoveChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3567
+ conversationTagChanged?: IConversationTagListener;
3424
3568
  /**
3425
- * 获取聊天室中的指定属性
3426
- * @param roomId 聊天室房间 id
3427
- * @param key 属性键名
3569
+ * 输入状态变更监听
3428
3570
  */
3429
- getChatroomEntry(roomId: string, key: string): Promise<IAsyncRes<string | null>>;
3571
+ typingState?: ItypingStateListener;
3572
+ pullFinished?: ITagListener;
3573
+ onConnecting?: () => void;
3574
+ onConnected?: () => void;
3575
+ onDisconnect?: () => void;
3576
+ onSuspend?: () => void;
3577
+ readReceiptReceived?: (conversation: IConversationOption, messageUId: string, sentTime: number) => void;
3578
+ messageReceiptRequest?: (conversation: IConversationOption, messageUId: string) => void;
3579
+ messageReceiptResponse?: (conversation: IConversationOption, messageUId: string, sender: {
3580
+ [responseUserIdList: string]: number;
3581
+ }) => void;
3582
+ }
3583
+ interface IAPIContextOption {
3430
3584
  /**
3431
- * 获取聊天室内的所有属性
3432
- * @param roomId 聊天室房间 id
3585
+ * 应用 appkey
3433
3586
  */
3434
- getAllChatroomEntries(roomId: string): Promise<IAsyncRes<{
3435
- [key: string]: string;
3436
- }>>;
3587
+ appkey: string;
3437
3588
  /**
3438
- * 拉取聊天室内的历史消息
3439
- * @param roomId
3440
- * @param count 拉取消息条数, 有效值范围 `1 - 20`
3441
- * @param order 获取顺序,默认值为 0。
3442
- * * 0:降序,用于获取早于指定时间戳发送的消息
3443
- * * 1:升序,用于获取晚于指定时间戳发送的消息
3444
- * @param timestamp 指定拉取消息用到的时间戳。默认值为 `0`,表示按当前时间拉取
3589
+ * IMLib 版本号
3445
3590
  */
3446
- getChatRoomHistoryMessages(roomId: string, count?: number, order?: 0 | 1, timestamp?: number): Promise<IAsyncRes<{
3447
- list: IReceivedMessage[];
3448
- hasMore: boolean;
3449
- }>>;
3591
+ apiVersion: string;
3450
3592
  /**
3451
- * 获取存储服务鉴权信息
3452
- * @param fileType 文件类型
3453
- * @param fileName 文件名称
3454
- * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
3455
- * @param queryString STC 分段上传时的查询字符串
3456
- * @description
3457
- * `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
3458
- * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`
3459
- * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`
3460
- * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`
3461
- * @returns
3593
+ * 自定义导航地址:
3594
+ * 1. 私有云环境下该值为必填项
3595
+ * 2. 当存在自定义导航地址时,SDK 内部默认地址将无效
3596
+ * 3. 当存在自定义导航地址时,地址 url 中需包含 http/https 协议头,否则视为无效值
3597
+ * 4. 建立 ws/wss 连接前的 ping 接口使用的协议与导航 url 中的协议相同
3598
+ * 5. 建立 websocket 建立连接时将根据 ping 接口使用的 http/https 协议来确定使用 ws/wss 协议
3599
+ * 6. 动态导航使用的协议头将与自定义导航地址相同
3600
+ * 7. 公有云默认使用 https 协议
3462
3601
  */
3463
- getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<IUploadAuth & {
3464
- bos: string;
3465
- qiniu: string;
3466
- }>;
3602
+ navigators: string[];
3467
3603
  /**
3468
- * 获取 七牛、百度、阿里云 上传成功可下载的 URL
3469
- * @param fileType 文件类型
3470
- * @param fileName 文件名
3471
- * @param saveName 下载后的存储文件名
3472
- * @param uploadRes 插件上传返回的结果。降级百度上传后,用户传入返回结果,再把结果里的下载地址返回给用户,保证兼容之前结果获取
3473
- * @param serverType 使用的存储服务标识
3604
+ * (参数已废弃)~~c++ 协议栈数据库地址~~
3605
+ * @deprecated
3474
3606
  */
3475
- getFileUrl(fileType: FileType, fileName?: string, saveName?: string, uploadRes?: {
3476
- isBosRes: boolean;
3477
- downloadUrl: string;
3478
- }, serverType?: UploadMethod): Promise<{
3479
- downloadUrl: string;
3480
- }>;
3607
+ dbPath?: string;
3481
3608
  /**
3482
- * 创建标签
3483
- * @param tag 标签
3609
+ * 小程序的 CMP 代理地址
3484
3610
  */
3485
- createTag(tag: ITagParam): Promise<IAsyncRes>;
3611
+ miniCMPProxy: string[];
3486
3612
  /**
3487
- * 删除标签
3488
- * @param tagId 标签id
3613
+ * 指定默认使用的连接类型
3489
3614
  */
3490
- removeTag(tagId: string): Promise<IAsyncRes>;
3615
+ connectionType: 'websocket' | 'comet';
3491
3616
  /**
3492
- * 更新标签
3493
- * @param tag 标签
3617
+ * 修改 engine log 打印等级
3494
3618
  */
3495
- updateTag(tag: ITagParam): Promise<IAsyncRes>;
3619
+ logLevel?: LogLevel;
3496
3620
  /**
3497
- * 获取标签列表
3621
+ * 修改默认的 log 输出函数
3498
3622
  */
3499
- getTagList(): Promise<IAsyncRes<Array<ITagInfo>>>;
3623
+ logStdout?: (logLevel: LogLevel, content: string) => void;
3500
3624
  /**
3501
- * 添加会话到标签(给多个会话增加标签)
3502
- * @param tagId 标签id
3503
- * @param conversations 要添加的会话列表
3625
+ * (已废弃)私有云标识
3626
+ * @deprecated
3504
3627
  */
3505
- addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
3628
+ isEnterPrise?: boolean;
3506
3629
  /**
3507
- * 删除标签中的会话(从多个会话中批量删除指定标签)
3508
- * @param tagId 标签id
3509
- * @param conversations 要删除的会话列表
3630
+ * typing状态过期时间
3510
3631
  */
3511
- removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
3632
+ typingExpireTime?: number;
3512
3633
  /**
3513
- * 删除会话中的标签(从单一会话中批量删除标签)
3514
- * @param conversationType 会话类型
3515
- * @param targetId 会话id
3516
- * @param tagIds 要删除的标签列表
3634
+ * 是否打开 IndexDB 存储,默认为 true
3517
3635
  */
3518
- removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<IAsyncRes>>;
3636
+ indexDBSwitch?: boolean;
3519
3637
  /**
3520
- * 获取标签下的会话列表
3521
- * @param tagId 标签id
3638
+ * 是否校验证书,默认为 true
3522
3639
  */
3523
- getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): Promise<IAsyncRes<IReceivedConversationByTag[]>>;
3640
+ checkCA?: boolean;
3641
+ }
3642
+
3643
+ interface IRemoveChatRoomEntriesOption {
3524
3644
  /**
3525
- * 获取标签下的未读消息数
3526
- * @param tagId 标签id
3527
- * @param containMuted 是否包含免打扰会话
3645
+ * key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
3528
3646
  */
3529
- getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number>>;
3647
+ entries: {
3648
+ key: string;
3649
+ }[];
3530
3650
  /**
3531
- * 设置标签中会话置顶
3532
- * @param conversation 会话
3651
+ * 删除成功后是否发送通知消息
3533
3652
  */
3534
- setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
3535
- isTop: boolean;
3536
- }): Promise<IAsyncRes<IAsyncRes>>;
3653
+ isSendNotification?: boolean;
3537
3654
  /**
3538
- * 获取会话里的标签
3539
- * @param conversation
3655
+ * RC:chrmKVNotiMsg 消息中携带的附加信息
3540
3656
  */
3541
- getTagsForConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[]>>;
3657
+ notificationExtra?: string;
3658
+ }
3659
+
3660
+ declare class APIContext {
3661
+ private _runtime;
3662
+ private static _context?;
3663
+ static init(runtime: IRuntime, options: IAPIContextOption): APIContext;
3664
+ static destroy(): void;
3665
+ private _token;
3542
3666
  /**
3543
- * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
3544
- * 对于未实现的方法,接口响应 Unsupport 错误码
3545
- * @param method 方法名
3546
- * @param args
3667
+ * 插件队列,用于逐一派发消息与信令
3547
3668
  */
3548
- callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
3549
- /**
3550
- * 删除所有会话
3551
- */
3552
- clearConversations(conversationTypes?: ConversationType[], tag?: string): Promise<ErrorCode>;
3553
- /**
3554
- * 设置用户连接状态监听器
3555
- */
3556
- setUserStatusListener(config: {
3557
- userIds: string[];
3558
- }, listener: Function): void;
3559
- /**
3560
- * 添加用户黑名单
3561
- */
3562
- addToBlacklist(userId: string): Promise<ErrorCode>;
3563
- /**
3564
- * 将指定用户移除黑名单
3565
- */
3566
- removeFromBlacklist(userId: string): Promise<ErrorCode>;
3567
- /**
3568
- * 获取黑名单列表
3569
- */
3570
- getBlacklist(): Promise<IAsyncRes<string[]>>;
3571
- /**
3572
- * 获取指定人员在黑名单中的状态
3573
- */
3574
- getBlacklistStatus(userId: string): Promise<IAsyncRes<string>>;
3575
- /**
3576
- * 向本地插入一条消息,不发送到服务器
3577
- */
3578
- insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
3669
+ private _pluginContextQueue;
3579
3670
  /**
3580
- * 删除本地消息
3581
- */
3582
- deleteMessages(timestamp: number[]): Promise<ErrorCode>;
3671
+ * 插件实例Map,用于重复初始化时返回实例
3672
+ */
3673
+ private _pluginInstanseMap;
3674
+ private readonly _engine;
3583
3675
  /**
3584
- * 从本地消息数据库中删除某一会话指定时间之前的消息数据
3585
- */
3586
- deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId?: string): Promise<ErrorCode>;
3676
+ * 核心库版本号,后期与 4.0 IM SDK 版本号保持一致
3677
+ */
3678
+ readonly coreVersion: string;
3679
+ readonly appkey: string;
3680
+ readonly apiVersion: string;
3681
+ private readonly _options;
3682
+ private _versionInfo;
3683
+ private _typingInfo;
3587
3684
  /**
3588
- * 清空会话下历史消息
3589
- */
3590
- clearMessages(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3685
+ * 内部连接状态标识,为 ture 时不允许调用 reconnect 方法
3686
+ */
3687
+ private _isInternalConnected;
3688
+ constructor(_runtime: IRuntime, options: IAPIContextOption);
3591
3689
  /**
3592
- * 获取本地消息
3593
- */
3594
- getMessage(messageId: number): Promise<IAsyncRes<IReceivedMessage>>;
3690
+ * 安装使用插件,并初始化插件实例
3691
+ * @param plugin
3692
+ * @param options
3693
+ */
3694
+ install<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
3695
+ private _connectionStatus;
3696
+ private _canRedirectConnect;
3595
3697
  /**
3596
- * 设置消息内容
3597
- */
3598
- setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
3698
+ * 重定向后,递归调用 connect
3699
+ */
3700
+ private _handleRedirect;
3599
3701
  /**
3600
- * 设置消息搜索字段
3601
- */
3602
- setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
3702
+ * 连接状态变更回调
3703
+ * @param message
3704
+ */
3705
+ private _connectionStatusListener;
3706
+ _handleConnecting(): void;
3707
+ _handleConnected(): void;
3708
+ _handleDisconnect(): void;
3709
+ _handleSuspend(): void;
3710
+ private _messageReceiver;
3711
+ _batchMessageReceiver(messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean): void;
3603
3712
  /**
3604
- * 设置消息发送状态
3713
+ * 聊天室相关信息监听
3605
3714
  */
3606
- setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
3715
+ private _chatroomInfoListener;
3607
3716
  /**
3608
- * 设置消息接收状态
3717
+ * 会话监听相关
3609
3718
  */
3610
- setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
3719
+ private _conversationInfoListener;
3611
3720
  /**
3612
- * 设置当前用户在线状态
3721
+ * 消息扩展监听相关
3613
3722
  */
3614
- setUserStatus(status: number): Promise<ErrorCode>;
3723
+ private _expansionInfoListener;
3615
3724
  /**
3616
- * 订阅用户在线状态
3617
- */
3618
- subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
3725
+ * 标签增删改监听
3726
+ */
3727
+ private _tagListener;
3619
3728
  /**
3620
- * 获取用户在线状态
3621
- */
3622
- getUserStatus(userId: string): Promise<IAsyncRes<{
3623
- status: string;
3624
- }>>;
3625
- searchConversationByContent(keyword: string, customMessageTypes?: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
3626
- searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId?: string): Promise<IAsyncRes<{
3627
- messages: IReceivedMessage[];
3628
- count: number;
3629
- }>>;
3630
- getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId?: string): IReceivedMessage[];
3631
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
3729
+ * 会话标签状态监听
3730
+ */
3731
+ private _conversationTagListener;
3732
+ private _typingStatusListener;
3733
+ private _pullFinishedLister;
3632
3734
  /**
3633
- * 获取会话免打扰状态
3634
- */
3635
- getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<NotificationStatus>>;
3636
- getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): Promise<IAsyncRes<{
3637
- list: IReceivedMessage[];
3638
- hasMore: boolean;
3639
- }>>;
3735
+ * rtc 数据变更通知 pluginContext
3736
+ */
3737
+ private _rtcDataChange;
3640
3738
  /**
3641
- * 加入房间
3642
- * @param roomId
3643
- * @param mode 房间模式:直播 or 会议
3644
- * @param mediaType 直播房间模式下的媒体资源类型
3739
+ * 业务层事件监听器挂载点
3645
3740
  */
3646
- joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
3647
- quitRTCRoom(roomId: string): Promise<ErrorCode>;
3648
- rtcPing(roomId: string, mode: number, mediaType?: number): Promise<ErrorCode>;
3649
- getRTCRoomInfo(roomId: string): Promise<IAsyncRes<IRTCRoomInfo>>;
3650
- getRTCUserInfoList(roomId: string): Promise<IAsyncRes<IRTCUsers>>;
3651
- getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
3652
- setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
3653
- removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
3654
- setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
3655
- name: string;
3656
- content: string;
3657
- }): Promise<ErrorCode>;
3658
- setRTCTotalRes(roomId: string, message: {
3659
- name: string;
3660
- content: string;
3661
- }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
3662
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
3663
- getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): Promise<IAsyncRes<KVString>>;
3664
- removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
3665
- name: string;
3666
- content: string;
3667
- }): Promise<ErrorCode>;
3668
- setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
3669
- getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
3670
- getRTCToken(roomId: string, mode: number, broadcastType?: number): Promise<IAsyncRes<IRtcTokenData>>;
3671
- setRTCState(roomId: string, report: string): Promise<ErrorCode>;
3672
- getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
3741
+ private _watcher;
3673
3742
  /**
3674
- * 直播观众加房间
3743
+ * 添加事件监听
3744
+ * @param options
3675
3745
  */
3676
- joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
3677
- token: string;
3678
- kvEntries: IServerRTCRoomEntry[];
3679
- }>>;
3746
+ assignWatcher(watcher: IWatcher): void;
3747
+ resetWatcher(): void;
3680
3748
  /**
3681
- * 直播观众退出房间
3749
+ * 向内存中添加 typing 信息
3750
+ * 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
3682
3751
  */
3683
- quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
3752
+ private _addTypingInfo;
3753
+ private _typingInternalTimer;
3754
+ private _typingExpireTime;
3755
+ private _typingChangedList;
3684
3756
  /**
3685
- * 直播身份切换
3757
+ * 启动定时移除typing
3686
3758
  */
3687
- rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
3688
- }
3689
-
3690
- /**
3691
- * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
3692
- */
3693
- interface IEngine {
3759
+ private _startCheckTypingInfo;
3760
+ getConnectedTime(): number;
3761
+ getServerTime(): number;
3762
+ getDeviceId(): string;
3763
+ getCurrentUserId(): string;
3764
+ getConnectionStatus(): ConnectionStatus;
3765
+ get token(): string;
3694
3766
  /**
3695
- * 建立连接
3767
+ * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
3696
3768
  * @param token
3697
- * @param naviInfo
3769
+ * @param refreshNavi 是否需要重新请求导航,当值为 `false` 时,优先使用有效缓存导航,若缓存失效则重新获取导航
3698
3770
  */
3699
- connect(token: string, naviInfo: INaviInfo, versionInfo: string): Promise<ErrorCode>;
3771
+ connect(token: string, refreshNavi?: boolean): Promise<IConnectResult>;
3700
3772
  /**
3701
- * 上报版本信息
3702
- * @param version
3773
+ * 拉取实时配置 web 端需更新 voipCall 字段
3703
3774
  */
3704
- reportSDKInfo(version: {
3705
- [name: string]: string;
3706
- }): void;
3775
+ private _pullUserSettings;
3776
+ disconnect(): Promise<void>;
3777
+ reconnect(): Promise<IConnectResult>;
3778
+ private _getTokenWithoutNavi;
3707
3779
  /**
3708
- * 连接时间
3780
+ * 获取当前缓存的导航数据
3709
3781
  */
3710
- getConnectedTime(): number;
3782
+ getInfoFromCache(): INaviInfo | null;
3711
3783
  /**
3712
- * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
3713
- * 对于未实现的方法,接口响应 Unsupport 错误码
3714
- * @param method
3715
- * @param args
3784
+ * 消息注册
3785
+ * @description 消息注册需在应用初始化完成前进行
3786
+ * @param objectName 消息类型,如:RC:TxtMsg
3787
+ * @param isPersited 是否存储
3788
+ * @param isCounted 是否技术
3789
+ * @param searchProps 搜索字段,只在搭配协议栈使用时有效
3716
3790
  */
3717
- callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
3791
+ registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
3718
3792
  /**
3719
- * 获取历史消息
3793
+ * 发送消息
3720
3794
  * @param conversationType
3721
3795
  * @param targetId
3722
- * @param timestamp
3723
- * @param count
3724
- * @param order
3796
+ * @param objectName
3797
+ * @param content
3798
+ * @param options
3725
3799
  */
3726
- getHistoryMessage(conversationType: ConversationType, targetId: string,
3800
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): Promise<IAsyncRes<IReceivedMessage>>;
3727
3801
  /**
3728
- * 拉取时间戳,值为 `0` 表示从当前时间拉取
3729
- */
3730
- timestamp: number,
3802
+ * 发送扩展消息
3803
+ * @param messageUId 消息 Id
3804
+ * @param keys 需要删除的 key
3805
+ * @param expansion 设置的扩展
3806
+ */
3807
+ sendExpansionMessage(options: ISendExMsgOptions): Promise<IAsyncRes<ErrorCode>>;
3731
3808
  /**
3732
- * 获取条数, 有效值 `1` - `20`
3809
+ * 发送群组消息已读回执
3810
+ * 导航下发已读回执开关为 true 时调用
3811
+ * @param targetId 群组会话id
3812
+ * @param messageUIds 消息id
3733
3813
  */
3734
- count: number,
3814
+ sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
3735
3815
  /**
3736
- * @description
3737
- * 1. `0` 表示升序,获取消息发送时间比传入 `sentTime` 小 的消息
3738
- * 2. `1` 表示降序,获取消息发送时间比传入 `sentTime` 大 的消息
3816
+ * 获取群组消息已读列表
3817
+ * @param targetId
3818
+ * @param messageUIds
3739
3819
  */
3740
- order: 0 | 1,
3820
+ getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
3741
3821
  /**
3742
- * 会话的业务标识
3743
- */
3744
- channelId: string,
3822
+ * 反初始化,清空所有监听及计时器
3823
+ */
3824
+ private _destroy;
3745
3825
  /**
3746
- * 消息类型
3826
+ * @param conversationType
3827
+ * @param targetId 会话 Id
3828
+ * @param timestamp 拉取时间戳
3829
+ * @param count 拉取条数
3830
+ * @param order 1 正序拉取,0 为倒序拉取
3831
+ * @param channelId
3832
+ * @param objectName
3747
3833
  */
3748
- objectName: string): IPromiseResult<{
3834
+ getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp?: number, count?: number, order?: 0 | 1, channelId?: string, objectName?: string): Promise<IAsyncRes<{
3749
3835
  list: IReceivedMessage[];
3750
3836
  hasMore: boolean;
3751
- }>;
3752
- /**
3753
- * 删除历史消息 通过 messageUId
3754
- */
3755
- deleteRemoteMessage(conversationType: ConversationType, targetId: string,
3756
- /**
3757
- * @description
3758
- * message 中 messageUId、setTime、messageDirection 为必须参数
3759
- */
3760
- messages: {
3761
- messageUId: string;
3762
- sentTime: number;
3763
- messageDirection: MessageDirection;
3764
- }[],
3765
- /**
3766
- * 会话的业务标识
3767
- */
3768
- channelId: string): Promise<ErrorCode>;
3769
- recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
3770
- /**
3771
- * 删除历史消息 通过 时间戳
3772
- * @param timestamp 小于等于传入时间戳的消息均删除
3773
- */
3774
- deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number,
3775
- /**
3776
- * 会话的业务标识
3777
- */
3778
- channelId: string): Promise<ErrorCode>;
3837
+ }>>;
3779
3838
  /**
3780
3839
  * 获取会话列表
3781
3840
  * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
3782
3841
  */
3783
- getConversationList(
3842
+ getConversationList(count?: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
3784
3843
  /**
3785
- * 拉取数量, 有效值 0 - 1000, 默认 300
3844
+ * 获取单一会话数据
3845
+ * @param conversationType
3846
+ * @param targetId
3847
+ * @param channelId
3786
3848
  */
3787
- count: number,
3849
+ getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
3788
3850
  /**
3789
- * 会话类型
3790
- * @todo 待确认是否生效
3851
+ * 删除会话
3791
3852
  */
3792
- conversationType?: ConversationType,
3793
- /**
3794
- * 起始时间
3795
- */
3796
- startTime?: number,
3797
- /**
3798
- * 获取顺序
3799
- */
3800
- order?: 0 | 1,
3801
- /**
3802
- * 会话的业务标识
3803
- */
3804
- channelId?: string): IPromiseResult<IReceivedConversation[]>;
3853
+ removeConversation(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3805
3854
  /**
3806
- * 获取指定会话
3807
- */
3808
- getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
3855
+ * 清除会话消息未读数
3856
+ */
3857
+ clearUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3809
3858
  /**
3810
- * 删除会话
3811
- * @description 该删除操作会删除服务器端存储的会话数据
3812
- * @param conversationType
3813
- * @param targetId
3859
+ * 获取指定会话消息未读数
3814
3860
  */
3815
- removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3861
+ getUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<number>>;
3816
3862
  /**
3817
3863
  * 获取所有会话未读数
3818
3864
  * @param channelId 多组织 Id
3819
3865
  * @param conversationTypes
3820
3866
  * @param includeMuted 包含已设置免打扰的会话
3821
3867
  */
3822
- getAllConversationUnreadCount(channelId: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
3868
+ getTotalUnreadCount(channelId: string, conversationTypes?: ConversationType[], includeMuted?: boolean): Promise<IAsyncRes<number>>;
3823
3869
  /**
3824
- * 获取指定会话未读数
3870
+ * 获取第一个未读消息
3825
3871
  */
3826
- getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
3872
+ getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<IReceivedMessage | null>>;
3873
+ setConversationStatus(conversationType: ConversationType, targetId: string, isTop?: boolean, notificationStatus?: 1 | 2, channelId?: string): Promise<ErrorCode>;
3874
+ saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
3875
+ getConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<IAsyncRes<string>>;
3876
+ clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
3877
+ recallMessage(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
3827
3878
  /**
3828
- * 清除指定会话未读数
3879
+ * 删除远端消息
3880
+ * @param conversationType
3881
+ * @param targetId
3882
+ * @param list
3829
3883
  */
3830
- clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3884
+ deleteRemoteMessage(conversationType: ConversationType, targetId: string, list: {
3885
+ messageUId: string;
3886
+ sentTime: number;
3887
+ messageDirection: MessageDirection;
3888
+ }[], channelId?: string): Promise<ErrorCode>;
3831
3889
  /**
3832
- * 获取第一个未读消息
3890
+ * 根据时间戳删除指定时间之前的
3891
+ * @param conversationType
3892
+ * @param targetId
3893
+ * @param timestamp
3833
3894
  */
3834
- getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
3895
+ deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
3835
3896
  /**
3836
- * 设置/保存指定会话消息草稿
3837
- * @draft 草稿内容
3897
+ * 加入聊天室,若聊天室不存在则创建聊天室
3898
+ * @param roomId 聊天室房间 Id
3899
+ * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
3838
3900
  */
3839
- saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
3901
+ joinChatroom(roomId: string, count?: number): Promise<ErrorCode>;
3840
3902
  /**
3841
- * 获取指定会话消息草稿
3903
+ * 加入聊天室,若聊天室不存在则抛出异常
3904
+ * @param roomId 聊天室房间 Id
3905
+ * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
3842
3906
  */
3843
- getConversationMessageDraft(conversationType: ConversationType, targetId: string): IPromiseResult<string>;
3907
+ joinExistChatroom(roomId: string, count?: number): Promise<ErrorCode>;
3844
3908
  /**
3845
- * 清除指定会话消息草稿
3909
+ * 退出聊天室
3910
+ * @param roomId
3846
3911
  */
3847
- clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
3912
+ quitChatroom(roomId: string): Promise<ErrorCode>;
3848
3913
  /**
3849
- * 从服务端拉取会话状态
3914
+ * 获取聊天室房间数据
3915
+ * @description count 或 order 有一个为 0 时,只返回成员总数,不返回成员列表信息
3916
+ * @param roomId 聊天室 Id
3917
+ * @param count 获取房间人员列表数量,最大有效值 `20`,最小值未 `0`,默认为 0
3918
+ * @param order 人员排序方式,`1` 为正序,`2` 为倒序,默认为 0
3850
3919
  */
3851
- pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
3920
+ getChatroomInfo(roomId: string, count?: number, order?: 0 | 1 | 2): Promise<IAsyncRes<IChatroomInfo>>;
3852
3921
  /**
3853
- * 批量设置会话 置顶、免打扰
3922
+ * 在指定聊天室中设置自定义属性
3923
+ * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3924
+ * @param roomId 聊天室房间 id
3925
+ * @param entry 属性信息
3854
3926
  */
3855
- batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
3856
- sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): IPromiseResult<IReceivedMessage>;
3927
+ setChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3928
+ setChatroomEntries(roomId: string, entryOptions: IChatroomEntries): Promise<ErrorCode>;
3857
3929
  /**
3858
- * 断开连接
3930
+ * 在指定聊天室中强制增加 / 修改任意聊天室属性
3931
+ * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3932
+ * @param roomId 聊天室房间 id
3933
+ * @param entry 属性信息
3859
3934
  */
3860
- disconnect(): void;
3935
+ forceSetChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3861
3936
  /**
3862
- * 拉取用户级配置数据
3937
+ * 删除聊天室属性
3938
+ * @description 该方法仅限于删除自己设置的聊天室属性
3939
+ * @param roomId 聊天室房间 id
3940
+ * @param entry 要移除的属性信息
3863
3941
  */
3864
- pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
3942
+ removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3865
3943
  /**
3866
- * 消息注册
3867
- * @description
3868
- * 消息注册需在应用初始化完成前进行,否则在搭配 C++ 协议栈使用时,
3869
- * 本端发出的消息将不默认作为未知消息处理,不存储、不计数
3870
- * @param objectName 消息类型,如:RC:TxtMsg
3871
- * @param isPersited 是否存储
3872
- * @param isCounted 是否技术
3873
- * @param searchProps 搜索字段,只在搭配协议栈使用时有效
3944
+ * 批量删除聊天室属性
3945
+ * @description 该方法仅限于删除自己设置的聊天室属性
3946
+ * @param roomId 聊天室房间 id
3947
+ * @param entry 要移除的属性信息
3874
3948
  */
3875
- registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
3876
- /**
3877
- * 加入聊天室
3878
- * @param count 拉取消息数量
3879
- */
3880
- joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
3949
+ removeChatroomEntries(roomId: string, entryOptions: IRemoveChatRoomEntriesOption): Promise<ErrorCode>;
3881
3950
  /**
3882
- * 加入已存在的聊天室
3883
- * @param count 拉取消息数量
3884
- */
3885
- joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
3951
+ * 强制删除任意聊天室属性
3952
+ * @description 该方法仅限于删除自己设置的聊天室属性
3953
+ * @param roomId 聊天室房间 id
3954
+ * @param entry 要移除的属性信息
3955
+ */
3956
+ forceRemoveChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3886
3957
  /**
3887
- * 退出聊天室
3888
- */
3889
- quitChatroom(chatroomId: string): Promise<ErrorCode>;
3958
+ * 获取聊天室中的指定属性
3959
+ * @param roomId 聊天室房间 id
3960
+ * @param key 属性键名
3961
+ */
3962
+ getChatroomEntry(roomId: string, key: string): Promise<IAsyncRes<string | null>>;
3890
3963
  /**
3891
- * 获取聊天室信息
3892
- * @param count 获取人数, 范围 0 - 20
3893
- * @param order 排序方式, 1 正序, 2 倒序
3894
- */
3895
- getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
3964
+ * 获取聊天室内的所有属性
3965
+ * @param roomId 聊天室房间 id
3966
+ */
3967
+ getAllChatroomEntries(roomId: string): Promise<IAsyncRes<{
3968
+ [key: string]: string;
3969
+ }>>;
3896
3970
  /**
3897
- * 获取聊天室历史消息
3898
- */
3899
- getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
3971
+ * 拉取聊天室内的历史消息
3972
+ * @param roomId
3973
+ * @param count 拉取消息条数, 有效值范围 `1 - 20`
3974
+ * @param order 获取顺序,默认值为 0。
3975
+ * * 0:降序,用于获取早于指定时间戳发送的消息
3976
+ * * 1:升序,用于获取晚于指定时间戳发送的消息
3977
+ * @param timestamp 指定拉取消息用到的时间戳。默认值为 `0`,表示按当前时间拉取
3978
+ */
3979
+ getChatRoomHistoryMessages(roomId: string, count?: number, order?: 0 | 1, timestamp?: number): Promise<IAsyncRes<{
3900
3980
  list: IReceivedMessage[];
3901
3981
  hasMore: boolean;
3902
- }>;
3903
- /**
3904
- * 设置聊天室属性
3905
- */
3906
- setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3907
- /**
3908
- * 强制设置聊天室属性
3909
- */
3910
- forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3911
- /**
3912
- * 删除聊天室属性
3913
- */
3914
- removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3915
- /**
3916
- * 强制删除聊天室属性
3917
- */
3918
- forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3919
- /**
3920
- * 获取聊天室 key 对应 value
3921
- */
3922
- getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
3923
- /**
3924
- * 获取聊天室所有 key value
3925
- */
3926
- getAllChatroomEntry(chatroomId: string): IPromiseResult<{
3927
- [key: string]: string;
3928
- }>;
3982
+ }>>;
3929
3983
  /**
3930
- * 获取上传认证信息
3984
+ * 获取存储服务鉴权信息
3985
+ * @param fileType 文件类型
3986
+ * @param fileName 文件名称
3987
+ * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
3988
+ * @param queryString STC 分段上传时的查询字符串
3931
3989
  * @description
3932
- * 若不传 fileName 百度上传认证字段(bosToken、bosDate、path)均返回 null
3933
- */
3934
- getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
3990
+ * `httpMethod` `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
3991
+ * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`
3992
+ * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`
3993
+ * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`
3994
+ * @returns
3995
+ */
3996
+ getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<IUploadAuth & {
3997
+ bos: string;
3998
+ qiniu: string;
3999
+ }>;
3935
4000
  /**
3936
- * 获取文件上传后下载地址
4001
+ * 获取 七牛、百度、阿里云 上传成功可下载的 URL
4002
+ * @param fileType 文件类型
4003
+ * @param fileName 文件名
4004
+ * @param saveName 下载后的存储文件名
4005
+ * @param uploadRes 插件上传返回的结果。降级百度上传后,用户传入返回结果,再把结果里的下载地址返回给用户,保证兼容之前结果获取
4006
+ * @param serverType 使用的存储服务标识
3937
4007
  */
3938
- getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName?: string, originName?: string): IPromiseResult<{
4008
+ getFileUrl(fileType: FileType, fileName?: string, saveName?: string, uploadRes?: {
4009
+ isBosRes: boolean;
4010
+ downloadUrl: string;
4011
+ }, serverType?: UploadMethod): Promise<{
3939
4012
  downloadUrl: string;
3940
4013
  }>;
3941
4014
  /**
3942
4015
  * 创建标签
3943
4016
  * @param tag 标签
3944
- */
3945
- createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
4017
+ */
4018
+ createTag(tag: ITagParam): Promise<IAsyncRes>;
3946
4019
  /**
3947
4020
  * 删除标签
3948
4021
  * @param tagId 标签id
3949
- */
3950
- removeTag(tagId: string): IPromiseResult<IAsyncRes>;
4022
+ */
4023
+ removeTag(tagId: string): Promise<IAsyncRes>;
3951
4024
  /**
3952
- * 编辑标签
4025
+ * 更新标签
3953
4026
  * @param tag 标签
3954
- */
3955
- updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
4027
+ */
4028
+ updateTag(tag: ITagParam): Promise<IAsyncRes>;
3956
4029
  /**
3957
4030
  * 获取标签列表
3958
4031
  */
3959
- getTagList(): IPromiseResult<Array<ITagInfo>>;
4032
+ getTagList(): Promise<IAsyncRes<Array<ITagInfo>>>;
3960
4033
  /**
3961
4034
  * 添加会话到标签(给多个会话增加标签)
3962
4035
  * @param tagId 标签id
3963
4036
  * @param conversations 要添加的会话列表
3964
4037
  */
3965
- addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
4038
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
3966
4039
  /**
3967
4040
  * 删除标签中的会话(从多个会话中批量删除指定标签)
3968
4041
  * @param tagId 标签id
3969
4042
  * @param conversations 要删除的会话列表
3970
4043
  */
3971
- removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
4044
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
3972
4045
  /**
3973
4046
  * 删除会话中的标签(从单一会话中批量删除标签)
3974
4047
  * @param conversationType 会话类型
3975
4048
  * @param targetId 会话id
3976
4049
  * @param tagIds 要删除的标签列表
3977
4050
  */
3978
- removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
4051
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<IAsyncRes>>;
3979
4052
  /**
3980
4053
  * 获取标签下的会话列表
3981
4054
  * @param tagId 标签id
3982
4055
  */
3983
- getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): IPromiseResult<IReceivedConversationByTag[]>;
4056
+ getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): Promise<IAsyncRes<IReceivedConversationByTag[]>>;
3984
4057
  /**
3985
4058
  * 获取标签下的未读消息数
3986
4059
  * @param tagId 标签id
3987
4060
  * @param containMuted 是否包含免打扰会话
3988
4061
  */
3989
- getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
4062
+ getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number>>;
3990
4063
  /**
3991
4064
  * 设置标签中会话置顶
3992
4065
  * @param conversation 会话
3993
4066
  */
3994
- setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
4067
+ setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
4068
+ isTop: boolean;
4069
+ }): Promise<IAsyncRes<IAsyncRes>>;
3995
4070
  /**
3996
4071
  * 获取会话里的标签
3997
- * @param config
3998
- */
3999
- getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
4000
- /**
4001
- * 发送群组消息已读回执
4002
- * 导航下发已读回执开关为 true 时调用
4003
- */
4004
- sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
4005
- /**
4006
- * 获取群组消息已读列表
4007
- */
4008
- getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
4009
- /**
4010
- * 获取服务器时间
4072
+ * @param conversation
4011
4073
  */
4012
- getServerTime(): number;
4074
+ getTagsForConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[]>>;
4013
4075
  /**
4014
- * 获取设备ID
4076
+ * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
4077
+ * 对于未实现的方法,接口响应 Unsupport 错误码
4078
+ * @param method 方法名
4079
+ * @param args
4015
4080
  */
4016
- getDeviceId(): string;
4081
+ callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
4017
4082
  /**
4018
- * 获取当前 userId
4019
- */
4020
- getCurrentUserId(): string;
4083
+ * 删除所有会话
4084
+ */
4085
+ clearConversations(conversationTypes?: ConversationType[], tag?: string): Promise<ErrorCode>;
4021
4086
  /**
4022
- * 设置用户在线状态监听器
4087
+ * 设置用户连接状态监听器
4023
4088
  */
4024
4089
  setUserStatusListener(config: {
4025
4090
  userIds: string[];
4026
4091
  }, listener: Function): void;
4027
4092
  /**
4028
- * 设置当前用户在线状态
4029
- */
4030
- setUserStatus(status: number): Promise<ErrorCode>;
4031
- /**
4032
- * 订阅用户在线状态
4033
- */
4034
- subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
4035
- /**
4036
- * 获取用户状态
4037
- */
4038
- getUserStatus(userId: string): IPromiseResult<{
4039
- status: string;
4040
- }>;
4041
- /**
4042
- * 清空所有会话
4043
- */
4044
- clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
4045
- /**
4046
- * 加入黑名单
4093
+ * 添加用户黑名单
4047
4094
  */
4048
4095
  addToBlacklist(userId: string): Promise<ErrorCode>;
4049
4096
  /**
4050
- * 将指定用户移除黑名单
4097
+ * 将指定用户移除黑名单
4051
4098
  */
4052
4099
  removeFromBlacklist(userId: string): Promise<ErrorCode>;
4053
4100
  /**
4054
- * 获取黑名单列表
4101
+ * 获取黑名单列表
4055
4102
  */
4056
- getBlacklist(): IPromiseResult<string[]>;
4103
+ getBlacklist(): Promise<IAsyncRes<string[]>>;
4057
4104
  /**
4058
- * 获取指定人员在黑名单中的状态
4105
+ * 获取指定人员在黑名单中的状态
4059
4106
  */
4060
- getBlacklistStatus(userId: string): IPromiseResult<string>;
4107
+ getBlacklistStatus(userId: string): Promise<IAsyncRes<string>>;
4061
4108
  /**
4062
4109
  * 向本地插入一条消息,不发送到服务器
4063
4110
  */
4064
- insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
4111
+ insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
4065
4112
  /**
4066
4113
  * 删除本地消息
4067
4114
  */
4068
- deleteMessages(timestamps: number[]): Promise<ErrorCode>;
4115
+ deleteMessages(timestamp: number[]): Promise<ErrorCode>;
4069
4116
  /**
4070
- * 通过时间戳删除本地消息
4117
+ * 从本地消息数据库中删除某一会话指定时间之前的消息数据
4071
4118
  */
4072
- deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
4119
+ deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId?: string): Promise<ErrorCode>;
4073
4120
  /**
4074
4121
  * 清空会话下历史消息
4075
4122
  */
4076
- clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
4123
+ clearMessages(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
4077
4124
  /**
4078
- * 获取消息
4125
+ * 获取本地消息
4079
4126
  */
4080
- getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
4127
+ getMessage(messageId: number): Promise<IAsyncRes<IReceivedMessage>>;
4081
4128
  /**
4082
4129
  * 设置消息内容
4083
4130
  */
@@ -4086,49 +4133,54 @@ interface IEngine {
4086
4133
  * 设置消息搜索字段
4087
4134
  */
4088
4135
  setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
4089
- /**
4090
- * 通过关键字搜索会话
4091
- */
4092
- searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
4093
- /**
4094
- * 按内容搜索会话内的消息
4095
- */
4096
- searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
4097
- messages: IReceivedMessage[];
4098
- count: number;
4099
- }>;
4100
- /**
4101
- * 获取会话下所有未读的 @ 消息
4102
- */
4103
- getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
4104
4136
  /**
4105
4137
  * 设置消息发送状态
4106
4138
  */
4107
4139
  setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
4108
4140
  /**
4109
- * 设置消息接收状态
4141
+ * 设置消息接收状态
4110
4142
  */
4111
4143
  setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
4112
4144
  /**
4113
- * 删除时间戳前的未读数
4145
+ * 设置当前用户在线状态
4114
4146
  */
4115
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
4147
+ setUserStatus(status: number): Promise<ErrorCode>;
4116
4148
  /**
4117
- * 获取会话免打扰状态
4149
+ * 订阅用户在线状态
4118
4150
  */
4119
- getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
4151
+ subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
4120
4152
  /**
4121
- * 协议栈获取远端历史消息
4153
+ * 获取用户在线状态
4122
4154
  */
4123
- getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
4155
+ getUserStatus(userId: string): Promise<IAsyncRes<{
4156
+ status: string;
4157
+ }>>;
4158
+ searchConversationByContent(keyword: string, customMessageTypes?: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
4159
+ searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId?: string): Promise<IAsyncRes<{
4160
+ messages: IReceivedMessage[];
4161
+ count: number;
4162
+ }>>;
4163
+ getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId?: string): IReceivedMessage[];
4164
+ clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
4165
+ /**
4166
+ * 获取会话免打扰状态
4167
+ */
4168
+ getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<NotificationStatus>>;
4169
+ getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): Promise<IAsyncRes<{
4124
4170
  list: IReceivedMessage[];
4125
4171
  hasMore: boolean;
4126
- }>;
4127
- joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
4172
+ }>>;
4173
+ /**
4174
+ * 加入房间
4175
+ * @param roomId
4176
+ * @param mode 房间模式:直播 or 会议
4177
+ * @param mediaType 直播房间模式下的媒体资源类型
4178
+ */
4179
+ joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4128
4180
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
4129
- rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
4130
- getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
4131
- getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
4181
+ rtcPing(roomId: string, mode: number, mediaType?: number): Promise<ErrorCode>;
4182
+ getRTCRoomInfo(roomId: string): Promise<IAsyncRes<IRTCRoomInfo>>;
4183
+ getRTCUserInfoList(roomId: string): Promise<IAsyncRes<IRTCUsers>>;
4132
4184
  getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
4133
4185
  setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
4134
4186
  removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
@@ -4136,49 +4188,105 @@ interface IEngine {
4136
4188
  name: string;
4137
4189
  content: string;
4138
4190
  }): Promise<ErrorCode>;
4139
- /**
4140
- * 全量订阅资源修改
4141
- * @param roomId 房间 Id
4142
- * @param message 向前兼容的消息内容
4143
- * @param valueInfo 全量资源数据
4144
- * @param objectName 全量 URI 消息名
4145
- */
4146
4191
  setRTCTotalRes(roomId: string, message: {
4147
4192
  name: string;
4148
4193
  content: string;
4149
- }, valueInfo: string, objectName: string, mcuValInfo: string): Promise<ErrorCode>;
4150
- getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
4194
+ }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
4195
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): Promise<IAsyncRes<KVString>>;
4151
4196
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
4152
4197
  name: string;
4153
4198
  content: string;
4154
4199
  }): Promise<ErrorCode>;
4155
4200
  setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
4156
4201
  getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
4157
- getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
4158
- setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
4202
+ getRTCToken(roomId: string, mode: number, broadcastType?: number): Promise<IAsyncRes<IRtcTokenData>>;
4203
+ setRTCState(roomId: string, report: string): Promise<ErrorCode>;
4159
4204
  getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
4160
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4205
+ /**
4206
+ * 直播观众加房间
4207
+ */
4208
+ joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
4209
+ token: string;
4210
+ }>>;
4211
+ /**
4212
+ * 直播观众退出房间
4213
+ */
4214
+ quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
4215
+ /**
4216
+ * 直播身份切换
4217
+ */
4218
+ rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4161
4219
  }
4162
4220
 
4163
- interface IExpansionMsgContent {
4221
+ declare class PluginContext {
4222
+ protected readonly _context: APIContext;
4223
+ constructor(_context: APIContext);
4164
4224
  /**
4165
- * 消息扩展的对象
4166
- */
4167
- put?: {
4168
- [key: string]: string;
4169
- };
4225
+ * 接收 IM 服务推送的消息,并通过返回 boolean 值决定此消息是否拦截
4226
+ * @param message
4227
+ * @returns 当返回值为 true,接收的消息将终止继续传递
4228
+ */
4229
+ onmessage?(message: IReceivedMessage): boolean;
4170
4230
  /**
4171
- * 删除的 keys
4172
- */
4173
- del?: string[];
4231
+ * 用户主动断开连接的事件通知
4232
+ */
4233
+ ondisconnect?(): void;
4174
4234
  /**
4175
- * messageUId
4176
- */
4177
- mid: string;
4235
+ * 接收 IM 连接状态变更通知
4236
+ * @param status
4237
+ */
4238
+ onconnectionstatechange?(status: ConnectionStatus): void;
4178
4239
  /**
4179
- * 是否删除所有, 有效值:0、1 . ( 后续如有需要, API Layer 层可使用)
4240
+ * IM 客户端销毁通知
4241
+ */
4242
+ ondestroy?(): void;
4243
+ /**
4244
+ * RTC 数据通知
4245
+ * @param roomdId 数据对应的房间 Id
4246
+ * @param data 通知数据为 key:value 方式
4247
+ * @description
4248
+ * 目前仅通知:主播加入、退出房间的人员列表变更,发布、取消发布资源列表变更
4180
4249
  */
4181
- removeAll?: number;
4250
+ onrtcdatachange?(data: IServerRTCRoomEntry[], roomdId?: string): void;
4251
+ /**
4252
+ * 获取 `@rongcloud/engine` 包版本
4253
+ */
4254
+ getCoreVersion(): string;
4255
+ /**
4256
+ * 获取当前运行中的 IMLib 版本号
4257
+ */
4258
+ getAPIVersion(): string;
4259
+ /**
4260
+ * 获取当前应用的 appkey
4261
+ */
4262
+ getAppkey(): string;
4263
+ /**
4264
+ * 获取当前已连接用户的 userId
4265
+ * 用户连接建立之前及 disconnect 之后,该方法返回 '' 值
4266
+ */
4267
+ getCurrentId(): string;
4268
+ /**
4269
+ * 获取当前连接状态
4270
+ */
4271
+ getConnectionStatus(): ConnectionStatus;
4272
+ getDeviceId(): string;
4273
+ /**
4274
+ * 发送消息
4275
+ */
4276
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
4277
+ /**
4278
+ * 消息注册
4279
+ * @description 消息注册需在应用初始化完成前进行
4280
+ * @param objectName 消息类型,如:RC:TxtMsg
4281
+ * @param isPersited 是否存储
4282
+ * @param isCounted 是否技术
4283
+ * @param searchProps 搜索字段,只在搭配协议栈使用时有效
4284
+ */
4285
+ registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
4286
+ /**
4287
+ * 获取服务时间
4288
+ */
4289
+ getServerTime(): number;
4182
4290
  }
4183
4291
 
4184
4292
  declare class RTCPluginContext extends PluginContext {
@@ -4233,22 +4341,6 @@ declare class RTCPluginContext extends PluginContext {
4233
4341
  * mcu 合流发布内容,是一个 JSON 字符串,解析类型为 {mediaType: number, msid: string, uri: string}[]
4234
4342
  */
4235
4343
  mcuValInfo?: string): Promise<ErrorCode>;
4236
- /**
4237
- * 设置 cdn_uris 扩散
4238
- * @param objectName 全量 URI 消息名,即 `RCRTC:TotalContentResources`
4239
- * @param CDNUris cdn_uris 扩散字段
4240
- * {
4241
- "broadcast":0,
4242
- "fps":25,
4243
- "h":640,
4244
- "pull_safe":true,
4245
- "push_mode":1,
4246
- "url":"https://rtc-media-api-service-ucbj2-01.rongcloud.net/api/rtc/cdn/player",
4247
- "w":360,
4248
- "enableInnerCDN":true
4249
- }[]
4250
- */
4251
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4252
4344
  getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
4253
4345
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
4254
4346
  name: string;
@@ -4264,7 +4356,6 @@ declare class RTCPluginContext extends PluginContext {
4264
4356
  */
4265
4357
  joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<{
4266
4358
  token: string;
4267
- kvEntries: IServerRTCRoomEntry[];
4268
4359
  }>;
4269
4360
  /**
4270
4361
  * 直播观众退出房间
@@ -4310,13 +4401,15 @@ interface IEngineWatcher {
4310
4401
  * @param leftCount 参数废弃,值始终为 undefined
4311
4402
  * @param hasMore 消息是否收取结束,需与协议栈配合使用
4312
4403
  */
4313
- message: (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
4404
+ batchMessage: (messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean) => void;
4314
4405
  status: (status: ConnectionStatus) => void;
4315
4406
  chatroom: (event: IChatroomListenerData) => void;
4316
4407
  conversation: (event: any) => void;
4317
4408
  expansion: (event: IExpansionListenerData) => void;
4318
4409
  tag: () => void;
4319
- conversationTag: () => void;
4410
+ conversationTag: (conversationType: ConversationType, targetId: string, conversationTags: {
4411
+ tags: ILocalTagStatus;
4412
+ }) => void;
4320
4413
  /**
4321
4414
  * RTC 数据变更
4322
4415
  */
@@ -4573,6 +4666,10 @@ declare abstract class AEngine implements IEngine {
4573
4666
  * 设置聊天室属性
4574
4667
  */
4575
4668
  abstract setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4669
+ /**
4670
+ * 批量设置聊天室属性
4671
+ */
4672
+ abstract setChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<ErrorCode>;
4576
4673
  /**
4577
4674
  * 强制设置聊天室属性
4578
4675
  */
@@ -4581,6 +4678,10 @@ declare abstract class AEngine implements IEngine {
4581
4678
  * 删除聊天室属性
4582
4679
  */
4583
4680
  abstract removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4681
+ /**
4682
+ * 批量删除聊天室属性
4683
+ */
4684
+ abstract removeChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<ErrorCode>;
4584
4685
  /**
4585
4686
  * 强制删除聊天室属性
4586
4687
  */
@@ -4687,10 +4788,6 @@ declare abstract class AEngine implements IEngine {
4687
4788
  * 获取设备ID
4688
4789
  */
4689
4790
  abstract getDeviceId(): string;
4690
- /**
4691
- * 获取当前 userId
4692
- */
4693
- abstract getCurrentUserId(): string;
4694
4791
  /**
4695
4792
  * 设置用户在线状态监听器
4696
4793
  */
@@ -4832,11 +4929,9 @@ declare abstract class AEngine implements IEngine {
4832
4929
  abstract getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
4833
4930
  abstract joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
4834
4931
  token: string;
4835
- kvEntries: IServerRTCRoomEntry[];
4836
4932
  }>>;
4837
4933
  abstract quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
4838
4934
  abstract rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4839
- abstract setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4840
4935
  }
4841
4936
 
4842
4937
  declare class AppStorage {
@@ -5287,4 +5382,4 @@ declare enum CONNECTION_TYPE {
5287
5382
  */
5288
5383
  declare const version: string;
5289
5384
 
5290
- export { AEngine, ANavi, APIContext, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAsyncRes, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IEngine, IEngineWatcher, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntryOption, IRequest, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, ItypingStateListener, KVString, LiveRole, LiveType, LogLevel, LogType, Logger, MAX_MESSAGE_CONTENT_BYTES, MINI_COMET_CONNECT_URIS, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NotificationStatus, PING_REQ_TIMEOUT, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, RTCApiType, RTCIdentityChangeType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UploadMethod, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, cloneByJSON, forEach, formatConnectResponseCode, getBrowser, getMimeKey, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidFileType, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, usingCppEngine, validate, version };
5385
+ export { AEngine, ANavi, APIContext, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType as ChatroomMemberChangeType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAsyncRes, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntryOption, IRequest, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, ItypingStateListener, KVString, LiveRole, LiveType, LogLevel, LogType, Logger, MAX_MESSAGE_CONTENT_BYTES, MINI_COMET_CONNECT_URIS, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NotificationStatus, PING_REQ_TIMEOUT, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, RTCApiType, RTCIdentityChangeType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UploadMethod, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, cloneByJSON, forEach, formatConnectResponseCode, getBrowser, getMimeKey, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidFileType, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, usingCppEngine, validate, version };