@rongcloud/engine 4.5.2 → 4.6.0-beem.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCEngine - v4.5.2
3
- * CommitId - ba81ca4a531f2c59a5e2f0cecb5e05aab7e03210
4
- * Thu Nov 25 2021 10:37:04 GMT+0800 (China Standard Time)
2
+ * RCEngine - v4.6.0-beem.1
3
+ * CommitId - 4789dcdc52f61868235bcda3f31eff906bab3674
4
+ * Wed Jan 05 2022 14:09:26 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -558,12 +558,17 @@ interface IUserProfile {
558
558
  name?: string;
559
559
  /**
560
560
  * 用户头像地址
561
+ * @deprecated
561
562
  */
562
563
  portraitUri?: string;
563
564
  /**
564
565
  * user info 中附加信息
565
566
  */
566
567
  extra?: string;
568
+ /**
569
+ * 用户头像地址(向移动端兼容)
570
+ */
571
+ portrait?: string;
567
572
  }
568
573
  /**
569
574
  * 发送消息时的可选项信息
@@ -1733,6 +1738,10 @@ interface IRequest {
1733
1738
  * @default 10 * 1000 毫秒
1734
1739
  */
1735
1740
  timeout?: number;
1741
+ /**
1742
+ * 期望返回的数据格式,如果为 json 则返回后会对返回的数据进行一次 JSON.parse, 在小程序平台需要
1743
+ */
1744
+ dataType?: 'json' | 'text' | 'base64' | 'arraybuffer';
1736
1745
  }
