@rongcloud/engine 5.5.5-beem → 5.5.5
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 +424 -624
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 会话类型
|
|
3
|
-
* @category Enum
|
|
4
3
|
*/
|
|
5
4
|
declare enum ConversationType {
|
|
6
5
|
/**
|
|
@@ -54,7 +53,6 @@ declare enum ConversationType {
|
|
|
54
53
|
*/
|
|
55
54
|
/**
|
|
56
55
|
* 会话标签
|
|
57
|
-
* @category Interface
|
|
58
56
|
*/
|
|
59
57
|
interface IConversationTag {
|
|
60
58
|
tagId: string;
|
|
@@ -64,7 +62,6 @@ interface IConversationTag {
|
|
|
64
62
|
}
|
|
65
63
|
/**
|
|
66
64
|
* 标签参数
|
|
67
|
-
* @category Interface
|
|
68
65
|
*/
|
|
69
66
|
interface ITagParam {
|
|
70
67
|
tagId: string;
|
|
@@ -72,30 +69,22 @@ interface ITagParam {
|
|
|
72
69
|
}
|
|
73
70
|
/**
|
|
74
71
|
* 标签状态
|
|
75
|
-
* @category Interface
|
|
76
72
|
*/
|
|
77
73
|
interface ITagStatus {
|
|
78
74
|
isTop?: boolean;
|
|
79
75
|
}
|
|
80
76
|
/**
|
|
81
77
|
* 本地存储会话的标签状态
|
|
82
|
-
* @category Interface
|
|
83
78
|
*/
|
|
84
79
|
interface ILocalTagStatus {
|
|
85
80
|
[tagId: string]: ITagStatus;
|
|
86
81
|
}
|
|
87
|
-
/**
|
|
88
|
-
* @category Interface
|
|
89
|
-
*/
|
|
90
82
|
interface ITagInfo {
|
|
91
83
|
tagId: string;
|
|
92
84
|
tagName: string;
|
|
93
85
|
conversationCount: number;
|
|
94
86
|
createdTime?: number;
|
|
95
87
|
}
|
|
96
|
-
/**
|
|
97
|
-
* @category Enum
|
|
98
|
-
*/
|
|
99
88
|
declare enum TagChangeType {
|
|
100
89
|
add = 1,
|
|
101
90
|
update = 2,
|
|
@@ -288,6 +277,7 @@ declare abstract class BaseWriter {
|
|
|
288
277
|
getHeaderFlag(): number;
|
|
289
278
|
getLengthSize(): number;
|
|
290
279
|
getBufferData(): Int8Array;
|
|
280
|
+
getCometData(): string;
|
|
291
281
|
}
|
|
292
282
|
declare class RetryableReader extends BaseReader {
|
|
293
283
|
messageId: number;
|
|
@@ -366,7 +356,6 @@ declare enum OperateStatus {
|
|
|
366
356
|
|
|
367
357
|
/**
|
|
368
358
|
* 文件类型
|
|
369
|
-
* @category Enum
|
|
370
359
|
*/
|
|
371
360
|
declare enum FileType {
|
|
372
361
|
/**
|
|
@@ -395,10 +384,6 @@ declare enum FileType {
|
|
|
395
384
|
COMBINE_HTML = 6
|
|
396
385
|
}
|
|
397
386
|
|
|
398
|
-
/**
|
|
399
|
-
* 消息方向
|
|
400
|
-
* @category Enum
|
|
401
|
-
*/
|
|
402
387
|
declare enum MessageDirection {
|
|
403
388
|
/**
|
|
404
389
|
* 己方发送消息
|
|
@@ -417,10 +402,6 @@ declare enum MessageDirection {
|
|
|
417
402
|
* 备注:iOS 与 Android 错误码一致。Web 与移动端一致的错误码,也用此片段,比如 34008 (消息不支持扩展)
|
|
418
403
|
* 35001 ~ 39999 为 Web 端错误码 备注:由于 Web IM 历史版本 35xxx 36xxx 37xxx 38xxx 39xxxx 都占用过,所以错误码段范围较大
|
|
419
404
|
*/
|
|
420
|
-
/**
|
|
421
|
-
* 错误码
|
|
422
|
-
* @category Enum
|
|
423
|
-
*/
|
|
424
405
|
declare enum ErrorCode {
|
|
425
406
|
/** 超时 */
|
|
426
407
|
TIMEOUT = -1,
|
|
@@ -664,15 +645,6 @@ declare enum ErrorCode {
|
|
|
664
645
|
* token平台验证失败
|
|
665
646
|
*/
|
|
666
647
|
RC_PLATFORM_ERROR = 31028,
|
|
667
|
-
/**
|
|
668
|
-
* 用户账号已销户
|
|
669
|
-
* @desc 请检查您使用的 Token 是否正确,以及对应的 UserId 是否被销户
|
|
670
|
-
*/
|
|
671
|
-
RC_CONN_USER_LOGOUT = 31029,
|
|
672
|
-
/**
|
|
673
|
-
* 证书过期,SDK不会重连
|
|
674
|
-
*/
|
|
675
|
-
RC_LICENSE_EXPIRED = 31030,
|
|
676
648
|
/**
|
|
677
649
|
* 协议层内部错误。query,上传下载过程中数据错误。
|
|
678
650
|
*/
|
|
@@ -1015,10 +987,6 @@ declare enum ConnectionStatus {
|
|
|
1015
987
|
* 重定向
|
|
1016
988
|
*/
|
|
1017
989
|
REDIRECT = 14,
|
|
1018
|
-
/**
|
|
1019
|
-
* 用户账号已销户,不再进行连接
|
|
1020
|
-
*/
|
|
1021
|
-
USER_LOGOUT = 19,
|
|
1022
990
|
/**
|
|
1023
991
|
* appkey 不正确
|
|
1024
992
|
*/
|
|
@@ -1046,17 +1014,9 @@ declare enum ConnectionStatus {
|
|
|
1046
1014
|
/**
|
|
1047
1015
|
* 请求导航超时
|
|
1048
1016
|
*/
|
|
1049
|
-
RESPONSE_NAVI_TIMEOUT = 204
|
|
1050
|
-
/**
|
|
1051
|
-
* 证书过期,SDK不会重连
|
|
1052
|
-
*/
|
|
1053
|
-
RC_LICENSE_EXPIRED = 31030
|
|
1017
|
+
RESPONSE_NAVI_TIMEOUT = 204
|
|
1054
1018
|
}
|
|
1055
1019
|
|
|
1056
|
-
/**
|
|
1057
|
-
* 消息接受状态
|
|
1058
|
-
* @category Enum
|
|
1059
|
-
*/
|
|
1060
1020
|
declare enum ReceivedStatus {
|
|
1061
1021
|
/**
|
|
1062
1022
|
* 已读
|
|
@@ -1160,10 +1120,6 @@ declare const ConnectResultCode: {
|
|
|
1160
1120
|
* token平台验证失败
|
|
1161
1121
|
*/
|
|
1162
1122
|
PLATFORM_ERROR: number;
|
|
1163
|
-
/**
|
|
1164
|
-
* 用户账号已销户,不再进行连接
|
|
1165
|
-
*/
|
|
1166
|
-
USER_LOGOUT: number;
|
|
1167
1123
|
};
|
|
1168
1124
|
|
|
1169
1125
|
/**
|
|
@@ -1250,14 +1206,6 @@ declare enum MessageType {
|
|
|
1250
1206
|
* 接受群已读回执更新消息(导航开关grpRRVer为1时使用)
|
|
1251
1207
|
*/
|
|
1252
1208
|
GROUP_READ_RECEIPT_REQUEST = "RC:RRMsg",
|
|
1253
|
-
/**
|
|
1254
|
-
* 消息送达报告,仅单聊
|
|
1255
|
-
*/
|
|
1256
|
-
DELIVERED = "RC:Delivered",
|
|
1257
|
-
/**
|
|
1258
|
-
* 消息送达状态报告,仅群聊
|
|
1259
|
-
*/
|
|
1260
|
-
DELIVERED_MSG = "RC:DRMsg",
|
|
1261
1209
|
/**
|
|
1262
1210
|
* 用户加入聊天室
|
|
1263
1211
|
*/
|
|
@@ -1282,7 +1230,6 @@ declare enum MessageType {
|
|
|
1282
1230
|
|
|
1283
1231
|
/**
|
|
1284
1232
|
* @deprecated 已废弃,请使用 NotificationLevel
|
|
1285
|
-
* @category Enum
|
|
1286
1233
|
*/
|
|
1287
1234
|
declare enum NotificationStatus {
|
|
1288
1235
|
/**
|
|
@@ -1296,9 +1243,7 @@ declare enum NotificationStatus {
|
|
|
1296
1243
|
}
|
|
1297
1244
|
|
|
1298
1245
|
/**
|
|
1299
|
-
* 免打扰级别
|
|
1300
1246
|
* @desc 原: NotificationStatus 已废弃
|
|
1301
|
-
* @category Enum
|
|
1302
1247
|
*/
|
|
1303
1248
|
declare enum NotificationLevel {
|
|
1304
1249
|
/**
|
|
@@ -1332,7 +1277,6 @@ declare enum NotificationLevel {
|
|
|
1332
1277
|
|
|
1333
1278
|
/**
|
|
1334
1279
|
* 群组 @ 类型
|
|
1335
|
-
* @category Enum
|
|
1336
1280
|
*/
|
|
1337
1281
|
declare enum MentionedType {
|
|
1338
1282
|
/**
|
|
@@ -1351,10 +1295,6 @@ interface IMetionedData {
|
|
|
1351
1295
|
mentionedContent?: string;
|
|
1352
1296
|
}
|
|
1353
1297
|
|
|
1354
|
-
/**
|
|
1355
|
-
* 上传方法
|
|
1356
|
-
* @category Enum
|
|
1357
|
-
*/
|
|
1358
1298
|
declare enum UploadMethod {
|
|
1359
1299
|
/**
|
|
1360
1300
|
* 七牛上传
|
|
@@ -1376,17 +1316,12 @@ declare enum UploadMethod {
|
|
|
1376
1316
|
|
|
1377
1317
|
/**
|
|
1378
1318
|
* 聊天室 kv 存储操作类型. 对方操作, 己方收到消息(RC:chrmKVNotiMsg)中会带入此值. 根据此值判断是删除还是更新
|
|
1379
|
-
* @category Enum
|
|
1380
1319
|
*/
|
|
1381
1320
|
declare enum ChatroomEntryType {
|
|
1382
1321
|
UPDATE = 1,
|
|
1383
1322
|
DELETE = 2
|
|
1384
1323
|
}
|
|
1385
1324
|
|
|
1386
|
-
/**
|
|
1387
|
-
* 日志级别
|
|
1388
|
-
* @category Enum
|
|
1389
|
-
*/
|
|
1390
1325
|
declare enum LogLevel {
|
|
1391
1326
|
LOG = 0,
|
|
1392
1327
|
DEBUG = 0,
|
|
@@ -1408,10 +1343,7 @@ declare enum LogSource {
|
|
|
1408
1343
|
declare enum LogTagId {
|
|
1409
1344
|
L_IMSDK_VER_O = "L-imsdk_ver-O",
|
|
1410
1345
|
A_INIT_O = "A-init-O",
|
|
1411
|
-
A_INIT_REPEAT_O = "A_INIT_REPEAT_O",
|
|
1412
1346
|
L_INIT_O = "L-init-O",
|
|
1413
|
-
A_DESTROY_O = "A_DESTROY_O",
|
|
1414
|
-
L_DESTROY_O = "L_DESTROY_O",
|
|
1415
1347
|
P_INIT_O = "P-init-O",
|
|
1416
1348
|
A_CONNECT_T = "A-connect-T",
|
|
1417
1349
|
A_CONNECT_R = "A-connect-R",
|
|
@@ -1467,7 +1399,6 @@ declare enum LogTagId {
|
|
|
1467
1399
|
L_MEDIA_UPLOAD_T = "L-media_upload-T",
|
|
1468
1400
|
L_MEDIA_UPLOAD_R = "L-media_upload-R",
|
|
1469
1401
|
G_UPLOAD_LOG_S = "G-upload_log-S",
|
|
1470
|
-
G_REPORT_LOG_S = "G-report_log-S",
|
|
1471
1402
|
G_UPLOAD_LOG_E = "G-upload_log-E",
|
|
1472
1403
|
G_GET_REAL_TIMELOG_COMMAND_S = "G-get_real_timelog_command-S",
|
|
1473
1404
|
L_CHECK_ALIVE_IM_T = "L-check_alive_im-T",
|
|
@@ -1492,7 +1423,6 @@ declare enum LogTagId {
|
|
|
1492
1423
|
|
|
1493
1424
|
/**
|
|
1494
1425
|
* 聊天室成员进入和退出状态
|
|
1495
|
-
* @category Enum
|
|
1496
1426
|
*/
|
|
1497
1427
|
declare enum ChatroomUserChangeType {
|
|
1498
1428
|
QUIT = 0,
|
|
@@ -1501,7 +1431,6 @@ declare enum ChatroomUserChangeType {
|
|
|
1501
1431
|
|
|
1502
1432
|
/**
|
|
1503
1433
|
* 消息被拦截类型
|
|
1504
|
-
* @category Enum
|
|
1505
1434
|
*/
|
|
1506
1435
|
declare enum MessageBlockType {
|
|
1507
1436
|
/**
|
|
@@ -1567,18 +1496,6 @@ declare enum RTCMode {
|
|
|
1567
1496
|
* 直播模式
|
|
1568
1497
|
*/
|
|
1569
1498
|
LIVE = 2,
|
|
1570
|
-
/**
|
|
1571
|
-
*sip呼叫
|
|
1572
|
-
*/
|
|
1573
|
-
SIP = 4,
|
|
1574
|
-
/**
|
|
1575
|
-
* 呼叫模式.包括单呼和群呼
|
|
1576
|
-
*/
|
|
1577
|
-
CALL = 5,
|
|
1578
|
-
/**
|
|
1579
|
-
* 会议
|
|
1580
|
-
*/
|
|
1581
|
-
MEETING = 6,
|
|
1582
1499
|
/**
|
|
1583
1500
|
* 跨应用多人房间
|
|
1584
1501
|
*/
|
|
@@ -1649,10 +1566,6 @@ declare enum RTCJoinType {
|
|
|
1649
1566
|
COEXIST = 2
|
|
1650
1567
|
}
|
|
1651
1568
|
|
|
1652
|
-
/**
|
|
1653
|
-
* 会话属性
|
|
1654
|
-
* @category Interface
|
|
1655
|
-
*/
|
|
1656
1569
|
interface IConversationOption {
|
|
1657
1570
|
conversationType: ConversationType;
|
|
1658
1571
|
targetId: string;
|
|
@@ -1745,9 +1658,6 @@ interface IClearMsgOption {
|
|
|
1745
1658
|
timestamp?: number;
|
|
1746
1659
|
}
|
|
1747
1660
|
|
|
1748
|
-
/**
|
|
1749
|
-
* @category Interface
|
|
1750
|
-
*/
|
|
1751
1661
|
interface IGooglePushConfig {
|
|
1752
1662
|
/**
|
|
1753
1663
|
* 分组ID
|
|
@@ -1762,9 +1672,6 @@ interface IGooglePushConfig {
|
|
|
1762
1672
|
*/
|
|
1763
1673
|
priority?: 'high' | 'normal';
|
|
1764
1674
|
}
|
|
1765
|
-
/**
|
|
1766
|
-
* @category Interface
|
|
1767
|
-
*/
|
|
1768
1675
|
interface IiOSPushConfig {
|
|
1769
1676
|
/**
|
|
1770
1677
|
* iOS 用于通知分组的 id
|
|
@@ -1783,9 +1690,6 @@ interface IiOSPushConfig {
|
|
|
1783
1690
|
*/
|
|
1784
1691
|
richMediaUri?: string;
|
|
1785
1692
|
}
|
|
1786
|
-
/**
|
|
1787
|
-
* @category Interface
|
|
1788
|
-
*/
|
|
1789
1693
|
interface IAndroidPushConfig {
|
|
1790
1694
|
/**
|
|
1791
1695
|
* Android 的通知 id
|
|
@@ -1812,10 +1716,6 @@ interface IAndroidPushConfig {
|
|
|
1812
1716
|
*/
|
|
1813
1717
|
googleConfig?: IGooglePushConfig;
|
|
1814
1718
|
}
|
|
1815
|
-
/**
|
|
1816
|
-
* 推送配置
|
|
1817
|
-
* @category Interface
|
|
1818
|
-
*/
|
|
1819
1719
|
interface IPushConfig {
|
|
1820
1720
|
/**
|
|
1821
1721
|
* 推送标题
|
|
@@ -1859,15 +1759,11 @@ interface IPushConfig {
|
|
|
1859
1759
|
|
|
1860
1760
|
/**
|
|
1861
1761
|
* 已读回执数据结构
|
|
1862
|
-
* @category Interface
|
|
1863
1762
|
*/
|
|
1864
1763
|
interface IMessageReader {
|
|
1865
1764
|
readTime: number;
|
|
1866
1765
|
userId: string;
|
|
1867
1766
|
}
|
|
1868
|
-
/**
|
|
1869
|
-
* @category Interface
|
|
1870
|
-
*/
|
|
1871
1767
|
interface IMessageReaderResponse {
|
|
1872
1768
|
totalMemberCount: number;
|
|
1873
1769
|
list: IMessageReader[];
|
|
@@ -1880,9 +1776,6 @@ interface ILocalReadReceiptInfo {
|
|
|
1880
1776
|
readCount?: number;
|
|
1881
1777
|
totalCount?: number;
|
|
1882
1778
|
}
|
|
1883
|
-
/**
|
|
1884
|
-
* @category Interface
|
|
1885
|
-
*/
|
|
1886
1779
|
interface IReadReceiptInfo {
|
|
1887
1780
|
/**
|
|
1888
1781
|
* 是否已经发送已读回执
|
|
@@ -1903,7 +1796,6 @@ interface IReadReceiptInfo {
|
|
|
1903
1796
|
}
|
|
1904
1797
|
/**
|
|
1905
1798
|
* 从服务端接收到的消息数据
|
|
1906
|
-
* @category Interface
|
|
1907
1799
|
*/
|
|
1908
1800
|
interface IReceivedMessage {
|
|
1909
1801
|
/**
|
|
@@ -2026,9 +1918,6 @@ interface IReceivedMessage {
|
|
|
2026
1918
|
*/
|
|
2027
1919
|
channelType?: UltraGroupChannelType;
|
|
2028
1920
|
}
|
|
2029
|
-
/**
|
|
2030
|
-
* @category Interface
|
|
2031
|
-
*/
|
|
2032
1921
|
interface IUserProfile {
|
|
2033
1922
|
/**
|
|
2034
1923
|
* 用户 ID
|
|
@@ -2352,7 +2241,6 @@ interface IUltraMsgQueryOptions {
|
|
|
2352
2241
|
}
|
|
2353
2242
|
/**
|
|
2354
2243
|
* 被拦截的消息信息
|
|
2355
|
-
* @category Interface
|
|
2356
2244
|
*/
|
|
2357
2245
|
interface IBlockedMessageInfo {
|
|
2358
2246
|
blockedMessageUId: string;
|
|
@@ -2419,178 +2307,8 @@ declare const DelayTimer: {
|
|
|
2419
2307
|
getTime: () => number;
|
|
2420
2308
|
};
|
|
2421
2309
|
|
|
2422
|
-
declare enum HttpMethod {
|
|
2423
|
-
GET = "GET",
|
|
2424
|
-
POST = "POST"
|
|
2425
|
-
}
|
|
2426
|
-
interface IRequest {
|
|
2427
|
-
url: string;
|
|
2428
|
-
/**
|
|
2429
|
-
* @default `HttpMethod.GET`
|
|
2430
|
-
*/
|
|
2431
|
-
method?: HttpMethod | 'GET' | 'POST';
|
|
2432
|
-
/**
|
|
2433
|
-
* 查询数据
|
|
2434
|
-
*/
|
|
2435
|
-
query?: {
|
|
2436
|
-
[key: string]: string | number | null;
|
|
2437
|
-
};
|
|
2438
|
-
/**
|
|
2439
|
-
* Request Header 信息
|
|
2440
|
-
*/
|
|
2441
|
-
headers?: {
|
|
2442
|
-
[key: string]: string;
|
|
2443
|
-
};
|
|
2444
|
-
/**
|
|
2445
|
-
* Request Body 数据
|
|
2446
|
-
*/
|
|
2447
|
-
body?: Object | string;
|
|
2448
|
-
/**
|
|
2449
|
-
* 超时设置,默认 `60s`
|
|
2450
|
-
*/
|
|
2451
|
-
timeout?: number;
|
|
2452
|
-
/**
|
|
2453
|
-
* 【Alipay-Only】
|
|
2454
|
-
* 期望返回的数据格式,如果为 json 则返回后会对返回的数据进行一次 JSON.parse
|
|
2455
|
-
*/
|
|
2456
|
-
dataType?: 'json' | 'text' | 'base64' | 'arraybuffer';
|
|
2457
|
-
}
|
|
2458
|
-
interface IStorage {
|
|
2459
|
-
setItem(key: string, value: string): void;
|
|
2460
|
-
getItem(key: string): string | null;
|
|
2461
|
-
removeItem(key: string): void;
|
|
2462
|
-
clear(): void;
|
|
2463
|
-
}
|
|
2464
|
-
interface IResponse {
|
|
2465
|
-
status: number;
|
|
2466
|
-
data?: string;
|
|
2467
|
-
}
|
|
2468
|
-
/**
|
|
2469
|
-
* 网络状态枚举
|
|
2470
|
-
*/
|
|
2471
|
-
declare enum NetworkType {
|
|
2472
|
-
WIFI = "wifi",
|
|
2473
|
-
FOUR_G = "4g",
|
|
2474
|
-
THREE_G = "3g",
|
|
2475
|
-
TWO_G = "2g",
|
|
2476
|
-
FIVE_G = "2g",
|
|
2477
|
-
THREE_GENT = "3gnet",
|
|
2478
|
-
UNKONWN = "unknown"
|
|
2479
|
-
}
|
|
2480
|
-
interface IWebSocket {
|
|
2481
|
-
/**
|
|
2482
|
-
* 监听连接建立事件,此时 WebSocket 实例已准备好收发数据
|
|
2483
|
-
* @param callback
|
|
2484
|
-
*/
|
|
2485
|
-
onOpen(callback: () => void): void;
|
|
2486
|
-
/**
|
|
2487
|
-
* 监听连接关闭事件
|
|
2488
|
-
* @param callback
|
|
2489
|
-
*/
|
|
2490
|
-
onClose(callback: (code?: number, reason?: string) => void): void;
|
|
2491
|
-
/**
|
|
2492
|
-
* 监听接收服务器消息事件
|
|
2493
|
-
* @param callback
|
|
2494
|
-
*/
|
|
2495
|
-
onMessage(callback: (data: string | ArrayBuffer) => void): void;
|
|
2496
|
-
/**
|
|
2497
|
-
* 监听链接错误事件
|
|
2498
|
-
* @param callback
|
|
2499
|
-
*/
|
|
2500
|
-
onError(callback: (error: unknown) => void): void;
|
|
2501
|
-
/**
|
|
2502
|
-
* 向服务器发送数据
|
|
2503
|
-
* @param data
|
|
2504
|
-
*/
|
|
2505
|
-
send(data: ArrayBuffer | string): void;
|
|
2506
|
-
/**
|
|
2507
|
-
* 关闭连接
|
|
2508
|
-
* @param code
|
|
2509
|
-
* @param reason
|
|
2510
|
-
*/
|
|
2511
|
-
close(code?: number, reason?: string): void;
|
|
2512
|
-
}
|
|
2513
|
-
/**
|
|
2514
|
-
* 平台运行时抽象
|
|
2515
|
-
*/
|
|
2516
|
-
interface IRuntime {
|
|
2517
|
-
/**
|
|
2518
|
-
* 平台标识
|
|
2519
|
-
*/
|
|
2520
|
-
tag: string;
|
|
2521
|
-
/**
|
|
2522
|
-
* 发送 http 请求
|
|
2523
|
-
* @param options
|
|
2524
|
-
*/
|
|
2525
|
-
httpReq(options: IRequest): Promise<IResponse>;
|
|
2526
|
-
/**
|
|
2527
|
-
* 是否使用导航
|
|
2528
|
-
*/
|
|
2529
|
-
useNavi: boolean;
|
|
2530
|
-
/**
|
|
2531
|
-
* websocket 地址上附加的平台字段
|
|
2532
|
-
*/
|
|
2533
|
-
connectPlatform: string;
|
|
2534
|
-
/**
|
|
2535
|
-
* websocket 地址上 apiVer 字段,代表代码是否来源于 uniapp
|
|
2536
|
-
*/
|
|
2537
|
-
isFromUniapp: boolean;
|
|
2538
|
-
/**
|
|
2539
|
-
* 创建长连接实例
|
|
2540
|
-
*/
|
|
2541
|
-
createWebSocket?(url: string, protocols?: string[]): IWebSocket;
|
|
2542
|
-
/**
|
|
2543
|
-
* 存储模块
|
|
2544
|
-
*/
|
|
2545
|
-
localStorage: IStorage;
|
|
2546
|
-
/**
|
|
2547
|
-
* 在某些非浏览器平台,其等同于 localStorage
|
|
2548
|
-
*/
|
|
2549
|
-
sessionStorage: IStorage;
|
|
2550
|
-
/**
|
|
2551
|
-
* 获取网络状态
|
|
2552
|
-
* 2g 3g 4g wifi unkown
|
|
2553
|
-
*/
|
|
2554
|
-
getNetworkType(): Promise<NetworkType>;
|
|
2555
|
-
}
|
|
2556
|
-
|
|
2557
|
-
/**
|
|
2558
|
-
* @category Interface
|
|
2559
|
-
*/
|
|
2560
|
-
interface IAsyncRes<T = void> {
|
|
2561
|
-
/**
|
|
2562
|
-
* Promise 执行结果
|
|
2563
|
-
*/
|
|
2564
|
-
code: ErrorCode;
|
|
2565
|
-
/**
|
|
2566
|
-
* 结果数据
|
|
2567
|
-
*/
|
|
2568
|
-
data?: T;
|
|
2569
|
-
/**
|
|
2570
|
-
* 错误消息
|
|
2571
|
-
*/
|
|
2572
|
-
msg?: string;
|
|
2573
|
-
}
|
|
2574
|
-
/**
|
|
2575
|
-
* 异步任务结果定义
|
|
2576
|
-
* @description
|
|
2577
|
-
* 通过 `Promise.resolve` 来处理预期内的异常,进而通过 Uncatch Promise Error 暴露预期外的异常
|
|
2578
|
-
*/
|
|
2579
|
-
declare type IPromiseResult<T = void> = Promise<IAsyncRes<T>>;
|
|
2580
|
-
interface IConnectResult {
|
|
2581
|
-
/**
|
|
2582
|
-
* 连接错误码
|
|
2583
|
-
*/
|
|
2584
|
-
code: ErrorCode;
|
|
2585
|
-
/**
|
|
2586
|
-
* 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
|
|
2587
|
-
*/
|
|
2588
|
-
userId?: string;
|
|
2589
|
-
}
|
|
2590
|
-
|
|
2591
2310
|
/**
|
|
2592
2311
|
* 从服务器拉取到的会话数据结构
|
|
2593
|
-
* @category Interface
|
|
2594
2312
|
*/
|
|
2595
2313
|
interface IReceivedConversation {
|
|
2596
2314
|
/**
|
|
@@ -2659,9 +2377,6 @@ interface IReceivedConversation {
|
|
|
2659
2377
|
versionTime?: number;
|
|
2660
2378
|
unreadMentionedCount?: number;
|
|
2661
2379
|
}
|
|
2662
|
-
/**
|
|
2663
|
-
* @category Interface
|
|
2664
|
-
*/
|
|
2665
2380
|
interface IReceivedConversationByTag extends IReceivedConversation {
|
|
2666
2381
|
isTopInTag: boolean;
|
|
2667
2382
|
}
|
|
@@ -2720,32 +2435,20 @@ interface IUpdatedConversation {
|
|
|
2720
2435
|
*/
|
|
2721
2436
|
unreadMentionedCount?: number;
|
|
2722
2437
|
}
|
|
2723
|
-
/**
|
|
2724
|
-
* @category Interface
|
|
2725
|
-
*/
|
|
2726
2438
|
interface IBaseConversationInfo {
|
|
2727
2439
|
conversationType: ConversationType;
|
|
2728
2440
|
targetId: string;
|
|
2729
2441
|
channelId: string;
|
|
2730
2442
|
}
|
|
2731
|
-
/**
|
|
2732
|
-
* @category Interface
|
|
2733
|
-
*/
|
|
2734
2443
|
interface IConversationState extends IBaseConversationInfo {
|
|
2735
2444
|
unreadCount: number;
|
|
2736
2445
|
unreadMentionedCount: number;
|
|
2737
2446
|
}
|
|
2738
|
-
/**
|
|
2739
|
-
* 指定超级群会话传参
|
|
2740
|
-
* @category Interface
|
|
2741
|
-
*/
|
|
2447
|
+
/** 指定超级群会话传参 */
|
|
2742
2448
|
interface IUltraGroupOption {
|
|
2743
2449
|
targetId: string;
|
|
2744
2450
|
channelId?: string;
|
|
2745
2451
|
}
|
|
2746
|
-
/**
|
|
2747
|
-
* @category Interface
|
|
2748
|
-
*/
|
|
2749
2452
|
interface IGetUltraGroupListOption {
|
|
2750
2453
|
targetId?: string;
|
|
2751
2454
|
channelType?: UltraGroupChannelType;
|
|
@@ -3009,9 +2712,6 @@ interface INaviInfo {
|
|
|
3009
2712
|
jwt?: string;
|
|
3010
2713
|
}
|
|
3011
2714
|
|
|
3012
|
-
/**
|
|
3013
|
-
* @category Interface
|
|
3014
|
-
*/
|
|
3015
2715
|
interface IChatroomEntryListenerData {
|
|
3016
2716
|
/**
|
|
3017
2717
|
* 更新的键
|
|
@@ -3034,9 +2734,6 @@ interface IChatroomEntryListenerData {
|
|
|
3034
2734
|
*/
|
|
3035
2735
|
type: ChatroomEntryType;
|
|
3036
2736
|
}
|
|
3037
|
-
/**
|
|
3038
|
-
* @category Interface
|
|
3039
|
-
*/
|
|
3040
2737
|
interface IChatroomRejoinedFailed {
|
|
3041
2738
|
/**
|
|
3042
2739
|
* 自动重新加入的聊天室 ID
|
|
@@ -3047,9 +2744,6 @@ interface IChatroomRejoinedFailed {
|
|
|
3047
2744
|
*/
|
|
3048
2745
|
errorCode: number;
|
|
3049
2746
|
}
|
|
3050
|
-
/**
|
|
3051
|
-
* @category Interface
|
|
3052
|
-
*/
|
|
3053
2747
|
interface IChatroomRejoinedSuccessed {
|
|
3054
2748
|
/**
|
|
3055
2749
|
* 自动重新加入的聊天室 ID
|
|
@@ -3060,9 +2754,6 @@ interface IChatroomRejoinedSuccessed {
|
|
|
3060
2754
|
*/
|
|
3061
2755
|
count: number;
|
|
3062
2756
|
}
|
|
3063
|
-
/**
|
|
3064
|
-
* @category Interface
|
|
3065
|
-
*/
|
|
3066
2757
|
interface IChatroomUserChangeInfo {
|
|
3067
2758
|
users: {
|
|
3068
2759
|
[userId: string]: ChatroomUserChangeType;
|
|
@@ -3072,7 +2763,6 @@ interface IChatroomUserChangeInfo {
|
|
|
3072
2763
|
declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
|
|
3073
2764
|
/**
|
|
3074
2765
|
* 聊天室信息
|
|
3075
|
-
* @category Interface
|
|
3076
2766
|
*/
|
|
3077
2767
|
interface IChatroomListenerData {
|
|
3078
2768
|
/**
|
|
@@ -3092,9 +2782,6 @@ interface IChatroomListenerData {
|
|
|
3092
2782
|
*/
|
|
3093
2783
|
chatroomDestroyed?: string;
|
|
3094
2784
|
}
|
|
3095
|
-
/**
|
|
3096
|
-
* @category Interface
|
|
3097
|
-
*/
|
|
3098
2785
|
interface IChatroomEntry {
|
|
3099
2786
|
/**
|
|
3100
2787
|
* 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
|
|
@@ -3117,9 +2804,6 @@ interface IChatroomEntry {
|
|
|
3117
2804
|
*/
|
|
3118
2805
|
isAutoDelete?: boolean;
|
|
3119
2806
|
}
|
|
3120
|
-
/**
|
|
3121
|
-
* @category Interface
|
|
3122
|
-
*/
|
|
3123
2807
|
interface IChatroomUser {
|
|
3124
2808
|
/**
|
|
3125
2809
|
* 用户 id
|
|
@@ -3130,9 +2814,6 @@ interface IChatroomUser {
|
|
|
3130
2814
|
*/
|
|
3131
2815
|
time: number;
|
|
3132
2816
|
}
|
|
3133
|
-
/**
|
|
3134
|
-
* @category Interface
|
|
3135
|
-
*/
|
|
3136
2817
|
interface IChatroomInfo {
|
|
3137
2818
|
/**
|
|
3138
2819
|
* 成员列表
|
|
@@ -3144,9 +2825,6 @@ interface IChatroomInfo {
|
|
|
3144
2825
|
*/
|
|
3145
2826
|
userCount: number;
|
|
3146
2827
|
}
|
|
3147
|
-
/**
|
|
3148
|
-
* @category Interface
|
|
3149
|
-
*/
|
|
3150
2828
|
interface IRemoveChatroomEntry {
|
|
3151
2829
|
/**
|
|
3152
2830
|
* 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
|
|
@@ -3161,9 +2839,6 @@ interface IRemoveChatroomEntry {
|
|
|
3161
2839
|
*/
|
|
3162
2840
|
notificationExtra?: string;
|
|
3163
2841
|
}
|
|
3164
|
-
/**
|
|
3165
|
-
* @category Interface
|
|
3166
|
-
*/
|
|
3167
2842
|
interface IRemoveChatroomEntries {
|
|
3168
2843
|
/**
|
|
3169
2844
|
* key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
|
|
@@ -3179,9 +2854,6 @@ interface IRemoveChatroomEntries {
|
|
|
3179
2854
|
*/
|
|
3180
2855
|
notificationExtra?: string;
|
|
3181
2856
|
}
|
|
3182
|
-
/**
|
|
3183
|
-
* @category Interface
|
|
3184
|
-
*/
|
|
3185
2857
|
interface IChatroomEntries {
|
|
3186
2858
|
/**
|
|
3187
2859
|
* entries ,要设置的属性列表
|
|
@@ -3209,9 +2881,6 @@ interface IChatroomEntries {
|
|
|
3209
2881
|
isForce?: boolean;
|
|
3210
2882
|
}
|
|
3211
2883
|
|
|
3212
|
-
/**
|
|
3213
|
-
* @category Interface
|
|
3214
|
-
*/
|
|
3215
2884
|
interface IUploadAuth {
|
|
3216
2885
|
/**
|
|
3217
2886
|
* 七牛 token 有效期
|
|
@@ -3236,106 +2905,280 @@ interface IUploadAuth {
|
|
|
3236
2905
|
/**
|
|
3237
2906
|
* 上传文件名,阿里上传获取下载地址时,必须使用上传文件名,所以需抛出到业务端
|
|
3238
2907
|
*/
|
|
3239
|
-
fileName: string;
|
|
2908
|
+
fileName: string;
|
|
2909
|
+
/**
|
|
2910
|
+
* 阿里云 oss 的 AccessKeyId
|
|
2911
|
+
*/
|
|
2912
|
+
osskeyId: string;
|
|
2913
|
+
/**
|
|
2914
|
+
* 阿里云 oss post 请求表单域中的字段 policy
|
|
2915
|
+
*/
|
|
2916
|
+
ossPolicy: string;
|
|
2917
|
+
/**
|
|
2918
|
+
* 阿里云 oss 根据 policy 计算的签名信息
|
|
2919
|
+
*/
|
|
2920
|
+
ossSign: string;
|
|
2921
|
+
/**
|
|
2922
|
+
* 阿里云 oss 存储空间名称
|
|
2923
|
+
*/
|
|
2924
|
+
ossBucketName: string;
|
|
2925
|
+
/**
|
|
2926
|
+
* s3 认证凭证,对应 post上传 x-amz-credential 字段
|
|
2927
|
+
*/
|
|
2928
|
+
s3Credential: string;
|
|
2929
|
+
/**
|
|
2930
|
+
* 加密算法,对应 post上传 x-amz-algorithm 字段
|
|
2931
|
+
*/
|
|
2932
|
+
s3Algorithm: string;
|
|
2933
|
+
/**
|
|
2934
|
+
* s3 日期,对应 post上传 x-amz-date 字段
|
|
2935
|
+
*/
|
|
2936
|
+
s3Date: string;
|
|
2937
|
+
/**
|
|
2938
|
+
* s3 policy,对应 post上传 policy 字段
|
|
2939
|
+
*/
|
|
2940
|
+
s3Policy: string;
|
|
2941
|
+
/**
|
|
2942
|
+
* s3 签名信息,对应 post上传 x-amz-signature 字段
|
|
2943
|
+
*/
|
|
2944
|
+
s3Signature: string;
|
|
2945
|
+
/**
|
|
2946
|
+
* s3 存储空间名称
|
|
2947
|
+
*/
|
|
2948
|
+
s3BucketName: string;
|
|
2949
|
+
/**
|
|
2950
|
+
* stc Authorization 头
|
|
2951
|
+
*/
|
|
2952
|
+
stcAuthorization: string;
|
|
2953
|
+
/**
|
|
2954
|
+
* stc xAmzContentSha256
|
|
2955
|
+
*/
|
|
2956
|
+
stcContentSha256: string;
|
|
2957
|
+
/**
|
|
2958
|
+
* stc date
|
|
2959
|
+
*/
|
|
2960
|
+
stcDate: string;
|
|
2961
|
+
/**
|
|
2962
|
+
* stc 存储空间名称
|
|
2963
|
+
*/
|
|
2964
|
+
stcBucketName: string;
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2967
|
+
interface IRTCRoomInfo {
|
|
2968
|
+
roomId: string;
|
|
2969
|
+
roomData: unknown[];
|
|
2970
|
+
userCount: number;
|
|
2971
|
+
list: unknown[];
|
|
2972
|
+
}
|
|
2973
|
+
interface IRtcTokenData {
|
|
2974
|
+
rtcToken: string;
|
|
2975
|
+
}
|
|
2976
|
+
interface IRTCUsers {
|
|
2977
|
+
users: {
|
|
2978
|
+
[userId: string]: {
|
|
2979
|
+
/**
|
|
2980
|
+
* 发布的资源数据,是一个 JSON 字符串,解析后为发布的资源列表
|
|
2981
|
+
*/
|
|
2982
|
+
uris?: string;
|
|
2983
|
+
/**
|
|
2984
|
+
* 加房间的身份标识,保存主房间 roomId
|
|
2985
|
+
*/
|
|
2986
|
+
extra?: string;
|
|
2987
|
+
};
|
|
2988
|
+
};
|
|
2989
|
+
}
|
|
2990
|
+
interface IJoinRTCRoomData extends IRTCUsers {
|
|
2991
|
+
token: string;
|
|
2992
|
+
sessionId: string;
|
|
2993
|
+
roomInfo: {
|
|
2994
|
+
key: string;
|
|
2995
|
+
value: string;
|
|
2996
|
+
}[];
|
|
2997
|
+
kvEntries: IServerRTCRoomEntry[];
|
|
2998
|
+
offlineKickTime: number;
|
|
2999
|
+
}
|
|
3000
|
+
interface KVString {
|
|
3001
|
+
[key: string]: string;
|
|
3002
|
+
}
|
|
3003
|
+
/**
|
|
3004
|
+
* 设置 RTC 人员 inner、outer 数据
|
|
3005
|
+
*/
|
|
3006
|
+
interface IRTCUserData {
|
|
3007
|
+
[key: string]: string;
|
|
3008
|
+
}
|
|
3009
|
+
|
|
3010
|
+
interface IAsyncRes<T = any> {
|
|
3011
|
+
/**
|
|
3012
|
+
* Promise 执行结果
|
|
3013
|
+
*/
|
|
3014
|
+
code: ErrorCode;
|
|
3015
|
+
/**
|
|
3016
|
+
* 结果数据
|
|
3017
|
+
*/
|
|
3018
|
+
data?: T;
|
|
3019
|
+
/**
|
|
3020
|
+
* 错误消息
|
|
3021
|
+
*/
|
|
3022
|
+
msg?: string;
|
|
3023
|
+
}
|
|
3024
|
+
/**
|
|
3025
|
+
* 异步任务结果定义
|
|
3026
|
+
* @description
|
|
3027
|
+
* 通过 `Promise.resolve` 来处理预期内的异常,进而通过 Uncatch Promise Error 暴露预期外的异常
|
|
3028
|
+
*/
|
|
3029
|
+
declare type IPromiseResult<T> = Promise<IAsyncRes<T>>;
|
|
3030
|
+
interface IConnectResult {
|
|
3031
|
+
/**
|
|
3032
|
+
* 连接错误码
|
|
3033
|
+
*/
|
|
3034
|
+
code: ErrorCode;
|
|
3035
|
+
/**
|
|
3036
|
+
* 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
|
|
3037
|
+
*/
|
|
3038
|
+
userId?: string;
|
|
3039
|
+
}
|
|
3040
|
+
|
|
3041
|
+
declare enum HttpMethod {
|
|
3042
|
+
GET = "GET",
|
|
3043
|
+
POST = "POST"
|
|
3044
|
+
}
|
|
3045
|
+
interface IRequest {
|
|
3046
|
+
url: string;
|
|
3047
|
+
/**
|
|
3048
|
+
* @default `HttpMethod.GET`
|
|
3049
|
+
*/
|
|
3050
|
+
method?: HttpMethod | 'GET' | 'POST';
|
|
3051
|
+
/**
|
|
3052
|
+
* 查询数据
|
|
3053
|
+
*/
|
|
3054
|
+
query?: {
|
|
3055
|
+
[key: string]: string | number | null;
|
|
3056
|
+
};
|
|
3057
|
+
/**
|
|
3058
|
+
* Request Header 信息
|
|
3059
|
+
*/
|
|
3060
|
+
headers?: {
|
|
3061
|
+
[key: string]: string;
|
|
3062
|
+
};
|
|
3063
|
+
/**
|
|
3064
|
+
* Request Body 数据
|
|
3065
|
+
*/
|
|
3066
|
+
body?: Object | string;
|
|
3067
|
+
/**
|
|
3068
|
+
* 超时设置
|
|
3069
|
+
* @default 10 * 1000 毫秒
|
|
3070
|
+
*/
|
|
3071
|
+
timeout?: number;
|
|
3072
|
+
/**
|
|
3073
|
+
* 期望返回的数据格式,如果为 json 则返回后会对返回的数据进行一次 JSON.parse, 在小程序平台需要
|
|
3074
|
+
*/
|
|
3075
|
+
dataType?: 'json' | 'text' | 'base64' | 'arraybuffer';
|
|
3076
|
+
}
|
|
3077
|
+
interface IStorage {
|
|
3078
|
+
setItem(key: string, value: string): void;
|
|
3079
|
+
getItem(key: string): string | null;
|
|
3080
|
+
removeItem(key: string): void;
|
|
3081
|
+
clear(): void;
|
|
3082
|
+
}
|
|
3083
|
+
interface IResponse {
|
|
3084
|
+
status: number;
|
|
3085
|
+
data?: string;
|
|
3086
|
+
}
|
|
3087
|
+
/**
|
|
3088
|
+
* 网络状态枚举
|
|
3089
|
+
*/
|
|
3090
|
+
declare enum NetworkType {
|
|
3091
|
+
WIFI = "wifi",
|
|
3092
|
+
FOUR_G = "4g",
|
|
3093
|
+
THREE_G = "3g",
|
|
3094
|
+
TWO_G = "2g",
|
|
3095
|
+
FIVE_G = "2g",
|
|
3096
|
+
THREE_GENT = "3gnet",
|
|
3097
|
+
UNKONWN = "unknown"
|
|
3098
|
+
}
|
|
3099
|
+
interface IWebSocket {
|
|
3100
|
+
/**
|
|
3101
|
+
* 监听连接建立事件,此时 WebSocket 实例已准备好收发数据
|
|
3102
|
+
* @param callback
|
|
3103
|
+
*/
|
|
3104
|
+
onOpen(callback: () => void): void;
|
|
3105
|
+
/**
|
|
3106
|
+
* 监听连接关闭事件
|
|
3107
|
+
* @param callback
|
|
3108
|
+
*/
|
|
3109
|
+
onClose(callback: (code?: number, reason?: string) => void): void;
|
|
3110
|
+
/**
|
|
3111
|
+
* 监听接收服务器消息事件
|
|
3112
|
+
* @param callback
|
|
3113
|
+
*/
|
|
3114
|
+
onMessage(callback: (data: string | ArrayBuffer) => void): void;
|
|
3240
3115
|
/**
|
|
3241
|
-
*
|
|
3116
|
+
* 监听链接错误事件
|
|
3117
|
+
* @param callback
|
|
3242
3118
|
*/
|
|
3243
|
-
|
|
3119
|
+
onError(callback: (error: unknown) => void): void;
|
|
3244
3120
|
/**
|
|
3245
|
-
*
|
|
3121
|
+
* 向服务器发送数据
|
|
3122
|
+
* @param data
|
|
3246
3123
|
*/
|
|
3247
|
-
|
|
3124
|
+
send(data: ArrayBuffer | string): void;
|
|
3248
3125
|
/**
|
|
3249
|
-
*
|
|
3126
|
+
* 关闭连接
|
|
3127
|
+
* @param code
|
|
3128
|
+
* @param reason
|
|
3250
3129
|
*/
|
|
3251
|
-
|
|
3130
|
+
close(code?: number, reason?: string): void;
|
|
3131
|
+
}
|
|
3132
|
+
/**
|
|
3133
|
+
* 平台运行时抽象
|
|
3134
|
+
*/
|
|
3135
|
+
interface IRuntime {
|
|
3252
3136
|
/**
|
|
3253
|
-
*
|
|
3137
|
+
* 平台标识
|
|
3254
3138
|
*/
|
|
3255
|
-
|
|
3139
|
+
tag: string;
|
|
3256
3140
|
/**
|
|
3257
|
-
*
|
|
3141
|
+
* 发送 http 请求
|
|
3142
|
+
* @param options
|
|
3258
3143
|
*/
|
|
3259
|
-
|
|
3144
|
+
httpReq(options: IRequest): Promise<IResponse>;
|
|
3260
3145
|
/**
|
|
3261
|
-
*
|
|
3146
|
+
* 检测是否支持长连接
|
|
3262
3147
|
*/
|
|
3263
|
-
|
|
3148
|
+
isSupportSocket(): boolean;
|
|
3264
3149
|
/**
|
|
3265
|
-
*
|
|
3150
|
+
* 是否使用导航
|
|
3266
3151
|
*/
|
|
3267
|
-
|
|
3152
|
+
useNavi: boolean;
|
|
3268
3153
|
/**
|
|
3269
|
-
*
|
|
3154
|
+
* websocket 地址上附加的平台字段
|
|
3270
3155
|
*/
|
|
3271
|
-
|
|
3156
|
+
connectPlatform: string;
|
|
3272
3157
|
/**
|
|
3273
|
-
*
|
|
3158
|
+
* websocket 地址上 apiVer 字段,代表代码是否来源于 uniapp
|
|
3274
3159
|
*/
|
|
3275
|
-
|
|
3160
|
+
isFromUniapp: boolean;
|
|
3276
3161
|
/**
|
|
3277
|
-
*
|
|
3162
|
+
* 创建长连接实例
|
|
3278
3163
|
*/
|
|
3279
|
-
|
|
3164
|
+
createWebSocket?(url: string, protocols?: string[]): IWebSocket;
|
|
3280
3165
|
/**
|
|
3281
|
-
*
|
|
3166
|
+
* 创建数据通道
|
|
3282
3167
|
*/
|
|
3283
|
-
|
|
3168
|
+
createDataChannel(watcher: IDataChannelWatcher, connectType?: 'websocket' | 'comet'): ADataChannel;
|
|
3284
3169
|
/**
|
|
3285
|
-
*
|
|
3170
|
+
* 存储模块
|
|
3286
3171
|
*/
|
|
3287
|
-
|
|
3172
|
+
localStorage: IStorage;
|
|
3288
3173
|
/**
|
|
3289
|
-
*
|
|
3174
|
+
* 在某些非浏览器平台,其等同于 localStorage
|
|
3290
3175
|
*/
|
|
3291
|
-
|
|
3176
|
+
sessionStorage: IStorage;
|
|
3292
3177
|
/**
|
|
3293
|
-
*
|
|
3178
|
+
* 获取网络状态
|
|
3179
|
+
* 2g 3g 4g wifi unkown
|
|
3294
3180
|
*/
|
|
3295
|
-
|
|
3296
|
-
}
|
|
3297
|
-
|
|
3298
|
-
interface IRTCRoomInfo {
|
|
3299
|
-
roomId: string;
|
|
3300
|
-
roomData: unknown[];
|
|
3301
|
-
userCount: number;
|
|
3302
|
-
list: unknown[];
|
|
3303
|
-
}
|
|
3304
|
-
interface IRtcTokenData {
|
|
3305
|
-
rtcToken: string;
|
|
3306
|
-
}
|
|
3307
|
-
interface IRTCUsers {
|
|
3308
|
-
users: {
|
|
3309
|
-
[userId: string]: {
|
|
3310
|
-
/**
|
|
3311
|
-
* 发布的资源数据,是一个 JSON 字符串,解析后为发布的资源列表
|
|
3312
|
-
*/
|
|
3313
|
-
uris?: string;
|
|
3314
|
-
/**
|
|
3315
|
-
* 加房间的身份标识,保存主房间 roomId
|
|
3316
|
-
*/
|
|
3317
|
-
extra?: string;
|
|
3318
|
-
};
|
|
3319
|
-
};
|
|
3320
|
-
}
|
|
3321
|
-
interface IJoinRTCRoomData extends IRTCUsers {
|
|
3322
|
-
token: string;
|
|
3323
|
-
sessionId: string;
|
|
3324
|
-
roomInfo: {
|
|
3325
|
-
key: string;
|
|
3326
|
-
value: string;
|
|
3327
|
-
}[];
|
|
3328
|
-
kvEntries: IServerRTCRoomEntry[];
|
|
3329
|
-
offlineKickTime: number;
|
|
3330
|
-
}
|
|
3331
|
-
interface KVString {
|
|
3332
|
-
[key: string]: string;
|
|
3333
|
-
}
|
|
3334
|
-
/**
|
|
3335
|
-
* 设置 RTC 人员 inner、outer 数据
|
|
3336
|
-
*/
|
|
3337
|
-
interface IRTCUserData {
|
|
3338
|
-
[key: string]: string;
|
|
3181
|
+
getNetworkType(): Promise<NetworkType>;
|
|
3339
3182
|
}
|
|
3340
3183
|
|
|
3341
3184
|
/**
|
|
@@ -3724,17 +3567,17 @@ interface IEngine {
|
|
|
3724
3567
|
* 创建标签
|
|
3725
3568
|
* @param tag 标签
|
|
3726
3569
|
*/
|
|
3727
|
-
createTag(tag: ITagParam): IPromiseResult
|
|
3570
|
+
createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
|
|
3728
3571
|
/**
|
|
3729
3572
|
* 删除标签
|
|
3730
3573
|
* @param tagId 标签id
|
|
3731
3574
|
*/
|
|
3732
|
-
removeTag(tagId: string): IPromiseResult
|
|
3575
|
+
removeTag(tagId: string): IPromiseResult<IAsyncRes>;
|
|
3733
3576
|
/**
|
|
3734
3577
|
* 编辑标签
|
|
3735
3578
|
* @param tag 标签
|
|
3736
3579
|
*/
|
|
3737
|
-
updateTag(tag: ITagParam): IPromiseResult
|
|
3580
|
+
updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
|
|
3738
3581
|
/**
|
|
3739
3582
|
* 获取标签列表
|
|
3740
3583
|
*/
|
|
@@ -3744,20 +3587,20 @@ interface IEngine {
|
|
|
3744
3587
|
* @param tagId 标签id
|
|
3745
3588
|
* @param conversations 要添加的会话列表
|
|
3746
3589
|
*/
|
|
3747
|
-
addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult
|
|
3590
|
+
addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
|
|
3748
3591
|
/**
|
|
3749
3592
|
* 删除标签中的会话(从多个会话中批量删除指定标签)
|
|
3750
3593
|
* @param tagId 标签id
|
|
3751
3594
|
* @param conversations 要删除的会话列表
|
|
3752
3595
|
*/
|
|
3753
|
-
removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult
|
|
3596
|
+
removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
|
|
3754
3597
|
/**
|
|
3755
3598
|
* 删除会话中的标签(从单一会话中批量删除标签)
|
|
3756
3599
|
* @param conversationType 会话类型
|
|
3757
3600
|
* @param targetId 会话id
|
|
3758
3601
|
* @param tagIds 要删除的标签列表
|
|
3759
3602
|
*/
|
|
3760
|
-
removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult
|
|
3603
|
+
removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
|
|
3761
3604
|
/**
|
|
3762
3605
|
* 获取标签下的会话列表
|
|
3763
3606
|
* @param tagId 标签id
|
|
@@ -3773,7 +3616,7 @@ interface IEngine {
|
|
|
3773
3616
|
* 设置标签中会话置顶
|
|
3774
3617
|
* @param conversation 会话
|
|
3775
3618
|
*/
|
|
3776
|
-
setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult
|
|
3619
|
+
setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
|
|
3777
3620
|
/**
|
|
3778
3621
|
* 获取会话里的标签
|
|
3779
3622
|
* @param config
|
|
@@ -3997,9 +3840,6 @@ interface IRTCJoinedInfo {
|
|
|
3997
3840
|
joinTime: number;
|
|
3998
3841
|
}
|
|
3999
3842
|
|
|
4000
|
-
/**
|
|
4001
|
-
* @category Interface
|
|
4002
|
-
*/
|
|
4003
3843
|
interface IRTCRoomBindOption {
|
|
4004
3844
|
/**
|
|
4005
3845
|
* 聊天室 ID
|
|
@@ -4011,10 +3851,6 @@ interface IRTCRoomBindOption {
|
|
|
4011
3851
|
rtcRoomId: string;
|
|
4012
3852
|
}
|
|
4013
3853
|
|
|
4014
|
-
/**
|
|
4015
|
-
* 扩展更新
|
|
4016
|
-
* @category Interface
|
|
4017
|
-
*/
|
|
4018
3854
|
interface IUpdatedExpansion {
|
|
4019
3855
|
expansion: {
|
|
4020
3856
|
[key: string]: any;
|
|
@@ -4022,19 +3858,11 @@ interface IUpdatedExpansion {
|
|
|
4022
3858
|
messageUId: string;
|
|
4023
3859
|
channelId?: string;
|
|
4024
3860
|
}
|
|
4025
|
-
/**
|
|
4026
|
-
* 扩展删除
|
|
4027
|
-
* @category Interface
|
|
4028
|
-
*/
|
|
4029
3861
|
interface IDeletedExpansion {
|
|
4030
3862
|
deletedKeys: string[];
|
|
4031
3863
|
messageUId: string;
|
|
4032
3864
|
channelId?: string;
|
|
4033
3865
|
}
|
|
4034
|
-
/**
|
|
4035
|
-
* 扩展变更监听
|
|
4036
|
-
* @category Interface
|
|
4037
|
-
*/
|
|
4038
3866
|
interface IExpansionListenerData {
|
|
4039
3867
|
updatedExpansion?: IUpdatedExpansion;
|
|
4040
3868
|
deletedExpansion?: IDeletedExpansion;
|
|
@@ -4181,32 +4009,6 @@ interface IEndRoomPKOptions {
|
|
|
4181
4009
|
keys: string[];
|
|
4182
4010
|
}
|
|
4183
4011
|
|
|
4184
|
-
/**
|
|
4185
|
-
* 消息送达相关接口
|
|
4186
|
-
*/
|
|
4187
|
-
interface IDeliveredUser {
|
|
4188
|
-
time: number;
|
|
4189
|
-
userId: string;
|
|
4190
|
-
}
|
|
4191
|
-
interface IGroupMessageDeliverInfo {
|
|
4192
|
-
totalCount: number;
|
|
4193
|
-
list: IDeliveredUser[];
|
|
4194
|
-
}
|
|
4195
|
-
interface IMessageDeliver {
|
|
4196
|
-
deliverTime: number;
|
|
4197
|
-
messageUId: string;
|
|
4198
|
-
objectName: string;
|
|
4199
|
-
targetId: string;
|
|
4200
|
-
}
|
|
4201
|
-
interface IGroupMessageDeliveredStatusInfo {
|
|
4202
|
-
MessageUId: string;
|
|
4203
|
-
deliveryCount: number;
|
|
4204
|
-
}
|
|
4205
|
-
interface IGroupMessageDeliverStatus {
|
|
4206
|
-
totalCount: number;
|
|
4207
|
-
list: IGroupMessageDeliveredStatusInfo[];
|
|
4208
|
-
}
|
|
4209
|
-
|
|
4210
4012
|
/**
|
|
4211
4013
|
* IndexDB中存储的log数据
|
|
4212
4014
|
*/
|
|
@@ -4232,16 +4034,6 @@ interface ILogInit {
|
|
|
4232
4034
|
localLogLevel?: LogLevel;
|
|
4233
4035
|
customLogPrint?: (logLevel: LogLevel, msg: string) => void;
|
|
4234
4036
|
}
|
|
4235
|
-
interface IInitBigDataOption {
|
|
4236
|
-
runtime?: IRuntime;
|
|
4237
|
-
appkey?: string;
|
|
4238
|
-
version?: string;
|
|
4239
|
-
userId?: string;
|
|
4240
|
-
}
|
|
4241
|
-
interface IBigdataLogInit extends IInitBigDataOption {
|
|
4242
|
-
logUrl: string;
|
|
4243
|
-
sessionId: string;
|
|
4244
|
-
}
|
|
4245
4037
|
|
|
4246
4038
|
/**
|
|
4247
4039
|
* 定义已废弃,请使用 `IRemoveChatroomEntries` 替换
|
|
@@ -4269,7 +4061,8 @@ declare type IRemoveChatRoomEntry = IRemoveChatroomEntry;
|
|
|
4269
4061
|
*/
|
|
4270
4062
|
declare class DataCodec {
|
|
4271
4063
|
private _codec;
|
|
4272
|
-
private
|
|
4064
|
+
private _connectType;
|
|
4065
|
+
constructor(connectType: 'websocket' | 'comet');
|
|
4273
4066
|
/**
|
|
4274
4067
|
* PB 数据 转为 rmtp 数据 反序列化 通用数据
|
|
4275
4068
|
* 根据解析的 PBName 分配解码方法. 如果没有单独的解码方法定义. 直接返回 pb 解析后的结果
|
|
@@ -4541,19 +4334,53 @@ interface IDataChannelWatcher {
|
|
|
4541
4334
|
*/
|
|
4542
4335
|
signal: (signal: PublishReader, ack?: PubAckReader) => void;
|
|
4543
4336
|
}
|
|
4337
|
+
/**
|
|
4338
|
+
* 数据通道接口,为 long-polling 与 websocket 提供公共抽象
|
|
4339
|
+
*/
|
|
4340
|
+
declare abstract class ADataChannel {
|
|
4341
|
+
protected _watcher: IDataChannelWatcher;
|
|
4342
|
+
/**
|
|
4343
|
+
* 通道所需的数据编解码器
|
|
4344
|
+
*/
|
|
4345
|
+
readonly codec: DataCodec;
|
|
4346
|
+
connectedTime: number;
|
|
4347
|
+
userId: string;
|
|
4348
|
+
sendConnectTime: number;
|
|
4349
|
+
constructor(type: 'websocket' | 'comet', _watcher: IDataChannelWatcher);
|
|
4350
|
+
/**
|
|
4351
|
+
* 建立连接,连接成功则返回 Websocket 实例,否则返回连接错误码
|
|
4352
|
+
* @param appkey
|
|
4353
|
+
* @param token
|
|
4354
|
+
* @param hosts 服务器地址,不包含协议头,`hostname:port`
|
|
4355
|
+
* @param protocol 请求导航数据时使用的网络协议, /ping 与 websocket 需要继续遵循该协议
|
|
4356
|
+
* @param apiVersion - apiVersion 需符合 `/\d+(\.\d+){2}/` 规则,对于预发布版本号如 `3.1.0-alpha.1` 需认定为 `3.1.0`
|
|
4357
|
+
*/
|
|
4358
|
+
abstract connect(appkey: string, token: string, host: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
|
|
4359
|
+
/**
|
|
4360
|
+
* 只发送数据,无需响应
|
|
4361
|
+
*/
|
|
4362
|
+
abstract sendOnly(writer: BaseWriter): void;
|
|
4363
|
+
/**
|
|
4364
|
+
*
|
|
4365
|
+
* @param writer
|
|
4366
|
+
* @param pbName 响应数据的 PB 定义
|
|
4367
|
+
* @param timeout 超时配置,单位 ms
|
|
4368
|
+
*/
|
|
4369
|
+
abstract send<T>(writer: QueryWriter | PublishWriter, pbName?: string, option?: any, timeout?: number): IPromiseResult<T>;
|
|
4370
|
+
/**
|
|
4371
|
+
* 关闭数据通道,同时清空监听
|
|
4372
|
+
*/
|
|
4373
|
+
abstract close(): void;
|
|
4374
|
+
}
|
|
4375
|
+
|
|
4544
4376
|
/**
|
|
4545
4377
|
* @todo 迁移中的 DataCodec 模块导致数据通道不够独立,与 xhr-polling 通信可能会有耦合,后续需解耦
|
|
4546
4378
|
* @description
|
|
4547
4379
|
* 1. 基于 WebSocket 协议建立数据通道,实现数据收发
|
|
4548
4380
|
* 2. 基于 Protobuf 进行数据编解码
|
|
4549
4381
|
*/
|
|
4550
|
-
declare class WebSocketChannel {
|
|
4382
|
+
declare class WebSocketChannel extends ADataChannel {
|
|
4551
4383
|
private _runtime;
|
|
4552
|
-
private _watcher;
|
|
4553
|
-
readonly codec: DataCodec;
|
|
4554
|
-
connectedTime: number;
|
|
4555
|
-
userId: string;
|
|
4556
|
-
sendConnectTime: number;
|
|
4557
4384
|
private _socket;
|
|
4558
4385
|
private _pingResolve?;
|
|
4559
4386
|
/**
|
|
@@ -4564,15 +4391,14 @@ declare class WebSocketChannel {
|
|
|
4564
4391
|
* 接收多端同步消息时,等待 PubAck 的 Promise.resolve 函数
|
|
4565
4392
|
*/
|
|
4566
4393
|
private _syncMessageIds;
|
|
4567
|
-
constructor(_runtime: IRuntime,
|
|
4394
|
+
constructor(_runtime: IRuntime, watcher: IDataChannelWatcher);
|
|
4568
4395
|
/**
|
|
4569
|
-
*
|
|
4396
|
+
* 建立 websocket 连接
|
|
4570
4397
|
* @param appkey
|
|
4571
4398
|
* @param token
|
|
4572
|
-
* @param hosts
|
|
4573
|
-
* @param protocol
|
|
4574
|
-
* @param apiVersion 需符合 `/\d+(\.\d+){2}/`
|
|
4575
|
-
* @param protocolVer
|
|
4399
|
+
* @param hosts
|
|
4400
|
+
* @param protocol
|
|
4401
|
+
* @param apiVersion - apiVersion 需符合 `/\d+(\.\d+){2}/` 规则
|
|
4576
4402
|
*/
|
|
4577
4403
|
connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
|
|
4578
4404
|
/**
|
|
@@ -4593,24 +4419,47 @@ declare class WebSocketChannel {
|
|
|
4593
4419
|
private _timer;
|
|
4594
4420
|
private _checkAlive;
|
|
4595
4421
|
private _onReceiveSignal;
|
|
4596
|
-
/**
|
|
4597
|
-
* 只发送数据,无需响应
|
|
4598
|
-
*/
|
|
4599
4422
|
sendOnly(writer: BaseWriter): void;
|
|
4600
4423
|
/**
|
|
4601
4424
|
* 有效值 0 - 65535,超出 65535 位数超长溢出
|
|
4602
4425
|
*/
|
|
4603
4426
|
private _idCount;
|
|
4604
4427
|
private _generateMessageId;
|
|
4428
|
+
send(writer: QueryWriter | PublishWriter, respPBName?: string, option?: any, timeout?: number): Promise<IAsyncRes>;
|
|
4429
|
+
close(): void;
|
|
4430
|
+
}
|
|
4431
|
+
|
|
4432
|
+
declare class CometChannel extends ADataChannel {
|
|
4433
|
+
private _runtime;
|
|
4434
|
+
private _pid;
|
|
4435
|
+
private _sessionid;
|
|
4436
|
+
private _domain;
|
|
4437
|
+
private _isDisconnected;
|
|
4438
|
+
private _messageIds;
|
|
4439
|
+
private _syncMessageIds;
|
|
4440
|
+
private _protocol;
|
|
4441
|
+
constructor(_runtime: IRuntime, watcher: IDataChannelWatcher);
|
|
4605
4442
|
/**
|
|
4606
|
-
*
|
|
4607
|
-
* @param
|
|
4608
|
-
* @param timeout 超时配置,单位 ms
|
|
4443
|
+
* 长轮询结果处理
|
|
4444
|
+
* @param data
|
|
4609
4445
|
*/
|
|
4610
|
-
|
|
4446
|
+
handleCometRes(res: IResponse): boolean;
|
|
4611
4447
|
/**
|
|
4612
|
-
*
|
|
4448
|
+
* 长轮询心跳
|
|
4613
4449
|
*/
|
|
4450
|
+
_startPullSignal(protocol: 'http' | 'https'): Promise<void>;
|
|
4451
|
+
/**
|
|
4452
|
+
* 连接
|
|
4453
|
+
* comet 连接暂时不走 protocolVer=v4 的协议
|
|
4454
|
+
* @returns
|
|
4455
|
+
*/
|
|
4456
|
+
connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
|
|
4457
|
+
private _connect;
|
|
4458
|
+
private _idCount;
|
|
4459
|
+
private _generateMessageId;
|
|
4460
|
+
sendCometData(writer: BaseWriter, timeout?: number): Promise<void>;
|
|
4461
|
+
sendOnly(writer: BaseWriter): void;
|
|
4462
|
+
send(writer: QueryWriter | PublishWriter, respPBName?: string, option?: any, timeout?: number): Promise<IAsyncRes>;
|
|
4614
4463
|
close(): void;
|
|
4615
4464
|
}
|
|
4616
4465
|
|
|
@@ -4628,8 +4477,6 @@ declare type ITagListener = () => void;
|
|
|
4628
4477
|
declare type IConversationTagListener = () => void;
|
|
4629
4478
|
declare type ItypingStateListener = (data: ITypingMessage[]) => void;
|
|
4630
4479
|
declare type IMessageBlockedListener = (data: IBlockedMessageInfo) => void;
|
|
4631
|
-
declare type IMessageDeliveredListener = (data: IMessageDeliver[]) => void;
|
|
4632
|
-
declare type IGroupMessageDeliveredStatusListener = (data: IGroupMessageDeliverStatus) => void;
|
|
4633
4480
|
interface IWatcher {
|
|
4634
4481
|
message?: IMessageListnenr;
|
|
4635
4482
|
batchMessage?: IMessagesListnenr;
|
|
@@ -4654,14 +4501,6 @@ interface IWatcher {
|
|
|
4654
4501
|
*/
|
|
4655
4502
|
typingState?: ItypingStateListener;
|
|
4656
4503
|
pullFinished?: ITagListener;
|
|
4657
|
-
/**
|
|
4658
|
-
* 单聊消息送达通知
|
|
4659
|
-
*/
|
|
4660
|
-
messageDelivered?: IMessageDeliveredListener;
|
|
4661
|
-
/**
|
|
4662
|
-
* 群聊消息送达状态通知
|
|
4663
|
-
*/
|
|
4664
|
-
groupMessageDeliveredStatus?: IGroupMessageDeliveredStatusListener;
|
|
4665
4504
|
onConnecting?: () => void;
|
|
4666
4505
|
onConnected?: () => void;
|
|
4667
4506
|
onDisconnect?: (status: ConnectionStatus) => void;
|
|
@@ -4715,6 +4554,10 @@ interface IAPIContextOption {
|
|
|
4715
4554
|
* 小程序的 CMP 代理地址
|
|
4716
4555
|
*/
|
|
4717
4556
|
miniCMPProxy: string[];
|
|
4557
|
+
/**
|
|
4558
|
+
* 指定默认使用的连接类型
|
|
4559
|
+
*/
|
|
4560
|
+
connectionType: 'websocket' | 'comet';
|
|
4718
4561
|
/**
|
|
4719
4562
|
* 修改 engine log 打印等级
|
|
4720
4563
|
*/
|
|
@@ -4740,32 +4583,6 @@ interface IAPIContextOption {
|
|
|
4740
4583
|
* 是否校验证书,默认为 true
|
|
4741
4584
|
*/
|
|
4742
4585
|
checkCA?: boolean;
|
|
4743
|
-
/**
|
|
4744
|
-
* TODO: 自定义策略覆盖服务策略有安全风险,等产品确认通用化逻辑,是否前后端共同建立双重开关
|
|
4745
|
-
* 目前仅 Beem Web-Meeting 使用
|
|
4746
|
-
* @deprecated
|
|
4747
|
-
* @hidden
|
|
4748
|
-
* 实时日志收集功能自定义上传策略
|
|
4749
|
-
* @param {number} logSwitch 日志收集功能开关,0 关闭;1 开启
|
|
4750
|
-
* @param {LogLevel} level 日志上传级别
|
|
4751
|
-
* @param {number} itv: interval 即日志上传间隔,单位秒,最小时间间隔 1 秒
|
|
4752
|
-
*/
|
|
4753
|
-
logPolicy?: {
|
|
4754
|
-
logSwitch?: number;
|
|
4755
|
-
level?: LogLevel;
|
|
4756
|
-
itv?: number;
|
|
4757
|
-
};
|
|
4758
|
-
/**
|
|
4759
|
-
* 开启后,SDK 内的 HTTP 请求将由 Electron 主进程内发送。
|
|
4760
|
-
* @since 5.6.0
|
|
4761
|
-
* @description
|
|
4762
|
-
* 仅在 Electron 环境中搭配 `@rongcloud/electron-renderer` 与 `@rongcloud/electron` 包时有效。
|
|
4763
|
-
* * 当值为 `true` 时,HTTP 请求由 Electron 主进程内发送,不受浏览器安全沙箱策略限制。
|
|
4764
|
-
* * 当值为 `false` 时,保持使用 Chromium 的 XMLHttpRequest 发送 HTTP 协议请求,
|
|
4765
|
-
* 请求由渲染进程内发出,受浏览器安全沙箱策略限制。
|
|
4766
|
-
* @defautl `false`
|
|
4767
|
-
*/
|
|
4768
|
-
httpInMainProcess: boolean;
|
|
4769
4586
|
}
|
|
4770
4587
|
|
|
4771
4588
|
interface IPluginGenerator<API, InitOption> {
|
|
@@ -4801,18 +4618,22 @@ declare type KeyType<T> = T[keyof T & number] & string;
|
|
|
4801
4618
|
declare type ModuleType<T> = {
|
|
4802
4619
|
[key in KeyType<T>]?: any;
|
|
4803
4620
|
};
|
|
4804
|
-
declare class
|
|
4621
|
+
declare abstract class AbsCodec<T> {
|
|
4805
4622
|
/**
|
|
4806
4623
|
* Key 对应的 Value 结构映射表,用于不同 Key 数据的编解码
|
|
4807
4624
|
*/
|
|
4808
|
-
|
|
4809
|
-
private readonly pbModules;
|
|
4625
|
+
protected pbmaps: T;
|
|
4810
4626
|
constructor(
|
|
4811
4627
|
/**
|
|
4812
4628
|
* Key 对应的 Value 结构映射表,用于不同 Key 数据的编解码
|
|
4813
4629
|
*/
|
|
4814
|
-
pbmaps: T
|
|
4815
|
-
|
|
4630
|
+
pbmaps: T);
|
|
4631
|
+
/**
|
|
4632
|
+
* 数据反序列化,反序列化的结果为未加工的原始数据,decode 函数本身不处理 format 过程
|
|
4633
|
+
* @param pbname 待解码数据的 PB 名
|
|
4634
|
+
* @param data 待解码数据
|
|
4635
|
+
*/
|
|
4636
|
+
abstract decode(pbname: string, data: Uint8Array | string): any;
|
|
4816
4637
|
/**
|
|
4817
4638
|
* 数据序列化
|
|
4818
4639
|
* @param pbname 待编码数据的 PB 名
|
|
@@ -4826,20 +4647,14 @@ declare class Codec<T> {
|
|
|
4826
4647
|
* const data = codec.encode('pb2', { key: buffer })
|
|
4827
4648
|
* ```
|
|
4828
4649
|
*/
|
|
4829
|
-
encode<K extends string & keyof T>(pbname: K, params?: ModuleType<T[K]>, returnSourceModule?: boolean): ArrayBuffer
|
|
4830
|
-
/**
|
|
4831
|
-
* 数据反序列化,反序列化的结果为未加工的原始数据,decode 函数本身不处理 format 过程
|
|
4832
|
-
* @param pbname 待解码数据的 PB 名
|
|
4833
|
-
* @param data 待解码数据
|
|
4834
|
-
*/
|
|
4835
|
-
decode(pbname: string, uint8array: Uint8Array): any;
|
|
4650
|
+
abstract encode<K extends string & keyof T>(pbname: K, params?: ModuleType<T[K]>, returnSourceModule?: boolean): ArrayBuffer | ModuleType<T[K]>;
|
|
4836
4651
|
}
|
|
4837
4652
|
|
|
4838
4653
|
declare class APIContext {
|
|
4839
4654
|
private _runtime;
|
|
4840
4655
|
private static _context?;
|
|
4841
4656
|
static init(runtime: IRuntime, options: IAPIContextOption): APIContext;
|
|
4842
|
-
static destroy():
|
|
4657
|
+
static destroy(): void;
|
|
4843
4658
|
private _token;
|
|
4844
4659
|
/**
|
|
4845
4660
|
* 插件队列,用于逐一派发消息与信令
|
|
@@ -4870,7 +4685,7 @@ declare class APIContext {
|
|
|
4870
4685
|
*/
|
|
4871
4686
|
private readonly _rtcCodec;
|
|
4872
4687
|
constructor(_runtime: IRuntime, options: IAPIContextOption);
|
|
4873
|
-
createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string):
|
|
4688
|
+
createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string): AbsCodec<T>;
|
|
4874
4689
|
/**
|
|
4875
4690
|
* 安装使用插件,并初始化插件实例
|
|
4876
4691
|
* @param plugin
|
|
@@ -4917,9 +4732,6 @@ declare class APIContext {
|
|
|
4917
4732
|
private _typingStatusListener;
|
|
4918
4733
|
private _pullFinishedListener;
|
|
4919
4734
|
private _MessageBlockedListener;
|
|
4920
|
-
private _messageDeliveredListerer;
|
|
4921
|
-
private _groupMessageDeliveredStatusListerer;
|
|
4922
|
-
private _callInfoListener;
|
|
4923
4735
|
private _ultraGroupEnableListener;
|
|
4924
4736
|
private _operateStatusListener;
|
|
4925
4737
|
private _ultraGroupMessageExpansionUpdatedListener;
|
|
@@ -4945,7 +4757,7 @@ declare class APIContext {
|
|
|
4945
4757
|
* @param options
|
|
4946
4758
|
*/
|
|
4947
4759
|
assignWatcher(watcher: IWatcher): void;
|
|
4948
|
-
|
|
4760
|
+
resetWatcher(): void;
|
|
4949
4761
|
/**
|
|
4950
4762
|
* 向内存中添加 typing 信息
|
|
4951
4763
|
* 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
|
|
@@ -5314,20 +5126,20 @@ declare class APIContext {
|
|
|
5314
5126
|
* @param tagId 标签id
|
|
5315
5127
|
* @param conversations 要添加的会话列表
|
|
5316
5128
|
*/
|
|
5317
|
-
addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes
|
|
5129
|
+
addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
|
|
5318
5130
|
/**
|
|
5319
5131
|
* 删除标签中的会话(从多个会话中批量删除指定标签)
|
|
5320
5132
|
* @param tagId 标签id
|
|
5321
5133
|
* @param conversations 要删除的会话列表
|
|
5322
5134
|
*/
|
|
5323
|
-
removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes
|
|
5135
|
+
removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
|
|
5324
5136
|
/**
|
|
5325
5137
|
* 删除会话中的标签(从单一会话中批量删除标签)
|
|
5326
5138
|
* @param conversationType 会话类型
|
|
5327
5139
|
* @param targetId 会话id
|
|
5328
5140
|
* @param tagIds 要删除的标签列表
|
|
5329
5141
|
*/
|
|
5330
|
-
removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes
|
|
5142
|
+
removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<IAsyncRes>>;
|
|
5331
5143
|
/**
|
|
5332
5144
|
* 获取标签下的会话列表
|
|
5333
5145
|
* @param tagId 标签id
|
|
@@ -5345,7 +5157,7 @@ declare class APIContext {
|
|
|
5345
5157
|
*/
|
|
5346
5158
|
setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
|
|
5347
5159
|
isTop: boolean;
|
|
5348
|
-
}): Promise<IAsyncRes
|
|
5160
|
+
}): Promise<IAsyncRes<IAsyncRes>>;
|
|
5349
5161
|
/**
|
|
5350
5162
|
* 获取会话里的标签
|
|
5351
5163
|
* @param conversation
|
|
@@ -5373,9 +5185,7 @@ declare class APIContext {
|
|
|
5373
5185
|
* 根据消息 ID 查询消息列表
|
|
5374
5186
|
* @param options
|
|
5375
5187
|
*/
|
|
5376
|
-
getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes
|
|
5377
|
-
[messageUid: string]: IReceivedMessage | undefined;
|
|
5378
|
-
}>>;
|
|
5188
|
+
getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes>;
|
|
5379
5189
|
/**
|
|
5380
5190
|
* 扩展已有的超级群消息
|
|
5381
5191
|
* @param options 设置的扩展
|
|
@@ -5436,18 +5246,6 @@ declare class APIContext {
|
|
|
5436
5246
|
* 获取应用主进程信息,仅限 Electron 平台可用
|
|
5437
5247
|
*/
|
|
5438
5248
|
getMainProcessInfo(): IPromiseResult<IProcessInfo>;
|
|
5439
|
-
setCallInfo(targetId: string, key: string, value: string): Promise<IAsyncRes<{
|
|
5440
|
-
key: string;
|
|
5441
|
-
value: string;
|
|
5442
|
-
}>>;
|
|
5443
|
-
/**
|
|
5444
|
-
* 获取群组消息送达信息
|
|
5445
|
-
*/
|
|
5446
|
-
getGroupMessageDeliverList(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IGroupMessageDeliverInfo>>;
|
|
5447
|
-
/**
|
|
5448
|
-
* 获取单聊消息送达信息
|
|
5449
|
-
*/
|
|
5450
|
-
getPrivateMessageDeliverTime(messageUId: string, channelId?: string): Promise<IAsyncRes<number>>;
|
|
5451
5249
|
/**
|
|
5452
5250
|
* 删除所有会话
|
|
5453
5251
|
*/
|
|
@@ -5572,7 +5370,7 @@ declare class APIContext {
|
|
|
5572
5370
|
clearData(): Promise<IAsyncRes<boolean>>;
|
|
5573
5371
|
rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: any): Promise<{
|
|
5574
5372
|
code: ErrorCode;
|
|
5575
|
-
buffer?: Uint8Array;
|
|
5373
|
+
buffer?: Uint8Array | string;
|
|
5576
5374
|
}>;
|
|
5577
5375
|
/**
|
|
5578
5376
|
* 加入房间
|
|
@@ -5659,7 +5457,7 @@ declare class PluginContext {
|
|
|
5659
5457
|
* 获取 context
|
|
5660
5458
|
*/
|
|
5661
5459
|
__getContext(): APIContext;
|
|
5662
|
-
createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string):
|
|
5460
|
+
createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string): AbsCodec<T>;
|
|
5663
5461
|
/**
|
|
5664
5462
|
* 获取当前的导航数据
|
|
5665
5463
|
*/
|
|
@@ -5685,10 +5483,6 @@ declare class PluginContext {
|
|
|
5685
5483
|
* IM 客户端销毁通知
|
|
5686
5484
|
*/
|
|
5687
5485
|
ondestroy?(): void;
|
|
5688
|
-
/**
|
|
5689
|
-
* beem 专有接口,做 groupCall 用到
|
|
5690
|
-
*/
|
|
5691
|
-
onCallInfo?(data: string): void;
|
|
5692
5486
|
/**
|
|
5693
5487
|
* 获取 `@rongcloud/engine` 包版本
|
|
5694
5488
|
*/
|
|
@@ -5740,10 +5534,6 @@ declare class PluginContext {
|
|
|
5740
5534
|
* 获取应用主进程信息,仅限 Electron 平台可用
|
|
5741
5535
|
*/
|
|
5742
5536
|
getMainProcessInfo(): IPromiseResult<IProcessInfo>;
|
|
5743
|
-
setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
|
|
5744
|
-
key: string;
|
|
5745
|
-
value: string;
|
|
5746
|
-
}>;
|
|
5747
5537
|
}
|
|
5748
5538
|
|
|
5749
5539
|
declare class RTCPluginContext extends PluginContext {
|
|
@@ -5921,7 +5711,7 @@ declare class RTCPluginContext extends PluginContext {
|
|
|
5921
5711
|
*/
|
|
5922
5712
|
rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: any): Promise<{
|
|
5923
5713
|
code: ErrorCode;
|
|
5924
|
-
buffer?: Uint8Array;
|
|
5714
|
+
buffer?: Uint8Array | string;
|
|
5925
5715
|
}>;
|
|
5926
5716
|
/**
|
|
5927
5717
|
* RTC KV 数据通知
|
|
@@ -5939,10 +5729,33 @@ declare class RTCPluginContext extends PluginContext {
|
|
|
5939
5729
|
getRTCJoinedUserInfo(userId: string): IPromiseResult<IRTCJoinedInfo[]>;
|
|
5940
5730
|
}
|
|
5941
5731
|
|
|
5942
|
-
declare const keymaps:
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5732
|
+
declare const keymaps: {
|
|
5733
|
+
readonly RtcInput: readonly ["roomType", "broadcastType", "extraInnerData", "needSysChatroom", "identityChangeType", "joinType", "innerDatas", "outerDatas"];
|
|
5734
|
+
readonly RtcUserListOutput: readonly ["users", "token", "sessionId", "roomInfo"];
|
|
5735
|
+
readonly SetUserStatusInput: readonly ["status"];
|
|
5736
|
+
readonly RtcSetDataInput: readonly ["interior", "target", "key", "value", "objectName", "content"];
|
|
5737
|
+
readonly RtcUserSetDataInput: readonly ["valueInfo", "objectName", "content"];
|
|
5738
|
+
readonly RtcDataInput: readonly ["interior", "target", "key", "objectName", "content"];
|
|
5739
|
+
readonly RtcSetOutDataInput: readonly ["target", "valueInfo", "objectName", "content"];
|
|
5740
|
+
readonly MCFollowInput: readonly ["state"];
|
|
5741
|
+
readonly RtcTokenOutput: readonly ["rtcToken"];
|
|
5742
|
+
readonly RtcQryOutput: readonly ["outInfo"];
|
|
5743
|
+
readonly RtcQryUserOutDataInput: readonly ["userId"];
|
|
5744
|
+
readonly RtcUserOutDataOutput: readonly ["user"];
|
|
5745
|
+
readonly RtcQueryListInput: readonly ["order"];
|
|
5746
|
+
readonly RtcRoomInfoOutput: readonly ["roomId", "roomData", "userCount", "list"];
|
|
5747
|
+
readonly RtcValueInfo: readonly ["key", "value"];
|
|
5748
|
+
readonly RtcKeyDeleteInput: readonly ["key"];
|
|
5749
|
+
readonly RtcNotifyMsg: readonly ["type", "time", "roomId"];
|
|
5750
|
+
readonly RtcPullKV: readonly ["timestamp", "roomId"];
|
|
5751
|
+
readonly RtcKVOutput: readonly ["entries", "bFullUpdate", "syncTime"];
|
|
5752
|
+
readonly RtcQueryUserJoinedInput: readonly ["userId"];
|
|
5753
|
+
readonly RtcQueryUserJoinedOutput: readonly ["info"];
|
|
5754
|
+
readonly RtcInviteInput: readonly ["invitedUserId", "timeoutTime", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
5755
|
+
readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
|
|
5756
|
+
readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
|
|
5757
|
+
readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
|
|
5758
|
+
};
|
|
5946
5759
|
declare type RTCKeyMaps = typeof keymaps;
|
|
5947
5760
|
|
|
5948
5761
|
interface IEngineWatcher {
|
|
@@ -5971,9 +5784,7 @@ interface IEngineWatcher {
|
|
|
5971
5784
|
*/
|
|
5972
5785
|
onRTCDataChange: (data: IServerRTCRoomEntry[], roomId?: string) => void;
|
|
5973
5786
|
pullFinished: () => void;
|
|
5974
|
-
|
|
5975
|
-
groupMessageDeliveredStatus: (data: IGroupMessageDeliverStatus) => void;
|
|
5976
|
-
callInfo: (data: string) => void;
|
|
5787
|
+
/** 导航数据变更 */
|
|
5977
5788
|
onNaviDataChange: (naviInfo: INaviInfo) => void;
|
|
5978
5789
|
}
|
|
5979
5790
|
/**
|
|
@@ -5981,7 +5792,7 @@ interface IEngineWatcher {
|
|
|
5981
5792
|
*/
|
|
5982
5793
|
declare abstract class AEngine implements IEngine {
|
|
5983
5794
|
readonly runtime: IRuntime;
|
|
5984
|
-
readonly rtcCodec:
|
|
5795
|
+
readonly rtcCodec: AbsCodec<RTCKeyMaps>;
|
|
5985
5796
|
protected readonly _watcher: IEngineWatcher;
|
|
5986
5797
|
protected readonly _options: IAPIContextOption;
|
|
5987
5798
|
/**
|
|
@@ -5996,7 +5807,7 @@ declare abstract class AEngine implements IEngine {
|
|
|
5996
5807
|
* 引擎初始化
|
|
5997
5808
|
* @param _appkey
|
|
5998
5809
|
*/
|
|
5999
|
-
constructor(runtime: IRuntime, rtcCodec:
|
|
5810
|
+
constructor(runtime: IRuntime, rtcCodec: AbsCodec<RTCKeyMaps>, _watcher: IEngineWatcher, _options: IAPIContextOption);
|
|
6000
5811
|
protected _rtcSignalingListener?: (buffer: Uint8Array) => void;
|
|
6001
5812
|
/**
|
|
6002
5813
|
* 注册 RTC KV 变更监听器
|
|
@@ -6330,17 +6141,17 @@ declare abstract class AEngine implements IEngine {
|
|
|
6330
6141
|
* 创建标签
|
|
6331
6142
|
* @param tag 标签
|
|
6332
6143
|
*/
|
|
6333
|
-
abstract createTag(tag: ITagParam): IPromiseResult
|
|
6144
|
+
abstract createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
|
|
6334
6145
|
/**
|
|
6335
6146
|
* 删除标签
|
|
6336
6147
|
* @param tagId 标签id
|
|
6337
6148
|
*/
|
|
6338
|
-
abstract removeTag(tagId: string): IPromiseResult
|
|
6149
|
+
abstract removeTag(tagId: string): IPromiseResult<IAsyncRes>;
|
|
6339
6150
|
/**
|
|
6340
6151
|
* 编辑标签
|
|
6341
6152
|
* @param tag 标签
|
|
6342
6153
|
*/
|
|
6343
|
-
abstract updateTag(tag: ITagParam): IPromiseResult
|
|
6154
|
+
abstract updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
|
|
6344
6155
|
/**
|
|
6345
6156
|
* 获取标签列表
|
|
6346
6157
|
*/
|
|
@@ -6350,20 +6161,20 @@ declare abstract class AEngine implements IEngine {
|
|
|
6350
6161
|
* @param tagId 标签id
|
|
6351
6162
|
* @param conversations 要添加的会话列表
|
|
6352
6163
|
*/
|
|
6353
|
-
abstract addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult
|
|
6164
|
+
abstract addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
|
|
6354
6165
|
/**
|
|
6355
6166
|
* 删除标签中的会话(从多个会话中批量删除指定标签)
|
|
6356
6167
|
* @param tagId 标签id
|
|
6357
6168
|
* @param conversations 要删除的会话列表
|
|
6358
6169
|
*/
|
|
6359
|
-
abstract removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult
|
|
6170
|
+
abstract removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
|
|
6360
6171
|
/**
|
|
6361
6172
|
* 删除会话中的标签(从单一会话中批量删除标签)
|
|
6362
6173
|
* @param conversationType 会话类型
|
|
6363
6174
|
* @param targetId 会话id
|
|
6364
6175
|
* @param tagIds 要删除的标签列表
|
|
6365
6176
|
*/
|
|
6366
|
-
abstract removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult
|
|
6177
|
+
abstract removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
|
|
6367
6178
|
/**
|
|
6368
6179
|
* 获取标签下的会话列表
|
|
6369
6180
|
* @param tagId 标签id
|
|
@@ -6379,7 +6190,7 @@ declare abstract class AEngine implements IEngine {
|
|
|
6379
6190
|
* 设置标签中会话置顶
|
|
6380
6191
|
* @param conversation 会话
|
|
6381
6192
|
*/
|
|
6382
|
-
abstract setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult
|
|
6193
|
+
abstract setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
|
|
6383
6194
|
/**
|
|
6384
6195
|
* 获取会话里的标签
|
|
6385
6196
|
* @param config
|
|
@@ -6438,7 +6249,7 @@ declare abstract class AEngine implements IEngine {
|
|
|
6438
6249
|
* @param targetId
|
|
6439
6250
|
* @param options
|
|
6440
6251
|
*/
|
|
6441
|
-
abstract sendUltraMessage(targetId: string, options: ISendMsgOptions, onSendBefore?: (messageId: number) => void, traceId?: string): Promise<IAsyncRes
|
|
6252
|
+
abstract sendUltraMessage(targetId: string, options: ISendMsgOptions, onSendBefore?: (messageId: number) => void, traceId?: string): Promise<IAsyncRes>;
|
|
6442
6253
|
/**
|
|
6443
6254
|
* 超级群消息正在输入中
|
|
6444
6255
|
* @param options
|
|
@@ -6448,9 +6259,7 @@ declare abstract class AEngine implements IEngine {
|
|
|
6448
6259
|
* 拉取超级群变更后的消息列表
|
|
6449
6260
|
* @param time
|
|
6450
6261
|
*/
|
|
6451
|
-
abstract getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes<
|
|
6452
|
-
[messageUid: string]: IReceivedMessage | undefined;
|
|
6453
|
-
}>>;
|
|
6262
|
+
abstract getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes<Object>>;
|
|
6454
6263
|
/**
|
|
6455
6264
|
* 对已有的消息进行扩展
|
|
6456
6265
|
* @param options
|
|
@@ -6466,11 +6275,7 @@ declare abstract class AEngine implements IEngine {
|
|
|
6466
6275
|
* @param targetId
|
|
6467
6276
|
* @param options
|
|
6468
6277
|
*/
|
|
6469
|
-
abstract getUltraHistoryMsg(targetId: string, options: IGetMsgOption, traceId?: string): Promise<IAsyncRes
|
|
6470
|
-
list: IReceivedMessage[];
|
|
6471
|
-
syncTime: number;
|
|
6472
|
-
hasMore: boolean;
|
|
6473
|
-
}>>;
|
|
6278
|
+
abstract getUltraHistoryMsg(targetId: string, options: IGetMsgOption, traceId?: string): Promise<IAsyncRes>;
|
|
6474
6279
|
abstract getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
|
|
6475
6280
|
abstract getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
|
|
6476
6281
|
/**
|
|
@@ -6618,18 +6423,6 @@ declare abstract class AEngine implements IEngine {
|
|
|
6618
6423
|
list: IReceivedMessage[];
|
|
6619
6424
|
hasMore: boolean;
|
|
6620
6425
|
}>;
|
|
6621
|
-
/**
|
|
6622
|
-
* 获取群组消息送达列表
|
|
6623
|
-
*/
|
|
6624
|
-
abstract getGroupMessageDeliverList(targetId: string, messageUId: string, channelId: string): IPromiseResult<IGroupMessageDeliverInfo>;
|
|
6625
|
-
/**
|
|
6626
|
-
* 获取单聊消息送达列表
|
|
6627
|
-
*/
|
|
6628
|
-
abstract getPrivateMessageDeliverTime(messageUId: string, channelId: string): IPromiseResult<number>;
|
|
6629
|
-
abstract setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
|
|
6630
|
-
key: string;
|
|
6631
|
-
value: string;
|
|
6632
|
-
}>;
|
|
6633
6426
|
/**
|
|
6634
6427
|
* 无差别获取本地免打扰列表
|
|
6635
6428
|
*/
|
|
@@ -6679,9 +6472,9 @@ declare abstract class AEngine implements IEngine {
|
|
|
6679
6472
|
* @param isQuery 使用 `qry` or `pub` 进行请求,按服务要求传递
|
|
6680
6473
|
* @param sourceData PB 数据
|
|
6681
6474
|
*/
|
|
6682
|
-
abstract rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: ArrayBuffer): Promise<{
|
|
6475
|
+
abstract rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: ArrayBuffer | object): Promise<{
|
|
6683
6476
|
code: ErrorCode;
|
|
6684
|
-
buffer?: Uint8Array;
|
|
6477
|
+
buffer?: Uint8Array | string;
|
|
6685
6478
|
}>;
|
|
6686
6479
|
abstract rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
|
|
6687
6480
|
joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData): IPromiseResult<IJoinRTCRoomData>;
|
|
@@ -6899,7 +6692,7 @@ declare const sessionId: string;
|
|
|
6899
6692
|
* logLevelTransformer
|
|
6900
6693
|
* @description 数据中心与前端日志规范LogLevel定义不统一
|
|
6901
6694
|
* WebLogLevel(前端日志级别) -> ServerLogLevel(服务器日志级别)
|
|
6902
|
-
* @param level LogLevel
|
|
6695
|
+
* @param level { LogLevel }
|
|
6903
6696
|
* @returns serverLogLevel
|
|
6904
6697
|
*/
|
|
6905
6698
|
declare function logLevelTransformer(level: LogLevel): number;
|
|
@@ -6968,7 +6761,7 @@ declare namespace base {
|
|
|
6968
6761
|
|
|
6969
6762
|
/**
|
|
6970
6763
|
* 缓存日志实时
|
|
6971
|
-
* @param
|
|
6764
|
+
* @param logLevel 日志等级
|
|
6972
6765
|
* @param tagId 日志标签
|
|
6973
6766
|
* @param content 日志内容
|
|
6974
6767
|
*/
|
|
@@ -7033,6 +6826,7 @@ declare class Logger {
|
|
|
7033
6826
|
}
|
|
7034
6827
|
declare const _default: Logger;
|
|
7035
6828
|
|
|
6829
|
+
declare const randomNum: (min: number, max: number) => number;
|
|
7036
6830
|
declare const getUUID: () => string;
|
|
7037
6831
|
declare const getUUID22: () => string;
|
|
7038
6832
|
|
|
@@ -7083,7 +6877,6 @@ declare class RCAssertError extends Error {
|
|
|
7083
6877
|
}
|
|
7084
6878
|
/**
|
|
7085
6879
|
* 参数校验,该方法用于对业务层入参数据检查,及时抛出异常通知业务层进行修改
|
|
7086
|
-
* @deprecated 优先使用 `validate` 替代,禁止直接 throw error 阻断调用栈
|
|
7087
6880
|
* @description
|
|
7088
6881
|
* 1. 必填参数,value 需符合 validator 验证规,否则抛出异常
|
|
7089
6882
|
* 2. 非必填参数,value 可为 undefined | null 或符合 validator 规则
|
|
@@ -7190,14 +6983,14 @@ declare const clone: (target: any) => any;
|
|
|
7190
6983
|
* Navi 缓存数据有效时长,单位毫秒
|
|
7191
6984
|
*/
|
|
7192
6985
|
declare const NAVI_CACHE_DURATION: number;
|
|
7193
|
-
/**
|
|
7194
|
-
* 默认 HTTP 请求超时时间,单位毫秒
|
|
7195
|
-
*/
|
|
7196
|
-
declare const HTTP_TIMEOUT: number;
|
|
7197
6986
|
/**
|
|
7198
6987
|
* 单个 Navi 请求的超时时间,单位毫秒
|
|
7199
6988
|
*/
|
|
7200
6989
|
declare const NAVI_REQ_TIMEOUT: number;
|
|
6990
|
+
/**
|
|
6991
|
+
* /ping?r= 请求的超时时间,单位毫秒
|
|
6992
|
+
*/
|
|
6993
|
+
declare const PING_REQ_TIMEOUT: number;
|
|
7201
6994
|
/**
|
|
7202
6995
|
* WebSocket 建立连接超时时间,单位毫秒
|
|
7203
6996
|
*/
|
|
@@ -7210,6 +7003,10 @@ declare const PUBLIC_CLOUD_NAVI_URIS: string[];
|
|
|
7210
7003
|
* 小程序 websocket 连接地址
|
|
7211
7004
|
*/
|
|
7212
7005
|
declare const MINI_SOCKET_CONNECT_URIS: string[];
|
|
7006
|
+
/**
|
|
7007
|
+
* 小程序 长轮询 连接地址
|
|
7008
|
+
*/
|
|
7009
|
+
declare const MINI_COMET_CONNECT_URIS: string[];
|
|
7213
7010
|
/**
|
|
7214
7011
|
* IM 接口超时时间,单位毫秒
|
|
7215
7012
|
*/
|
|
@@ -7230,6 +7027,10 @@ declare const IM_PING_MIN_TIMEOUT: number;
|
|
|
7230
7027
|
* 消息 content 内容尺寸限制:128 KB
|
|
7231
7028
|
*/
|
|
7232
7029
|
declare const MAX_MESSAGE_CONTENT_BYTES: number;
|
|
7030
|
+
/**
|
|
7031
|
+
* IM Comet 发送 pullmsg(嗅探 + 等待信令) 超时时间 45s
|
|
7032
|
+
*/
|
|
7033
|
+
declare const IM_COMET_PULLMSG_TIMEOUT = 45000;
|
|
7233
7034
|
/**
|
|
7234
7035
|
* IM 加入聊天室后定时拉取消息和 KV 时间间隔
|
|
7235
7036
|
*/
|
|
@@ -7266,22 +7067,21 @@ declare const CPP_PROTOCAL_MSGTYPE_OPTION: {
|
|
|
7266
7067
|
* 状态消息(不存储,不计数,并且上线后不会拉取离线的状态消息)
|
|
7267
7068
|
*/
|
|
7268
7069
|
declare const STATUS_MESSAGE: string[];
|
|
7070
|
+
/**
|
|
7071
|
+
* 连接类型
|
|
7072
|
+
*/
|
|
7073
|
+
declare enum CONNECTION_TYPE {
|
|
7074
|
+
WEBSOCKET = "websocket",
|
|
7075
|
+
COMET = "comet"
|
|
7076
|
+
}
|
|
7269
7077
|
declare const REAT_TIME_LOG_SIZE = 500;
|
|
7270
7078
|
declare const DB_LOG_MAX_SIZE = 100000;
|
|
7271
7079
|
declare const DB_LOG_FLUSH_FREQUENCY = 3000;
|
|
7272
7080
|
declare const ONE_LOG_SIZE_MAX = 1000;
|
|
7273
|
-
/** 日志上报域名 */
|
|
7274
|
-
declare const LOG_REPORT_URI = "logcollection.ronghub.com";
|
|
7275
|
-
|
|
7276
|
-
/**
|
|
7277
|
-
* 请使用 `Codec` 替代 `AbsCodec`
|
|
7278
|
-
* @deprecated
|
|
7279
|
-
*/
|
|
7280
|
-
declare type AbsCodec<T> = Codec<T>;
|
|
7281
7081
|
|
|
7282
7082
|
/**
|
|
7283
7083
|
* engine 版本号
|
|
7284
7084
|
*/
|
|
7285
7085
|
declare const version: string;
|
|
7286
7086
|
|
|
7287
|
-
export { AEngine, APIContext, AbsCodec, AppStorage, AssertRules, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType,
|
|
7087
|
+
export { AEngine, APIContext, AbsCodec, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DB_LOG_FLUSH_FREQUENCY, DB_LOG_MAX_SIZE, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBlockedMessageInfo, ICancelRoomPKOptions, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGetMsgOption, IGetUltraGroupListOption, IGooglePushConfig, IInsertMsgOptions, IIsValidExpansion, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, ILogExtensions, ILogInfo, ILogInit, IM_CHATROOM_PULL_INTERVAL_TIME, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, 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, ItypingStateListener, KVString, LiveRole, LiveType, LogLevel, LogSource, LogTagId, Logger, MAX_MESSAGE_CONTENT_BYTES, MAX_MESSAGE_EXPANSION_KEY_LENGTH, MAX_MESSAGE_EXPANSION_VAL_LENGTH, MINI_COMET_CONNECT_URIS, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NetworkType, NotificationLevel, NotificationStatus, ONE_LOG_SIZE_MAX, OperateStatus, PING_REQ_TIMEOUT, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, REAT_TIME_LOG_SIZE, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCKeyMaps, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UltraGroupChannelChangeType, UltraGroupChannelType, UltraMsgChangeType, UltraMsgSubChangeType, UploadMethod, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, clone, cloneByJSON, _default as engineLogger, forEach, formatConnectResponseCode, getBrowser, getClientMessageId, getMimeKey, getUUID, getUUID22, getUploadFileName, indexOf, 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, randomNum, todo, usingCppEngine, validate, version };
|