@rongcloud/electron 5.8.5 → 5.9.0-alpha.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/index.d.ts CHANGED
@@ -1,581 +1,8 @@
1
- import { ConversationType, IChrmKVEntry, FileType, NotificationLevel, LogL, EnableLogL, LogType, ILogger } from '@rongcloud/engine';
1
+ import { EnableLogL } from '@rongcloud/engine';
2
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, sdkVersion?: string) => string;
11
- /**
12
- * 反初始化
13
- * @description
14
- * 清除实例、监听
15
- */
16
- destory: () => void;
17
- /**
18
- * 通用接口,主进程内持久化存储
19
- * @param key
20
- * @param value
21
- * @description 需要依赖协议栈 db_open 通知后调用
22
- */
23
- setStoreValue(key: string, value: string): boolean;
24
- /**
25
- * 通用接口,主进程内获取持久化数据
26
- * @param key
27
- * @description 需要依赖协议栈 db_open 通知后调用
28
- */
29
- getStoreValue(key: string): string;
30
- /**
31
- * 设置连接状态监听器
32
- */
33
- setConnectionStatusListener: (
34
- /**
35
- * 连接结果回调,可能会被调用多次,因 connecting 状态也在其中回调
36
- */
37
- onConnectResult: (status: number) => void,
38
- /**
39
- * 数据库是否初始化成功
40
- */
41
- onDBOpen: (status: number) => void,
42
- /**
43
- * 心跳响应回调
44
- */
45
- onHeartPong: (status: number) => void, // ping 返回结果
46
- /**
47
- * 连接被断开回调。也会被调用多次,因 TCP 连接断开本身会通知
48
- */
49
- onDisconnect: (status: number) => void,
50
- /**
51
- * TCP 连接结果的回调
52
- */
53
- onHandshake: (code: number, host: string, port: number, duration: number, dnsDuration: number, index: number, isQuic: boolean) => void) => void;
54
- /**
55
- * 心跳发送 4.0 + 协议栈需 lib 层维护心跳, 有回调即认为 ping 成功
56
- */
57
- sendHeartbeat: () => void;
58
- /**
59
- * 设置消息监听器
60
- */
61
- setOnReceiveMessageListener: (onSuccess?: (result: string, leftCount: number, offline: boolean, hasMore: boolean) => void, onPullDone?: () => void) => void;
62
- /**
63
- * 设置用户状态(在线、离线、忙碌)接收监听器
64
- */
65
- setOnReceiveStatusListener: (onSuccess?: (userId: string, status: string) => void) => void;
66
- /**
67
- * 设置会话状态监听器 ( 置顶、免打扰 )
68
- */
69
- setConversationStatusListener: (listenter?: (result: string) => void, tagListener?: (result: string) => void) => void;
70
- /**
71
- * 设置聊天室状态监听
72
- */
73
- setChatroomEventListener: (listenter?: (roomId: string, destroyType: any) => void) => void;
74
- /**
75
- * TODO ?
76
- */
77
- setUserProfileListener: (listenter?: (result: any) => void, tagListenter?: (result: any) => void) => void;
78
- /**
79
- * 建立链接
80
- */
81
- connectWithToken: (token: string, sdkVer: string, navi: string, reconnect: boolean, options: string) => void;
82
- /**
83
- * 断开链接
84
- * @param isCloseDB 是否关闭数据库连接
85
- */
86
- disconnect: (isCloseDB: boolean) => void;
87
- /**
88
- * 设置当前用户在线状态
89
- * @param status 10 在线、11 离开、12 忙碌
90
- */
91
- setUserStatus: (status: number, onSuccess: () => void, onError: IOnErrorCallBack) => void;
92
- /**
93
- * TODO ? 设置用户状态(在线、离线、忙碌)接收监听器 订阅的用户
94
- */
95
- subscribeUserStatus: (userIds: string[], onSuccess: () => void, onError: IOnErrorCallBack) => void;
96
- /**
97
- * 获取用户状态
98
- */
99
- getUserStatus: (userId: string, onSuccess: (status: string) => void, onError: IOnErrorCallBack) => void;
100
- /**
101
- * 注册消息
102
- * @param messageType 消息类型
103
- * @param persistentFlag 存储选项 0 不存不计数 1 只存不计数 3 存且计数
104
- * @param searchProp 搜索字段
105
- */
106
- registerMessageType: (messageType: string, persistentFlag: number, searchProp?: string[]) => void;
107
- getRTCProfile: () => string;
108
- /**
109
- * 获取延迟时间 = 本地时间 - 服务器时间
110
- */
111
- getDeltaTime: () => number;
112
- /**
113
- * 发送消息
114
- * @description
115
- * 废弃 isMentioned 字段,协议栈内部根据消息体内容判断是否是 @ 消息
116
- */
117
- sendMessage: (onSuccess: (message: string, code: number) => void, onError: (message: string, code: number) => void, conversationType: ConversationType, targetId: string, messageType: string, messageContent: string, directionalUserIdList: string[], // 接收定向消息的用户 id 列表. 仅群组有效
118
- disableNotification: boolean, // 禁用消息通知
119
- disablePushTitle: boolean, // 移动端是否禁用自定义标题 // disablePushTitle
120
- forceShowDetailContent: boolean, // 移动端是否强制显示详情 // forceShowDetailContent
121
- pushContent: string, // Push 显示内容
122
- pushData: string, // Push 通知时附加信息
123
- notificationId: string, // 推送 ID // notificationId
124
- pushTitle: string, // 自定义推送标题 // pushTitle
125
- pushConfig: string, // 移动端 PUSH 配置
126
- pushTemplateId: string, // PUSH 模板 ID
127
- canIncludeExpansion: boolean, // 是否支持消息扩展存储
128
- expansionContent: string, // 扩展消息内容
129
- enableVoipPush: boolean, // 开启 voip 推送 , 音视频 CAllLib SDK 发消息使用。IM 消息均为 false
130
- channelId?: string, // 会话组织标识
131
- messageId?: number) => any;
132
- /**
133
- * 撤回消息
134
- */
135
- recallMessage: (onSuccess: (message: string, code: number) => void, onError: IOnErrorCallBack, mesasgeType: string, content: string, disableNotification: boolean, // 禁用消息通知
136
- disablePushTitle: boolean, // 移动端是否禁用自定义标题 // disablePushTitle
137
- forceShowDetailContent: boolean, // 移动端是否强制显示详情 // forceShowDetailContent
138
- pushContent: string, // Push 显示内容
139
- pushData: string, // Push 通知时附加信息
140
- notificationId: string, // 推送 ID // notificationId
141
- pushTitle: string, // 自定义推送标题 // pushTitle
142
- pushConfig: string, // 移动端 PUSH 配置
143
- pushTemplateId: string, // PUSH 模板 ID,
144
- tag: string) => void;
145
- /**
146
- * 获取历史消息,并按时间降序排列
147
- * @param isDesc : 是否降序取
148
- * @param timestamp : 如果传 0 且降序 获取最新时间戳之前降序排列。 非 0 降序为获取时间戳之前的, 非 0 升序为获取时间戳时候的
149
- */
150
- getHistoryMessages: (conversationType: ConversationType, targetId: string, timestamp: number, count: number, objectName: string, isDesc: boolean, tag: string) => string;
151
- /**
152
- * 获取历史消息,携带断档标识
153
- */
154
- getMessages: (conversationType: ConversationType, targetId: string, timestamp: number, count: number, direction: boolean, channelId: string) => string;
155
- /**
156
- * 通过消息类型获取历史消息列表
157
- * @param desc 是否按 sentTime 降序排列,默认为 true
158
- */
159
- getHistoryMessagesByObjectNames: (conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: boolean, tag: string) => string;
160
- /**
161
- * 获取远端历史消息
162
- * @param isDesc : 是否降序取
163
- * @param timestamp : 如果传 0 且降序 获取最新时间戳之前降序排列。 非 0 降序为获取时间戳之前的, 非 0 升序为获取时间戳时候的
164
- * @param needRepeatMsg : 是否需要重复消息。比如第一次获取了[1,2] 历史消息,第二次获取了 [2,3]. true 第二次包含 2 、false 第二次不包含 2
165
- */
166
- getRemoteHistoryMessages: (conversationType: ConversationType, targetId: string, timestamp: number, count: number, onSuccess: (result: string, hasMore: boolean) => void, onError: IOnErrorCallBack, isDesc: number, needRepeatMsg: boolean, channelId: string, withMsg?: boolean) => void;
167
- /**
168
- * 通过时间戳删除历史消息
169
- */
170
- clearRemoteHistoryMessages: (conversationType: ConversationType, targetId: string, timestamp: number, onSuccess: () => void, onError: IOnErrorCallBack, tag: string) => void;
171
- /**
172
- * 通过消息 ID 删除批量指定消息
173
- * @param isDelLocal 是否同时删除本地消息
174
- */
175
- deleteRemoteHistoryMessages: (conversationType: ConversationType, targetId: string, msgsStr: string, isDelLocal: boolean, tag: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
176
- /**
177
- * 清空会话内本地历史消息
178
- */
179
- clearMessages: (conversationType: ConversationType, targetId: string, tag: string) => void;
180
- /**
181
- * 获取会话列表
182
- */
183
- getConversationList: (conversationTypes: ConversationType[], tag: string) => string;
184
- getConversationListWithAllChannelByPage(conversationTypes: ConversationType[], index: number, limit: number): string;
185
- getConversationListWithAllChannel(conversationTypes: ConversationType[]): string;
186
- /**
187
- * 获取指定会话
188
- */
189
- getConversation: (conversationType: ConversationType, targetId: string, tag: string) => string;
190
- /**
191
- * 获取置顶的会话列表
192
- */
193
- getTopConversations: (conversationTypes: ConversationType[], channelId?: string) => string;
194
- /**
195
- * 删除会话
196
- */
197
- removeConversation: (conversationType: ConversationType, targetId: string, tag: string) => boolean;
198
- /**
199
- * 清空会话列表
200
- */
201
- clearConversations: (conversationTypes?: ConversationType[], tag?: string) => void;
202
- /**
203
- * 获取指定会话未读数
204
- */
205
- getUnreadCount: (conversationType: ConversationType, targetId: string, tag: string) => number;
206
- /**
207
- * 按会话类型获取会话未读数
208
- * @description
209
- * 不传 conversationType 获取所有会话未读数
210
- * @param isIncludeNotDisturb 是否包含免打扰
211
- */
212
- getTotalUnreadCount: (conversationTypes?: ConversationType[], isIncludeNotDisturb?: boolean, tag?: string) => number;
213
- /**
214
- * 清除指定会话未读数
215
- */
216
- clearUnreadCount: (conversationType: ConversationType, targetId: string, tag: string) => unknown;
217
- /**
218
- * 清除时间戳之前的未读数
219
- */
220
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, tag: string): unknown;
221
- /**
222
- * 获取第一个未读消息
223
- */
224
- getTheFirstUnreadMessage: (conversationType: ConversationType, targetId: string, tag: string) => unknown;
225
- /**
226
- * 设置会话置顶、免打扰状态
227
- */
228
- setConversationStatus: (conversationType: ConversationType, targetId: string, isBlocked: boolean, isTop: boolean, onSuccess: () => void, onError: (code: number) => void, tag: string, isCreateConversation: boolean) => void;
229
- /**
230
- * 设置会话置顶
231
- */
232
- setConversationToTop(conversationType: ConversationType, targetId: string, isTop: boolean, tag: string, isCreateConversation: boolean): void;
233
- /**
234
- * 获取会话置顶状态
235
- */
236
- getConversationTopStatus: (conversationType: ConversationType, targetId: string, channelId: string) => number;
237
- /**
238
- * 设置会话隐藏
239
- */
240
- setConversationHidden: (conversationType: ConversationType, targetId: string, isHidden: boolean, tag: string) => void;
241
- /**
242
- * 设置会话免打扰
243
- * @param isBlocked true 开启免打扰 false 关闭免打扰
244
- */
245
- setConversationNotificationStatus: (conversationType: ConversationType, targetId: string, isBlocked: boolean, onSuccess: () => void, onError: (code: number) => void, tag: string) => void;
246
- /**
247
- * 获取会话置顶状态
248
- */
249
- getConversationNotificationStatus: (conversationType: ConversationType, targetId: string, tag: string) => boolean;
250
- /**
251
- * 通过关键字搜索会话
252
- */
253
- searchConversationByContent: (conversationTypes: ConversationType[], keyword: string, customMessageTypes: string[], // 自定义消息类型
254
- tag: string) => string;
255
- searchConversationByContentWithAllChannel(conversationTypes: ConversationType[], keyword: string, customMessageTypes: string[]): string;
256
- /**
257
- * 发送已读回执
258
- */
259
- sendReadReceipt: (targetId: string, channelId: string, msgUid: string[], onSuccess: () => void, onError: IOnErrorCallBack) => void;
260
- /**
261
- * 获取已读列表
262
- */
263
- getMessageReader: (targetId: string, channelId: string, msgUid: string, onSuccess: (list: any[], count: number) => void, onError: IOnErrorCallBack) => void;
264
- /**
265
- * 更新消息已读回执信息
266
- */
267
- updateReadReceiptRequestInfo: (messageUId: string, readerInfo: string) => void;
268
- /**
269
- * 加入聊天室
270
- */
271
- joinChatRoom: (chrmId: string, count: number, onSuccess: (createTime: number, memberCount: number, isAllChatroomBanned: boolean, isCurrentUserBanned: boolean, isCurrentChatroomBanned: boolean, isCurrentChatroomInWhitelist: boolean) => void, onError: IOnErrorCallBack) => void;
272
- /**
273
- * 加入已存在的聊天室,若不存在返回错误码
274
- */
275
- joinExistChatRoom: (chrmId: string, count: number, onSuccess: (createTime: number, memberCount: number, isAllChatroomBanned: boolean, isCurrentUserBanned: boolean, isCurrentChatroomBanned: boolean, isCurrentChatroomInWhitelist: boolean) => void, onError: IOnErrorCallBack) => void;
276
- /**
277
- * 退出聊天室
278
- */
279
- quitChatRoom: (chrmId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
280
- /**
281
- * 获取聊天室信息
282
- */
283
- getChatroomInfo: (chrmId: string, count: number, order: number, onSuccess: (result: string, count: number) => void, onError: IOnErrorCallBack) => void;
284
- /**
285
- * 获取聊天室历史消息
286
- * TODO 旧 V2 未实现,先补充接口定义
287
- */
288
- getChatroomHistoryMessage: (chrmId: string, begin: number, count: number, order: number, onSuccess: (data: string) => void, onError: (code: number) => void, channelId: string) => void;
289
- /**
290
- * 设置聊天室属性
291
- */
292
- setChatroomKV: (chrmId: string, kv: string, autoDelete: boolean | undefined, overwrite: boolean | undefined, onSuccess: () => void, onError: (code: number) => void) => void;
293
- /**
294
- * 删除聊天室属性
295
- */
296
- deleteChatroomKV: (chrmId: string, kvs: string[], overwrite: boolean | undefined, onSuccess: () => void, onError: (code: number) => void) => void;
297
- /**
298
- * 强制删除聊天室属性
299
- */
300
- forceRemoveChatroomEntry: (chrmId: string, entry: IChrmKVEntry, onSuccess: () => void, onError: (code: number) => void) => void;
301
- /**
302
- * 获取Entry
303
- */
304
- getChatroomKV: (chrmId: string, onSuccess: (data: string) => void, onError: (code: number) => void) => void;
305
- /**
306
- * 获取上传文件校验信息
307
- */
308
- getUploadToken: (fileType: FileType, fileName: string, httpMethod: string | undefined, queryInfo: string | undefined, url: string | undefined, extra: string, // 扩展信息
309
- 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, minioAuthorization: string, minioContentSha256: string, minioDate: string, minioBucketName: string, downloadAuthInfo: string) => void, onError: IOnErrorCallBack) => void;
310
- /**
311
- * 获取文件下载地址
312
- */
313
- getDownloadUrl: (fileType: FileType, filename: string, // 媒体类型
314
- oriName: string, // 本地存储文件名
315
- isOss: number, // 是否为阿里云存储
316
- extra: string, // 扩展信息
317
- onSuccess: (url: string) => void, onError: IOnErrorCallBack) => void;
318
- /**
319
- * 上报版本号
320
- */
321
- uploadSDKVersion: (version: string, appVersion: string) => void;
322
- /**
323
- * 设置 callInfo
324
- */
325
- callInfoSignaling: (targetId: string, key: string, value: string, onSuccess: (key: string, value: string) => void, onError: IOnErrorCallBack) => void;
326
- /**
327
- * 设置监听
328
- */
329
- setCallInfoListener: (listener: Function) => void;
330
- /**
331
- * 添加标签
332
- */
333
- addTag: (tagId: string, tagName: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
334
- /**
335
- * 修改标签名称
336
- */
337
- renameTag: (tagId: string, tagName: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
338
- /**
339
- * 删除标签
340
- */
341
- deleteTag: (tagId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
342
- /**
343
- * 标签下添加会话
344
- */
345
- addConversationsForTag: (tagId: string, conversations: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
346
- /**
347
- * 标签下移除会话
348
- */
349
- removeConversationsForTag: (tagId: string, conversations: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
350
- /**
351
- * 移除指定会话的某些标签
352
- */
353
- removeTagsForConversation: (conversationType: number, targetId: string, channelId: string, tagId: string[], onSuccess: () => void, onError: IOnErrorCallBack) => void;
354
- /**
355
- * 设置指定标签下指定会话是否置顶
356
- * tag_id 不存在 协议层返回错误码 33100
357
- */
358
- setConversationToTopForTag: (tagId: string, conversationType: number, targetId: string, channelId: string, isTop: boolean, onSuccess: () => void, onError: IOnErrorCallBack) => void;
359
- /**
360
- * 获取用户的所有标签
361
- */
362
- getTags: () => string;
363
- /**
364
- * 获取指定会话的所有标签
365
- */
366
- getTagsForConversation: (conversationType: number, targetId: string, channelId: string) => string;
367
- /**
368
- * 分页获取指定标签下的会话列表
369
- */
370
- getConversationsForTagByPage: (tagId: string, sendTime: number, limit: number, channelId: string) => string;
371
- /**
372
- * 获取指定标签下的会话消息未读数
373
- */
374
- getConversationUnreadCountForTag: (tagId: string, containBlocked: boolean) => number;
375
- /**
376
- * 获取群组消息送达列表
377
- */
378
- getGroupMessageDeliverList: (targetId: string, channelId: string, messageUId: string, onSuccess: (result: string, totalCount: number) => void, onError: IOnErrorCallBack) => string;
379
- /**
380
- * 获取单聊消息送达列表
381
- */
382
- getPrivateMessageDeliverList: (channelId: string, messageUId: string, onSuccess: (result: string) => void, onError: IOnErrorCallBack) => string;
383
- /**
384
- * 获取单聊本地消息送达时间
385
- */
386
- getMessageDeliverTime: (messsageUId: string) => number;
387
- /**
388
- * 设置消息送达时间
389
- */
390
- setMessageDeliverTime: (msgs: string) => string;
391
- /**
392
- * 加入黑名单
393
- */
394
- addToBlacklist: (userId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
395
- /**
396
- * 将指定用户移除黑名单
397
- */
398
- removeFromBlacklist: (userId: string, onSuccess: () => void, onError: IOnErrorCallBack) => void;
399
- /**
400
- * 获取黑名单列表
401
- */
402
- getBlacklist: (onSuccess: (userIds: string[]) => void, onError: IOnErrorCallBack) => void;
403
- /**
404
- * 获取指定人员在黑名单中的状态
405
- */
406
- getBlacklistStatus: (userId: string, onSuccess: (result: number) => void, onError: IOnErrorCallBack) => void;
407
- updateMessageReceiptStatus(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): boolean;
408
- /**
409
- * 向本地插入一条消息,不发送到服务器
410
- * onSuccess 优先于函数返回值
411
- */
412
- insertMessage: (conversationType: ConversationType, targetId: string, senderUserId: string, messageType: string, msgContent: string, // JSON.stringify(msg.content)
413
- onSuccess: () => void, onError: IOnErrorCallBack, direction: number, // 消息方向
414
- readStatus?: number, // 阅读状态,0:未读,1:已读,2:已听
415
- sendStatus?: number, // 发送状态,10:发送中,20:发送失败,30:发送成功,50:已发回执
416
- sentTime?: number, // 发送消息的时间,unix 时间戳
417
- searchContent?: string, // 消息的搜索关键字
418
- isUnread?: number, // 存入时是否计入未读数,1:不计入,0:计入 (注意:direction 为接收消息方向时才生效)
419
- messageUId?: string, // 消息唯一标识,服务生成,不确定时填入空字符串
420
- disableNotification?: boolean, canIncludeExpansion?: boolean, expansionMsg?: string, tag?: string) => string;
421
- /**
422
- * 批量向本地插入消息
423
- */
424
- insertMessages: (messages: string, checkDuplicate: boolean) => boolean;
425
- /**
426
- * 获取会话所有消息数
427
- */
428
- getMessageCount: (conversationType: ConversationType, targetId: string, channelId: string) => number;
429
- /**
430
- * 删除本地消息,必须是同一会话的消息
431
- * @param messageUId
432
- */
433
- deleteMessages: (messageId: number[]) => void;
434
- /**
435
- * 通过时间戳删除本地消息
436
- */
437
- deleteMessagesByTimestamp: (conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, tag: string) => void;
438
- /**
439
- * 获取消息
440
- * @description
441
- * messageId 可以传 messageId 或 messageUId 均能查到消息
442
- */
443
- getMessage: (messageId: number | string) => string;
444
- /**
445
- * 设置消息内容
446
- */
447
- setMessageContent: (messageId: number, content: string, messageType: string) => void;
448
- /**
449
- * 设置消息搜索字段
450
- */
451
- setMessageSearchField: (messageId: number, content: string, searchFiles: string) => void;
452
- /**
453
- * 按内容搜索会话内的消息
454
- * @description
455
- * 1、文本类型消息只搜 content, 文件类型消息只搜 name (内置消息只有 文本和文件是协议栈定义死的,其他内置消息注册决定)
456
- * 2、图文内置消息,协议栈只支持 name 字段。TODO 其他内置消息需与移动端对应
457
- * 3、自定义消息根据 registerMessageType 的 searchProp 参数决定
458
- * 4、引用消息不支持搜索
459
- *
460
- */
461
- searchMessageByContent: (conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, // 是否返回查到的消息数量 {matchedNumber} 1 返回 0 不返
462
- onSuccess: (result: string, matchedNumber: number) => void, tag: string) => void;
463
- /**
464
- * 按用户ID搜索消息
465
- */
466
- getMessageBySender: (conversationType: ConversationType, targetId: string, userId: string, timestamp: number, count: number, channelId: string, onSuccess: (result: string) => void) => void;
467
- searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, onSuccess: (result: string, matchedNumber: number) => void): void;
468
- searchMessageByTimestampWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, startTime: number, endTime: number, offset: number, limit: number, onSuccess: (result: string) => void): void;
469
- /**
470
- * 设置消息发送状态
471
- */
472
- setMessageSentStatus: (messageId: number, sentStatus: number) => void;
473
- /**
474
- * 设置消息接收状态
475
- */
476
- setMessageReceivedStatus: (messageId: number, receivedStatus: number) => void;
477
- /**
478
- * 获取会话下所有未读的 @ 消息
479
- */
480
- getUnreadMentionedMessages: (conversationType: ConversationType, targetId: string, tag: string) => string;
481
- /**
482
- * 设置消息扩展字段
483
- */
484
- setMessageExtension(conversationType: ConversationType, targetId: string, messageUId: string, messageExtension: string, tag: string): void;
485
- getConversationListByPage(conversationTypes: ConversationType[], timestamp: number, limit: number, channelId: string): string;
486
- /**
487
- * 获取未读的会话列表
488
- */
489
- getUnreadConversationList(conversationTypes: ConversationType[]): string;
490
- /**
491
- * 设置聊天室关联的rtc房间
492
- */
493
- bindRTCRoomForChatroom: (chatRoomId: string, rtcRoomId: string, onSuccess: (result: string) => void, onError: IOnErrorCallBack) => void;
494
- /**
495
- * 设置融云消息重排开关
496
- */
497
- checkDuplicateMessage: (enableCheck: boolean) => boolean;
498
- /**
499
- * 获取指定免打扰级别的未读数
500
- */
501
- getUnreadCountByLevel: (conversationTypes: ConversationType[], levels: NotificationLevel[]) => number;
502
- /**
503
- * 获取指定免打扰级别的未读 @ 数
504
- */
505
- getUnreadMentionedCountByLevel: (conversationTypes: ConversationType[], levels: NotificationLevel[]) => number;
506
- /**
507
- * 设置免打扰级别
508
- */
509
- setBlockPushLevelForConversation(targetId: string, channelId: string, conversationType: ConversationType, level: NotificationLevel, onsuccess: () => void, onError: (code: number) => void): void;
510
- /**
511
- * 获取免打扰级别
512
- */
513
- getBlockPushLevelForConversation(targetId: string, channelId: string, conversationType: ConversationType): NotificationLevel;
514
- rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: number[], success: (buffer: number[]) => void, error: (code: number) => void, timeout: number): void;
515
- /**
516
- * RTC Ping
517
- */
518
- sendRTCHeartbeat(roomId: string[], timeout: number): void;
519
- setRTCHeartbeatListener(onReq: (roomId: string, seqId: string) => void, onRes: (roomId: string, code: number, seqId: string, version: bigint) => void): void;
520
- setRTCRoomEventListener(callback: (buffer: number[]) => void): void;
521
- /**
522
- * 初始化日志模块
523
- * @param dbpath 日志数据库存储目录
524
- * @param appkey
525
- * @param sessionId 应用生命周期 sessionId
526
- */
527
- initLogModule(dbpath: string, appkey: string, sessionId: string): number;
528
- setLogEventListener(onLogData: (log: string) => void, onLogDone: (code: number) => void, onLogEvent: (tag: string, log: string, level: LogL) => void): void;
529
- writeLog(arrLog: string): number;
530
- pullFullLog(level: LogL, beginTime: number, endTime: number, needColName: boolean): number;
531
- deinitLogModule(): void;
532
- /**
533
- * 删库
534
- */
535
- clearData(): boolean;
536
- /**
537
- * 设置设备信息,将设置信息传到服务器
538
- */
539
- setDeviceId(deviceId: string): void;
540
- /**
541
- * 2.0 RTC
542
- */
543
- getVoIPKey(engineType: number, channelName: string, extra: string, onSuccess: (token: string) => void, onError: IOnErrorCallBack): void;
544
- /**
545
- * 获取协议栈 commit 版本标识
546
- */
547
- getNodeVersion(): string;
548
- /**
549
- * 退出应用前调用
550
- */
551
- destroy(): void;
552
- /**
553
- * 获取会话文本草稿
554
- * @category 草稿
555
- * @params conversationType 会话类型
556
- * @params targetId 目标 ID
557
- */
558
- getTextMessageDraft(conversationType: ConversationType, targetId: string, channelId: string): string;
559
- /**
560
- * 设置会话文本草稿
561
- * @category 草稿
562
- * @params conversationType 会话类型
563
- * @params targetId 目标 ID
564
- * @params draft 草稿内容
565
- */
566
- saveTextMessageDraft(conversationType: ConversationType, targetId: string, draft: string, channelId: string): boolean;
567
- /**
568
- * 删除会话文本草稿
569
- * @category 草稿
570
- * @params conversationType 会话类型
571
- * @params targetId 目标 ID
572
- */
573
- clearTextMessageDraft(conversationType: ConversationType, targetId: string, channelId: string): boolean;
574
- }
575
-
576
- declare class RCServiceProxy {
577
- private _cppService;
578
- constructor(appkey: string, addon: ICppProtocol, dbpath?: string, logOutputLevel?: EnableLogL);
3
+ declare class RCMainProxy {
4
+ private _rcMain;
5
+ constructor(appkey: string, dbpath: string | undefined, logOutputLevel: EnableLogL);
579
6
  /**
580
7
  * @deprecated
581
8
  */
@@ -594,14 +21,6 @@ declare class RCServiceProxy {
594
21
  * 获取 server Time
595
22
  */
596
23
  getServerTime(): number;
597
- /**
598
- * @hidden
599
- * 创建 logger 日志工具实例,仅限内部使用
600
- * @param id RC 为 SDK 内部日志前缀,为避免冲突,请勿以 RC 起始的字符串定义 id
601
- * @param type 有效值 'IM' 或 'RTC',其他值无效
602
- * @deprecated
603
- */
604
- __createLogger(id: string, type: LogType): ILogger | null;
605
24
  }
606
25
 
607
26
  declare const _default: (options: {
@@ -622,6 +41,6 @@ declare const _default: (options: {
622
41
  * 设置日志打印级别
623
42
  */
624
43
  logOutputLevel?: EnableLogL;
625
- }) => RCServiceProxy;
44
+ }) => RCMainProxy;
626
45
 
627
46
  export { _default as default };