1737
1746
  interface IStorage {
1738
1747
  setItem(key: string, value: string): void;
@@ -1852,6 +1861,10 @@ declare class WebSocketChannel extends ADataChannel {
1852
1861
  * @param apiVersion - apiVersion 需符合 `/\d+(\.\d+){2}/` 规则
1853
1862
  */
1854
1863
  connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
1864
+ /**
1865
+ * 发起连接请求
1866
+ */
1867
+ private _connect;
1855
1868
  /**
1856
1869
  * 当前累计心跳超时次数
1857
1870
  */
@@ -1901,6 +1914,7 @@ declare class CometChannel extends ADataChannel {
1901
1914
  * @returns
1902
1915
  */
1903
1916
  connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
1917
+ private _connect;
1904
1918
  private _idCount;
1905
1919
  private _generateMessageId;
1906
1920
  sendCometData(writer: BaseWriter, timeout?: number): Promise<void>;
@@ -2624,6 +2638,7 @@ declare class PluginContext {
2624
2638
  * 目前仅通知:主播加入、退出房间的人员列表变更,发布、取消发布资源列表变更
2625
2639
  */
2626
2640
  onrtcdatachange?(data: IServerRTCRoomEntry[], roomdId?: string): void;
2641
+ onCallInfo?(data: string): void;
2627
2642
  /**
2628
2643
  * 获取 `@rongcloud/engine` 包版本
2629
2644
  */
@@ -2667,6 +2682,10 @@ declare class PluginContext {
2667
2682
  * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
2668
2683
  */
2669
2684
  getRTCJoinedUserInfo(userId: string): IPromiseResult<IRTCJoinedInfo[]>;
2685
+ setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
2686
+ key: string;
2687
+ value: string;
2688
+ }>;
2670
2689
  }
2671
2690
 
2672
2691
  declare enum ReceivedStatus {
@@ -2859,8 +2878,9 @@ declare enum MessageType {
2859
2878
  */
2860
2879
  GROUP_READ_RECEIPT_REQUEST = "RC:RRMsg",
2861
2880
  /**
2862
- * 用户加入聊天室
2881
+ * 消息送达报告,仅单聊
2863
2882
  */
2883
+ DELIVERED = "RC:Delivered",
2864
2884
  CHATROOM_JOIN = "RC:ChrmJoinNtf",
2865
2885
  /**
2866
2886
  * 用户退出聊天室
@@ -2936,6 +2956,24 @@ declare enum LogType {
2936
2956
  RTC = "RTC"
2937
2957
  }
2938
2958
 
2959
+ /**
2960
+ * 消息被拦截类型
2961
+ */
2962
+ declare enum MessageBlockType {
2963
+ /*!
2964
+ 全局敏感词:命中了融云内置的全局敏感词
2965
+ */
2966
+ GLOBAL = 1,
2967
+ /*!
2968
+ 自定义敏感词拦截:命中了客户在融云自定义的敏感词
2969
+ */
2970
+ CUSTOM = 2,
2971
+ /*!
2972
+ 第三方审核拦截:命中了第三方(数美)或模板路由决定不下发的状态
2973
+ */
2974
+ THIRD_PARTY = 3
2975
+ }
2976
+
2939
2977
  /**
2940
2978
  * 导航信息数据就结构
2941
2979
  */
@@ -3188,672 +3226,429 @@ interface ITypingMessage {
3188
3226
  }
3189
3227
 
3190
3228
  /**
3191
- * 消息被拦截类型
3229
+ * 消息送达相关接口
3192
3230
  */
3193
- declare enum MessageBlockType {
3194
- /*!
3195
- 全局敏感词:命中了融云内置的全局敏感词
3196
- */
3197
- GLOBAL = 1,
3198
- /*!
3199
- 自定义敏感词拦截:命中了客户在融云自定义的敏感词
3200
- */
3201
- CUSTOM = 2,
3202
- /*!
3203
- 第三方审核拦截:命中了第三方(数美)或模板路由决定不下发的状态
3204
- */
3205
- THIRD_PARTY = 3
3206
- }
3207
3231
 
3208
- /**
3209
- * 被拦截的消息信息
3210
- */
3211
- interface IBlockedMessageInfo {
3212
- blockedMessageUId: string;
3213
- conversationType: number;
3232
+ interface IDeliveredUser {
3233
+ time: number;
3234
+ userId: string;
3235
+ }
3236
+ interface IGroupMessageDeliverInfo {
3237
+ totalCount: number;
3238
+ list: IDeliveredUser[];
3239
+ }
3240
+ interface IMessageDeliver {
3241
+ deliverTime: number;
3242
+ messageUId: string;
3243
+ conversationType: ConversationType;
3214
3244
  targetId: string;
3215
- blockType: MessageBlockType;
3216
3245
  }
3217
3246
 
3218
- interface IConnectResult {
3247
+ /**
3248
+ * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
3249
+ */
3250
+ interface IEngine {
3219
3251
  /**
3220
- * 连接错误码
3252
+ * 建立连接
3253
+ * @param token
3254
+ * @param naviInfo
3221
3255
  */
3222
- code: ErrorCode;
3256
+ connect(token: string, naviInfo: INaviInfo, versionInfo: string): Promise<ErrorCode>;
3223
3257
  /**
3224
- * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
3258
+ * 上报版本信息
3259
+ * @param version
3225
3260
  */
3226
- userId?: string;
3227
- }
3228
- declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
3229
- declare type IConnectionStatusListener = (status: ConnectionStatus) => void;
3230
- declare type IConversationStateListener = (conversation: IUpdatedConversation[]) => void;
3231
- declare type IChatroomListener = (state: IChatroomListenerData) => void;
3232
- declare type IRTCInnerListener = {
3233
- message?: IMessageListnenr;
3234
- status?: IConnectionStatusListener;
3235
- };
3236
- declare type IExpansionListener = (data: IExpansionListenerData) => void;
3237
- declare type ITagListener = () => void;
3238
- declare type IConversationTagListener = () => void;
3239
- declare type ItypingStateListener = (data: ITypingMessage[]) => void;
3240
- declare type IMessageBlockedListener = (data: IBlockedMessageInfo) => void;
3241
- interface ISendExMsgOptions {
3242
- channelId: string;
3243
- conversationType: ConversationType;
3244
- targetId: string;
3261
+ reportSDKInfo(version: {
3262
+ [name: string]: string;
3263
+ }): void;
3245
3264
  /**
3246
- * 消息 ID
3265
+ * 连接时间
3266
+ */
3267
+ getConnectedTime(): number;
3268
+ /**
3269
+ * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
3270
+ * 对于未实现的方法,接口响应 Unsupport 错误码
3271
+ * @param method
3272
+ * @param args
3273
+ */
3274
+ callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
3275
+ /**
3276
+ * 获取历史消息
3277
+ * @param conversationType
3278
+ * @param targetId
3279
+ * @param timestamp
3280
+ * @param count
3281
+ * @param order
3282
+ */
3283
+ getHistoryMessage(conversationType: ConversationType, targetId: string,
3284
+ /**
3285
+ * 拉取时间戳,值为 `0` 表示从当前时间拉取
3286
+ */
3287
+ timestamp: number,
3288
+ /**
3289
+ * 获取条数, 有效值 `1` - `20`
3290
+ */
3291
+ count: number,
3292
+ /**
3293
+ * @description
3294
+ * 1. `0` 表示升序,获取消息发送时间比传入 `sentTime` 小 的消息
3295
+ * 2. `1` 表示降序,获取消息发送时间比传入 `sentTime` 大 的消息
3296
+ */
3297
+ order: 0 | 1,
3298
+ /**
3299
+ * 会话的业务标识
3247
3300
  */
3248
- messageUId: string;
3301
+ channelId: string,
3249
3302
  /**
3250
- * 原始消息是否支持扩展的字段
3303
+ * 消息类型
3304
+ */
3305
+ objectName: string): IPromiseResult<{
3306
+ list: IReceivedMessage[];
3307
+ hasMore: boolean;
3308
+ }>;
3309
+ /**
3310
+ * 删除历史消息 通过 messageUId
3251
3311
  */
3252
- canIncludeExpansion: boolean;
3312
+ deleteRemoteMessage(conversationType: ConversationType, targetId: string,
3253
3313
  /**
3254
- * 删除的 keys
3314
+ * @description
3315
+ * message 中 messageUId、setTime、messageDirection 为必须参数
3255
3316
  */
3256
- keys?: string[];
3317
+ messages: {
3318
+ messageUId: string;
3319
+ sentTime: number;
3320
+ messageDirection: MessageDirection;
3321
+ }[],
3257
3322
  /**
3258
- * 扩展对象
3323
+ * 会话的业务标识
3259
3324
  */
3260
- expansion?: {
3261
- [key: string]: string;
3262
- };
3325
+ channelId: string): Promise<ErrorCode>;
3326
+ recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
3263
3327
  /**
3264
- * 是否删除所有扩展
3328
+ * 删除历史消息 通过 时间戳
3329
+ * @param timestamp 小于等于传入时间戳的消息均删除
3265
3330
  */
3266
- removeAll?: boolean;
3331
+ deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number,
3267
3332
  /**
3268
- * 原始消息的扩展
3333
+ * 会话的业务标识
3269
3334
  */
3270
- originExpansion?: {
3271
- [key: string]: string;
3272
- } | null;
3273
- }
3274
- interface IWatcher {
3275
- message?: IMessageListnenr;
3276
- connectionState?: IConnectionStatusListener;
3277
- conversationState?: IConversationStateListener;
3278
- chatroomState?: IChatroomListener;
3279
- expansion?: IExpansionListener;
3335
+ channelId: string): Promise<ErrorCode>;
3280
3336
  /**
3281
- * 为兼容老版本 RTCLib 与 CallLib 接收消息的方式,新版本消息走插件机制
3337
+ * 获取会话列表
3338
+ * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
3282
3339
  */
3283
- rtcInnerWatcher?: IRTCInnerListener;
3340
+ getConversationList(
3284
3341
  /**
3285
- * 标签的增删改监听
3342
+ * 拉取数量, 有效值 0 - 1000, 默认 300
3286
3343
  */
3287
- tag?: ITagListener;
3344
+ count: number,
3288
3345
  /**
3289
- * 会话中标签状态变更监听
3346
+ * 会话类型
3347
+ * @todo 待确认是否生效
3290
3348
  */
3291
- conversationTagChanged?: IConversationTagListener;
3349
+ conversationType?: ConversationType,
3292
3350
  /**
3293
- * 输入状态变更监听
3294
- */
3295
- typingState?: ItypingStateListener;
3351
+ * 起始时间
3352
+ */
3353
+ startTime?: number,
3296
3354
  /**
3297
- * 是否拉取完毕添加通知
3355
+ * 获取顺序
3356
+ */
3357
+ order?: 0 | 1,
3358
+ /**
3359
+ * 会话的业务标识
3360
+ */
3361
+ channelId?: string): IPromiseResult<IReceivedConversation[]>;
3362
+ /**
3363
+ * 获取指定会话
3364
+ */
3365
+ getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
3366
+ /**
3367
+ * 删除会话
3368
+ * @description 该删除操作会删除服务器端存储的会话数据
3369
+ * @param conversationType
3370
+ * @param targetId
3298
3371
  */
3299
- pullFinished?: ITagListener;
3372
+ removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3300
3373
  /**
3301
- * 敏感词被拦截监听
3374
+ * 获取所有会话未读数
3375
+ * @param channelId 多组织 Id
3376
+ * @param conversationTypes
3377
+ * @param includeMuted 包含已设置免打扰的会话
3302
3378
  */
3303
- messageBlocked?: IMessageBlockedListener;
3304
- }
3305
- interface IPluginGenerator<API, InitOption> {
3379
+ getAllConversationUnreadCount(channelId: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
3306
3380
  /**
3307
- * 只读插件标识
3381
+ * 获取指定会话未读数
3308
3382
  */
3309
- readonly tag: string;
3383
+ getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
3310
3384
  /**
3311
- * 版本号
3385
+ * 清除指定会话未读数
3312
3386
  */
3313
- readonly version?: string;
3387
+ clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3314
3388
  /**
3315
- * 插件名称
3389
+ * 获取第一个未读消息
3316
3390
  */
3317
- readonly name?: string;
3391
+ getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
3318
3392
  /**
3319
- * 插件安装前的环境检测,通过返回 boolean 值确认插件是否可运行
3393
+ * 设置/保存指定会话消息草稿
3394
+ * @draft 草稿内容
3320
3395
  */
3321
- verify(runtime: IRuntime): boolean;
3396
+ saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
3322
3397
  /**
3323
- * 插件初始化
3324
- * @param context 插件调用上下文,用于实现插件的消息注册、消息首发等
3325
- * @param runtime 运行时实例,用于标识最终的运行时平台
3326
- * @param options 初始化参数
3398
+ * 获取指定会话消息草稿
3327
3399
  */
3328
- setup(context: PluginContext, runtime: IRuntime, options: InitOption): API;
3329
- }
3330
- interface IAPIContextOption {
3400
+ getConversationMessageDraft(conversationType: ConversationType, targetId: string): IPromiseResult<string>;
3331
3401
  /**
3332
- * 应用 appkey
3402
+ * 清除指定会话消息草稿
3333
3403
  */
3334
- appkey: string;
3404
+ clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
3335
3405
  /**
3336
- * IMLib 版本号
3406
+ * 从服务端拉取会话状态
3337
3407
  */
3338
- apiVersion: string;
3408
+ pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
3339
3409
  /**
3340
- * 自定义导航地址:
3341
- * 1. 私有云环境下该值为必填项
3342
- * 2. 当存在自定义导航地址时,SDK 内部默认地址将无效
3343
- * 3. 当存在自定义导航地址时,地址 url 中需包含 http/https 协议头,否则视为无效值
3344
- * 4. 建立 ws/wss 连接前的 ping 接口使用的协议与导航 url 中的协议相同
3345
- * 5. 建立 websocket 建立连接时将根据 ping 接口使用的 http/https 协议来确定使用 ws/wss 协议
3346
- * 6. 动态导航使用的协议头将与自定义导航地址相同
3347
- * 7. 公有云默认使用 https 协议
3410
+ * 批量设置会话 置顶、免打扰
3348
3411
  */
3349
- navigators: string[];
3350
- /**
3351
- * (参数已废弃)~~c++ 协议栈数据库地址~~
3352
- * @deprecated
3353
- */
3354
- dbPath?: string;
3412
+ batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
3413
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): IPromiseResult<IReceivedMessage>;
3355
3414
  /**
3356
- * 小程序的 CMP 代理地址
3415
+ * 断开连接
3357
3416
  */
3358
- miniCMPProxy: string[];
3417
+ disconnect(): void;
3359
3418
  /**
3360
- * 指定默认使用的连接类型
3419
+ * 拉取用户级配置数据
3361
3420
  */
3362
- connectionType: 'websocket' | 'comet';
3421
+ pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
3363
3422
  /**
3364
- * 修改 engine log 打印等级
3423
+ * 消息注册
3424
+ * @description
3425
+ * 消息注册需在应用初始化完成前进行,否则在搭配 C++ 协议栈使用时,
3426
+ * 本端发出的消息将不默认作为未知消息处理,不存储、不计数
3427
+ * @param objectName 消息类型,如:RC:TxtMsg
3428
+ * @param isPersited 是否存储
3429
+ * @param isCounted 是否技术
3430
+ * @param searchProps 搜索字段,只在搭配协议栈使用时有效
3365
3431
  */
3366
- logLevel?: LogLevel;
3432
+ registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
3367
3433
  /**
3368
- * 修改默认的 log 输出函数
3369
- */
3370
- logStdout?: (logLevel: LogLevel, content: string) => void;
3434
+ * 加入聊天室
3435
+ * @param count 拉取消息数量
3436
+ */
3437
+ joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
3371
3438
  /**
3372
- * (已废弃)私有云标识
3373
- * @deprecated
3374
- */
3375
- isEnterPrise?: boolean;
3439
+ * 加入已存在的聊天室
3440
+ * @param count 拉取消息数量
3441
+ */
3442
+ joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
3376
3443
  /**
3377
- * typing状态过期时间
3378
- */
3379
- typingExpireTime?: number;
3444
+ * 退出聊天室
3445
+ */
3446
+ quitChatroom(chatroomId: string): Promise<ErrorCode>;
3380
3447
  /**
3381
- * 是否打开 IndexDB 存储,默认为 true
3382
- */
3383
- indexDBSwitch?: boolean;
3448
+ * 获取聊天室信息
3449
+ * @param count 获取人数, 范围 0 - 20
3450
+ * @param order 排序方式, 1 正序, 2 倒序
3451
+ */
3452
+ getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
3384
3453
  /**
3385
- * 是否校验证书,默认为 true
3386
- */
3387
- checkCA?: boolean;
3388
- }
3389
- declare class APIContext {
3390
- private _runtime;
3391
- private static _context?;
3392
- static init(runtime: IRuntime, options: IAPIContextOption): APIContext;
3393
- static destroy(): void;
3394
- private _token;
3454
+ * 获取聊天室历史消息
3455
+ */
3456
+ getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
3457
+ list: IReceivedMessage[];
3458
+ hasMore: boolean;
3459
+ }>;
3395
3460
  /**
3396
- * 插件队列,用于逐一派发消息与信令
3397
- */
3398
- private _pluginContextQueue;
3461
+ * 设置聊天室属性
3462
+ */
3463
+ setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3399
3464
  /**
3400
- * 插件实例Map,用于重复初始化时返回实例
3465
+ * 批量设置聊天室属性
3401
3466
  */
3402
- private _pluginInstanseMap;
3403
- private readonly _engine;
3467
+ setChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<{
3468
+ code: ErrorCode;
3469
+ data?: any;
3470
+ }>;
3404
3471
  /**
3405
- * 核心库版本号,后期与 4.0 IM SDK 版本号保持一致
3406
- */
3407
- readonly coreVersion: string;
3408
- readonly appkey: string;
3409
- readonly apiVersion: string;
3410
- private readonly _options;
3411
- private _versionInfo;
3412
- private _typingInfo;
3472
+ * 强制设置聊天室属性
3473
+ */
3474
+ forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3413
3475
  /**
3414
- * 内部连接状态标识,为 ture 时不允许调用 reconnect 方法
3415
- */
3416
- private _isInternalConnected;
3417
- constructor(_runtime: IRuntime, options: IAPIContextOption);
3476
+ * 删除聊天室属性
3477
+ */
3478
+ removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3418
3479
  /**
3419
- * 安装使用插件,并初始化插件实例
3420
- * @param plugin
3421
- * @param options
3480
+ * 批量删除聊天室属性
3422
3481
  */
3423
- install<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
3424
- private _connectionStatus;
3425
- private _canRedirectConnect;
3482
+ removeChatroomEntries(chatroomId: string, entries: IChrmKVEntries): Promise<{
3483
+ code: ErrorCode;
3484
+ data?: any;
3485
+ }>;
3426
3486
  /**
3427
- * 重定向后,递归调用 connect
3428
- */
3429
- private _handleRedirect;
3487
+ * 强制删除聊天室属性
3488
+ */
3489
+ forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3430
3490
  /**
3431
- * 连接状态变更回调
3432
- * @param message
3433
- */
3434
- private _connectionStatusListener;
3435
- private _messageReceiver;
3491
+ * 获取聊天室 key 对应 value
3492
+ */
3493
+ getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
3436
3494
  /**
3437
- * 聊天室相关信息监听
3495
+ * 获取聊天室所有 key value
3438
3496
  */
3439
- private _chatroomInfoListener;
3497
+ getAllChatroomEntry(chatroomId: string): IPromiseResult<{
3498
+ [key: string]: string;
3499
+ }>;
3440
3500
  /**
3441
- * 会话监听相关
3501
+ * 获取上传认证信息
3502
+ * @description
3503
+ * 若不传 fileName 百度上传认证字段(bosToken、bosDate、path)均返回 null
3442
3504
  */
3443
- private _conversationInfoListener;
3505
+ getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
3444
3506
  /**
3445
- * 消息扩展监听相关
3507
+ * 获取文件上传后下载地址
3446
3508
  */
3447
- private _expansionInfoListener;
3509
+ getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName?: string, originName?: string): IPromiseResult<{
3510
+ downloadUrl: string;
3511
+ }>;
3448
3512
  /**
3449
- * 标签增删改监听
3450
- */
3451
- private _tagListener;
3513
+ * 创建标签
3514
+ * @param tag 标签
3515
+ */
3516
+ createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3452
3517
  /**
3453
- * 会话标签状态监听
3454
- */
3455
- private _conversationTagListener;
3456
- private _typingStatusListener;
3457
- private _pullFinishedListener;
3458
- private _MessageBlockedListener;
3518
+ * 删除标签
3519
+ * @param tagId 标签id
3520
+ */
3521
+ removeTag(tagId: string): IPromiseResult<IAsyncRes>;
3459
3522
  /**
3460
- * rtc 数据变更通知 pluginContext
3523
+ * 编辑标签
3524
+ * @param tag 标签
3525
+ */
3526
+ updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3527
+ /**
3528
+ * 获取标签列表
3461
3529
  */
3462
- private _rtcDataChange;
3530
+ getTagList(): IPromiseResult<Array<ITagInfo>>;
3463
3531
  /**
3464
- * 业务层事件监听器挂载点
3532
+ * 添加会话到标签(给多个会话增加标签)
3533
+ * @param tagId 标签id
3534
+ * @param conversations 要添加的会话列表
3465
3535
  */
3466
- private _watcher;
3536
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
3467
3537
  /**
3468
- * 添加事件监听
3469
- * @param options
3538
+ * 删除标签中的会话(从多个会话中批量删除指定标签)
3539
+ * @param tagId 标签id
3540
+ * @param conversations 要删除的会话列表
3470
3541
  */
3471
- assignWatcher(watcher: IWatcher): void;
3542
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
3472
3543
  /**
3473
- * 向内存中添加 typing 信息
3474
- * 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
3544
+ * 删除会话中的标签(从单一会话中批量删除标签)
3545
+ * @param conversationType 会话类型
3546
+ * @param targetId 会话id
3547
+ * @param tagIds 要删除的标签列表
3475
3548
  */
3476
- private _addTypingInfo;
3477
- private _typingInternalTimer;
3478
- private _typingExpireTime;
3479
- private _typingChangedList;
3549
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
3480
3550
  /**
3481
- * 启动定时移除typing
3551
+ * 获取标签下的会话列表
3552
+ * @param tagId 标签id
3482
3553
  */
3483
- private _startCheckTypingInfo;
3484
- getConnectedTime(): number;
3485
- getServerTime(): number;
3486
- getDeviceId(): string;
3487
- getCurrentUserId(): string;
3488
- getConnectionStatus(): ConnectionStatus;
3554
+ getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): IPromiseResult<IReceivedConversationByTag[]>;
3489
3555
  /**
3490
- * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
3491
- * @param token
3492
- * @param refreshNavi 是否需要重新请求导航,当值为 `false` 时,优先使用有效缓存导航,若缓存失效则重新获取导航
3556
+ * 获取标签下的未读消息数
3557
+ * @param tagId 标签id
3558
+ * @param containMuted 是否包含免打扰会话
3493
3559
  */
3494
- connect(token: string, refreshNavi?: boolean): Promise<IConnectResult>;
3560
+ getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
3495
3561
  /**
3496
- * 拉取实时配置 web 端需更新 voipCall 字段
3562
+ * 设置标签中会话置顶
3563
+ * @param conversation 会话
3497
3564
  */
3498
- private _pullUserSettings;
3499
- disconnect(): Promise<void>;
3500
- reconnect(): Promise<IConnectResult>;
3501
- private _getTokenWithoutNavi;
3565
+ setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
3502
3566
  /**
3503
- * 获取当前缓存的导航数据
3567
+ * 获取会话里的标签
3568
+ * @param config
3504
3569
  */
3505
- getInfoFromCache(): INaviInfo | null;
3570
+ getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
3506
3571
  /**
3507
- * 消息注册
3508
- * @description 消息注册需在应用初始化完成前进行
3509
- * @param objectName 消息类型,如:RC:TxtMsg
3510
- * @param isPersited 是否存储
3511
- * @param isCounted 是否技术
3512
- * @param searchProps 搜索字段,只在搭配协议栈使用时有效
3572
+ * 发送群组消息已读回执
3573
+ * 导航下发已读回执开关为 true 时调用
3513
3574
  */
3514
- registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
3575
+ sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
3515
3576
  /**
3516
- * 发送消息
3517
- * @param conversationType
3518
- * @param targetId
3519
- * @param objectName
3520
- * @param content
3521
- * @param options
3577
+ * 获取群组消息已读列表
3522
3578
  */
3523
- sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): Promise<IAsyncRes<IReceivedMessage>>;
3579
+ getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
3524
3580
  /**
3525
- * 发送扩展消息
3526
- * @param messageUId 消息 Id
3527
- * @param keys 需要删除的 key
3528
- * @param expansion 设置的扩展
3529
- */
3530
- sendExpansionMessage(options: ISendExMsgOptions): Promise<IAsyncRes<ErrorCode>>;
3531
- /**
3532
- * 发送群组消息已读回执
3533
- * 导航下发已读回执开关为 true 时调用
3534
- * @param targetId 群组会话id
3535
- * @param messageUIds 消息id
3536
- */
3537
- sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
3538
- /**
3539
- * 获取群组消息已读列表
3540
- * @param targetId
3541
- * @param messageUIds
3542
- */
3543
- getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
3544
- /**
3545
- * 反初始化,清空所有监听及计时器
3546
- */
3547
- private _destroy;
3548
- /**
3549
- * @param conversationType
3550
- * @param targetId 会话 Id
3551
- * @param timestamp 拉取时间戳
3552
- * @param count 拉取条数
3553
- * @param order 1 正序拉取,0 为倒序拉取
3554
- * @param channelId
3555
- * @param objectName
3556
- */
3557
- getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp?: number, count?: number, order?: 0 | 1, channelId?: string, objectName?: string): Promise<IAsyncRes<{
3558
- list: IReceivedMessage[];
3559
- hasMore: boolean;
3560
- }>>;
3561
- /**
3562
- * 获取会话列表
3563
- * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
3564
- */
3565
- getConversationList(count?: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
3566
- /**
3567
- * 获取单一会话数据
3568
- * @param conversationType
3569
- * @param targetId
3570
- * @param channelId
3571
- */
3572
- getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
3573
- /**
3574
- * 删除会话
3575
- */
3576
- removeConversation(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3577
- /**
3578
- * 清除会话消息未读数
3579
- */
3580
- clearUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3581
- /**
3582
- * 获取指定会话消息未读数
3583
- */
3584
- getUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<number>>;
3585
- /**
3586
- * 获取所有会话未读数
3587
- * @param channelId 多组织 Id
3588
- * @param conversationTypes
3589
- * @param includeMuted 包含已设置免打扰的会话
3590
- */
3591
- getTotalUnreadCount(channelId: string, conversationTypes?: ConversationType[], includeMuted?: boolean): Promise<IAsyncRes<number>>;
3592
- /**
3593
- * 获取第一个未读消息
3594
- */
3595
- getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<IReceivedMessage | null>>;
3596
- setConversationStatus(conversationType: ConversationType, targetId: string, isTop?: boolean, notificationStatus?: 1 | 2, channelId?: string): Promise<ErrorCode>;
3597
- saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
3598
- getConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<IAsyncRes<string>>;
3599
- clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
3600
- recallMessage(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
3601
- /**
3602
- * 删除远端消息
3603
- * @param conversationType
3604
- * @param targetId
3605
- * @param list
3606
- */
3607
- deleteRemoteMessage(conversationType: ConversationType, targetId: string, list: {
3608
- messageUId: string;
3609
- sentTime: number;
3610
- messageDirection: MessageDirection;
3611
- }[], channelId?: string): Promise<ErrorCode>;
3612
- /**
3613
- * 根据时间戳删除指定时间之前的
3614
- * @param conversationType
3615
- * @param targetId
3616
- * @param timestamp
3617
- */
3618
- deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
3619
- /**
3620
- * 加入聊天室,若聊天室不存在则创建聊天室
3621
- * @param roomId 聊天室房间 Id
3622
- * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
3623
- */
3624
- joinChatroom(roomId: string, count?: number): Promise<ErrorCode>;
3625
- /**
3626
- * 加入聊天室,若聊天室不存在则抛出异常
3627
- * @param roomId 聊天室房间 Id
3628
- * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
3629
- */
3630
- joinExistChatroom(roomId: string, count?: number): Promise<ErrorCode>;
3631
- /**
3632
- * 退出聊天室
3633
- * @param roomId
3634
- */
3635
- quitChatroom(roomId: string): Promise<ErrorCode>;
3636
- /**
3637
- * 获取聊天室房间数据
3638
- * @description count 或 order 有一个为 0 时,只返回成员总数,不返回成员列表信息
3639
- * @param roomId 聊天室 Id
3640
- * @param count 获取房间人员列表数量,最大有效值 `20`,最小值未 `0`,默认为 0
3641
- * @param order 人员排序方式,`1` 为正序,`2` 为倒序,默认为 0
3642
- */
3643
- getChatroomInfo(roomId: string, count?: number, order?: 0 | 1 | 2): Promise<IAsyncRes<IChatroomInfo>>;
3644
- /**
3645
- * 在指定聊天室中设置自定义属性
3646
- * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3647
- * @param roomId 聊天室房间 id
3648
- * @param entry 属性信息
3649
- */
3650
- setChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3651
- setChatroomEntries(roomId: string, entryOptions: IChatroomEntries): Promise<{
3652
- code: ErrorCode;
3653
- data?: any;
3654
- }>;
3655
- /**
3656
- * 在指定聊天室中强制增加 / 修改任意聊天室属性
3657
- * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3658
- * @param roomId 聊天室房间 id
3659
- * @param entry 属性信息
3660
- */
3661
- forceSetChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3662
- /**
3663
- * 删除聊天室属性
3664
- * @description 该方法仅限于删除自己设置的聊天室属性
3665
- * @param roomId 聊天室房间 id
3666
- * @param entry 要移除的属性信息
3667
- */
3668
- removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3669
- /**
3670
- * 批量删除聊天室属性
3671
- * @description 该方法仅限于删除自己设置的聊天室属性
3672
- * @param roomId 聊天室房间 id
3673
- * @param entry 要移除的属性信息
3674
- */
3675
- removeChatroomEntries(roomId: string, entryOptions: IRemoveChatRoomEntriesOption): Promise<{
3676
- code: ErrorCode;
3677
- data?: any;
3678
- }>;
3679
- /**
3680
- * 强制删除任意聊天室属性
3681
- * @description 该方法仅限于删除自己设置的聊天室属性
3682
- * @param roomId 聊天室房间 id
3683
- * @param entry 要移除的属性信息
3684
- */
3685
- forceRemoveChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3686
- /**
3687
- * 获取聊天室中的指定属性
3688
- * @param roomId 聊天室房间 id
3689
- * @param key 属性键名
3690
- */
3691
- getChatroomEntry(roomId: string, key: string): Promise<IAsyncRes<string | null>>;
3692
- /**
3693
- * 获取聊天室内的所有属性
3694
- * @param roomId 聊天室房间 id
3581
+ * 获取服务器时间
3695
3582
  */
3696
- getAllChatroomEntries(roomId: string): Promise<IAsyncRes<{
3697
- [key: string]: string;
3698
- }>>;
3583
+ getServerTime(): number;
3699
3584
  /**
3700
- * 拉取聊天室内的历史消息
3701
- * @param roomId
3702
- * @param count 拉取消息条数, 有效值范围 `1 - 20`
3703
- * @param order 获取顺序,默认值为 0。
3704
- * * 0:降序,用于获取早于指定时间戳发送的消息
3705
- * * 1:升序,用于获取晚于指定时间戳发送的消息
3706
- * @param timestamp 指定拉取消息用到的时间戳。默认值为 `0`,表示按当前时间拉取
3585
+ * 获取设备ID
3707
3586
  */
3708
- getChatRoomHistoryMessages(roomId: string, count?: number, order?: 0 | 1, timestamp?: number): Promise<IAsyncRes<{
3709
- list: IReceivedMessage[];
3710
- hasMore: boolean;
3711
- }>>;
3587
+ getDeviceId(): string;
3712
3588
  /**
3713
- * 获取存储服务鉴权信息
3714
- * @param fileType 文件类型
3715
- * @param fileName 文件名称
3716
- * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
3717
- * @param queryString STC 分段上传时的查询字符串
3718
- * @description
3719
- * `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
3720
- * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`
3721
- * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`
3722
- * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`
3723
- * @returns
3589
+ * 获取当前 userId
3724
3590
  */
3725
- getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<IUploadAuth & {
3726
- bos: string;
3727
- qiniu: string;
3728
- }>;
3591
+ getCurrentUserId(): string;
3729
3592
  /**
3730
- * 获取 七牛、百度、阿里云 上传成功可下载的 URL
3731
- * @param fileType 文件类型
3732
- * @param fileName 文件名
3733
- * @param saveName 下载后的存储文件名
3734
- * @param uploadRes 插件上传返回的结果。降级百度上传后,用户传入返回结果,再把结果里的下载地址返回给用户,保证兼容之前结果获取
3735
- * @param serverType 使用的存储服务标识
3593
+ * 设置用户在线状态监听器
3736
3594
  */
3737
- getFileUrl(fileType: FileType, fileName?: string, saveName?: string, uploadRes?: {
3738
- isBosRes: boolean;
3739
- downloadUrl: string;
3740
- }, serverType?: UploadMethod): Promise<{
3741
- downloadUrl: string;
3742
- }>;
3743
- /**
3744
- * 创建标签
3745
- * @param tag 标签
3746
- */
3747
- createTag(tag: ITagParam): Promise<IAsyncRes>;
3748
- /**
3749
- * 删除标签
3750
- * @param tagId 标签id
3751
- */
3752
- removeTag(tagId: string): Promise<IAsyncRes>;
3753
- /**
3754
- * 更新标签
3755
- * @param tag 标签
3756
- */
3757
- updateTag(tag: ITagParam): Promise<IAsyncRes>;
3758
- /**
3759
- * 获取标签列表
3760
- */
3761
- getTagList(): Promise<IAsyncRes<Array<ITagInfo>>>;
3762
- /**
3763
- * 添加会话到标签(给多个会话增加标签)
3764
- * @param tagId 标签id
3765
- * @param conversations 要添加的会话列表
3766
- */
3767
- addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
3768
- /**
3769
- * 删除标签中的会话(从多个会话中批量删除指定标签)
3770
- * @param tagId 标签id
3771
- * @param conversations 要删除的会话列表
3772
- */
3773
- removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
3774
- /**
3775
- * 删除会话中的标签(从单一会话中批量删除标签)
3776
- * @param conversationType 会话类型
3777
- * @param targetId 会话id
3778
- * @param tagIds 要删除的标签列表
3779
- */
3780
- removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<IAsyncRes>>;
3781
- /**
3782
- * 获取标签下的会话列表
3783
- * @param tagId 标签id
3784
- */
3785
- getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): Promise<IAsyncRes<IReceivedConversationByTag[]>>;
3786
- /**
3787
- * 获取标签下的未读消息数
3788
- * @param tagId 标签id
3789
- * @param containMuted 是否包含免打扰会话
3790
- */
3791
- getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number>>;
3792
- /**
3793
- * 设置标签中会话置顶
3794
- * @param conversation 会话
3795
- */
3796
- setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
3797
- isTop: boolean;
3798
- }): Promise<IAsyncRes<IAsyncRes>>;
3595
+ setUserStatusListener(config: {
3596
+ userIds: string[];
3597
+ }, listener: Function): void;
3799
3598
  /**
3800
- * 获取会话里的标签
3801
- * @param conversation
3802
- */
3803
- getTagsForConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[]>>;
3599
+ * 设置当前用户在线状态
3600
+ */
3601
+ setUserStatus(status: number): Promise<ErrorCode>;
3804
3602
  /**
3805
- * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
3806
- * 对于未实现的方法,接口响应 Unsupport 错误码
3807
- * @param method 方法名
3808
- * @param args
3809
- */
3810
- callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
3603
+ * 订阅用户在线状态
3604
+ */
3605
+ subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
3811
3606
  /**
3812
- * 删除所有会话
3607
+ * 获取用户状态
3813
3608
  */
3814
- clearConversations(conversationTypes?: ConversationType[], tag?: string): Promise<ErrorCode>;
3609
+ getUserStatus(userId: string): IPromiseResult<{
3610
+ status: string;
3611
+ }>;
3815
3612
  /**
3816
- * 设置用户连接状态监听器
3613
+ * 清空所有会话
3817
3614
  */
3818
- setUserStatusListener(config: {
3819
- userIds: string[];
3820
- }, listener: Function): void;
3615
+ clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
3821
3616
  /**
3822
- * 添加用户黑名单
3617
+ * 加入黑名单
3823
3618
  */
3824
3619
  addToBlacklist(userId: string): Promise<ErrorCode>;
3825
3620
  /**
3826
- * 将指定用户移除黑名单
3621
+ * 将指定用户移除黑名单
3827
3622
  */
3828
3623
  removeFromBlacklist(userId: string): Promise<ErrorCode>;
3829
3624
  /**
3830
- * 获取黑名单列表
3625
+ * 获取黑名单列表
3831
3626
  */
3832
- getBlacklist(): Promise<IAsyncRes<string[]>>;
3627
+ getBlacklist(): IPromiseResult<string[]>;
3833
3628
  /**
3834
- * 获取指定人员在黑名单中的状态
3629
+ * 获取指定人员在黑名单中的状态
3835
3630
  */
3836
- getBlacklistStatus(userId: string): Promise<IAsyncRes<string>>;
3631
+ getBlacklistStatus(userId: string): IPromiseResult<string>;
3837
3632
  /**
3838
3633
  * 向本地插入一条消息,不发送到服务器
3839
3634
  */
3840
- insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
3635
+ insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
3841
3636
  /**
3842
3637
  * 删除本地消息
3843
3638
  */
3844
- deleteMessages(timestamp: number[]): Promise<ErrorCode>;
3639
+ deleteMessages(timestamps: number[]): Promise<ErrorCode>;
3845
3640
  /**
3846
- * 从本地消息数据库中删除某一会话指定时间之前的消息数据
3641
+ * 通过时间戳删除本地消息
3847
3642
  */
3848
- deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId?: string): Promise<ErrorCode>;
3643
+ deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
3849
3644
  /**
3850
3645
  * 清空会话下历史消息
3851
3646
  */
3852
- clearMessages(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3647
+ clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3853
3648
  /**
3854
- * 获取本地消息
3649
+ * 获取消息
3855
3650
  */
3856
- getMessage(messageId: number): Promise<IAsyncRes<IReceivedMessage>>;
3651
+ getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
3857
3652
  /**
3858
3653
  * 设置消息内容
3859
3654
  */
@@ -3862,502 +3657,771 @@ declare class APIContext {
3862
3657
  * 设置消息搜索字段
3863
3658
  */
3864
3659
  setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
3660
+ /**
3661
+ * 通过关键字搜索会话
3662
+ */
3663
+ searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3664
+ /**
3665
+ * 按内容搜索会话内的消息
3666
+ */
3667
+ searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
3668
+ messages: IReceivedMessage[];
3669
+ count: number;
3670
+ }>;
3671
+ /**
3672
+ * 获取会话下所有未读的 @ 消息
3673
+ */
3674
+ getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
3865
3675
  /**
3866
3676
  * 设置消息发送状态
3867
3677
  */
3868
3678
  setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
3869
3679
  /**
3870
- * 设置消息接收状态
3680
+ * 设置消息接收状态
3871
3681
  */
3872
3682
  setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
3873
3683
  /**
3874
- * 设置当前用户在线状态
3684
+ * 删除时间戳前的未读数
3875
3685
  */
3876
- setUserStatus(status: number): Promise<ErrorCode>;
3686
+ clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
3687
+ /**
3688
+ * 获取会话免打扰状态
3689
+ */
3690
+ getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
3691
+ /**
3692
+ * 协议栈获取远端历史消息
3693
+ */
3694
+ getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
3695
+ list: IReceivedMessage[];
3696
+ hasMore: boolean;
3697
+ }>;
3698
+ /**
3699
+ * 获取群组消息送达列表
3700
+ */
3701
+ getGroupMessageDeliverList(targetId: string, messageUId: string, channelId: string): IPromiseResult<IGroupMessageDeliverInfo>;
3702
+ /**
3703
+ * 获取单聊消息送达详情
3704
+ */
3705
+ getPrivateMessageDeliverTime(messageUId: string, channelId: string): IPromiseResult<number>;
3706
+ setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
3707
+ key: string;
3708
+ value: string;
3709
+ }>;
3710
+ joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
3711
+ quitRTCRoom(roomId: string): Promise<ErrorCode>;
3712
+ rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
3713
+ getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
3714
+ getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
3715
+ getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
3716
+ setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
3717
+ removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
3718
+ setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
3719
+ name: string;
3720
+ content: string;
3721
+ }): Promise<ErrorCode>;
3722
+ /**
3723
+ * 全量订阅资源修改
3724
+ * @param roomId 房间 Id
3725
+ * @param message 向前兼容的消息内容
3726
+ * @param valueInfo 全量资源数据
3727
+ * @param objectName 全量 URI 消息名
3728
+ */
3729
+ setRTCTotalRes(roomId: string, message: {
3730
+ name: string;
3731
+ content: string;
3732
+ }, valueInfo: string, objectName: string, mcuValInfo: string): Promise<ErrorCode>;
3733
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
3734
+ removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
3735
+ name: string;
3736
+ content: string;
3737
+ }): Promise<ErrorCode>;
3738
+ setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
3739
+ getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
3740
+ getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
3741
+ setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
3742
+ getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
3743
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
3744
+ }
3745
+
3746
+ interface IExpansionMsgContent {
3747
+ /**
3748
+ * 消息扩展的对象
3749
+ */
3750
+ put?: {
3751
+ [key: string]: string;
3752
+ };
3753
+ /**
3754
+ * 删除的 keys
3755
+ */
3756
+ del?: string[];
3757
+ /**
3758
+ * messageUId
3759
+ */
3760
+ mid: string;
3761
+ /**
3762
+ * 是否删除所有, 有效值:0、1 . ( 后续如有需要, API Layer 层可使用)
3763
+ */
3764
+ removeAll?: number;
3765
+ }
3766
+
3767
+ /**
3768
+ * 被拦截的消息信息
3769
+ */
3770
+ interface IBlockedMessageInfo {
3771
+ blockedMessageUId: string;
3772
+ conversationType: number;
3773
+ targetId: string;
3774
+ channelId: string;
3775
+ blockType: MessageBlockType;
3776
+ }
3777
+
3778
+ interface IConnectResult {
3779
+ /**
3780
+ * 连接错误码
3781
+ */
3782
+ code: ErrorCode;
3783
+ /**
3784
+ * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
3785
+ */
3786
+ userId?: string;
3787
+ }
3788
+ declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
3789
+ declare type IConnectionStatusListener = (status: ConnectionStatus) => void;
3790
+ declare type IConversationStateListener = (conversation: IUpdatedConversation[]) => void;
3791
+ declare type IChatroomListener = (state: IChatroomListenerData) => void;
3792
+ declare type IRTCInnerListener = {
3793
+ message?: IMessageListnenr;
3794
+ status?: IConnectionStatusListener;
3795
+ };
3796
+ declare type IExpansionListener = (data: IExpansionListenerData) => void;
3797
+ declare type ITagListener = () => void;
3798
+ declare type IConversationTagListener = () => void;
3799
+ declare type ItypingStateListener = (data: ITypingMessage[]) => void;
3800
+ declare type IMessageDeliveredListener = (data: IMessageDeliver[]) => void;
3801
+ declare type IMessageBlockedListener = (data: IBlockedMessageInfo) => void;
3802
+ interface ISendExMsgOptions {
3803
+ channelId: string;
3804
+ conversationType: ConversationType;
3805
+ targetId: string;
3806
+ /**
3807
+ * 消息 ID
3808
+ */
3809
+ messageUId: string;
3810
+ /**
3811
+ * 原始消息是否支持扩展的字段
3812
+ */
3813
+ canIncludeExpansion: boolean;
3814
+ /**
3815
+ * 删除的 keys
3816
+ */
3817
+ keys?: string[];
3818
+ /**
3819
+ * 扩展对象
3820
+ */
3821
+ expansion?: {
3822
+ [key: string]: string;
3823
+ };
3824
+ /**
3825
+ * 是否删除所有扩展
3826
+ */
3827
+ removeAll?: boolean;
3828
+ /**
3829
+ * 原始消息的扩展
3830
+ */
3831
+ originExpansion?: {
3832
+ [key: string]: string;
3833
+ } | null;
3834
+ }
3835
+ interface IWatcher {
3836
+ message?: IMessageListnenr;
3837
+ connectionState?: IConnectionStatusListener;
3838
+ conversationState?: IConversationStateListener;
3839
+ chatroomState?: IChatroomListener;
3840
+ expansion?: IExpansionListener;
3841
+ /**
3842
+ * 为兼容老版本 RTCLib 与 CallLib 接收消息的方式,新版本消息走插件机制
3843
+ */
3844
+ rtcInnerWatcher?: IRTCInnerListener;
3845
+ /**
3846
+ * 标签的增删改监听
3847
+ */
3848
+ tag?: ITagListener;
3849
+ /**
3850
+ * 会话中标签状态变更监听
3851
+ */
3852
+ conversationTagChanged?: IConversationTagListener;
3853
+ /**
3854
+ * 输入状态变更监听
3855
+ */
3856
+ typingState?: ItypingStateListener;
3857
+ /**
3858
+ * 是否拉取完毕添加通知
3859
+ */
3860
+ pullFinished?: ITagListener;
3861
+ /**
3862
+ * 单聊消息送达通知
3863
+ */
3864
+ messageDelivered?: IMessageDeliveredListener;
3865
+ messageBlocked?: IMessageBlockedListener;
3866
+ }
3867
+ interface IPluginGenerator<API, InitOption> {
3868
+ /**
3869
+ * 只读插件标识
3870
+ */
3871
+ readonly tag: string;
3872
+ /**
3873
+ * 版本号
3874
+ */
3875
+ readonly version?: string;
3876
+ /**
3877
+ * 插件名称
3878
+ */
3879
+ readonly name?: string;
3880
+ /**
3881
+ * 插件安装前的环境检测,通过返回 boolean 值确认插件是否可运行
3882
+ */
3883
+ verify(runtime: IRuntime): boolean;
3884
+ /**
3885
+ * 插件初始化
3886
+ * @param context 插件调用上下文,用于实现插件的消息注册、消息首发等
3887
+ * @param runtime 运行时实例,用于标识最终的运行时平台
3888
+ * @param options 初始化参数
3889
+ */
3890
+ setup(context: PluginContext, runtime: IRuntime, options: InitOption): API;
3891
+ }
3892
+ interface IAPIContextOption {
3893
+ /**
3894
+ * 应用 appkey
3895
+ */
3896
+ appkey: string;
3877
3897
  /**
3878
- * 订阅用户在线状态
3879
- */
3880
- subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
3898
+ * IMLib 版本号
3899
+ */
3900
+ apiVersion: string;
3881
3901
  /**
3882
- * 获取用户在线状态
3883
- */
3884
- getUserStatus(userId: string): Promise<IAsyncRes<{
3885
- status: string;
3886
- }>>;
3887
- searchConversationByContent(keyword: string, customMessageTypes?: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
3888
- searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId?: string): Promise<IAsyncRes<{
3889
- messages: IReceivedMessage[];
3890
- count: number;
3891
- }>>;
3892
- getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId?: string): IReceivedMessage[];
3893
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
3902
+ * 自定义导航地址:
3903
+ * 1. 私有云环境下该值为必填项
3904
+ * 2. 当存在自定义导航地址时,SDK 内部默认地址将无效
3905
+ * 3. 当存在自定义导航地址时,地址 url 中需包含 http/https 协议头,否则视为无效值
3906
+ * 4. 建立 ws/wss 连接前的 ping 接口使用的协议与导航 url 中的协议相同
3907
+ * 5. 建立 websocket 建立连接时将根据 ping 接口使用的 http/https 协议来确定使用 ws/wss 协议
3908
+ * 6. 动态导航使用的协议头将与自定义导航地址相同
3909
+ * 7. 公有云默认使用 https 协议
3910
+ */
3911
+ navigators: string[];
3894
3912
  /**
3895
- * 获取会话免打扰状态
3913
+ * (参数已废弃)~~c++ 协议栈数据库地址~~
3914
+ * @deprecated
3896
3915
  */
