@rongcloud/imlib-next 5.9.9 → 5.10.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,12 +1,31 @@
1
- import { FileType, APIContext, LogLevel, EnableLogL, IRuntime, AreaCode, ConversationType, MessageDirection, ReceivedStatus, IReceivedStatusInfo, SentStatus, IReadReceiptResponseInfo, IReadReceiptInfo, IPushConfig, UltraGroupChannelType, RCConnectionStatus, IPluginGenerator, IAsyncRes, NotificationStatus, NotificationLevel, IUltraUnreadMsg, IUserProfile, IConversationOption, ITypingMessage, IUpdateItem, ErrorCode, IChatroomListenerData, IExpansionListenerData, IBlockedMessageInfo, IOperateStatusNotify, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUserGroupStatusInfo, IMessageDeliver, IGroupMessageDeliverStatus, IReadReceiptData, ISyncReadStatusData, ISubscribeUserStatusInfo, ISubscribeRelationInfo, IBaseConversationInfo, IConversationState as IConversationState$1, IGetUltraGroupListOption, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadMentionedOption, IUltraGroupUnreadInfo, IChatroomJoinResponse, IChatroomInfo, IChatRoomEntry, IChatroomEntries, IRemoveChatRoomEntry, IRTCRoomBindOption, MentionedInfoBody, ICombineV2MessageContent, IMessageReadReceiptV4Response, IGroupReadReceiptData, IClearMessageOption, IMessageReaderResponse, IFirstUnreadMessageInfo, IReceivedMessage, IReceivedConversation, ITagParam, ITagInfo, IConversationTag, IUploadAuth, IDownloadAuth, UploadMethod, IInsertMessage, IGroupMessageDeliverInfo, IProxy, IPromiseResult, IResponse, SubscribeType } from '@rongcloud/engine';
2
- export { AreaCode, ChatroomEntryType, ChatroomSyncStatusReason, ChatroomUserChangeType, ChrmMemBanType, ChrmMemOperateType, ChrmSyncStatus, ConnectionStatus, ConversationType, EnableLogL, ErrorCode, FileType, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBlockedMessageInfo, IChannelAndUserGroupChangeData, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomJoinResponse, IChatroomListenerData, IChatroomNotifyBan, IChatroomNotifyBlock, IChatroomNotifyMultiLoginSync, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IClearMessageOption, ICombineV2MessageContent, ICombinedMessage, IConversationIdentifier, IConversationOption, IConversationTag, IDeletedExpansion, IDeliveredUser, IDownloadAuth, IEventListener, IExpansionListenerData, IFirstUnreadMessageInfo, IGetUltraGroupListOption, IGooglePushConfig, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IGroupMessageDeliveredStatusInfo, IGroupReadReceiptData, IInsertMessage, IMessageDeliver, IMessageReadReceiptV4Response, IMessageReader, IMessageReaderResponse, IOperateInfo, IOperateStatusNotify, IOperateSummary, IPrivateReadReceiptData, IPromiseResult, IProxy, IPushConfig, IRTCRoomBindOption, IReadReceiptData, IReadReceiptInfo, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IReceivedStatusInfo, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IResponse, ISubscribeRelationInfo, ISubscribeStatusDetail, ISubscribeUserStatusInfo, ISyncReadStatusData, ITagInfo, ITagParam, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadInfo, IUltraGroupUnreadMentionedOption, IUltraUnreadMsg, IUpdateItem, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserGroupChangeData, IUserGroupStatusInfo, IUserProfile, IiOSPushConfig, InterruptionLevel, LogL, LogLevel, MentionedInfoBody, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, NotificationLevel, NotificationStatus, OnlineStatus, OperateStatus, PlatformInfo, PushImportanceHonor, RCConnectionStatus, ReceivedStatus, SentStatus, SubscribeOperationType, SubscribeType, UltraGroupChannelChangeType, UltraGroupChannelType, UploadMethod } from '@rongcloud/engine';
1
+ import { FileType, APIContext, LogLevel, EnableLogL, IRuntime, AreaCode, ConversationType, MessageDirection, ReceivedStatus, IReceivedStatusInfo, SentStatus, IReadReceiptResponseInfo, IReadReceiptInfo, IPushConfig, UltraGroupChannelType, RCConnectionStatus, IPluginGenerator, IAsyncRes, NotificationStatus, NotificationLevel, IUltraUnreadMsg, IUserProfile, IConversationOption, ITypingMessage, IUpdateItem, ErrorCode, IChatroomListenerData, IExpansionListenerData, IBlockedMessageInfo, IOperateStatusNotify, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUserGroupStatusInfo, IMessageDeliver, IGroupMessageDeliverStatus, IReadReceiptData, ISyncReadStatusData, ISubscribeUserStatusInfo, ISubscribeRelationInfo, SubscribeType, IUserProfileInfo, IBaseConversationInfo, IConversationState as IConversationState$1, IGetUltraGroupListOption, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadMentionedOption, IUltraGroupUnreadInfo, IChatroomJoinResponse, IChatroomInfo, IChatroomEntry, IChatroomEntries, IRemoveChatroomEntry, IRTCRoomBindOption, MentionedInfoBody, ICombineV2MessageContent, IMessageReadReceiptV4Response, IGroupReadReceiptData, IClearMessageOption, IMessageReaderResponse, IFirstUnreadMessageInfo, IReceivedMessage, IReceivedConversation, ITagParam, ITagInfo, IConversationTag, IUploadAuth, IDownloadAuth, UploadMethod, IInsertMessage, IGroupMessageDeliverInfo, IProxy, IPromiseResult, IResponse, UserProfileVisibility } from '@rongcloud/engine';
2
+ export { AreaCode, ChatroomEntryType, ChatroomSyncStatusReason, ChatroomUserChangeType, ChrmMemBanType, ChrmMemOperateType, ChrmSyncStatus, ConnectionStatus, ConversationType, EnableLogL, ErrorCode, FileType, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBlockedMessageInfo, IChannelAndUserGroupChangeData, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomJoinResponse, IChatroomListenerData, IChatroomNotifyBan, IChatroomNotifyBlock, IChatroomNotifyMultiLoginSync, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IClearMessageOption, ICombineV2MessageContent, ICombinedMessage, IConversationIdentifier, IConversationOption, IConversationTag, IDeletedExpansion, IDeliveredUser, IDownloadAuth, IEventListener, IExpansionListenerData, IFirstUnreadMessageInfo, IGetUltraGroupListOption, IGooglePushConfig, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IGroupMessageDeliveredStatusInfo, IGroupReadReceiptData, IInsertMessage, IMessageDeliver, IMessageReadReceiptV4Response, IMessageReader, IMessageReaderResponse, IOperateInfo, IOperateStatusNotify, IOperateSummary, IPrivateReadReceiptData, IPromiseResult, IProxy, IPushConfig, IRTCRoomBindOption, IReadReceiptData, IReadReceiptInfo, IReadReceiptResponseInfo, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IReceivedStatusInfo, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IResponse, ISubscribeRelationInfo, ISubscribeStatusDetail, ISubscribeUserStatusInfo, ISyncReadStatusData, ITagInfo, ITagParam, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadInfo, IUltraGroupUnreadMentionedOption, IUltraUnreadMsg, IUpdateItem, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserGroupChangeData, IUserGroupStatusInfo, IUserProfile, IUserProfileInfo, IiOSPushConfig, InterruptionLevel, LogL, LogLevel, MentionedInfoBody, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, NotificationLevel, NotificationStatus, OnlineStatus, OperateStatus, PlatformInfo, PushImportanceHonor, RCConnectionStatus, ReceivedStatus, SentStatus, SubscribeOperationType, SubscribeType, UltraGroupChannelChangeType, UltraGroupChannelType, UploadMethod, UserProfileVisibility } from '@rongcloud/engine';
3
3
 
4
+ /**
5
+ * 缩略图配置
6
+ * @category Interface
7
+ */
4
8
  interface IThumbnailConfig {
9
+ /**
10
+ * 最大高度
11
+ */
5
12
  maxHeight?: number;
13
+ /**
14
+ * 最大宽度
15
+ */
6
16
  maxWidth?: number;
17
+ /**
18
+ * 图片质量
19
+ */
7
20
  quality?: number;
21
+ /**
22
+ * 缩放比例
23
+ */
8
24
  scale?: number;
9
25
  }
