@rongcloud/engine 5.6.2-beem.7 → 5.7.0-beem.10

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/index.d.ts CHANGED
@@ -102,154 +102,6 @@ declare enum TagChangeType {
102
102
  delete = 3
103
103
  }
104
104
 
105
- /**
106
- * 通信协议中 fixHeader 第一个字节中的 Qos 数据标识
107
- * ```
108
- * fixHeader:command(4 bit) | dup(1 bit) | Qos(2 bit) | retain(1 bit)
109
- * ```
110
- */
111
- declare enum QOS {
112
- AT_MOST_ONCE = 0,
113
- AT_LEAST_ONCE = 1,
114
- EXACTLY_ONCE = 2,
115
- DEFAULT = 3
116
- }
117
- /**
118
- * 通信协议中 fixHeader 第一个字节中的 command 数据标识,用于判断操作类型
119
- * ```
120
- * fixHeader:command(4 bit) | dup(1 bit) | Qos(2 bit) | retain(1 bit)
121
- * ```
122
- */
123
- declare enum OperationType {
124
- /** 私有云专用,解密协商指令 */
125
- SYMMETRIC = 0,
126
- /** 连接请求 */
127
- CONNECT = 1,
128
- /** 连接应答 */
129
- CONN_ACK = 2,
130
- /** 上行发送消息 */
131
- PUBLISH = 3,
132
- /** 上行发送消息的应答 */
133
- PUB_ACK = 4,
134
- /** 上行拉消息 */
135
- QUERY = 5,
136
- /** 上行拉消息的应答 */
137
- QUERY_ACK = 6,
138
- /** QueryConfirm */
139
- QUERY_CONFIRM = 7,
140
- SUBSCRIBE = 8,
141
- SUB_ACK = 9,
142
- UNSUBSCRIBE = 10,
143
- UNSUB_ACK = 11,
144
- PING_REQ = 12,
145
- PING_RESP = 13,
146
- /** 连接挂断 */
147
- DISCONNECT = 14,
148
- RESERVER2 = 15
149
- }
150
- /**
151
- * connect 版本号,用于区分 ConnAckMessage 的解析规则
152
- */
153
- declare enum ConnAckProtocolVer {
154
- /**
155
- * V4 说明:
156
- * ```
157
- * 增加 flag 来标识每个位置是否有内容,如果没有 messageId 说明此 APP 没有配置防重放,默认取0
158
- * status | 4byte
159
- * flag | 1byte 每一位标识是否有对应值,由低到高
160
- * userId | 可变长
161
- * sessionId | 可变长
162
- * timestamp | 8byte
163
- * messageId | 4byte
164
- * onlineClientInfo | 可变长
165
- * ===
166
- * flag 描述:
167
- * | | | | 4 | 3 | 2 | 1 | 0 |
168
- * | | | | hasOnlineClientInfo | hasMessageId | hasTimeStamp | hasSessionId | hasUserId |
169
- * ```
170
- */
171
- V4 = 4,
172
- /**
173
- * V3 说明:
174
- * ```
175
- * status | 4byte
176
- * userId | 可变长
177
- * sessionId | 可变长
178
- * timestamp | 8byte
179
- * descyptionType | 1byte
180
- * secretKey | 可变长
181
- * onlineClientInfo | 可变长
182
- * ```
183
- */
184
- V3 = 3
185
- }
186
-
187
- /**
188
- * @todo 注释补全
189
- * @description
190
- * Header 处理
191
- */
192
- declare class Header {
193
- readonly type: OperationType;
194
- private readonly _retain;
195
- qos: QOS;
196
- private readonly _dup;
197
- readonly syncMsg: boolean;
198
- constructor(type: OperationType, retain?: boolean, qos?: QOS, dup?: boolean);
199
- encode(): number;
200
- }
201
- /**
202
- * @description
203
- * 融云读取二进制数据
204
- */
205
- declare class RongStreamReader {
206
- private _pool;
207
- private _position;
208
- private _poolLen;
209
- constructor(arr: Uint8Array);
210
- check(): boolean;
211
- /**
212
- * 读 2 位
213
- */
214
- read2Byte(): number;
215
- /**
216
- * 读 4 位
217
- */
218
- readInt(): number;
219
- /**
220
- * 读 8 位
221
- */
222
- readLong(): number;
223
- /**
224
- * 读 1 位
225
- */
226
- readByte(): number;
227
- /**
228
- * 获取数据
229
- */
230
- readUTF(): string;
231
- /**
232
- * 读剩余的所有值
233
- */
234
- readAll(): Uint8Array;
235
- }
236
- /**
237
- * @description
238
- * 融云写入二进制数据
239
- */
240
- declare class RongStreamWriter {
241
- private _pool;
242
- private _position;
243
- private _writen;
244
- /**
245
- * 写入缓存区, writen 值往后移
246
- */
247
- write(byte: number): number;
248
- writeArr(byte: Array<number>): number[];
249
- writeUTF(str: string): void;
250
- getBytesArray(): Array<number>;
251
- }
252
-
253
105
  /**
254
106
  * LogLevel 等级定义,与大数据服务器日志等级保持一致
255
107
  */