3897
- getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<NotificationStatus>>;
3898
- getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): Promise<IAsyncRes<{
3899
- list: IReceivedMessage[];
3900
- hasMore: boolean;
3901
- }>>;
3916
+ dbPath?: string;
3902
3917
  /**
3903
- * 加入房间
3904
- * @param roomId
3905
- * @param mode 房间模式:直播 or 会议
3906
- * @param mediaType 直播房间模式下的媒体资源类型
3918
+ * 小程序的 CMP 代理地址
3907
3919
  */
3908
- joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number, joinType?: RTCJoinType): Promise<IAsyncRes<IJoinRTCRoomData>>;
3909
- quitRTCRoom(roomId: string): Promise<ErrorCode>;
3910
- rtcPing(roomId: string, mode: number, mediaType?: number): Promise<ErrorCode>;
3911
- getRTCRoomInfo(roomId: string): Promise<IAsyncRes<IRTCRoomInfo>>;
3912
- getRTCUserInfoList(roomId: string): Promise<IAsyncRes<IRTCUsers>>;
3913
- getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
3914
- setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
3915
- removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
3916
- setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
3917
- name: string;
3918
- content: string;
3919
- }): Promise<ErrorCode>;
3920
- setRTCTotalRes(roomId: string, message: {
3921
- name: string;
3922
- content: string;
3923
- }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
3924
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
3925
- getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): Promise<IAsyncRes<KVString>>;
3926
- removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
3927
- name: string;
3928
- content: string;
3929
- }): Promise<ErrorCode>;
3930
- setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
3931
- getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
3932
- getRTCToken(roomId: string, mode: number, broadcastType?: number): Promise<IAsyncRes<IRtcTokenData>>;
3933
- setRTCState(roomId: string, report: string): Promise<ErrorCode>;
3934
- getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
3920
+ miniCMPProxy: string[];
3935
3921
  /**
3936
- * 直播观众加房间
3922
+ * 指定默认使用的连接类型
3937
3923
  */
