@rongcloud/electron 5.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts ADDED
@@ -0,0 +1,980 @@
1
+ import { ConversationType, IChrmKVEntry, FileType, RTCJoinType, IRTCUsers, RTCApiType, IEngine, IExtraMethod, IAsyncRes, IReceivedConversation, IPromiseResult, IReceivedMessage, INaviInfo, ErrorCode, ISendMsgOptions, IRecallMsgOptions, MessageDirection, NotificationStatus, IInsertMsgOptions, IServerConversationStatus, ISetConversationStatusOptions, IServerUserSetting, IMessageReaderResponse, IChatroomInfo, IChrmKVEntries, IUploadAuth, UploadMethod, RTCMode, IRTCUserData, IJoinRTCRoomData, IRTCRoomInfo, KVString, IRtcTokenData, ITagParam, ITagInfo, IConversationOption, IReceivedConversationByTag, ITagStatus, IConversationTag, IServerRTCRoomEntry, RTCIdentityChangeType, IRTCJoinedInfo, IBaseConversationInfo, IReqRoomPKOptions, ICancelRoomPKOptions, IResRoomPKOptions, IEndRoomPKOptions, IRTCRoomBindOption, LogLevel } from '@rongcloud/engine';
2
+
3
+ declare type IOnErrorCallBack = (code: number) => void;
4
+ interface ICppProtocol {
5
+ /**
6
+ * 初始化 CPP
7
+ * @param appkey App Key
8
+ * @param dbPath 数据库路径,相对:相对于启动目录 绝对:绝对路径
9
+ */
10
+ initWithAppkey: (appkey: string, dbPath?: string) => string;
11
+ /**
12
+ * 反初始化
13
+ * @description
14
+ * 清除实例、监听
15
+ */
16
+ destory: () => void;
17
+ /**
18
+ * 设置连接状态监听器
19
+ */
20
+ setConnectionStatusListener: (onSuccess?: (status: number) => void, onDBOpen?: (status: number) => void, // 数据库是否初始化成功
21
+ onHeartPong?: (status: number) => void) => void;
22
+ /**
23
+ * 心跳发送 4.0 + 协议栈需 lib 层维护心跳, 有回调即认为 ping 成功
24
+ */
25
+ sendHeartbeat: () => void;
26
+ /**
27
+ * 设置消息监听器
28
+ */
29
+ setOnReceiveMessageListener: (onSuccess?: (result: string, leftCount: number, offline: boolean, hasMore: boolean) => void, onPullDone?: () => void) => void;
30
+ /**
31
+ * 设置用户状态(在线、离线、忙碌)接收监听器
32
+ */
33
+ setOnReceiveStatusListener: (onSuccess?: (userId: string, status: string) => void) => void;
34
+ /**
35
+ * 设置会话状态监听器 ( 置顶、免打扰 )
36
+ */
37
+ setConversationStatusListener: (listenter?: (result: string) => void, tagListener?: (result: string) => void) => void;
38
+ /**
39
+ * 设置聊天室状态监听
40
+ */
41
+ setChatroomEventListener: (listenter?: (roomId: string, destroyType: any) => void) => void;
42
+ /**
43
+ * TODO ?
44
+ */
45
+ setUserProfileListener: (listenter?: (result: any) => void, tagListenter?: (result: any) => void) => void;
46
+ /**
47
+ * 建立链接
48
+ */
49
+ connectWithToken: (token: string, sdkVer: string, navi: string, reconnect: boolean) => void;
50
+ /**
51
+ * 断开链接
52
+ * @param isReceivePush 断开连接后是否接收 PUSH
53
+ */
54
+ disconnect: (isReceivePush: boolean) => void;
55
+ /**
56
+ * 设置当前用户在线状态
57
+ * @param status 10 在线、11 离开、12 忙碌
58
+ */
59
+ setUserStatus: (status: number, onSuccess: () => void, onError: IOnErrorCallBack) => void;
60
+ /**
61
+ * TODO ? 设置用户状态(在线、离线、忙碌)接收监听器 订阅的用户
62
+ */
63
+ subscribeUserStatus: (userIds: string[], onSuccess: () => void, onError: IOnErrorCallBack) => void;
64
+ /**
65
+ * 获取用户状态
66
+ */
67
+ getUserStatus: (userId: string, onSuccess: (status: string) => void, onError: IOnErrorCallBack) => void;
68
+ /**
69
+ * 注册消息
70
+ * @param messageType 消息类型
71
+ * @param persistentFlag 存储选项 0 不存不计数 1 只存不计数 3 存且计数
72
+ * @param searchProp 搜索字段
73
+ */
74
+ registerMessageType: (messageType: string, persistentFlag: number, searchProp?: string[]) => void;
75
+ /**
76
+ * 获取延迟时间 = 本地时间 - 服务器时间
77
+ */
78
+ getDeltaTime: () => number;
79
+ /**
80
+ * 发送消息
81
+ * @description
82
+ * 废弃 isMentioned 字段,协议栈内部根据消息体内容判断是否是 @ 消息
83
+ */
84
+ sendMessage: (onSuccess: (message: string, code: number) => void, onError: (message: string, code: number) => void, conversationType: ConversationType, targetId: string, messageType: string, messageContent: string, directionalUserIdList: string[], // 接收定向消息的用户 id 列表. 仅群组有效
85
+ disableNotification: boolean, // 禁用消息通知
86
+ disablePushTitle: boolean, // 移动端是否禁用自定义标题 // disablePushTitle
87
+ forceShowDetailContent: boolean, // 移动端是否强制显示详情 // forceShowDetailContent
88
+ pushContent: string, // Push 显示内容
89
+ pushData: string, // Push 通知时附加信息
90
+ notificationId: string, // 推送 ID // notificationId
91
+ pushTitle: string, // 自定义推送标题 // pushTitle
92
+ pushConfig: string, // 移动端 PUSH 配置
93
+ pushTemplateId: string, // PUSH 模板 ID
94
+ canIncludeExpansion: boolean, // 是否支持消息扩展存储
95
+ expansionContent: string, // 扩展消息内容
96
+ enableVoipPush: boolean, // 开启 voip 推送 , 音视频 CAllLib SDK 发消息使用。IM 消息均为 false
97
+ tag?: string) => any;
98
+ /**
99
+ * 撤回消息
100
+ */
101
+ recallMessage: (onSuccess: (message: string, code: number) => void, onError: IOnErrorCallBack, mesasgeType: string, content: string, disableNotification: boolean, // 禁用消息通知
102
+ disablePushTitle: boolean, // 移动端是否禁用自定义标题 // disablePushTitle
103
+ forceShowDetailContent: boolean, // 移动端是否强制显示详情 // forceShowDetailContent
104
+ pushContent: string, // Push 显示内容
105
+ pushData: string, // Push 通知时附加信息
106
+ notificationId: string, // 推送 ID // notificationId
107
+ pushTitle: string, // 自定义推送标题 // pushTitle
108
+ pushConfig: string, // 移动端 PUSH 配置
109
+ pushTemplateId: string, // PUSH 模板 ID,
110
+ tag: string) => void;
111
+ /**
112
+ * 获取历史消息,并按时间降序排列
113
+ * @param isDesc : 是否降序取
114
+ * @param timestamp : 如果传 0 且降序 获取最新时间戳之前降序排列。 非 0 降序为获取时间戳之前的, 非 0 升序为获取时间戳时候的
115
+ */
116
+ getHistoryMessages: (conversationType: ConversationType, targetId: string, timestamp: number, count: number, objectName: string, isDesc: boolean, tag: string) => string;
117
+ /**
118
+ * 通过消息类型获取历史消息列表
119
+ * @param desc 是否按 sentTime 降序排列,默认为 true
120
+ */
121
+ getHistoryMessagesByObjectNames: (conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: boolean, tag: string) => string;
122
+ /**
123
+ * 获取远端历史消息
124
+ * @param isDesc : 是否降序取
125
+ * @param timestamp : 如果传 0 且降序 获取最新时间戳之前降序排列。 非 0 降序为获取时间戳之前的, 非 0 升序为获取时间戳时候的
126
+ * @param needRepeatMsg : 是否需要重复消息。比如第一次获取了[1,2] 历史消息,第二次获取了 [2,3]. true 第二次包含 2 、false 第二次不包含 2
127
+ */
128
+ getRemoteHistoryMessages: (conversationType: ConversationType, targetId: string, timestamp: number, count: number, onSuccess: (result: string, hasMore: boolean) => void, onError: IOnErrorCallBack, isDesc: number, needRepeatMsg: boolean, tag: string) => void;
129
+ /**
130
+ * 通过时间戳删除历史消息
131
+ */
132
+ clearRemoteHistoryMessages: (conversationType: ConversationType, targetId: string, timestamp: number, onSuccess: () => void, onError: IOnErrorCallBack, tag: string) => void;
133
+ /**
134
+ * 通过消息 ID 删除批量指定消息
135
+ * @param isDelLocal 是否同时删除本地消息
136
+ */
137
+ deleteRemoteHistoryMessages: (conversationType: ConversationType, targetId: string, msgsStr: string, isDelLocal: boolean, tag: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
138
+ /**
139
+ * 清空会话内本地历史消息
140
+ */
141
+ clearMessages: (conversationType: ConversationType, targetId: string, tag: string) => void;
142
+ /**
143
+ * 获取会话列表
144
+ */
145
+ getConversationList: (conversationTypes: ConversationType[], tag: string) => string;
146
+ getConversationListWithAllChannelByPage(conversationTypes: ConversationType[], index: number, limit: number): string;
147
+ getConversationListWithAllChannel(conversationTypes: ConversationType[]): string;
148
+ /**
149
+ * 获取指定会话
150
+ */
151
+ getConversation: (conversationType: ConversationType, targetId: string, tag: string) => string;
152
+ /**
153
+ * 删除会话
154
+ */
155
+ removeConversation: (conversationType: ConversationType, targetId: string, tag: string) => boolean;
156
+ /**
157
+ * 清空会话列表
158
+ */
159
+ clearConversations: (conversationTypes?: ConversationType[], tag?: string) => void;
160
+ /**
161
+ * 获取指定会话未读数
162
+ */
163
+ getUnreadCount: (conversationType: ConversationType, targetId: string, tag: string) => number;
164
+ /**
165
+ * 按会话类型获取会话未读数
166
+ * @description
167
+ * 不传 conversationType 获取所有会话未读数
168
+ * @param isIncludeNotDisturb 是否包含免打扰
169
+ */
170
+ getTotalUnreadCount: (conversationTypes?: ConversationType[], isIncludeNotDisturb?: boolean, tag?: string) => number;
171
+ /**
172
+ * 清除指定会话未读数
173
+ */
174
+ clearUnreadCount: (conversationType: ConversationType, targetId: string, tag: string) => unknown;
175
+ /**
176
+ * 清除时间戳之前的未读数
177
+ */
178
+ clearUnreadCountByTimestamp: (conversationType: ConversationType, targetId: string, timestamp: number, tag: string) => unknown;
179
+ /**
180
+ * 获取第一个未读消息
181
+ */
182
+ getTheFirstUnreadMessage: (conversationType: ConversationType, targetId: string, tag: string) => unknown;
183
+ /**
184
+ * 设置会话置顶、免打扰状态
185
+ */
186
+ setConversationStatus: (conversationType: ConversationType, targetId: string, isBlocked: boolean, isTop: boolean, onSuccess: () => void, onError: (code: number) => void, tag: string, isCreateConversation: boolean) => void;
187
+ /**
188
+ * 设置会话置顶
189
+ */
190
+ setConversationToTop: (conversationType: ConversationType, targetId: string, isTop: boolean, tag: string, isCreateConversation: boolean) => void;
191
+ /**
192
+ * 获取会话置顶状态
193
+ */
194
+ getConversationTopStatus: (conversationType: ConversationType, targetId: string, channelId: string) => number;
195
+ /**
196
+ * 设置会话隐藏
197
+ */
198
+ setConversationHidden: (conversationType: ConversationType, targetId: string, isHidden: boolean, tag: string) => void;
199
+ /**
200
+ * 设置会话免打扰
201
+ * @param isBlocked true 开启免打扰 false 关闭免打扰
202
+ */
203
+ setConversationNotificationStatus: (conversationType: ConversationType, targetId: string, isBlocked: boolean, onSuccess: () => void, onError: (code: number) => void, tag: string) => void;
204
+ /**
205
+ * 获取会话置顶状态
206
+ */
207
+ getConversationNotificationStatus: (conversationType: ConversationType, targetId: string, tag: string) => boolean;
208
+ /**
209
+ * 通过关键字搜索会话
210
+ */
211
+ searchConversationByContent: (conversationTypes: ConversationType[], keyword: string, customMessageTypes: string[], // 自定义消息类型
212
+ tag: string) => string;
213
+ /**
214
+ * 发送已读回执
215
+ */
216
+ sendReadReceipt: (targetId: string, channelId: string, msgUid: string[], onSuccess: () => void, onError: IOnErrorCallBack) => void;
217
+ /**
218
+ * 获取已读列表
219
+ */
220
+ getMessageReader: (targetId: string, channelId: string, msgUid: string, onSuccess: (list: any[], count: number) => void, onError: IOnErrorCallBack) => void;
221
+ /**
222
+ * 更新消息已读回执信息
223
+ */
224
+ updateReadReceiptRequestInfo: (messageUId: string, readerInfo: string) => void;
225
+ /**
226
+ * 加入聊天室
227
+ */
228
+ joinChatRoom: (chrmId: string, count: number, onSuccess: () => void, onError: IOnErrorCallBack) => void;
229
+ /**
230
+ * 退出聊天室
231
+ */
232
+ quitChatRoom: (chrmId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
233
+ /**
234
+ * 获取聊天室信息
235
+ */
236
+ getChatroomInfo: (chrmId: string, count: number, order: number, onSuccess: (result: string, count: number) => void, onError: IOnErrorCallBack) => void;
237
+ /**
238
+ * 获取聊天室历史消息
239
+ * TODO 旧 V2 未实现,先补充接口定义
240
+ */
241
+ getChatroomHistoryMessage: (chrmId: string, begin: number, count: number, order: number, onSuccess: (data: string) => void, onError: (code: number) => void, channelId: string) => void;
242
+ /**
243
+ * 设置聊天室属性
244
+ */
245
+ setChatroomKV: (chrmId: string, kv: string, autoDelete: boolean | undefined, overwrite: boolean | undefined, onSuccess: () => void, onError: (code: number) => void) => void;
246
+ /**
247
+ * 删除聊天室属性
248
+ */
249
+ deleteChatroomKV: (chrmId: string, kvs: string[], overwrite: boolean | undefined, onSuccess: () => void, onError: (code: number) => void) => void;
250
+ /**
251
+ * 强制删除聊天室属性
252
+ */
253
+ forceRemoveChatroomEntry: (chrmId: string, entry: IChrmKVEntry, onSuccess: () => void, onError: (code: number) => void) => void;
254
+ /**
255
+ * 获取Entry
256
+ */
257
+ getChatroomKV: (chrmId: string, onSuccess: (data: string) => void, onError: (code: number) => void) => void;
258
+ /**
259
+ * 获取上传文件校验信息
260
+ */
261
+ getUploadToken: (fileType: FileType, fileName: string, httpMethod: string | undefined, queryInfo: string | undefined, onSuccess: (token: string, bosToken: string, bosDate: string, bosPath: string, ossToken: string, ossPolicy: string, ossSignature: string, ossBucketName: string, s3Credential: string, s3Algorithm: string, s3Date: string, s3Policy: string, s3Signature: string, s3BucketName: string, stcAuthorization: string, stcContentSha256: string, stcDate: string, stcBucketName: string) => void, onError: IOnErrorCallBack) => void;
262
+ /**
263
+ * 获取文件下载地址
264
+ */
265
+ getDownloadUrl: (fileType: FileType, filename: string, // 媒体类型
266
+ oriName: string, // 本地存储文件名
267
+ isOss: number, // 是否为阿里云存储
268
+ onSuccess: (url: string) => void, onError: IOnErrorCallBack) => void;
269
+ /**
270
+ * 上报版本号
271
+ */
272
+ uploadSDKVersion: (version: string) => void;
273
+ /**
274
+ * 添加标签
275
+ */
276
+ addTag: (tagId: string, tagName: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
277
+ /**
278
+ * 修改标签名称
279
+ */
280
+ renameTag: (tagId: string, tagName: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
281
+ /**
282
+ * 删除标签
283
+ */
284
+ deleteTag: (tagId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
285
+ /**
286
+ * 标签下添加会话
287
+ */
288
+ addConversationsForTag: (tagId: string, conversations: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
289
+ /**
290
+ * 标签下移除会话
291
+ */
292
+ removeConversationsForTag: (tagId: string, conversations: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
293
+ /**
294
+ * 移除指定会话的某些标签
295
+ */
296
+ removeTagsForConversation: (conversationType: number, targetId: string, channelId: string, tagId: string[], onSuccess: () => void, onError: IOnErrorCallBack) => void;
297
+ /**
298
+ * 设置指定标签下指定会话是否置顶
299
+ * tag_id 不存在 协议层返回错误码 33100
300
+ */
301
+ setConversationToTopForTag: (tagId: string, conversationType: number, targetId: string, channelId: string, isTop: boolean, onSuccess: () => void, onError: IOnErrorCallBack) => void;
302
+ /**
303
+ * 获取用户的所有标签
304
+ */
305
+ getTags: () => string;
306
+ /**
307
+ * 获取指定会话的所有标签
308
+ */
309
+ getTagsForConversation: (conversationType: number, targetId: string, channelId: string) => string;
310
+ /**
311
+ * 分页获取指定标签下的会话列表
312
+ */
313
+ getConversationsForTagByPage: (tagId: string, sendTime: number, limit: number, channelId: string) => string;
314
+ /**
315
+ * 获取指定标签下的会话消息未读数
316
+ */
317
+ getConversationUnreadCountForTag: (tagId: string, containBlocked: boolean) => number;
318
+ /**
319
+ * 加入黑名单
320
+ */
321
+ addToBlacklist: (userId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
322
+ /**
323
+ * 将指定用户移除黑名单
324
+ */
325
+ removeFromBlacklist: (userId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
326
+ /**
327
+ * 获取黑名单列表
328
+ */
329
+ getBlacklist: (onSuccess: (userIds: string[]) => void, onError: IOnErrorCallBack) => void;
330
+ /**
331
+ * 获取指定人员在黑名单中的状态
332
+ */
333
+ getBlacklistStatus: (userId: string, onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
334
+ updateMessageReceiptStatus(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): boolean;
335
+ /**
336
+ * 向本地插入一条消息,不发送到服务器
337
+ * onSuccess 优先于函数返回值
338
+ */
339
+ insertMessage: (conversationType: ConversationType, targetId: string, senderUserId: string, messageType: string, msgContent: string, // JSON.stringify(msg.content)
340
+ onSuccess: () => void, onError: IOnErrorCallBack, direction: number, // 消息方向
341
+ readStatus?: number, // 阅读状态,0:未读,1:已读,2:已听
342
+ sendStatus?: number, // 发送状态,10:发送中,20:发送失败,30:发送成功,50:已发回执
343
+ sentTime?: number, // 发送消息的时间,unix 时间戳
344
+ searchContent?: string, // 消息的搜索关键字
345
+ isUnread?: number, // 存入时是否计入未读数,1:不计入,0:计入 (注意:direction 为接收消息方向时才生效)
346
+ messageUId?: string, // 消息唯一标识,服务生成,不确定时填入空字符串
347
+ disableNotification?: boolean, canIncludeExpansion?: boolean, expansionMsg?: string, tag?: string) => string;
348
+ /**
349
+ * 删除本地消息
350
+ * @param messageUId
351
+ */
352
+ deleteMessages: (messageUId: number[]) => void;
353
+ /**
354
+ * 通过时间戳删除本地消息
355
+ */
356
+ deleteMessagesByTimestamp: (conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, tag: string) => void;
357
+ /**
358
+ * 获取消息
359
+ * @description
360
+ * messageId 可以传 messageId 或 messageUId 均能查到消息
361
+ */
362
+ getMessage: (messageId: number | string) => string;
363
+ /**
364
+ * 设置消息内容
365
+ */
366
+ setMessageContent: (messageId: number, content: string, messageType: string) => void;
367
+ /**
368
+ * 设置消息搜索字段
369
+ */
370
+ setMessageSearchField: (messageId: number, content: string, searchFiles: string) => void;
371
+ /**
372
+ * 按内容搜索会话内的消息
373
+ * @description
374
+ * 1、文本类型消息只搜 content, 文件类型消息只搜 name (内置消息只有 文本和文件是协议栈定义死的,其他内置消息注册决定)
375
+ * 2、图文内置消息,协议栈只支持 name 字段。TODO 其他内置消息需与移动端对应
376
+ * 3、自定义消息根据 registerMessageType 的 searchProp 参数决定
377
+ * 4、引用消息不支持搜索
378
+ *
379
+ */
380
+ searchMessageByContent: (conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, // 是否返回查到的消息数量 {matchedNumber} 1 返回 0 不返
381
+ onSuccess: (result: string, matchedNumber: number) => void, tag: string) => void;
382
+ /**
383
+ * 设置消息发送状态
384
+ */
385
+ setMessageSentStatus: (messageId: number, sentStatus: number) => void;
386
+ /**
387
+ * 设置消息接收状态
388
+ */
389
+ setMessageReceivedStatus: (messageId: number, receivedStatus: number) => void;
390
+ /**
391
+ * 获取会话下所有未读的 @ 消息
392
+ */
393
+ getUnreadMentionedMessages: (conversationType: ConversationType, targetId: string, tag: string) => string;
394
+ /**
395
+ * 设置消息扩展字段
396
+ */
397
+ setMessageExtension: (conversationType: ConversationType, targetId: string, messageUId: string, messageExtension: string, tag: string) => void;
398
+ /**
399
+ * 加入 RTC 房间
400
+ */
401
+ joinRTCRoom: (roomId: string, roomType: number, liveType: number, joinType: RTCJoinType, onSuccess: (result: string, token: string, sessionId: string, roomInfo: string) => void, onError: IOnErrorCallBack, key?: string, value?: string, inner?: string, outer?: string) => void;
402
+ /**
403
+ * 退出 RTC 房间
404
+ */
405
+ exitRTCRoom: (roomId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
406
+ /**
407
+ * RTC Ping
408
+ */
409
+ sendRTCPing: (roomId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
410
+ /**
411
+ * 获取 RTC 房间信息
412
+ */
413
+ getRTCResouce: (roomId: string, order: number, onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
414
+ /**
415
+ * 获取 RTC 用户信息列表
416
+ */
417
+ getRTCUsers: (roomId: string, order: number, onSuccess: (result: IRTCUsers) => void, onError: IOnErrorCallBack) => void;
418
+ /**
419
+ * 设置 RTC 数据
420
+ */
421
+ setRTCInnerData: (roomId: string, apiType: RTCApiType, key: string, value: string, name: string, content: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
422
+ /**
423
+ * 设置 RTC 数据
424
+ */
425
+ setRTCOuterData: (roomId: string, apiType: RTCApiType, key: string, value: string, name: string, content: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
426
+ /**
427
+ * 获取 RTC 数据
428
+ */
429
+ getRTCInnerData: (roomId: string, apiType: RTCApiType, keys: string[], onSuccess: (data: string) => void, onError: IOnErrorCallBack) => void;
430
+ /**
431
+ * 获取 RTC 数据
432
+ */
433
+ getRTCOuterData: (roomId: string, apiType: RTCApiType, keys: string[], onSuccess: (data: string) => void, onError: IOnErrorCallBack) => void;
434
+ /**
435
+ * 删除 RTC 数据
436
+ */
437
+ deleteRTCInnerData: (roomId: string, apiType: RTCApiType, keys: string[], name: string, content: string, onSuccess: (data: unknown) => void, onError: IOnErrorCallBack) => void;
438
+ /**
439
+ * 删除 RTC 数据
440
+ */
441
+ deleteRTCOuterData: (roomId: string, apiType: RTCApiType, keys: string[], name: string, content: string, onSuccess: (data: unknown) => void, onError: IOnErrorCallBack) => void;
442
+ /**
443
+ * 获取 RTC Token
444
+ */
445
+ getRTCToken: (roomId: string, onSuccess: (token: string) => void, onError: IOnErrorCallBack) => void;
446
+ /**
447
+ * 日志上报
448
+ */
449
+ setRTCUserState: (roomId: string, state: string, onSuccess: (token: string) => void, onError: IOnErrorCallBack) => void;
450
+ /**
451
+ * 全量 Uri
452
+ */
453
+ setUserResource: (roomId: string, oldname: string, oldContent: string, newName: string, uris: string, mcuUris: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
454
+ /**
455
+ * 设置内置 cdn 数据
456
+ */
457
+ setRTCCDNUris: (roomId: string, objectName: string, CDNUris: string, onSuccess: () => void) => void;
458
+ /**
459
+ * 发送 RTC 消息
460
+ */
461
+ sendRTCMessage: (onSuccess: (message: string, code: number) => void, onError: (message: string, code: number) => void, conversationType: ConversationType, targetId: string, messageType: string, content: string, directionalUserIdList: string[], // 接收定向消息的用户 id 列表. 仅群组有效
462
+ disableNotification: boolean, // 禁用消息通知
463
+ disablePushTitle: boolean, // 移动端是否禁用自定义标题 // disablePushTitle
464
+ forceShowDetailContent: boolean, // 移动端是否强制显示详情 // forceShowDetailContent
465
+ pushContent: string, // Push 显示内容
466
+ pushData: string, // Push 通知时附加信息
467
+ notificationId: string, // 推送 ID // notificationId
468
+ pushTitle: string, // 自定义推送标题 // pushTitle
469
+ pushConfig: string, // 移动端 PUSH 配置
470
+ pushTemplateId: string, // PUSH 模板 ID
471
+ canIncludeExpansion: boolean, // 是否支持消息扩展存储
472
+ expansionContent: string, // 扩展消息内容
473
+ enableVoipPush: boolean, // 开启 voip 推送 , 音视频 CAllLib SDK 发消息使用。IM 消息均为 false
474
+ isStatusMsg: boolean) => void;
475
+ /**
476
+ * 直播观众加房间
477
+ */
478
+ audienceJoinRoom: (roomId: string, liveType: number, onSuccess: (token: string, entries: string) => void, onError: IOnErrorCallBack) => void;
479
+ /**
480
+ * 直播观众退出房间
481
+ */
482
+ audienceLeaveRoom: (roomId: string, onSuccess: (token: string) => void, onError: IOnErrorCallBack) => void;
483
+ /**
484
+ * 直播房间身份切换
485
+ */
486
+ switchRole: (roomId: string, liveType: number, roleChangeType: number, key: string, value: string,
487
+ /**
488
+ * TODO 主播切观众仅返回 token 待验证
489
+ */
490
+ onSuccess: (result: string, token: string, sessionId: string, roomInfo: string, entries: string) => void, onError: IOnErrorCallBack) => void;
491
+ /**
492
+ * 观众房间,资源通知监听
493
+ */
494
+ setRTCRoomEventListener(callback: (kv: string) => void): void;
495
+ getConversationListByPage(conversationTypes: ConversationType[], timestamp: number, limit: number, channelId: string): string;
496
+ /**
497
+ * 查询加入房间用户的信息
498
+ */
499
+ queryJoinedRoom: (onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
500
+ /**
501
+ * 直播跨房间连麦 PK 邀请
502
+ */
503
+ livePKInvitation: (roomId: string, // 当前房间 ID
504
+ invitedUserId: string, // 被邀请用户 ID
505
+ invitedRoomId: string, // 被邀请房间 ID
506
+ inviteInfo: string, // 本次邀请额外信息
507
+ inviteSessionId: string, // 本次邀请唯一 ID
508
+ inviteTimeout: number, // 本次邀请超时时间
509
+ onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
510
+ /**
511
+ * 直播跨房间连麦 PK 取消邀请
512
+ */
513
+ livePKCancel: (roomId: string, // 当前房间 ID
514
+ invitedUserId: string, // 被邀请用户 ID
515
+ invitedRoomId: string, // 被邀请房间 ID
516
+ inviteInfo: string, // 本次邀请额外信息
517
+ inviteSessionId: string, // 本次邀请唯一 ID
518
+ onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
519
+ /**
520
+ * 直播跨房间连麦 PK 取消邀请
521
+ */
522
+ livePKAnswer: (roomId: string, // 当前房间 ID
523
+ answerCode: number, // 是否同意 同意:1 不同意:0
524
+ inviteUserId: string, // 邀请者 ID
525
+ inviteRoomId: string, // 邀请者房间 ID
526
+ inviteSessionId: string, // 邀请的 SessionID
527
+ content: string, // 需要转发的信息
528
+ key: string, // 同意邀请时要设置的 key, 放在room级别的k和v,新加入房间的能拉取到
529
+ value: string, // 同意邀请时要设置的 value, 放在room级别的k和v,新加入房间的能拉取到
530
+ onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
531
+ /**
532
+ * 直播跨房间连麦 PK 取消邀请
533
+ */
534
+ livePKHangup: (roomId: string, // 当前房间 ID
535
+ endRoomId: string, // 需要结束的连麦房间 ID
536
+ sessionId: string, // 需要结束的连麦 SessionID
537
+ content: string, // 结束连麦的信息
538
+ keys: string[], // 需要删除连麦信息的 keys
539
+ onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
540
+ /**
541
+ * 设置聊天室关联的rtc房间
542
+ */
543
+ bindRTCRoomForChatroom: (chatRoomId: string, rtcRoomId: string, onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
544
+ /**
545
+ * 删库
546
+ */
547
+ clearData(): boolean;
548
+ /**
549
+ * 设置设备信息,将设置信息传到服务器
550
+ */
551
+ setDeviceId(deviceId: string): void;
552
+ /**
553
+ * 2.0 RTC
554
+ */
555
+ getVoIPKey(engineType: number, channelName: string, extra: string, onSuccess: (token: string) => void, onError: IOnErrorCallBack): void;
556
+ /**
557
+ * 获取协议栈 commit 版本标识
558
+ */
559
+ getNodeVersion(): string;
560
+ /**
561
+ * 退出应用前调用
562
+ */
563
+ destroy(): void;
564
+ }
565
+
566
+ declare class RCCppService implements IEngine, IExtraMethod {
567
+ private readonly _cppProtocol;
568
+ private readonly _dbpath;
569
+ private readonly _reconnectKickEnable;
570
+ private _currentToken;
571
+ private _connectionStatus;
572
+ private _promiseHandler;
573
+ private _customMessageType;
574
+ private _heartbeat;
575
+ private _cppConnectionStatus;
576
+ private _connectedTime;
577
+ private _currentUserId;
578
+ private _msgExpansionHandler;
579
+ private _inited;
580
+ private _initOptions;
581
+ private _naviInfo;
582
+ private _version;
583
+ constructor(_cppProtocol: ICppProtocol, _dbpath?: string, _reconnectKickEnable?: boolean);
584
+ private _callCppProxy;
585
+ /**
586
+ * 打印日志并发送给第一个 render
587
+ * @param method
588
+ * @param args
589
+ */
590
+ private _superLog;
591
+ private _logger;
592
+ /**
593
+ * 获取协议栈引用
594
+ */
595
+ getCppProto(): ICppProtocol;
596
+ callExtra(method: keyof RCCppService, ...args: any[]): Promise<IAsyncRes<unknown>>;
597
+ getConversationsByPage(conversationTypes: ConversationType[], timestamp: number, count: number, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
598
+ getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
599
+ getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
600
+ getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: 0 | 1, tag: string): Promise<IAsyncRes<{
601
+ list: IReceivedMessage[];
602
+ hasMore: boolean;
603
+ }>>;
604
+ updateMessageReceiptStatus(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<boolean>>;
605
+ getConnectedTime(): number;
606
+ getServerTime(): number;
607
+ getCurrentUserId(): string;
608
+ private _senders;
609
+ private _send2Renderer;
610
+ private _send2AllRenderer;
611
+ private _init;
612
+ /**
613
+ * 批量注册内置消息
614
+ */
615
+ private _registerMsgTypes;
616
+ /**
617
+ * 消息构建
618
+ */
619
+ private _buildMessage;
620
+ private _updateReadReceiptInfo;
621
+ /**
622
+ * 会话构建
623
+ */
624
+ private _buildConversation;
625
+ private _sendConnectionStatus2Renderer;
626
+ /**
627
+ * 返回列表数据的格式转换
628
+ */
629
+ private _convertResultList;
630
+ /**
631
+ * 设置连接状态监听器
632
+ * ConnectionStatus_TokenIncorrect = 31004,
633
+ * ConnectionStatus_Connected = 0,
634
+ * ConnectionStatus_KickedOff = 6,// 其他设备登录
635
+ * ConnectionStatus_Connecting = 10,// 连接中
636
+ * ConnectionStatus_SignUp = 12, // 未登录
637
+ * ConnectionStatus_NetworkUnavailable = 1, // 连接断开
638
+ * ConnectionStatus_ServerInvalid = 8, // 断开
639
+ * ConnectionStatus_ValidateFailure = 9,//断开
640
+ * ConnectionStatus_Unconnected = 11,//断开
641
+ * ConnectionStatus_DisconnExecption = 31011 //断开
642
+ * RC_NAVI_MALLOC_ERROR = 30000,//断开
643
+ * RC_NAVI_NET_UNAVAILABLE= 30002,//断开
644
+ * RC_NAVI_SEND_FAIL = 30004,//断开
645
+ * RC_NAVI_REQ_TIMEOUT = 30005,//断开
646
+ * RC_NAVI_RECV_FAIL = 30006,//断开
647
+ * RC_NAVI_RESOURCE_ERROR = 30007,//断开
648
+ * RC_NAVI_NODE_NOT_FOUND = 30008,//断开
649
+ * RC_NAVI_DNS_ERROR = 30009,//断开
650
+ */
651
+ private _setConnectionStatusListener;
652
+ /**
653
+ * 心跳超时时重连
654
+ */
655
+ private _handleHeartTimeout;
656
+ /**
657
+ * 数据库初始化回调
658
+ */
659
+ private _dbOpenCallback;
660
+ /**
661
+ * 发送心跳
662
+ */
663
+ private _sendHeartbeat;
664
+ /**
665
+ * 设置消息监听器
666
+ */
667
+ private _setOnReceiveMessageListener;
668
+ private _sendMessageExpansion;
669
+ private _sendMessageNotification;
670
+ private _sendPullOfflineFinished;
671
+ /**
672
+ * 设置会话状态监听器
673
+ */
674
+ private _setConversationStatusListener;
675
+ private _setUserProfileListener;
676
+ private _setRTCLivingRoomEventListener;
677
+ private _setChatroomEventListener;
678
+ /**
679
+ * 清空监听器
680
+ */
681
+ private _clearListener;
682
+ /**
683
+ * 注册自定义消息
684
+ */
685
+ registerMessageType(messageType: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
686
+ /**
687
+ * 连接
688
+ * @param reconnectKickEnable 设置断线重连时是否踢出当前正在重连的设备 (仅 Electron 环境有效) false: 踢其他端, true:踢自己
689
+ * 同一个账号在一台新设备上登录的时候,会把这个账号在之前登录的设备上踢出。
690
+ 由于 SDK 有断线重连功能,存在下面情况。
691
+ 用户在 A 设备登录,A 设备网络不稳定,没有连接成功,SDK 启动重连机制。
692
+ 用户此时又在 B 设备登录,B 设备连接成功。
693
+ A 设备网络稳定之后,用户在 A 设备连接成功,B 设备被踢出。
694
+ 这个字段就是为这种情况加的。
695
+ 设置 reconnectKickEnable 为 true 时,SDK 重连的时候发现此时已有别的设备连接成功,不再强行踢出已有设备,而是踢出重连设备。
696
+ */
697
+ connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
698
+ private _doConnect;
699
+ reportSDKInfo(version: {
700
+ [name: string]: string;
701
+ }): void;
702
+ /**
703
+ * 断开链接
704
+ */
705
+ disconnect(): void;
706
+ /**
707
+ * 注销登录
708
+ */
709
+ logout(): void;
710
+ /**
711
+ * 设置用户在线状态监听器
712
+ */
713
+ setUserStatusListener(config: {
714
+ userIds: string[];
715
+ }, listener: Function): void;
716
+ /**
717
+ * 订阅用户在线状态
718
+ */
719
+ subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
720
+ /**
721
+ * 设置当前用户在线状态
722
+ */
723
+ setUserStatus(status: number): Promise<ErrorCode>;
724
+ /**
725
+ * 获取用户状态
726
+ */
727
+ getUserStatus(userId: string): IPromiseResult<{
728
+ status: string;
729
+ }>;
730
+ /**
731
+ * 发送消息
732
+ */
733
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): IPromiseResult<IReceivedMessage>;
734
+ /**
735
+ * 撤回消息
736
+ */
737
+ recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
738
+ getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string, objectName: string): IPromiseResult<{
739
+ list: IReceivedMessage[];
740
+ hasMore: boolean;
741
+ }>;
742
+ getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
743
+ list: IReceivedMessage[];
744
+ hasMore: boolean;
745
+ }>;
746
+ deleteRemoteMessage(conversationType: ConversationType, targetId: string, messages: {
747
+ messageUId: string;
748
+ sentTime: number;
749
+ messageDirection: MessageDirection;
750
+ }[], channelId: string): Promise<ErrorCode>;
751
+ deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
752
+ clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
753
+ /**
754
+ * 获取全部会话列表
755
+ */
756
+ getConversationList(count: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): IPromiseResult<IReceivedConversation[]>;
757
+ /**
758
+ * 获取指定会话
759
+ */
760
+ getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
761
+ /**
762
+ * 删除指定会话
763
+ */
764
+ removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
765
+ /**
766
+ * 删除所有会话
767
+ */
768
+ clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
769
+ /**
770
+ * 获取所有会话未读数
771
+ */
772
+ getAllConversationUnreadCount(channelId: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
773
+ /**
774
+ * 获取指定会话未读数
775
+ */
776
+ getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): IPromiseResult<number>;
777
+ /**
778
+ * 清除指定会话未读数
779
+ */
780
+ clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
781
+ /**
782
+ * 清除时间戳之前的未读数
783
+ */
784
+ clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
785
+ /**
786
+ * 获取第一个未读消息
787
+ */
788
+ getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
789
+ /**
790
+ * 设置会话置顶
791
+ */
792
+ setConversationToTop(conversationType: ConversationType, targetId: string, isTop: boolean, channelId?: string): Promise<ErrorCode>;
793
+ /**
794
+ * 设置会话隐藏
795
+ */
796
+ setConversationHidden(conversationType: ConversationType, targetId: string, isHidden: boolean, channelId: string): Promise<ErrorCode>;
797
+ /**
798
+ * 设置会话置顶
799
+ */
800
+ setConversationNotificationStatus(conversationType: ConversationType, targetId: string, isNotify: boolean, channelId: string): Promise<ErrorCode>;
801
+ /**
802
+ * 设置会话置顶、免打扰
803
+ */
804
+ setConversationStatus(conversationType: ConversationType, targetId: string, isBlocked: boolean, isTop: boolean, channelId: string): Promise<ErrorCode>;
805
+ /**
806
+ * 获取会话置顶状态
807
+ */
808
+ getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
809
+ /**
810
+ * 通过关键字搜索会话
811
+ * @description
812
+ * 不传 messageTypes 默认仅支持 文本消息、文件消息, 自定义消息类型需传
813
+ */
814
+ searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
815
+ /**
816
+ * 按内容搜索会话内的消息
817
+ */
818
+ searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
819
+ messages: IReceivedMessage[];
820
+ count: number;
821
+ }>;
822
+ /**
823
+ * 获取会话下所有未读的 @ 消息
824
+ * @description
825
+ * 什么时机变为已读: 清除会话未读数或者设置消息已读状态时
826
+ */
827
+ getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
828
+ addToBlacklist(userId: string): Promise<ErrorCode>;
829
+ removeFromBlacklist(userId: string): Promise<ErrorCode>;
830
+ getBlacklist(): IPromiseResult<string[]>;
831
+ getBlacklistStatus(userId: string): IPromiseResult<string>;
832
+ insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
833
+ deleteMessages(timestamps: number[]): Promise<ErrorCode>;
834
+ deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
835
+ getMessage(messageId: number | string): IPromiseResult<IReceivedMessage>;
836
+ setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
837
+ setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
838
+ setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
839
+ setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
840
+ saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string, channelId: string): Promise<ErrorCode>;
841
+ getConversationMessageDraft(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<string>;
842
+ clearConversationMessageDraft(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
843
+ pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
844
+ /**
845
+ * 协议栈暂时仅支持单独设置免打扰和置顶
846
+ */
847
+ batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
848
+ pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
849
+ /**
850
+ * 发送已读回执
851
+ */
852
+ sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): IPromiseResult<IAsyncRes>;
853
+ /**
854
+ * 获取已读列表
855
+ */
856
+ getMessageReader(targetId: string, messageUId: string, channelId: string): IPromiseResult<IMessageReaderResponse>;
857
+ joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
858
+ joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
859
+ quitChatroom(chatroomId: string): Promise<ErrorCode>;
860
+ /**
861
+ * 获取聊天室信息
862
+ * @description
863
+ * 协议栈返回数据里不带用户加入时间
864
+ */
865
+ getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
866
+ getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
867
+ list: IReceivedMessage[];
868
+ hasMore: boolean;
869
+ }>;
870
+ setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
871
+ setChatroomEntries(chatroomId: string, entriesOptions: IChrmKVEntries): Promise<{
872
+ code: ErrorCode;
873
+ data?: any;
874
+ }>;
875
+ forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
876
+ removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
877
+ forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
878
+ removeChatroomEntries(chatroomId: string, entriesOptions: IChrmKVEntries): Promise<{
879
+ code: ErrorCode;
880
+ data?: any;
881
+ }>;
882
+ getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
883
+ getAllChatroomEntry(chatroomId: string): IPromiseResult<{
884
+ [key: string]: string;
885
+ }>;
886
+ getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
887
+ getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName: string, originName: string): IPromiseResult<{
888
+ downloadUrl: string;
889
+ }>;
890
+ clearData(): IPromiseResult<boolean>;
891
+ getDeviceId(): string;
892
+ getVoIPKey(engineType: number, channelName: string): IPromiseResult<string>;
893
+ /**
894
+ * 以下为 RTC 方法
895
+ */
896
+ joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData): IPromiseResult<IJoinRTCRoomData>;
897
+ quitRTCRoom(roomId: string): Promise<ErrorCode>;
898
+ rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
899
+ getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
900
+ getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
901
+ getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
902
+ setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
903
+ removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
904
+ setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
905
+ name: string;
906
+ content: string;
907
+ }): Promise<ErrorCode>;
908
+ setRTCTotalRes(roomId: string, message: {
909
+ name: string;
910
+ content: string;
911
+ }, valueInfo: string, messageType: string, mcuValInfo: string): Promise<ErrorCode>;
912
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
913
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
914
+ removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
915
+ name: string;
916
+ content: string;
917
+ }): Promise<ErrorCode>;
918
+ setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
919
+ getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
920
+ getRTCToken(roomId: string, _mode: number, _broadcastType?: number): IPromiseResult<IRtcTokenData>;
921
+ setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
922
+ getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
923
+ createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
924
+ removeTag(tagId: string): IPromiseResult<IAsyncRes>;
925
+ updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
926
+ getTagList(): IPromiseResult<Array<ITagInfo>>;
927
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
928
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
929
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
930
+ getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): IPromiseResult<IReceivedConversationByTag[]>;
931
+ getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
932
+ setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
933
+ getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
934
+ /**
935
+ * 直播观众加房间
936
+ */
937
+ joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
938
+ token: string;
939
+ kvEntries: IServerRTCRoomEntry[];
940
+ }>>;
941
+ /**
942
+ * 直播观众退出房间
943
+ */
944
+ quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
945
+ /**
946
+ * 直播房间身份切换
947
+ */
948
+ switchLivingRoomRole(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
949
+ getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
950
+ getBlockConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
951
+ getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
952
+ getUnreadMentionedCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
953
+ getAllUnreadMentionedCount(): Promise<IAsyncRes<number>>;
954
+ requestRoomPK(options: IReqRoomPKOptions): Promise<ErrorCode>;
955
+ cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
956
+ responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
957
+ endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
958
+ bindRTCRoomForChatroom(options: IRTCRoomBindOption): Promise<ErrorCode>;
959
+ }
960
+
961
+ declare const _default: (options: {
962
+ /**
963
+ * 指定 C++ 协议栈的数据存储目录
964
+ */
965
+ dbpath: string;
966
+ /**
967
+ * 修改输出日志等级,有效值 0 - 4
968
+ */
969
+ logLevel: LogLevel;
970
+ /**
971
+ * 修改默认日志的输出函数
972
+ */
973
+ logStdout: (logLevel: LogLevel, content: string) => void;
974
+ /**
975
+ * 断线重连时,若已有其他 PC 设备登录,是否将其他设备踢下线,默认值为 `false`,true 是踢自己,false 是踢其他端
976
+ */
977
+ reconnectKickEnable: boolean;
978
+ }) => RCCppService;
979
+
980
+ export { _default as default };