26
+ /**
27
+ * @hidden
28
+ */
10
29
  interface IUploadConfig {
11
30
  getFileToken: TGetFileToken;
12
31
  getFileUrl: TGetFileUrl;
@@ -16,6 +35,9 @@ interface IUploadConfig {
16
35
  uploadServer?: string;
17
36
  bosAddr?: string;
18
37
  }
38
+ /**
39
+ * @hidden
40
+ */
19
41
  interface IUploadInfo {
20
42
  file: File;
21
43
  onProgress?: (loaded: number, total: number) => void;
@@ -23,6 +45,9 @@ interface IUploadInfo {
23
45
  contentDisposition?: 'inline' | 'attachment';
24
46
  thumbnailConfig?: IThumbnailConfig;
25
47
  }
48
+ /**
49
+ * @hidden
50
+ */
26
51
  interface IUploadResult {
27
52
  name: string;
28
53
  downloadUrl: string;
@@ -50,6 +75,10 @@ interface IUploadResult {
50
75
  declare type TGetFileToken = typeof APIContext.prototype.getFileToken;
51
76
  declare type TGetFileUrl = typeof APIContext.prototype.getFileUrl;
52
77
 
78
+ /**
79
+ * 初始化配置项
80
+ * @category Type
81
+ */
53
82
  declare type IInitOption = {
54
83
  /**
55
84
  * 应用 appkey 标识
@@ -195,12 +224,12 @@ interface IAReceivedMessage {
195
224
  messageDirection: MessageDirection;
196
225
  /**
197
226
  * 是否存储
198
- * @default true
227
+ * @defaultValue true
199
228
  */
200
229
  isPersited: boolean;
201
230
  /**
202
231
  * 是否计数
203
- * @default true
232
+ * @defaultValue true
204
233
  */
205
234
  isCounted: boolean;
206
235
  /**
@@ -275,6 +304,10 @@ interface IAReceivedMessage {
275
304
  */
276
305
  directedUserIds?: string[];
277
306
  }
307
+ /**
308
+ * 获取历史消息配置项
309
+ * @category Type
310
+ */
278
311
  declare type GetHistoryMessageOption = {
279
312
  /**
280
313
  * 获取此时间之前的消息,0 为从当前时间拉取
@@ -293,6 +326,7 @@ declare type GetHistoryMessageOption = {
293
326
  order?: 0 | 1;
294
327
  };
295
328
  /**
329
+ * 通过消息类型获取历史消息配置项
296
330
  * @category Interface
297
331
  */
298
332
  interface IGetHistoryMessagesByTypesOption extends GetHistoryMessageOption {
@@ -301,68 +335,142 @@ interface IGetHistoryMessagesByTypesOption extends GetHistoryMessageOption {
301
335
  */
302
336
  messageTypes: string[];
303
337
  }
338
+ /**
339
+ * 获取历史消息返回结构
340
+ * @category Type
341
+ */
304
342
  declare type GetHistoryMessageResult = {
305
343
  list: IAReceivedMessage[];
306
344
  hasMore: boolean;
307
345
  };
308
346
 
347
+ /**
348
+ * 初始化
349
+ * @description 初始化 IM SDK,传入 Appkey 及相关配置信息
350
+ * @category 基础
351
+ * @param options 初始化参数,类型为 {@link IInitOption}
352
+ * @example
353
+ * 初始化示例:
354
+ * ```ts
355
+ * RongIMLib.init({ appkey: 'appkey' });
356
+ * console.log('初始化完成');
357
+ * ```
358
+ */
309
359
  declare function init(options: IInitOption): void;
310
360
  /**
311
361
  * 反初始化
362
+ * @description 反初始化,清空所有监听及计时器,停止日志上报等业务
363
+ * * **适用场景**:
364
+ * 1. 应用退出时,推荐使用此方法
365
+ * 2. 需要更换 appkey 时,需要调用此方法后,重新使用新 Appkey 在次调用 {@link init} 方法
366
+ * @category 基础
367
+ * @example
368
+ * 反初始化示例:
369
+ * ```ts
370
+ * await RongIMLib.destroy();
371
+ * console.log('反初始化完成');
372
+ * ```
312
373
  */
313
374
  declare function destroy(): Promise<void>;
314
375
  /**
315
376
  * 获取 IM 连接状态
316
377
  * @category 基础
378
+ * @example
379
+ * 获取 IM 连接状态示例:
380
+ * ```ts
381
+ * const status = RongIMLib.getConnectionStatus();
382
+ * console.log('获取 IM 连接状态:', status);
383
+ * ```
317
384
  */
318
385
  declare function getConnectionStatus(): RCConnectionStatus;
319
386
  /**
320
387
  * 当前服务器时间
321
388
  * 校准时间,可能存在误差
322
389
  * @category 基础
390
+ * @hidden
323
391
  */
324
392
  declare function getServerTime(): number;
325
393
  /**
326
- * 获取 IM 连接用户的 id
394
+ * 获取 IM 连接用户的 id
327
395
  * @category 基础
328
- */
396
+ * @example
397
+ * 获取当前用户 id 示例:
398
+ * ```ts
399
+ * const userId = RongIMLib.getCurrentUserId();
400
+ * console.log('获取当前用户 id:', userId);
401
+ * ```
402
+ */
329
403
  declare function getCurrentUserId(): string;
330
404
  /**
331
405
  * (内部方法)用于统计各组件版本信息
332
406
  * @param name
333
407
  * @param version
408
+ * @hidden
334
409
  */
335
410
  declare function __addSDKVersion(name: string, version: string): void;
336
411
  /**
337
412
  * 获取 deviceId
413
+ * @description 获取当前设备的唯一标识
338
414
  * @category 基础
415
+ * @example
416
+ * 获取 deviceId 示例:
417
+ * ```ts
418
+ * const deviceId = RongIMLib.getDeviceId();
419
+ * console.log('获取 deviceId:', deviceId);
420
+ * ```
339
421
  */
340
422
  declare function getDeviceId(): string;
341
423
 
342
424
  /**
343
- * 装载 plugin 插件,并返回相应的插件实例,需在调用 `connect` 方法之前使用
425
+ * 装载 plugin 插件
426
+ * @description 装载 plugin 插件,需在调用 `connect` 方法之前使用,并返回相应的插件实例
344
427
  * @category 基础
345
- * @param plugins
428
+ * @param plugins 插件生成器
429
+ * @param options 插件配置
346
430
  */
347
431
  declare function installPlugin<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
348
432
 
349
433
  /**
350
434
  * 建立 IM 连接
435
+ * @description 传入从用户身份令牌(Token),向融云聊天服务器发起连接请求。
436
+ * * **注意**:
437
+ * 1. 必须在 SDK 初始化 {@link init} 之后,调用 connect() 方法进行连接。否则可能没有回调。
438
+ * 2. SDK 本身有重连机制,在一个应用生命周期内不须多次调用connect()
439
+ * 3. 在应用生命周期调用一次即可。
351
440
  * @category 基础
352
441
  * @param token
353
- * @param reconnectKickEnable 设置断线重连时是否踢出当前正在重连的设备 (仅 Electron 环境有效)
442
+ * @param reconnectKickEnable 设置断线重连时是否踢出当前正在重连的设备 (仅 `Electron` 环境有效)
443
+ * 默认仅允许同一用户账号在单台桌面端设备上登录。后登录的 Electron 设备一旦连接成功,则自动踢出之前登录的设备。在部分情况下,SDK 的重连机制可能会导致后登录设备无法正常在线
444
+ * @example
445
+ * 建立 IM 连接示例:
446
+ * ```ts
447
+ * const token = '<Your-token>';
448
+ * const res = await RongIMLib.connect(token);
449
+ * console.info('建立 IM 连接结果:', res);
450
+ * ```
354
451
  */
355
452
  declare function connect(token: string, reconnectKickEnable?: boolean): Promise<IAsyncRes<{
356
453
  userId: string;
357
454
  }>>;
358
455
  /**
359
- * 断开当前用户的连接
360
- * @param closeDB 是否关闭数据库,默认为 true,仅 Electron 平台有效
361
- * @category 基础
456
+ * 断开连接
362
457
  * @description 调用后将不再接收消息,不可发送消息,不可获取历史消息,不可获取会话列表
458
+ * * **适用场景**:注销账号,切换账号时,推荐使用此方法
459
+ * @category 基础
460
+ * @param closeDB 是否关闭数据库,默认为 true,仅 Electron 平台有效
461
+ * @example
462
+ * 断开连接示例:
463
+ * ```ts
464
+ * await RongIMLib.disconnect();
465
+ * console.info('成功断开');
466
+ * ```
363
467
  */
364
468
  declare function disconnect(closeDB?: boolean): Promise<void>;
365
469
 
470
+ /**
471
+ * 事件监听名称
472
+ * @category Enum
473
+ */
366
474
  declare enum Events {
367
475
  /**
368
476
  * 连接中
@@ -512,7 +620,16 @@ declare enum Events {
512
620
  * 订阅用户状态同步完成
513
621
  * @since 5.9.8
514
622
  */
515
- SYNC_SUBSCRIBED_USER_STATUS_FINISHED = "SYNC_SUBSCRIBED_USER_STATUS_FINISHED"
623
+ SYNC_SUBSCRIBED_USER_STATUS_FINISHED = "SYNC_SUBSCRIBED_USER_STATUS_FINISHED",
624
+ /**
625
+ * 订阅关系同步完成
626
+ * @since 5.9.8
627
+ */
628
+ /**
629
+ * 我的用户信息变更通知
630
+ * @since 5.10.1
631
+ */
632
+ OWN_USER_PROFILE_CHANGED = "OWN_USER_PROFILE_CHANGED"
516
633
  }
517
634
  /**
518
635
  * 消息审核状态
@@ -525,6 +642,7 @@ declare enum MessageAuditType {
525
642
 
526
643
  /**
527
644
  * 上传任务
645
+ * @hidden
528
646
  */
529
647
  declare class UploadTask {
530
648
  private readonly _promise;
@@ -548,15 +666,30 @@ declare class BaseMessage<T = any> {
548
666
  readonly isCounted: boolean;
549
667
  constructor(messageType: string, content: T, isPersited?: boolean, isCounted?: boolean);
550
668
  }
669
+ /**
670
+ * 消息类型构造函数
671
+ * @category Type
672
+ */
551
673
  declare type MessageConstructor<T> = new (content: T) => BaseMessage<T>;
552
674
 
553
675
  /**
676
+ * 会话更新项结构
554
677
  * @category Interface
555
678
  */
556
679
  interface IConversationUpdateItem {
680
+ /**
681
+ * 时间
682
+ */
557
683
  time: number;
684
+ /**
685
+ * 更新数据
686
+ */
558
687
  val: any;
559
688
  }
689
+ /**
690
+ * @ 类型
691
+ * @category Type
692
+ */
560
693
  declare type MentionedInfo = {
561
694
  /**
562
695
  * `@ 类型,其中 1 为 @ 所有人,2 为 @ 部分人`
@@ -568,20 +701,59 @@ declare type MentionedInfo = {
568
701
  userIdList?: Array<string>;
569
702
  };
570
703
  /**
704
+ * 会话数据更新结构
571
705
  * @category Interface
572
706
  */
573
707
  interface IReceivedUpdateConversation {
708
+ /**
709
+ * 会话更新项
710
+ */
574
711
  updatedItems: {
575
712
  [key: string]: IConversationUpdateItem;
576
713
  };
714
+ /**
715
+ * 会话类型
716
+ * * 1: 单聊
717
+ * * 3: 群聊
718
+ * * 4: 聊天室
719
+ * * 5: 客服会话
720
+ * * 6: 系统消息
721
+ * * 7: 默认关注的公众号
722
+ * * 8: 手动关注的公众号
723
+ * * 9: RTCLib 房间
724
+ */
577
725
  conversationType: number;
726
+ /**
727
+ * 会话 id
728
+ */
578
729
  targetId: string;
730
+ /**
731
+ * 会话最后一条消息
732
+ */
579
733
  latestMessage?: IAReceivedMessage;
734
+ /**
735
+ * 未读数
736
+ */
580
737
  unreadMessageCount?: number;
738
+ /**
739
+ * 是否是 @ 消息
740
+ */
581
741
  hasMentioned?: boolean;
742
+ /**
743
+ * @ 信息
744
+ */
582
745
  mentionedInfo?: MentionedInfo;
746
+ /**
747
+ * 消息最后阅读时间
748
+ */
583
749
  lastUnreadTime?: number;
750
+ /**
751
+ * 免打扰状态
752
+ */
584
753
  notificationStatus?: NotificationStatus;
754
+ /**
755
+ * 是否制定
756
+ */
585
757
  isTop?: boolean;
586
758
  }
587
759
  /**
@@ -672,15 +844,20 @@ interface IAReceivedConversation {
672
844
  draft?: string;
673
845
  }
674
846
  /**
847
+ * 分页获取标签下会话数据结构
675
848
  * @category Interface
676
849
  */
677
850
  interface IAReceivedConversationByTag extends IAReceivedConversation {
678
851
  isTopInTag: boolean;
679
852
  }
680
853
  /**
854
+ * 超级群会话数据结构
681
855
  * @category Interface
682
856
  */
683
857
  interface IAUltraGroupReceivedConversation extends IAReceivedConversation {
858
+ /**
859
+ * 超级群频道类型,只有 ConversationType 为超级群时该字段有效
860
+ */
684
861
  channelType?: UltraGroupChannelType;
685
862
  /**
686
863
  * 第一条未读消息
@@ -688,6 +865,7 @@ interface IAUltraGroupReceivedConversation extends IAReceivedConversation {
688
865
  firstUnreadMessage?: IUltraUnreadMsg | null;
689
866
  }
690
867
  /**
868
+ * 发送消息参数结构
691
869
  * @category Interface
692
870
  */
693
871
  interface ISendMessageOptions {
@@ -791,6 +969,7 @@ interface IImageMessageOption extends IUploadMessageOption {
791
969
  thumbnailConfig?: IThumbnailConfig;
792
970
  }
793
971
  /**
972
+ * 插入消息配置项结构
794
973
  * @category Interface
795
974
  */
796
975
  interface IInsertOptions {
@@ -804,6 +983,7 @@ interface IInsertOptions {
804
983
  searchContent?: string;
805
984
  }
806
985
  /**
986
+ * 用户信息结构
807
987
  * @category Interface
808
988
  */
809
989
  interface IUserInfo {
@@ -836,6 +1016,7 @@ interface IUserInfo {
836
1016
  };
837
1017
  }
838
1018
  /**
1019
+ * 消息扩展结构
839
1020
  * @category Interface
840
1021
  */
841
1022
  interface IExtraData {
@@ -845,8 +1026,8 @@ interface IExtraData {
845
1026
  extra?: string;
846
1027
  }
847
1028
  /**
1029
+ * 消息审核配置结构
848
1030
  * @category Interface
849
- * 消息审核配置
850
1031
  */
851
1032
  interface IAuditInfo {
852
1033
  audit?: {
@@ -865,10 +1046,17 @@ interface IAuditInfo {
865
1046
  };
866
1047
  }
867
1048
  /**
1049
+ * 消息关键信息结构
868
1050
  * @category Interface
869
1051
  */
870
1052
  interface IMessageDesc {
1053
+ /**
1054
+ * 消息唯一标识
1055
+ */
871
1056
  messageUId: string;
1057
+ /**
1058
+ * 消息发送时间
1059
+ */
872
1060
  sendTime: number;
873
1061
  }
874
1062
  /**
@@ -932,18 +1120,41 @@ interface IUploadHooks {
932
1120
  * @category Interface
933
1121
  */
934
1122
  interface ISearchMessageInTimeRangeOption {
1123
+ /**
1124
+ *搜索关键字
1125
+ */
935
1126
  keyword: string;
1127
+ /**
1128
+ * 开始时间
1129
+ */
936
1130
  startTime: number;
1131
+ /**
1132
+ * 截止时间
1133
+ */
937
1134
  endTime: number;
1135
+ /**
1136
+ * 分页搜索时的偏移量, 默认为0
1137
+ */
938
1138
  offset?: number;
1139
+ /**
1140
+ * 每页的数量, 默认为 5
1141
+ */
939
1142
  limit?: number;
940
1143
  }
1144
+ /**
1145
+ * 消息监听数据结构
1146
+ * @category Interface
1147
+ */
941
1148
  interface IMessagesEvent {
942
1149
  /**
943
1150
  * 接收的消息数据
944
1151
  */
945
1152
  messages: IAReceivedMessage[];
946
1153
  }
1154
+ /**
1155
+ * 收到已读回执(单聊)数据结构
1156
+ * @category Interface
1157
+ */
947
1158
  interface IReadReceiptReceivedEvent {
948
1159
  /**
949
1160
  * 会话信息,包含会话属性
@@ -962,6 +1173,10 @@ interface IReadReceiptReceivedEvent {
962
1173
  */
963
1174
  sendUserId: string;
964
1175
  }
1176
+ /**
1177
+ * 收到已读回执请求(群聊)数据结构
1178
+ * @category Interface
1179
+ */
965
1180
  interface IMessageReceiptRequestEvent {
966
1181
  /**
967
1182
  * 会话信息,包含会话属性
@@ -976,6 +1191,10 @@ interface IMessageReceiptRequestEvent {
976
1191
  */
977
1192
  senderUserId: string;
978
1193
  }
1194
+ /**
1195
+ * 收到已读回执响应(群聊)数据结构
1196
+ * @category Interface
1197
+ */
979
1198
  interface IMessageReceiptResponseEvent {
980
1199
  /**
981
1200
  * 会话信息,包含会话属性
@@ -990,16 +1209,34 @@ interface IMessageReceiptResponseEvent {
990
1209
  */
991
1210
  messageUIdList: string[];
992
1211
  }
1212
+ /**
1213
+ * 正在输入状态事件数据结构
1214
+ * @category Interface
1215
+ */
993
1216
  interface ITypingStatusEvent {
994
1217
  /**
995
1218
  * typing 状态
996
1219
  */
997
1220
  status: ITypingMessage[];
998
1221
  }
1222
+ /**
1223
+ * 会话变更数据结构
1224
+ * @category Interface
1225
+ */
999
1226
  interface IConversationState {
1227
+ /**
1228
+ * 会话结构
1229
+ */
1000
1230
  conversation: IAReceivedConversation;
1231
+ /**
1232
+ * 更新项
1233
+ */
1001
1234
  updatedItems?: IUpdateItem;
1002
1235
  }
1236
+ /**
1237
+ * 会话变更监听数据结构
1238
+ * @category Interface
1239
+ */
1003
1240
  interface IConversationEvent {
1004
1241
  /**
1005
1242
  * 会话信息数组
@@ -1007,6 +1244,10 @@ interface IConversationEvent {
1007
1244
  conversationList: IConversationState[];
1008
1245
  }
1009
1246
 
1247
+ /**
1248
+ * 事件监听器
1249
+ * @category Type
1250
+ */
1010
1251
  declare type EventListeners = {
1011
1252
  [Events.CONNECTING]: () => void;
1012
1253
  [Events.CONNECTED]: () => void;
@@ -1048,42 +1289,95 @@ declare type EventListeners = {
1048
1289
  [Events.SYNC_READ_STATUS]: (list: ISyncReadStatusData) => void;
1049
1290
  [Events.SUBSCRIBED_USER_STATUS_CHANGE]: (data: ISubscribeUserStatusInfo[]) => void;
1050
1291
  [Events.SUBSCRIBED_RELATION_CHANGE]: (data: ISubscribeRelationInfo[]) => void;
1051
- [Events.SYNC_SUBSCRIBED_USER_STATUS_FINISHED]: () => void;
1292
+ [Events.SYNC_SUBSCRIBED_USER_STATUS_FINISHED]: (type: SubscribeType) => void;
1293
+ [Events.OWN_USER_PROFILE_CHANGED]: (data: IUserProfileInfo) => void;
1052
1294
  };
1053
1295
 
1054
1296
  /**
1055
- * 绑定事件
1297
+ * 添加监听器
1298
+ * @description 用来接收来自于 IMLib 内的各种事件通知,同类型事件可以多次添加不同的监听函数。绑定仅执行一次的事件可以使用 {@link onceEventListener}
1056
1299
  * @category 基础
1057
- * @param eventType
1058
- * @param listener
1059
- * @param target
1300
+ * @param eventType 事件名称
1301
+ * @param listener 事件监听函数
1302
+ * @example
1303
+ * 添加监听器示例:
1304
+ * ```ts
1305
+ * RongIMLib.addEventListener(RongIMLib.Events.CONNECTED, () => {
1306
+ * console.log('连接成功');
1307
+ * });
1308
+ * ```
1060
1309
  */
1061
1310
  declare function addEventListener<T extends Events>(eventType: T, listener: EventListeners[T], target?: any): void;
1062
1311
  /**
1063
- * 绑定仅执行一次的事件
1312
+ * 添加监听器(仅执行一次)
1313
+ * @description 用来接收来自于 IMLib 内的各种事件通知
1064
1314
  * @category 基础
1315
+ * @param eventType 事件名称
1316
+ * @param listener 事件监听函数
1317
+ * @example
1318
+ * 添加监听器示例:
1319
+ * ```ts
1320
+ * RongIMLib.onceEventListener(RongIMLib.Events.CONNECTED, () => {
1321
+ * console.log('连接成功');
1322
+ * });
1323
+ * ```
1065
1324
  */
1066
1325
  declare function onceEventListener<T extends Events>(eventType: T, listener: EventListeners[T], target?: any): void;
1067
1326
  /**
1068
1327
  * 移除事件
1328
+ * @description 业务层需注意在必要时使用 {@link removeEventListener} 或 {@link removeEventListeners} 移除对指定事件的监听函数,以免造成内存泄露
1069
1329
  * @category 基础
1330
+ * @param eventType 事件名称
1331
+ * @param listener 事件监听函数
1332
+ * @example
1333
+ * 移除事件示例:
1334
+ * ```ts
1335
+ * const listener = (evt) => console.log(evt.messages)
1336
+ * RongIMLib.removeEventListener(Events.MESSAGES, listener);
1337
+ * ```
1070
1338
  */
1071
1339
  declare function removeEventListener<T extends Events>(eventType: T, listener: EventListeners[T], target?: any): void;
1072
1340
  /**
1073
1341
  * 移除同一类型下的所有事件
1342
+ * @description 将移除对某一特定事件的所有监听函数
1074
1343
  * @category 基础
1344
+ * @param eventType 事件名称
1345
+ * @example
1346
+ * 移除事件示例:
1347
+ * ```ts
1348
+ * RongIMLib.removeEventListeners(Events.MESSAGES);
1349
+ * ```
1075
1350
  */
1076
1351
  declare function removeEventListeners(eventType: string): void;
1077
1352
  /**
1078
1353
  * 清理所有事件
1079
1354
  * @category 基础
1355
+ * @example
1356
+ * 清理所有事件示例:
1357
+ * ```ts
1358
+ * RongIMLib.clearEventListeners();
1359
+ * ```
1080
1360
  */
1081
1361
  declare function clearEventListeners(): void;
1082
1362
 
1083
1363
  /**
1084
1364
  * 获取会话列表
1365
+ *
1366
+ * @description 获取会话列表接口需要开通单群聊消息云存储之后才可以从服务端获取到数据,服务端会话列表存储上限为 1000
1367
+ * * **注意**:
1368
+ * Electron 平台调用时会忽略参数传值,固定返回所有会话列表。建议 Electron 平台客户考虑使用其他获取会话列表的接口
1369
+ * 超过 1000 会根据最后一条消息时间排序,删除最早的会话
1085
1370
  * @category 会话
1086
- * @param options
1371
+ * @param options 获取会话列表参数配置
1372
+ * @defaultValues count: 20, startTime: 0, order: 0
1373
+ *
1374
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedConversation} 类型数组
1375
+ * @example
1376
+ * 获取会话列表示例:
1377
+ * ```ts
1378
+ * const conversationList = await RongIMLib.getConversationList();
1379
+ * console.info('获取会话列表结果:', conversationList);
1380
+ * ```
1087
1381
  */
1088
1382
  declare function getConversationList$1(options?: {
1089
1383
  /**
@@ -1108,12 +1402,39 @@ declare function getConversationList$1(options?: {
1108
1402
  * 获取指定会话数据
1109
1403
  * @description 通过该方法获取的会话可能并不存在于当前的会话列表中,此处只作为功能性封装语法糖
1110
1404
  * @category 会话
1111
- * @param options
1405
+ * @param options 需要获取会话参数,类型为 {@link IConversationOption}
1406
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedConversation} 类型
1407
+ *
1408
+ * @example
1409
+ * 获取指定会话数据示例:
1410
+ * ```ts
1411
+ * const options = {
1412
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1413
+ * targetId: 'targetId',
1414
+ * }
1415
+ * const conversation = await RongIMLib.getConversation(options);
1416
+ * console.info('获取指定会话数据结果:', conversation);
1417
+ * ```
1112
1418
  */
1113
1419
  declare function getConversation(options: IConversationOption): Promise<IAsyncRes<IAReceivedConversation | null | undefined>>;
1114
1420
  /**
1115
- * 移除指定的会话实例
1421
+ * 移除指定的会话
1116
1422
  * @category 会话
1423
+ * @description 移除指定的会话,不会删除会话内的消息
1424
+ * * **注意**:
1425
+ * 1. 删除会话不会删除会话的未读数,推荐在删除会话前先调用清除指定会话未读数 {@link clearMessagesUnreadStatus}接口,以防止未读数异常
1426
+ * 2. 会话是有消息生成,如会话中在产生新消息会重新生成会话
1427
+ * @param options 会话信息
1428
+ * @example
1429
+ * 移除指定的会话示例:
1430
+ * ```ts
1431
+ * const options = {
1432
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1433
+ * targetId: 'targetId',
1434
+ * }
1435
+ * const conversation = await RongIMLib.removeConversation(options);
1436
+ * console.info('移除指定的会话结果:', conversation);
1437
+ * ```
1117
1438
  */
1118
1439
  declare function removeConversation(options: IConversationOption): Promise<IAsyncRes<void>>;
1119
1440
  /**
@@ -1146,23 +1467,53 @@ declare function batchRemoveConversation(conversations: IConversationOption[]):
1146
1467
  /**
1147
1468
  * 获取会话文本草稿
1148
1469
  * @category 草稿
1149
- * @params conversationType 会话类型
1150
- * @params targetId 目标 ID
1470
+ * @description Web 端草稿为内存态保存,如刷新浏览器会导致已经设置的草稿丢失
1471
+ * @param options 会话信息
1472
+ * @example
1473
+ * 获取会话文本草稿示例:
1474
+ * ```ts
1475
+ * const options = {
1476
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1477
+ * targetId: 'targetId',
1478
+ * }
1479
+ * const conversation = await RongIMLib.getTextMessageDraft(options);
1480
+ * console.info('获取会话文本草稿结果:', conversation);
1481
+ * ```
1151
1482
  */
1152
1483
  declare function getTextMessageDraft(options: IConversationOption): Promise<IAsyncRes<string>>;
1153
1484
  /**
1154
1485
  * 设置会话文本草稿
1155
1486
  * @category 草稿
1156
- * @params conversationType 会话类型
1157
- * @params targetId 目标 ID
1158
- * @params draft 草稿内容
1487
+ * @description Web 端草稿为内存态保存,如刷新浏览器会导致已经设置的草稿丢失
1488
+ * @param options 会话信息
1489
+ * @param draft 草稿内容
1490
+ * @example
1491
+ * 设置会话文本草稿示例:
1492
+ * ```ts
1493
+ * const options = {
1494
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1495
+ * targetId: 'targetId',
1496
+ * }
1497
+ * const draft = '这是草稿信息';
1498
+ * const conversation = await RongIMLib.saveTextMessageDraft(options, draft);
1499
+ * console.info('设置会话文本草稿结果:', conversation);
1500
+ * ```
1159
1501
  */
1160
1502
  declare function saveTextMessageDraft(options: IConversationOption, draft: string): Promise<IAsyncRes<void>>;
1161
1503
  /**
1162
1504
  * 删除会话文本草稿
1163
1505
  * @category 草稿
1164
- * @params conversationType 会话类型
1165
- * @params targetId 目标 ID
1506
+ * @param options 会话信息
1507
+ * @example
1508
+ * 删除会话文本草稿示例:
1509
+ * ```ts
1510
+ * const options = {
1511
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1512
+ * targetId: 'targetId',
1513
+ * }
1514
+ * const conversation = await RongIMLib.clearTextMessageDraft(options);
1515
+ * console.info('删除会话文本草稿结果:', conversation);
1516
+ * ```
1166
1517
  */
1167
1518
  declare function clearTextMessageDraft(options: IConversationOption): Promise<IAsyncRes<void>>;
1168
1519
  /**
@@ -1174,45 +1525,110 @@ declare function clearTextMessageDraft(options: IConversationOption): Promise<IA
1174
1525
  * 3. 其他端删除会话可能会导致会话未读数不准确
1175
1526
  * @param includeMuted 是否包含免打扰会话
1176
1527
  * @param conversationTypes 要获取未读数的会话类型,若为空,则默认获取单聊、群聊及系统消息未读数
1528
+ * @defaultValues includeMuted: false
1529
+ * @return 返回一个 {@link IAsyncRes} 类型 Promise,data 中返回会话未读数
1530
+ * @example
1531
+ * 获取当前所有会话的消息未读数示例:
1532
+ * ```ts
1533
+ * const totalUnreadCount = await RongIMLib.getTotalUnreadCount();
1534
+ * console.info('获取当前所有会话的消息未读数结果:', totalUnreadCount);
1535
+ * ```
1177
1536
  */
1178
1537
  declare function getTotalUnreadCount(includeMuted?: boolean, conversationTypes?: ConversationType[]): Promise<IAsyncRes<number>>;
1179
1538
  /**
1180
1539
  * 获取会话指定免打扰级别的未读数
1540
+ * @description 查找免打扰配置符合传入的免打扰级别的会话,返回所有会话中未读消息的总数
1541
+ * * **注意**:
1542
+ * 1. 聊天室会话类型不存储未读数,故不支持获取聊天室会话的未读数
1181
1543
  * @category 会话未读数
1182
- * @param conversationTypes 会话类型列表
1183
- * @param levels 免打扰级别列表,传空数组则获取全部免打扰级别未读数
1184
- * @return number 未读总数
1544
+ * @since 5.5.1 暂不支持 Electron 平台
1545
+ * @param conversationTypes 会话类型列表,
1546
+ * @param levels 需要获取的会话的免打扰级别,传空数组则统计全部支持会话未读数的会话类型的免打扰级别的未读数
1547
+ * @return 返回一个 {@link IAsyncRes} 类型 Promise,data 中返回会话未读数
1548
+ *
1549
+ * @example
1550
+ * 获取会话指定免打扰级别的未读数示例:
1551
+ * ```ts
1552
+ * const conversationTypes = [RongIMLib.ConversationType.PRIVATE];
1553
+ * const levels = [RongIMLib.NotificationLevel.ALL_MESSAGE];
1554
+ * const totalUnreadCount = await RongIMLib.getTotalUnreadCountByLevels(conversationTypes, levels);
1555
+ * console.info('获取会话指定免打扰级别的未读数结果:', totalUnreadCount);
1556
+ * ```
1185
1557
  */
1186
1558
  declare function getTotalUnreadCountByLevels(conversationTypes: ConversationType[], levels: NotificationLevel[]): Promise<IAsyncRes<number>>;
1187
1559
  /**
1188
1560
  * 获取会话指定免打扰级别未读 @ 消息数
1561
+ * @description 查找免打扰配置符合传入的免打扰级别的会话,返回所有会话中所有未读 @ 消息的总数
1189
1562
  * @category 会话未读数
1563
+ * @since 5.5.1 暂不支持 Electron 平台
1190
1564
  * @param conversationTypes 会话类型列表
1191
1565
  * @param levels 免打扰级别列表,传空数组则获取全部免打扰级别未读数
1192
- * @return number 未读总数
1566
+ * @return 返回一个 {@link IAsyncRes} 类型 Promise,data 中返回会话未读数
1567
+ *
1568
+ * @example
1569
+ * 获取会话指定免打扰级别未读 @ 消息数示例:
1570
+ * ```ts
1571
+ * const conversationTypes = [RongIMLib.ConversationType.PRIVATE];
1572
+ * const levels = [RongIMLib.NotificationLevel.ALL_MESSAGE];
1573
+ * const totalUnreadCount = await RongIMLib.getTotalUnreadMentionedCountByLevels(conversationTypes, levels);
1574
+ * console.info('获取会话指定免打扰级别未读 @ 消息数结果:', totalUnreadCount);
1575
+ * ```
1193
1576
  */
1194
1577
  declare function getTotalUnreadMentionedCountByLevels(conversationTypes: ConversationType[], levels: NotificationLevel[]): Promise<IAsyncRes<number>>;
1195
1578
  /**
1196
- * 获取单个会话的未读数
1579
+ * 获取指定会话的未读数
1580
+ * @description 获取指定会话的未读数,Web 端会话未读数保存在 localstorage 中,如清除浏览器缓存会导致会话未读数不准确
1197
1581
  * @category 会话未读数
1582
+ * @param options 会话信息
1583
+ *
1584
+ * @example
1585
+ * 获取指定会话的未读数示例:
1586
+ * ```ts
1587
+ * const options = {
1588
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1589
+ * targetId: 'targetId',
1590
+ * }
1591
+ * const unreadCount = await RongIMLib.getUnreadCount(options);
1592
+ * console.info('获取指定会话的未读数结果:', unreadCount);
1593
+ * ```
1198
1594
  */
1199
1595
  declare function getUnreadCount(options: IConversationOption): Promise<IAsyncRes<number>>;
1200
1596
  /**
1201
- * 清除会话未读数
1202
- * 原:clearUnreadCount
1597
+ * 清除指定会话未读数
1598
+ * @description 清除指定会话的未读数(不含聊天室会话类型)
1599
+ * * **注意**:
1600
+ * 1. Web 端会话未读数保存在 localstorage 中,如清除浏览器缓存会导致会话未读数不准确
1601
+ * 2. 聊天室会话类型不存储未读数,故不支持清除聊天室会话的未读数
1602
+ * 3. 未读数为本地为本地存储,清除后不可恢复,如用户多端未读数不会主动做多端同步,如需要多端同步需要通过 {@link sendSyncReadStatusMessage} 接口进行同步
1203
1603
  * @category 会话未读数
1604
+ * @param options 会话信息
1605
+ * @example
1606
+ * 清除指定会话未读数示例:
1607
+ * ```ts
1608
+ * const options = {
1609
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1610
+ * targetId: 'targetId',
1611
+ * }
1612
+ * const clearRes = await RongIMLib.clearMessagesUnreadStatus(options);
1613
+ * console.info('清除指定会话未读数结果:', clearRes);
1614
+ * ```
1204
1615
  */
1205
1616
  declare function clearMessagesUnreadStatus(options: IConversationOption): Promise<IAsyncRes<void>>;
1206
1617
  /**
1207
1618
  * 清理全部未读数
1208
1619
  * @category 会话未读数
1209
- * @returns
1620
+ * @since 5.0.2
1621
+ * @example
1622
+ * 清理全部未读数示例:
1623
+ * ```ts
1624
+ * const clearRes = await RongIMLib.clearAllMessagesUnreadStatus();
1625
+ * console.info('清除指定会话未读数结果:', clearRes);
1626
+ * ```
1210
1627
  */
1211
1628
  declare function clearAllMessagesUnreadStatus(): Promise<IAsyncRes<ErrorCode>>;
1212
1629
  /**
1213
1630
  * 设置会话免打扰
1214
- * 原: setConversationNotificationStatus 已废弃
1215
- * 是否免打扰
1631
+ * @description 支持按照 {@link NotificationLevel} 类型进行免打扰级别设置,级别描述如下:
1216
1632
  * * -1: 全部消息通知(接收全部消息通知 -- 显示指定关闭免打扰功能)
1217
1633
  * * 0: 未设置(向上查询群或者APP级别设置)//存量数据中0表示未设置
1218
1634
  * * 1: 群聊超级群仅@消息通知(现在通知)单聊代表全部消息通知
@@ -1220,7 +1636,20 @@ declare function clearAllMessagesUnreadStatus(): Promise<IAsyncRes<ErrorCode>>;
1220
1636
  * * 3: @ 群用户组通知,通知用户组暂未实现,暂不暴露出去
1221
1637
  * * 4: @ 群全员通知
1222
1638
  * * 5: 消息通知被屏蔽,即不接收消息通知
1639
+ * @since 5.3.0
1640
+ * @param options 会话信息
1641
+ * @param notificationLevel 需要设置的免打扰级别,类型为 {@link NotificationLevel}
1223
1642
  * @category 会话
1643
+ * @example
1644
+ * 设置会话免打扰示例:
1645
+ * ```ts
1646
+ * const options = {
1647
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1648
+ * targetId: 'targetId',
1649
+ * }
1650
+ * const notificationLevel = RongIMLib.NotificationLevel.NOT_MESSAGE_NOTIFICATION;
1651
+ * const res = await RongIMLib.setConversationNotificationLevel(options, notificationLevel);
1652
+ * console.info('设置会话免打扰结果:', res);
1224
1653
  */
1225
1654
  declare function setConversationNotificationLevel(options: IConversationOption, notificationLevel: NotificationLevel): Promise<IAsyncRes<void>>;
1226
1655
  /**
@@ -1252,51 +1681,82 @@ declare function setConversationNotificationLevel(options: IConversationOption,
1252
1681
  declare function batchSetConversationNotificationLevel(conversations: IConversationOption[], notificationLevel: NotificationLevel): Promise<IAsyncRes<void>>;
1253
1682
  /**
1254
1683
  * 设置会话免打扰
1255
- * @deprecated 已废弃,请使用 setConversationNotificationLevel
1256
- * 原: setConversationStatus,免打扰和置顶一体的
1257
- * 是否免打扰
1258
- * * 1: 开启免打扰
1259
- * * 2: 关闭免打扰
1684
+ * @deprecated @since 5.3.0 已废弃,请使用 {@link setConversationNotificationLevel}
1260
1685
  * @category 会话
1261
1686
  */
1262
1687
  declare function setConversationNotificationStatus(options: IConversationOption, notificationStatus: NotificationStatus): Promise<IAsyncRes<void>>;
1263
1688
  /**
1264
1689
  * 查询指定会话和频道免打扰
1265
- * 原: getConversationNotificationStatus 已废弃
1690
+ * @deprecated 查询通过 {@link setConversationNotificationLevel} 接口设置的指定会话和频道免打扰
1691
+ * 1. Electron 平台,从 5.8.4 版本开始支持 {@link setConversationNotificationLevel} 接口。
1266
1692
  * @category 会话
1693
+ * @since 5.3.0
1694
+ * @param options 会话信息
1695
+ * @example
1696
+ * 查询指定会话和频道免打扰示例:
1697
+ * ```ts
1698
+ * const options = {
1699
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1700
+ * targetId: 'targetId',
1701
+ * }
1702
+ * const conversation = await RongIMLib.getConversationNotificationLevel(options);
1703
+ * console.info('查询指定会话和频道免打扰结果:', conversation);
1704
+ * ```
1267
1705
  */
1268
1706
  declare function getConversationNotificationLevel(options: IConversationOption): Promise<IAsyncRes<NotificationLevel | undefined>>;
1269
1707
  /**
1270
1708
  * 获取免打扰状态
1271
- * getConversationNotificationStatus
1272
1709
  * @category 会话
1273
- * @deprecated 已废弃,请使用 getConversationNotificationLevel
1710
+ * @deprecated 已废弃 @since 5.3.0, 5.3.0以上版本请使用 {@link getConversationNotificationLevel} 接口
1274
1711
  */
1275
1712
  declare function getConversationNotificationStatus(options: IConversationOption): Promise<IAsyncRes<NotificationStatus | undefined>>;
1276
1713
  /**
1277
1714
  * 获取免打扰状态列表
1278
- * getBlockedConversationList
1715
+ * @description 获取已设置免打扰状态的所有会话,接口仅 Web 端支持
1716
+ * @since 5.1.1
1279
1717
  * @category 会话
1718
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IBaseConversationInfo} 类型数组
1719
+ * @example
1720
+ * 获取免打扰状态列表示例:
1721
+ * ```ts
1722
+ * const list = await RongIMLib.getBlockedConversationList();
1723
+ * console.info('获取免打扰状态列表结果:', list);
1724
+ * ```
1280
1725
  */
1281
1726
  declare function getBlockedConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
1282
1727
  /**
1283
1728
  * 设置指定会话类型的免打扰级别
1729
+ * @description 私有云功能,暂未公有云暴露
1730
+ * @hidden
1284
1731
  * @param conversationType 会话类型
1285
1732
  * @param level 免打扰级别
1286
1733
  */
1287
1734
  declare function setConversationTypeNotificationLevel(conversationType: ConversationType, level: NotificationLevel): Promise<IAsyncRes<void>>;
1288
1735
  /**
1289
1736
  * 获取指定会话类型的免打扰级别
1737
+ * @description 私有云功能,暂未公有云暴露
1738
+ * @hidden
1290
1739
  * @param conversationType 会话类型
1291
1740
  */
1292
1741
  declare function getConversationTypeNotificationLevel(conversationType: ConversationType): Promise<IAsyncRes<NotificationLevel>>;
1293
1742
  /**
1294
1743
  * 设置会话是否置顶
1295
1744
  * @category 会话
1296
- * @param options 回话信息
1745
+ * @param options 会话信息
1297
1746
  * @param isTop 置顶状态
1298
1747
  * @param isUpdateTime 是否更新会话操作时间,默认为更新,仅私有云环境有效
1299
- * @returns
1748
+ * @defaultValue isUpdateTime 默认为 true
1749
+ * @example
1750
+ * 设置会话是否置顶示例:
1751
+ * ```ts
1752
+ * const isTop = true
1753
+ * const options = {
1754
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1755
+ * targetId: 'targetId',
1756
+ * }
1757
+ * const res = await RongIMLib.setConversationToTop(options, isTop);
1758
+ * console.info('设置会话是否置顶结果:', res);
1759
+ * ```
1300
1760
  */
1301
1761
  declare function setConversationToTop(options: IConversationOption, isTop?: boolean, isUpdateTime?: boolean): Promise<IAsyncRes<void>>;
1302
1762
  /**
@@ -1329,150 +1789,390 @@ declare function setConversationToTop(options: IConversationOption, isTop?: bool
1329
1789
  */
1330
1790
  declare function batchSetConversationToTop(conversations: IConversationOption[], isTop: boolean, isCreateConversation?: boolean): Promise<IAsyncRes<void>>;
1331
1791
  /**
1332
- * 获取置顶会话
1792
+ * 获取置顶会话列表
1793
+ * @description 注意:该接口在 Web 平台返回数据中将不包含 latestMessage 字段。
1333
1794
  * @category 会话
1334
- * @param conversationTypes 会话类型
1795
+ * @since 5.6.0
1796
+ * @param conversationTypes 需要传递 {@link ConversationType} 类型数组
1335
1797
  * @param channelId 不传或传 undefined 时获取全部 channelId 类型的置顶会话
1798
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
1799
+ * @example
1800
+ * 获取置顶会话列表示例:
1801
+ * ```ts
1802
+ * const res = await RongIMLib.getTopConversationList();
1803
+ * console.info('获取置顶会话列表数结果:', res);
1804
+ * ```
1336
1805
  */
1337
1806
  declare function getTopConversationList(conversationTypes?: ConversationType[], channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
1338
1807
  /**
1339
1808
  * 获取未读会话列表
1809
+ * @description 注意:该接口在 Web 平台返回数据中将不包含 latestMessage 字段。
1340
1810
  * @category 会话
1811
+ * @since 5.7.0
1341
1812
  * @param conversationTypes 会话类型
1813
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
1814
+ * @example
1815
+ * 获取未读会话列表示例:
1816
+ * ```ts
1817
+ * const res = await RongIMLib.getUnreadConversationList();
1818
+ * console.info('获取未读会话列表结果:', res);
1819
+ * ```
1342
1820
  */
1343
1821
  declare function getUnreadConversationList(conversationTypes?: ConversationType[]): Promise<IAsyncRes<IAReceivedConversation[]>>;
1344
1822
  /**
1345
1823
  * 获取单个群会话 @ 消息未读数
1824
+ * @description 获取当前用户在指定超级群会话指定频道的未读 @ 消息数。
1825
+ * 注意,获取指定频道的未读 @ 消息数要求必须传入超级群频道 ID(channelId)
1346
1826
  * @category 会话未读数
1347
- * @param targetId 目标 ID
1827
+ * @param options 会话信息
1828
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 返回单个群会话 @ 消息未读数
1829
+ * @example
1830
+ * 获取单个群会话 @ 消息未读数示例:
1831
+ * ```ts
1832
+ * const options = {
1833
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1834
+ * targetId: 'targetId',
1835
+ * }
1836
+ * const count = await RongIMLib.getUnreadMentionedCount(options);
1837
+ * console.info('获取单个群会话 @ 消息未读数结果:', count);
1838
+ * ```
1348
1839
  */
1349
1840
  declare function getUnreadMentionedCount(options: IConversationOption): Promise<IAsyncRes<number>>;
1350
1841
  /**
1351
1842
  * 获取所有群会话 @ 消息未读数
1843
+ * @description 仅支持普通群会话,暂不支持超级群
1352
1844
  * @category 会话未读数
1845
+ * @since 5.9.0
1846
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 返回所有群会话 @ 消息未读总数
1847
+ * @example
1848
+ * 获取所有群会话 @ 消息未读数示例:
1849
+ * ```ts
1850
+ * const count = await RongIMLib.getAllUnreadMentionedCount();
1851
+ * console.info('获取所有群会话 @ 消息未读数结果:', count);
1852
+ * ```
1353
1853
  */
1354
1854
  declare function getAllUnreadMentionedCount(): Promise<IAsyncRes<number>>;
1355
1855
  /**
1356
1856
  * 获取本地全部会话的状态
1857
+ * @description 接口仅针对 Mihoyo 提供使用,目前公有云文档暂未提及,标注 hidden 暂不推荐使用。
1858
+ * @hidden
1357
1859
  * @category 会话
1358
1860
  */
1359
1861
  declare function getAllConversationState(): Promise<IAsyncRes<IConversationState$1[]>>;
1360
1862
 
1361
1863
  /**
1362
1864
  * 获取超级群会话列表
1865
+ * @description 获取超级群会话列表,不传则获取全部超级群会话列表,该列表不包含未产生任何消息的会话。
1363
1866
  * @category 超级群
1867
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1868
+ * @param options 获取超级群会话列表参数,不传则获取全部超级群会话列表
1869
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为超级群会话列表 {@link IUltraGroupConversation[]},code 接口返回状态码
1870
+ * @defaultValue options 默认值为 {}
1871
+ * @example 获取超级群会话列表示例:
1872
+ * ```ts
1873
+ * const res = await RongIMLib.getUltraGroupList();
1874
+ * console.log('获取超级群会话列表结果:', res);
1875
+ * ```
1364
1876
  */
1365
1877
  declare function getUltraGroupList(options?: IGetUltraGroupListOption): Promise<IAsyncRes<IUltraGroupConversation[]>>;
1366
1878
  /**
1367
- * 获取超级群免打扰列表
1879
+ * 获取当前登录用户免打扰超级群会话列表
1880
+ * @description 获取当前登录用户免打扰超级群会话列表
1368
1881
  * @category 超级群
1882
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1883
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为超级群会话列表 {@link IUltraGroupConversation[]},code 接口返回状态码
1884
+ * @example 获取当前登录用户免打扰超级群会话列表示例:
1885
+ * ```ts
1886
+ * const res = await RongIMLib.getBlockUltraGroupList();
1887
+ * console.log('获取当前登录用户免打扰超级群会话列表结果:', res);
1888
+ * ```
1369
1889
  */
1370
1890
  declare function getBlockUltraGroupList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
1371
1891
  /**
1372
- * 通知服务端正在输入中
1892
+ * 发送输入状态
1893
+ * @description 发送输入状态,用于通知服务端正在输入中
1373
1894
  * @category 超级群
1895
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1896
+ * @param options 发送输入状态参数,包含会话类型、目标 Id、频道 Id,类型为 {@link IConversationOption}
1897
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,code 接口返回状态码
1898
+ * @example 发送输入状态示例:
1899
+ * ```ts
1900
+ * const options = {
1901
+ * conversationType: RongIMLib.ConversationType.ULTRA_GROUP,
1902
+ * targetId: 'targetId',
1903
+ * channelId: 'channelId',
1904
+ * };
1905
+ * const res = await RongIMLib.sendUltraGroupTypingStatus(options);
1906
+ * console.log('发送输入状态结果:', res);
1907
+ * ```
1374
1908
  */
1375
1909
  declare function sendUltraGroupTypingStatus(options: IConversationOption): Promise<IAsyncRes<void>>;
1376
1910
  /**
1377
- * 根据消息 ID 获取消息
1911
+ * 从服务端获取特定批量消息
1912
+ * @description 根据消息的 Uid 从服务端获取特定批量消息
1378
1913
  * @category 超级群
1914
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1915
+ * @param options 获取消息参数,包含会话类型、目标 Id、频道 Id,类型为 {@link IConversationOption}
1916
+ * @param messages 消息列表,包含消息的 Uid,类型为 {@link IMessageDesc} 数组
1917
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为消息列表,code 接口返回状态码
1918
+ * 从 SDK 版本 @since 5.7.0 开始,该接口的返回数据类型由 {@link IReceivedMessage} 变更为 {@link IAReceivedMessage}
1919
+ * @example 从服务端获取特定批量消息示例:
1920
+ * ```ts
1921
+ * const options = {
1922
+ * conversationType: RongIMLib.ConversationType.ULTRA_GROUP,
1923
+ * targetId: 'targetId',
1924
+ * channelId: 'channelId',
1925
+ * };
1926
+ * // sendTime 为消息的发送时间,此处示例为假数据
1927
+ * const messages = [{ messageUId: 'messageUId1', sendTime: 1626864000000, }];
1928
+ * const res = await RongIMLib.getUltraGroupMessageListByMessageUId(options, messages);
1929
+ * console.log('从服务端获取特定批量消息结果:', res);
1930
+ * ```
1379
1931
  */
1380
1932
  declare function getUltraGroupMessageListByMessageUId(options: IConversationOption, messages: IMessageDesc[]): Promise<IAsyncRes<{
1381
1933
  [messageUid: string]: IAReceivedMessage | undefined;
1382
1934
  }>>;
1383
1935
  /**
1384
- * 修改消息扩展
1936
+ * 设置、更新消息扩展信息
1937
+ * @description 设置、更新消息扩展信息,用于超级群消息扩展信息的设置、更新,消息扩展信息
1938
+ * * **适用场景**:原始消息增加状态标识的需求,都可使用消息扩展
1939
+ * 1. 消息评论需求,可通过设置原始消息扩展信息的方式添加评论信息。
1940
+ * 2. 礼物领取、订单状态变化需求,通过此功能改变消息显示状态。 例如:向用户发送礼物,默认为未领取状态,用户点击后可设置消息扩展为已领取状态
1941
+ * * **注意**:
1942
+ * 1. 每次设置消息扩展将会产生内置通知消息,频繁设置扩展会产生大量消息
1943
+ * 2. 仅当发送消息时指定 canIncludeExpansion 值为 true,才可对消息进行扩展
1385
1944
  * @category 超级群
1945
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1946
+ * @param expansion 消息扩展信息,类型是 Object。Key 支持大小写英文字母、数字、 特殊字符+ = - _ 的组合方式,不支持汉字。最大 32 个字符。<br />
1947
+ * (SDK < 5.3.0)Value 最大 64 个字符 <br />
1948
+ * (SDK ≧ 5.3.0)Value 最大 4096 个字符
1949
+ * @param message 接收到的消息,类型是 {@link IAReceivedMessage}
1950
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,code 接口返回状态码
1951
+ * @example 设置、更新消息扩展信息示例:
1952
+ * ```ts
1953
+ * const expansion = { key1: 'value1' };
1954
+ * const message = {} // 需要设置的消息,类型为 IAReceivedMessage
1955
+ * const res = await RongIMLib.updateExpansionForUltraGroupMessage(expansion, message);
1956
+ * console.log('设置、更新消息扩展信息结果:', res);
1957
+ * ```
1386
1958
  */
1387
1959
  declare function updateExpansionForUltraGroupMessage(expansion: {
1388
1960
  [key: string]: any;
1389
1961
  }, message: IAReceivedMessage): Promise<IAsyncRes<void>>;
1390
1962
  /**
1391
1963
  * 删除消息扩展
1964
+ * @description 删除消息扩展,用于超级群消息扩展信息的删除,消息扩展信息
1392
1965
  * @category 超级群
1966
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1967
+ * @param expansion 消息扩展信息的 key 数组,类型是 Array。Key 支持大小写英文字母、数字、特殊字符+ = - _ 的组合方式,不支持汉字。最大 32 个字符
1968
+ * @param message 接收到的消息,类型是 {@link IAReceivedMessage}
1969
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,code 接口返回状态码
1970
+ * @example 删除消息扩展示例:
1971
+ * ```ts
1972
+ * const expansion = ['key1'];
1973
+ * // message 需要删除扩展的消息,类型为 IAReceivedMessage,此处示例伪代码
1974
+ * const res = await RongIMLib.removeExpansionForUltraGroupMessage(expansion, message);
1975
+ * console.log('删除消息扩展结果:', res);
1976
+ * ```
1393
1977
  */
1394
1978
  declare function removeExpansionForUltraGroupMessage(expansion: string[], message: IAReceivedMessage): Promise<IAsyncRes<void>>;
1395
1979
  /**
1396
1980
  * 删除指定消息上的所有扩展
1981
+ * @description 删除指定消息上的所有扩展,用于超级群消息扩展信息的删除,消息扩展信息
1397
1982
  * @category 超级群
1983
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1984
+ * @param message 接收到的消息,类型是 {@link IAReceivedMessage}
1985
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,code 接口返回状态码
1986
+ * @example 删除指定消息上的所有扩展示例:
1987
+ * ```ts
1988
+ * // message 需要删除扩展的消息,类型为 IAReceivedMessage,此处示例伪代码
1989
+ * const res = await RongIMLib.removeAllExpansionForUltraGroupMessage(message);
1990
+ * console.log('删除指定消息上的所有扩展结果:', res);
1991
+ * ```
1398
1992
  */
1399
1993
  declare function removeAllExpansionForUltraGroupMessage(message: IAReceivedMessage): Promise<IAsyncRes<void>>;
1400
1994
  /**
1401
1995
  * 修改消息
1996
+ * @description 用户在成功发送超级群消息后,可以主动修改已发送消息的消息内容
1997
+ * 消息被修改后,{@link IAReceivedMessage} 对象的 `isModifyMessage` 属性会被更新为 `true`
1998
+ * * **注意**:
1999
+ * 1. 消息类型无法修改。如果改前为文本消息,则传入的新消息内容必须为 {@link ITextMessageBody} 类型
2000
+ * 2. 无法修改他人发送的消息。
1402
2001
  * @category 超级群
2002
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
2003
+ * @param content 修改后的消息内容,大小不能超过 128k
2004
+ * @param message 需要修改的消息,类型是 {@link IAReceivedMessage}
2005
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,code 接口返回状态码
2006
+ * @example 修改消息示例:
2007
+ * ```ts
2008
+ * const content = { text: '修改后的消息内容' };
2009
+ * // message 需要修改的消息,类型为 IAReceivedMessage,此处示例伪代码
2010
+ * const res = await RongIMLib.modifyMessage(content, message);
2011
+ * console.log('修改消息结果:', res);
2012
+ * ```
1403
2013
  */
1404
2014
  declare function modifyMessage(content: {
1405
2015
  [key: string]: any;
1406
2016
  }, message: IAReceivedMessage): Promise<IAsyncRes<void>>;
1407
2017
  /**
1408
- * 获取超级群所有子频道的未读数
2018
+ * 获取指定会话的未读 @ 消息数
2019
+ * @description 获取当前用户在指定超级群会话中的未读 @ 消息数
1409
2020
  * @category 超级群
2021
+ * @since 5.5.1 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1410
2022
  * @param targetId 超级群 Id
1411
- * @param notificationLevels 免打扰级别,不传或传空数组则获取全部级别
2023
+ * @param notificationLevels 免打扰级别,不传或传空数组则获取全部级别,类型为 {@link NotificationLevel} 数组
2024
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为未读 @ 消息数,code 接口返回状态码
2025
+ * @example 获取指定会话的未读 @ 消息数示例:
2026
+ * ```ts
2027
+ * const targetId = 'targetId';
2028
+ * const res = await RongIMLib.getUltraGroupUnreadMentionedCountByTargetId(targetId);
2029
+ * console.log('获取指定会话的未读 @ 消息数结果:', res);
2030
+ * ```
1412
2031
  */
1413
2032
  declare function getUltraGroupUnreadMentionedCountByTargetId(targetId: string, notificationLevels?: NotificationLevel[]): Promise<IAsyncRes<number>>;
1414
2033
  /**
1415
- * 查询指定超级群默认通知配置
2034
+ * 查询指定超级群或频道的默认免打扰级别
1416
2035
  * @category 超级群
2036
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
2037
+ * @param options 查询超级群或频道的默认免打扰级别参数,包含会话类型、目标 Id、频道 Id,类型为 {@link IUltraGroupOption}
2038
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为默认免打扰级别,code 接口返回状态码
2039
+ * @example 查询指定超级群或频道的默认免打扰级别示例:
2040
+ * ```ts
2041
+ * const options = {
2042
+ * targetId: 'targetId',
2043
+ * channelId: 'channelId',
2044
+ * };
2045
+ * const res = await RongIMLib.getUltraGroupDefaultNotificationLevel(options);
2046
+ * console.log('查询指定超级群或频道的默认免打扰级别结果:', res);
2047
+ * ```
1417
2048
  */
1418
2049
  declare function getUltraGroupDefaultNotificationLevel(options: IUltraGroupOption): Promise<IAsyncRes<NotificationLevel>>;
1419
2050
  /**
1420
- * 设置指定超级群默认通知配置
2051
+ * 设置指定超级群或频道的默认免打扰级别
2052
+ * @description 为指定的超级群设置的默认免打扰逻辑,自动适用于群下的所有频道。如果针对频道另行设置了默认免打扰逻辑,则以该频道的默认设置为准
2053
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务
1421
2054
  * @category 超级群
1422
- * @param options
2055
+ * @param options 设置超级群或频道的默认免打扰级别参数,包含会话类型、目标 Id、频道 Id,类型为 {@link IUltraGroupOption}
1423
2056
  * * 设置超级群默认通知配置 options: \{ targetId: 'xxx' \}, channelId 不传或传 ''
1424
2057
  * * 设置超级群指定频道默认通知配置 options: \{ targetId: 'xxx', channelId: 'xxx' \}
1425
- * @param notificationLevel
1426
- * * NotificationLevel
2058
+ * @param notificationLevel 免打扰级别 @since 5.3.0 以后 notificationLevel 类型为 {@link NotificationLevel}
2059
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,code 接口返回状态码
2060
+ * @example 设置指定超级群或频道的默认免打扰级别示例:
2061
+ * ```ts
2062
+ * const options = {
2063
+ * targetId: 'targetId',
2064
+ * channelId: 'channelId',
2065
+ * };
2066
+ * const notificationLevel = RongIMLib.NotificationLevel.NOT_MESSAGE_NOTIFICATION;
2067
+ * const res = await RongIMLib.setUltraGroupDefaultNotificationLevel(options, notificationLevel);
2068
+ * console.log('设置指定超级群或频道的默认免打扰级别结果:', res);
2069
+ * ```
1427
2070
  */
1428
2071
  declare function setUltraGroupDefaultNotificationLevel(options: IUltraGroupOption, notificationLevel: NotificationLevel): Promise<IAsyncRes<void>>;
1429
2072
  /**
1430
- * 获取指定超级群所有频道未读数
2073
+ * 获取指定会话的未读消息数
2074
+ * @description 获取当前用户在指定超级群会话中的未读消息数
2075
+ * @since 5.5.1 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1431
2076
  * @category 超级群
1432
2077
  * @param targetId 超级群 Id
1433
- * @param notificationLevels 免打扰级别,不传或传空数组则获取全部级别
1434
- * @returns 未读数
2078
+ * @param notificationLevels 免打扰级别,不传或传空数组则获取全部级别,类型为 {@link NotificationLevel} 数组
2079
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为未读消息数,code 接口返回状态码
2080
+ * @example 获取指定会话的未读消息数示例:
2081
+ * ```ts
2082
+ * const targetId = 'targetId';
2083
+ * const res = await RongIMLib.getUltraGroupUnreadCountByTargetId(targetId);
2084
+ * console.log('获取指定会话的未读消息数结果:', res);
2085
+ * ```
1435
2086
  */
1436
2087
  declare function getUltraGroupUnreadCountByTargetId(targetId: string, notificationLevels?: NotificationLevel[]): Promise<IAsyncRes<number>>;
1437
2088
  /**
1438
2089
  * 超级群类型所有未读数
2090
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
1439
2091
  * @category 超级群
1440
- * @returns 未读数
2092
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为未读数,code 接口返回状态码
2093
+ * @example 超级群类型所有未读数示例:
2094
+ * ```ts
2095
+ * const res = await RongIMLib.getAllUltraGroupUnreadCount();
2096
+ * console.log('超级群类型所有未读数结果:', res);
2097
+ * ```
1441
2098
  */
1442
2099
  declare function getAllUltraGroupUnreadCount(): Promise<IAsyncRes<number>>;
1443
2100
  /**
1444
- * 超级群类型所有 @ 消息未读数
2101
+ * 获取所有会话的未读 @ 消息数
2102
+ * @description 获取当前用户加入的所有超级群会话中的未读 @ 消息数的总和
1445
2103
  * @category 超级群
1446
- * @returns 未读数
2104
+ * @since 5.2.0 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
2105
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为未读 @ 消息数,code 接口返回状态码
2106
+ * @example 获取所有会话的未读 @ 消息数示例:
2107
+ * ```ts
2108
+ * const res = await RongIMLib.getAllUltraGroupUnreadMentionedCount();
2109
+ * console.log('获取所有会话的未读 @ 消息数结果:', res);
2110
+ * ```
1447
2111
  */
1448
2112
  declare function getAllUltraGroupUnreadMentionedCount(): Promise<IAsyncRes<number>>;
1449
2113
  /**
1450
2114
  * 超级群获取指定会话未读 @ 消息列表
2115
+ * @description 从远端获取指定超级群频道中的未读 @ 消息的摘要数据。最多可获取 50 条(count 取值范围为 [1-50])
2116
+ * * **注意**:功能依赖融云服务端保存的超级群会话「未读 @ 消息摘要」数据。「@所有人」消息的摘要数据固定存储 7 天(不支持调整)。其他类型 @ 消息的摘要数据与超级群历史消息存储时长一致。
1451
2117
  * @category 超级群
1452
- * @param options
1453
- * @returns 指定会话 @ 未读数消息列表
2118
+ * @since 5.5.2 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
2119
+ * @param options 获取指定会话未读 @ 消息列表参数,包含会话类型、目标 Id、频道 Id、时间戳、获取数量,类型为 {@link IUltraGroupUnreadMentionedOption}
2120
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为未读 @ 消息列表,code 接口返回状态码
2121
+ * @example 获取指定会话未读 @ 消息列表示例:
2122
+ * ```ts
2123
+ * const options = {
2124
+ * targetId: 'targetId',
2125
+ * channelId: 'channelId',
2126
+ * sentTime: 0,
2127
+ * count: 10,
2128
+ * };
2129
+ * const res = await RongIMLib.getUltraGroupUnreadMentionedMessages(options);
2130
+ * console.log('获取指定会话未读 @ 消息列表结果:', res);
2131
+ * ```
1454
2132
  */
1455
2133
  declare function getUltraGroupUnreadMentionedMessages(options: IUltraGroupUnreadMentionedOption): Promise<IAsyncRes<IUltraUnreadMsg[]>>;
1456
2134
  /**
1457
- * 超级群获取指定会话第一条未读消息时间戳
2135
+ * 获取指定会话的第一条未读消息的时间戳
2136
+ * @description 获取当前用户在指定超级群会话或指定频道的第一条未读消息的时间戳
1458
2137
  * @category 超级群
1459
- * @param conversation
1460
- * @returns 指定会话第一条未读消息时间戳
2138
+ * @since 5.5.2 仅 Web 端 IMLib 支持超级群。Electron 解决方案暂不适用于超级群业务。
2139
+ * @param conversation 获取指定会话第一条未读消息时间戳参数,包含会话类型、目标 Id、频道 Id,类型为 {@link IUltraGroupOption}
2140
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为指定会话第一条未读消息时间戳,code 接口返回状态码
2141
+ * @example 获取指定会话第一条未读消息时间戳示例:
2142
+ * ```ts
2143
+ * const conversation = {
2144
+ * targetId: 'targetId',
2145
+ * channelId: 'channelId',
2146
+ * };
2147
+ * const res = await RongIMLib.getUltraGroupFirstUnreadMessageTimestamp(conversation);
2148
+ * console.log('获取指定会话第一条未读消息时间戳结果:', res);
2149
+ * ```
1461
2150
  */
1462
2151
  declare function getUltraGroupFirstUnreadMessageTimestamp(conversation: IUltraGroupOption): Promise<IAsyncRes<IUltraUnreadMsg>>;
1463
2152
  /**
1464
- * 根据超级群的 targetId 数组,获取每个超级群下所有频道会话信息
1465
- * @param targetIds
1466
- * @returns
2153
+ * 批量获取超级群会话信息
2154
+ * @description 根据传入要查询的会话 id,获取该会话下所有频道的 {@link IUltraGroupUnreadInfo} 信息
1467
2155
  * @since 5.7.10
2156
+ * @category 超级群
2157
+ * @param targetIds 超级群 Id 数组,数组长度限制 [1-20] 个
2158
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为超级群会话信息列表,code 接口返回状态码
2159
+ * @example 批量获取超级群会话信息示例:
2160
+ * ```ts
2161
+ * const targetIds = ['targetId1', 'targetId2'];
2162
+ * const res = await RongIMLib.getUltraGroupUnreadInfoList(targetIds);
2163
+ * console.log('批量获取超级群会话信息结果:', res);
2164
+ * ```
1468
2165
  */
1469
2166
  declare function getUltraGroupUnreadInfoList(targetIds: string[]): Promise<IAsyncRes<IUltraGroupUnreadInfo[]>>;
1470
2167
 
1471
2168
  /**
1472
- * 加入聊天室
1473
- * @category 聊天室
1474
- * @deprecated
1475
- */
2169
+ * 加入聊天室
2170
+ * @description 接口会创建并加入聊天室。如果聊天室已存在,则直接加入聊天室
2171
+ * @category 聊天室
2172
+ * @param options 加入聊天室配置参数
2173
+ * @param targetId 聊天室 ID
2174
+ * @deprecated 从 @since 5.8.3 开始废弃该方法,请使用 {@link joinExistChatRoom} 代替
2175
+ */
1476
2176
  declare function joinChatRoom(targetId: string, options: {
1477
2177
  /**
1478
2178
  * 拉取消息数
@@ -1481,7 +2181,24 @@ declare function joinChatRoom(targetId: string, options: {
1481
2181
  }): Promise<IAsyncRes<void>>;
1482
2182
  /**
1483
2183
  * 加入已存在的聊天室
2184
+ * @description 聊天室已存在,在获取 `chatRoomId` 后可以调用 `joinExistChatRoom` 加入聊天室。该方法只能加入已存在的聊天室。
2185
+ * * **注意**:
2186
+ * 1. Electron 平台从 5.7.0 开始提供该接口
2187
+ * 2. 从 5.8.3 开始,成功回调的 data 数据中返回聊天室信息和禁言状态,详见 IChatroomJoinResponse
2188
+ * 3. 断网重连场景下,SDK 重新加入聊天室成功后,会按照加入聊天室时传入的 count 值拉取固定数量的消息。拉取的消息有可能在本地已存在,App 可能需要进行排重后再显示
2189
+ * @param options 加入聊天室配置参数, count 为进入聊天室时获取历史消息的数量,数量范围:1-50。如果传 -1,表示不获取任何历史消息。如果传 0,表示使用 SDK 默认设置(默认为获取 10 条)
2190
+ * @param targetId 聊天室 ID
2191
+ * @defaultValue options.count 为 10
1484
2192
  * @category 聊天室
2193
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IChatroomJoinResponse} 类型
2194
+ * @example
2195
+ * 加入已存在的聊天室示例:
2196
+ * ```ts
2197
+ * const chatRoomId = 'chatroomId';
2198
+ * const options = { count: 10 };
2199
+ * const res = await RongIMLib.joinExistChatRoom(chatRoomId, options);
2200
+ * console.log('加入已存在的聊天室结果:', res);
2201
+ * ```
1485
2202
  */
1486
2203
  declare function joinExistChatRoom(targetId: string, options: {
1487
2204
  /**
@@ -1491,13 +2208,36 @@ declare function joinExistChatRoom(targetId: string, options: {
1491
2208
  }): Promise<IAsyncRes<IChatroomJoinResponse>>;
1492
2209
  /**
1493
2210
  * 退出聊天室
2211
+ * @description 客户端用户可主动退出聊天室,退出后不再接收聊天室消息
1494
2212
  * @category 聊天室
2213
+ * @param targetId 聊天室 ID
2214
+ * @example
2215
+ * 退出聊天室示例:
2216
+ * ```ts
2217
+ * const chatRoomId = 'chatroomId';
2218
+ * const res = await RongIMLib.quitChatRoom(chatRoomId);
2219
+ * console.log('退出聊天室结果:', res);
2220
+ * ```
1495
2221
  */
1496
2222
  declare function quitChatRoom(targetId: string): Promise<IAsyncRes<void>>;
1497
2223
  /**
1498
- * 获取聊天室房间数据
2224
+ * 查询聊天室房间信息
1499
2225
  * @category 聊天室
1500
- * @description count order 有一个为0时,只返回成员总数,不返回成员列表信息
2226
+ * @description 获取聊天室的信息,返回聊天室成员总数和指定数量(最多 20 个)的聊天室成员的列表,包括该成员的用户 ID 以及加入聊天室的时间
2227
+ * * **注意**:
2228
+ * 1. count 或 order 有一个为 0 时,只返回成员总数,不返回成员列表信息, order 人员排序方式,`1` 为正序,`2` 为倒序,默认为 `0` 不返回
2229
+ * 2. 单个设备每秒钟支持调用一次,每分钟单个设备最多调用 20 次
2230
+ * @param targetId 聊天室 ID
2231
+ * @param options 查询聊天室信息配置参数
2232
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IChatroomInfo} 类型
2233
+ * @example
2234
+ * 查询聊天室房间信息示例:
2235
+ * ```ts
2236
+ * const chatRoomId = 'chatroomId';
2237
+ * const options = { count: 10, order: 1 };
2238
+ * const res = await RongIMLib.getChatRoomInfo(chatRoomId, options);
2239
+ * console.log('查询聊天室房间信息结果:', res);
2240
+ * ```
1501
2241
  */
1502
2242
  declare function getChatRoomInfo(targetId: string, options?: {
1503
2243
  /**
@@ -1505,59 +2245,148 @@ declare function getChatRoomInfo(targetId: string, options?: {
1505
2245
  */
1506
2246
  count?: number;
1507
2247
  /**
1508
- * 聊天室的人员排序,默认为 0
2248
+ * 聊天室的人员排序,默认为 0 不返回
1509
2249
  * * 1: 升序
1510
2250
  * * 2: 降序
1511
2251
  */
1512
2252
  order?: 0 | 1 | 2;
1513
2253
  }): Promise<IAsyncRes<IChatroomInfo>>;
1514
2254
  /**
1515
- * 设置聊天室自定义属性
2255
+ * 设置单个属性
2256
+ * @description 设置聊天室属性,支持设置 Key-Value 类型的属性信息
2257
+ * * **功能局限性:**
2258
+ * 1. 聊天室销毁后,聊天室中的自定义属性同时销毁。
2259
+ * 2. 每个聊天室中,最多允许设置 100 个属性信息,以 Key-Value 的方式进行存储。
2260
+ * 3. 客户端 SDK 未针对聊天室属性 KV 的操作频率进行限制。建议每个聊天室,每秒钟操作 Key-Value 频率保持在 100 次及以下(一秒内单次操作 100 个 KV 等同于操作 100 次)。
2261
+ *
2262
+ * * **注意**:
2263
+ * 1. 使用该接口需要开通 `聊天室属性自定义设置` 功能,您可以前往控制台的免费基础功能页面开启服务。
2264
+ * 2. 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
1516
2265
  * @category 聊天室
1517
- * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
2266
+ * @param targetId 聊天室 ID
2267
+ * @param options 设置聊天室属性配置参数,类型为 {@link IChatRoomEntry}
2268
+ * @example 设置单个属性示例:
2269
+ * ```ts
2270
+ * const chatRoomId = 'chatroomId';
2271
+ * const options = {
2272
+ * key: 'key',
2273
+ * value: 'value',
2274
+ * };
2275
+ * const res = await RongIMLib.setChatRoomEntry(chatRoomId, options);
2276
+ * console.log('设置单个属性结果:', res);
2277
+ * ```
1518
2278
  */
1519
- declare function setChatRoomEntry(targetId: string, options: IChatRoomEntry): Promise<IAsyncRes<void>>;
2279
+ declare function setChatRoomEntry(targetId: string, options: IChatroomEntry): Promise<IAsyncRes<void>>;
1520
2280
  /**
1521
- * 批量设置聊天室自定义属性
2281
+ * 批量设置属性
2282
+ *
1522
2283
  * @category 聊天室
1523
- * @param options ISetChatroomEntryOption数组
2284
+ * @description 批量设置聊天室属性
2285
+ * * **功能局限性:**
2286
+ * * 聊天室销毁后,聊天室中的自定义属性同时销毁。
2287
+ * * 每个聊天室中,最多允许设置 100 个属性信息,以 Key-Value 的方式进行存储。
2288
+ * * 客户端 SDK 未针对聊天室属性 KV 的操作频率进行限制。建议每个聊天室,每秒钟操作 Key-Value 频率保持在 100 次及以下(一秒内单次操作 100 个 KV 等同于操作 100 次)。
2289
+ *
2290
+ * * **注意**:
2291
+ * 1. 使用该接口需要开通 `聊天室属性自定义设置` 功能,您可以前往控制台的免费基础功能页面开启服务。
2292
+ * 2. 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
2293
+ * @param targetId 聊天室 ID
2294
+ * @param options 设置聊天室属性配置参数
2295
+ * 类型为 {@link IChatroomEntries} @since 5.3.4 版本开始,该接口同时支持通过 isForce 属性强制设置多个属性值。强制设置可直接覆盖他人创建的属性值。
2296
+ * @example 批量设置属性示例:
2297
+ * ```ts
2298
+ * const chatRoomId = 'chatroomId';
2299
+ * const options = { entries: [{ key: 'key', value: 'value' }] };
2300
+ * const res = await RongIMLib.setChatRoomEntries(chatRoomId, options);
2301
+ * console.log('批量设置属性结果:', res);
2302
+ * ```
1524
2303
  */
1525
2304
  declare function setChatRoomEntries(targetId: string, options: IChatroomEntries): Promise<IAsyncRes<void>>;
1526
2305
  /**
1527
- * 强制 增加/修改 任意聊天室属性
2306
+ * 强制设置单个属性
1528
2307
  * @category 聊天室
1529
- * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
2308
+ * @description 强制设置单个聊天室属性。可用于修改他人创建的属性值,以 key = value 的形式存储。当 key 不存在时,代表增加属性; 当 key 已经存在时,代表更新属性的值。使用强制设置可修改他人创建的属性值
2309
+ * @param targetId 聊天室 ID
2310
+ * @param options 设置聊天室属性配置参数,类型为 {@link IChatroomEntry}
2311
+ * @example 强制设置单个属性示例:
2312
+ * ```ts
2313
+ * const chatRoomId = 'chatroomId';
2314
+ * const options = {
2315
+ * key: 'key',
2316
+ * value: 'value',
2317
+ * };
2318
+ * const res = await RongIMLib.forceSetChatRoomEntry(chatRoomId, options);
2319
+ * console.log('强制设置单个属性结果:', res);
2320
+ * ```
1530
2321
  */
1531
- declare function forceSetChatRoomEntry(targetId: string, options: IChatRoomEntry): Promise<IAsyncRes<void>>;
2322
+ declare function forceSetChatRoomEntry(targetId: string, options: IChatroomEntry): Promise<IAsyncRes<void>>;
1532
2323
  /**
1533
- * 删除聊天室属性
2324
+ * 删除单个属性
1534
2325
  * @category 聊天室
1535
- * @description 仅限于删除自己设置的聊天室属性
1536
- * @param key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式,最大长度 128 字符
1537
- * @param isSendNotification? 删除成功后是否发送通知消息
1538
- * @param notificationExtra? RC:chrmKVNotiMsg 通知消息中携带的附加信息
2326
+ * @description 删除聊天室自定义属性。只可删除当前用户所创建的属性
2327
+ * @param targetId 聊天室 ID
2328
+ * @param options 删除聊天室属性配置参数,类型为 {@link IRemoveChatroomEntry}
2329
+ * @example 删除单个属性示例:
2330
+ * ```ts
2331
+ * const targetId = 'chatroomId';
2332
+ * const options = {
2333
+ * key: 'key',
2334
+ * };
2335
+ * const res = await RongIMLib.removeChatRoomEntry(targetId, options);
2336
+ * console.log('删除单个属性结果:', res);
2337
+ * ```
1539
2338
  */
1540
- declare function removeChatRoomEntry(targetId: string, options: IRemoveChatRoomEntry): Promise<IAsyncRes<void>>;
2339
+ declare function removeChatRoomEntry(targetId: string, options: IRemoveChatroomEntry): Promise<IAsyncRes<void>>;
1541
2340
  /**
1542
2341
  * 批量删除聊天室属性
1543
2342
  * @category 聊天室
1544
- * @description 仅限于删除自己设置的聊天室属性
1545
- * @param entries[] 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
1546
- * @param notificationExtra? RC:chrmKVNotiMsg 通知消息中携带的附加信息
2343
+ * @description 删除聊天室自定义属性。只可删除当前用户所创建的属性
2344
+ * @param targetId 聊天室 ID
2345
+ * @param options 删除聊天室属性配置参数
2346
+ * @example 批量删除聊天室属性示例:
2347
+ * ```ts
2348
+ * const targetId = 'chatroomId';
2349
+ * const options = {
2350
+ * entries: ['key'],
2351
+ * };
2352
+ * const res = await RongIMLib.removeChatRoomEntries(targetId, options);
2353
+ * console.log('批量删除聊天室属性结果:', res);
2354
+ * ```
1547
2355
  */
1548
2356
  declare function removeChatRoomEntries(targetId: string, options: {
1549
2357
  entries: string[];
1550
2358
  notificationExtra?: string;
1551
2359
  }): Promise<IAsyncRes<void>>;
1552
2360
  /**
1553
- * 强制删除聊天室内的任意属性
2361
+ * 强制删除
1554
2362
  * @category 聊天室
1555
- * @description
2363
+ * @description 强制删除聊天室自定义属性。可删除他人所创建的属性
2364
+ * @param targetId 聊天室 ID
2365
+ * @param options 删除聊天室属性配置参数,类型为 {@link IRemoveChatroomEntry}
2366
+ * @example 强制删除示例:
2367
+ * ```ts
2368
+ * const targetId = 'chatroomId';
2369
+ * const options = {
2370
+ * key: 'key',
2371
+ * };
2372
+ * const res = await RongIMLib.forceRemoveChatRoomEntry(targetId, options);
2373
+ * console.log('强制删除结果:', res);
2374
+ * ```
1556
2375
  */
1557
- declare function forceRemoveChatRoomEntry(targetId: string, options: IRemoveChatRoomEntry): Promise<IAsyncRes<void>>;
2376
+ declare function forceRemoveChatRoomEntry(targetId: string, options: IRemoveChatroomEntry): Promise<IAsyncRes<void>>;
1558
2377
  /**
1559
- * 获取聊天室的指定属性
2378
+ * 获取单个属性
2379
+ * @description 获取单个聊天室属性
1560
2380
  * @category 聊天室
2381
+ * @param targetId 聊天室 ID
2382
+ * @param key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2383
+ * @example 获取单个属性示例:
2384
+ * ```ts
2385
+ * const targetId = 'chatroomId';
2386
+ * const key = 'key';
2387
+ * const res = await RongIMLib.getChatRoomEntry(targetId, key);
2388
+ * console.log('获取单个属性结果:', res);
2389
+ * ```
1561
2390
  */
1562
2391
  declare function getChatRoomEntry(targetId: string,
1563
2392
  /**
@@ -1565,44 +2394,124 @@ declare function getChatRoomEntry(targetId: string,
1565
2394
  */
1566
2395
  key: string): Promise<IAsyncRes<string | number | boolean>>;
1567
2396
  /**
1568
- * 获取聊天室的所有属性
2397
+ * 获取所有属性
2398
+ * @description 获取聊天室所有属性
1569
2399
  * @category 聊天室
2400
+ * @param targetId 聊天室 ID
2401
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为一个对象,包含聊天室所有属性,格式为 { [key: string]: string | number | boolean }
2402
+ * @example 获取所有属性示例:
2403
+ * ```ts
2404
+ * const targetId = 'chatroomId';
2405
+ * const res = await RongIMLib.getAllChatRoomEntries(targetId);
2406
+ * console.log('获取所有属性结果:', res);
2407
+ * ```
1570
2408
  */
1571
2409
  declare function getAllChatRoomEntries(targetId: string): Promise<IAsyncRes<{
1572
2410
  [key: string]: string | number | boolean;
1573
2411
  }>>;
1574
2412
  /**
1575
2413
  * 获取聊天室的历史消息
2414
+ * @description 获取聊天室的历史消息接口要求开通`聊天室消息云端存储服务`。使用前请确认已开通服务。开通后聊天室历史消息保存在云端,默认保存 2 个月
1576
2415
  * @category 聊天室
2416
+ * @param targetId 聊天室 ID
2417
+ * @param options 获取历史消息配置参数,类型为 {@link GetHistoryMessageOption}
2418
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link GetHistoryMessageResult} 类型
2419
+ * @example 获取聊天室的历史消息示例:
2420
+ * ```ts
2421
+ * const chatRoomId = 'chatroomId';
2422
+ * const options = {
2423
+ * count: 10,
2424
+ * order: 1,
2425
+ * timestamp: 0,
2426
+ * };
2427
+ * const res = await RongIMLib.getChatroomHistoryMessages(chatRoomId, options);
2428
+ * console.log('获取聊天室的历史消息结果:', res);
2429
+ * ```
1577
2430
  */
1578
2431
  declare function getChatroomHistoryMessages(targetId: string, options: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
1579
2432
  /**
1580
- * 将聊天室和 RTC 房间绑定
2433
+ * 绑定音视频房间
2434
+ * @description 聊天室与音视频房间绑定成功后,只要音视频房间仍存在,则阻止聊天室自动销毁
2435
+ * * **适用场景**:
2436
+ * 聊天室具有自动销毁机制。在使用融云 RTC 业务的 App 中,可能配合使用 IM SDK 的聊天室业务实现直播聊天、弹幕、属性记录等功能。
2437
+ * 这种情况下,可以考虑将聊天室与音视频房间绑定,确保聊天室不会在语聊、直播结束前销毁,以免丢失关键数据。
2438
+ * @since 5.2.1
1581
2439
  * @category 聊天室
2440
+ * @param option 绑定音视频房间配置参数,类型为 {@link IRTCRoomBindOption}
2441
+ * @example
2442
+ * 绑定音视频房间示例:
2443
+ * ```ts
2444
+ * const option = {
2445
+ * chatRoomId: 'chatroomId',
2446
+ * rtcRoomId: 'rtcRoomId',
2447
+ * };
2448
+ * const res = await RongIMLib.bindRTCRoomForChatroom(option);
2449
+ * console.log('绑定音视频房间结果:', res);
2450
+ * ```
1582
2451
  */
1583
2452
  declare function bindRTCRoomForChatroom(option: IRTCRoomBindOption): Promise<IAsyncRes<void>>;
1584
2453
 
1585
2454
  /**
1586
- * 添加用户到黑名单
2455
+ * 加入黑名单
2456
+ * @description 本功能暂仅限于在 Electron 解决方案中使用,将用户加入黑名单之后,将不再收到对方发来的任何单聊消息
2457
+ * * **注意**:
2458
+ * 1. 加入黑名单为单向操作,例如:用户 A 拉黑用户 B,代表 B 无法给 A 发消息(错误码 405)。但 A 向 B 发消息,B 仍然能正常接收
2459
+ * 2. 单个用户的黑名单总人数存在上限,具体与计费套餐有关。IM 旗舰版与 IM 尊享版上限为 3000 人,其他套餐详见功能对照表中的服务限制
2460
+ * 3. 调用服务端 API 发送单聊消息默认不受黑名单限制。如需启用限制,请在调用 API 时设置 verifyBlacklist 为 1
2461
+ * @since 5.4.0
1587
2462
  * @category 黑名单
1588
2463
  * @param userId 用户 ID
2464
+ * @example
2465
+ * 加入黑名单示例:
2466
+ * ```ts
2467
+ * const userId = 'userId';
2468
+ * const res = await RongIMLib.addToBlacklist(userId);
2469
+ * console.log('加入黑名单结果:', res);
2470
+ * ```
1589
2471
  */
1590
2472
  declare function addToBlacklist(userId: string): Promise<IAsyncRes<void>>;
1591
2473
  /**
1592
- * 从黑名单中移除用户
2474
+ * 移出黑名单
2475
+ * @description 本功能暂仅限于在 Electron 解决方案中使用, 将用户移出黑名单之后,将恢复接收对方发来的任何单聊消息
2476
+ * @since 5.4.0
1593
2477
  * @category 黑名单
1594
2478
  * @param userId 用户 ID
2479
+ * @example
2480
+ * 移出黑名单示例:
2481
+ * ```ts
2482
+ * const userId = 'userId';
2483
+ * const res = await RongIMLib.removeFromBlacklist(userId);
2484
+ * console.log('移出黑名单结果:', res);
2485
+ * ```
1595
2486
  */
1596
2487
  declare function removeFromBlacklist(userId: string): Promise<IAsyncRes<void>>;
1597
2488
  /**
1598
2489
  * 获取黑名单列表
2490
+ * @description 本功能暂仅限于在 Electron 解决方案中使用,用来获取黑名单列表
2491
+ * @since 5.4.0
1599
2492
  * @category 黑名单
2493
+ * @param userId 用户 ID
2494
+ * @example
2495
+ * 获取黑名单列表示例:
2496
+ * ```ts
2497
+ * const res = await RongIMLib.getBlacklist();
2498
+ * console.log('获取黑名单列表结果:', res);
2499
+ * ```
1600
2500
  */
1601
2501
  declare function getBlacklist(): Promise<IAsyncRes<string[]>>;
1602
2502
  /**
1603
2503
  * 查询用户是否在黑名单中
2504
+ * @description 本功能暂仅限于在 Electron 解决方案中使用,用来查询用户是否在黑名单中
2505
+ * @since 5.4.0
1604
2506
  * @category 黑名单
1605
2507
  * @param userId 用户 ID
2508
+ * @example
2509
+ * 获取黑名单列表示例:
2510
+ * ```ts
2511
+ * const userId = 'userId';
2512
+ * const res = await RongIMLib.getBlacklistStatus(userId);
2513
+ * console.log('获取黑名单列表结果:', res);
2514
+ * ```
1606
2515
  */
1607
2516
  declare function getBlacklistStatus(userId: string): Promise<IAsyncRes<boolean>>;
1608
2517
 
@@ -1634,7 +2543,7 @@ interface IImageMessageBody extends IExtraData, IMentionedInfo, IUserInfo, IAudi
1634
2543
  declare const _default$e: MessageConstructor<IImageMessageBody>;
1635
2544
 
1636
2545
  /**
1637
- * 图片消息
2546
+ * 语音消息
1638
2547
  * @category Interface
1639
2548
  */
1640
2549
  interface IHQVoiceMessageBody extends IUserInfo, IExtraData, IMentionedInfo, IAuditInfo {
@@ -1695,7 +2604,7 @@ interface ITextMessageBody extends IUserInfo, IExtraData, IMentionedInfo, IAudit
1695
2604
  declare const _default$b: MessageConstructor<ITextMessageBody>;
1696
2605
 
1697
2606
  /**
1698
- * 富文本消息
2607
+ * 合并转发消息
1699
2608
  * @category Interface
1700
2609
  */
1701
2610
  interface ICombineMessageBody extends IExtraData, IUserInfo, IMentionedInfo {
@@ -1718,6 +2627,11 @@ interface ICombineMessageBody extends IExtraData, IUserInfo, IMentionedInfo {
1718
2627
  }
1719
2628
  declare const _default$a: MessageConstructor<ICombineMessageBody>;
1720
2629
 
2630
+ /**
2631
+ * 合并消息
2632
+ * @category Type
2633
+ * @hidden
2634
+ */
1721
2635
  declare type CombineV2MessageContent = ICombineV2MessageContent & IExtraData & IUserInfo & IMentionedInfo;
1722
2636
  declare const _default$9: MessageConstructor<CombineV2MessageContent>;
1723
2637
 
@@ -1779,6 +2693,7 @@ interface IVoiceMessageBody extends IExtraData, IMentionedInfo, IUserInfo, IAudi
1779
2693
  declare const _default$6: MessageConstructor<IVoiceMessageBody>;
1780
2694
 
1781
2695
  /**
2696
+ * 本地消息
1782
2697
  * @category Interface
1783
2698
  */
1784
2699
  interface ILocationMessageBody extends IExtraData, IMentionedInfo, IUserInfo {
@@ -1802,6 +2717,7 @@ interface ILocationMessageBody extends IExtraData, IMentionedInfo, IUserInfo {
1802
2717
  declare const _default$5: MessageConstructor<ILocationMessageBody>;
1803
2718
 
1804
2719
  /**
2720
+ * 引用消息
1805
2721
  * @category Interface
1806
2722
  */
1807
2723
  interface IReferenceMessageBody extends IExtraData, IMentionedInfo, IUserInfo, IAuditInfo {
@@ -1835,6 +2751,7 @@ interface IArticle {
1835
2751
  url: string;
1836
2752
  }
1837
2753
  /**
2754
+ * 富文本消息
1838
2755
  * @category Interface
1839
2756
  */
1840
2757
  interface IRichContentMessageBody extends IArticle, IExtraData, IMentionedInfo, IUserInfo {
@@ -1903,40 +2820,165 @@ declare const _default: MessageConstructor<IGroupNotificationMessageBody>;
1903
2820
 
1904
2821
  /**
1905
2822
  * 发送消息
2823
+ * @description 发送消息的基础接口,可用来发送 IMLib 中的内置类型消息或自定义消息。针对不同的特定消息类型
1906
2824
  * @category 消息
1907
- * @param options
2825
+ * @param conversation 会话信息
2826
+ * @param message 消息体,类型为 BaseMessage 的子类,如 TextMessage、ImageMessage,通过 new TextMessage() 获取
2827
+ * @param options 发送消息配置项
2828
+ *
2829
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2830
+ *
2831
+ * @example
2832
+ * 发送文本消息示例:
2833
+ * ```ts
2834
+ * const content = {content: 'hello world'};
2835
+ * const message = new RongIMLib.TextMessage(content);
2836
+ * const conversation = {
2837
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2838
+ * targetId: 'targetId'
2839
+ * }
2840
+ * const sendRes = await RongIMLib.sendMessage(conversation, message);
2841
+ * console.info('消息发送结果:', sendRes);
2842
+ * ```
1908
2843
  */
1909
2844
  declare function sendMessage(conversation: IConversationOption, message: BaseMessage, options?: ISendMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
1910
2845
  /**
1911
- * 发送文本消息
1912
- * @category 消息
1913
- */
2846
+ * 发送文本消息
2847
+ * @description 发送文本消息的快捷方式,等同于使用 new TextMessage() 创建消息体后调用 sendMessage() 方法
2848
+ * @category 消息
2849
+ * @param conversation 会话信息
2850
+ * @param messageBody 消息体
2851
+ * @param options 发送消息配置项
2852
+ *
2853
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2854
+ *
2855
+ * @example
2856
+ * 发送文本消息示例:
2857
+ * ```ts
2858
+ * const messageBody = {content: 'hello world'};
2859
+ * const conversation = {
2860
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2861
+ * targetId: 'targetId'
2862
+ * }
2863
+ * const sendRes = await RongIMLib.sendTextMessage(conversation, messageBody);
2864
+ * console.info('消息发送结果:', sendRes);
2865
+ * ```
2866
+ */
1914
2867
  declare function sendTextMessage(conversation: IConversationOption, messageBody: ITextMessageBody, options?: ISendMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
2868
+ /**
2869
+ * 发送消息基础类型
2870
+ * @category Type
2871
+ */
1915
2872
  declare type ISendBody = IUserInfo & IExtraData & {
1916
2873
  file: File;
1917
2874
  } & IMentionedInfo & IAuditInfo;
1918
- declare type ISendFileMessageOptions = ISendBody;
1919
2875
  /**
1920
- * 发送文件消息
1921
- * @category 消息
2876
+ * 发送文件消息配置项
2877
+ * @category Type
1922
2878
  */
2879
+ declare type ISendFileMessageOptions = ISendBody;
2880
+ /**
2881
+ * 发送文件消息
2882
+ * @description 发送文件消息的快捷方式,等同于使用 new FileMessage() 创建消息体后调用 sendMessage() 方法,支持文件上传,上传成功后自动发送消息
2883
+ * @category 消息
2884
+ * @param conversation 会话信息
2885
+ * @param msgBody 消息体,其中 file 为待上传文件引用
2886
+ * @param hooks 上传文件过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2887
+ * @param sendOptions 文件消息配置项,类型为 {@link IUploadMessageOption} 可选
2888
+ *
2889
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2890
+ *
2891
+ * @example
2892
+ * 发送文本消息示例:
2893
+ * ```ts
2894
+ * const msgBody = { file }; // file 为待上传文件
2895
+ * const conversation = {
2896
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2897
+ * targetId: 'targetId'
2898
+ * }
2899
+ * const sendRes = await RongIMLib.sendFileMessage(conversation, msgBody);
2900
+ * console.info('消息发送结果:', sendRes);
2901
+ * ```
2902
+ */
1923
2903
  declare const sendFileMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
2904
+ /**
2905
+ * 发送图片消息配置项
2906
+ * @category Type
2907
+ */
1924
2908
  declare type ISendImageMessageOptions = ISendBody;
1925
2909
  /**
1926
2910
  * 发送图片消息
2911
+ * @description 发送图片消息的快捷方式,等同于使用 new ImageMessage() 创建消息体后调用 sendMessage() 方法,支持图片上传,上传成功后自动发送消息
1927
2912
  * @category 消息
2913
+ * @param conversation 会话信息
2914
+ * @param msgBody 消息体,其中 file 为待上传图片引用
2915
+ * @param hooks 上传图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2916
+ * @param sendOptions 图片消息配置项,类型为 {@link IImageMessageOption} 可选
2917
+ *
2918
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2919
+ * @example
2920
+ * 发送图片消息示例:
2921
+ * ```ts
2922
+ * const msgBody = { file }; // file 为待上传图片
2923
+ * const conversation = {
2924
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2925
+ * targetId: 'targetId'
2926
+ * }
2927
+ * const sendRes = await RongIMLib.sendImageMessage(conversation, msgBody);
2928
+ * console.info('消息发送结果:', sendRes);
2929
+ * ```
1928
2930
  */
1929
2931
  declare const sendImageMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IImageMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
1930
2932
  /**
1931
- * 发送 GIF图片消息
2933
+ * 发送 GIF 图片消息
2934
+ * @description 发送 GIF 图片消息的快捷方式,等同于使用 new GIFMessage() 创建消息体后调用 sendMessage() 方法,支持 GIF 图片上传,上传成功后自动发送消息
1932
2935
  * @category 消息
2936
+ * @param conversation 会话信息
2937
+ * @param msgBody 消息体,其中 file 为待上传 GIF 图片引用
2938
+ * @param hooks 上传 GIF 图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2939
+ * @param sendOptions GIF 图片消息配置项,类型为 {@link IGIFMessageOption} 可选
2940
+ *
2941
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2942
+ * @example
2943
+ * 发送 GIF 图片消息示例:
2944
+ * ```ts
2945
+ * const msgBody = { file }; // file 为待上传 GIF 图片
2946
+ * const conversation = {
2947
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2948
+ * targetId: 'targetId'
2949
+ * }
2950
+ * const sendRes = await RongIMLib.sendGIFMessage(conversation, msgBody);
2951
+ * console.info('消息发送结果:', sendRes);
2952
+ * ```
1933
2953
  */
1934
2954
  declare const sendGIFMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
1935
2955
  /**
1936
- * 发送高清语音消息,待发送的文件必须为 AAC 音频文件
2956
+ * 发送高清语音消息
2957
+ * @description 待发送的文件必须为 AAC 音频文件。
2958
+ * 发送高清语音消息的快捷方式,等同于使用 new HQVoiceMessage() 创建消息体后调用 sendMessage() 方法,支持高清语音上传,上传成功后自动发送消息
1937
2959
  * @category 消息
2960
+ * @param conversation 会话信息
2961
+ * @param msgBody 消息体,其中 file 为待上传高清语音引用
2962
+ * @param hooks 上传高清语音过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2963
+ * @param sendOptions 高清语音消息配置项,类型为 {@link ISendHQVoiceMessageOptions} 可选
2964
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2965
+ * @example
2966
+ * 发送高清语音消息示例:
2967
+ * ```ts
2968
+ * const msgBody = { file }; // file 为待上传高清语音
2969
+ * const conversation = {
2970
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2971
+ * targetId: 'targetId'
2972
+ * }
2973
+ * const sendRes = await RongIMLib.sendHQVoiceMessage(conversation, msgBody);
2974
+ * console.info('消息发送结果:', sendRes);
2975
+ * ```
1938
2976
  */
1939
2977
  declare const sendHQVoiceMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
2978
+ /**
2979
+ * 发送小视频消息配置项
2980
+ * @category Type
2981
+ */
1940
2982
  declare type ISendSightMessageOptions = {
1941
2983
  duration: number;
1942
2984
  thumbnail: string;
@@ -1945,64 +2987,175 @@ declare type ISendSightMessageOptions = {
1945
2987
  /**
1946
2988
  * 发送小视频消息
1947
2989
  * @category 消息
1948
- * @description 发送的小视频消息必须是 MP4 文件,且音频编码为 AAC,视频编码 H264,否则可能造成 iOS 或 Android 接收后不可播放问题
2990
+ * @description 发送的小视频消息必须是 MP4 文件,且音频编码为 AAC,视频编码 H264,否则可能造成 iOS 或 Android 接收后不可播放问题。
2991
+ * 发送小视频消息的快捷方式,等同于使用 new SightMessage() 创建消息体后调用 sendMessage() 方法,支持小视频上传,上传成功后自动发送消息
2992
+ * @param conversation 会话信息
2993
+ * @param msgBody 消息体,其中 file 为待上传小视频引用
2994
+ * @param hooks 上传小视频过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2995
+ * @param sendOptions 小视频消息配置项,类型为 {@link ISendSightMessageOptions} 可选
2996
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2997
+ * @example
2998
+ * 发送小视频消息示例:
2999
+ * ```ts
3000
+ * const msgBody = { file, duration: 10, thumbnail: 'base64' }; // file 为待上传小视频,duration 为小视频时长,thumbnail 为小视频封面 base64
3001
+ * const conversation = {
3002
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3003
+ * targetId: 'targetId'
3004
+ * }
3005
+ * const sendRes = await RongIMLib.sendSightMessage(conversation, msgBody);
3006
+ * console.info('消息发送结果:', sendRes);
3007
+ * ```
1949
3008
  */
1950
3009
  declare const sendSightMessage: (conversation: IConversationOption, msgBody: ISendSightMessageOptions, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
1951
3010
  /**
1952
3011
  * 获取历史消息
1953
- * Electron 获取的是本地数据库
1954
- * Web 获取的是远端历史消息
1955
3012
  * @category 消息
3013
+ * @description 获取历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
3014
+ * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
3015
+ * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
3016
+ * * **注意**:
3017
+ * 1. Electron 获取的是本地数据库
3018
+ * 2. Web 获取的是远端历史消息,Web 端不具备持久化的数据存储能力,无法在本地持久化存储历史消息记录与会话列表,因此需要从融云服务端获取数据。
3019
+ * 3. 请确保已开通单群聊消息云端存储服务,如未开通服务请移步到融云开发者后台的 IM 服务管理模块开启。
3020
+ * @param conversation 会话信息
3021
+ * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
3022
+ * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
3023
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link GetHistoryMessageResult} 类型
3024
+ *
3025
+ * @example
3026
+ * 获取历史消息示例:
3027
+ * ```ts
3028
+ * const conversation = {
3029
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3030
+ * targetId: 'targetId',
3031
+ * }
3032
+ * const messages = await RongIMLib.getHistoryMessages(conversation);
3033
+ * console.info('获取历史消息结果:', messages);
1956
3034
  */
1957
3035
  declare function getHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
1958
3036
  /**
1959
3037
  * 获取远程历史消息
1960
3038
  * @category 消息
3039
+ * @description 获取远程历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
3040
+ * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
3041
+ * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
3042
+ * * **注意**:
3043
+ * 需要开启单群聊消息云存储服务后,才可以从远端拉取历史消息,服务请移步到融云开发者后台的 IM 服务管理模块开启。
3044
+ *
3045
+ * @param conversation 会话信息
3046
+ * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
3047
+ * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
3048
+ *
3049
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link GetHistoryMessageResult} 类型
3050
+ * @example
3051
+ * 获取远程历史消息示例:
3052
+ * ```ts
3053
+ * const conversation = {
3054
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3055
+ * targetId: 'targetId',
3056
+ * }
3057
+ * const messages = await RongIMLib.getRemoteHistoryMessages(conversation);
3058
+ * console.info('获取远程历史消息结果:', messages);
1961
3059
  */
1962
3060
  declare function getRemoteHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
1963
3061
  /**
1964
3062
  * 发送单聊已读回执
3063
+ * @description 发送单聊已读回执,用于标记已读消息
3064
+ * * **实现已读功能步骤:**
3065
+ * 1. 在用户查看了某单聊会话的未读消息后,调用 sendReadReceiptMessage 发送已读回执。
3066
+ * 2. 通过 addEventListener 设置消息回执监听器。
3067
+ * 3. SDK 在收到消息已读回执时派发 READ_RECEIPT_RECEIVED 事件。
3068
+ *
3069
+ * * **注意**:
3070
+ * 1. 在 Web 平台,SDK 不会记录每个会话和消息的已读状态,您需要在 localStorage 中记录每个会话的已读时间。在渲染消息列表时,根据 localStorage 中时间判断消息是否已读,更新对应的消息界面。
3071
+ * 2. 在 Electron 平台,收到 READ_RECEIPT_RECEIVED 通知时,您需要调用
3072
+ * {@link electronExtension.setMessageStatusToRead} 方法更新消息已读状态,并更新对应的消息界面。
3073
+ * 3. 调用 `sendReadReceiptMessage` 接口不会清除未读数,需单独调用清除未读数接口 {@link clearMessagesUnreadStatus}。
3074
+ *
3075
+ * @param targetId 目标 ID
3076
+ * @param messageUId 消息唯一标识,可在 Message 中获取
3077
+ * @param timestamp 消息的发送时间,可通过 Message 中 sendTime 获取
1965
3078
  * @category 消息
3079
+ * @example
3080
+ * 单聊消息回执示例:
3081
+ * ```ts
3082
+ * const targetId = 'targetId';
3083
+ * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
3084
+ * const timestamp = 1632728573423;
3085
+ *
3086
+ * const readReceiptRes = await RongIMLib.sendReadReceiptMessage(targetId, messageUId, timestamp);
3087
+ * console.info('单聊消息回执:', readReceiptRes)
3088
+ * ```
1966
3089
  */
1967
3090
  declare function sendReadReceiptMessage(targetId: string, messageUId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<void>>;
1968
3091
  /**
1969
3092
  * 发送群已读回执请求
3093
+ * @description 实现群聊中按需获取己方发送消息的阅读状态请求。与群聊已读回执响应接口 {@link sendReadReceiptResponseV2} 配套使用。单独调用无法实现群回执能力
3094
+ *
1970
3095
  * @category 消息
3096
+ * @param targetId 目标 ID
1971
3097
  * @param messageUIds 消息UID列表
3098
+ *
3099
+ *@example
3100
+ * 群已读回执请求示例:
3101
+ * ```ts
3102
+ * const targetId = 'targetId';
3103
+ * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
3104
+ * const readReceiptRes = await RongIMLib.sendReadReceiptRequest(targetId, messageUId);
3105
+ * console.info('群已读回执请求:', readReceiptRes)
3106
+ * ```
1972
3107
  */
1973
3108
  declare function sendReadReceiptRequest(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<void>>;
1974
3109
  /**
1975
3110
  * @category 消息
1976
- * @deprecated 已废弃,请使用 sendReadReceiptResponseV2
3111
+ * @deprecated 已废弃,@since 5.1.1。请替换使用 {@link sendReadReceiptResponseV2} 方法
1977
3112
  */
1978
3113
  declare function sendReadReceiptResponse(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes<void>>;
1979
3114
  /**
1980
3115
  * 发送群阅读回执响应V2
3116
+ * @description 实现群聊中按需获取己方发送消息的阅读状态响应。
3117
+ * 与群聊已读回执请求接口 {@link sendReadReceiptRequest} 配套使用。单独调用无法实现群回执能力
3118
+ * * **注意**:
3119
+ * 5.9.4 版本之后,SDK 内部维护了已读回执请求信息,并在历史消息列表里携带已读回执信息:readReceiptInfo, 在 Web 平台和 Electron 平台实现不同之处:
3120
+ * Web 和 Electron 平台的区别:
3121
+ * 1. 在 Web 平台,SDK 内部会缓存每个群会话的最新 30 个已读回执信息(以已读回执请求的发送时间为准),缓存有效期为 24H。
3122
+ * 在发送消息回执响应时无需传 messageList 字段,SDK 会把该会话下的所有请求组织好然后发送响应。
3123
+ *
3124
+ * 2. 在 Electron 平台,用户需先获取历史消息,取出 message.messageDirection = MessageDirection.RECEIVE , readReceiptInfo.
3125
+ * isReceiptRequestMessage = true 并且 readReceiptInfo.hasRespond = false 的数据组织成参数 messageList 来发送回执响应。
1981
3126
  * @category 消息
1982
- * @param targetId 群组Id
1983
- * @param messageList 要回执的消息列表,结构为: \{senderUserId: [messageUId1, messageUId2]\}
1984
- * @param channelId
3127
+ * @param targetId 群组Id
3128
+ * @param messageList 要回执的消息列表,结构为: \{senderUserId: [messageUId1, messageUId2]\}
3129
+ * @since 5.1.1
3130
+ * @example
3131
+ * 群已读回执响应示例:
3132
+ * ```ts
3133
+ * const targetId = 'targetId';
3134
+ * const messageList = {
3135
+ * 'senderUserId': ['messageUId1', 'messageUId2'],
3136
+ * }
3137
+ * const readReceiptRes = await RongIMLib.sendReadReceiptResponseV2(targetId, messageList);
3138
+ * console.info('群已读回执响应:', readReceiptRes);
1985
3139
  */
1986
3140
  declare function sendReadReceiptResponseV2(targetId: string, messageList?: {
1987
3141
  [senderUserId: string]: string[];
1988
3142
  }, channelId?: string): Promise<IAsyncRes<void>>;
1989
3143
  /**
1990
3144
  * 多端同步阅读状态
3145
+ * @description 由于未读消息数存储在本地,服务器不存未读消息数量。当用户多端登录时,需要同步未读消息数以保证多端未读数一致
1991
3146
  * @param conversation 会话信息
1992
- * @param timestamp 时间戳
3147
+ * @param timestamp 需要同步消息阅读的时间戳,可以在消息体中通过消息的 sendTime 获取
3148
+ * @category 消息
1993
3149
  * @example
1994
- * ```js
1995
- * const con = {
1996
- * conversationType: ConversationType.Group,
1997
- * targetId: 'targetId'
3150
+ * 多端同步阅读状态示例:
3151
+ * ```ts
3152
+ * const conversation = {
3153
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3154
+ * targetId: 'targetId',
1998
3155
  * }
1999
- * sendSyncReadStatusMessage(con, Date.now()).then(res => {
2000
- * if (res.code === ErrorCode.success) {
2001
- * console.log('send success', res.data)
2002
- * } else {
2003
- * console.log('send error', res.msg)
2004
- * }
2005
- * })
3156
+ * const timestamp = 1632728573423; // 阅读消息的 sendTime
3157
+ * const syncReadStatusRes = await RongIMLib.sendSyncReadStatusMessage(conversation, timestamp);
3158
+ * console.info('多端同步阅读状态:', syncReadStatusRes);
2006
3159
  * ```
2007
3160
  */
2008
3161
  declare function sendSyncReadStatusMessage(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
@@ -2040,7 +3193,7 @@ declare function sendReadReceiptMessageV4(conversation: IConversationOption, end
2040
3193
  * @since 5.9.0
2041
3194
  * @hidden
2042
3195
  * @param conversation 会话信息, 仅支持群聊
2043
- * @param messageUid 消息 UId
3196
+ * @param messageUId 消息 UId
2044
3197
  * @example
2045
3198
  * ```js
2046
3199
  * const con = {
@@ -2083,13 +3236,54 @@ declare function getMessageReadReceiptV4(conversation: IConversationOption, mess
2083
3236
  declare function batchGetMessageReadReceiptInfoV4(conversation: IConversationOption, messageUIds: string[]): Promise<IAsyncRes<IGroupReadReceiptData[]>>;
2084
3237
  /**
2085
3238
  * 撤回消息
3239
+ * @description 融云对撤回消息的操作者不作限制。
3240
+ * 如需避免用户撤回非本人发送的消息,可以提交工单申请打开IMLib SDK 只允许撤回自己发送的消息。从融云服务端进行限制,禁止用户撤回非本人发送的消息。
2086
3241
  * @category 消息
2087
- * @param options
3242
+ * @param conversation 会话信息
3243
+ * @param options 撤回消息参数
3244
+ * @example
3245
+ * 撤回消息示例:
3246
+ * ```ts
3247
+ * const conversation = {
3248
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3249
+ * targetId: 'targetId',
3250
+ * }
3251
+ * const options = {
3252
+ * messageUId: 'messageUId',
3253
+ * sentTime: 1632728573423,
3254
+ * }
3255
+ * const recallRes = await RongIMLib.recallMessage(conversation, options);
3256
+ * console.info('撤回消息结果:', recallRes);
3257
+ * ```
3258
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2088
3259
  */
2089
3260
  declare function recallMessage(conversation: IConversationOption, options: IRecallMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
2090
3261
  /**
2091
3262
  * 按消息 UId 删除消息
2092
3263
  * @category 消息
3264
+ * @description 根据消息的 ID、时间戳和方向(发送或接收)从服务端删除指定单个会话中的一条或一组消息。
3265
+ * * **注意**:
3266
+ * 1. 删除消息仅会删除本端消息,不会删除对端消息。A 与 B 之间的消息,A 删除消息后,B 仍然可以看到消息。如 B 需要无法查看需要调用撤回消息 {@link recallMessage}接口。
3267
+ * 2. 仅适用于 App Key 已开通单群聊消息云端存储 的 App。
3268
+ * 3. 服务端默认不会删除对应的离线消息补偿,如需彻底删除消息补偿,请提交工单,申请开通删除服务端历史消息时同时删除多端补偿的离线消息。
3269
+ *
3270
+ * @param conversation 会话信息
3271
+ * @param messages 消息列表
3272
+ * @example
3273
+ * 按消息 UId 删除消息示例:
3274
+ * ```ts
3275
+ * const conversation = {
3276
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3277
+ * targetId: 'targetId',
3278
+ * };
3279
+ * const messages = [{
3280
+ * messageUId: 'BS4O-P5AO-D1O6-9GPP', // 消息 UId
3281
+ * sentTime: 1632728573423, // 消息发送时间
3282
+ * messageDirection: RongIMLib.MessageDirection.SEND, // 消息方向
3283
+ * }];
3284
+ * const deleteRes = await RongIMLib.deleteMessages(conversation, messages);
3285
+ * console.info('删除消息结果:', deleteRes);
3286
+ * ```
2093
3287
  */
2094
3288
  declare function deleteMessages$1(conversation: IConversationOption, messages: {
2095
3289
  /**
@@ -2109,23 +3303,37 @@ declare function deleteMessages$1(conversation: IConversationOption, messages: {
2109
3303
  }[]): Promise<IAsyncRes<void>>;
2110
3304
  /**
2111
3305
  * 按时间戳删除消息
3306
+ * @description 根据时间戳删除指定单个会话中早于(含)指定时间戳的所有消息。
2112
3307
  * @category 消息
2113
3308
  * @param conversation 会话
2114
3309
  * @param timestamp 清除时间点, 该时间之前的消息将被清除
3310
+ *
3311
+ * @example
3312
+ * 按时间戳删除消息示例:
3313
+ * ```ts
3314
+ * const conversation = {
3315
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3316
+ * targetId: 'targetId',
3317
+ * }
3318
+ * const timestamp = 1632728573423;
3319
+ * const clearRes = await RongIMLib.clearHistoryMessages(conversation, timestamp);
3320
+ * console.info('清除消息结果:', clearRes);
3321
+ * ```
2115
3322
  */
2116
3323
  declare function clearHistoryMessages(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
2117
3324
  /**
3325
+ * @hidden
2118
3326
  * 批量删除多个会话的远端消息
3327
+ * @category 消息
3328
+ * @description 批量删除服务端多个会话早于(含)发送时间的所有远端消息(Electron 平台可以删除对应的本地消息)
2119
3329
  * @param conversations 会话列表,最大数量为 20
2120
3330
  * @param isDeleteLocal 是否删除本地消息, 仅 Electron 平台支持,默认为 false
2121
- * @category 消息
2122
3331
  * @since 5.9.0
2123
- * @hidden
2124
- * @description 批量删除服务端多个会话早于(含)发送时间的所有远端消息(Electron 平台可以删除对应的本地消息),
2125
3332
  * 时间戳,传 0 清除所有消息
2126
3333
  * 支持的会话类型:单聊, 群聊, 聊天室, 系统消息
2127
3334
  * @example
2128
- * ```js
3335
+ * 批量删除多个会话的远端消息示例:
3336
+ * ```ts
2129
3337
  * batchClearHistoryMessages([
2130
3338
  * {
2131
3339
  * conversationType: ConversationType.PRIVATE,
@@ -2140,91 +3348,190 @@ declare function clearHistoryMessages(conversation: IConversationOption, timesta
2140
3348
  declare function batchClearRemoteHistoryMessages(clearMessageOption: IClearMessageOption[], isDeleteLocal?: boolean): Promise<IAsyncRes<void>>;
2141
3349
  /**
2142
3350
  * 更新(添加、替换)消息扩展属性
3351
+ * @description 消息扩展功能可为消息增加基于 Key/Value 的状态标识。消息的扩展信息可在发送前、后设置或更新,可用于实现消息评论、礼物领取、订单状态变化等业务需求。
3352
+ * * **注意**:
3353
+ * 1. 单条消息单次最多可设置 20 个扩展信息 KV 对,总计不可超过 300 个扩展信息 KV 对。
3354
+ * 2. 消息扩展(Key、Value 扩展信息)会被存储。如已开通历史消息云存储功能,从服务端获取的历史消息也会携带已设置的扩展信息。
3355
+ * 3. 仅支持单聊、群聊会话类型,不支持聊天室类型。
3356
+ * 4. 仅当发送消息时指定 canIncludeExpansion 值为 true,才可对消息进行拓展。
2143
3357
  * @category 消息
2144
3358
  * @param expansion 要更新的消息扩展信息键值对
2145
3359
  * @param message 要更新的原始消息体
3360
+ *
3361
+ * @example
3362
+ * 更新(添加、替换)消息扩展属性示例:
3363
+ * ```ts
3364
+ * const expansion = { key1: 'value1' };
3365
+ * // message 为 IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
3366
+ * const updateRes = await RongIMLib.updateMessageExpansion(expansion, message);
3367
+ * console.info('更新消息扩展属性结果:', updateRes);
3368
+ * ```
2146
3369
  */
2147
3370
  declare function updateMessageExpansion(expansion: {
2148
3371
  [key: string]: any;
2149
3372
  }, message: IAReceivedMessage): Promise<IAsyncRes<void>>;
2150
3373
  /**
2151
3374
  * 删除扩展存储
3375
+ * @description 删除消息扩展信息中指定的 Key
2152
3376
  * @category 消息
2153
3377
  * @params keys 需删除消息扩展的 keys
2154
3378
  * @params message 原始消息体
3379
+ * @example
3380
+ * 删除扩展存储示例:
3381
+ * ```ts
3382
+ * const keys = ['key1'];
3383
+ * // message 为 IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
3384
+ * const removeRes = await RongIMLib.removeMessageExpansionForKey(keys, message);
3385
+ * console.info('删除扩展存储结果:', removeRes);
3386
+ * ```
2155
3387
  */
2156
3388
  declare function removeMessageExpansionForKey(keys: string[], message: IAReceivedMessage): Promise<IAsyncRes<void>>;
2157
3389
  /**
2158
- * 发送typing消息
3390
+ * 发送输入状态消息
3391
+ * @description 发送输入状态消息,用于展示对方正在输入的状态
2159
3392
  * @category 消息
3393
+ * @param conversation 会话信息
2160
3394
  * @param typingContentType 输入状态消息类型
2161
- * @returns
3395
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3396
+ *
3397
+ * @example
3398
+ * 发送输入状态消息示例:
3399
+ * ```ts
3400
+ * const conversation = {
3401
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3402
+ * targetId: 'targetId',
3403
+ * }
3404
+ * const typingContentType = RongIMLib.MessageType.TEXT;
3405
+ * const typingRes = await RongIMLib.sendTypingStatusMessage(conversation, typingContentType);
3406
+ * console.info('发送typing消息结果:', typingRes);
3407
+ * ```
2162
3408
  */
2163
3409
  declare function sendTypingStatusMessage(conversation: IConversationOption, typingContentType: string): Promise<IAsyncRes<IAReceivedMessage>>;
2164
3410
  /**
2165
3411
  * 获取群已读列表
2166
3412
  * @category 消息
3413
+ * @param targetId 群 ID
2167
3414
  * @param messageUId 消息UID
2168
- * @returns
3415
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IMessageReaderResponse} 类型
3416
+ * @example
3417
+ * ```ts
3418
+ * const messageUId = 'messageUId';
3419
+ * const targetId = 'targetId';
3420
+ * const getReaderRes = await RongIMLib.getMessageReader(targetId, messageUId);
3421
+ * console.info('获取群已读列表结果:', getReaderRes);
3422
+ * ```
2169
3423
  */
2170
- declare function getMessageReader(targetId: string, messageUId: string, channelId: string): Promise<IAsyncRes<IMessageReaderResponse>>;
3424
+ declare function getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
2171
3425
  /**
2172
3426
  * 注册自定义消息
3427
+ * @description 注册自定义消息,用于定义自定义消息的类型,会影响消息的发送和接收
3428
+ * * **注意**:
3429
+ * 1. 注册自定义消息代码必须在发送、接收该自定义消息之前
3430
+ * 2. 推荐将所有注册自定义消息代码放在 init 方法之后, connect 方法之前
3431
+ * 3. 注册的消息类型名, 必须多端一致, 否则消息无法互通
3432
+ * 4. 请勿使用 RC: 开头的类型名,以免和 SDK 默认的消息名称冲突,自定义消息的消息类型名如和 SDK 默认的消息类型名相同以 SDK 默认的消息定义名为准
3433
+ * 5. 需要再 connect 之前调用防止手消息行为异常
2173
3434
  * @category 消息
2174
3435
  * @param messageType 消息类型
2175
3436
  * @param isPersited 是否存储
2176
3437
  * @param isCounted 是否计数
2177
- * @param searchProps 可搜索的属性
2178
- * @param isStatusMessage 是否状态消息,状态消息不计数,不存储,仅在线能收到
3438
+ * @param searchProps 可搜索的属性,web 端无需设置,搜索字段值设置为数字时取值范围为 (-Math.pow(2, 64), Math.pow(2, 64)) 且为整数
3439
+ * @param isStatusMessage 是否状态消息,状态消息不计数,不存储,接收方在线时才能收到
3440
+ * @returns 返回一个 {@link BaseMessage} 类型的构造函数
3441
+ * @example
3442
+ * ```ts
3443
+ * const messageType = 'CustomMessage';
3444
+ * const isPersited = true;
3445
+ * const isCounted = true;
3446
+ * const searchProps = ['content']; // 搜索字段
3447
+ * const isStatusMsg = false;
3448
+ * const CustomMessage = RongIMLib.registerMessageType(messageType, isPersited, isCounted, searchProps, isStatusMsg);
3449
+ * ```
2179
3450
  */
2180
3451
  declare function registerMessageType<T>(messageType: string, isPersited: boolean, isCounted: boolean, searchProps?: string[], isStatusMessage?: boolean): new (content: T) => BaseMessage<T>;
2181
3452
  /**
2182
3453
  * 获取第一条未读消息
3454
+ * @description 获取指定会话中的第一条未读消息,仅支持 Electron 平台
2183
3455
  * @category 消息
2184
3456
  * @param conversation
3457
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3458
+ *
3459
+ * @example
3460
+ * 获取第一条未读消息示例:
3461
+ * ```ts
3462
+ * const conversation = {
3463
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3464
+ * targetId: 'targetId',
3465
+ * }
3466
+ * const firstUnreadRes = await RongIMLib.getFirstUnreadMessage(conversation);
3467
+ * console.info('获取第一条未读消息结果:', firstUnreadRes);
3468
+ * ```
2185
3469
  */
2186
3470
  declare function getFirstUnreadMessage(conversation: IConversationOption): Promise<IAsyncRes<IAReceivedMessage | null>>;
2187
3471
  /**
2188
3472
  * 获取第一条未读消息信息
2189
3473
  * @category 消息
2190
3474
  * @since 5.9.0
2191
- * @param conversation
2192
- * 当没有未读消息时,返回的 data 为 null
2193
- * 当第一条未读消息被撤回时,此信息不会更新
3475
+ * @param conversation 会话信息
3476
+ * @description 获取指定会话中的第一条未读消息信息
3477
+ * * **注意**:
3478
+ * 1. 当没有未读消息时,返回的 data 为 null
3479
+ * 2. 当第一条未读消息被撤回时,此信息不会更新
3480
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IFirstUnreadMessageInfo} 类型
3481
+ * @example
3482
+ * 获取第一条未读消息信息示例:
3483
+ * ```ts
3484
+ * const conversation = {
3485
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3486
+ * targetId: 'targetId',
3487
+ * }
3488
+ * const firstUnreadMessageInfoRes = await RongIMLib.getFirstUnreadMessageInfo(conversation);
3489
+ * console.info('获取第一条未读消息信息结果:', firstUnreadMessageInfoRes);
3490
+ * ```
2194
3491
  */
2195
3492
  declare function getFirstUnreadMessageInfo(conversation: IConversationOption): Promise<IAsyncRes<IFirstUnreadMessageInfo | null>>;
2196
3493
  /**
2197
- * 向本地插入一条消息,不发送到服务器
3494
+ * 向本地插入一条消息,不发送到服务器
2198
3495
  * @category 消息
2199
- * @param conversationType 会话类型
2200
- * @param targetId 目标 ID
2201
- * @param content 消息体
2202
- * @param callback
2203
- * @deprecated
2204
- */
3496
+ * @deprecated 请使用 {@link RongIMLib.ElectronExtension.insertMessage} 代替
3497
+ */
2205
3498
  declare function insertMessage$1(conversation: IConversationOption, content: IReceivedMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
2206
3499
  /**
2207
3500
  * 获取消息
3501
+ * @description 获取本地消息, 通过本地消息 ID 或 messageUId 获取消息, 仅支持 Electron 平台
2208
3502
  * @category 消息
2209
3503
  * @param messageId 本地消息 ID 或 messageUId
3504
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3505
+ * @example
3506
+ * 获取消息示例:
3507
+ * ```ts
3508
+ * const messageUId = 'BS4O-P5AO-D1O6-9GPP';
3509
+ * const getMessageRes = await RongIMLib.getMessage(messageUId);
3510
+ * console.info('获取消息结果:', getMessageRes);
3511
+ * ```
2210
3512
  */
2211
3513
  declare function getMessage(messageId: number | string): Promise<IAsyncRes<IAReceivedMessage>>;
2212
3514
  /**
2213
3515
  * 获取会话下所有未读的 @ 消息
2214
3516
  * @category 消息
2215
- * @param conversationType 会话类型
2216
- * @param targetId 目标 ID
3517
+ * @param conversation 会话信息
3518
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage[]} 类型
3519
+ * @example
3520
+ * 获取会话下所有未读的 @ 消息示例:
3521
+ * ```ts
3522
+ * const conversation = {
3523
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3524
+ * targetId: 'targetId',
3525
+ * }
3526
+ * const getUnreadMentionedRes = await RongIMLib.getUnreadMentionedMessages(conversation);
3527
+ * console.info('获取会话下所有未读的 @ 消息结果:', getUnreadMentionedRes);
3528
+ * ```
2217
3529
  */
2218
3530
  declare function getUnreadMentionedMessages(conversation: IConversationOption): IAsyncRes<IAReceivedMessage[]>;
2219
3531
  /**
2220
3532
  * 按关键字搜索会话内的消息
2221
3533
  * @category 消息
2222
- * @deprecated 已废弃,推荐使用 electronExtension.searchMessages 方法
2223
- * @param conversation 会话
2224
- * @param keyword 搜索内容
2225
- * @param timestamp 搜索时间, 搜索该时间之前的消息
2226
- * @param count 获取的数量
2227
- * @deprecated
3534
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.searchMessages} 方法
2228
3535
  */
2229
3536
  declare function searchMessages$1(conversation: IConversationOption, keyword: string, timestamp: number, count: number): Promise<IAsyncRes<{
2230
3537
  messages: IAReceivedMessage[];
@@ -2233,99 +3540,200 @@ declare function searchMessages$1(conversation: IConversationOption, keyword: st
2233
3540
  /**
2234
3541
  * 从本地消息数据库中删除某一会话指定时间之前的消息数据
2235
3542
  * @category 消息
2236
- * @param conversation 会话
2237
- * @param timestamp 指定删除该时间戳之前的消息
2238
- * @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
2239
- * 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
2240
- * @deprecated
3543
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.deleteMessagesByTimestamp} 方法
2241
3544
  */
2242
3545
  declare function deleteLocalMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<IAsyncRes<void>>;
2243
3546
  /**
2244
3547
  * 清空会话下历史消息
2245
3548
  * @category 消息
2246
- * @param conversation 会话
2247
- * @deprecated
3549
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.clearMessages} 方法
2248
3550
  */
2249
3551
  declare function clearMessages$1(conversation: IConversationOption): Promise<IAsyncRes<void>>;
2250
3552
  /**
2251
3553
  * 按内容搜索会话
2252
3554
  * @category 消息
2253
- * @param keyword 关键字
2254
- * @param conversationTypes 会话类型数组
2255
- * @deprecated
3555
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.searchConversationByContent} 方法
2256
3556
  */
2257
3557
  declare function searchConversationByContent$1(keyword: string, conversationTypes?: ConversationType[], messageTypes?: string[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[] | undefined>>;
2258
3558
  /**
2259
3559
  * 清除时间戳前的未读数
3560
+ * @description 清除时间戳前的未读数,仅支持 Electron 平台。
2260
3561
  * @category 消息
2261
- * @param conversationType 会话类型
2262
- * @param targetId 目标 ID
2263
- * @param timestamp 目标 ID
2264
- * @param callback
3562
+ * @param conversation 会话信息
3563
+ * @param timestamp 清理未读时间戳
3564
+ *
3565
+ * @example
3566
+ * 清除时间戳前的未读数示例:
3567
+ * ```ts
3568
+ * const conversation = {
3569
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3570
+ * targetId: 'targetId',
3571
+ * }
3572
+ * const timestamp = 1626955200000;
3573
+ * const clearRes = await RongIMLib.clearUnreadCountByTimestamp(conversation, timestamp);
3574
+ * console.info('清除时间戳前的未读数结果:', clearRes);
3575
+ * ```
2265
3576
  */
2266
3577
  declare function clearUnreadCountByTimestamp(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
2267
3578
  /**
2268
3579
  * 设置消息接收状态
2269
3580
  * @category 消息
2270
- * @deprecated
3581
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.setMessageReceivedStatusInfo} 方法
2271
3582
  */
2272
3583
  declare function setMessageReceivedStatus$1(messageId: number, receivedStatus: number): Promise<IAsyncRes<void>>;
2273
3584
 
2274
3585
  /**
2275
3586
  * 创建标签
3587
+ * @description 创建标签系统,用于对会话进行管理。SDK 创建的标签会被同步到服务端
3588
+ * SDK 支持使用一个或多个标签标记会话,可用于会话的分组显示、获取会话列表等操作,并提供了多个接口用于移除会话上的标签
3589
+ * * **注意**:每个用户最多可以创建 20 个标签
2276
3590
  * @category 标签
2277
- * @param tag 标签信息
3591
+ * @param tag 标签信息,包含标签 ID 和标签名称,类型为 {@link ITagParam}
3592
+ * @returns 创建成功返回 code 为 0,失败返回错误码
3593
+ * @example 创建标签示例:
3594
+ * ```ts
3595
+ * const tag = {
3596
+ * tagId: 'tagId',
3597
+ * tagName: 'tagName',
3598
+ * };
3599
+ * const res = await RongIMLib.addTag(tag);
3600
+ * console.log('创建标签结果:', res);
3601
+ * ```
2278
3602
  */
2279
3603
  declare function addTag(tag: ITagParam): Promise<IAsyncRes<void>>;
2280
3604
  /**
2281
3605
  * 删除标签
2282
3606
  * @category 标签
2283
3607
  * @param tagId 标签 ID
3608
+ * @returns 删除成功返回 code 为 0,失败返回错误码
3609
+ * @example 删除标签示例:
3610
+ * ```ts
3611
+ * const tagId = 'tagId';
3612
+ * const res = await RongIMLib.removeTag(tagId);
3613
+ * console.log('删除标签结果:', res);
3614
+ * ```
2284
3615
  */
2285
3616
  declare function removeTag(tagId: string): Promise<IAsyncRes<void>>;
2286
3617
  /**
2287
3618
  * 编辑标签
3619
+ * @description 编辑标签名称,标签名称最大长度为 15 个字符, 标签 ID,长度不能超过 10 个字符
2288
3620
  * @category 标签
2289
- * @param tag 标签信息
3621
+ * @param tag 标签信息, 包含标签 ID 和标签名称,类型为 {@link ITagParam}
3622
+ * @returns 编辑成功返回 code 为 0,失败返回错误码
3623
+ * @example 编辑标签示例:
3624
+ * ```ts
3625
+ * const tag = {
3626
+ * tagId: 'tagId',
3627
+ * tagName: 'tagName',
3628
+ * };
3629
+ * const res = await RongIMLib.updateTag(tag);
3630
+ * console.log('编辑标签结果:', res);
3631
+ * ```
2290
3632
  */
2291
3633
  declare function updateTag(tag: ITagParam): Promise<IAsyncRes<void>>;
2292
3634
  /**
2293
3635
  * 获取标签列表
2294
3636
  * @category 标签
3637
+ * @description 获取当前用户的标签列表
3638
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为标签列表,类型为 {@link ITagInfo} 数组或者 undefined
3639
+ * @example 获取标签列表示例:
3640
+ * ```ts
3641
+ * const res = await RongIMLib.getTags();
3642
+ * console.log('获取标签列表结果:', res);
3643
+ * ```
2295
3644
  */
2296
3645
  declare function getTags(): Promise<IAsyncRes<ITagInfo[] | undefined>>;
2297
3646
  /**
2298
3647
  * 获取会话下的标签
2299
- * @category 标签
2300
- * @param conversation 会话信息
3648
+ * @description 更具会话信息获取具体某个会话下的标签列表
3649
+ * @category 标签
3650
+ * @param conversation 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption}
3651
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为标签列表,类型为 {@link IConversationTag} 数组或者 undefined
3652
+ * @example 获取会话下的标签示例:
3653
+ * ```ts
3654
+ * const conversation = {
3655
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3656
+ * targetId: 'targetId',
3657
+ * };
3658
+ * const res = await RongIMLib.getTagsFromConversation(conversation);
3659
+ * console.log('获取会话下的标签结果:', res);
3660
+ * ```
2301
3661
  */
2302
3662
  declare function getTagsFromConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[] | undefined>>;
2303
3663
  /**
2304
3664
  * 添加会话到指定标签
3665
+ * @description 添加会话到指定标签,一个会话可以添加到多个标签
3666
+ * * **注意**:
3667
+ * 1. 每个标签下最多可以添加 1000 个会话
3668
+ * 2. 如果标签下已添加 1000 个会话,继续在该标签下添加会话仍会成功,但会导致最早添加标签的会话被移除标签
3669
+ * 3. 同一个会话可以设置多个不同的标签
2305
3670
  * @category 标签
2306
3671
  * @param tagId 标签 ID
2307
- * @param conversations 要添加的会话列表
3672
+ * @param conversations 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption} 数组
3673
+ * @example 添加会话到指定标签示例:
3674
+ * ```ts
3675
+ * const tagId = 'tagId';
3676
+ * const conversations = [{
3677
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3678
+ * targetId: 'targetId',
3679
+ * }];
3680
+ * const res = await RongIMLib.addConversationsToTag(tagId, conversations);
3681
+ * console.log('添加会话到指定标签结果:', res);
3682
+ * ```
2308
3683
  */
2309
3684
  declare function addConversationsToTag(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
2310
3685
  /**
2311
- * 删除指定标签中会话
3686
+ * 从指定标签中删除多个会话
3687
+ * @description 从指定标签中删除多个会话,此操作仅解除会话与标签的关系,并不会删除会话数据
2312
3688
  * @category 标签
2313
3689
  * @param tagId 标签 ID
2314
- * @param conversations 要删除的会话列表
3690
+ * @param conversations 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption} 数组
3691
+ * @example 从指定标签中删除多个会话示例:
3692
+ * ```ts
3693
+ * const tagId = 'tagId';
3694
+ * const conversations = [{
3695
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3696
+ * targetId: 'targetId',
3697
+ * }];
3698
+ * const res = await RongIMLib.removeConversationsFromTag(tagId, conversations);
3699
+ * console.log('从指定标签中删除多个会话果:', res);
3700
+ * ```
2315
3701
  */
2316
3702
  declare function removeConversationsFromTag(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
2317
3703
  /**
2318
3704
  * 从指定会话中删除多个标签
3705
+ * @description 从指定会话中删除多个标签,此操作仅解除会话与标签的关系,并不会删除会话数据
2319
3706
  * @category 标签
2320
- * @param conversation 会话
3707
+ * @param conversation 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption}
2321
3708
  * @param tagIds 要删除的标签列表
3709
+ * @example 从指定会话中删除多个标签示例:
3710
+ * ```ts
3711
+ * const conversation = {
3712
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3713
+ * targetId: 'targetId',
3714
+ * };
3715
+ * const tagIds = ['tagId1', 'tagId2'];
3716
+ * const res = await RongIMLib.removeTagsFromConversation(conversation, tagIds);
3717
+ * console.log('从指定会话中删除多个标签结果:', res);
3718
+ * ```
2322
3719
  */
2323
3720
  declare function removeTagsFromConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<void>>;
2324
3721
  /**
2325
3722
  * 从多个会话中删除指定的标签
3723
+ * @description 从多个会话中删除指定的标签,此操作仅解除会话与标签的关系,并不会删除会话数据
2326
3724
  * @category 标签
2327
3725
  * @param tagId 标签 ID
2328
- * @param conversations 要删除的会话列表
3726
+ * @param conversations 会话信息列表
3727
+ * @example 从多个会话中删除指定的标签示例:
3728
+ * ```ts
3729
+ * const tagId = 'tagId';
3730
+ * const conversations = [{
3731
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3732
+ * targetId: 'targetId',
3733
+ * }];
3734
+ * const res = await RongIMLib.removeTagFromConversations(tagId, conversations);
3735
+ * console.log('从多个会话中删除指定的标签:', res);
3736
+ * ```
2329
3737
  */
2330
3738
  declare function removeTagFromConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
2331
3739
  /**
@@ -2333,7 +3741,17 @@ declare function removeTagFromConversations(tagId: string, conversations: IConve
2333
3741
  * @category 标签
2334
3742
  * @param tagId 标签id
2335
3743
  * @param count 获取数量
2336
- * @param timestamp 会话时间戳
3744
+ * @param timestamp 会话中消息的时间戳
3745
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为会话列表,类型为 {@link IAReceivedConversationByTag} 数组或者 undefined
3746
+ * 从 SDK 版本 @since 5.7.0 开始该接口的返回数据类型由 {@link IReceivedConversationByTag} 变更为 {@link IAReceivedConversationByTag}
3747
+ * @example 分页获取标签下会话列表示例:
3748
+ * ```ts
3749
+ * const tagId = 'tagId';
3750
+ * const count = 10;
3751
+ * const timestamp = 0;
3752
+ * const res = await RongIMLib.getConversationsFromTagByPage(tagId, count, timestamp);
3753
+ * console.log('分页获取标签下会话列表结果:', res);
3754
+ * ```
2337
3755
  */
2338
3756
  declare function getConversationsFromTagByPage(tagId: string, count: number, startTime: number): Promise<IAsyncRes<IAReceivedConversationByTag[] | undefined>>;
2339
3757
  /**
@@ -2341,29 +3759,54 @@ declare function getConversationsFromTagByPage(tagId: string, count: number, sta
2341
3759
  * @category 标签
2342
3760
  * @param tagId 标签id
2343
3761
  * @param containMuted 是否包含免打扰
3762
+ * @example 根据标签获取未读消息数示例:
3763
+ * ```ts
3764
+ * const tagId = 'tagId';
3765
+ * const containMuted = false;
3766
+ * const res = await RongIMLib.getUnreadCountByTag(tagId, containMuted);
3767
+ * console.log('根据标签获取未读消息数结果:', res);
3768
+ * ```
2344
3769
  */
2345
3770
  declare function getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number | undefined>>;
2346
3771
  /**
2347
3772
  * 设置标签中会话置顶
3773
+ * @description 设置在指定标签下置顶的会话。如果根据标签获取会话,可在获取的会话中可以看到该属性。请注意与会话列表中的会话置顶相区分
2348
3774
  * @category 标签
2349
3775
  * @param tagId 标签id
2350
3776
  * @param conversation 会话
2351
3777
  * @param status 状态
3778
+ * @example 设置标签中会话置顶示例:
3779
+ * ```ts
3780
+ * const tagId = 'tagId';
3781
+ * const conversation = {
3782
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3783
+ * targetId: 'targetId',
3784
+ * };
3785
+ * const isTop = true;
3786
+ * const res = await RongIMLib.setConversationToTopInTag(tagId, conversation, isTop);
3787
+ * console.log('设置标签中会话置顶结果:', res);
3788
+ * ```
2352
3789
  */
2353
3790
  declare function setConversationToTopInTag(tagId: string, conversation: IConversationOption, isTop: boolean): Promise<IAsyncRes<void>>;
2354
3791
 
2355
3792
  /**
2356
3793
  * 创建文件上传任务
2357
3794
  * @param uploadInfo
3795
+ * @hidden
2358
3796
  * @returns
2359
3797
  */
2360
3798
  declare function createUploadTask(uploadInfo: IUploadInfo): Promise<IAsyncRes<UploadTask>>;
2361
3799
  /**
2362
3800
  * 停止文件上传任务
3801
+ * @hidden
2363
3802
  * @param taskId
2364
3803
  * @returns
2365
3804
  */
2366
3805
  declare function stopUploadTask(taskId: number): Promise<IAsyncRes<boolean>>;
3806
+ /**
3807
+ * 上传文件
3808
+ * @hidden
3809
+ */
2367
3810
  declare function upload(uploadInfo: IUploadInfo): Promise<IAsyncRes<IUploadResult>>;
2368
3811
  /**
2369
3812
  * 获取文件 token
@@ -2388,6 +3831,7 @@ declare function getFileToken(fileType: FileType, fileName?: string, httpMethod?
2388
3831
  * 获取下载鉴权信息
2389
3832
  * @param url 文件 URL 地址
2390
3833
  * @description 通过文件 URL 地址获取下载鉴权信息,用于下载文件时的鉴权
3834
+ * @hidden
2391
3835
  * token: 原 RCX 存储鉴权 token,优先使用
2392
3836
  * downloadAuthInfo: RCX 升级后,公有云私有化部署的下载鉴权信息
2393
3837
  */
@@ -2415,11 +3859,16 @@ declare function getFileUrl(fileType: FileType, filename?: string, saveName?: st
2415
3859
 
2416
3860
  /**
2417
3861
  * @deprecated 从 5.6.0 版本开始,此定义失效
3862
+ * @category 基础
2418
3863
  */
2419
3864
  declare const ConnectType: {
2420
3865
  COMET: string;
2421
3866
  WEBSOCKET: string;
2422
3867
  };
3868
+ /**
3869
+ * 消息类型
3870
+ * @category 消息
3871
+ */
2423
3872
  declare const MessageType: {
2424
3873
  TEXT: string;
2425
3874
  VOICE: string;
@@ -2440,50 +3889,142 @@ declare const MessageType: {
2440
3889
  };
2441
3890
 
2442
3891
  /**
2443
- * 获取全部会话列表
3892
+ * 获取全部本地会话列表
3893
+ * @category Electron 独有
3894
+ * @description 本接口仅适用 Electron 平台获取全部本地会话列表
3895
+ * * **注意**:此接口不包含超级群会话
2444
3896
  * @param channelId 频道 ID,不传则获取全部频道 ID 类型
3897
+ * @since 5.4.0
3898
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3899
+ * @example
3900
+ * 获取全部本地会话列表示例:
3901
+ * ```ts
3902
+ * const conversationList = await RongIMLib.electronExtension.getAllConversationList();
3903
+ * console.log('获取全部本地会话列表结果:', conversationList);
3904
+ * ```
2445
3905
  */
2446
3906
  declare function getAllConversationList(channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
2447
3907
  /**
2448
- * 获取会话列表
2449
- * @param startTime 起始时间
2450
- * @param count 数量
3908
+ * 分页获取本地会话列表
3909
+ * @category Electron 独有
3910
+ * @description 本接口仅适用 Electron 平台分页获取本地会话列表,
3911
+ * * **注意**:不包含超级群会话
3912
+ * @param startTime 获取会话起始时间,需要精确到毫秒,0 表示当前时间
3913
+ * @param count 分页数量
2451
3914
  * @param channelId 频道 ID,不传则获取全部频道 ID 类型
3915
+ * @param topPriority 是否置顶优先
3916
+ * @defaultValue topPriority false
3917
+ * @since 5.4.0
3918
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3919
+ * @example
3920
+ * 分页获取本地会话列表示例:
3921
+ * ```ts
3922
+ * const startTime = 0;
3923
+ * const count = 10;
3924
+ * const conversationList = await RongIMLib.electronExtension.getConversationList(startTime, count);
3925
+ * console.log('分页获取本地会话列表结果:', conversationList);
3926
+ * ```
2452
3927
  */
2453
3928
  declare function getConversationList(startTime: number, count: number, channelId?: string, topPriority?: boolean): Promise<IAsyncRes<IAReceivedConversation[]>>;
2454
3929
  /**
2455
- * 根据消息内容搜索会话列表
3930
+ * 搜索本地会话列表
3931
+ * @category Electron 独有
3932
+ * @description 本接口仅适用 Electron 平台搜索本地会话列表
3933
+ * * **注意**:
3934
+ * 1. 不包含超级群会话
3935
+ * 2. 支持查询自定义消息类型,需要再注册自定义消息时设置搜索字段,否则无法搜索 ,详细请查看 {@link registerMessageType} 的 searchProps 参数
2456
3936
  * @param keyword 搜索关键字
2457
3937
  * @param messageTypes 消息类型
2458
3938
  * @param channelId 频道 ID,不传则获取全部频道 ID 类型
3939
+ * @since 5.4.0
3940
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3941
+ * @example
3942
+ * 搜索本地会话列表示例:
3943
+ * ```ts
3944
+ * const keyword = 'keyword';
3945
+ * const messageTypes = [RongIMLib.MessageType.TEXT];
3946
+ * const conversationList = await RongIMLib.electronExtension.searchConversationByContent(keyword, messageTypes);
3947
+ * console.log('搜索本地会话列表结果:', conversationList);
3948
+ * ```
2459
3949
  */
2460
3950
  declare function searchConversationByContent(keyword: string, messageTypes: string[], channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
2461
3951
  /**
2462
3952
  * 批量获取会话列表
2463
- * 仅支持单群聊系统会话
2464
- * @param conversations 需要获取会话的信息
2465
- * 一次最多获取 100 个会话
2466
- * @returns IReceivedConversation[]
3953
+ * @category Electron 独有
3954
+ * @description 本接口仅适用 Electron 平台批量获取会话列表,通过提供会话的唯一标标识属性返回 {@link IReceivedConversation} 类型的会话信息
3955
+ * * **注意**:
3956
+ * 1. 仅支持单群聊系统会话
3957
+ * @since 5.9.9
3958
+ * @param conversations 需要获取会话的信息,一次最多获取 100 个会话
3959
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3960
+ * @example
3961
+ * 批量获取会话列表示例:
3962
+ * ```ts
3963
+ * const conversations = [{ conversationType: RongIMLib.ConversationType.PRIVATE, targetId: 'targetId' }];
3964
+ * const conversationList = await RongIMLib.electronExtension.getConversations(conversations);
3965
+ * console.log('批量获取会话列表结果:', conversationList);
3966
+ * ```
2467
3967
  */
2468
3968
  declare function getConversations(conversations: IConversationOption[]): Promise<IAsyncRes<IAReceivedConversation[]>>;
2469
3969
 
2470
3970
  /**
2471
- * 搜索消息
2472
- * 如果不传 channelId,则在所有 channelId 中搜索消息
2473
- * @param conversation 会话
3971
+ * 根据关键字搜索本地消息
3972
+ * @category Electron 独有
3973
+ * @description 本接口仅适用 Electron 平台搜索本地消息
3974
+ * * **注意**:
3975
+ * 1. 文本类型消息只支持搜索 content,文件类型消息只支持搜索 name
3976
+ * 2. 自定义消息根据 registerMessageType 的 searchProps 参数决定
3977
+ * 3. 引用消息不支持搜索
3978
+ * 4. 如果不传 channelId,则在所有 channelId 中搜索消息
3979
+ * 5. 如果不传 messageTypes,则搜索所有支持搜索的消息类型
3980
+ * @since 5.4.0
3981
+ * @param conversation 会话信息
2474
3982
  * @param keyword 搜索关键字
2475
- * @param startTime 搜索起始时间
2476
- * @param count 数量
2477
- * @param messageTypes 消息类型, 只支持文本(RC:TxtMsg)、文件(RC:FileMsg)、引用消息(RC:ReferenceMsg)、自定义消息
3983
+ * @param startTime 搜索时间, 搜索该时间之前的消息
3984
+ * @param count 获取的数量
3985
+ * @param messageTypes 消息类型,@since 5.9.8 开始支持按照消息类型搜索,支持范围:文本(RC:TxtMsg)、文件(RC:FileMsg)、设置 {@link searchProps} 的自定义消息
3986
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
3987
+ * @example
3988
+ * 根据关键字搜索本地消息示例:
3989
+ * ```ts
3990
+ * const conversation = {
3991
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3992
+ * targetId: 'targetId',
3993
+ * };
3994
+ * const keyword = 'keyword';
3995
+ * const startTime = Date.now();
3996
+ * const count = 10;
3997
+ * const res = await RongIMLib.electronExtension.searchMessages(conversation, keyword, startTime, count);
3998
+ * console.info('根据关键字搜索本地消息结果:', res);
3999
+ * ```
2478
4000
  */
2479
4001
  declare function searchMessages(conversation: IConversationOption, keyword: string, startTime: number, count: number, messageTypes?: string[]): Promise<IAsyncRes<{
2480
4002
  messages: IAReceivedMessage[];
2481
4003
  count: number | undefined;
2482
4004
  }>>;
2483
4005
  /**
2484
- * 在时间范围内搜索消息
2485
- * @param conversation 会话
2486
- * @param option 配置
4006
+ * 在指定时间范围内搜索本地消息
4007
+ * @category Electron 独有
4008
+ * @description 本接口仅适用 Electron 平台搜索本地消息
4009
+ * @since 5.4.0
4010
+ * @param conversation 会话信息
4011
+ * @param option 搜索参数,类型为 {@link ISearchMessageInTimeRangeOption}
4012
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4013
+ * @example
4014
+ * 在指定时间范围内搜索本地消息示例:
4015
+ * ```ts
4016
+ * const conversation = {
4017
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4018
+ * targetId: 'targetId'
4019
+ * }
4020
+ * const option = {
4021
+ * keyword: 'keyword',
4022
+ * startTime: 0,
4023
+ * endTime: 1632728573423,
4024
+ * }
4025
+ * const res = await RongIMLib.electronExtension.searchMessageInTimeRange(conversation, option)
4026
+ * console.info('在指定时间范围内搜索本地消息结果:', res);
4027
+ * ```
2487
4028
  */
2488
4029
  declare function searchMessageInTimeRange(conversation: {
2489
4030
  conversationType: ConversationType;
@@ -2492,17 +4033,51 @@ declare function searchMessageInTimeRange(conversation: {
2492
4033
  messages: IAReceivedMessage[];
2493
4034
  }>>;
2494
4035
  /**
2495
- * 根据用户 ID 搜索消息
2496
- * @param conversation 会话
4036
+ * 根据用户 ID 搜索本地消息
4037
+ * @category Electron 独有
4038
+ * @description 本接口仅适用 Electron 平台在指定会话的所有频道中根据用户 ID 搜索时间范围内的消息
4039
+ * @param conversation 会话信息
4040
+ * @param count 获取的数量
4041
+ * @param startTime 搜索时间,搜索时间之前的消息
4042
+ * @param userId 用户 ID
2497
4043
  * @since 5.7.10
4044
+ * @return 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4045
+ * @example
4046
+ * 根据用户 ID 搜索本地消息示例:
4047
+ * ```ts
4048
+ * const conversation = {
4049
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4050
+ * targetId: 'targetId'
4051
+ * };
4052
+ * const userId = 'userId';
4053
+ * const startTime = Date.now();
4054
+ * const count = 10;
4055
+ * const res = await RongIMLib.electronExtension.searchMessagesByUser(conversation, userId, startTime, count);
4056
+ * console.info('根据用户 ID 搜索本地消息', res);
4057
+ * ```
2498
4058
  */
2499
4059
  declare function searchMessagesByUser(conversation: IConversationOption, userId: string, startTime: number, count: number): Promise<IAsyncRes<{
2500
4060
  messages: IAReceivedMessage[];
2501
4061
  }>>;
2502
4062
  /**
2503
- * 获取指定消息类型的历史消息
2504
- * @param conversation 会话
2505
- * @param option 配置参数
4063
+ * 获取会话中指定类型的消息
4064
+ * @category Electron 独有
4065
+ * @description 本接口仅适用 Electron 平台获取会话中指定类型的消息
4066
+ * @param conversation 会话信息
4067
+ * @param option 配置参数,类型为 {@link IGetHistoryMessagesByTypesOption}
4068
+ * @since 5.4.0
4069
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4070
+ * @example
4071
+ * 获取会话中指定类型的消息示例:
4072
+ * ```ts
4073
+ * const conversation = {
4074
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4075
+ * targetId: 'targetId'
4076
+ * };
4077
+ * const options = { messageTypes: [RongIMLib.MessageType.TEXT] };
4078
+ * const res = await RongIMLib.electronExtension.getHistoryMessagesByMessageTypes(conversation, option);
4079
+ * console.info('获取会话中指定类型的消息结果:', res);
4080
+ * ```
2506
4081
  */
2507
4082
  declare function getHistoryMessagesByMessageTypes(conversation: IConversationOption, option: IGetHistoryMessagesByTypesOption): Promise<IAsyncRes<{
2508
4083
  /**
@@ -2511,16 +4086,33 @@ declare function getHistoryMessagesByMessageTypes(conversation: IConversationOpt
2511
4086
  messages: IAReceivedMessage[];
2512
4087
  } & GetHistoryMessageResult>>;
2513
4088
  /**
2514
- * 获取本地与远端历史消息(该接口已解决消息断档)
4089
+ * 获取本地与远端历史消息
4090
+ * @category Electron 独有
4091
+ * @description 本接口仅适用 Electron 平台且需要业务层开启`单群聊云存储服务`
4092
+ * 方法与 {@link getRemoteHistoryMessages} 的区别是 getContinuousMessages 会先查询指定会话存储本地数据库的消息,
4093
+ * 当本地消息无法满足查询条件时,再查询在单群聊消息云端存储中的历史消息,以返回连续且相邻的消息对象列表
4094
+ * * **注意**:
2515
4095
  * 1. 分页获取时,下次传的时间戳必须使用 getContinuousMessages 接口返回的 timestamp
2516
4096
  * 2. 获取历史消息逻辑:优先获取本地数据历史消息,本地获取不到再获取远端历史消息,但是该情况可能会因为离线或者补偿消息存储天数影响,出现消息断档现象
2517
4097
  * 消息断档现象:因为离线或者补偿消息存储天数影响,存储在本地数据库中消息存在不连续或者说中间某段时间消息丢失
2518
4098
  * 比如离线消息和补偿消息都为 1 天,第一天 A 给 B 发送 1, 2, 3,第二天 A 给 B 发送 4, 5, 6,
2519
4099
  * B 第二天再登入,由于离线消息和补偿消息都为 1 天,所以 B 只能收到 4, 5, 6。 1, 2, 3 消息丢失
2520
- * @param conversation
2521
- * @param option
4100
+ * 3. option 中的 Count 字段仅支持 1-100 范围
4101
+ * @param conversation 会话信息
4102
+ * @param option 参数配置,类型为 {@link GetHistoryMessageOption}
2522
4103
  * @since 5.9.6
2523
- * @description 该接口需要业务层开启单群聊云存储服务
4104
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4105
+ * @example
4106
+ * 获取本地与远端历史消息示例:
4107
+ * ```ts
4108
+ * const conversation = {
4109
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4110
+ * targetId: 'targetId'
4111
+ * };
4112
+ * const options = { timestamp: 0, count: 20, order: 0 };
4113
+ * const res = await RongIMLib.electronExtension.getContinuousMessages(conversation, option);
4114
+ * console.info('获取本地与远端历史消息结果:', res);
4115
+ * ```
2524
4116
  */
2525
4117
  declare function getContinuousMessages(conversation: IConversationOption, options: GetHistoryMessageOption): Promise<IAsyncRes<{
2526
4118
  list: IAReceivedMessage[];
@@ -2528,57 +4120,160 @@ declare function getContinuousMessages(conversation: IConversationOption, option
2528
4120
  hasMore: boolean;
2529
4121
  }>>;
2530
4122
  /**
2531
- * 将自己发送的指定时间之前的消息标记对方已读,状态值为 SentStatus.READ
2532
- * @param conversation 会话
2533
- * @param timestamp 时间戳
4123
+ * 通过时间戳设置消息状态为对方已读
4124
+ * @category Electron 独有
4125
+ * @description 将自己发送的指定时间之前的消息设置为对方已读,状态值为 SentStatus.READ
4126
+ * @param conversation 会话信息
4127
+ * @param timestamp 消息的发送时间,将该时间之前的消息设置为已读
4128
+ * @since 5.4.0
4129
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
4130
+ * @example
4131
+ * 通过时间戳设置消息状态为对方已读示例:
4132
+ * ```ts
4133
+ * const conversation = {
4134
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4135
+ * targetId: 'targetId'
4136
+ * };
4137
+ * const timestamp = Date.now();
4138
+ * const res = await RongIMLib.electronExtension.setMessageStatusToRead(conversation, timestamp);
4139
+ * console.info('通过时间戳设置消息状态为对方已读结果:', res);
4140
+ * ```
2534
4141
  */
2535
4142
  declare function setMessageStatusToRead(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<boolean>>;
2536
4143
  /**
2537
- * 设置对方发送的消息 自己的接受状态
4144
+ * 设置消息的接收状态
2538
4145
  * @param messageId 消息 ID
2539
4146
  * @param receivedStatus 接受状态
2540
- * @deprecated 建议使用 setMessageReceivedStatusInfo, 支持设置多种状态
4147
+ * @since 5.4.0
4148
+ * @deprecated @since 5.9.3 MLib SDK 版本 ≧ 5.9.3,建议使用 {@link setMessageReceivedStatusInfo} 接口替换
2541
4149
  */
2542
4150
  declare function setMessageReceivedStatus(messageId: number, receivedStatus: ReceivedStatus): Promise<IAsyncRes<void>>;
2543
4151
  /**
4152
+ * 设置消息的接收状态
4153
+ * @category Electron 独有
4154
+ * @description 本接口仅适用 Electron 平台设置消息的接收状态,支持多状态同时设置
2544
4155
  * 设置对方发送的消息 自己的接受状态信息
2545
- * @param messageId
2546
- * @param receivedStatusInfo
4156
+ * @param messageId 消息 ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
4157
+ * @param receivedStatusInfo 接受状态信息,类型为 {@link IReceivedStatusInfo}
4158
+ * @since 5.9.3
4159
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4160
+ * @example
4161
+ * 设置消息的接收状态示例:
4162
+ * ```ts
4163
+ * const messageId = 123;
4164
+ * const receivedStatusInfo = {
4165
+ * isRead: true,
4166
+ * isListened: true,
4167
+ * };
4168
+ * const res = await RongIMLib.electronExtension.setMessageReceivedStatusInfo(messageId, receivedStatusInfo);
4169
+ * console.info('设置消息的接收状态结果:', res);
4170
+ * ```
2547
4171
  */
2548
4172
  declare function setMessageReceivedStatusInfo(messageId: number, receivedStatusInfo: IReceivedStatusInfo): Promise<IAsyncRes<void>>;
2549
4173
  /**
2550
- * 设置自己发送的消息的发送状态
2551
- * @param messageId 消息ID
2552
- * @param sentStatus 发送状态
4174
+ * 设置消息的发送状态
4175
+ * @category Electron 独有
4176
+ * @description 本接口仅适用 Electron 平台设置自己发送的消息的发送状态
4177
+ * @param messageId 消息ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
4178
+ * @param sentStatus 消息的发送状态,类型为 {@link SentStatus}
4179
+ * @since 5.4.0
4180
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4181
+ * @example
4182
+ * 设置消息的发送状态示例:
4183
+ * ```ts
4184
+ * const messageId = 123;
4185
+ * const sentStatus = RongIMLib.SentStatus.SENT;
4186
+ * const res = await RongIMLib.electronExtension.setMessageSentStatus(messageId, sentStatus);
4187
+ * console.info('设置消息的发送状态结果:', res);
4188
+ * ```
2553
4189
  */
2554
4190
  declare function setMessageSentStatus(messageId: number, sentStatus: SentStatus): Promise<IAsyncRes<void>>;
2555
4191
  /**
2556
4192
  * 修改消息内容
4193
+ * @category Electron 独有
4194
+ * @description 本接口仅适用 Electron 平台修改消息内容,目前仅私有云使用 RCE api 暂不对外
4195
+ * @hidden
2557
4196
  * @param messageId 消息 ID
2558
4197
  * @param content 消息 content
2559
4198
  * @param messageType 消息类型,如果设置了消息类型,会使该消息无法被搜索
4199
+ * @since 5.4.0
4200
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4201
+ * @example
4202
+ * 修改消息内容示例:
4203
+ * ```ts
4204
+ * const messageId = 123;
4205
+ * const content = {
4206
+ * content: 'new content',
4207
+ * };
4208
+ * const messageType = 'RC:TxtMsg';
4209
+ * const res = await RongIMLib.electronExtension.setMessageContent(messageId, content, messageType);
4210
+ * console.info('修改消息内容结果:', res);
4211
+ * ```
2560
4212
  */
2561
4213
  declare function setMessageContent(messageId: number, content: Object, messageType?: string): Promise<IAsyncRes<void>>;
2562
4214
  /**
2563
- * 删除消息
4215
+ * 通过消息 ID 删除消息
4216
+ * @category Electron 独有
4217
+ * @description 本接口仅适用 Electron 平台
4218
+ * 通过消息 ID 从本地消息数据库中删除指定的一条或一组消息数据。删除多条消息时,请确保消息 ID 均属于同一会话
2564
4219
  * @param messageIds 消息 ID 列表, 需是同一会话的消息
4220
+ * @since 5.4.0
4221
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4222
+ * @example
4223
+ * 通过消息 ID 删除消息示例:
4224
+ * ```ts
4225
+ * const messageIds = [1, 2];
4226
+ * const res = await RongIMLib.electronExtension.deleteMessages(messageIds);
4227
+ * console.info('通过消息 ID 删除消息结果:', res);
4228
+ * ```
2565
4229
  */
2566
4230
  declare function deleteMessages(messageIds: number[]): Promise<IAsyncRes<void>>;
2567
4231
  /**
2568
4232
  * 清空会话下历史消息
2569
- * @param conversation 会话
4233
+ * @category Electron 独有
4234
+ * @description 本接口仅适用 Electron 平台,从本地消息数据库中删除指定会话所有消息。
4235
+ * @param conversation 会话信息
4236
+ * @since 5.4.0
4237
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4238
+ * @example
4239
+ * 清空会话下历史消息示例:
4240
+ * ```ts
4241
+ * const conversation = {
4242
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4243
+ * targetId: 'targetId',
4244
+ * };
4245
+ * const res = await RongIMLib.electronExtension.clearMessages(conversation);
4246
+ * console.info('清空会话下历史消息结果:', res);
4247
+ * ```
2570
4248
  */
2571
4249
  declare function clearMessages(conversation: IConversationOption): Promise<IAsyncRes<void>>;
2572
4250
  /**
2573
- * 从本地消息数据库中删除某一会话指定时间之前的消息数据
2574
- * @param conversation 会话
4251
+ * 通过时间戳删除
4252
+ * @category Electron 独有
4253
+ * @description 本接口仅适用 Electron 平台,根据时间戳,从本地消息数据库中删除单个会话中早于该时间戳的消息数据。
4254
+ * @param conversation 会话信息
2575
4255
  * @param timestamp 指定删除该时间戳之前的消息
2576
4256
  * @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
2577
4257
  * 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
4258
+ * @since 5.4.0
4259
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4260
+ * @example
4261
+ * 通过时间戳删除示例:
4262
+ * ```ts
4263
+ * const conversation = {
4264
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4265
+ * targetId: 'targetId',
4266
+ * };
4267
+ * const timestamp = Date.now();
4268
+ * const cleanSpace = false;
4269
+ * const res = await RongIMLib.electronExtension.deleteMessagesByTimestamp(conversation, timestamp, cleanSpace);
4270
+ * console.info('通过时间戳删除结果:', res);
4271
+ * ```
2578
4272
  */
2579
4273
  declare function deleteMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<IAsyncRes<void>>;
2580
4274
  /**
2581
4275
  * 批量清除多个会话的本地消息
4276
+ * @category Electron 独有
2582
4277
  * @param options 会话列表,最大数量为 20
2583
4278
  * @since 5.9.0
2584
4279
  * @description 从本地消息数据库中批量删除多个会话指定时间之前的消息数据,
@@ -2586,41 +4281,74 @@ declare function deleteMessagesByTimestamp(conversation: IConversationOption, ti
2586
4281
  * 支持的会话类型:单聊, 群聊, 聊天室, 系统消息
2587
4282
  * @hidden
2588
4283
  * @example
2589
- * ```js
2590
- * const conversations = [{
2591
- * conversationType: ConversationType.PRIVATE,
2592
- * targetId: 'targetId',
2593
- * timestamp: 0,
2594
- * channelId: '',
2595
- * }]
2596
- * RongIMLib.batchClearMessagesByTimestamp(conversations, 0).then(res => {
2597
- * if (res.code === ErrorCode.SUCCESS) {
2598
- * console.log('删除成功')
2599
- * } else {
2600
- * console.log('删除失败', res.code)
2601
- * }
2602
- * })
4284
+ * ```ts
4285
+ * const conversations = [{
4286
+ * conversationType: ConversationType.PRIVATE,
4287
+ * targetId: 'targetId',
4288
+ * timestamp: 0,
4289
+ * channelId: '',
4290
+ * }]
4291
+ * const res = await RongIMLib.batchClearMessagesByTimestamp(conversations, 0);
4292
+ * console.log('批量清除多个会话的本地消息结果:', res);
2603
4293
  * ```
2604
4294
  */
2605
4295
  declare function batchClearMessagesByTimestamp(options: IClearMessageOption[]): Promise<IAsyncRes<void>>;
2606
4296
  /**
2607
- * 向本地插入一条消息,不发送到服务器
2608
- * @param conversation 会话
2609
- * @param message 消息体
2610
- * @param options
2611
- * 注意:插入消息时,messageUid 将不会存入数据库
2612
- */
4297
+ * 向本地插入一条消息
4298
+ * @category Electron 独有
4299
+ * @description 本接口仅适用 Electron 平台,插入消息到本地数据库,不发送到服务器
4300
+ * * **注意**:插入消息时,messageUId 将不会存入数据库
4301
+ * @since 5.4.0
4302
+ * @param conversation 会话信息
4303
+ * @param message 消息体,@since 5.6.1 增加支持 {@link BaseMessage} 类型
4304
+ * @param options 插入消息配置,类型为 {@link IInsertOptions}
4305
+ * @defaultValues options = {}
4306
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedMessage} 类型的消息对象
4307
+ * @example
4308
+ * 插入消息示例:
4309
+ * ```ts
4310
+ * const conversation = {
4311
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4312
+ * targetId: 'targetId',
4313
+ * };
4314
+ * const message = new RongIMLib.TextMessage({ content: 'hello' });
4315
+ * const options = {
4316
+ * searchContent: 'hello',
4317
+ * };
4318
+ * const res = await RongIMLib.electronExtension.insertMessage(conversation, message, options);
4319
+ * console.info('插入消息结果:', res);
4320
+ * ```
4321
+ */
2613
4322
  declare function insertMessage(conversation: IConversationOption, message: IAReceivedMessage | BaseMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
2614
4323
  /**
2615
4324
  * 批量向本地插入消息
4325
+ * @category Electron 独有
4326
+ * @description 本接口仅适用 Electron 平台,批量插入消息到本地数据库,不发送到服务器,目前仅有私有云和 RCE 使用 api 标注 hidden
4327
+ * @hidden
4328
+ * @since 5.7.2
2616
4329
  * @param messages 批量插入的消息体
2617
4330
  * @param checkDuplicate 选择是否排重,默认 false
2618
- * @returns
4331
+ * @defaultValues checkDuplicate = false
4332
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
2619
4333
  */
2620
4334
  declare function batchInsertMessage(messages: IInsertMessage[], checkDuplicate: boolean): Promise<IAsyncRes<boolean>>;
2621
4335
  /**
2622
4336
  * 获取会话所有消息数
4337
+ * @category Electron 独有
4338
+ * @description 本接口仅适用 Electron 平台,获取指定会话下的所有消息数
2623
4339
  * @param conversation
4340
+ * @since 5.7.2
4341
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 消息数
4342
+ * @example
4343
+ * 获取会话所有消息数示例:
4344
+ * ```ts
4345
+ * const conversation = {
4346
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4347
+ * targetId: 'targetId',
4348
+ * };
4349
+ * const res = await RongIMLib.electronExtension.getMessageCount(conversation);
4350
+ * console.info('获取会话所有消息数结果:', res);
4351
+ * ```
2624
4352
  */
2625
4353
  declare function getMessageCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
2626
4354
  /**
@@ -2639,29 +4367,68 @@ declare function getPrivateMessageDeliverTime(messageUId: string): Promise<IAsyn
2639
4367
  declare function getGroupMessageDeliverList(targetId: string, messageUId: string): Promise<IAsyncRes<IGroupMessageDeliverInfo>>;
2640
4368
  /**
2641
4369
  * 设置融云消息重排开关
2642
- *
2643
- * 发送方弱网情况下发送消息,消息到达服务但发送方没有收到服务 ack,导致发送方认为消息发送失败
4370
+ * @category Electron 独有
4371
+ * @description 发送方弱网情况下发送消息,消息到达服务但发送方没有收到服务 ack,导致发送方认为消息发送失败
2644
4372
  * 此种情况下,服务端和接收方都会收到第一条消息
2645
4373
  * 此时发送方重发该消息,再次达到服务,那么此时服务端会有两条消息(消息内容相同,messageUid 不同
2646
- * 接收方会收到两条内容相同 messageUid 不同的消息,SDK 此时会把第二条相同内容消息排重掉
4374
+ * 接收方会收到两条内容相同 messageUId 不同的消息,SDK 此时会把第二条相同内容消息排重掉
2647
4375
  * 以此来保证重发的相同内容消息,发送方只有一条消息,接收方也只有一条消息
2648
4376
  *
2649
4377
  * 当消息量少时,消息排重影响不大;但是本地存在大量消息时,排重会出现性能问题
2650
4378
  * 当本地存在大量消息,且发生收消息卡顿时,建议将排重关闭
2651
4379
  *
2652
4380
  * @param checkDuplicate 是否使用融云消息重排机制 true: 开启, false: 关闭
2653
- * @description
2654
- * @returns data => true: 成功,false: 失败
2655
- *
4381
+ * @since 5.7.1
4382
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data boolean 类型的操作结果
4383
+ * @example
4384
+ * 设置融云消息重排开关示例:
4385
+ * ```ts
4386
+ * const checkDuplicate = true;
4387
+ * const res = await RongIMLib.electronExtension.setCheckDuplicateMessage(checkDuplicate);
4388
+ * console.info('设置融云消息重排开关结果:', res);
4389
+ * ```
2656
4390
  */
2657
4391
  declare function setCheckDuplicateMessage(checkDuplicate?: boolean): Promise<IAsyncRes<boolean>>;
4392
+ /**
4393
+ * 设置聊天室消息重排开关
4394
+ * @category Electron 独有
4395
+ * @description 仅支持聊天室消息重排开关,不支持其他会话类型,聊天室消息重排开关默认开启
4396
+ * 目前仅支持对 CUID 进行排重策略修改
4397
+ * @hidden 产品协商暂不对外提供
4398
+ * @since 5.9.9
4399
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
4400
+ * @example
4401
+ * 设置聊天室消息重排开关示例:
4402
+ * ```ts
4403
+ * const checkDuplicate = true;
4404
+ * const res = await RongIMLib.electronExtension.setCheckChatRoomDuplicateMessage(checkDuplicate);
4405
+ * console.info('设置聊天室消息重排开关结果:', res);
4406
+ * ```
4407
+ */
2658
4408
  declare function setCheckChatRoomDuplicateMessage(checkDuplicate?: boolean): Promise<IAsyncRes<boolean>>;
2659
4409
  /**
2660
4410
  * 获取本地指定时间戳前后 N 条消息方法
2661
- * @param conversation
2662
- * @param option
2663
- * @returns
2664
- * 与移动端保持一致 beforeCount,afterCount 仅验证是否大于等于0,上限没做控制
4411
+ * @category Electron 独有
4412
+ * @description 本接口仅适用 Electron 平台,获取本地指定时间戳前后 N 条消息
4413
+ * @param conversation 会话信息
4414
+ * @param option 获取参数
4415
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedMessage[]} 类型的消息列表
4416
+ * @since 5.9.8
4417
+ * @example
4418
+ * 获取本地指定时间戳前后 N 条消息示例:
4419
+ * ```ts
4420
+ * const conversation = {
4421
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4422
+ * targetId: 'targetId',
4423
+ * };
4424
+ * const option = {
4425
+ * timestamp: 0,
4426
+ * beforeCount: 10,
4427
+ * afterCount: 10,
4428
+ * };
4429
+ * const res = await RongIMLib.electronExtension.getMessagesAroundTimestamp(conversation, option);
4430
+ * console.info('获取本地指定时间戳前后 N 条消息结果:', res);
4431
+ * ```
2665
4432
  */
2666
4433
  declare function getMessagesAroundTimestamp(conversation: IConversationOption, option: {
2667
4434
  timestamp: number;
@@ -2670,14 +4437,33 @@ declare function getMessagesAroundTimestamp(conversation: IConversationOption, o
2670
4437
  }): Promise<IAsyncRes<IAReceivedMessage[]>>;
2671
4438
 
2672
4439
  /**
2673
- * 清除本地数据, 包括消息列表、会话列表、拉取消息的时间戳
2674
- * @returns data => true: 成功,false: 失败
4440
+ * 清除本地数据
4441
+ * @category Electron 独有
4442
+ * @description 该方法用于清除本地数据,包括消息列表、会话列表、拉取消息的时间戳
4443
+ * * **注意**:清除后在此登录会作为新设备进行消息拉取切操作无法恢复,谨慎使用
4444
+ * @since 5.4.0
4445
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型,表示是否清除成功
4446
+ * @example
4447
+ * 清除本地数据示例:
4448
+ * ```ts
4449
+ * const res = await RongIMLib.electronExtension.clearLocalData();
4450
+ * console.info('清除本地数据结果:', res);
4451
+ * ```
2675
4452
  */
2676
4453
  declare function clearLocalData(): Promise<IAsyncRes<boolean>>;
2677
4454
  /**
2678
4455
  * 获取是否使用 Electron 扩展
2679
- * @since 5.8.3
2680
- */
4456
+ * @category Electron 独有
4457
+ * @description 该方法用于判断当前是否使用 Electron 扩展
4458
+ * @since 5.8.3
4459
+ * @returns {boolean} 是否使用 Electron 扩展
4460
+ * @example
4461
+ * 获取是否使用 Electron 扩展示例:
4462
+ * ```ts
4463
+ * const res = await RongIMLib.electronExtension.enable();
4464
+ * console.info('获取是否使用 Electron 扩展结果:', res);
4465
+ * ```
4466
+ */
2681
4467
  declare function enable(): boolean;
2682
4468
 
2683
4469
  declare const index_getAllConversationList: typeof getAllConversationList;
@@ -2743,57 +4529,200 @@ declare namespace index {
2743
4529
 
2744
4530
  /**
2745
4531
  * 设置代理
2746
- * @param proxy
2747
- * @returns
4532
+ * @hidden
4533
+ * @since 5.7.0
4534
+ * @param proxy 代理信息
2748
4535
  */
2749
4536
  declare function setProxy(proxy: IProxy | null): IPromiseResult<IProxy>;
2750
4537
  /**
2751
4538
  * 获取代理
2752
- * @param proxy
4539
+ * @hidden
4540
+ * @since 5.7.0
2753
4541
  * @returns
2754
4542
  */
2755
4543
  declare function getProxy(): IPromiseResult<IProxy>;
2756
4544
  /**
2757
4545
  * 测试代理
2758
- * @param proxy
2759
- * @returns
4546
+ * @hidden
4547
+ * @since 5.7.0
4548
+ * @param proxy 代理信息
4549
+ * @param testHost 测试代理地址
2760
4550
  */
2761
4551
  declare function testProxy(proxy: IProxy, testHost: string): IPromiseResult<IResponse>;
2762
4552
 
2763
4553
  /**
2764
4554
  * 订阅用户状态
2765
- * <p>此方法用于订阅一组用户的状态。当这些用户的状态发生变化时,将通过回调接口通知调用者。</p>
4555
+ * @category 订阅用户状态
4556
+ * @description 此方法用于订阅一组用户的状态。当这些用户的状态发生变化时,将通过回调接口通知调用者
4557
+ * **注意**:
4558
+ * 1. 一次订阅用户的上限为 200 个, 订阅的用户数最多为 1000 个,一个用户最多可以被 5000 个用户订阅
4559
+ * 2. 订阅用户在线状态能力需要开通服务,开通路径: IM 服务 > IM 服务管理 > 客户端用户在线状态订阅
2766
4560
  * @param userIds 被订阅用户 ID 列表,一次最多订阅 200 个用户
2767
4561
  * @param subscribeType 订阅类型
2768
- * @param expiry 订阅有效期,单位为秒
2769
- * @returns 订阅错误为 26021 时返回被订阅达上限的用户 ID 列表
4562
+ * @param expiry 订阅有效期,取值范围为[60,2592000](单位:秒)
4563
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,订阅错误为 26021 时返回被订阅达上限(用户最多可以被 5000 个用户订阅)的用户 ID 列表
2770
4564
  * @since 5.9.8
4565
+ * @example 订阅用户状态示例:
4566
+ * ```ts
4567
+ * const userIds = ['user1', 'user2'];
4568
+ * const subscribeType = RongIMLib.SubscribeType.ONLINE_STATUS;
4569
+ * // 设置订阅时间,取值范围为[60,2592000](单位:秒)。
4570
+ * const expiry = 60;
4571
+ * const res = await RongIMLib.subscribeUserStatus(userIds, subscribeType, expiry);
4572
+ * console.log('订阅用户状态结果:', res);
4573
+ * ```
2771
4574
  */
2772
4575
  declare function subscribeUserStatus(userIds: string[], subscribeType: SubscribeType, expiry: number): Promise<IAsyncRes<string[]>>;
2773
4576
  /**
2774
4577
  * 取消订阅用户状态
2775
- * <p>此方法用于取消已经订阅的用户状态事件。</p>
2776
- * @param userIds 被订阅用户 ID 列表,一次最多订阅 200 个用户
2777
- * @param subscribeType 订阅类型
2778
- * @returns
4578
+ * @category 订阅用户状态
4579
+ * @description 此方法用于取消已经订阅的用户状态事件
4580
+ * @param userIds 被订阅用户 ID 列表,一次最多传递 200 个用户
4581
+ * @param subscribeType 订阅类型, 可在 {@link SubscribeType} 中获取
2779
4582
  * @since 5.9.8
4583
+ * @example 取消订阅用户状态示例:
4584
+ * ```ts
4585
+ * const userIds = ['user1', 'user2'];
4586
+ * const subscribeType = RongIMLib.SubscribeType.ONLINE_STATUS;
4587
+ * const res = await RongIMLib.unSubscribeUserStatus(userIds, subscribeType);
4588
+ * console.log('取消订阅用户状态结果:', res);
4589
+ * ```
2780
4590
  */
2781
4591
  declare function unSubscribeUserStatus(userIds: string[], subscribeType: SubscribeType): Promise<IAsyncRes<void>>;
2782
4592
  /**
2783
- * 查询当前的订阅用户列表
2784
- * <p>此方法用于获取当前所有订阅的事件的状态信息。(仅支持在线状态类型)</p>
4593
+ * 分页查询已订阅用户的状态信息
4594
+ * @category 订阅用户状态
4595
+ * @description 此方法用于获取当前所有订阅的事件的状态信息(仅支持在线状态类型)
2785
4596
  * @param pageSize 数量
2786
4597
  * @param offset 分页偏移量
2787
- * @returns
4598
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,其中 data 为 {@link ISubscribeUserStatusInfo} 类型数组
2788
4599
  * @since 5.9.8
4600
+ * @example 分页查询已订阅用户的状态信息示例:
4601
+ * ```ts
4602
+ * const pageSize = 10;
4603
+ * const offset = 0;
4604
+ * const subscribeType = RongIMLib.SubscribeType.ONLINE_STATUS;
4605
+ * const res = await RongIMLib.getSubscribeUserList(subscribeType, pageSize, offset);
4606
+ * console.log('分页查询已订阅用户的状态信息结果:', res);
4607
+ * ```
2789
4608
  */
2790
4609
  declare function getSubscribeUserList(subscribeType: SubscribeType, pageSize: number, offset: number): Promise<IAsyncRes<ISubscribeUserStatusInfo[]>>;
2791
4610
  /**
2792
- * 获取指定用户的状态
2793
- * @param userIds 被订阅用户 ID 列表
2794
- * @returns
4611
+ * 查询订阅状态信息
4612
+ * @category 订阅用户状态
4613
+ * @description 查询指定用户和订阅类型的状态信息。 一次最多查询 200 个用户的状态信息
4614
+ * @param userIds 被订阅用户 ID 列表, 列表不可为空,且一次最多查询 200 个用户的状态信息
4615
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,其中 data 为 {@link ISubscribeUserStatusInfo} 类型数组
2795
4616
  * @since 5.9.8
4617
+ * @example 查询订阅状态信息示例:
4618
+ * ```ts
4619
+ * const userIds = ['user1', 'user2'];
4620
+ * const subscribeType = RongIMLib.SubscribeType.ONLINE_STATUS;
4621
+ * const res = await RongIMLib.getSubscribeUserStatus(subscribeType, userIds);
4622
+ * console.log('查询订阅状态信息结果:', res);
4623
+ * ```
2796
4624
  */
2797
4625
  declare function getSubscribeUserStatus(subscribeType: SubscribeType, userIds: string[]): Promise<IAsyncRes<ISubscribeUserStatusInfo[]>>;
4626
+ /**
4627
+ * 更新用户资料
4628
+ * @category 用户资料
4629
+ * @description 此方法用于更新当前用户的资料信息
4630
+ * @param profile 用户资料信息
4631
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,其中 data 为 { errorKey: string } 类型
4632
+ * @since 5.10.1
4633
+ * @example 更新用户资料示例:
4634
+ * ```ts
4635
+ * const profile = {
4636
+ * name: 'name',
4637
+ * portraitUri: 'portraitUri',
4638
+ * email: 'email',
4639
+ * birthday: 'birthday',
4640
+ * gender: 1,
4641
+ * location: 'location',
4642
+ * role: 1,
4643
+ * level: 1,
4644
+ * extraProfile: {
4645
+ * key1: 'value1',
4646
+ * key2: 'value2',
4647
+ * },
4648
+ * }
4649
+ * const res = await RongIMLib.updateMyUserProfile(profile);
4650
+ * console.log('更新用户资料结果:', res);
4651
+ * ```
4652
+ */
4653
+ declare function updateMyUserProfile(profile: IUserProfileInfo): Promise<IAsyncRes<{
4654
+ errorKey: string;
4655
+ }>>;
4656
+ /**
4657
+ * 批量获取用户资料
4658
+ * @category 用户资料
4659
+ * @description 此方法用于批量获取用户的资料信息
4660
+ * @param userIds 用户ID 列表,一次最多获取 100 个
4661
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,其中 data 为 {@link IUserProfileInfo} 类型数组
4662
+ * @since 5.10.1
4663
+ * @example 批量获取用户资料示例:
4664
+ * ```ts
4665
+ * const userIds = ['user1', 'user2'];
4666
+ * const res = await RongIMLib.getUserProfiles(userIds);
4667
+ * console.log('批量获取用户资料结果:', res);
4668
+ * ```
4669
+ */
4670
+ declare function getUserProfiles(userIds: string[]): Promise<IAsyncRes<IUserProfileInfo[]>>;
4671
+ /**
4672
+ * 获取当前用户资料
4673
+ * @category 用户资料
4674
+ * @description 此方法用于获取当前用户的资料信息
4675
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,其中 data 为 {@link IUserProfileInfo} 类型
4676
+ * @since 5.10.1
4677
+ * @example 获取当前用户资料示例:
4678
+ * ```ts
4679
+ * const res = await RongIMLib.getMyUserProfile();
4680
+ * console.log('获取当前用户资料结果:', res);
4681
+ * ```
4682
+ */
4683
+ declare function getMyUserProfile(): Promise<IAsyncRes<IUserProfileInfo>>;
4684
+ /**
4685
+ * 用户权限设置
4686
+ * @category 用户资料
4687
+ * @description 此方法用于设置用户信息权限
4688
+ * @param Visibility 用户信息权限
4689
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,其中 data 为 void 类型
4690
+ * @since 5.10.1
4691
+ * @example 用户权限设置示例:
4692
+ * ```ts
4693
+ * const visibility = RongIMLib.UserProfileVisibility.EVERYONE;
4694
+ * const res = await RongIMLib.updateMyUserProfileVisibility(visibility);
4695
+ * console.log('用户权限设置结果:', res);
4696
+ * ```
4697
+ */
4698
+ declare function updateMyUserProfileVisibility(visibility: UserProfileVisibility): Promise<IAsyncRes<void>>;
4699
+ /**
4700
+ * 用户权限获取
4701
+ * @category 用户资料
4702
+ * @description 此方法用于获取用户信息权限
4703
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,其中 data 为 {@link UserProfileVisibility} 类型
4704
+ * @since 5.10.1
4705
+ * @example 用户权限获取示例:
4706
+ * ```ts
4707
+ * const res = await RongIMLib.getMyUserProfileVisibility();
4708
+ * console.log('用户权限获取结果:', res);
4709
+ * ```
4710
+ */
4711
+ declare function getMyUserProfileVisibility(): Promise<IAsyncRes<UserProfileVisibility>>;
4712
+ /**
4713
+ * 按用户应用号精确搜索用户信息
4714
+ * @category 用户资料
4715
+ * @description 此方法用于按用户应用号精确搜索用户信息
4716
+ * @param uniqueId 用户应用号
4717
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,其中 data 为 {@link IUserProfileInfo} 类型
4718
+ * @since 5.10.1
4719
+ * @example 按用户应用号精确搜索用户信息示例:
4720
+ * ```ts
4721
+ * const uniqueId = 'uniqueId';
4722
+ * const res = await RongIMLib.searchUserProfileByUniqueId(uniqueId);
4723
+ * console.log('按用户应用号精确搜索用户信息结果:', res);
4724
+ * ```
4725
+ */
4726
+ declare function searchUserProfileByUniqueId(uniqueId: string): Promise<IAsyncRes<IUserProfileInfo>>;
2798
4727
 
2799
- export { BaseMessage, _default$a as CombineMessage, _default$9 as CombineV2Message, CombineV2MessageContent, _default$2 as CommandMessage, ConnectType, EventListeners, Events, _default$8 as FileMessage, _default$7 as GIFMessage, GetHistoryMessageOption, GetHistoryMessageResult, _default as GroupNotificationMessage, _default$d as HQVoiceMessage, IAReceivedConversation, IAReceivedConversationByTag, IAReceivedMessage, IAUltraGroupReceivedConversation, ICombineMessageBody, ICommandMessageBody, IConversationEvent, IConversationState, IConversationUpdateItem, IExtraData, IFileMessageBody, IGIFMessageBody, IGetHistoryMessagesByTypesOption, IGroupNotificationMessageBody, IHQVoiceMessageBody, IImageMessageBody, IImageMessageOption, IInformationNotificationMessageBody, IInitOption, IInsertOptions, ILocationMessageBody, IMessageDesc, IMessageReceiptRequestEvent, IMessageReceiptResponseEvent, IMessagesEvent, IReadReceiptReceivedEvent, IRecallMessageOptions, IReceivedUpdateConversation, IReferenceMessageBody, IRichContentMessageBody, ISearchMessageInTimeRangeOption, ISendBody, ISendFileMessageOptions, ISendImageMessageOptions, ISendMessageOptions, ISendSightMessageOptions, ISightMessageBody, ITextMessageBody, IThumbnailConfig, ITypingStatusEvent, IUploadConfig, IUploadHooks, IUploadInfo, IUploadMessageOption, IUploadResult, IUserInfo, IVoiceMessageBody, _default$e as ImageMessage, _default$1 as InformationNotificationMessage, _default$5 as LocationMessage, MentionedInfo, MessageConstructor, MessageType, _default$4 as ReferenceMessage, _default$3 as RichContentMessage, _default$c as SightMessage, _default$b as TextMessage, UploadTask, _default$6 as VoiceMessage, __addSDKVersion, addConversationsToTag, addEventListener, addTag, addToBlacklist, batchClearRemoteHistoryMessages, batchGetMessageReadReceiptInfoV4, batchRemoveConversation, batchSetConversationNotificationLevel, batchSetConversationToTop, bindRTCRoomForChatroom, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages$1 as clearMessages, clearMessagesUnreadStatus, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, createUploadTask, deleteLocalMessagesByTimestamp, deleteMessages$1 as deleteMessages, destroy, disconnect, index as electronExtension, forceRemoveChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, getAllConversationState, getAllUltraGroupUnreadCount, getAllUltraGroupUnreadMentionedCount, getAllUnreadMentionedCount, getBlacklist, getBlacklistStatus, getBlockUltraGroupList, getBlockedConversationList, getChatRoomEntry, getChatRoomInfo, getChatroomHistoryMessages, getConnectionStatus, getConversation, getConversationList$1 as getConversationList, getConversationNotificationLevel, getConversationNotificationStatus, getConversationTypeNotificationLevel, getConversationsFromTagByPage, getCurrentUserId, getDeviceId, getDownloadAuth, getFileToken, getFileUrl, getFirstUnreadMessage, getFirstUnreadMessageInfo, getHistoryMessages, getMessage, getMessageReadReceiptV4, getMessageReader, getProxy, getRemoteHistoryMessages, getServerTime, getSubscribeUserList, getSubscribeUserStatus, getTags, getTagsFromConversation, getTextMessageDraft, getTopConversationList, getTotalUnreadCount, getTotalUnreadCountByLevels, getTotalUnreadMentionedCountByLevels, getUltraGroupDefaultNotificationLevel, getUltraGroupFirstUnreadMessageTimestamp, getUltraGroupList, getUltraGroupMessageListByMessageUId, getUltraGroupUnreadCountByTargetId, getUltraGroupUnreadInfoList, getUltraGroupUnreadMentionedCountByTargetId, getUltraGroupUnreadMentionedMessages, getUnreadConversationList, getUnreadCount, getUnreadCountByTag, getUnreadMentionedCount, getUnreadMentionedMessages, init, insertMessage$1 as insertMessage, installPlugin, joinChatRoom, joinExistChatRoom, modifyMessage, onceEventListener, quitChatRoom, recallMessage, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeFromBlacklist, removeMessageExpansionForKey, removeTag, removeTagFromConversations, removeTagsFromConversation, saveTextMessageDraft, searchConversationByContent$1 as searchConversationByContent, searchMessages$1 as searchMessages, sendFileMessage, sendGIFMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptMessageV4, sendReadReceiptRequest, sendReadReceiptResponse, sendReadReceiptResponseV2, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, sendUltraGroupTypingStatus, setChatRoomEntries, setChatRoomEntry, setConversationNotificationLevel, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setConversationTypeNotificationLevel, setMessageReceivedStatus$1 as setMessageReceivedStatus, setProxy, setUltraGroupDefaultNotificationLevel, stopUploadTask, subscribeUserStatus, testProxy, unSubscribeUserStatus, updateExpansionForUltraGroupMessage, updateMessageExpansion, updateTag, upload };
4728
+ export { BaseMessage, _default$a as CombineMessage, _default$9 as CombineV2Message, CombineV2MessageContent, _default$2 as CommandMessage, ConnectType, EventListeners, Events, _default$8 as FileMessage, _default$7 as GIFMessage, GetHistoryMessageOption, GetHistoryMessageResult, _default as GroupNotificationMessage, _default$d as HQVoiceMessage, IAReceivedConversation, IAReceivedConversationByTag, IAReceivedMessage, IAUltraGroupReceivedConversation, IAuditInfo, ICombineMessageBody, ICommandMessageBody, IConversationEvent, IConversationState, IConversationUpdateItem, IExtraData, IFileMessageBody, IGIFMessageBody, IGetHistoryMessagesByTypesOption, IGroupNotificationMessageBody, IHQVoiceMessageBody, IImageMessageBody, IImageMessageOption, IInformationNotificationMessageBody, IInitOption, IInsertOptions, ILocationMessageBody, IMessageDesc, IMessageReceiptRequestEvent, IMessageReceiptResponseEvent, IMessagesEvent, IReadReceiptReceivedEvent, IRecallMessageOptions, IReceivedUpdateConversation, IReferenceMessageBody, IRichContentMessageBody, ISearchMessageInTimeRangeOption, ISendBody, ISendFileMessageOptions, ISendImageMessageOptions, ISendMessageOptions, ISendSightMessageOptions, ISightMessageBody, ITextMessageBody, IThumbnailConfig, ITypingStatusEvent, IUploadConfig, IUploadHooks, IUploadInfo, IUploadMessageOption, IUploadResult, IUserInfo, IVoiceMessageBody, _default$e as ImageMessage, _default$1 as InformationNotificationMessage, _default$5 as LocationMessage, MentionedInfo, MessageAuditType, MessageConstructor, MessageType, _default$4 as ReferenceMessage, _default$3 as RichContentMessage, _default$c as SightMessage, _default$b as TextMessage, UploadTask, _default$6 as VoiceMessage, __addSDKVersion, addConversationsToTag, addEventListener, addTag, addToBlacklist, batchClearRemoteHistoryMessages, batchGetMessageReadReceiptInfoV4, batchRemoveConversation, batchSetConversationNotificationLevel, batchSetConversationToTop, bindRTCRoomForChatroom, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages$1 as clearMessages, clearMessagesUnreadStatus, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, createUploadTask, deleteLocalMessagesByTimestamp, deleteMessages$1 as deleteMessages, destroy, disconnect, index as electronExtension, forceRemoveChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, getAllConversationState, getAllUltraGroupUnreadCount, getAllUltraGroupUnreadMentionedCount, getAllUnreadMentionedCount, getBlacklist, getBlacklistStatus, getBlockUltraGroupList, getBlockedConversationList, getChatRoomEntry, getChatRoomInfo, getChatroomHistoryMessages, getConnectionStatus, getConversation, getConversationList$1 as getConversationList, getConversationNotificationLevel, getConversationNotificationStatus, getConversationTypeNotificationLevel, getConversationsFromTagByPage, getCurrentUserId, getDeviceId, getDownloadAuth, getFileToken, getFileUrl, getFirstUnreadMessage, getFirstUnreadMessageInfo, getHistoryMessages, getMessage, getMessageReadReceiptV4, getMessageReader, getMyUserProfile, getMyUserProfileVisibility, getProxy, getRemoteHistoryMessages, getServerTime, getSubscribeUserList, getSubscribeUserStatus, getTags, getTagsFromConversation, getTextMessageDraft, getTopConversationList, getTotalUnreadCount, getTotalUnreadCountByLevels, getTotalUnreadMentionedCountByLevels, getUltraGroupDefaultNotificationLevel, getUltraGroupFirstUnreadMessageTimestamp, getUltraGroupList, getUltraGroupMessageListByMessageUId, getUltraGroupUnreadCountByTargetId, getUltraGroupUnreadInfoList, getUltraGroupUnreadMentionedCountByTargetId, getUltraGroupUnreadMentionedMessages, getUnreadConversationList, getUnreadCount, getUnreadCountByTag, getUnreadMentionedCount, getUnreadMentionedMessages, getUserProfiles, init, insertMessage$1 as insertMessage, installPlugin, joinChatRoom, joinExistChatRoom, modifyMessage, onceEventListener, quitChatRoom, recallMessage, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeFromBlacklist, removeMessageExpansionForKey, removeTag, removeTagFromConversations, removeTagsFromConversation, saveTextMessageDraft, searchConversationByContent$1 as searchConversationByContent, searchMessages$1 as searchMessages, searchUserProfileByUniqueId, sendFileMessage, sendGIFMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptMessageV4, sendReadReceiptRequest, sendReadReceiptResponse, sendReadReceiptResponseV2, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, sendUltraGroupTypingStatus, setChatRoomEntries, setChatRoomEntry, setConversationNotificationLevel, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setConversationTypeNotificationLevel, setMessageReceivedStatus$1 as setMessageReceivedStatus, setProxy, setUltraGroupDefaultNotificationLevel, stopUploadTask, subscribeUserStatus, testProxy, unSubscribeUserStatus, updateExpansionForUltraGroupMessage, updateMessageExpansion, updateMyUserProfile, updateMyUserProfileVisibility, updateTag, upload };