3938
- joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
3939
- token: string;
3940
- kvEntries: IServerRTCRoomEntry[];
3941
- }>>;
3924
+ connectionType: 'websocket' | 'comet';
3942
3925
  /**
3943
- * 直播观众退出房间
3926
+ * 修改 engine log 打印等级
3944
3927
  */
3945
- quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
3928
+ logLevel?: LogLevel;
3946
3929
  /**
3947
- * 直播身份切换
3930
+ * 修改默认的 log 输出函数
3948
3931
  */
3949
- rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
3932
+ logStdout?: (logLevel: LogLevel, content: string) => void;
3950
3933
  /**
3951
- * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
3934
+ * (已废弃)私有云标识
3935
+ * @deprecated
3952
3936
  */
3953
- getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
3954
- }
3955
-
3956
- /**
3957
- * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
3958
- */
3959
- interface IEngine {
3937
+ isEnterPrise?: boolean;
3960
3938
  /**
3961
- * 建立连接
3962
- * @param token
3963
- * @param naviInfo
3939
+ * typing状态过期时间
3964
3940
  */
3965
- connect(token: string, naviInfo: INaviInfo, versionInfo: string): Promise<ErrorCode>;
3941
+ typingExpireTime?: number;
3966
3942
  /**
3967
- * 上报版本信息
3968
- * @param version
3943
+ * 是否打开 IndexDB 存储,默认为 true
3969
3944
  */
3970
- reportSDKInfo(version: {
3971
- [name: string]: string;
3972
- }): void;
3945
+ indexDBSwitch?: boolean;
3973
3946
  /**
3974
- * 连接时间
3947
+ * 是否校验证书,默认为 true
3975
3948
  */
3976
- getConnectedTime(): number;
3949
+ checkCA?: boolean;
3950
+ }
3951
+ declare class APIContext {
3952
+ private _runtime;
3953
+ private static _context?;
3954
+ static init(runtime: IRuntime, options: IAPIContextOption): APIContext;
3955
+ static destroy(): void;
3956
+ private _token;
3977
3957
  /**
3978
- * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
3979
- * 对于未实现的方法,接口响应 Unsupport 错误码
3980
- * @param method
3981
- * @param args
3958
+ * 插件队列,用于逐一派发消息与信令
3982
3959
  */
3983
- callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
3960
+ private _pluginContextQueue;
3984
3961
  /**
3985
- * 获取历史消息
3986
- * @param conversationType
3987
- * @param targetId
3988
- * @param timestamp
3989
- * @param count
3990
- * @param order
3962
+ * 插件实例Map,用于重复初始化时返回实例
3991
3963
  */
3992
- getHistoryMessage(conversationType: ConversationType, targetId: string,
3964
+ private _pluginInstanseMap;
3965
+ private readonly _engine;
3993
3966
  /**
3994
- * 拉取时间戳,值为 `0` 表示从当前时间拉取
3967
+ * 核心库版本号,后期与 4.0 IM SDK 版本号保持一致
3995
3968
  */
3996
- timestamp: number,
3969
+ readonly coreVersion: string;
3970
+ readonly appkey: string;
3971
+ readonly apiVersion: string;
3972
+ private readonly _options;
3973
+ private _versionInfo;
3974
+ private _typingInfo;
3997
3975
  /**
3998
- * 获取条数, 有效值 `1` - `20`
3976
+ * 内部连接状态标识,为 ture 时不允许调用 reconnect 方法
3999
3977
  */
4000
- count: number,
3978
+ private _isInternalConnected;
3979
+ constructor(_runtime: IRuntime, options: IAPIContextOption);
4001
3980
  /**
4002
- * @description
4003
- * 1. `0` 表示升序,获取消息发送时间比传入 `sentTime` 小 的消息
4004
- * 2. `1` 表示降序,获取消息发送时间比传入 `sentTime` 大 的消息
3981
+ * 安装使用插件,并初始化插件实例
3982
+ * @param plugin
3983
+ * @param options
4005
3984
  */
4006
- order: 0 | 1,
3985
+ install<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
3986
+ private _connectionStatus;
3987
+ private _canRedirectConnect;
4007
3988
  /**
4008
- * 会话的业务标识
4009
- */
4010
- channelId: string,
3989
+ * 重定向后,递归调用 connect
3990
+ */
3991
+ private _handleRedirect;
4011
3992
  /**
4012
- * 消息类型
3993
+ * 连接状态变更回调
3994
+ * @param message
4013
3995
  */
4014
- objectName: string): IPromiseResult<{
4015
- list: IReceivedMessage[];
4016
- hasMore: boolean;
4017
- }>;
3996
+ private _connectionStatusListener;
3997
+ private _messageReceiver;
4018
3998
  /**
4019
- * 删除历史消息 通过 messageUId
3999
+ * 聊天室相关信息监听
4020
4000
  */
4021
- deleteRemoteMessage(conversationType: ConversationType, targetId: string,
4001
+ private _chatroomInfoListener;
4022
4002
  /**
4023
- * @description
4024
- * message 中 messageUId、setTime、messageDirection 为必须参数
4003
+ * 会话监听相关
4025
4004
  */
4026
- messages: {
4027
- messageUId: string;
4028
- sentTime: number;
4029
- messageDirection: MessageDirection;
4030
- }[],
4005
+ private _conversationInfoListener;
4031
4006
  /**
4032
- * 会话的业务标识
4007
+ * 消息扩展监听相关
4033
4008
  */
4034
- channelId: string): Promise<ErrorCode>;
4035
- recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
4009
+ private _expansionInfoListener;
4036
4010
  /**
4037
- * 删除历史消息 通过 时间戳
4038
- * @param timestamp 小于等于传入时间戳的消息均删除
4039
- */
4040
- deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number,
4011
+ * 标签增删改监听
4012
+ */
4013
+ private _tagListener;
4041
4014
  /**
4042
- * 会话的业务标识
4043
- */
4044
- channelId: string): Promise<ErrorCode>;
4015
+ * 会话标签状态监听
4016
+ */
4017
+ private _conversationTagListener;
4018
+ private _typingStatusListener;
4019
+ private _pullFinishedListener;
4020
+ private _messageDeliveredListerer;
4021
+ private _MessageBlockedListener;
4022
+ private _callInfoListener;
4045
4023
  /**
4046
- * 获取会话列表
4047
- * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
4024
+ * rtc 数据变更通知 pluginContext
4048
4025
  */