@@ -570,7 +422,7 @@ declare enum ErrorCode {
570
422
  */
571
423
  FORBIDDEN_IN_CHATROOM = 23408,
572
424
  /**
573
- * 聊天室中成员被踢出
425
+ * 当前用户被目标聊天室封禁
574
426
  */
575
427
  RC_CHATROOM_USER_KICKED = 23409,
576
428
  /**
@@ -663,9 +515,9 @@ declare enum ErrorCode {
663
515
  */
664
516
  RC_HTTP_RECV_FAIL = 30006,
665
517
  /**
666
- * 导航操作的 HTTP 请求,返回不是200。
518
+ * 导航请求失败
667
519
  */
668
- RC_NAVI_RESOURCE_ERROR = 30007,
520
+ RC_NAVI_REQ_FAILED = 30007,
669
521
  /**
670
522
  * 导航数据解析后,其中不存在有效数据。
671
523
  */
@@ -675,21 +527,17 @@ declare enum ErrorCode {
675
527
  */
676
528
  RC_DOMAIN_NOT_RESOLVE = 30009,
677
529
  /**
678
- * 创建 Socket 失败。
530
+ * Socket 连接失败
679
531
  */
680
532
  RC_SOCKET_NOT_CREATED = 30010,
681
533
  /**
682
- * Socket 被断开。
534
+ * Socket 连接断开
683
535
  */
684
536
  RC_SOCKET_DISCONNECTED = 30011,
685
537
  /**
686
- * PING 操作失败。
687
- */
688
- RC_PING_SEND_FAIL = 30012,
689
- /**
690
- * PING 超时。
538
+ * PING 连续失败次数超限制
691
539
  */
692
- RC_PONG_RECV_FAIL = 30013,
540
+ RC_PING_EXCEED_LIMIT = 30012,
693
541
  /**
694
542
  * 消息发送失败。
695
543
  */
@@ -699,27 +547,27 @@ declare enum ErrorCode {
699
547
  */
700
548
  RC_MSG_CONTENT_EXCEED_LIMIT = 30016,
701
549
  /**
702
- * connect 连接时,收到的 ACK 超时。
550
+ * TCP 连接中,CMP 应答超时。
703
551
  */
704
552
  RC_CONN_ACK_TIMEOUT = 31000,
705
553
  /**
706
- * 参数错误。
554
+ * 连接协议版本错误
707
555
  */
708
556
  RC_CONN_PROTO_VERSION_ERROR = 31001,
709
557
  /**
710
- * 参数错误,App Id 错误。
558
+ * 客户端连接用设备 info 信息错误
711
559
  */
712
- RC_CONN_ID_REJECT = 31002,
560
+ RC_CONN_IDENTIFIER_REJECTED = 31002,
713
561
  /**
714
- * 服务器不可用。
562
+ * 连接服务未开通,需要排查后台小程序(或桌面端)服务是否已开通
715
563
  */
716
564
  RC_CONN_SERVER_UNAVAILABLE = 31003,
717
565
  /**
718
- * Token 错误。
566
+ * Token 无法解析,或 Token 已过期
719
567
  */
720
- RC_CONN_USER_OR_PASSWD_ERROR = 31004,
568
+ RC_CONN_TOKEN_INCORRECT = 31004,
721
569
  /**
722
- * websocket 鉴权失败,通常为连接后未及时发送 Ping 或接收到 Pong
570
+ * 防黑产校验失败
723
571
  */
724
572
  RC_CONN_NOT_AUTHRORIZED = 31005,
725
573
  /**
@@ -727,31 +575,51 @@ declare enum ErrorCode {
727
575
  */
728
576
  RC_CONN_REDIRECTED = 31006,
729
577
  /**
730
- * NAME 与后台注册信息不一致。
578
+ * 包名不合法(目前仅限移动端使用)
731
579
  */
732
580
  RC_CONN_PACKAGE_NAME_INVALID = 31007,
733
581
  /**
734
- * APP 被屏蔽、删除或不存在。
582
+ * Appkey 已被封禁或删除
735
583
  */
736
584
  RC_CONN_APP_BLOCKED_OR_DELETED = 31008,
737
585
  /**
738
- * 用户被屏蔽。
586
+ * 用户已被封禁
739
587
  */
740
588
  RC_CONN_USER_BLOCKED = 31009,
741
589
  /**
742
- * Disconnect,由服务器返回,比如用户互踢。
590
+ * 其他端登录导致本端被踢
743
591
  */
744
592
  RC_DISCONN_KICK = 31010,
745
593
  /**
746
- * Disconnect,由服务器返回,比如用户互踢。
594
+ * 用户在线时被封禁导致连接断开
747
595
  */
748
596
  RC_DISCONN_EXCEPTION = 31011,
749
597
  /**
750
- * 开启禁止把已在线客户端踢下线开关后,该错误码标识已有同类型端在线,禁止链接;
598
+ * Token 已过期
599
+ */
600
+ RC_CONN_TOKEN_EXPIRED = 31020,
601
+ /**
602
+ * Token 中携带 deviceId 时,检测 Token 中 deviceId 与链接设备 deviceId 不一致
603
+ */
604
+ RC_CONN_DEVICE_ERROR = 31021,
605
+ /**
606
+ * 页面域名不在安全域名白名单内,需通过开发者后台添加安全域名配置
607
+ */
608
+ RC_CONN_HOSTNAME_ERROR = 31022,
609
+ /**
610
+ * 开启禁止把已在线客户端踢下线开关后,该错误码标识已有同类型端在线
751
611
  */
752
612
  RC_DISCONN_SAME_CLIENT_ON_LINE = 31023,
753
613
  /**
754
- * app 验证Token 验证不通过。所有内部超时,访问失败,返回给客户端sdk都是验证不通过,由服务端日志去看具体是那种失败。
614
+ * 连接数已达上限(私有云)
615
+ */
616
+ RC_LISCENSE_COUNT_OUT_OF_LIMIT = 31024,
617
+ /**
618
+ * 客户端连错环境,引发连接拒绝;如使用开发环境 Appkey 连接到生产环境
619
+ */
620
+ RC_CONN_WRONG_CLUSTER = 31025,
621
+ /**
622
+ * 开启 AppServer 联合鉴权功能后,到 AppServer 认证失败
755
623
  */
756
624
  RC_APP_AUTH_NOT_PASS = 31026,
757
625
  /**
@@ -759,16 +627,15 @@ declare enum ErrorCode {
759
627
  */
760
628
  RC_OTP_USED = 31027,
761
629
  /**
762
- * token平台验证失败
630
+ * Token 绑定的平台与登录平台不符
763
631
  */
764
632
  RC_PLATFORM_ERROR = 31028,
765
633
  /**
766
634
  * 用户账号已销户
767
- * @desc 请检查您使用的 Token 是否正确,以及对应的 UserId 是否被销户
768
635
  */
769
- RC_CONN_USER_LOGOUT = 31029,
636
+ RC_ACCOUNT_CANCELLATION = 31029,
770
637
  /**
771
- * 证书过期,SDK不会重连
638
+ * License 授权过期(私有云)
772
639
  */
773
640
  RC_LICENSE_EXPIRED = 31030,
774
641
  /**
@@ -779,6 +646,10 @@ declare enum ErrorCode {
779
646
  * 协议层内部错误。
780
647
  */
781
648
  RC_MSG_DATA_INCOMPLETE = 32002,
649
+ /**
650
+ * TCP 连接重置
651
+ */
652
+ RC_TCP_RESET = 32054,
782
653
  /**
783
654
  * 未调用 init 初始化函数。
784
655
  */
@@ -888,7 +759,7 @@ declare enum ErrorCode {
888
759
  */
889
760
  CAN_NOT_RECONNECT = 35007,
890
761
  /**
891
- * 不支持的平台类型,一般小程序或 PC 未开通
762
+ * 无可用的 IM 服务地址
892
763
  */
893
764
  SERVER_UNAVAILABLE = 35008,
894
765
  /**
@@ -1058,11 +929,34 @@ declare enum ErrorCode {
1058
929
  * 聊天室设置批量kv,一次不能超过10个
1059
930
  */
1060
931
  CHATROOM_KV_STORE_OUT_LIMIT = 23429,
1061
- SEARCH_PROPS_LIMIT_ERROR = 35022
932
+ SEARCH_PROPS_LIMIT_ERROR = 35022,
933
+ /**
934
+ * 非法的代理配置,RongIMProxy 为空或者非法
935
+ */
936
+ INVALID_PARAMETER_PROXY = 34238,
937
+ /**
938
+ * 代理测试服务地址为空或者非法
939
+ */
940
+ INVALID_PARAMETER_TESTHOST = 34239,
941
+ /**
942
+ * 开发者接口调用 testProxy 接口时无法联通
943
+ */
944
+ INVALID_CONNECT_TESTHOST_FAILED = 34240,
945
+ /**
946
+ * 开发者调用 connect 时 proxy 服务设置失败
947
+ * 移动端使用的为 31028,但web 端此状态码已经被占用,所以改为 web 端使用号码段 35XXX
948
+ * @discussion 设置 setProxy 接口不可在连接或正在连接中的状态调用。
949
+ */
950
+ RC_CONN_PROXY_UNAVAILABLE = 35028,
951
+ /**
952
+ * proxy 服务不可用
953
+ */
954
+ PROXY_UNAVAILABLE = 17
1062
955
  }
1063
956
 
1064
957
  /**
1065
958
  * 连接状态
959
+ * @deprecated 请使用 `RCConnectionStatus` 替代此枚举声明
1066
960
  */
1067
961
  declare enum ConnectionStatus {
1068
962
  /**
@@ -1148,7 +1042,11 @@ declare enum ConnectionStatus {
1148
1042
  /**
1149
1043
  * 证书过期,SDK不会重连
1150
1044
  */
1151
- RC_LICENSE_EXPIRED = 31030
1045
+ RC_LICENSE_EXPIRED = 31030,
1046
+ /**
1047
+ * Token 错误。
1048
+ */
1049
+ RC_CONN_USER_OR_PASSWD_ERROR = 31004
1152
1050
  }
1153
1051
 
1154
1052
  /**
@@ -1178,92 +1076,6 @@ declare enum ReceivedStatus {
1178
1076
  UNREAD = 0
1179
1077
  }
1180
1078
 
1181
- /**
1182
- * CMP/Comet 服务连接应答码
1183
- */
1184
- declare const ConnectResultCode: {
1185
- /**
1186
- * 连接成功
1187
- */
1188
- ACCEPTED: number;
1189
- /**
1190
- * 协议版本不匹配
1191
- * @description 暂未使用
1192
- */
1193
- UNACCEPTABLE_PROTOCOL_VERSION: number;
1194
- /**
1195
- * 客户端(移动端 TCP 连接建立时)`info` 字段格式错误
1196
- * @description 格式:`{平台类型}-{设备信息}-{sdk版本}`。
1197
- * 其中设备信息为:{手机类型}{手机型号}{网络类型,4G/WIFI}{运营商标识, 移动/电信/联通}
1198
- */
1199
- IDENTIFIER_REJECTED: number;
1200
- /**
1201
- * 不支持的平台类型,一般小程序或 PC 未开通
1202
- */
1203
- SERVER_UNAVAILABLE: number;
1204
- /**
1205
- * Token无法解析,或Token已过期
1206
- */
1207
- TOKEN_INCORRECT: number;
1208
- /**
1209
- * 防黑产规则相关应答
1210
- */
1211
- NOT_AUTHORIZED: number;
1212
- /**
1213
- * 服务重定向,一般服务扩缩容时,落点已经改变,此时 userId 链接到旧的节点时,会触发该错误。
1214
- * 客户端收到该应答后须重新访问导航,重新获取 CMP 地址
1215
- */
1216
- REDIRECT: number;
1217
- /**
1218
- * 暂未使用
1219
- */
1220
- PACKAGE_ERROR: number;
1221
- /**
1222
- * 该 AppKey 已经封禁或删除
1223
- */
1224
- APP_BLOCK_OR_DELETE: number;
1225
- /**
1226
- * 该用户 ID 已经被封禁
1227
- */
1228
- BLOCK: number;
1229
- /**
1230
- * Token 已过期,暂未使用
1231
- */
1232
- TOKEN_EXPIRE: number;
1233
- /**
1234
- * Token 中携带 deviceId 时,检测 Token 中 deviceId 与链接设备 deviceId 不一致
1235
- */
1236
- DEVICE_ERROR: number;
1237
- /**
1238
- * Web 端设置安全域名后,连接端域名不在安全域名范围内
1239
- */
1240
- HOSTNAME_ERROR: number;
1241
- /**
1242
- * 开启`禁止把已在线客户端踢下线`开关后,该错误码标识已有同类型端在线,禁止链接
1243
- */
1244
- HASOHTERSAMECLIENTONLINE: number;
1245
- /**
1246
- * 客户端连错环境,引发连接拒绝
1247
- */
1248
- IN_OTHER_CLUSTER: number;
1249
- /**
1250
- * app 验证Token 验证不通过。所有内部超时,访问失败,返回给客户端sdk都是验证不通过,由服务端日志去看具体是那种失败。
1251
- */
1252
- APP_AUTH_NOT_PASS: number;
1253
- /**
1254
- * One Time Password 已经被使用过
1255
- */
1256
- OTP_USED: number;
1257
- /**
1258
- * token平台验证失败
1259
- */
1260
- PLATFORM_ERROR: number;
1261
- /**
1262
- * 用户账号已销户,不再进行连接
1263
- */
1264
- USER_LOGOUT: number;
1265
- };
1266
-
1267
1079
  /**
1268
1080
  * 内置消息类型
1269
1081
  */
@@ -1328,6 +1140,14 @@ declare enum MessageType {
1328
1140
  * 撤回消息
1329
1141
  */
1330
1142
  RECALL = "RC:RcCmd",
1143
+ /**
1144
+ * 撤回通知消息
1145
+ *
1146
+ * 融云定义了 ObjectName 为 `RC:RcNtf` 的撤回通知消息
1147
+ *
1148
+ * PC: recallMessage 会替换聊天记录中的原始消息为一条 objectName 为 `RC:RcNtf` 的撤回通知消息
1149
+ */
1150
+ RECALL_NOTIFICATION_MESSAGE = "RC:RcNtf",
1331
1151
  /**
1332
1152
  * 已读同步状态消息
1333
1153
  */
@@ -1515,6 +1335,7 @@ declare enum LogTagId {
1515
1335
  L_DESTROY_O = "L_DESTROY_O",
1516
1336
  A_CONNECT_T = "A-connect-T",
1517
1337
  A_CONNECT_R = "A-connect-R",
1338
+ A_CONNECT_S = "A-connect-S",
1518
1339
  A_DISCONNECT_O = "A-disconnect-O",
1519
1340
  A_RECONNECT_T = "A-reconnect-T",
1520
1341
  A_RECONNECT_R = "A_RECONNECT_R",
@@ -1570,6 +1391,8 @@ declare enum LogTagId {
1570
1391
  P_REGTYP_E = "P-regtype-E",
1571
1392
  L_GET_NAVI_T = "L-get_navi-T",
1572
1393
  L_GET_NAVI_R = "L-get_navi-R",
1394
+ L_GET_NAVI_O = "L-get_navi-O",
1395
+ L_PARSE_NAVI_E = "L-parse_navi-E",
1573
1396
  L_ENV_S = "L-Env-S",
1574
1397
  L_GET_INDEX_NAVI_S = "L-get_index_navi-S",
1575
1398
  A_JOIN_CHATROOM_T = "A-join_chatroom-T",
@@ -1580,6 +1403,7 @@ declare enum LogTagId {
1580
1403
  A_QUIT_CHATROOM_R = "A-quit_chatroom-R",
1581
1404
  L_REJOIN_CHATROOM_T = "L-rejoin_chatroom-T",
1582
1405
  L_REJOIN_CHATROOM_R = "L-rejoin_chatroom-R",
1406
+ L_REJOIN_CHATROOM_S = "L-rejoin_chatroom-S",
1583
1407
  L_MEDIA_S = "L-media-S",
1584
1408
  L_MEDIA_UPLOAD_T = "L-media_upload-T",
1585
1409
  L_MEDIA_UPLOAD_R = "L-media_upload-R",
@@ -1589,13 +1413,17 @@ declare enum LogTagId {
1589
1413
  G_GET_REAL_TIMELOG_COMMAND_S = "G-get_real_timelog_command-S",
1590
1414
  L_CHECK_ALIVE_IM_T = "L-check_alive_im-T",
1591
1415
  L_CHECK_ALIVE_IM_R = "L-check_alive_im-R",
1416
+ L_CHECK_ALIVE_IM_S = "L-check_alive_im-S",
1592
1417
  A_GET_HISTORY_MSG_T = "A-get_history_msg-T",
1593
1418
  A_GET_HISTORY_MSG_R = "A-get_history_msg-R",
1594
1419
  L_GET_HISTORY_MSG_T = "L-get_history_msg-T",
1595
1420
  L_GET_HISTORY_MSG_R = "L-get_history_msg-R",
1421
+ A_GET_PRIVATE_MESSAGE_DELIVER_TIME_E = "A-get_privage_message_deliver_time-E",
1422
+ A_GET_GROUP_MESSAGE_DELIVER_LIST_E = "A-get_group_message_deliver_list-E",
1596
1423
  A_CALLBACK_O = "A-callback-O",
1597
1424
  A_CALLBACK_E = "A-callback-E",
1598
1425
  L_CALLBACK_E = "L-callback-E",
1426
+ A_GET_TOP_CONVERSATION_LIST_E = "A-get_top_conversation_list-E",
1599
1427
  /**
1600
1428
  * PB 数据编码错误
1601
1429
  */
@@ -1621,6 +1449,7 @@ declare enum LogTagId {
1621
1449
  L_UNKNOWN_TOPIC_E = "L_UNKNOWN_TOPIC_E",
1622
1450
  L_RECV_RMTP_O = "L_RECV_RMTP_O",
1623
1451
  L_RECV_RMTP_E = "L_RECV_RMTP_E",
1452
+ L_RECV_S_NTF_O = "L-recv_s_ntf_O",
1624
1453
  /** 版本号上报 */
1625
1454
  L_VER_REPORT_T = "L-VER_REPORT-T",
1626
1455
  /** 版本号上报结果 */
@@ -1629,7 +1458,10 @@ declare enum LogTagId {
1629
1458
  L_CALL_MAIN_SYNC_O = "L_CALL_MAIN_SYNC_O",
1630
1459
  /** 未知的通知 */
1631
1460
  L_UNSUPPORT_NTF_FROM_MAIN_E = "L_UNSUPPORT_NTF_FROM_MAIN_E",
1632
- A_SET_MSG_CONTENT_O = "A_SET_MSG_CONTENT_O"
1461
+ A_SET_MSG_CONTENT_O = "A_SET_MSG_CONTENT_O",
1462
+ A_REMOVE_PROXY_O = "A-remove_proxy-O",
1463
+ A_SET_PROXY_O = "A-set_proxy-O",
1464
+ A_TEST_PROXY_O = "A-test_proxy-O"
1633
1465
  }
1634
1466
 
1635
1467
  /**
@@ -1641,6 +1473,37 @@ declare enum ChatroomUserChangeType {
1641
1473
  JOIN = 1
1642
1474
  }
1643
1475
 
1476
+ /**
1477
+ * 发送状态
1478
+ * @category Enum
1479
+ */
1480
+ declare enum SentStatus {
1481
+ /**
1482
+ * 发送中。
1483
+ */
1484
+ SENDING = 10,
1485
+ /**
1486
+ * 发送失败。
1487
+ */
1488
+ FAILED = 20,
1489
+ /**
1490
+ * 已发送。
1491
+ */
1492
+ SENT = 30,
1493
+ /**
1494
+ * 对方已接收。
1495
+ */
1496
+ RECEIVED = 40,
1497
+ /**
1498
+ * 对方已读。
1499
+ */
1500
+ READ = 50,
1501
+ /**
1502
+ * 对方已销毁。
1503
+ */
1504
+ DESTROYED = 60
1505
+ }
1506
+
1644
1507
  declare enum StoreKeys {
1645
1508
  /**
1646
1509
  * Navi 数据缓存,暂未使用
@@ -2025,13 +1888,13 @@ interface IReceivedMessage {
2025
1888
  */
2026
1889
  receivedStatus: number;
2027
1890
  /**
2028
- * CPP 独有字段 消息本地 ID
1891
+ * 消息本地 ID, web 端由 lib 内生成, PC 端由协议栈数据库生成自增ID
2029
1892
  */
2030
1893
  messageId?: number;
2031
1894
  /**
2032
- * CPP 独有字段 消息发送状态
1895
+ * 消息发送状态, web 端由 lib 内根据消息状态设置值为 发送中、已发送和发送失败 ,PC 端由协议栈自动维护或用户自己设置
2033
1896
  */
2034
- sentStatus?: number;
1897
+ sentStatus?: SentStatus;
2035
1898
  /**
2036
1899
  * 已读回执信息(导航配置grpRRVer=1时群组类型消息内存在, 其他情况为undefined)
2037
1900
  */
@@ -2052,6 +1915,10 @@ interface IReceivedMessage {
2052
1915
  * 拉取历史消息时表示该消息是否为超级群频道类型(仅超级群有效)
2053
1916
  */
2054
1917
  channelType?: UltraGroupChannelType;
1918
+ /**
1919
+ * 扩展内容
1920
+ */
1921
+ extraContent?: string;
2055
1922
  }
2056
1923
  /**
2057
1924
  * @category Interface
@@ -2270,6 +2137,10 @@ interface ISendMsgOptions {
2270
2137
  * 超级群专有字段,是否断档,若断档需要客户判断是否拉取
2271
2138
  */
2272
2139
  isInterrupt?: boolean;
2140
+ /**
2141
+ * 标识该消息是否为重发消息,仅 electron 中有效。
2142
+ */
2143
+ isResend?: boolean;
2273
2144
  }
2274
2145
  interface IInsertMsgOptions {
2275
2146
  senderUserId: string;
@@ -2432,6 +2303,13 @@ interface IUltraUnreadMsg {
2432
2303
  mentionedType?: number;
2433
2304
  }
2434
2305
 
2306
+ interface IMentionInfo {
2307
+ type: MentionedType;
2308
+ /**
2309
+ * 被 @ 的用户 Id 列表,仅在 `type` 为 `2` 时有效
2310
+ */
2311
+ userIdList: string[];
2312
+ }
2435
2313
  /**
2436
2314
  * 从服务器拉取到的会话数据结构
2437
2315
  * @category Interface
@@ -2467,16 +2345,7 @@ interface IReceivedConversation {
2467
2345
  /**
2468
2346
  * 消息中的 @ 数据,仅在 `conversationType` 为 `ConversationType.GROUP` 时有效
2469
2347
  */
2470
- mentionedInfo?: {
2471
- /**
2472
- * `@ 类型,其中 1 为 @ 所有人,2 为 @ 部分人`
2473
- */
2474
- type: 1 | 2;
2475
- /**
2476
- * 被 @ 的用户 Id 列表,仅在 `type` 为 `2` 时有效
2477
- */
2478
- userIdList: string[];
2479
- } | null;
2348
+ mentionedInfo?: IMentionInfo | null;
2480
2349
  /**
2481
2350
  * 会话免打扰状态
2482
2351
  * @description
@@ -2630,304 +2499,75 @@ interface IUltraUnreadConversation {
2630
2499
  }
2631
2500
 
2632
2501
  /**
2633
- * 导航信息数据就结构
2502
+ * @category Interface
2634
2503
  */
2635
- interface INaviInfo {
2504
+ interface IChatroomEntryListenerData {
2636
2505
  /**
2637
- * Navi 数据请求响应码,200 为成功请求
2638
- */
2639
- code: number;
2506
+ * 更新的键
2507
+ */
2508
+ key: string;
2640
2509
  /**
2641
- * 获取 Navi 数据失败时的提示信息
2642
- */
2643
- errorMessage?: string;
2510
+ * 更新的值
2511
+ */
2512
+ value: string;
2644
2513
  /**
2645
- * 获取 Navi 数据失败时的请求 url 信息
2646
- */
2647
- url?: string;
2514
+ * 更新的时间
2515
+ */
2516
+ timestamp: number;
2648
2517
  /**
2649
- * 请求导航数据时使用的协议:http / https
2650
- * @description 该字段为 SDK 内增加的字段,导航接口数据中不存在
2651
- */
2652
- protocol: 'http' | 'https';
2518
+ * 更新的聊天室 ID
2519
+ */
2520
+ chatroomId: string;
2653
2521
  /**
2654
- * 获取导航时使用的 userId,小程序不走导航,故拿不到 userId
2655
- */
2656
- userId?: string;
2522
+ * 更新类型
2523
+ */
2524
+ type: ChatroomEntryType;
2525
+ }
2526
+ /**
2527
+ * @category Interface
2528
+ */
2529
+ interface IChatroomRejoinedFailed {
2657
2530
  /**
2658
- * CMP 服务 Websocket 连接地址,包含域名与端口,不含 ws 或 wss 协议头
2659
- * @example a.domain.com:443
2660
- */
2661
- server: string;
2531
+ * 自动重新加入的聊天室 ID
2532
+ */
2533
+ chatroomId: string;
2662
2534
  /**
2663
- * 备用 CMP 服务地址,包含域名与端口,不含 ws 或 wss 协议头,多个备用地址以 ',' 分割
2664
- * @example a.domain.com:443,b.domain.com:443
2665
- */
2666
- backupServer?: string;
2535
+ * 自动重新加入失败的 code
2536
+ */
2537
+ errorCode: number;
2538
+ }
2539
+ /**
2540
+ * @category Interface
2541
+ */
2542
+ interface IChatroomRejoinedSuccessed {
2667
2543
  /**
2668
- * 备用 CMP 服务地址,POST 请求 TCP 连接返回的是 bs 字段,非 backupServer 字段
2669
- */
2670
- bs?: string;
2544
+ * 自动重新加入的聊天室 ID
2545
+ */
2546
+ chatroomId: string;
2671
2547
  /**
2672
- * RTC 服务配置,其值可能为 null、无效字符串、有效 JSON 字符串
2673
- * 1. 公有云未开通音视频时,值为 null
2674
- * 2. 私有云无配置时为 `{ "strategy": 0 }`
2675
- */
2676
- voipCallInfo: string | null;
2548
+ * 自动重新加入的聊天室拉取消息的数量
2549
+ */
2550
+ count: number;
2551
+ }
2552
+ /**
2553
+ * @category Interface
2554
+ */
2555
+ interface IChatroomUserChangeInfo {
2556
+ users: {
2557
+ [userId: string]: ChatroomUserChangeType;
2558
+ };
2559
+ chatroomId: string;
2560
+ }
2561
+ declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
2562
+ /**
2563
+ * 聊天室信息
2564
+ * @category Interface
2565
+ */
2566
+ interface IChatroomListenerData {
2677
2567
  /**
2678
- * 聊天室 kv 存储开关
2679
- * @todo 需确认详细有效值
2680
- * @description 公有云独有配置
2681
- */
2682
- kvStorage: number;
2683
- /**
2684
- * HttpDNS 功能开关,在 web 端无效
2685
- * @description 公有云独有配置
2686
- */
2687
- openHttpDNS: boolean;
2688
- /**
2689
- * 历史消息云存储功能开关
2690
- * @description
2691
- * 1. 公有云通过 `developer.rongcloud.cn` 管理后台 `单群聊消息云端存储` 功能开关进行配置
2692
- * 2. 私有云默认为 `true`
2693
- */
2694
- historyMsg: boolean;
2695
- /**
2696
- * 聊天室历史消息开关
2697
- * @description
2698
- * 1. 私有云对聊天室功能支持有限,默认为 `false`
2699
- * 2. TODO: 公有云配置待确认
2700
- */
2701
- chatroomMsg: boolean;
2702
- /**
2703
- * 文件服务器地址
2704
- * @description
2705
- * 1. 公有云下,该地址为七牛云服务器地址
2706
- * 2. 私有云下,该地址为私有云自研文件服务器地址
2707
- */
2708
- uploadServer: string;
2709
- /**
2710
- * 实时位置共享配置,web 端无需处理
2711
- */
2712
- location: null | string;
2713
- /**
2714
- * 实时日志上传开关
2715
- * @todo 需确认有效值及作用
2716
- */
2717
- monitor: number;
2718
- /**
2719
- * 是否允许加入多聊天室开关
2720
- */
2721
- joinMChrm: boolean;
2722
- /**
2723
- * 是否开启公众号功能:`0` 为未开启,`1` 为已开启
2724
- */
2725
- openMp: 0 | 1;
2726
- /**
2727
- * 是否开启用户级配置,若开启,需连接成功后立即拉取实时配置,0 | 1
2728
- * @description
2729
- * 配置来源:
2730
- * 1. 导航
2731
- * 2. 服务端实时下发
2732
- * 已有配置字段:
2733
- * 1. Lan. 推送使用的语言设置,用户端可自定义修改. Web 端未做设置, 只做接收
2734
- * 2. ShPushSwit. 推送是否显示详情设置,用户端可自定义修改. Web 端未做设置, 只做接收
2735
- * 3. MobPushSwit: Web/PC 在线,移动端不在线是否发送推送开关,用户端可自定义修改. Web 端未做设置, 只做接收
2736
- * 4. OffMsgDur: 离线消息保存天数,设置天数不可大于App级对应配置,用户端可自定义修改. Web 端未做设置, 只做接收
2737
- * 5. VoipInfo: 音视频相关配置,用户端不可自定义修改. 由服务端决定,与导航下发格式一致
2738
- * @todo 需确认公有云与私有云区别
2739
- */
2740
- openUS: 0 | 1;
2741
- /**
2742
- * 超级群功能开关,1表示开
2743
- */
2744
- ugMsg?: 0 | 1;
2745
- /**
2746
- * 群离线消息最大下发条数,`0` 为关闭
2747
- * @description 公有云独有配合
2748
- */
2749
- grpMsgLimit: number;
2750
- /**
2751
- * 消息加密开关,0 为关闭
2752
- * @todo
2753
- * 1. 确定其控制的功能
2754
- * 2. 确定 web 相关性
2755
- */
2756
- isFormatted: number;
2757
- /**
2758
- * GIF 动图大小限制,默认 2048 KB
2759
- */
2760
- gifSize: number;
2761
- /**
2762
- * 上传小视频时长限制,单位:秒
2763
- * @description 公有云字段,即私有云配置中的 `uploadVideoTimeLimit`
2764
- */
2765
- videoTimes?: number;
2766
- /**
2767
- * 上传小视频时长限制,单位:秒
2768
- * @description 私有云字段,即公有云配置中的 `videoTimes`
2769
- */
2770
- uploadVideoTimeLimit?: number;
2771
- /**
2772
- * 实时日志上传开关:`0` 为关闭,`1` 为开启
2773
- */
2774
- logSwitch: number;
2775
- /**
2776
- * 实时日志上传策略,值为 JSON 字符串
2777
- * @example `'{
2778
- * "url": "logcollection.ronghub.com", // 上传地址
2779
- * "level": 1, // 日志等级
2780
- * "itv": 6, // 上传频率,即时间间隔,单位 s
2781
- * "times": 5 // 重试次数?
2782
- * }'`
2783
- */
2784
- logPolicy: string;
2785
- /**
2786
- * 百度 BOS 存储服务地址
2787
- * @description 公有云独有配置
2788
- * @example `gz.bcebos.com`
2789
- */
2790
- bosAddr?: string;
2791
- /**
2792
- * 阿里上传配置,字符串数组,数组顺序代表 七牛、百度、阿里云 上传权重
2793
- * @example
2794
- * ```
2795
- * `[{"qiniu":"upload.qiniup.com","p":"1"},
2796
- * {"baidu":"gz.bcebos.com","p":"2"},
2797
- * {"aliyun":"oss-cn-beijing.aliyuncs.com","p":"3"}]`
2798
- * ```
2799
- */
2800
- ossConfig?: string;
2801
- /**
2802
- * 私有云专有属性,可用来判断当前环境是公有云还是私有云,私有云环境下该值为 `1`
2803
- */
2804
- type?: number;
2805
- /**
2806
- * @deprecated 已废弃
2807
- */
2808
- compDays: number;
2809
- /**
2810
- * @deprecated 已废弃
2811
- */
2812
- msgAck: unknown;
2813
- /**
2814
- * @deprecated 已废弃
2815
- */
2816
- activeServer: string;
2817
- /**
2818
- * @deprecated 已废弃
2819
- */
2820
- qnAddr: string;
2821
- /**
2822
- * @deprecated 已废弃
2823
- */
2824
- extkitSwitch: number;
2825
- /**
2826
- * @deprecated 已废弃
2827
- */
2828
- alone: boolean;
2829
- /**
2830
- * @deprecated 已废弃
2831
- */
2832
- voipServer: string;
2833
- /**
2834
- * 离线日志上报地址
2835
- * @deprecated 已废弃
2836
- */
2837
- offlinelogserver: string;
2838
- /**
2839
- * 在线日志上报地址
2840
- * @deprecated 已废弃
2841
- */
2842
- onlinelogserver?: string;
2843
- /**
2844
- * 链路加密字段,内容为 JSON 字符串,仅限 C++ 可用
2845
- */
2846
- crypto?: string;
2847
- /**
2848
- * 群组回执开关, 1: 打开,0(或者没有): 关闭
2849
- */
2850
- grpRRVer?: number;
2851
- /**
2852
- * 防黑产开关, 1: 打开,0:关闭
2853
- */
2854
- openAnti?: number;
2855
- /**
2856
- * 鉴权认证
2857
- */
2858
- jwt?: string;
2859
- }
2860
-
2861
- /**
2862
- * @category Interface
2863
- */
2864
- interface IChatroomEntryListenerData {
2865
- /**
2866
- * 更新的键
2867
- */
2868
- key: string;
2869
- /**
2870
- * 更新的值
2871
- */
2872
- value: string;
2873
- /**
2874
- * 更新的时间
2875
- */
2876
- timestamp: number;
2877
- /**
2878
- * 更新的聊天室 ID
2879
- */
2880
- chatroomId: string;
2881
- /**
2882
- * 更新类型
2883
- */
2884
- type: ChatroomEntryType;
2885
- }
2886
- /**
2887
- * @category Interface
2888
- */
2889
- interface IChatroomRejoinedFailed {
2890
- /**
2891
- * 自动重新加入的聊天室 ID
2892
- */
2893
- chatroomId: string;
2894
- /**
2895
- * 自动重新加入失败的 code
2896
- */
2897
- errorCode: number;
2898
- }
2899
- /**
2900
- * @category Interface
2901
- */
2902
- interface IChatroomRejoinedSuccessed {
2903
- /**
2904
- * 自动重新加入的聊天室 ID
2905
- */
2906
- chatroomId: string;
2907
- /**
2908
- * 自动重新加入的聊天室拉取消息的数量
2909
- */
2910
- count: number;
2911
- }
2912
- /**
2913
- * @category Interface
2914
- */
2915
- interface IChatroomUserChangeInfo {
2916
- users: {
2917
- [userId: string]: ChatroomUserChangeType;
2918
- };
2919
- chatroomId: string;
2920
- }
2921
- declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
2922
- /**
2923
- * 聊天室信息
2924
- * @category Interface
2925
- */
2926
- interface IChatroomListenerData {
2927
- /**
2928
- * SDK 内部重连聊天室信息
2929
- */
2930
- rejoinedRoom?: IChatroomRejoinedInfo;
2568
+ * SDK 内部重连聊天室信息
2569
+ */
2570
+ rejoinedRoom?: IChatroomRejoinedInfo;
2931
2571
  /**
2932
2572
  * 监听到的聊天室 KV 更新
2933
2573
  */
@@ -3221,6 +2861,16 @@ interface IConnectResult {
3221
2861
  userId?: string;
3222
2862
  }
3223
2863
 
2864
+ /**
2865
+ * 代理信息
2866
+ */
2867
+ interface IProxy {
2868
+ socksHost: string;
2869
+ socksPort: number;
2870
+ socksUsername?: string;
2871
+ socksPassword?: string;
2872
+ }
2873
+
3224
2874
  declare enum HttpMethod {
3225
2875
  GET = "GET",
3226
2876
  POST = "POST"
@@ -3256,6 +2906,10 @@ interface IRequest {
3256
2906
  * 期望返回的数据格式,如果为 json 则返回后会对返回的数据进行一次 JSON.parse
3257
2907
  */
3258
2908
  dataType?: 'json' | 'text' | 'base64' | 'arraybuffer';
2909
+ /**
2910
+ * socks5 代理参数,仅 Electron 平台有效,web 平台默认为 null
2911
+ */
2912
+ proxy?: IProxy | null;
3259
2913
  }
3260
2914
  interface IStorage {
3261
2915
  setItem(key: string, value: string): void;
@@ -3289,83 +2943,411 @@ interface IWebSocket {
3289
2943
  * 监听连接关闭事件
3290
2944
  * @param callback
3291
2945
  */
3292
- onClose(callback: (code?: number, reason?: string) => void): void;
2946
+ onClose(callback: (code?: number, reason?: string) => void): void;
2947
+ /**
2948
+ * 监听接收服务器消息事件
2949
+ * @param callback
2950
+ */
2951
+ onMessage(callback: (data: string | ArrayBuffer) => void): void;
2952
+ /**
2953
+ * 监听链接错误事件
2954
+ * @param callback
2955
+ */
2956
+ onError(callback: (error: unknown) => void): void;
2957
+ /**
2958
+ * 向服务器发送数据
2959
+ * @param data
2960
+ */
2961
+ send(data: ArrayBuffer | string): void;
2962
+ /**
2963
+ * 关闭连接
2964
+ * @param code
2965
+ * @param reason
2966
+ */
2967
+ close(code?: number, reason?: string): void;
2968
+ }
2969
+ /**
2970
+ * 平台运行时抽象
2971
+ */
2972
+ interface IRuntime {
2973
+ /**
2974
+ * 平台标识
2975
+ */
2976
+ tag: string;
2977
+ /**
2978
+ * 发送 http 请求
2979
+ * @param options
2980
+ */
2981
+ httpReq(options: IRequest): Promise<IResponse>;
2982
+ /**
2983
+ * 是否使用导航
2984
+ */
2985
+ useNavi: boolean;
2986
+ /**
2987
+ * websocket 地址上附加的平台字段
2988
+ */
2989
+ connectPlatform: string;
2990
+ /**
2991
+ * websocket 地址上 apiVer 字段,代表代码是否来源于 uniapp
2992
+ */
2993
+ isFromUniapp: boolean;
2994
+ /**
2995
+ * 创建长连接实例
2996
+ */
2997
+ createWebSocket(url: string, protocols?: string[]): IWebSocket;
2998
+ /**
2999
+ * 存储模块
3000
+ */
3001
+ localStorage: IStorage;
3002
+ /**
3003
+ * 在某些非浏览器平台,其等同于 localStorage
3004
+ */
3005
+ sessionStorage: IStorage;
3006
+ /**
3007
+ * 获取网络状态
3008
+ * 2g 3g 4g wifi unkown
3009
+ */
3010
+ getNetworkType(): Promise<NetworkType>;
3011
+ }
3012
+
3013
+ /**
3014
+ * 拓展方法定义,便于 electron-solution 实现时保持接口类型推导可用
3015
+ */
3016
+ interface IExtraMethod {
3017
+ getConversationsByPage(conversationTypes: ConversationType[], sentTime: number, count: number, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
3018
+ getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: 0 | 1, tag: string): Promise<IAsyncRes<{
3019
+ list: IReceivedMessage[];
3020
+ hasMore: boolean;
3021
+ }>>;
3022
+ updateMessageReceiptStatus(conersationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<boolean>>;
3023
+ }
3024
+
3025
+ /**
3026
+ * 导航信息数据就结构
3027
+ */
3028
+ interface INaviInfo {
3029
+ /**
3030
+ * Navi 数据请求响应码,200 为成功请求
3031
+ */
3032
+ code: number;
3033
+ /**
3034
+ * 获取 Navi 数据失败时的提示信息
3035
+ */
3036
+ errorMessage?: string;
3037
+ /**
3038
+ * 获取 Navi 数据失败时的请求 url 信息
3039
+ */
3040
+ url?: string;
3041
+ /**
3042
+ * 请求导航数据时使用的协议:http / https
3043
+ * @description 该字段为 SDK 内增加的字段,导航接口数据中不存在
3044
+ */
3045
+ protocol: 'http' | 'https';
3046
+ /**
3047
+ * 获取导航时使用的 userId,小程序不走导航,故拿不到 userId
3048
+ */
3049
+ userId?: string;
3050
+ /**
3051
+ * CMP 服务 Websocket 连接地址,包含域名与端口,不含 ws 或 wss 协议头
3052
+ * @example a.domain.com:443
3053
+ */
3054
+ server: string;
3055
+ /**
3056
+ * 备用 CMP 服务地址,包含域名与端口,不含 ws 或 wss 协议头,多个备用地址以 ',' 分割
3057
+ * @example a.domain.com:443,b.domain.com:443
3058
+ */
3059
+ backupServer?: string;
3060
+ /**
3061
+ * 备用 CMP 服务地址,POST 请求 TCP 连接返回的是 bs 字段,非 backupServer 字段
3062
+ */
3063
+ bs?: string;
3064
+ /**
3065
+ * RTC 服务配置,其值可能为 null、无效字符串、有效 JSON 字符串
3066
+ * 1. 公有云未开通音视频时,值为 null
3067
+ * 2. 私有云无配置时为 `{ "strategy": 0 }`
3068
+ */
3069
+ voipCallInfo: string | null;
3070
+ /**
3071
+ * 聊天室 kv 存储开关
3072
+ * @todo 需确认详细有效值
3073
+ * @description 公有云独有配置
3074
+ */
3075
+ kvStorage: number;
3076
+ /**
3077
+ * HttpDNS 功能开关,在 web 端无效
3078
+ * @description 公有云独有配置
3079
+ */
3080
+ openHttpDNS: boolean;
3081
+ /**
3082
+ * 历史消息云存储功能开关
3083
+ * @description
3084
+ * 1. 公有云通过 `developer.rongcloud.cn` 管理后台 `单群聊消息云端存储` 功能开关进行配置
3085
+ * 2. 私有云默认为 `true`
3086
+ */
3087
+ historyMsg: boolean;
3088
+ /**
3089
+ * 聊天室历史消息开关
3090
+ * @description
3091
+ * 1. 私有云对聊天室功能支持有限,默认为 `false`
3092
+ * 2. TODO: 公有云配置待确认
3093
+ */
3094
+ chatroomMsg: boolean;
3095
+ /**
3096
+ * 文件服务器地址
3097
+ * @description
3098
+ * 1. 公有云下,该地址为七牛云服务器地址
3099
+ * 2. 私有云下,该地址为私有云自研文件服务器地址
3100
+ */
3101
+ uploadServer: string;
3102
+ /**
3103
+ * 实时位置共享配置,web 端无需处理
3104
+ */
3105
+ location: null | string;
3106
+ /**
3107
+ * 实时日志上传开关
3108
+ * @todo 需确认有效值及作用
3109
+ */
3110
+ monitor: number;
3111
+ /**
3112
+ * 是否允许加入多聊天室开关
3113
+ */
3114
+ joinMChrm: boolean;
3115
+ /**
3116
+ * 是否开启公众号功能:`0` 为未开启,`1` 为已开启
3117
+ */
3118
+ openMp: 0 | 1;
3119
+ /**
3120
+ * 是否开启用户级配置,若开启,需连接成功后立即拉取实时配置,0 | 1
3121
+ * @description
3122
+ * 配置来源:
3123
+ * 1. 导航
3124
+ * 2. 服务端实时下发
3125
+ * 已有配置字段:
3126
+ * 1. Lan. 推送使用的语言设置,用户端可自定义修改. Web 端未做设置, 只做接收
3127
+ * 2. ShPushSwit. 推送是否显示详情设置,用户端可自定义修改. Web 端未做设置, 只做接收
3128
+ * 3. MobPushSwit: Web/PC 在线,移动端不在线是否发送推送开关,用户端可自定义修改. Web 端未做设置, 只做接收
3129
+ * 4. OffMsgDur: 离线消息保存天数,设置天数不可大于App级对应配置,用户端可自定义修改. Web 端未做设置, 只做接收
3130
+ * 5. VoipInfo: 音视频相关配置,用户端不可自定义修改. 由服务端决定,与导航下发格式一致
3131
+ * @todo 需确认公有云与私有云区别
3132
+ */
3133
+ openUS: 0 | 1;
3134
+ /**
3135
+ * 超级群功能开关,1表示开
3136
+ */
3137
+ ugMsg?: 0 | 1;
3138
+ /**
3139
+ * 群离线消息最大下发条数,`0` 为关闭
3140
+ * @description 公有云独有配合
3141
+ */
3142
+ grpMsgLimit: number;
3143
+ /**
3144
+ * 消息加密开关,0 为关闭
3145
+ * @todo
3146
+ * 1. 确定其控制的功能
3147
+ * 2. 确定 web 相关性
3148
+ */
3149
+ isFormatted: number;
3150
+ /**
3151
+ * GIF 动图大小限制,默认 2048 KB
3152
+ */
3153
+ gifSize: number;
3154
+ /**
3155
+ * 上传小视频时长限制,单位:秒
3156
+ * @description 公有云字段,即私有云配置中的 `uploadVideoTimeLimit`
3157
+ */
3158
+ videoTimes?: number;
3159
+ /**
3160
+ * 上传小视频时长限制,单位:秒
3161
+ * @description 私有云字段,即公有云配置中的 `videoTimes`
3162
+ */
3163
+ uploadVideoTimeLimit?: number;
3164
+ /**
3165
+ * 实时日志上传开关:`0` 为关闭,`1` 为开启
3166
+ */
3167
+ logSwitch: number;
3168
+ /**
3169
+ * 实时日志上传策略,值为 JSON 字符串
3170
+ * @example `'{
3171
+ * "url": "logcollection.ronghub.com", // 上传地址
3172
+ * "level": 1, // 日志等级
3173
+ * "itv": 6, // 上传频率,即时间间隔,单位 s
3174
+ * "times": 5 // 重试次数?
3175
+ * }'`
3176
+ */
3177
+ logPolicy: string;
3178
+ /**
3179
+ * 百度 BOS 存储服务地址
3180
+ * @description 公有云独有配置
3181
+ * @example `gz.bcebos.com`
3182
+ */
3183
+ bosAddr?: string;
3184
+ /**
3185
+ * 阿里上传配置,字符串数组,数组顺序代表 七牛、百度、阿里云 上传权重
3186
+ * @example
3187
+ * ```
3188
+ * `[{"qiniu":"upload.qiniup.com","p":"1"},
3189
+ * {"baidu":"gz.bcebos.com","p":"2"},
3190
+ * {"aliyun":"oss-cn-beijing.aliyuncs.com","p":"3"}]`
3191
+ * ```
3192
+ */
3193
+ ossConfig?: string;
3194
+ /**
3195
+ * 私有云专有属性,可用来判断当前环境是公有云还是私有云,私有云环境下该值为 `1`
3196
+ */
3197
+ type?: number;
3198
+ /**
3199
+ * @deprecated 已废弃
3200
+ */
3201
+ compDays: number;
3202
+ /**
3203
+ * @deprecated 已废弃
3204
+ */
3205
+ msgAck: unknown;
3206
+ /**
3207
+ * @deprecated 已废弃
3208
+ */
3209
+ activeServer: string;
3210
+ /**
3211
+ * @deprecated 已废弃
3212
+ */
3213
+ qnAddr: string;
3214
+ /**
3215
+ * @deprecated 已废弃
3216
+ */
3217
+ extkitSwitch: number;
3218
+ /**
3219
+ * @deprecated 已废弃
3220
+ */
3221
+ alone: boolean;
3222
+ /**
3223
+ * @deprecated 已废弃
3224
+ */
3225
+ voipServer: string;
3226
+ /**
3227
+ * 离线日志上报地址
3228
+ * @deprecated 已废弃
3229
+ */
3230
+ offlinelogserver: string;
3231
+ /**
3232
+ * 在线日志上报地址
3233
+ * @deprecated 已废弃
3234
+ */
3235
+ onlinelogserver?: string;
3293
3236
  /**
3294
- * 监听接收服务器消息事件
3295
- * @param callback
3237
+ * 链路加密字段,内容为 JSON 字符串,仅限 C++ 可用
3296
3238
  */
3297
- onMessage(callback: (data: string | ArrayBuffer) => void): void;
3239
+ crypto?: string;
3298
3240
  /**
3299
- * 监听链接错误事件
3300
- * @param callback
3241
+ * 群组回执开关, 1: 打开,0(或者没有): 关闭
3301
3242
  */
3302
- onError(callback: (error: unknown) => void): void;
3243
+ grpRRVer?: number;
3303
3244
  /**
3304
- * 向服务器发送数据
3305
- * @param data
3245
+ * 防黑产开关, 1: 打开,0:关闭
3306
3246
  */
3307
- send(data: ArrayBuffer | string): void;
3247
+ openAnti?: number;
3308
3248
  /**
3309
- * 关闭连接
3310
- * @param code
3311
- * @param reason
3249
+ * 鉴权认证
3312
3250
  */
3313
- close(code?: number, reason?: string): void;
3251
+ jwt?: string;
3314
3252
  }
3253
+
3254
+ declare type INaviCache = {
3255
+ token: string;
3256
+ naviInfo: INaviInfo;
3257
+ timestamp: number;
3258
+ };
3315
3259
  /**
3316
- * 平台运行时抽象
3260
+ * 导航数据管理类,负责管理导航有效期、导航请求、导航缓存
3317
3261
  */
3318
- interface IRuntime {
3262
+ declare abstract class BasicNavi {
3263
+ protected readonly appkey: string;
3264
+ protected readonly logger: BasicLogger;
3319
3265
  /**
3320
- * 平台标识
3266
+ * 业务层的自定义导航配置
3321
3267
  */
3322
- tag: string;
3268
+ protected readonly navigators: string[];
3269
+ constructor(appkey: string, logger: BasicLogger,
3323
3270
  /**
3324
- * 发送 http 请求
3325
- * @param options
3271
+ * 业务层的自定义导航配置
3326
3272
  */
3327
- httpReq(options: IRequest): Promise<IResponse>;
3273
+ navigators: string[]);
3328
3274
  /**
3329
- * 是否使用导航
3275
+ * 当前进行中的导航请求
3330
3276
  */
3331
- useNavi: boolean;
3277
+ private crtRequest;
3332
3278
  /**
3333
- * websocket 地址上附加的平台字段
3279
+ * 请求导航数据
3280
+ * @param token
3281
+ * @param ignoreCache 是否忽略缓存,强制从服务器重新拉取。
3282
+ * @param ignoreExpire 是否忽略有效期检查。理论上只需要在建立连接时需要检测 navi 有效期,其他场景无需检测
3283
+ * @param traceId 事务日志跟踪 ID
3334
3284
  */
3335
- connectPlatform: string;
3285
+ request(token: string, ignoreCache: boolean, ignoreExpire: boolean, traceId: string): IPromiseResult<INaviInfo>;
3286
+ private sendRequest;
3336
3287
  /**
3337
- * websocket 地址上 apiVer 字段,代表代码是否来源于 uniapp
3288
+ * 从指定服务列表中顺序尝试获取导航
3289
+ * @param uris 导航服务列表
3290
+ * @param token
3291
+ * @param traceId
3338
3292
  */
3339
- isFromUniapp: boolean;
3293
+ private requestHandler;
3340
3294
  /**
3341
- * 创建长连接实例
3295
+ * 向目标导航服务发送请求
3296
+ * @param uri 导航服务地址
3297
+ * @param appkey
3298
+ * @param token
3299
+ * @param version
3300
+ * @param timeout 请求超时时间
3301
+ * @param traceId
3342
3302
  */
3343
- createWebSocket?(url: string, protocols?: string[]): IWebSocket;
3303
+ protected abstract httpRequest(uri: string, appkey: string, token: string, version: string, timeout: number, traceId: string): IPromiseResult<INaviInfo>;
3344
3304
  /**
3345
- * 存储模块
3305
+ * 转换 Navi 接口 HTTP 请求状态码为 ErrorCode 定义
3306
+ * @param code
3346
3307
  */
3347
- localStorage: IStorage;
3308
+ protected transHttpCode(code: number): ErrorCode;
3348
3309
  /**
3349
- * 在某些非浏览器平台,其等同于 localStorage
3310
+ * 设置缓存
3311
+ * @param formatedToken
3312
+ * @param naviInfo
3313
+ * @description 设置缓存的同时会检测缓存中的既有数据,适当清理,避免无效数据长时间占用存储空间
3350
3314
  */
3351
- sessionStorage: IStorage;
3315
+ protected abstract setNaviCache(formatedToken: string, naviInfo: INaviInfo): void;
3352
3316
  /**
3353
- * 获取网络状态
3354
- * 2g 3g 4g wifi unkown
3317
+ * 获取缓存数据
3318
+ * @param formatedToken
3355
3319
  */
3356
- getNetworkType(): Promise<NetworkType>;
3320
+ protected abstract getNaviCache(formatedToken: string): INaviCache | null;
3321
+ /**
3322
+ * 获取缓存的导航信息
3323
+ * @param token
3324
+ */
3325
+ getNaviInfoFromCache(token: string): INaviInfo | null;
3326
+ /**
3327
+ * RTC 配置变更,更新 navi 缓存
3328
+ * @param token
3329
+ * @param voipCallInfo
3330
+ */
3331
+ updateVoipCallInfo(token: string, voipCallInfo: string): void;
3357
3332
  }
3358
3333
 
3359
3334
  /**
3360
- * 拓展方法定义,便于 electron-solution 实现时保持接口类型推导可用
3335
+ * Websocket 导航工具类
3361
3336
  */
3362
- interface IExtraMethod {
3363
- getConversationsByPage(conversationTypes: ConversationType[], sentTime: number, count: number, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
3364
- getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: 0 | 1, tag: string): Promise<IAsyncRes<{
3365
- list: IReceivedMessage[];
3366
- hasMore: boolean;
3367
- }>>;
3368
- updateMessageReceiptStatus(conersationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<boolean>>;
3337
+ declare class WebSocketNavi extends BasicNavi {
3338
+ private runtime;
3339
+ /**
3340
+ * 小程序平台服务地址,多个地址以 ',' 分割
3341
+ */
3342
+ private readonly miniCmpUris;
3343
+ constructor(appkey: string, logger: BasicLogger, runtime: IRuntime,
3344
+ /**
3345
+ * 小程序平台服务地址,多个地址以 ',' 分割
3346
+ */
3347
+ miniCmpUris: string, navigators?: string[]);
3348
+ protected httpRequest(uri: string, appkey: string, token: string, version: string, timeout: number, traceId: string): IPromiseResult<INaviInfo>;
3349
+ protected getNaviCache(formatedToken: string): INaviCache | null;
3350
+ protected setNaviCache(formatedToken: string, naviInfo: INaviInfo): void;
3369
3351
  }
3370
3352
 
3371
3353
  /**
@@ -3459,17 +3441,216 @@ interface IProcessInfo {
3459
3441
  }
3460
3442
 
3461
3443
  /**
3462
- * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
3444
+ * 连接状态定义枚举值
3463
3445
  */
3464
- interface IEngine {
3446
+ declare enum RCConnectionStatus {
3447
+ /**
3448
+ * 已连接
3449
+ */
3450
+ CONNECTED = 0,
3451
+ /**
3452
+ * 连接中
3453
+ */
3454
+ CONNECTING = 1,
3455
+ /**
3456
+ * 无连接,或已断开
3457
+ */
3458
+ DISCONNECTED = 2,
3459
+ /**
3460
+ * 连接暂停状态,SDK 内部 5s 后会自动尝试重连
3461
+ */
3462
+ SUSPENDED = 3
3463
+ }
3464
+ interface IConnectionListener {
3465
+ /**
3466
+ * 连接成功
3467
+ */
3468
+ onConnected(): void;
3469
+ /**
3470
+ * 连接中止,SDK 内部会进行重连
3471
+ * @param code 中止原因
3472
+ */
3473
+ onSuspend(code: ErrorCode): void;
3474
+ /**
3475
+ * 连接中
3476
+ */
3477
+ onConnecting(): void;
3478
+ /**
3479
+ * 连接已终止
3480
+ * @param code 连接终止原因
3481
+ */
3482
+ onDisconnected(code: ErrorCode): void;
3483
+ }
3484
+ /**
3485
+ * 抽象连接管理器类,负责 engine 层的连接状态维持,和对外的连接状态通知
3486
+ */
3487
+ declare abstract class AConnectionMgr {
3488
+ protected readonly appkey: string;
3489
+ private navi;
3490
+ protected logger: BasicLogger;
3491
+ private listener;
3492
+ constructor(appkey: string, navi: BasicNavi, logger: BasicLogger, listener: IConnectionListener);
3493
+ /**
3494
+ * 当前连接所用 token
3495
+ */
3496
+ private token;
3497
+ /**
3498
+ * 获取当前连接中使用的 token
3499
+ * @returns
3500
+ */
3501
+ getToken(): string;
3502
+ private reconnectKick;
3503
+ /**
3504
+ * 当前连接状态
3505
+ */
3506
+ private _crtConnectionStatus;
3507
+ /**
3508
+ * 当前用户 ID
3509
+ */
3510
+ protected _crtUserId: string;
3511
+ /**
3512
+ * 获取当前用户 ID
3513
+ * @returns
3514
+ */
3515
+ getCurrentUserId(): string;
3516
+ /**
3517
+ * 修改连接状态
3518
+ * @param status
3519
+ * @param code
3520
+ */
3521
+ private setConnectionStatus;
3522
+ /**
3523
+ * 获取当前连接状态
3524
+ * @returns
3525
+ */
3526
+ getConnectionStatus(): RCConnectionStatus;
3465
3527
  /**
3466
3528
  * 建立连接
3467
3529
  * @param token
3530
+ * @param reconnectKickEnable 设置断线重连时是否踢出当前正在重连的设备 (仅 Electron 环境有效)
3531
+ * 同一个账号在一台新设备上登录的时候,会把这个账号在之前登录的设备上踢出。
3532
+ * 由于 SDK 有断线重连功能,存在下面情况。
3533
+ * 用户在 A 设备登录,A 设备网络不稳定,没有连接成功,SDK 启动重连机制。
3534
+ * 用户此时又在 B 设备登录,B 设备连接成功。
3535
+ * A 设备网络稳定之后,用户在 A 设备连接成功,B 设备被踢出。
3536
+ * 这个字段就是为这种情况加的。
3537
+ * 设置 reconnectKickEnable 为 true 时,SDK 重连的时候发现此时已有别的设备连接成功,不再强行踢出已有设备,而是踢出重连设备。
3538
+ */
3539
+ connect(token: string, reconnectKickEnable: boolean, traceId: string): IPromiseResult<string>;
3540
+ /**
3541
+ * 执行中的连接事务
3542
+ */
3543
+ private _crtConnectionTask;
3544
+ /**
3545
+ * 尝试建立连接
3546
+ * @param token
3547
+ * @param reconnectKickEnable
3548
+ * @param ignoreNaviCache
3549
+ * @param traceId
3550
+ * @description 函数会检测当前是否有进行中的连接任务,若存在,则直接返回当前连接任务
3551
+ */
3552
+ private try2Connect;
3553
+ /**
3554
+ * 创建连接任务
3555
+ * @param token
3556
+ * @param reconnectKickEnable
3557
+ * @param ignoreNaviCache
3558
+ * @param traceId
3559
+ * @returns
3560
+ */
3561
+ private createConnectionTask;
3562
+ private reconnectTimer;
3563
+ /**
3564
+ * 尝试重连
3565
+ * @param ignoreNaviCache 是否忽略 navi 缓存以重新请求 navi
3566
+ */
3567
+ private try2Reconnect;
3568
+ /**
3569
+ * 服务器主动断开时由子类调用,函数将根据 reason 确定是否尝试重连
3570
+ * @param reason
3571
+ */
3572
+ protected onDisconnectByServer(code: ErrorCode): void;
3573
+ /**
3574
+ * Socket 异常中断时由子类调用,SDK 尝试恢复重连
3575
+ */
3576
+ protected onDisconenctUnusual(code: ErrorCode): void;
3577
+ /**
3578
+ * 建立 Socket 连接,由子类集成实现
3579
+ * @param token
3468
3580
  * @param naviInfo
3469
3581
  * @param reconnectKickEnable
3582
+ * @param traceId
3583
+ */
3584
+ protected abstract connectWithToken(token: string, naviInfo: INaviInfo, reconnectKickEnable: boolean, traceId: string): IPromiseResult<string>;
3585
+ /**
3586
+ * 当前累计心跳超时次数
3587
+ */
3588
+ private _failedCount;
3589
+ /**
3590
+ * 允许连续 PING 超时次数,超出指定次数后会主动关闭 socket 并重新连接
3591
+ */
3592
+ private readonly ALLOW_FAILED_TIMES;
3593
+ /**
3594
+ * 启动心跳计时器
3595
+ */
3596
+ private checkAlive;
3597
+ /**
3598
+ * 关闭连接
3599
+ * @param inReconnect
3600
+ */
3601
+ protected abstract close(inReconnect: boolean, closeDB?: boolean): void;
3602
+ /**
3603
+ * 完成一次 ping 过程,并返回响应状态码
3604
+ * @param timeout 超时时间
3605
+ */
3606
+ protected abstract sendPing(timeout: number): Promise<ErrorCode>;
3607
+ /**
3608
+ * 业务层主动断开连接时调用
3609
+ */
3610
+ disconnect(closeDB?: boolean): Promise<void>;
3611
+ /**
3612
+ * 清理重连计时器
3613
+ */
3614
+ private stopReconnectTimer;
3615
+ }
3616
+
3617
+ /**
3618
+ * 查询错误码是否为服务下发的 disconnect 通知 status 所转换
3619
+ * @param code
3620
+ * @description 排除重定向 31006,因 disconnect 和 connAck 都包含元素可被转换为 31006
3621
+ */
3622
+ declare const isDisconnectCode: (code: ErrorCode) => boolean;
3623
+ /**
3624
+ * 查询错误码是否为服务下发的 connAck status 所转换
3625
+ * @param code
3626
+ * @description 排除重定向 31006,因 disconnect 和 connAck 都包含元素可被转换为 31006
3627
+ */
3628
+ declare const isConnnectAckCode: (code: ErrorCode) => boolean;
3629
+
3630
+ /**
3631
+ * 进程内缓存数据
3632
+ */
3633
+ interface IProcessCache {
3634
+ crtUserId: string;
3635
+ connectedTime: number;
3636
+ naviInfo: INaviInfo | null;
3637
+ connectionStatus: RCConnectionStatus;
3638
+ deviceId: string;
3639
+ }
3640
+ /**
3641
+ * 约束主进程 CppEngine 与 CppService 间的方法定义,以便于代码检查
3642
+ */
3643
+ interface IEngine {
3644
+ /**
3645
+ * 注册本渲染进程至主进程,以接收主进程的消息通知,同时同步主进程的当前缓存数据
3646
+ */
3647
+ getMainProcessCache(): IProcessCache;
3648
+ /**
3649
+ * 建立连接
3650
+ * @param token
3651
+ * @param reconnectKickEnable
3470
3652
  */
3471
- connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
3472
- requestNaviInfo(uris: string[], appkey: string, token: string, checkCA?: boolean): Promise<INaviInfo | null>;
3653
+ connect(token: string, reconnectKickEnable: boolean, traceId: string): IPromiseResult<string>;
3473
3654
  getNaviInfoFromCache(): INaviInfo | null;
3474
3655
  /**
3475
3656
  * 上报版本信息
@@ -3591,6 +3772,10 @@ interface IEngine {
3591
3772
  * 获取指定会话
3592
3773
  */
3593
3774
  getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
3775
+ /**
3776
+ * 获取未读会话列表
3777
+ */
3778
+ getUnreadConversationList(conversationTypes: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3594
3779
  /**
3595
3780
  * 删除会话
3596
3781
  * @description 该删除操作会删除服务器端存储的会话数据
@@ -3642,7 +3827,7 @@ interface IEngine {
3642
3827
  /**
3643
3828
  * 断开连接
3644
3829
  */
3645
- disconnect(): void;
3830
+ disconnect(closeDB?: boolean): void;
3646
3831
  /**
3647
3832
  * 拉取用户级配置数据
3648
3833
  */
@@ -3879,7 +4064,11 @@ interface IEngine {
3879
4064
  /**
3880
4065
  * 获取消息
3881
4066
  */
3882
- getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
4067
+ getMessage(messageId: number | string): IPromiseResult<IReceivedMessage>;
4068
+ /**
4069
+ * 设置消息附加信息
4070
+ */
4071
+ setTextMessageExtra(messageId: number, content: any): Promise<ErrorCode>;
3883
4072
  /**
3884
4073
  * 设置消息内容
3885
4074
  */
@@ -3951,7 +4140,7 @@ interface IEngine {
3951
4140
  /**
3952
4141
  * 无差别获取本地置顶列表
3953
4142
  */
3954
- getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
4143
+ getTopConversationList(conversationTypes?: ConversationType[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
3955
4144
  /**
3956
4145
  * 获取单个群聊会话 @ 消息未读数
3957
4146
  */
@@ -3969,6 +4158,18 @@ interface IEngine {
3969
4158
  * 获取应用主进程信息,仅限 Electron 平台可用
3970
4159
  */
3971
4160
  getMainProcessInfo(): IPromiseResult<IProcessInfo>;
4161
+ /**
4162
+ * 设置代理
4163
+ */
4164
+ setProxy(proxy: IProxy | null): IPromiseResult<IProxy>;
4165
+ /**
4166
+ * 获取代理
4167
+ */
4168
+ getProxy(): IPromiseResult<IProxy>;
4169
+ /**
4170
+ * 测试代理
4171
+ */
4172
+ testProxy(proxy: IProxy, testHost: string): Promise<IResponse>;
3972
4173
  rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<IAsyncRes<any>>;
3973
4174
  rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: any): Promise<{
3974
4175
  code: ErrorCode;
@@ -4202,65 +4403,49 @@ interface IEndRoomPKOptions {
4202
4403
  /**
4203
4404
  * 消息送达相关接口
4204
4405
  */
4406
+ /**
4407
+ * 送达的用户信息
4408
+ * @hidden
4409
+ */
4205
4410
  interface IDeliveredUser {
4206
4411
  time: number;
4207
4412
  userId: string;
4208
4413
  }
4414
+ /**
4415
+ * 获取群组消息送达的状态信息
4416
+ * @hidden
4417
+ */
4209
4418
  interface IGroupMessageDeliverInfo {
4210
4419
  totalCount: number;
4211
4420
  list: IDeliveredUser[];
4212
4421
  }
4422
+ /**
4423
+ * 单聊消息送达通知数据
4424
+ * @hidden
4425
+ */
4213
4426
  interface IMessageDeliver {
4214
4427
  deliverTime: number;
4215
4428
  messageUId: string;
4216
4429
  objectName: string;
4217
4430
  targetId: string;
4218
4431
  }
4432
+ /**
4433
+ * 群组消息送达通知数据信息
4434
+ * @hidden
4435
+ */
4219
4436
  interface IGroupMessageDeliveredStatusInfo {
4220
4437
  MessageUId: string;
4221
4438
  deliveryCount: number;
4222
4439
  }
4440
+ /**
4441
+ * 群组消息送达通知数据
4442
+ * @hidden
4443
+ */
4223
4444
  interface IGroupMessageDeliverStatus {
4224
4445
  totalCount: number;
4225
4446
  list: IGroupMessageDeliveredStatusInfo[];
4226
4447
  }
4227
4448
 
4228
- /**
4229
- * IndexDB中存储的log数据
4230
- */
4231
- interface ILogInfo {
4232
- sessionId: string;
4233
- time: number;
4234
- level: LogLevel;
4235
- content: string;
4236
- userId?: string;
4237
- logSource?: LogSource;
4238
- tagId?: LogTagId;
4239
- }
4240
- interface IRealTimeLog {
4241
- level: LogLevel;
4242
- content: string;
4243
- }
4244
- interface ILogExtensions {
4245
- traceId?: string;
4246
- logSource?: LogSource;
4247
- }
4248
- interface ILogInit {
4249
- userId?: string;
4250
- localLogLevel?: LogLevel;
4251
- customLogPrint?: (logLevel: LogLevel, msg: string) => void;
4252
- }
4253
- interface IInitBigDataOption {
4254
- runtime?: IRuntime;
4255
- appkey?: string;
4256
- version?: string;
4257
- userId?: string;
4258
- }
4259
- interface IBigdataLogInit extends IInitBigDataOption {
4260
- logUrl: string;
4261
- sessionId: string;
4262
- }
4263
-
4264
4449
  /**
4265
4450
  * 定义已废弃,请使用 `IRemoveChatroomEntries` 替换
4266
4451
  * @deprecated
@@ -4414,114 +4599,7 @@ declare const deInitLogDB: () => Promise<void>;
4414
4599
  * @param log
4415
4600
  * @returns
4416
4601
  */
4417
- declare const transcsv: (log: ILogData) => string;
4418
-
4419
- /**
4420
- * @description
4421
- * 读数据处理基类
4422
- */
4423
- declare class BaseReader {
4424
- readonly header: Header;
4425
- messageId: number;
4426
- timestamp: number;
4427
- syncMsg: boolean;
4428
- protected identifier: string;
4429
- constructor(header: Header);
4430
- getIdentifier(): string | number;
4431
- read(logger: ILogger, stream: RongStreamReader, length: number, protocolVer: ConnAckProtocolVer): void;
4432
- readMessage(logger: ILogger, stream: RongStreamReader, length?: number, protocolVer?: ConnAckProtocolVer): {
4433
- stream: RongStreamReader;
4434
- length: number | undefined;
4435
- };
4436
- }
4437
- /**
4438
- * @description
4439
- * 写数据处理基类
4440
- */
4441
- declare abstract class BaseWriter {
4442
- private _header;
4443
- lengthSize: number;
4444
- data: any;
4445
- messageId: number;
4446
- topic: string;
4447
- targetId: string;
4448
- identifier: string;
4449
- constructor(headerType: OperationType);
4450
- getIdentifier(): string | number;
4451
- write(stream: RongStreamWriter): void;
4452
- abstract writeMessage(stream: RongStreamWriter): void;
4453
- setHeaderQos(qos: number): void;
4454
- getHeaderFlag(): number;
4455
- getLengthSize(): number;
4456
- getBufferData(): Int8Array;
4457
- }
4458
- declare class RetryableReader extends BaseReader {
4459
- messageId: number;
4460
- readMessage(logger: ILogger, stream: RongStreamReader, length: number): {
4461
- stream: RongStreamReader;
4462
- length: number;
4463
- };
4464
- }
4465
- declare class RetryableWriter extends BaseWriter {
4466
- writeMessage(stream: RongStreamWriter): void;
4467
- }
4468
- declare class PublishReader extends RetryableReader {
4469
- topic: string;
4470
- data: any;
4471
- targetId: string;
4472
- date: any;
4473
- syncMsg: boolean;
4474
- identifier: string;
4475
- readMessage(logger: ILogger, stream: RongStreamReader, length: number): {
4476
- stream: RongStreamReader;
4477
- length: number;
4478
- };
4479
- }
4480
- /**
4481
- * @description
4482
- * 发消息使用
4483
- */
4484
- declare class PublishWriter extends RetryableWriter {
4485
- topic: string;
4486
- data: any;
4487
- targetId: string;
4488
- date: any;
4489
- syncMsg: boolean;
4490
- identifier: string;
4491
- constructor(topic: string, data: any, targetId: string);
4492
- writeMessage(stream: RongStreamWriter): void;
4493
- }
4494
- /**
4495
- * @description
4496
- * 发消息, Server 给的 Ack 回执
4497
- */
4498
- declare class PubAckReader extends RetryableReader {
4499
- status: number;
4500
- date: number;
4501
- data: any;
4502
- millisecond: number;
4503
- messageUId: string;
4504
- timestamp: number;
4505
- identifier: string;
4506
- topic: string;
4507
- targetId: string;
4508
- readMessage(logger: ILogger, stream: RongStreamReader, length: number): {
4509
- stream: RongStreamReader;
4510
- length: number;
4511
- };
4512
- }
4513
- /**
4514
- * @description
4515
- * Web 主动查询
4516
- */
4517
- declare class QueryWriter extends RetryableWriter {
4518
- topic: string;
4519
- data: any;
4520
- targetId: string;
4521
- identifier: string;
4522
- constructor(topic: string, data: any, targetId: string);
4523
- writeMessage(stream: RongStreamWriter): void;
4524
- }
4602
+ declare const transcsv: (log: ILogData) => string;
4525
4603
 
4526
4604
  /**
4527
4605
  * 会话属性
@@ -4598,26 +4676,12 @@ interface IServerUserSetting {
4598
4676
  };
4599
4677
  version: number;
4600
4678
  }
4601
- interface ISyncMsgArgs {
4602
- inboxTime: number;
4603
- sendboxTime: number;
4604
- broadcastSyncTime?: number;
4605
- }
4606
4679
  interface IGetMsgOption {
4607
4680
  timestamp?: number;
4608
4681
  count?: number;
4609
4682
  order?: number;
4610
4683
  channelId?: string;
4611
4684
  }
4612
- interface IGetConversationListOption {
4613
- type?: number;
4614
- count?: number;
4615
- startTime?: number;
4616
- order?: 0 | 1;
4617
- }
4618
- interface IClearMsgOption {
4619
- timestamp?: number;
4620
- }
4621
4685
 
4622
4686
  /**
4623
4687
  * TODO: 确定对外暴露的必要性
@@ -4633,362 +4697,9 @@ declare const DelayTimer: {
4633
4697
  getTime: () => number;
4634
4698
  };
4635
4699
 
4636
- /**
4637
- * 序列化、反序列化数据通道
4638
- */
4639
- declare class DataCodec {
4640
- private logger;
4641
- private _codec;
4642
- constructor(logger: BasicLogger);
4643
- private static createPBCodec;
4644
- /**
4645
- * PB 数据 转为 rmtp 数据 反序列化 通用数据
4646
- * 根据解析的 PBName 分配解码方法. 如果没有单独的解码方法定义. 直接返回 pb 解析后的结果
4647
- */
4648
- decodeByPBName(data: any, pbName: string, option?: any): any;
4649
- private _readBytes;
4650
- /**
4651
- * ====== 以下为 rmtp 数据 反序列化为 可用数据 ======
4652
- */
4653
- private _formatBytes;
4654
- /**
4655
- * 格式化多端同步消息
4656
- */
4657
- private _formatSyncMessages;
4658
- /**
4659
- * 格式化接收消息
4660
- */
4661
- private _formatReceivedMessage;
4662
- /**
4663
- * 格式化发送消息
4664
- */
4665
- private _formatSentMessage;
4666
- /**
4667
- * 格式化历史消息
4668
- */
4669
- private _formatHistoryMessages;
4670
- /**
4671
- * 格式化超级群消息变更列表
4672
- */
4673
- private _formatUltraMsgChangeList;
4674
- /**
4675
- * 格式化超级群消息变更列表
4676
- */
4677
- private _formatUltraOperateStatusNotifyList;
4678
- /**
4679
- * 格式化超级群变更后消息列表
4680
- */
4681
- private _formatUltraMsgList;
4682
- /**
4683
- * 格式化超级群获取指定会话未读 @ 消息列表
4684
- */
4685
- private _formatUltraGroupUnreadMentionedList;
4686
- /**
4687
- * 格式化会话列表
4688
- */
4689
- private _formatConversationList;
4690
- /**
4691
- * 格式化用户设置
4692
- */
4693
- private _formatSetUserSettingOutput;
4694
- /**
4695
- * 格式化聊天室信息
4696
- */
4697
- private _formatChatRoomInfos;
4698
- /**
4699
- * 格式化 聊天室 KV 列表
4700
- */
4701
- private _formatChatRoomKVList;
4702
- /**
4703
- * 格式化 用户设置
4704
- */
4705
- private _formatUserSetting;
4706
- /**
4707
- * 格式化 会话状态 置顶、免打扰
4708
- */
4709
- private _formatConversationStatus;
4710
- /**
4711
- * 格式化 获取已读列表
4712
- */
4713
- private _formatGrpReadReceiptQryResp;
4714
- /**
4715
- * 格式化用户配置通知
4716
- */
4717
- private _formatUserSettingNotification;
4718
- /**
4719
- * 拉取聊天室 kv 存储时的最新时间戳
4720
- */
4721
- private _formatChrmKVVersion;
4722
- /**
4723
- * 格式化加入 RTC 房间的用户信息
4724
- */
4725
- private _formatRTCJoinedUserInfo;
4726
- /**
4727
- * ===== 以下为通用数据 序列化为 PB 数据 =====
4728
- * Engine Index 调用处理数据
4729
- */
4730
- /**
4731
- * ? 待补全注释
4732
- */
4733
- encodeServerConfParams(): any[];
4734
- /**
4735
- * 上行消息基础配置
4736
- */
4737
- private _getUpMsgModule;
4738
- /**
4739
- * 序列化上行消息
4740
- */
4741
- encodeUpMsg(conversation: IConversationOption, option: ISendMsgOptions): any[];
4742
- /**
4743
- * 序列化拉取多端消息
4744
- */
4745
- encodeSyncMsg(syncMsgArgs: ISyncMsgArgs): any[];
4746
- /**
4747
- * 序列化拉取聊天室消息
4748
- */
4749
- encodeChrmSyncMsg(time: number, count: number): any[];
4750
- /**
4751
- * 序列化历史消息所需参数
4752
- */
4753
- encodeGetHistoryMsg(targetId: string, option: IGetMsgOption): any[];
4754
- /**
4755
- * 序列化同步超级群所需参数
4756
- */
4757
- encodeSuperSyncMsg(syncTime: number): any[];
4758
- /**
4759
- * 序列化会话列表
4760
- */
4761
- encodeGetConversationList(option: IGetConversationListOption): any[];
4762
- /**
4763
- * 旧会话列表. 获取、删除都调用此方法
4764
- */
4765
- encodeOldConversationList(option: IGetConversationListOption): any[];
4766
- /**
4767
- * 旧会话列表删除,支持多组织
4768
- */
4769
- encodeRemoveOldConversationList(conversation: IConversationOption): any[];
4770
- /**
4771
- * 旧会话列表删除
4772
- */
4773
- encodeRemoveConversationList(conversationList: IConversationOption[]): any[];
4774
- /**
4775
- * 批量删除消息通过消息 ID
4776
- */
4777
- encodeDeleteMessages(conversationType: ConversationType, targetId: string, list: {
4778
- messageUId: string;
4779
- sentTime: number;
4780
- messageDirection: MessageDirection;
4781
- }[], channelId: string): any[];
4782
- /**
4783
- * 批量删除消息通过时间
4784
- */
4785
- encodeClearMessages(targetId: string, timestamp: number, channelId: string, conversationType?: ConversationType): any[];
4786
- /**
4787
- * 未读数清除
4788
- */
4789
- encodeClearUnreadCount(conversation: IConversationOption, option: IClearMsgOption): any[];
4790
- /**
4791
- * 对已有的超级群消息扩展
4792
- */
4793
- encodeExpandUltraMessage(option: IUltraExMsgOptions, userId: string): any[];
4794
- /**
4795
- * 对已有的超级群消息扩展
4796
- */
4797
- encodemodifyMessage(option: IUltraModifyMsgOptions, userId: string): any[];
4798
- /**
4799
- * 超级群消息变更通知
4800
- */
4801
- encodeQueryMsgChange(time: number): any[];
4802
- /**
4803
- * 超级群消息变更通知
4804
- */
4805
- encodeMsgQuery(option: IUltraMsgQueryOptions): any[];
4806
- /**
4807
- * 序列化获取超级群获取指定会话未读 @ 消息列表参数
4808
- */
4809
- encodeUnreadMentionedMsgQuery(option: IUltraGroupUnreadMentionedOption): any[];
4810
- /**
4811
- * 正在输入中
4812
- */
4813
- encodeOperateStatus(targetId: string, conversationType: ConversationType, channelId: string, operationType: OperateStatus): any[];
4814
- /**
4815
- * 加入退出聊天室
4816
- */
4817
- encodeJoinOrQuitChatRoom(): any[];
4818
- /**
4819
- * 获取聊天室信息
4820
- * @param count 获取人数
4821
- * @param order 排序方式
4822
- */
4823
- encodeGetChatRoomInfo(count: number, order: number): any[];
4824
- /**
4825
- * 设置指定超级群默认通知配置
4826
- * @param notificationLevel
4827
- * * NotificationLevel
4828
- * @param channelId 超级群频道 Id
4829
- */
4830
- encodeSetUltraGroupDefaultNotificationLevel(notificationLevel: NotificationLevel, channelId: string): any;
4831
- /**
4832
- * 查询指定超级群默认通知配置
4833
- * @param channelId 频道 ID
4834
- */
4835
- encodeGetUltraGroupDefaultNotificationLevel(channelId: string): any;
4836
- /**
4837
- * 上传文件认证信息获取
4838
- */
4839
- encodeGetFileToken(fileType: number, fileName: string, httpMethod?: string, queryString?: string): any;
4840
- /**
4841
- * 获取七牛上传url
4842
- */
4843
- encodeGetFileUrl(inputPBName: string, fileType: number, fileName?: string, originName?: string): any;
4844
- /**
4845
- * 聊天室 KV 存储
4846
- */
4847
- encodeModifyChatRoomKV(chrmId: string, entry: IChrmKVEntry, currentUserId: string): any;
4848
- encodeModifyChatRoomKVS(chrmId: string, entryOptions: IChrmKVEntries, currentUserId: string): any;
4849
- /**
4850
- * KV 存储拉取
4851
- */
4852
- encodePullChatRoomKV(time: number): any;
4853
- /**
4854
- * 用户实时配置更新
4855
- */
4856
- encodePullUserSetting(version: number): any;
4857
- /**
4858
- * 获取会话状态 (置顶、免打扰)
4859
- */
4860
- encodeGetConversationStatus(time: number): any;
4861
- /**
4862
- * 设置会话状态 (置顶、免打扰)
4863
- */
4864
- encodeSetConversationStatus(statusList: Array<ISetConversationStatusOptions>, conversationUpdatedTime: number): any;
4865
- /**
4866
- * 序列化发送群组已读回执
4867
- */
4868
- encodeReadReceipt(messageUIds: string[], channelId?: string): any;
4869
- /**
4870
- * 序列化创建tag消息
4871
- */
4872
- encodeCreateTag(tags: Array<ITagParam>, version: number): any;
4873
- /**
4874
- * 序列化获取群组消息已读列表
4875
- */
4876
- encodeMessageReader(messageUId: string, channelId?: string): any;
4877
- /**
4878
- * 序列化删除tag消息
4879
- */
4880
- encodeRemoveTag(tagIds: Array<string>, version: number): any;
4881
- /**
4882
- * 解除会话标签关系
4883
- */
4884
- encodeDisConversationTag(tagIds: Array<string>): any;
4885
- /**
4886
- * 序列化更新会话标签
4887
- */
4888
- encodeUpdateConversationTag(tags: IConversationTag[], conversations: IConversationOption[]): any;
4889
- /**
4890
- * 序列号上报SDK信息
4891
- */
4892
- encodeReportSDKInfo(info: string): any;
4893
- /**
4894
- * 序列号超级群获取会话参数
4895
- */
4896
- encodeUltraGroup(syncTime: number, isEraseMsgContent: boolean): any;
4897
- /**
4898
- * 设置聊天室关联的rtc房间
4899
- */
4900
- encodebindRTCRoomForChatroom(options: IRTCRoomBindOption): any;
4901
- }
4902
-
4903
- interface IDataChannelWatcher {
4904
- /**
4905
- * 连接状态变更通知
4906
- */
4907
- status: (status: ConnectionStatus) => void;
4908
- /**
4909
- * 业务信令通知
4910
- * @params signal
4911
- * @params ack 当接收到的数据为多端同步消息时,ack 值为 PubAck,否则为 undefined
4912
- */
4913
- signal: (signal: PublishReader, ack?: PubAckReader) => void;
4914
- }
4915
- /**
4916
- * @todo 迁移中的 DataCodec 模块导致数据通道不够独立,与 xhr-polling 通信可能会有耦合,后续需解耦
4917
- * @description
4918
- * 1. 基于 WebSocket 协议建立数据通道,实现数据收发
4919
- * 2. 基于 Protobuf 进行数据编解码
4920
- */
4921
- declare class WebSocketChannel {
4922
- private _runtime;
4923
- private _watcher;
4924
- private logger;
4925
- readonly codec: DataCodec;
4926
- connectedTime: number;
4927
- userId: string;
4928
- sendConnectTime: number;
4929
- private _socket;
4930
- private _pingResolve?;
4931
- /**
4932
- * 本端发送消息时等待接收 PubAck 的 Promise.resolve 函数
4933
- */
4934
- private _messageIds;
4935
- /**
4936
- * 接收多端同步消息时,等待 PubAck 的 Promise.resolve 函数
4937
- */
4938
- private _syncMessageIds;
4939
- constructor(_runtime: IRuntime, _watcher: IDataChannelWatcher, logger: BasicLogger);
4940
- /**
4941
- * 建立连接,连接成功则返回 Websocket 实例,否则返回连接错误码
4942
- * @param appkey
4943
- * @param token
4944
- * @param hosts 服务器地址,不包含协议头,`hostname:port`
4945
- * @param protocol 请求导航数据时使用的网络协议, /ping 与 websocket 需要继续遵循该协议
4946
- * @param apiVersion 需符合 `/\d+(\.\d+){2}/` 规则,对于预发布版本号如 `3.1.0-alpha.1` 需认定为 `3.1.0`
4947
- * @param protocolVer
4948
- */
4949
- connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
4950
- /**
4951
- * 发起连接请求
4952
- */
4953
- private _connect;
4954
- /**
4955
- * 当前累计心跳超时次数
4956
- */
4957
- private _failedCount;
4958
- /**
4959
- * 允许连续 PING 超时次数,次数内不主动关闭连接
4960
- */
4961
- private readonly ALLOW_FAILED_TIMES;
4962
- /**
4963
- * ping定时器
4964
- */
4965
- private _timer;
4966
- private _checkAlive;
4967
- private _onReceiveSignal;
4968
- /**
4969
- * 只发送数据,无需响应
4970
- */
4971
- sendOnly(writer: BaseWriter): void;
4972
- /**
4973
- * 有效值 0 - 65535,超出 65535 位数超长溢出
4974
- */
4975
- private _idCount;
4976
- private _generateMessageId;
4977
- /**
4978
- * @param writer
4979
- * @param pbName 响应数据的 PB 定义
4980
- * @param timeout 超时配置,单位 ms
4981
- */
4982
- send<T>(writer: QueryWriter | PublishWriter, respPBName?: string, option?: any, timeout?: number): Promise<IAsyncRes<T>>;
4983
- /**
4984
- * 关闭数据通道,同时清空监听
4985
- */
4986
- close(): void;
4987
- }
4988
-
4989
4700
  declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
4990
4701
  declare type IMessagesListnenr = (messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean) => void;
4991
- declare type IConnectionStatusListener = (status: ConnectionStatus) => void;
4702
+ declare type IConnectionStatusListener = (status: RCConnectionStatus | ErrorCode | ConnectionStatus) => void;
4992
4703
  declare type IConversationStateListener = (conversation: IUpdatedConversation[]) => void;
4993
4704
  declare type IChatroomListener = (state: IChatroomListenerData) => void;
4994
4705
  declare type IRTCInnerListener = {
@@ -5005,12 +4716,18 @@ declare type IGroupMessageDeliveredStatusListener = (data: IGroupMessageDeliverS
5005
4716
  interface IWatcher {
5006
4717
  message?: IMessageListnenr;
5007
4718
  batchMessage?: IMessagesListnenr;
5008
- connectionState?: IConnectionStatusListener;
4719
+ /**
4720
+ * 连接状态变更监听
4721
+ * @param status 变更的连接状态
4722
+ * @param code 当连接状态为 `RCConnectionStatus.DISCONNECTED` 或 `RCConnectionStatus.SUSPEND` 时有值
4723
+ */
4724
+ connection?: (status: RCConnectionStatus, code?: ErrorCode) => void;
5009
4725
  conversationState?: IConversationStateListener;
5010
4726
  chatroomState?: IChatroomListener;
5011
4727
  expansion?: IExpansionListener;
5012
4728
  /**
5013
4729
  * 为兼容老版本 RTCLib 与 CallLib 接收消息的方式,新版本消息走插件机制
4730
+ * @deprecated
5014
4731
  */
5015
4732
  rtcInnerWatcher?: IRTCInnerListener;
5016
4733
  /**
@@ -5034,10 +4751,6 @@ interface IWatcher {
5034
4751
  * 群聊消息送达状态通知
5035
4752
  */
5036
4753
  groupMessageDeliveredStatus?: IGroupMessageDeliveredStatusListener;
5037
- onConnecting?: () => void;
5038
- onConnected?: () => void;
5039
- onDisconnect?: (status: ConnectionStatus) => void;
5040
- onSuspend?: (status: ConnectionStatus | ErrorCode) => void;
5041
4754
  readReceiptReceived?: (conversation: IConversationOption, messageUId: string, sentTime: number) => void;
5042
4755
  messageReceiptRequest?: (conversation: IConversationOption, messageUId: string, senderUserId: string) => void;
5043
4756
  messageReceiptResponse?: (conversation: IConversationOption, receivedUserId: string, messageUIdList: string[]) => void;
@@ -5059,10 +4772,6 @@ interface IAPIContextOption {
5059
4772
  * 应用 appkey
5060
4773
  */
5061
4774
  appkey: string;
5062
- /**
5063
- * IMLib 版本号
5064
- */
5065
- apiVersion: string;
5066
4775
  /**
5067
4776
  * 自定义导航地址:
5068
4777
  * 1. 私有云环境下该值为必填项
@@ -5082,10 +4791,6 @@ interface IAPIContextOption {
5082
4791
  * typing状态过期时间
5083
4792
  */
5084
4793
  typingExpireTime?: number;
5085
- /**
5086
- * 是否校验证书,默认为 true
5087
- */
5088
- checkCA?: boolean;
5089
4794
  /**
5090
4795
  * 开启后,SDK 内的 HTTP 请求将由 Electron 主进程内发送。
5091
4796
  * @since 5.6.0
@@ -5186,6 +4891,11 @@ declare class Codec<T> {
5186
4891
  * @param data 待解码数据
5187
4892
  */
5188
4893
  decode(pbname: string, uint8array: Uint8Array): any;
4894
+ /**
4895
+ * protobuf 结构中,int64 类型数据无法直接转为 JS 的 number 数据,需计算获取
4896
+ * @param data
4897
+ */
4898
+ private fixInt64Values;
5189
4899
  }
5190
4900
 
5191
4901
  declare class APIContext {
@@ -5203,19 +4913,10 @@ declare class APIContext {
5203
4913
  */
5204
4914
  private _pluginInstanseMap;
5205
4915
  private readonly _engine;
5206
- /**
5207
- * 核心库版本号,后期与 4.0 IM SDK 版本号保持一致
5208
- */
5209
- readonly coreVersion: string;
5210
4916
  readonly appkey: string;
5211
- readonly apiVersion: string;
5212
4917
  private readonly _options;
5213
4918
  private _versionInfo;
5214
4919
  private _typingInfo;
5215
- /**
5216
- * 内部连接状态标识,为 ture 时不允许调用 reconnect 方法
5217
- */
5218
- private _isInternalConnected;
5219
4920
  /**
5220
4921
  * RTC 相关的编解码模块,用于向前兼容 RTC 旧版本的编解码,
5221
4922
  * 包括向 CppEngine 提供 RTC 业务编解码能力
@@ -5233,21 +4934,23 @@ declare class APIContext {
5233
4934
  * @param options
5234
4935
  */
5235
4936
  install<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
5236
- private _connectionStatus;
5237
- private _canRedirectConnect;
4937
+ private _onConnectionStatusChange;
4938
+ private _processChatrormMessage;
4939
+ private _processChrmMemChangeMessage;
4940
+ private _processTypingStatusMessage;
4941
+ private _processInterceptMessage;
5238
4942
  /**
5239
- * 重定向后,递归调用 connect
5240
- */
5241
- private _handleRedirect;
4943
+ * 消息处理器(v2/v4/next 版本中兼容)
4944
+ * 返回 false | undefined:消息继续向上抛出,true:内部处理或转为事件回调,无需向上抛出
4945
+ */
4946
+ private _compatibleMessageProccessor;
4947
+ private _processReadReceiptMessage;
4948
+ private _processReadReceiptRequestMessage;
4949
+ private _processReadReceiptResponseMessage;
5242
4950
  /**
5243
- * 连接状态变更回调
5244
- * @param message
4951
+ * 消息处理器(imlib-next 中转为事件回调, 无需抛出)
5245
4952
  */
5246
- private _connectionStatusListener;
5247
- _handleConnecting(): void;
5248
- _handleConnected(): void;
5249
- _handleDisconnect(status: ConnectionStatus): void;
5250
- _handleSuspend(status: ConnectionStatus | ErrorCode): void;
4953
+ private _messageProccessor;
5251
4954
  private _messageReceiver;
5252
4955
  _batchMessageReceiver(messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean): void;
5253
4956
  /**
@@ -5320,6 +5023,7 @@ declare class APIContext {
5320
5023
  getCurrentUserId(): string;
5321
5024
  getConnectionStatus(): ConnectionStatus;
5322
5025
  get token(): string;
5026
+ refetchNaviInfo(): IPromiseResult<INaviInfo | null>;
5323
5027
  /**
5324
5028
  * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
5325
5029
  * @param token
@@ -5333,22 +5037,14 @@ declare class APIContext {
5333
5037
  这个字段就是为这种情况加的。
5334
5038
  设置 reconnectKickEnable 为 true 时,SDK 重连的时候发现此时已有别的设备连接成功,不再强行踢出已有设备,而是踢出重连设备。
5335
5039
  */
5336
- connect(token: string, refreshNavi?: boolean, reconnectKickEnable?: boolean, traceId?: string): Promise<IConnectResult>;
5337
- /**
5338
- * 拉取实时配置 web 端需更新 voipCall 字段
5339
- */
5340
- private _pullUserSettings;
5341
- disconnect(): Promise<void>;
5040
+ connect(token: string, reconnectKickEnable: boolean, traceId: string): Promise<IConnectResult>;
5041
+ disconnect(closeDB?: boolean): Promise<void>;
5342
5042
  reconnect(reconnectKickEnable?: boolean): Promise<IConnectResult>;
5343
5043
  private _getTokenWithoutNavi;
5344
5044
  /**
5345
5045
  * 获取当前缓存的导航数据
5346
5046
  */
5347
- getInfoFromCache(): INaviInfo | null;
5348
- /**
5349
- * 请求服务导航数据
5350
- */
5351
- reqNaviInfo(refreshNavi: boolean, traceId?: string): IPromiseResult<INaviInfo | null>;
5047
+ getNaviInfoFromCache(): INaviInfo | null;
5352
5048
  private _registerMessageSearchPropsMapping;
5353
5049
  /**
5354
5050
  * 消息注册
@@ -5714,7 +5410,11 @@ declare class APIContext {
5714
5410
  /**
5715
5411
  * 获取所有本地置顶列表
5716
5412
  */
5717
- getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
5413
+ getTopConversationList(conversationTypes?: ConversationType[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
5414
+ /**
5415
+ * 获取未读会话列表
5416
+ */
5417
+ getUnreadConversationList(conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
5718
5418
  getUnreadMentionedCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
5719
5419
  /**
5720
5420
  * 获取所有群聊会话 @ 消息未读数
@@ -5849,7 +5549,11 @@ declare class APIContext {
5849
5549
  /**
5850
5550
  * 获取本地消息
5851
5551
  */
5852
- getMessage(messageId: number): Promise<IAsyncRes<IReceivedMessage>>;
5552
+ getMessage(messageId: number | string): Promise<IAsyncRes<IReceivedMessage>>;
5553
+ /**
5554
+ * 设置消息附加信息
5555
+ */
5556
+ setTextMessageExtra(messageId: number, value: string): Promise<ErrorCode>;
5853
5557
  /**
5854
5558
  * 设置消息内容
5855
5559
  */
@@ -6003,20 +5707,32 @@ declare class APIContext {
6003
5707
  * SDK设置聊天室关联的rtc房间
6004
5708
  */
6005
5709
  bindRTCRoomForChatroom(option: IRTCRoomBindOption): Promise<ErrorCode>;
5710
+ /**
5711
+ * 设置代理
5712
+ */
5713
+ setProxy(proxy: IProxy | null): IPromiseResult<IProxy>;
5714
+ /**
5715
+ * 获取代理
5716
+ */
5717
+ getProxy(): IPromiseResult<IProxy>;
5718
+ /**
5719
+ * 测试代理
5720
+ */
5721
+ testProxy(proxy: IProxy, testHost: string): Promise<IResponse>;
6006
5722
  }
6007
5723
 
6008
5724
  declare class PluginContext {
6009
5725
  protected readonly _context: APIContext;
6010
5726
  constructor(_context: APIContext);
6011
- /**
6012
- * 重新请求服务导航数据
6013
- */
6014
- refetchNaviInfo(): IPromiseResult<INaviInfo | null>;
6015
5727
  /**
6016
5728
  * 获取 context
6017
5729
  */
6018
5730
  __getContext(): APIContext;
6019
5731
  createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string): Codec<T>;
5732
+ /**
5733
+ * 重新请求服务导航数据
5734
+ */
5735
+ refetchNaviInfo(): IPromiseResult<INaviInfo | null>;
6020
5736
  /**
6021
5737
  * 获取当前的导航数据
6022
5738
  */
@@ -6035,9 +5751,10 @@ declare class PluginContext {
6035
5751
  onnavidatachange?(naviInfo: INaviInfo): void;
6036
5752
  /**
6037
5753
  * 接收 IM 连接状态变更通知
6038
- * @param status
5754
+ * @param status 当前连接状态,ConnectionStatus 仅作为向前兼容声明,实际通知只有 RCConnectionStatus 值
5755
+ * @param code 当连接状态为 `RCConnectionStatus.DISCONNECTED` 或 `RCConnectionStatus.SUSPEND` 时有值
6039
5756
  */
6040
- onconnectionstatechange?(status: ConnectionStatus): void;
5757
+ onconnectionstatechange?(status: RCConnectionStatus | ConnectionStatus, code?: ErrorCode): void;
6041
5758
  /**
6042
5759
  * IM 客户端销毁通知
6043
5760
  */
@@ -6314,14 +6031,13 @@ declare const keymaps: CodecPBMaps;
6314
6031
  */
6315
6032
  declare type RTCKeyMaps = typeof keymaps;
6316
6033
 
6317
- interface IEngineWatcher {
6034
+ interface IEngineWatcher extends IConnectionListener {
6318
6035
  /**
6319
6036
  * @param message 消息
6320
6037
  * @param leftCount 参数废弃,值始终为 undefined
6321
6038
  * @param hasMore 消息是否收取结束,需与协议栈配合使用
6322
6039
  */
6323
6040
  batchMessage: (messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean) => void;
6324
- status: (status: ConnectionStatus) => void;
6325
6041
  chatroom: (event: IChatroomListenerData) => void;
6326
6042
  conversation: (event: any) => void;
6327
6043
  expansion: (event: IExpansionListenerData) => void;
@@ -6348,7 +6064,7 @@ interface IEngineWatcher {
6348
6064
  /**
6349
6065
  * 引擎定义
6350
6066
  */
6351
- declare abstract class AEngine implements IEngine {
6067
+ declare abstract class AEngine {
6352
6068
  readonly runtime: IRuntime;
6353
6069
  readonly rtcCodec: Codec<RTCKeyMaps>;
6354
6070
  protected readonly _watcher: IEngineWatcher;
@@ -6359,8 +6075,6 @@ declare abstract class AEngine implements IEngine {
6359
6075
  */
6360
6076
  abstract getConnectedTime(): number;
6361
6077
  protected readonly _appkey: string;
6362
- protected readonly _apiVer: string;
6363
- protected readonly _apiVersion: string;
6364
6078
  private _rtcKVManager;
6365
6079
  /**
6366
6080
  * 引擎初始化
@@ -6373,28 +6087,22 @@ declare abstract class AEngine implements IEngine {
6373
6087
  * @param listener
6374
6088
  */
6375
6089
  registerRTCSignalingListener(listener: ((buffer: Uint8Array) => void) | undefined): void;
6376
- abstract requestNaviInfo(uris: string[], appkey: string, token: string, checkCA?: boolean): Promise<INaviInfo | null>;
6377
6090
  /**
6378
- * 为非 engine 包创建 logger 工具实例
6091
+ * 忽视缓存,重新请求导航数据
6379
6092
  */
6380
- abstract createLogger(id: string, type: LogType): BasicLogger;
6093
+ abstract refetchNaviInfo(): IPromiseResult<INaviInfo | null>;
6381
6094
  /**
6382
- * 获取 engine 包内部 logger 工具
6095
+ * 获取导航缓存数据
6383
6096
  */
6384
- getInnerLogger(): BasicLogger;
6097
+ abstract getNaviInfoFromCache(): INaviInfo | null;
6385
6098
  /**
6386
- * 获取导航数据
6387
- * @param token
6388
- * @param dynamicUris token 携带的动态导航地址
6389
- * @param force 是否强制重新获取并清空缓存数据
6099
+ * 为非 engine 包创建 logger 工具实例
6390
6100
  */
6391
- getNaviInfo(token: string, dynamicUris: string[], force: boolean, checkCA?: boolean): Promise<INaviInfo | null>;
6392
- protected setNaviInfo2Cache(token: string, naviInfo: INaviInfo): void;
6393
- abstract getNaviInfoFromCache(): INaviInfo | null;
6101
+ abstract createLogger(id: string, type: LogType): BasicLogger;
6394
6102
  /**
6395
- * 清空导航数据:内存数据、缓存数据
6103
+ * 获取 engine 包内部 logger 工具
6396
6104
  */
6397
- private _clear;
6105
+ getInnerLogger(): BasicLogger;
6398
6106
  /**
6399
6107
  * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
6400
6108
  * 对于未实现的方法,接口响应 Unsupport 错误码
@@ -6405,10 +6113,10 @@ declare abstract class AEngine implements IEngine {
6405
6113
  /**
6406
6114
  * 建立连接
6407
6115
  * @param token
6408
- * @param naviInfo
6409
6116
  * @param reconnectKickEnable
6117
+ * @param traceId
6410
6118
  */
6411
- abstract connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean, traceId?: string): Promise<ErrorCode>;
6119
+ abstract connect(token: string, reconnectKickEnable: boolean, traceId: string): IPromiseResult<string>;
6412
6120
  /**
6413
6121
  * 发送SDK版本
6414
6122
  * @param versionInfo
@@ -6518,6 +6226,10 @@ declare abstract class AEngine implements IEngine {
6518
6226
  * 获取指定会话
6519
6227
  */
6520
6228
  abstract getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
6229
+ /**
6230
+ * 获取未读会话列表
6231
+ */
6232
+ abstract getUnreadConversationList(conversationTypes: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
6521
6233
  /**
6522
6234
  * 删除会话
6523
6235
  * @description 该删除操作会删除服务器端存储的会话数据
@@ -6593,12 +6305,17 @@ declare abstract class AEngine implements IEngine {
6593
6305
  abstract getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
6594
6306
  /**
6595
6307
  * 断开连接
6308
+ * @param closeDB 是否关闭数据库,默认为 true,仅 Electron 平台有效
6596
6309
  */
6597
- abstract disconnect(): void;
6310
+ abstract disconnect(closeDB?: boolean): Promise<void>;
6598
6311
  /**
6599
6312
  * 拉取用户级配置数据
6600
6313
  */
6601
6314
  abstract pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
6315
+ /**
6316
+ * 获取当前连接状态
6317
+ */
6318
+ abstract getConnectionStatus(): RCConnectionStatus;
6602
6319
  /**
6603
6320
  * 消息注册
6604
6321
  * @description
@@ -6909,7 +6626,11 @@ declare abstract class AEngine implements IEngine {
6909
6626
  /**
6910
6627
  * 获取消息
6911
6628
  */
6912
- abstract getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
6629
+ abstract getMessage(messageId: number | string): IPromiseResult<IReceivedMessage>;
6630
+ /**
6631
+ * 设置消息附加信息
6632
+ */
6633
+ abstract setTextMessageExtra(messageId: number, value: string): Promise<ErrorCode>;
6913
6634
  /**
6914
6635
  * 设置消息内容
6915
6636
  */
@@ -7014,7 +6735,7 @@ declare abstract class AEngine implements IEngine {
7014
6735
  /**
7015
6736
  * 无差别获取本地置顶列表
7016
6737
  */
7017
- abstract getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
6738
+ abstract getTopConversationList(conversationTypes: ConversationType[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
7018
6739
  /**
7019
6740
  * 获取单个群聊会话 @ 消息未读数
7020
6741
  */
@@ -7118,6 +6839,18 @@ declare abstract class AEngine implements IEngine {
7118
6839
  * Engine 反初始化
7119
6840
  */
7120
6841
  destroy(): void;
6842
+ /**
6843
+ * 设置代理
6844
+ */
6845
+ abstract setProxy(proxy: IProxy | null): IPromiseResult<IProxy>;
6846
+ /**
6847
+ * 获取代理
6848
+ */
6849
+ abstract getProxy(): IPromiseResult<IProxy>;
6850
+ /**
6851
+ * 测试代理
6852
+ */
6853
+ abstract testProxy(proxy: IProxy, testHost: string): Promise<IResponse>;
7121
6854
  }
7122
6855
 
7123
6856
  declare class AppStorage {
@@ -7262,6 +6995,7 @@ declare const notEmptyObject: (val: Object) => boolean;
7262
6995
  declare const isValidConversationType: (conversation: number) => boolean;
7263
6996
  declare const isValidNotificationLevel: (level: number) => boolean;
7264
6997
  declare const isValidChannelId: (value: any) => boolean;
6998
+ declare const isTypeInConversationList: (type: number) => boolean;
7265
6999
  /**
7266
7000
  * 判断是否是一个有效的文件类型
7267
7001
  */
@@ -7292,31 +7026,31 @@ declare function ID(): string;
7292
7026
  /**
7293
7027
  * @deprecated
7294
7028
  */
7295
- declare function init(userLogInfo: ILogInit): void;
7029
+ declare function init(userLogInfo: any): void;
7296
7030
  /**
7297
7031
  * @deprecated
7298
7032
  */
7299
- declare function log(logLevel: LogLevel, tagId: LogTagId | string, logObj?: Object, logExtens?: ILogExtensions): void;
7033
+ declare function log(logLevel: LogLevel, tagId: LogTagId | string, logObj?: Object, logExtens?: any): void;
7300
7034
  /**
7301
7035
  * @deprecated
7302
7036
  */
7303
- declare const debug: (tagId: string, logObj?: Object | undefined, logExtens?: ILogExtensions | undefined) => void;
7037
+ declare const debug: (tagId: string, logObj?: Object | undefined, logExtens?: any) => void;
7304
7038
  /**
7305
7039
  * @deprecated
7306
7040
  */
7307
- declare const info: (tagId: string, logObj?: Object | undefined, logExtens?: ILogExtensions | undefined) => void;
7041
+ declare const info: (tagId: string, logObj?: Object | undefined, logExtens?: any) => void;
7308
7042
  /**
7309
7043
  * @deprecated
7310
7044
  */
7311
- declare const warn: (tagId: string, logObj?: Object | undefined, logExtens?: ILogExtensions | undefined) => void;
7045
+ declare const warn: (tagId: string, logObj?: Object | undefined, logExtens?: any) => void;
7312
7046
  /**
7313
7047
  * @deprecated
7314
7048
  */
7315
- declare const error: (tagId: string, logObj?: Object | undefined, logExtens?: ILogExtensions | undefined) => void;
7049
+ declare const error: (tagId: string, logObj?: Object | undefined, logExtens?: any) => void;
7316
7050
  /**
7317
7051
  * @deprecated
7318
7052
  */
7319
- declare const fatal: (tagId: string, logObj?: Object | undefined, logExtens?: ILogExtensions | undefined) => void;
7053
+ declare const fatal: (tagId: string, logObj?: Object | undefined, logExtens?: any) => void;
7320
7054
 
7321
7055
  declare const base_logLevelTransformer: typeof logLevelTransformer;
7322
7056
  declare const base_ID: typeof ID;
@@ -7553,11 +7287,6 @@ declare const getBrowser: (runtime: IRuntime) => {
7553
7287
  type: any;
7554
7288
  version: any;
7555
7289
  };
7556
- /**
7557
- * 将连接时服务端返回码转换成业务响应码
7558
- * @param code 连接响应码
7559
- */
7560
- declare const formatConnectResponseCode: (code: number) => ErrorCode;
7561
7290
  declare const clone: (target: any) => any;
7562
7291
 
7563
7292
  /**
@@ -7647,6 +7376,12 @@ declare const DB_LOG_FLUSH_FREQUENCY = 3000;
7647
7376
  declare const ONE_LOG_SIZE_MAX = 1000;
7648
7377
  /** 日志上报域名 */
7649
7378
  declare const LOG_REPORT_URI = "logcollection.ronghub.com";
7379
+ /** SDK 版本号 */
7380
+ declare const VERSION: string;
7381
+ /**
7382
+ * 祛除标签的标准版本号,如愿版本号为 `3.1.0-alpha.1`,则该值为 `3.1.0`
7383
+ */
7384
+ declare const FORMATED_VERSION: string;
7650
7385
 
7651
7386
  /**
7652
7387
  * 请使用 `Codec` 替代 `AbsCodec`
@@ -7655,8 +7390,9 @@ declare const LOG_REPORT_URI = "logcollection.ronghub.com";
7655
7390
  declare type AbsCodec<T> = Codec<T>;
7656
7391
 
7657
7392
  /**
7393
+ * @deprecated
7658
7394
  * engine 版本号
7659
7395
  */
7660
7396
  declare const version: string;
7661
7397
 
7662
- export { AEngine, APIContext, AbsCodec, AppStorage, AssertRules, BasicLogger, BasicReporter, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType, Codec, CodecPBMaps, ConnectResultCode, ConnectionStatus, ConversationType, DB_LOG_FLUSH_FREQUENCY, DB_LOG_MAX_SIZE, DelayTimer, EnableLogL, ErrorCode, EventEmitter, FileType, HTTP_TIMEOUT, HttpMethod, IAPIContextOption, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBigdataLogInit, IBlockedMessageInfo, ICancelRoomPKOptions, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDeletedExpansion, IDeliveredUser, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGetMsgOption, IGetUltraGroupListOption, IGooglePushConfig, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IInitBigDataOption, IInsertMsgOptions, IIsValidExpansion, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, ILogDB, ILogData, ILogExtensions, ILogInfo, ILogInit, ILogger, IM_CHATROOM_PULL_INTERVAL_TIME, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageDeliver, IMessageDeliveredListener, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IOSInfo, IOperateStatusNotify, IPluginGenerator, IProcessInfo, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomBindOption, IRTCRoomInfo, IRTCUserData, IRTCUsers, IReadReceiptInfo, IRealTimeLog, IRecallMsgContent, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IReqRoomPKOptions, IRequest, IResRoomPKOptions, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraExMsgOptions, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadMentionedOption, IUltraModifyMsgOptions, IUltraMsgQueryOptions, IUltraUnreadConversation, IUltraUnreadMsg, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, IiOSPushConfig, IndexDBLogger, IndexDBReporter, RTCKeyMaps as InnerRTCKeyMaps, ItypingStateListener, KVString, LOG_REPORT_URI, LiveRole, LiveType, LogContent, LogL, LogLevel, LogSource, LogTagId, LogType, Logger, MAX_MESSAGE_CONTENT_BYTES, MAX_MESSAGE_EXPANSION_KEY_LENGTH, MAX_MESSAGE_EXPANSION_VAL_LENGTH, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NetworkType, NotificationLevel, NotificationStatus, ONE_LOG_SIZE_MAX, OperateStatus, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, REAT_TIME_LOG_SIZE, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, StoreKeys, TagChangeType, UltraGroupChannelChangeType, UltraGroupChannelType, UltraMsgChangeType, UltraMsgSubChangeType, UploadMethod, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, clone, cloneByJSON, deInitLogDB, logger as engineLogger, forEach, formatConnectResponseCode, getBrowser, getClientMessageId, getMimeKey, getUUID, getUUID22, getUploadFileName, indexOf, initLogDB, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChannelId, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidExpansion, isValidFileType, isValidNotificationLevel, base as logger, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, transcsv, usingCppEngine, validate, version };
7398
+ export { AConnectionMgr, AEngine, APIContext, AbsCodec, AppStorage, AssertRules, BasicLogger, BasicNavi, BasicReporter, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType, Codec, CodecPBMaps, ConnectionStatus, ConversationType, DB_LOG_FLUSH_FREQUENCY, DB_LOG_MAX_SIZE, DelayTimer, EnableLogL, ErrorCode, EventEmitter, FORMATED_VERSION, FileType, HTTP_TIMEOUT, HttpMethod, IAPIContextOption, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBlockedMessageInfo, ICancelRoomPKOptions, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionListener, IConnectionStatusListener, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDeletedExpansion, IDeliveredUser, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGetMsgOption, IGetUltraGroupListOption, IGooglePushConfig, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IGroupMessageDeliveredStatusInfo, IInsertMsgOptions, IIsValidExpansion, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, ILogDB, ILogData, ILogger, IM_CHATROOM_PULL_INTERVAL_TIME, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageDeliver, IMessageDeliveredListener, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviCache, INaviInfo, IOSInfo, IOperateInfo, IOperateStatusNotify, IOperateSummary, IPluginGenerator, IProcessCache, IProcessInfo, IPromiseResult, IProxy, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomBindOption, IRTCRoomInfo, IRTCUserData, IRTCUsers, IReadReceiptInfo, IRecallMsgContent, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IReqRoomPKOptions, IRequest, IResRoomPKOptions, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraExMsgOptions, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadMentionedOption, IUltraModifyMsgOptions, IUltraMsgQueryOptions, IUltraUnreadConversation, IUltraUnreadMsg, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, IiOSPushConfig, IndexDBLogger, IndexDBReporter, RTCKeyMaps as InnerRTCKeyMaps, ItypingStateListener, KVString, LOG_REPORT_URI, LiveRole, LiveType, LogContent, LogL, LogLevel, LogSource, LogTagId, LogType, Logger, MAX_MESSAGE_CONTENT_BYTES, MAX_MESSAGE_EXPANSION_KEY_LENGTH, MAX_MESSAGE_EXPANSION_VAL_LENGTH, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NetworkType, NotificationLevel, NotificationStatus, ONE_LOG_SIZE_MAX, OperateStatus, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, RCConnectionStatus, REAT_TIME_LOG_SIZE, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, SentStatus, StoreKeys, TagChangeType, UltraGroupChannelChangeType, UltraGroupChannelType, UltraMsgChangeType, UltraMsgSubChangeType, UploadMethod, VERSION, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketNavi, appendUrl, assert, clone, cloneByJSON, deInitLogDB, logger as engineLogger, forEach, getBrowser, getClientMessageId, getMimeKey, getUUID, getUUID22, getUploadFileName, indexOf, initLogDB, isArray, isArrayBuffer, isBoolean, isConnnectAckCode as isConnnectAck, isDisconnectCode as isDisconnectedByServer, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isTypeInConversationList, isUndefined, isValidChannelId, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidExpansion, isValidFileType, isValidNotificationLevel, base as logger, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, transcsv, usingCppEngine, validate, version };