4049
- getConversationList(
4026
+ private _rtcDataChange;
4050
4027
  /**
4051
- * 拉取数量, 有效值 0 - 1000, 默认 300
4028
+ * 业务层事件监听器挂载点
4052
4029
  */
4053
- count: number,
4030
+ private _watcher;
4031
+ /**
4032
+ * 添加事件监听
4033
+ * @param options
4034
+ */
4035
+ assignWatcher(watcher: IWatcher): void;
4036
+ /**
4037
+ * 向内存中添加 typing 信息
4038
+ * 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
4039
+ */
4040
+ private _addTypingInfo;
4041
+ private _typingInternalTimer;
4042
+ private _typingExpireTime;
4043
+ private _typingChangedList;
4044
+ /**
4045
+ * 启动定时移除typing
4046
+ */
4047
+ private _startCheckTypingInfo;
4048
+ getConnectedTime(): number;
4049
+ getServerTime(): number;
4050
+ getDeviceId(): string;
4051
+ getCurrentUserId(): string;
4052
+ getConnectionStatus(): ConnectionStatus;
4053
+ /**
4054
+ * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
4055
+ * @param token
4056
+ * @param refreshNavi 是否需要重新请求导航,当值为 `false` 时,优先使用有效缓存导航,若缓存失效则重新获取导航
4057
+ */
4058
+ connect(token: string, refreshNavi?: boolean): Promise<IConnectResult>;
4059
+ /**
4060
+ * 拉取实时配置 web 端需更新 voipCall 字段
4061
+ */
4062
+ private _pullUserSettings;
4063
+ disconnect(): Promise<void>;
4064
+ reconnect(): Promise<IConnectResult>;
4065
+ private _getTokenWithoutNavi;
4054
4066
  /**
4055
- * 会话类型
4056
- * @todo 待确认是否生效
4067
+ * 获取当前缓存的导航数据
4057
4068
  */
4058
- conversationType?: ConversationType,
4069
+ getInfoFromCache(): INaviInfo | null;
4059
4070
  /**
4060
- * 起始时间
4061
- */
4062
- startTime?: number,
4071
+ * 消息注册
4072
+ * @description 消息注册需在应用初始化完成前进行
4073
+ * @param objectName 消息类型,如:RC:TxtMsg
4074
+ * @param isPersited 是否存储
4075
+ * @param isCounted 是否技术
4076
+ * @param searchProps 搜索字段,只在搭配协议栈使用时有效
4077
+ */
4078
+ registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
4063
4079
  /**
4064
- * 获取顺序
4065
- */
4066
- order?: 0 | 1,
4080
+ * 发送消息
4081
+ * @param conversationType
4082
+ * @param targetId
4083
+ * @param objectName
4084
+ * @param content
4085
+ * @param options
4086
+ */
4087
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): Promise<IAsyncRes<IReceivedMessage>>;
4067
4088
  /**
4068
- * 会话的业务标识
4089
+ * 发送扩展消息
4090
+ * @param messageUId 消息 Id
4091
+ * @param keys 需要删除的 key
4092
+ * @param expansion 设置的扩展
4069
4093
  */
4070
- channelId?: string): IPromiseResult<IReceivedConversation[]>;
4094
+ sendExpansionMessage(options: ISendExMsgOptions): Promise<IAsyncRes<ErrorCode>>;
4071
4095
  /**
4072
- * 获取指定会话
4073
- */
4074
- getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
4096
+ * 发送群组消息已读回执
4097
+ * 导航下发已读回执开关为 true 时调用
4098
+ * @param targetId 群组会话id
4099
+ * @param messageUIds 消息id
4100
+ */
4101
+ sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
4075
4102
  /**
4076
- * 删除会话
4077
- * @description 该删除操作会删除服务器端存储的会话数据
4078
- * @param conversationType
4103
+ * 获取群组消息已读列表
4079
4104
  * @param targetId
4105
+ * @param messageUIds
4080
4106
  */
4081
- removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
4107
+ getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
4082
4108
  /**
4083
- * 获取所有会话未读数
4084
- * @param channelId 多组织 Id
4085
- * @param conversationTypes
4086
- * @param includeMuted 包含已设置免打扰的会话
4109
+ * 反初始化,清空所有监听及计时器
4087
4110
  */
4088
- getAllConversationUnreadCount(channelId: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
4111
+ private _destroy;
4089
4112
  /**
4090
- * 获取指定会话未读数
4113
+ * @param conversationType
4114
+ * @param targetId 会话 Id
4115
+ * @param timestamp 拉取时间戳
4116
+ * @param count 拉取条数
4117
+ * @param order 1 正序拉取,0 为倒序拉取
4118
+ * @param channelId
4119
+ * @param objectName
4091
4120
  */
4092
- getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
4121
+ getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp?: number, count?: number, order?: 0 | 1, channelId?: string, objectName?: string): Promise<IAsyncRes<{
4122
+ list: IReceivedMessage[];
4123
+ hasMore: boolean;
4124
+ }>>;
4093
4125
  /**
4094
- * 清除指定会话未读数
4126
+ * 获取会话列表
4127
+ * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
4095
4128
  */
4096
- clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
4129
+ getConversationList(count?: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
4097
4130
  /**
4098
- * 获取第一个未读消息
4131
+ * 获取单一会话数据
4132
+ * @param conversationType
4133
+ * @param targetId
4134
+ * @param channelId
4099
4135
  */
4100
- getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
4136
+ getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
4101
4137
  /**
4102
- * 设置/保存指定会话消息草稿
4103
- * @draft 草稿内容
4138
+ * 删除会话
4104
4139
  */
4105
- saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
4140
+ removeConversation(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
4106
4141
  /**
4107
- * 获取指定会话消息草稿
4142
+ * 清除会话消息未读数
4108
4143
  */
4109
- getConversationMessageDraft(conversationType: ConversationType, targetId: string): IPromiseResult<string>;
4144
+ clearUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
4110
4145
  /**
4111
- * 清除指定会话消息草稿
4146
+ * 清除全部会话消息未读数
4112
4147
  */
4113
- clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
4148
+ clearAllUnreadCount(): Promise<ErrorCode>;
4114
4149
  /**
4115
- * 从服务端拉取会话状态
4150
+ * 获取指定会话消息未读数
4116
4151
  */
4117
- pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
4152
+ getUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<number>>;
4118
4153
  /**
4119
- * 批量设置会话 置顶、免打扰
4154
+ * 获取所有会话未读数
4155
+ * @param channelId 多组织 Id
4156
+ * @param conversationTypes
4157
+ * @param includeMuted 包含已设置免打扰的会话
4120
4158
  */
4121
- batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
4122
- sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): IPromiseResult<IReceivedMessage>;
4159
+ getTotalUnreadCount(channelId: string, conversationTypes?: ConversationType[], includeMuted?: boolean): Promise<IAsyncRes<number>>;
4123
4160
  /**
4124
- * 断开连接
4161
+ * 获取第一个未读消息
4125
4162
  */
4126
- disconnect(): void;
4163
+ getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<IReceivedMessage | null>>;
4164
+ setConversationStatus(conversationType: ConversationType, targetId: string, isTop?: boolean, notificationStatus?: 1 | 2, channelId?: string): Promise<ErrorCode>;
4165
+ saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
4166
+ getConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<IAsyncRes<string>>;
4167
+ clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
4168
+ recallMessage(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
4127
4169
  /**
4128
- * 拉取用户级配置数据
4170
+ * 删除远端消息
4171
+ * @param conversationType
4172
+ * @param targetId
4173
+ * @param list
4129
4174
  */
4130
- pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
4175
+ deleteRemoteMessage(conversationType: ConversationType, targetId: string, list: {
4176
+ messageUId: string;
4177
+ sentTime: number;
4178
+ messageDirection: MessageDirection;
4179
+ }[], channelId?: string): Promise<ErrorCode>;
4131
4180
  /**
4132
- * 消息注册
4133
- * @description
4134
- * 消息注册需在应用初始化完成前进行,否则在搭配 C++ 协议栈使用时,
4135
- * 本端发出的消息将不默认作为未知消息处理,不存储、不计数
4136
- * @param objectName 消息类型,如:RC:TxtMsg
4137
- * @param isPersited 是否存储
4138
- * @param isCounted 是否技术
4139
- * @param searchProps 搜索字段,只在搭配协议栈使用时有效
4181
+ * 根据时间戳删除指定时间之前的
4182
+ * @param conversationType
4183
+ * @param targetId
4184
+ * @param timestamp
4140
4185
  */
4141
- registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
4186
+ deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
4142
4187
  /**
4143
- * 加入聊天室
4144
- * @param count 拉取消息数量
4145
- */
4146
- joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
4188
+ * 加入聊天室,若聊天室不存在则创建聊天室
4189
+ * @param roomId 聊天室房间 Id
4190
+ * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
4191
+ */
4192
+ joinChatroom(roomId: string, count?: number): Promise<ErrorCode>;
4147
4193
  /**
4148
- * 加入已存在的聊天室
4149
- * @param count 拉取消息数量
4150
- */
4151
- joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
4194
+ * 加入聊天室,若聊天室不存在则抛出异常
4195
+ * @param roomId 聊天室房间 Id
4196
+ * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
4197
+ */
4198
+ joinExistChatroom(roomId: string, count?: number): Promise<ErrorCode>;
4152
4199
  /**
4153
4200
  * 退出聊天室
4154
- */
4155
- quitChatroom(chatroomId: string): Promise<ErrorCode>;
4156
- /**
4157
- * 获取聊天室信息
4158
- * @param count 获取人数, 范围 0 - 20
4159
- * @param order 排序方式, 1 正序, 2 倒序
4160
- */
4161
- getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
4162
- /**
4163
- * 获取聊天室历史消息
4164
- */
4165
- getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
4166
- list: IReceivedMessage[];
4167
- hasMore: boolean;
4168
- }>;
4201
+ * @param roomId
4202
+ */
4203
+ quitChatroom(roomId: string): Promise<ErrorCode>;
4169
4204
  /**
4170
- * 设置聊天室属性
4171
- */
4172
- setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4205
+ * 获取聊天室房间数据
4206
+ * @description count 或 order 有一个为 0 时,只返回成员总数,不返回成员列表信息
4207
+ * @param roomId 聊天室 Id
4208
+ * @param count 获取房间人员列表数量,最大有效值 `20`,最小值未 `0`,默认为 0
4209
+ * @param order 人员排序方式,`1` 为正序,`2` 为倒序,默认为 0
4210
+ */
4211
+ getChatroomInfo(roomId: string, count?: number, order?: 0 | 1 | 2): Promise<IAsyncRes<IChatroomInfo>>;
4173
4212
  /**
4174
- * 批量设置聊天室属性
4213
+ * 在指定聊天室中设置自定义属性
4214
+ * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
4215
+ * @param roomId 聊天室房间 id
4216
+ * @param entry 属性信息
4175
4217
  */
4176
- setChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<{
4218
+ setChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
4219
+ setChatroomEntries(roomId: string, entryOptions: IChatroomEntries): Promise<{
4177
4220
  code: ErrorCode;
4178
4221
  data?: any;
4179
4222
  }>;
4180
4223
  /**
4181
- * 强制设置聊天室属性
4182
- */
4183
- forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4224
+ * 在指定聊天室中强制增加 / 修改任意聊天室属性
4225
+ * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
4226
+ * @param roomId 聊天室房间 id
4227
+ * @param entry 属性信息
4228
+ */
4229
+ forceSetChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
4184
4230
  /**
4185
4231
  * 删除聊天室属性
4186
- */
4187
- removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4232
+ * @description 该方法仅限于删除自己设置的聊天室属性
4233
+ * @param roomId 聊天室房间 id
4234
+ * @param entry 要移除的属性信息
4235
+ */
4236
+ removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
4188
4237
  /**
4189
4238
  * 批量删除聊天室属性
4239
+ * @description 该方法仅限于删除自己设置的聊天室属性
4240
+ * @param roomId 聊天室房间 id
4241
+ * @param entry 要移除的属性信息
4190
4242
  */
4191
- removeChatroomEntries(chatroomId: string, entries: IChrmKVEntries): Promise<{
4243
+ removeChatroomEntries(roomId: string, entryOptions: IRemoveChatRoomEntriesOption): Promise<{
4192
4244
  code: ErrorCode;
4193
4245
  data?: any;
4194
4246
  }>;
4195
4247
  /**
4196
- * 强制删除聊天室属性
4197
- */
4198
- forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4248
+ * 强制删除任意聊天室属性
4249
+ * @description 该方法仅限于删除自己设置的聊天室属性
4250
+ * @param roomId 聊天室房间 id
4251
+ * @param entry 要移除的属性信息
4252
+ */
4253
+ forceRemoveChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
4199
4254
  /**
4200
- * 获取聊天室 key 对应 value
4201
- */
4202
- getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
4255
+ * 获取聊天室中的指定属性
4256
+ * @param roomId 聊天室房间 id
4257
+ * @param key 属性键名
4258
+ */
4259
+ getChatroomEntry(roomId: string, key: string): Promise<IAsyncRes<string | null>>;
4203
4260
  /**
4204
- * 获取聊天室所有 key value
4205
- */
4206
- getAllChatroomEntry(chatroomId: string): IPromiseResult<{
4261
+ * 获取聊天室内的所有属性
4262
+ * @param roomId 聊天室房间 id
4263
+ */
4264
+ getAllChatroomEntries(roomId: string): Promise<IAsyncRes<{
4207
4265
  [key: string]: string;
4208
- }>;
4266
+ }>>;
4209
4267
  /**
4210
- * 获取上传认证信息
4268
+ * 拉取聊天室内的历史消息
4269
+ * @param roomId
4270
+ * @param count 拉取消息条数, 有效值范围 `1 - 20`
4271
+ * @param order 获取顺序,默认值为 0。
4272
+ * * 0:降序,用于获取早于指定时间戳发送的消息
4273
+ * * 1:升序,用于获取晚于指定时间戳发送的消息
4274
+ * @param timestamp 指定拉取消息用到的时间戳。默认值为 `0`,表示按当前时间拉取
4275
+ */
4276
+ getChatRoomHistoryMessages(roomId: string, count?: number, order?: 0 | 1, timestamp?: number): Promise<IAsyncRes<{
4277
+ list: IReceivedMessage[];
4278
+ hasMore: boolean;
4279
+ }>>;
4280
+ /**
4281
+ * 获取存储服务鉴权信息
4282
+ * @param fileType 文件类型
4283
+ * @param fileName 文件名称
4284
+ * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
4285
+ * @param queryString STC 分段上传时的查询字符串
4211
4286
  * @description
4212
- * 若不传 fileName 百度上传认证字段(bosToken、bosDate、path)均返回 null
4213
- */
4214
- getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
4287
+ * `httpMethod` `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
4288
+ * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`
4289
+ * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`
4290
+ * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`
4291
+ * @returns
4292
+ */
4293
+ getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<IUploadAuth & {
4294
+ bos: string;
4295
+ qiniu: string;
4296
+ }>;
4215
4297
  /**
4216
- * 获取文件上传后下载地址
4298
+ * 获取 七牛、百度、阿里云 上传成功可下载的 URL
4299
+ * @param fileType 文件类型
4300
+ * @param fileName 文件名
4301
+ * @param saveName 下载后的存储文件名
4302
+ * @param uploadRes 插件上传返回的结果。降级百度上传后,用户传入返回结果,再把结果里的下载地址返回给用户,保证兼容之前结果获取
4303
+ * @param serverType 使用的存储服务标识
4217
4304
  */
4218
- getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName?: string, originName?: string): IPromiseResult<{
4305
+ getFileUrl(fileType: FileType, fileName?: string, saveName?: string, uploadRes?: {
4306
+ isBosRes: boolean;
4307
+ downloadUrl: string;
4308
+ }, serverType?: UploadMethod): Promise<{
4219
4309
  downloadUrl: string;
4220
4310
  }>;
4221
4311
  /**
4222
4312
  * 创建标签
4223
4313
  * @param tag 标签
4224
- */
4225
- createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
4314
+ */
4315
+ createTag(tag: ITagParam): Promise<IAsyncRes>;
4226
4316
  /**
4227
4317
  * 删除标签
4228
4318
  * @param tagId 标签id
4229
- */
4230
- removeTag(tagId: string): IPromiseResult<IAsyncRes>;
4319
+ */
4320
+ removeTag(tagId: string): Promise<IAsyncRes>;
4231
4321
  /**
4232
- * 编辑标签
4322
+ * 更新标签
4233
4323
  * @param tag 标签
4234
- */
4235
- updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
4324
+ */
4325
+ updateTag(tag: ITagParam): Promise<IAsyncRes>;
4236
4326
  /**
4237
4327
  * 获取标签列表
4238
4328
  */
4239
- getTagList(): IPromiseResult<Array<ITagInfo>>;
4329
+ getTagList(): Promise<IAsyncRes<Array<ITagInfo>>>;
4240
4330
  /**
4241
4331
  * 添加会话到标签(给多个会话增加标签)
4242
4332
  * @param tagId 标签id
4243
4333
  * @param conversations 要添加的会话列表
4244
4334
  */
4245
- addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
4335
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
4246
4336
  /**
4247
4337
  * 删除标签中的会话(从多个会话中批量删除指定标签)
4248
4338
  * @param tagId 标签id
4249
4339
  * @param conversations 要删除的会话列表
4250
4340
  */
4251
- removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
4341
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
4252
4342
  /**
4253
4343
  * 删除会话中的标签(从单一会话中批量删除标签)
4254
4344
  * @param conversationType 会话类型
4255
4345
  * @param targetId 会话id
4256
4346
  * @param tagIds 要删除的标签列表
4257
4347
  */
4258
- removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
4348
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<IAsyncRes>>;
4259
4349
  /**
4260
4350
  * 获取标签下的会话列表
4261
4351
  * @param tagId 标签id
4262
4352
  */
4263
- getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): IPromiseResult<IReceivedConversationByTag[]>;
4353
+ getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): Promise<IAsyncRes<IReceivedConversationByTag[]>>;
4264
4354
  /**
4265
4355
  * 获取标签下的未读消息数
4266
4356
  * @param tagId 标签id
4267
4357
  * @param containMuted 是否包含免打扰会话
4268
4358
  */
4269
- getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
4359
+ getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number>>;
4270
4360
  /**
4271
4361
  * 设置标签中会话置顶
4272
4362
  * @param conversation 会话
4273
4363
  */
4274
- setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
4364
+ setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
4365
+ isTop: boolean;
4366
+ }): Promise<IAsyncRes<IAsyncRes>>;
4275
4367
  /**
4276
4368
  * 获取会话里的标签
4277
- * @param config
4278
- */
4279
- getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
4280
- /**
4281
- * 发送群组消息已读回执
4282
- * 导航下发已读回执开关为 true 时调用
4283
- */
4284
- sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
4285
- /**
4286
- * 获取群组消息已读列表
4287
- */
4288
- getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
4289
- /**
4290
- * 获取服务器时间
4369
+ * @param conversation
4291
4370
  */
4292
- getServerTime(): number;
4371
+ getTagsForConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[]>>;
4293
4372
  /**
4294
- * 获取设备ID
4373
+ * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
4374
+ * 对于未实现的方法,接口响应 Unsupport 错误码
4375
+ * @param method 方法名
4376
+ * @param args
4295
4377
  */
4296
- getDeviceId(): string;
4378
+ callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
4297
4379
  /**
4298
- * 获取当前 userId
4299
- */
4300
- getCurrentUserId(): string;
4380
+ * 删除所有会话
4381
+ */
4382
+ clearConversations(conversationTypes?: ConversationType[], tag?: string): Promise<ErrorCode>;
4301
4383
  /**
4302
- * 设置用户在线状态监听器
4384
+ * 设置用户连接状态监听器
4303
4385
  */
4304
4386
  setUserStatusListener(config: {
4305
4387
  userIds: string[];
4306
4388
  }, listener: Function): void;
4307
4389
  /**
4308
- * 设置当前用户在线状态
4309
- */
4310
- setUserStatus(status: number): Promise<ErrorCode>;
4311
- /**
4312
- * 订阅用户在线状态
4313
- */
4314
- subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
4315
- /**
4316
- * 获取用户状态
4317
- */
4318
- getUserStatus(userId: string): IPromiseResult<{
4319
- status: string;
4320
- }>;
4321
- /**
4322
- * 清空所有会话
4323
- */
4324
- clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
4325
- /**
4326
- * 加入黑名单
4390
+ * 添加用户黑名单
4327
4391
  */
4328
4392
  addToBlacklist(userId: string): Promise<ErrorCode>;
4329
4393
  /**
4330
- * 将指定用户移除黑名单
4394
+ * 将指定用户移除黑名单
4331
4395
  */
4332
4396
  removeFromBlacklist(userId: string): Promise<ErrorCode>;
4333
4397
  /**
4334
- * 获取黑名单列表
4398
+ * 获取黑名单列表
4335
4399
  */
4336
- getBlacklist(): IPromiseResult<string[]>;
4400
+ getBlacklist(): Promise<IAsyncRes<string[]>>;
4337
4401
  /**
4338
- * 获取指定人员在黑名单中的状态
4402
+ * 获取指定人员在黑名单中的状态
4339
4403
  */
4340
- getBlacklistStatus(userId: string): IPromiseResult<string>;
4404
+ getBlacklistStatus(userId: string): Promise<IAsyncRes<string>>;
4341
4405
  /**
4342
4406
  * 向本地插入一条消息,不发送到服务器
4343
4407
  */
4344
- insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
4408
+ insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
4345
4409
  /**
4346
4410
  * 删除本地消息
4347
4411
  */
4348
- deleteMessages(timestamps: number[]): Promise<ErrorCode>;
4412
+ deleteMessages(timestamp: number[]): Promise<ErrorCode>;
4349
4413
  /**
4350
- * 通过时间戳删除本地消息
4414
+ * 从本地消息数据库中删除某一会话指定时间之前的消息数据
4351
4415
  */
4352
- deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
4416
+ deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId?: string): Promise<ErrorCode>;
4353
4417
  /**
4354
4418
  * 清空会话下历史消息
4355
4419
  */
4356
- clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
4420
+ clearMessages(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
4357
4421
  /**
4358
- * 获取消息
4422
+ * 获取本地消息
4359
4423
  */
4360
- getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
4424
+ getMessage(messageId: number): Promise<IAsyncRes<IReceivedMessage>>;
4361
4425
  /**
4362
4426
  * 设置消息内容
4363
4427
  */
@@ -4366,49 +4430,66 @@ interface IEngine {
4366
4430
  * 设置消息搜索字段
4367
4431
  */
4368
4432
  setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
4369
- /**
4370
- * 通过关键字搜索会话
4371
- */
4372
- searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
4373
- /**
4374
- * 按内容搜索会话内的消息
4375
- */
4376
- searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
4377
- messages: IReceivedMessage[];
4378
- count: number;
4379
- }>;
4380
- /**
4381
- * 获取会话下所有未读的 @ 消息
4382
- */
4383
- getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
4384
4433
  /**
4385
4434
  * 设置消息发送状态
4386
4435
  */
4387
4436
  setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
4388
4437
  /**
4389
- * 设置消息接收状态
4438
+ * 设置消息接收状态
4390
4439
  */
4391
4440
  setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
4392
4441
  /**
4393
- * 删除时间戳前的未读数
4442
+ * 设置当前用户在线状态
4394
4443
  */
4395
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
4444
+ setUserStatus(status: number): Promise<ErrorCode>;
4396
4445
  /**
4397
- * 获取会话免打扰状态
4446
+ * 订阅用户在线状态
4398
4447
  */
4399
- getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
4448
+ subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
4400
4449
  /**
4401
- * 协议栈获取远端历史消息
4450
+ * 获取用户在线状态
4402
4451
  */
4403
- getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
4452
+ getUserStatus(userId: string): Promise<IAsyncRes<{
4453
+ status: string;
4454
+ }>>;
4455
+ searchConversationByContent(keyword: string, customMessageTypes?: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
4456
+ searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId?: string): Promise<IAsyncRes<{
4457
+ messages: IReceivedMessage[];
4458
+ count: number;
4459
+ }>>;
4460
+ getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId?: string): IReceivedMessage[];
4461
+ clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
4462
+ /**
4463
+ * 获取会话免打扰状态
4464
+ */
4465
+ getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<NotificationStatus>>;
4466
+ getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): Promise<IAsyncRes<{
4404
4467
  list: IReceivedMessage[];
4405
4468
  hasMore: boolean;
4469
+ }>>;
4470
+ /**
4471
+ * 获取群组消息送达信息
4472
+ */
4473
+ getGroupMessageDeliverList(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IGroupMessageDeliverInfo>;
4474
+ /**
4475
+ * 获取单聊消息送达信息
4476
+ */
4477
+ getPrivateMessageDeliverTime(messageUId: string, channelId?: string): IPromiseResult<number>;
4478
+ setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
4479
+ key: string;
4480
+ value: string;
4406
4481
  }>;
4407
- joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
4482
+ /**
4483
+ * 加入房间
4484
+ * @param roomId
4485
+ * @param mode 房间模式:直播 or 会议
4486
+ * @param mediaType 直播房间模式下的媒体资源类型
4487
+ */
4488
+ joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number, joinType?: RTCJoinType): Promise<IAsyncRes<IJoinRTCRoomData>>;
4408
4489
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
4409
- rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
4410
- getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
4411
- getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
4490
+ rtcPing(roomId: string, mode: number, mediaType?: number): Promise<ErrorCode>;
4491
+ getRTCRoomInfo(roomId: string): Promise<IAsyncRes<IRTCRoomInfo>>;
4492
+ getRTCUserInfoList(roomId: string): Promise<IAsyncRes<IRTCUsers>>;
4412
4493
  getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
4413
4494
  setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
4414
4495
  removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
@@ -4416,49 +4497,40 @@ interface IEngine {
4416
4497
  name: string;
4417
4498
  content: string;
4418
4499
  }): Promise<ErrorCode>;
4419
- /**
4420
- * 全量订阅资源修改
4421
- * @param roomId 房间 Id
4422
- * @param message 向前兼容的消息内容
4423
- * @param valueInfo 全量资源数据
4424
- * @param objectName 全量 URI 消息名
4425
- */
4426
4500
  setRTCTotalRes(roomId: string, message: {
4427
4501
  name: string;
4428
4502
  content: string;
4429
- }, valueInfo: string, objectName: string, mcuValInfo: string): Promise<ErrorCode>;
4430
- getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
4503
+ }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
4504
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4505
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): Promise<IAsyncRes<KVString>>;
4431
4506
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
4432
4507
  name: string;
4433
4508
  content: string;
4434
4509
  }): Promise<ErrorCode>;
4435
4510
  setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
4436
4511
  getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
4437
- getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
4438
- setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
4512
+ getRTCToken(roomId: string, mode: number, broadcastType?: number): Promise<IAsyncRes<IRtcTokenData>>;
4513
+ setRTCState(roomId: string, report: string): Promise<ErrorCode>;
4439
4514
  getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
4440
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4441
- }
4442
-
4443
- interface IExpansionMsgContent {
4444
4515
  /**
4445
- * 消息扩展的对象
4446
- */
4447
- put?: {
4448
- [key: string]: string;
4449
- };
4516
+ * 直播观众加房间
4517
+ */
4518
+ joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
4519
+ token: string;
4520
+ kvEntries: IServerRTCRoomEntry[];
4521
+ }>>;
4450
4522
  /**
4451
- * 删除的 keys
4452
- */
4453
- del?: string[];
4523
+ * 直播观众退出房间
4524
+ */
4525
+ quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
4454
4526
  /**
4455
- * messageUId
4456
- */
4457
- mid: string;
4527
+ * 直播身份切换
4528
+ */
4529
+ rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4458
4530
  /**
4459
- * 是否删除所有, 有效值:0、1 . ( 后续如有需要, API Layer 层可使用)
4460
- */
4461
- removeAll?: number;
4531
+ * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
4532
+ */
4533
+ getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
4462
4534
  }
4463
4535
 
4464
4536
  declare class RTCPluginContext extends PluginContext {
@@ -4602,6 +4674,8 @@ interface IEngineWatcher {
4602
4674
  */
4603
4675
  onRTCDataChange: (data: IServerRTCRoomEntry[], roomId?: string) => void;
4604
4676
  pullFinished: () => void;
4677
+ messageDelivered: (data: IMessageDeliver[]) => void;
4678
+ callInfo: (data: string) => void;
4605
4679
  }
4606
4680
  /**
4607
4681
  * 引擎定义
@@ -4760,6 +4834,10 @@ declare abstract class AEngine implements IEngine {
4760
4834
  * 清除指定会话未读数
4761
4835
  */
4762
4836
  abstract clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
4837
+ /**
4838
+ * 清除全部会话未读数
4839
+ */
4840
+ abstract clearAllUnreadCount(): Promise<ErrorCode>;
4763
4841
  /**
4764
4842
  * 获取第一个未读消息
4765
4843
  */
@@ -5091,6 +5169,18 @@ declare abstract class AEngine implements IEngine {
5091
5169
  list: IReceivedMessage[];
5092
5170
  hasMore: boolean;
5093
5171
  }>;
5172
+ /**
5173
+ * 获取群组消息送达列表
5174
+ */
5175
+ abstract getGroupMessageDeliverList(targetId: string, messageUId: string, channelId: string): IPromiseResult<IGroupMessageDeliverInfo>;
5176
+ /**
5177
+ * 获取单聊消息送达列表
5178
+ */
5179
+ abstract getPrivateMessageDeliverTime(messageUId: string, channelId: string): IPromiseResult<number>;
5180
+ abstract setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
5181
+ key: string;
5182
+ value: string;
5183
+ }>;
5094
5184
  abstract joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): IPromiseResult<IJoinRTCRoomData>;
5095
5185
  abstract quitRTCRoom(roomId: string): Promise<ErrorCode>;
5096
5186
  abstract rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
@@ -5595,4 +5685,4 @@ declare enum CONNECTION_TYPE {
5595
5685
  */
5596
5686
  declare const version: string;
5597
5687
 
5598
- export { AEngine, ANavi, APIContext, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType as ChatroomMemberChangeType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAsyncRes, IBlockedMessageInfo, IChatroomEntries, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IEngine, IEngineWatcher, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageBlockedListener, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntriesOption, IRemoveChatRoomEntryOption, IRequest, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, ItypingStateListener, KVString, LiveRole, LiveType, LogLevel, LogType, Logger, MAX_MESSAGE_CONTENT_BYTES, MINI_COMET_CONNECT_URIS, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NotificationStatus, PING_REQ_TIMEOUT, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UploadMethod, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, cloneByJSON, forEach, formatConnectResponseCode, getBrowser, getMimeKey, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidFileType, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, usingCppEngine, validate, version };
5688
+ export { AEngine, ANavi, APIContext, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType as ChatroomMemberChangeType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAsyncRes, IBlockedMessageInfo, IChatroomEntries, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IDeliveredUser, IEngine, IEngineWatcher, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGroupMessageDeliverInfo, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageBlockedListener, IMessageDeliver, IMessageDeliveredListener, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntriesOption, IRemoveChatRoomEntryOption, IRequest, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, ItypingStateListener, KVString, LiveRole, LiveType, LogLevel, LogType, Logger, MAX_MESSAGE_CONTENT_BYTES, MINI_COMET_CONNECT_URIS, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NotificationStatus, PING_REQ_TIMEOUT, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UploadMethod, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, cloneByJSON, forEach, formatConnectResponseCode, getBrowser, getMimeKey, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidFileType, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, usingCppEngine, validate, version };