@rongcloud/imlib-next 5.14.1 → 5.16.0-c-rtc-alpha-2

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,5 +1,5 @@
1
- import { FileType, APIContext, IAsyncRes, LogLevel, EnableLogL, AreaCode, ConversationType, MessageDirection, ReceivedStatus, IReceivedStatusInfo, SentStatus, IReadReceiptResponseInfo, IReadReceiptInfo, IPushConfig, UltraGroupChannelType, RCConnectionStatus, IPluginGenerator, NotificationStatus, NotificationLevel, IUltraUnreadMsg, IUserProfile, IConversationOption, ITypingMessage, IUpdateItem, ErrorCode, IChatroomListenerData, IExpansionListenerData, IBlockedMessageInfo, IOperateStatusNotify, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUserGroupStatusInfo, IMessageDeliver, IGroupMessageDeliverStatus, IReadReceiptData, ISyncReadStatusData, ISubscribeUserStatusInfo, ISubscribeRelationInfo, SubscribeType, IUserProfileInfo, IGroupOperationInfo, IGroupInfoChanged, IGroupMemberInfoChanged, IGroupApplicationInfo, IGroupRemarkChangedSync, IGroupFollowsChangedSync, IFriendAdd, IFriendDelete, IFriendApplicationStatusChange, IFriendInfoChangedSync, IBaseConversationInfo, IConversationState as IConversationState$1, IConversationIdentifier, IConversationUnreadCount, 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, IGroupInfoOption, IProcessCode, IGroupInfo, IQuitGroupConfig, GroupMemberRole, IPagingQueryOption, IPagingQueryResult, IGroupMemberInfo, GroupApplicationDirection, GroupApplicationStatus, IFollowsInfo, DirectionType, IFriendRelationInfo, QueryFriendsDirectionType, IFriendInfo, FriendApplicationType, FriendApplicationStatus, IFriendApplicationInfo, FriendAddPermission, INotificationQuietHoursSetting, RCResult } from '@rongcloud/engine';
2
- export { AreaCode, ChatroomEntryType, ChatroomSyncStatusReason, ChatroomUserChangeType, ChrmMemBanType, ChrmMemOperateType, ChrmSyncStatus, ConnectionStatus, ConversationType, DirectionType, EnableLogL, ErrorCode, FileType, FriendAddPermission, FriendApplicationStatus, FriendApplicationType, FriendRelationType, GroupApplicationDirection, GroupApplicationStatus, GroupApplicationType, GroupInviteHandlePermission, GroupJoinPermission, GroupMemberInfoEditPermission, GroupMemberRole, GroupOperation, GroupOperationPermission, GroupOperationType, 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, IFollowsInfo, IFriendAdd, IFriendApplicationInfo, IFriendApplicationStatusChange, IFriendDelete, IFriendInfo, IFriendInfoChangedSync, IFriendRelationInfo, IGetUltraGroupListOption, IGooglePushConfig, IGroupApplicationInfo, IGroupFollowsChangedSync, IGroupFollowsList, IGroupFollowsUserInfo, IGroupInfo, IGroupInfoChanged, IGroupInfoOption, IGroupMemberInfo, IGroupMemberInfoChanged, IGroupMembers, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IGroupMessageDeliveredStatusInfo, IGroupOperationInfo, IGroupReadReceiptData, IGroupRemarkChangedSync, IHarmonyOSPushConfig, IInsertMessage, IMessageDeliver, IMessageReadReceiptV4Response, IMessageReader, IMessageReaderResponse, INotificationQuietHoursSetting, IOperateInfo, IOperateStatusNotify, IOperateSummary, IPagingQueryOption, IPagingQueryResult, IPrivateReadReceiptData, IProcessCode, IPromiseResult, IProxy, IPushConfig, IQuitGroupConfig, 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, PushNotificationQuietHoursLevel, QueryFriendsDirectionType, RCConnectionStatus, ReceivedStatus, SentStatus, SubscribeOperationType, SubscribeType, UltraGroupChannelChangeType, UltraGroupChannelType, UploadMethod, UserProfileVisibility } from '@rongcloud/engine';
1
+ import { FileType, APIContext, IAsyncRes, LogLevel, EnableLogL, AreaCode, ConversationType, MessageDirection, ReceivedStatus, IReceivedStatusInfo, SentStatus, IReadReceiptResponseInfo, IReadReceiptInfo, IPushConfig, UltraGroupChannelType, RCConnectionStatus, IPluginGenerator, NotificationStatus, NotificationLevel, IUltraUnreadMsg, IRecallMsgOptions, IConversationOption, ITypingMessage, IUpdateItem, ErrorCode, IChatroomListenerData, IExpansionListenerData, IBlockedMessageInfo, IOperateStatusNotify, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUserGroupStatusInfo, IMessageDeliver, IGroupMessageDeliverStatus, IReadReceiptData, ISyncReadStatusData, ISubscribeUserStatusInfo, ISubscribeRelationInfo, SubscribeType, IUserProfileInfo, IGroupOperationInfo, IGroupInfoChanged, IGroupMemberInfoChanged, IGroupApplicationInfo, IGroupRemarkChangedSync, IGroupFollowsChangedSync, IFriendAdd, IFriendDelete, IFriendApplicationStatusChange, IFriendInfoChangedSync, IStreamMessageResponseEventData as IStreamMessageResponseEventData$1, IBaseConversationInfo, IConversationState as IConversationState$1, IConversationIdentifier, IConversationUnreadCount, IGetUltraGroupListOption, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadMentionedOption, IUltraGroupUnreadInfo, IChatroomJoinResponse, IChatroomInfo, IChatroomEntry, IChatroomEntries, IRemoveChatroomEntry, IRTCRoomBindOption, MentionedInfoBody, ICombineV2MessageContent, IClearMessageOption, IInsertMessage, IGroupMessageDeliverInfo, RCResult, IMessageReadReceiptV4Response, IGroupReadReceiptData, IMessageReaderResponse, IFirstUnreadMessageInfo, IReceivedMessage, IReceivedConversation, ITagParam, ITagInfo, IConversationTag, IUploadAuth, IDownloadAuth, UploadMethod, IProxy, IPromiseResult, IResponse, IUpdateMyProfileFail, UserProfileVisibility, IGroupInfoOption, ICreateGroupFail, IErrorKeys, IGroupInfo, IQuitGroupConfig, GroupMemberRole, IPagingQueryOption, IPagingQueryResult, IGroupMemberInfo, IProcessCode, GroupApplicationDirection, GroupApplicationStatus, IFollowsInfo, DirectionType, IFriendRelationInfo, QueryFriendsDirectionType, IFriendInfo, FriendApplicationType, FriendApplicationStatus, IFriendApplicationInfo, FriendAddPermission, INotificationQuietHoursSetting } from '@rongcloud/engine';
2
+ export { AreaCode, ChatroomEntryType, ChatroomSyncStatusReason, ChatroomUserChangeType, ChrmMemBanType, ChrmMemOperateType, ChrmSyncStatus, ConnectionStatus, ConversationType, DirectionType, EnableLogL, ErrorCode, FileType, FriendAddPermission, FriendApplicationStatus, FriendApplicationType, FriendRelationType, GroupApplicationDirection, GroupApplicationStatus, GroupApplicationType, GroupInviteHandlePermission, GroupJoinPermission, GroupMemberInfoEditPermission, GroupMemberRole, GroupOperation, GroupOperationPermission, GroupOperationType, 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, IErrorKeys, IEventListener, IExpansionListenerData, IFirstUnreadMessageInfo, IFollowsInfo, IFriendAdd, IFriendApplicationInfo, IFriendApplicationStatusChange, IFriendDelete, IFriendInfo, IFriendInfoChangedSync, IFriendRelationInfo, IGetUltraGroupListOption, IGooglePushConfig, IGroupApplicationInfo, IGroupFollowsChangedSync, IGroupFollowsList, IGroupFollowsUserInfo, IGroupInfo, IGroupInfoChanged, IGroupInfoOption, IGroupMemberInfo, IGroupMemberInfoChanged, IGroupMembers, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IGroupMessageDeliveredStatusInfo, IGroupOperationInfo, IGroupReadReceiptData, IGroupRemarkChangedSync, IHarmonyOSPushConfig, IInsertMessage, IMessageDeliver, IMessageReadReceiptV4Response, IMessageReader, IMessageReaderResponse, INotificationQuietHoursSetting, IOperateInfo, IOperateStatusNotify, IOperateSummary, IPagingQueryOption, IPagingQueryResult, IPrivateReadReceiptData, IProcessCode, IPromiseResult, IProxy, IPushConfig, IQuitGroupConfig, IRTCRoomBindOption, IReadReceiptData, IReadReceiptInfo, IReadReceiptResponseInfo, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IReceivedStatusInfo, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IResponse, IStreamMessageResponseChunkData, ISubscribeRelationInfo, ISubscribeStatusDetail, ISubscribeUserStatusInfo, ISyncReadStatusData, ITagInfo, ITagParam, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadInfo, IUltraGroupUnreadMentionedOption, IUltraUnreadMsg, IUpdateItem, IUpdateMyProfileFail, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserGroupChangeData, IUserGroupStatusInfo, IUserProfile, IUserProfileInfo, IiOSPushConfig, InterruptionLevel, LogL, LogLevel, MentionedInfoBody, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, NotificationLevel, NotificationStatus, OnlineStatus, OperateStatus, PlatformInfo, PushImportanceHonor, PushNotificationQuietHoursLevel, QueryFriendsDirectionType, RCConnectionStatus, RCResult, ReceivedStatus, SentStatus, StreamMessageResponseEventType, SubscribeOperationType, SubscribeType, UltraGroupChannelChangeType, UltraGroupChannelType, UploadMethod, UserProfileVisibility } from '@rongcloud/engine';
3
3
 
4
4
  /**
5
5
  * 缩略图配置
@@ -29,11 +29,12 @@ interface IThumbnailConfig {
29
29
  interface IUploadConfig {
30
30
  getFileToken: TGetFileToken;
31
31
  getFileUrl: TGetFileUrl;
32
+ /** RCX 服务独立配置,优先级高于 ossConfig 配置 */
32
33
  customDomain: string;
33
- serverType?: number;
34
+ /** 导航下发的 ossConfig 配置 */
34
35
  ossConfig?: string;
36
+ /** 历史版本 navi 中单独下发的上传服务地址,优先级低于 ossConfig 配置 */
35
37
  uploadServer?: string;
36
- bosAddr?: string;
37
38
  }
38
39
  /**
39
40
  * @hidden
@@ -114,7 +115,7 @@ declare type IInitOption = {
114
115
  */
115
116
  logOutputLevel?: EnableLogL;
116
117
  /**
117
- * @deprecated - 配置已废弃
118
+ * @deprecated 配置已废弃
118
119
  */
119
120
  logStdout?: (logLevel: LogLevel, content: string) => void;
120
121
  /**
@@ -140,7 +141,7 @@ declare type IInitOption = {
140
141
  */
141
142
  checkCA?: boolean;
142
143
  /**
143
- * 七牛上传文件地址域名(仅私有云 RCX 服务支持)
144
+ * 七牛上传文件地址域名(仅私有云 RCX 服务支持),优先级高于 ossConfig 配置
144
145
  */
145
146
  uploadDomain?: string;
146
147
  /**
@@ -701,7 +702,11 @@ declare enum Events {
701
702
  * 数据库升级完成
702
703
  * @since 5.10.3
703
704
  */
704
- DATABASE_UPGRADE_DID_COMPLETE = "DATABASE_UPGRADE_DID_COMPLETE"
705
+ DATABASE_UPGRADE_DID_COMPLETE = "DATABASE_UPGRADE_DID_COMPLETE",
706
+ /**
707
+ * 流式消息拉取响应事件
708
+ */
709
+ STREAM_MESSAGE_RESPONSE = "STREAM_MESSAGE_RESPONSE"
705
710
  }
706
711
  /**
707
712
  * 消息审核状态
@@ -887,7 +892,7 @@ interface IAReceivedConversation {
887
892
  unreadMentionedMeCount?: number;
888
893
  /**
889
894
  * 会话操作时间
890
- * @description - 5.8.4 版本开始,Electron 平台支持此参数,收发消息、设置置顶等操作会更新。
895
+ * - 5.8.4 版本开始,Electron 平台支持此参数,收发消息、设置置顶等操作会更新。
891
896
  * - 5.14.0 版本开始 Web 端支持此参数,仅收发消息时会更新。
892
897
  * @since 5.8.4
893
898
  */
@@ -1125,47 +1130,7 @@ interface IMessageDesc {
1125
1130
  * 撤回消息 option 参数
1126
1131
  * @category Interface
1127
1132
  */
1128
- interface IRecallMessageOptions {
1129
- /**
1130
- * 消息的唯一id,客户端依赖此属性查找要撤回的消息
1131
- */
1132
- messageUId: string;
1133
- /**
1134
- * 消息发送时间,服务端依赖此属性查找要撤回的消息
1135
- */
1136
- sentTime: number;
1137
- /**
1138
- * 撤回消息携带用户信息
1139
- */
1140
- user?: IUserProfile;
1141
- /**
1142
- * 是否发送静默消息
1143
- * @description
1144
- * 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
1145
- */
1146
- disableNotification?: boolean;
1147
- /**
1148
- * 移动端推送配置
1149
- */
1150
- pushConfig?: IPushConfig;
1151
- /**
1152
- * 撤回消息携带扩展信息
1153
- */
1154
- extra?: string;
1155
- /**
1156
- * 是否删除原始消息(在移动端会使用到),为 true 时移动端会不显示小灰条提示
1157
- */
1158
- isDelete?: boolean;
1159
- /**
1160
- * 用于标识定向消息撤回,只当 conversationType 值为 群、超级群 时有效
1161
- */
1162
- directionalUserIdList?: string[];
1163
- /**
1164
- * 禁止更新到会话最新一条消息,默认 false: 更新,true: 不更新。
1165
- * 注意:需要传原消息的 disableUpdateLastMessage 值
1166
- */
1167
- disableUpdateLastMessage?: boolean;
1168
- }
1133
+ declare type IRecallMessageOptions = Omit<IRecallMsgOptions, 'pushContent'>;
1169
1134
  /**
1170
1135
  * 上传过程中的回调钩子
1171
1136
  * @category Interface
@@ -1372,6 +1337,7 @@ declare type EventListeners = {
1372
1337
  [Events.DATABASE_UPGRADE_WILL_START]: () => void;
1373
1338
  [Events.DATABASE_UPGRADING]: (progress: number) => void;
1374
1339
  [Events.DATABASE_UPGRADE_DID_COMPLETE]: (code: ErrorCode) => void;
1340
+ [Events.STREAM_MESSAGE_RESPONSE]: (evt: IStreamMessageResponseEventData$1<IAReceivedMessage>) => void;
1375
1341
  };
1376
1342
 
1377
1343
  /**
@@ -2681,7 +2647,7 @@ interface IImageMessageBody extends IExtraData, IMentionedInfo, IUserInfo, IAudi
2681
2647
  */
2682
2648
  imageUri: string;
2683
2649
  }
2684
- declare const _default$e: MessageConstructor<IImageMessageBody>;
2650
+ declare const _default$f: MessageConstructor<IImageMessageBody>;
2685
2651
 
2686
2652
  /**
2687
2653
  * 语音消息
@@ -2701,7 +2667,7 @@ interface IHQVoiceMessageBody extends IUserInfo, IExtraData, IMentionedInfo, IAu
2701
2667
  */
2702
2668
  duration: number;
2703
2669
  }
2704
- declare const _default$d: MessageConstructor<IHQVoiceMessageBody>;
2670
+ declare const _default$e: MessageConstructor<IHQVoiceMessageBody>;
2705
2671
 
2706
2672
  /**
2707
2673
  * 短视频消息
@@ -2730,7 +2696,7 @@ interface ISightMessageBody extends IExtraData, IMentionedInfo, IUserInfo, IAudi
2730
2696
  */
2731
2697
  name: string;
2732
2698
  }
2733
- declare const _default$c: MessageConstructor<ISightMessageBody>;
2699
+ declare const _default$d: MessageConstructor<ISightMessageBody>;
2734
2700
 
2735
2701
  /**
2736
2702
  * 文本消息
@@ -2742,7 +2708,7 @@ interface ITextMessageBody extends IUserInfo, IExtraData, IMentionedInfo, IAudit
2742
2708
  */
2743
2709
  content: string;
2744
2710
  }
2745
- declare const _default$b: MessageConstructor<ITextMessageBody>;
2711
+ declare const _default$c: MessageConstructor<ITextMessageBody>;
2746
2712
 
2747
2713
  /**
2748
2714
  * 合并转发消息
@@ -2766,7 +2732,7 @@ interface ICombineMessageBody extends IExtraData, IUserInfo, IMentionedInfo {
2766
2732
  */
2767
2733
  conversationType: ConversationType;
2768
2734
  }
2769
- declare const _default$a: MessageConstructor<ICombineMessageBody>;
2735
+ declare const _default$b: MessageConstructor<ICombineMessageBody>;
2770
2736
 
2771
2737
  /**
2772
2738
  * 合并消息
@@ -2774,7 +2740,7 @@ declare const _default$a: MessageConstructor<ICombineMessageBody>;
2774
2740
  * @hidden
2775
2741
  */
2776
2742
  declare type CombineV2MessageContent = ICombineV2MessageContent & IExtraData & IUserInfo & IMentionedInfo;
2777
- declare const _default$9: MessageConstructor<CombineV2MessageContent>;
2743
+ declare const _default$a: MessageConstructor<CombineV2MessageContent>;
2778
2744
 
2779
2745
  /**
2780
2746
  * 文件消息
@@ -2798,7 +2764,7 @@ interface IFileMessageBody extends IExtraData, IUserInfo, IMentionedInfo {
2798
2764
  */
2799
2765
  fileUrl: string;
2800
2766
  }
2801
- declare const _default$8: MessageConstructor<IFileMessageBody>;
2767
+ declare const _default$9: MessageConstructor<IFileMessageBody>;
2802
2768
 
2803
2769
  /**
2804
2770
  * @category Interface
@@ -2821,7 +2787,7 @@ interface IGIFMessageBody extends IExtraData, IUserInfo, IMentionedInfo, IAuditI
2821
2787
  */
2822
2788
  height: number;
2823
2789
  }
2824
- declare const _default$7: MessageConstructor<IGIFMessageBody>;
2790
+ declare const _default$8: MessageConstructor<IGIFMessageBody>;
2825
2791
 
2826
2792
  /**
2827
2793
  * @category Interface
@@ -2831,7 +2797,7 @@ interface IVoiceMessageBody extends IExtraData, IMentionedInfo, IUserInfo, IAudi
2831
2797
  duration: number;
2832
2798
  extra: string;
2833
2799
  }
2834
- declare const _default$6: MessageConstructor<IVoiceMessageBody>;
2800
+ declare const _default$7: MessageConstructor<IVoiceMessageBody>;
2835
2801
 
2836
2802
  /**
2837
2803
  * 本地消息
@@ -2859,7 +2825,7 @@ interface ILocationMessageBody extends IExtraData, IMentionedInfo, IUserInfo {
2859
2825
  */
2860
2826
  content: string;
2861
2827
  }
2862
- declare const _default$5: MessageConstructor<ILocationMessageBody>;
2828
+ declare const _default$6: MessageConstructor<ILocationMessageBody>;
2863
2829
 
2864
2830
  /**
2865
2831
  * 引用消息
@@ -2887,7 +2853,7 @@ interface IReferenceMessageBody extends IExtraData, IMentionedInfo, IUserInfo, I
2887
2853
  */
2888
2854
  objName: string;
2889
2855
  }
2890
- declare const _default$4: MessageConstructor<IReferenceMessageBody>;
2856
+ declare const _default$5: MessageConstructor<IReferenceMessageBody>;
2891
2857
 
2892
2858
  interface IArticle {
2893
2859
  title: string;
@@ -2901,7 +2867,7 @@ interface IArticle {
2901
2867
  */
2902
2868
  interface IRichContentMessageBody extends IArticle, IExtraData, IMentionedInfo, IUserInfo {
2903
2869
  }
2904
- declare const _default$3: MessageConstructor<IRichContentMessageBody>;
2870
+ declare const _default$4: MessageConstructor<IRichContentMessageBody>;
2905
2871
 
2906
2872
  /**
2907
2873
  * 命令消息
@@ -2917,7 +2883,7 @@ interface ICommandMessageBody extends IUserInfo, IExtraData, IMentionedInfo {
2917
2883
  */
2918
2884
  data: string;
2919
2885
  }
2920
- declare const _default$2: MessageConstructor<ICommandMessageBody>;
2886
+ declare const _default$3: MessageConstructor<ICommandMessageBody>;
2921
2887
 
2922
2888
  /**
2923
2889
  * 小灰条消息
@@ -2933,7 +2899,7 @@ interface IInformationNotificationMessageBody extends IUserInfo, IExtraData, IMe
2933
2899
  */
2934
2900
  extra?: string;
2935
2901
  }
2936
- declare const _default$1: MessageConstructor<IInformationNotificationMessageBody>;
2902
+ declare const _default$2: MessageConstructor<IInformationNotificationMessageBody>;
2937
2903
 
2938
2904
  /**
2939
2905
  * 群组通知消息
@@ -2961,1716 +2927,1778 @@ interface IGroupNotificationMessageBody extends IUserInfo, IExtraData, IMentione
2961
2927
  */
2962
2928
  extra?: string;
2963
2929
  }
2964
- declare const _default: MessageConstructor<IGroupNotificationMessageBody>;
2930
+ declare const _default$1: MessageConstructor<IGroupNotificationMessageBody>;
2931
+
2932
+ interface IReferMsg {
2933
+ /**
2934
+ * 消息中包含的引用消息数据
2935
+ */
2936
+ referMsg?: {
2937
+ /**
2938
+ * 被引用消息UId
2939
+ */
2940
+ messageUId: string;
2941
+ /**
2942
+ * 被引用消息类型
2943
+ */
2944
+ objectName: string;
2945
+ /**
2946
+ * 消息发送者 ID
2947
+ */
2948
+ senderId: string;
2949
+ };
2950
+ }
2965
2951
 
2966
2952
  /**
2967
- * 发送消息
2968
- * @description 发送消息的基础接口,可用来发送 IMLib 中的内置类型消息或自定义消息。针对不同的特定消息类型
2969
- * @category 消息
2970
- * @param conversation 会话信息
2971
- * @param message 消息体,类型为 BaseMessage 的子类,如 TextMessage、ImageMessage,通过 new TextMessage() 获取
2972
- * @param options 发送消息配置项
2973
- *
2974
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2975
- *
2976
- * @example
2977
- * 发送文本消息示例:
2978
- * ```ts
2979
- * const content = {content: 'hello world'};
2980
- * const message = new RongIMLib.TextMessage(content);
2981
- * const conversation = {
2982
- * conversationType: RongIMLib.ConversationType.PRIVATE,
2983
- * targetId: 'targetId'
2984
- * }
2985
- * const sendRes = await RongIMLib.sendMessage(conversation, message);
2986
- * console.info('消息发送结果:', sendRes);
2987
- * ```
2988
- */
2989
- declare function sendMessage(conversation: IConversationOption, message: BaseMessage, options?: ISendMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
2990
- /**
2991
- * 发送文本消息
2992
- * @description 发送文本消息的快捷方式,等同于使用 new TextMessage() 创建消息体后调用 sendMessage() 方法
2993
- * @category 消息
2994
- * @param conversation 会话信息
2995
- * @param messageBody 消息体
2996
- * @param options 发送消息配置项
2997
- *
2998
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2999
- *
3000
- * @example
3001
- * 发送文本消息示例:
3002
- * ```ts
3003
- * const messageBody = {content: 'hello world'};
3004
- * const conversation = {
3005
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3006
- * targetId: 'targetId'
3007
- * }
3008
- * const sendRes = await RongIMLib.sendTextMessage(conversation, messageBody);
3009
- * console.info('消息发送结果:', sendRes);
3010
- * ```
3011
- */
3012
- declare function sendTextMessage(conversation: IConversationOption, messageBody: ITextMessageBody, options?: ISendMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
3013
- /**
3014
- * 发送消息基础类型
3015
- * @category Type
3016
- */
3017
- declare type ISendBody = IUserInfo & IExtraData & {
3018
- file: File;
3019
- } & IMentionedInfo & IAuditInfo;
3020
- /**
3021
- * 发送文件消息配置项
3022
- * @category Type
2953
+ * 文本消息
2954
+ * @category Interface
3023
2955
  */
3024
- declare type ISendFileMessageOptions = ISendBody;
3025
- /**
3026
- * 发送文件消息
3027
- * @description 发送文件消息的快捷方式,等同于使用 new FileMessage() 创建消息体后调用 sendMessage() 方法,支持文件上传,上传成功后自动发送消息
3028
- * @category 消息
3029
- * @param conversation 会话信息
3030
- * @param msgBody 消息体,其中 file 为待上传文件引用
3031
- * @param hooks 上传文件过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3032
- * @param sendOptions 文件消息配置项,类型为 {@link IUploadMessageOption} 可选
3033
- *
3034
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3035
- *
3036
- * @example
3037
- * 发送文本消息示例:
3038
- * ```ts
3039
- * const msgBody = { file }; // file 为待上传文件
3040
- * const conversation = {
3041
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3042
- * targetId: 'targetId'
3043
- * }
3044
- * const sendRes = await RongIMLib.sendFileMessage(conversation, msgBody);
3045
- * console.info('消息发送结果:', sendRes);
3046
- * ```
3047
- */
3048
- declare const sendFileMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
2956
+ interface IStreamMessageBody extends IUserInfo, IExtraData, IMentionedInfo, IReferMsg {
2957
+ /**
2958
+ * 流式消息内容
2959
+ *
2960
+ * * Web 平台拉取到的内容为流式消息的首包数据;
2961
+ * * Electron 平台下,当新收消息时,该字段为消息首包数据;通过拉取流式数据接口,SDK 将逐渐补全该数据内容
2962
+ */
2963
+ content: string;
2964
+ /**
2965
+ * 用于标识服务器是否已接收流推送完成
2966
+ */
2967
+ complete?: boolean;
2968
+ /**
2969
+ * 业务层推流结束时透传的结束 reason 信息
2970
+ */
2971
+ completeReason?: number;
2972
+ /**
2973
+ * 服务器端接收流数据的结束原因
2974
+ */
2975
+ stopReason?: number;
2976
+ /**
2977
+ * 用于标识客户端是否已完成流数据拉取,当该值为 true 时,content 内容为全量流消息数据;仅限 Electron 平台有效
2978
+ */
2979
+ isSynced?: boolean;
2980
+ /**
2981
+ * 自定义编码流媒体数据类型
2982
+ */
2983
+ type?: string;
2984
+ }
2985
+ declare const _default: MessageConstructor<IStreamMessageBody>;
2986
+
3049
2987
  /**
3050
- * 发送图片消息配置项
3051
- * @category Type
2988
+ * 获取全部本地会话列表
2989
+ * @category Electron 独有
2990
+ * @description 本接口仅适用 Electron 平台获取全部本地会话列表
2991
+ * * **注意**:此接口不包含超级群会话
2992
+ * @param channelId 频道 ID,不传则获取全部频道 ID 类型
2993
+ * @since 5.4.0
2994
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
2995
+ * @example
2996
+ * 获取全部本地会话列表示例:
2997
+ * ```ts
2998
+ * const conversationList = await RongIMLib.electronExtension.getAllConversationList();
2999
+ * console.log('获取全部本地会话列表结果:', conversationList);
3000
+ * ```
3052
3001
  */
3053
- declare type ISendImageMessageOptions = ISendBody;
3002
+ declare function getAllConversationList(channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
3054
3003
  /**
3055
- * 发送图片消息
3056
- * @description 发送图片消息的快捷方式,等同于使用 new ImageMessage() 创建消息体后调用 sendMessage() 方法,支持图片上传,上传成功后自动发送消息
3057
- * @category 消息
3058
- * @param conversation 会话信息
3059
- * @param msgBody 消息体,其中 file 为待上传图片引用
3060
- * @param hooks 上传图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3061
- * @param sendOptions 图片消息配置项,类型为 {@link IImageMessageOption} 可选
3062
- *
3063
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3004
+ * 分页获取本地会话列表
3005
+ * @category Electron 独有
3006
+ * @description 本接口仅适用 Electron 平台分页获取本地会话列表,
3007
+ * * **注意**:不包含超级群会话
3008
+ * @param startTime 获取会话起始时间,需要精确到毫秒,0 表示当前时间
3009
+ * @param count 分页数量
3010
+ * @param channelId 频道 ID,不传则获取全部频道 ID 类型
3011
+ * @param topPriority 是否置顶优先
3012
+ * @defaultValue topPriority false
3013
+ * @since 5.4.0
3014
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3064
3015
  * @example
3065
- * 发送图片消息示例:
3016
+ * 分页获取本地会话列表示例:
3066
3017
  * ```ts
3067
- * const msgBody = { file }; // file 为待上传图片
3068
- * const conversation = {
3069
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3070
- * targetId: 'targetId'
3071
- * }
3072
- * const sendRes = await RongIMLib.sendImageMessage(conversation, msgBody);
3073
- * console.info('消息发送结果:', sendRes);
3018
+ * const startTime = 0;
3019
+ * const count = 10;
3020
+ * const conversationList = await RongIMLib.electronExtension.getConversationList(startTime, count);
3021
+ * console.log('分页获取本地会话列表结果:', conversationList);
3074
3022
  * ```
3075
3023
  */
3076
- declare const sendImageMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IImageMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3024
+ declare function getConversationList(startTime: number, count: number, channelId?: string, topPriority?: boolean): Promise<IAsyncRes<IAReceivedConversation[]>>;
3077
3025
  /**
3078
- * 发送 GIF 图片消息
3079
- * @description 发送 GIF 图片消息的快捷方式,等同于使用 new GIFMessage() 创建消息体后调用 sendMessage() 方法,支持 GIF 图片上传,上传成功后自动发送消息
3080
- * @category 消息
3081
- * @param conversation 会话信息
3082
- * @param msgBody 消息体,其中 file 为待上传 GIF 图片引用
3083
- * @param hooks 上传 GIF 图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3084
- * @param sendOptions GIF 图片消息配置项,类型为 {@link IGIFMessageOption} 可选
3085
- *
3086
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3026
+ * 搜索本地会话列表
3027
+ * @category Electron 独有
3028
+ * @description 本接口仅适用 Electron 平台搜索本地会话列表
3029
+ * * **注意**:
3030
+ * 1. 不包含超级群会话
3031
+ * 2. 支持查询自定义消息类型,需要再注册自定义消息时设置搜索字段,否则无法搜索 ,详细请查看 {@link registerMessageType} 的 searchProps 参数
3032
+ * @param keyword 搜索关键字
3033
+ * @param messageTypes 消息类型
3034
+ * @param channelId 频道 ID,不传则获取全部频道 ID 类型
3035
+ * @since 5.4.0
3036
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3087
3037
  * @example
3088
- * 发送 GIF 图片消息示例:
3038
+ * 搜索本地会话列表示例:
3089
3039
  * ```ts
3090
- * const msgBody = { file }; // file 为待上传 GIF 图片
3091
- * const conversation = {
3092
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3093
- * targetId: 'targetId'
3094
- * }
3095
- * const sendRes = await RongIMLib.sendGIFMessage(conversation, msgBody);
3096
- * console.info('消息发送结果:', sendRes);
3040
+ * const keyword = 'keyword';
3041
+ * const messageTypes = [RongIMLib.MessageType.TEXT];
3042
+ * const conversationList = await RongIMLib.electronExtension.searchConversationByContent(keyword, messageTypes);
3043
+ * console.log('搜索本地会话列表结果:', conversationList);
3097
3044
  * ```
3098
3045
  */
3099
- declare const sendGIFMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3046
+ declare function searchConversationByContent$1(keyword: string, messageTypes: string[], channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
3100
3047
  /**
3101
- * 发送高清语音消息
3102
- * @description 待发送的文件必须为 AAC 音频文件。
3103
- * 发送高清语音消息的快捷方式,等同于使用 new HQVoiceMessage() 创建消息体后调用 sendMessage() 方法,支持高清语音上传,上传成功后自动发送消息
3104
- * @category 消息
3105
- * @param conversation 会话信息
3106
- * @param msgBody 消息体,其中 file 为待上传高清语音引用
3107
- * @param hooks 上传高清语音过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3108
- * @param sendOptions 高清语音消息配置项,类型为 {@link ISendHQVoiceMessageOptions} 可选
3109
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3048
+ * 批量获取会话列表
3049
+ * @category Electron 独有
3050
+ * @description 本接口仅适用 Electron 平台批量获取会话列表,通过提供会话的唯一标标识属性返回 {@link IReceivedConversation} 类型的会话信息
3051
+ * * **注意**:
3052
+ * 1. 仅支持单群聊系统会话
3053
+ * @since 5.9.9
3054
+ * @param conversations 需要获取会话的信息,一次最多获取 100 个会话
3055
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3110
3056
  * @example
3111
- * 发送高清语音消息示例:
3057
+ * 批量获取会话列表示例:
3112
3058
  * ```ts
3113
- * const msgBody = { file }; // file 为待上传高清语音
3114
- * const conversation = {
3115
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3116
- * targetId: 'targetId'
3117
- * }
3118
- * const sendRes = await RongIMLib.sendHQVoiceMessage(conversation, msgBody);
3119
- * console.info('消息发送结果:', sendRes);
3059
+ * const conversations = [{ conversationType: RongIMLib.ConversationType.PRIVATE, targetId: 'targetId' }];
3060
+ * const conversationList = await RongIMLib.electronExtension.getConversations(conversations);
3061
+ * console.log('批量获取会话列表结果:', conversationList);
3120
3062
  * ```
3121
3063
  */
3122
- declare const sendHQVoiceMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3064
+ declare function getConversations(conversations: IConversationOption[]): Promise<IAsyncRes<IAReceivedConversation[]>>;
3065
+
3123
3066
  /**
3124
- * 发送小视频消息配置项
3125
- * @category Type
3067
+ * 根据关键字搜索本地消息
3068
+ * @category Electron 独有
3069
+ * @description 本接口仅适用 Electron 平台搜索本地消息
3070
+ * * **注意**:
3071
+ * 1. 文本类型消息只支持搜索 content,文件类型消息只支持搜索 name
3072
+ * 2. 自定义消息根据 registerMessageType 的 searchProps 参数决定
3073
+ * 3. 引用消息不支持搜索
3074
+ * 4. 如果不传 channelId,则在所有 channelId 中搜索消息
3075
+ * 5. 如果不传 messageTypes,则搜索所有支持搜索的消息类型
3076
+ * @since 5.4.0
3077
+ * @param conversation 会话信息
3078
+ * @param keyword 搜索关键字
3079
+ * @param startTime 搜索时间, 搜索该时间之前的消息
3080
+ * @param count 获取的数量
3081
+ * @param messageTypes 消息类型,@since 5.9.8 开始支持按照消息类型搜索,支持范围:文本(RC:TxtMsg)、文件(RC:FileMsg)、设置 {@link searchProps} 的自定义消息
3082
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
3083
+ * @example
3084
+ * 根据关键字搜索本地消息示例:
3085
+ * ```ts
3086
+ * const conversation = {
3087
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3088
+ * targetId: 'targetId',
3089
+ * };
3090
+ * const keyword = 'keyword';
3091
+ * const startTime = Date.now();
3092
+ * const count = 10;
3093
+ * const res = await RongIMLib.electronExtension.searchMessages(conversation, keyword, startTime, count);
3094
+ * console.info('根据关键字搜索本地消息结果:', res);
3095
+ * ```
3126
3096
  */
3127
- declare type ISendSightMessageOptions = {
3128
- duration: number;
3129
- thumbnail: string;
3130
- name?: string;
3131
- } & ISendBody;
3097
+ declare function searchMessages$1(conversation: IConversationOption, keyword: string, startTime: number, count: number, messageTypes?: string[]): Promise<IAsyncRes<{
3098
+ messages: IAReceivedMessage[];
3099
+ count: number | undefined;
3100
+ }>>;
3132
3101
  /**
3133
- * 发送小视频消息
3134
- * @category 消息
3135
- * @description 发送的小视频消息必须是 MP4 文件,且音频编码为 AAC,视频编码 H264,否则可能造成 iOS 或 Android 接收后不可播放问题。
3136
- * 发送小视频消息的快捷方式,等同于使用 new SightMessage() 创建消息体后调用 sendMessage() 方法,支持小视频上传,上传成功后自动发送消息
3102
+ * 在指定时间范围内搜索本地消息
3103
+ * @category Electron 独有
3104
+ * @description 本接口仅适用 Electron 平台搜索本地消息
3105
+ * @since 5.4.0
3137
3106
  * @param conversation 会话信息
3138
- * @param msgBody 消息体,其中 file 为待上传小视频引用
3139
- * @param hooks 上传小视频过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3140
- * @param sendOptions 小视频消息配置项,类型为 {@link ISendSightMessageOptions} 可选
3141
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3107
+ * @param option 搜索参数,类型为 {@link ISearchMessageInTimeRangeOption}
3108
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
3142
3109
  * @example
3143
- * 发送小视频消息示例:
3110
+ * 在指定时间范围内搜索本地消息示例:
3144
3111
  * ```ts
3145
- * const msgBody = { file, duration: 10, thumbnail: 'base64' }; // file 为待上传小视频,duration 为小视频时长,thumbnail 为小视频封面 base64
3146
3112
  * const conversation = {
3147
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3148
- * targetId: 'targetId'
3113
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3114
+ * targetId: 'targetId'
3149
3115
  * }
3150
- * const sendRes = await RongIMLib.sendSightMessage(conversation, msgBody);
3151
- * console.info('消息发送结果:', sendRes);
3116
+ * const option = {
3117
+ * keyword: 'keyword',
3118
+ * startTime: 0,
3119
+ * endTime: 1632728573423,
3120
+ * }
3121
+ * const res = await RongIMLib.electronExtension.searchMessageInTimeRange(conversation, option)
3122
+ * console.info('在指定时间范围内搜索本地消息结果:', res);
3152
3123
  * ```
3153
3124
  */
3154
- declare const sendSightMessage: (conversation: IConversationOption, msgBody: ISendSightMessageOptions, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3125
+ declare function searchMessageInTimeRange(conversation: {
3126
+ conversationType: ConversationType;
3127
+ targetId: string;
3128
+ }, option: ISearchMessageInTimeRangeOption): Promise<IAsyncRes<{
3129
+ messages: IAReceivedMessage[];
3130
+ }>>;
3155
3131
  /**
3156
- * 获取历史消息
3157
- * @category 消息
3158
- * @description 获取历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
3159
- * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
3160
- * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
3161
- * * **注意**:
3162
- * 1. Electron 获取的是本地数据库
3163
- * 2. Web 获取的是远端历史消息,Web 端不具备持久化的数据存储能力,无法在本地持久化存储历史消息记录与会话列表,因此需要从融云服务端获取数据。
3164
- * 3. 请确保已开通单群聊消息云端存储服务,如未开通服务请移步到融云开发者后台的 IM 服务管理模块开启。
3132
+ * 根据用户 ID 搜索本地消息
3133
+ * @category Electron 独有
3134
+ * @description 本接口仅适用 Electron 平台在指定会话的所有频道中根据用户 ID 搜索时间范围内的消息
3165
3135
  * @param conversation 会话信息
3166
- * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
3167
- * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
3168
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link GetHistoryMessageResult} 类型
3169
- *
3136
+ * @param count 获取的数量
3137
+ * @param startTime 搜索时间,搜索时间之前的消息
3138
+ * @param userId 用户 ID
3139
+ * @since 5.7.10
3140
+ * @return 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
3170
3141
  * @example
3171
- * 获取历史消息示例:
3142
+ * 根据用户 ID 搜索本地消息示例:
3172
3143
  * ```ts
3173
3144
  * const conversation = {
3174
3145
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3175
- * targetId: 'targetId',
3176
- * }
3177
- * const messages = await RongIMLib.getHistoryMessages(conversation);
3178
- * console.info('获取历史消息结果:', messages);
3146
+ * targetId: 'targetId'
3147
+ * };
3148
+ * const userId = 'userId';
3149
+ * const startTime = Date.now();
3150
+ * const count = 10;
3151
+ * const res = await RongIMLib.electronExtension.searchMessagesByUser(conversation, userId, startTime, count);
3152
+ * console.info('根据用户 ID 搜索本地消息', res);
3153
+ * ```
3179
3154
  */
3180
- declare function getHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
3155
+ declare function searchMessagesByUser(conversation: IConversationOption, userId: string, startTime: number, count: number): Promise<IAsyncRes<{
3156
+ messages: IAReceivedMessage[];
3157
+ }>>;
3181
3158
  /**
3182
- * 获取远程历史消息
3183
- * @category 消息
3184
- * @description 获取远程历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
3185
- * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
3186
- * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
3187
- * * **注意**:
3188
- * 需要开启单群聊消息云存储服务后,才可以从远端拉取历史消息,服务请移步到融云开发者后台的 IM 服务管理模块开启。
3189
- *
3159
+ * 获取会话中指定类型的消息
3160
+ * @category Electron 独有
3161
+ * @description 本接口仅适用 Electron 平台获取会话中指定类型的消息
3190
3162
  * @param conversation 会话信息
3191
- * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
3192
- * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
3193
- *
3194
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link GetHistoryMessageResult} 类型
3163
+ * @param option 配置参数,类型为 {@link IGetHistoryMessagesByTypesOption}
3164
+ * @since 5.4.0
3165
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
3195
3166
  * @example
3196
- * 获取远程历史消息示例:
3167
+ * 获取会话中指定类型的消息示例:
3197
3168
  * ```ts
3198
3169
  * const conversation = {
3199
3170
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3200
- * targetId: 'targetId',
3201
- * }
3202
- * const messages = await RongIMLib.getRemoteHistoryMessages(conversation);
3203
- * console.info('获取远程历史消息结果:', messages);
3171
+ * targetId: 'targetId'
3172
+ * };
3173
+ * const options = { messageTypes: [RongIMLib.MessageType.TEXT] };
3174
+ * const res = await RongIMLib.electronExtension.getHistoryMessagesByMessageTypes(conversation, option);
3175
+ * console.info('获取会话中指定类型的消息结果:', res);
3176
+ * ```
3204
3177
  */
3205
- declare function getRemoteHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
3178
+ declare function getHistoryMessagesByMessageTypes(conversation: IConversationOption, option: IGetHistoryMessagesByTypesOption): Promise<IAsyncRes<{
3179
+ /**
3180
+ * @deprecated 字段已废弃即将删除,推荐使用 list
3181
+ */
3182
+ messages: IAReceivedMessage[];
3183
+ } & GetHistoryMessageResult>>;
3206
3184
  /**
3207
- * 发送单聊已读回执
3208
- * @description 发送单聊已读回执,用于标记已读消息
3209
- * * **实现已读功能步骤:**
3210
- * 1. 在用户查看了某单聊会话的未读消息后,调用 sendReadReceiptMessage 发送已读回执。
3211
- * 2. 通过 addEventListener 设置消息回执监听器。
3212
- * 3. SDK 在收到消息已读回执时派发 READ_RECEIPT_RECEIVED 事件。
3213
- *
3185
+ * 获取本地与远端历史消息
3186
+ * @category Electron 独有
3187
+ * @description 本接口仅适用 Electron 平台且需要业务层开启`单群聊云存储服务`
3188
+ * 方法与 {@link getRemoteHistoryMessages} 的区别是 getContinuousMessages 会先查询指定会话存储本地数据库的消息,
3189
+ * 当本地消息无法满足查询条件时,再查询在单群聊消息云端存储中的历史消息,以返回连续且相邻的消息对象列表
3214
3190
  * * **注意**:
3215
- * 1. Web 平台,SDK 不会记录每个会话和消息的已读状态,您需要在 localStorage 中记录每个会话的已读时间。在渲染消息列表时,根据 localStorage 中时间判断消息是否已读,更新对应的消息界面。
3216
- * 2. 在 Electron 平台,收到 READ_RECEIPT_RECEIVED 通知时,您需要调用
3217
- * {@link electronExtension.setMessageStatusToRead} 方法更新消息已读状态,并更新对应的消息界面。
3218
- * 3. 调用 `sendReadReceiptMessage` 接口不会清除未读数,需单独调用清除未读数接口 {@link clearMessagesUnreadStatus}。
3219
- *
3220
- * @param targetId 目标 ID
3221
- * @param messageUId 消息唯一标识,可在 Message 中获取
3222
- * @param timestamp 消息的发送时间,可通过 Message 中 sendTime 获取
3223
- * @category 消息
3191
+ * 1. 分页获取时,下次传的时间戳必须使用 getContinuousMessages 接口返回的 timestamp
3192
+ * 2. 获取历史消息逻辑:优先获取本地数据历史消息,本地获取不到再获取远端历史消息,但是该情况可能会因为离线或者补偿消息存储天数影响,出现消息断档现象
3193
+ * 消息断档现象:因为离线或者补偿消息存储天数影响,存储在本地数据库中消息存在不连续或者说中间某段时间消息丢失
3194
+ * 比如离线消息和补偿消息都为 1 天,第一天 A 给 B 发送 1, 2, 3,第二天 A B 发送 4, 5, 6,
3195
+ * B 第二天再登入,由于离线消息和补偿消息都为 1 天,所以 B 只能收到 4, 5, 6。 1, 2, 3 消息丢失
3196
+ * 3. option 中的 Count 字段仅支持 1-100 范围
3197
+ * @param conversation 会话信息
3198
+ * @param option 参数配置,类型为 {@link GetHistoryMessageOption}
3199
+ * @since 5.9.6
3200
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
3224
3201
  * @example
3225
- * 单聊消息回执示例:
3202
+ * 获取本地与远端历史消息示例:
3226
3203
  * ```ts
3227
- * const targetId = 'targetId';
3228
- * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
3229
- * const timestamp = 1632728573423;
3230
- *
3231
- * const readReceiptRes = await RongIMLib.sendReadReceiptMessage(targetId, messageUId, timestamp);
3232
- * console.info('单聊消息回执:', readReceiptRes)
3204
+ * const conversation = {
3205
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3206
+ * targetId: 'targetId'
3207
+ * };
3208
+ * const options = { timestamp: 0, count: 20, order: 0 };
3209
+ * const res = await RongIMLib.electronExtension.getContinuousMessages(conversation, option);
3210
+ * console.info('获取本地与远端历史消息结果:', res);
3233
3211
  * ```
3234
3212
  */
3235
- declare function sendReadReceiptMessage(targetId: string, messageUId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<void>>;
3213
+ declare function getContinuousMessages(conversation: IConversationOption, options: GetHistoryMessageOption): Promise<IAsyncRes<{
3214
+ list: IAReceivedMessage[];
3215
+ timestamp: number;
3216
+ hasMore: boolean;
3217
+ }>>;
3236
3218
  /**
3237
- * 发送群已读回执请求
3238
- * @description 实现群聊中按需获取己方发送消息的阅读状态请求。与群聊已读回执响应接口 {@link sendReadReceiptResponseV2} 配套使用。单独调用无法实现群回执能力
3239
- *
3240
- * @category 消息
3241
- * @param targetId 目标 ID
3242
- * @param messageUIds 消息UID列表
3243
- *
3244
- *@example
3245
- * 群已读回执请求示例:
3219
+ * 通过时间戳设置消息状态为对方已读
3220
+ * @category Electron 独有
3221
+ * @description 将自己发送的指定时间之前的消息设置为对方已读,状态值为 SentStatus.READ
3222
+ * @param conversation 会话信息
3223
+ * @param timestamp 消息的发送时间,将该时间之前的消息设置为已读
3224
+ * @since 5.4.0
3225
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
3226
+ * @example
3227
+ * 通过时间戳设置消息状态为对方已读示例:
3246
3228
  * ```ts
3247
- * const targetId = 'targetId';
3248
- * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
3249
- * const readReceiptRes = await RongIMLib.sendReadReceiptRequest(targetId, messageUId);
3250
- * console.info('群已读回执请求:', readReceiptRes)
3229
+ * const conversation = {
3230
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3231
+ * targetId: 'targetId'
3232
+ * };
3233
+ * const timestamp = Date.now();
3234
+ * const res = await RongIMLib.electronExtension.setMessageStatusToRead(conversation, timestamp);
3235
+ * console.info('通过时间戳设置消息状态为对方已读结果:', res);
3251
3236
  * ```
3252
3237
  */
3253
- declare function sendReadReceiptRequest(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<void>>;
3238
+ declare function setMessageStatusToRead(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<boolean>>;
3254
3239
  /**
3255
- * @category 消息
3256
- * @deprecated 已废弃,@since 5.1.1。请替换使用 {@link sendReadReceiptResponseV2} 方法
3240
+ * 设置消息的接收状态
3241
+ * @category Electron 独有
3242
+ * @param messageId 消息 ID
3243
+ * @param receivedStatus 接受状态
3244
+ * @since 5.4.0
3245
+ * @deprecated @since 5.9.3 MLib SDK 版本 ≧ 5.9.3,建议使用 {@link setMessageReceivedStatusInfo} 接口替换
3257
3246
  */
3258
- declare function sendReadReceiptResponse(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes<void>>;
3247
+ declare function setMessageReceivedStatus$1(messageId: number, receivedStatus: ReceivedStatus): Promise<IAsyncRes<void>>;
3259
3248
  /**
3260
- * 发送群阅读回执响应V2
3261
- * @description 实现群聊中按需获取己方发送消息的阅读状态响应。
3262
- * 与群聊已读回执请求接口 {@link sendReadReceiptRequest} 配套使用。单独调用无法实现群回执能力
3263
- * * **注意**:
3264
- * 5.9.4 版本之后,SDK 内部维护了已读回执请求信息,并在历史消息列表里携带已读回执信息:readReceiptInfo, Web 平台和 Electron 平台实现不同之处:
3265
- * Web Electron 平台的区别:
3266
- * 1. 在 Web 平台,SDK 内部会缓存每个群会话的最新 30 个已读回执信息(以已读回执请求的发送时间为准),缓存有效期为 24H。
3267
- * 在发送消息回执响应时无需传 messageList 字段,SDK 会把该会话下的所有请求组织好然后发送响应。
3268
- *
3269
- * 2. 在 Electron 平台,用户需先获取历史消息,取出 message.messageDirection = MessageDirection.RECEIVE , readReceiptInfo.
3270
- * isReceiptRequestMessage = true 并且 readReceiptInfo.hasRespond = false 的数据组织成参数 messageList 来发送回执响应。
3271
- * @category 消息
3272
- * @param targetId 群组Id
3273
- * @param messageList 要回执的消息列表,结构为: \{senderUserId: [messageUId1, messageUId2]\}
3274
- * @since 5.1.1
3249
+ * 设置消息的接收状态
3250
+ * @category Electron 独有
3251
+ * @description 本接口仅适用 Electron 平台设置消息的接收状态,支持多状态同时设置
3252
+ * 设置对方发送的消息 自己的接受状态信息
3253
+ * @param messageId 消息 ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
3254
+ * @param receivedStatusInfo 接受状态信息,类型为 {@link IReceivedStatusInfo}
3255
+ * @since 5.9.3
3256
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
3275
3257
  * @example
3276
- * 群已读回执响应示例:
3258
+ * 设置消息的接收状态示例:
3277
3259
  * ```ts
3278
- * const targetId = 'targetId';
3279
- * const messageList = {
3280
- * 'senderUserId': ['messageUId1', 'messageUId2'],
3281
- * }
3282
- * const readReceiptRes = await RongIMLib.sendReadReceiptResponseV2(targetId, messageList);
3283
- * console.info('群已读回执响应:', readReceiptRes);
3260
+ * const messageId = 123;
3261
+ * const receivedStatusInfo = {
3262
+ * isRead: true,
3263
+ * isListened: true,
3264
+ * };
3265
+ * const res = await RongIMLib.electronExtension.setMessageReceivedStatusInfo(messageId, receivedStatusInfo);
3266
+ * console.info('设置消息的接收状态结果:', res);
3267
+ * ```
3284
3268
  */
3285
- declare function sendReadReceiptResponseV2(targetId: string, messageList?: {
3286
- [senderUserId: string]: string[];
3287
- }, channelId?: string): Promise<IAsyncRes<void>>;
3269
+ declare function setMessageReceivedStatusInfo(messageId: number, receivedStatusInfo: IReceivedStatusInfo): Promise<IAsyncRes<void>>;
3288
3270
  /**
3289
- * 多端同步阅读状态
3290
- * @description 由于未读消息数存储在本地,服务器不存未读消息数量。当用户多端登录时,需要同步未读消息数以保证多端未读数一致
3291
- * @param conversation 会话信息
3292
- * @param timestamp 需要同步消息阅读的时间戳,可以在消息体中通过消息的 sendTime 获取
3293
- * @category 消息
3271
+ * 设置消息的发送状态
3272
+ * @category Electron 独有
3273
+ * @description 本接口仅适用 Electron 平台设置自己发送的消息的发送状态
3274
+ * @param messageId 消息ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
3275
+ * @param sentStatus 消息的发送状态,类型为 {@link SentStatus}
3276
+ * @since 5.4.0
3277
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
3294
3278
  * @example
3295
- * 多端同步阅读状态示例:
3279
+ * 设置消息的发送状态示例:
3296
3280
  * ```ts
3297
- * const conversation = {
3298
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3299
- * targetId: 'targetId',
3300
- * }
3301
- * const timestamp = 1632728573423; // 阅读消息的 sendTime
3302
- * const syncReadStatusRes = await RongIMLib.sendSyncReadStatusMessage(conversation, timestamp);
3303
- * console.info('多端同步阅读状态:', syncReadStatusRes);
3281
+ * const messageId = 123;
3282
+ * const sentStatus = RongIMLib.SentStatus.SENT;
3283
+ * const res = await RongIMLib.electronExtension.setMessageSentStatus(messageId, sentStatus);
3284
+ * console.info('设置消息的发送状态结果:', res);
3304
3285
  * ```
3305
3286
  */
3306
- declare function sendSyncReadStatusMessage(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
3287
+ declare function setMessageSentStatus(messageId: number, sentStatus: SentStatus): Promise<IAsyncRes<void>>;
3307
3288
  /**
3308
- * 发送已读回执(V4 版本)
3309
- *
3310
- * 调用此接口后,消息的发送者会收到 EVENTS.MESSAGE_READ_RECEIPT_V4 事件通知
3311
- *
3312
- * 调用此接口需在开发者后台开通服务
3313
- * @since 5.9.0
3289
+ * 修改消息内容
3290
+ * @category Electron 独有
3291
+ * @description 本接口仅适用 Electron 平台修改消息内容,目前仅私有云使用 RCE api 暂不对外
3314
3292
  * @hidden
3315
- * @param conversation 会话信息,支持单聊、群聊
3316
- * @param endMsgUId 结束消息 UId
3317
- * @param startMsgUId 开始消息UId, 仅群聊时有效
3293
+ * @param messageId 消息 ID
3294
+ * @param content 消息 content
3295
+ * @param messageType 消息类型,如果设置了消息类型,会使该消息无法被搜索
3296
+ * @since 5.4.0
3297
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
3318
3298
  * @example
3319
- * ```js
3320
- * const con = {
3321
- * conversationType: ConversationType.Group,
3322
- * targetId: 'targetId'
3323
- * }
3324
- * sendReadReceiptMessageV4(con, 'endMsgUId', 'startMsgUId').then(res => {
3325
- * if (res.code === ErrorCode.success) {
3326
- * console.log('send success')
3327
- * } else {
3328
- * console.log('send error', res.msg)
3329
- * }
3330
- * })
3299
+ * 修改消息内容示例:
3300
+ * ```ts
3301
+ * const messageId = 123;
3302
+ * const content = {
3303
+ * content: 'new content',
3304
+ * };
3305
+ * const messageType = 'RC:TxtMsg';
3306
+ * const res = await RongIMLib.electronExtension.setMessageContent(messageId, content, messageType);
3307
+ * console.info('修改消息内容结果:', res);
3331
3308
  * ```
3332
3309
  */
3333
- declare function sendReadReceiptMessageV4(conversation: IConversationOption, endMsgUId: string, startMsgUId?: string): Promise<IAsyncRes<void>>;
3310
+ declare function setMessageContent(messageId: number, content: Object, messageType?: string): Promise<IAsyncRes<void>>;
3334
3311
  /**
3335
- * 获取消息的已读回执列表
3336
- *
3337
- * 调用此接口需在开发者后台开通服务
3338
- * @since 5.9.0
3339
- * @hidden
3340
- * @param conversation 会话信息, 仅支持群聊
3341
- * @param messageUId 消息 UId
3312
+ * 通过消息 ID 列表删除本地消息
3313
+ * @category Electron 独有
3314
+ * @description 本接口仅适用 Electron 平台
3315
+ * 通过消息 ID 从本地消息数据库中删除指定的一条或一组消息数据。删除多条消息时,请确保消息 ID 均属于同一会话
3316
+ * @param messageIds 消息 ID 列表, 需是同一会话的消息
3317
+ * @since 5.4.0
3318
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
3342
3319
  * @example
3343
- * ```js
3344
- * const con = {
3345
- * conversationType: ConversationType.Group,
3346
- * targetId: 'targetId'
3347
- * }
3348
- * getMessageReadReceiptV4(con, 'MsgUId').then(res => {
3349
- * if (res.code === ErrorCode.success) {
3350
- * console.log('send success', res.data)
3351
- * } else {
3352
- * console.log('send error', res.msg)
3353
- * }
3354
- * })
3320
+ * 通过消息 ID 删除消息示例:
3321
+ * ```ts
3322
+ * const messageIds = [1, 2];
3323
+ * const res = await RongIMLib.electronExtension.deleteMessages(messageIds);
3324
+ * console.info('通过消息 ID 删除消息结果:', res);
3355
3325
  * ```
3356
3326
  */
3357
- declare function getMessageReadReceiptV4(conversation: IConversationOption, messageUId: string): Promise<IAsyncRes<IMessageReadReceiptV4Response>>;
3327
+ declare function deleteMessages$1(messageIds: number[]): Promise<IAsyncRes<void>>;
3358
3328
  /**
3359
- * 获取消息的已读回执列表
3360
- *
3361
- * 调用此接口需在开发者后台开通服务
3362
- * @since 5.9.0
3363
- * @hidden
3364
- * @param conversation 会话信息, 仅支持群聊
3365
- * @param messageUIds 消息 UId 列表
3329
+ * 清空会话下历史消息
3330
+ * @category Electron 独有
3331
+ * @description 本接口仅适用 Electron 平台,从本地消息数据库中删除指定会话所有消息。
3332
+ * @param conversation 会话信息
3333
+ * @since 5.4.0
3334
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
3366
3335
  * @example
3367
- * ```js
3368
- * const con = {
3369
- * conversationType: ConversationType.Group,
3370
- * targetId: 'targetId'
3371
- * }
3372
- * batchGetMessageReadReceiptInfoV4(con, ['MsgUId']).then(res => {
3373
- * if (res.code === ErrorCode.success) {
3374
- * console.log('send success', res.data)
3375
- * } else {
3376
- * console.log('send error', res.msg)
3377
- * }
3378
- * })
3336
+ * 清空会话下历史消息示例:
3337
+ * ```ts
3338
+ * const conversation = {
3339
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3340
+ * targetId: 'targetId',
3341
+ * };
3342
+ * const res = await RongIMLib.electronExtension.clearMessages(conversation);
3343
+ * console.info('清空会话下历史消息结果:', res);
3379
3344
  * ```
3380
- */
3381
- declare function batchGetMessageReadReceiptInfoV4(conversation: IConversationOption, messageUIds: string[]): Promise<IAsyncRes<IGroupReadReceiptData[]>>;
3345
+ */
3346
+ declare function clearMessages$1(conversation: IConversationOption): Promise<IAsyncRes<void>>;
3382
3347
  /**
3383
- * 撤回消息
3384
- * @description 融云对撤回消息的操作者不作限制。
3385
- * 如需避免用户撤回非本人发送的消息,可以提交工单申请打开IMLib SDK 只允许撤回自己发送的消息。从融云服务端进行限制,禁止用户撤回非本人发送的消息。
3386
- * @category 消息
3348
+ * 通过时间戳删除
3349
+ * @category Electron 独有
3350
+ * @description 本接口仅适用 Electron 平台,根据时间戳,从本地消息数据库中删除单个会话中早于该时间戳的消息数据。
3387
3351
  * @param conversation 会话信息
3388
- * @param options 撤回消息参数
3352
+ * @param timestamp 指定删除该时间戳之前的消息
3353
+ * @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
3354
+ * 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
3355
+ * @since 5.4.0
3356
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
3389
3357
  * @example
3390
- * 撤回消息示例:
3358
+ * 通过时间戳删除示例:
3391
3359
  * ```ts
3392
3360
  * const conversation = {
3393
3361
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3394
3362
  * targetId: 'targetId',
3395
- * }
3396
- * const options = {
3397
- * messageUId: 'messageUId',
3398
- * sentTime: 1632728573423,
3399
- * }
3400
- * const recallRes = await RongIMLib.recallMessage(conversation, options);
3401
- * console.info('撤回消息结果:', recallRes);
3363
+ * };
3364
+ * const timestamp = Date.now();
3365
+ * const cleanSpace = false;
3366
+ * const res = await RongIMLib.electronExtension.deleteMessagesByTimestamp(conversation, timestamp, cleanSpace);
3367
+ * console.info('通过时间戳删除结果:', res);
3368
+ * ```
3369
+ */
3370
+ declare function deleteMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<IAsyncRes<void>>;
3371
+ /**
3372
+ * 批量清除多个会话的本地消息
3373
+ * @category Electron 独有
3374
+ * @param options 会话列表,最大数量为 20
3375
+ * @since 5.9.0
3376
+ * @description 从本地消息数据库中批量删除多个会话指定时间之前的消息数据,
3377
+ * 时间戳传 0 时,清除所有消息
3378
+ * 支持的会话类型:单聊, 群聊, 聊天室, 系统消息
3379
+ * @hidden
3380
+ * @example
3381
+ * ```ts
3382
+ * const conversations = [{
3383
+ * conversationType: ConversationType.PRIVATE,
3384
+ * targetId: 'targetId',
3385
+ * timestamp: 0,
3386
+ * channelId: '',
3387
+ * }]
3388
+ * const res = await RongIMLib.batchClearMessagesByTimestamp(conversations, 0);
3389
+ * console.log('批量清除多个会话的本地消息结果:', res);
3402
3390
  * ```
3403
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3404
3391
  */
3405
- declare function recallMessage(conversation: IConversationOption, options: IRecallMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
3392
+ declare function batchClearMessagesByTimestamp(options: IClearMessageOption[]): Promise<IAsyncRes<void>>;
3406
3393
  /**
3407
- * 按消息 UId 删除消息
3408
- * @category 消息
3409
- * @description 根据消息的 ID、时间戳和方向(发送或接收)从服务端删除指定单个会话中的一条或一组消息。
3410
- * * **注意**:
3411
- * 1. 删除消息仅会删除本端消息,不会删除对端消息。A 与 B 之间的消息,A 删除消息后,B 仍然可以看到消息。如 B 需要无法查看需要调用撤回消息 {@link recallMessage}接口。
3412
- * 2. 仅适用于 App Key 已开通单群聊消息云端存储 的 App。
3413
- * 3. 服务端默认不会删除对应的离线消息补偿,如需彻底删除消息补偿,请提交工单,申请开通删除服务端历史消息时同时删除多端补偿的离线消息。
3414
- *
3394
+ * 向本地插入一条消息
3395
+ * @category Electron 独有
3396
+ * @description 本接口仅适用 Electron 平台,插入消息到本地数据库,不发送到服务器
3397
+ * * **注意**:插入消息时,messageUId 将不会存入数据库
3398
+ * @since 5.4.0
3415
3399
  * @param conversation 会话信息
3416
- * @param messages 消息列表
3400
+ * @param message 消息体,@since 5.6.1 增加支持 {@link BaseMessage} 类型
3401
+ * @param options 插入消息配置,类型为 {@link IInsertOptions}
3402
+ * @defaultValues options = {}
3403
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedMessage} 类型的消息对象
3417
3404
  * @example
3418
- * 按消息 UId 删除消息示例:
3405
+ * 插入消息示例:
3419
3406
  * ```ts
3420
3407
  * const conversation = {
3421
3408
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3422
3409
  * targetId: 'targetId',
3423
3410
  * };
3424
- * const messages = [{
3425
- * messageUId: 'BS4O-P5AO-D1O6-9GPP', // 消息 UId
3426
- * sentTime: 1632728573423, // 消息发送时间
3427
- * messageDirection: RongIMLib.MessageDirection.SEND, // 消息方向
3428
- * }];
3429
- * const deleteRes = await RongIMLib.deleteMessages(conversation, messages);
3430
- * console.info('删除消息结果:', deleteRes);
3411
+ * const message = new RongIMLib.TextMessage({ content: 'hello' });
3412
+ * const options = {
3413
+ * searchContent: 'hello',
3414
+ * };
3415
+ * const res = await RongIMLib.electronExtension.insertMessage(conversation, message, options);
3416
+ * console.info('插入消息结果:', res);
3431
3417
  * ```
3432
3418
  */
3433
- declare function deleteMessages$1(conversation: IConversationOption, messages: {
3434
- /**
3435
- * 消息 id
3436
- */
3437
- messageUId: string;
3438
- /**
3439
- * 消息发送时间
3440
- */
3441
- sentTime: number;
3442
- /**
3443
- * 消息方向
3444
- * * 1: 发送
3445
- * * 2: 接收
3446
- */
3447
- messageDirection: MessageDirection;
3448
- }[]): Promise<IAsyncRes<void>>;
3419
+ declare function insertMessage$1(conversation: IConversationOption, message: IAReceivedMessage | BaseMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
3449
3420
  /**
3450
- * 按时间戳删除消息
3451
- * @description 根据时间戳删除指定单个会话中早于(含)指定时间戳的所有消息。
3452
- * @category 消息
3453
- * @param conversation 会话
3454
- * @param timestamp 清除时间点, 该时间之前的消息将被清除
3455
- *
3421
+ * 批量向本地插入消息
3422
+ * @category Electron 独有
3423
+ * @description 本接口仅适用 Electron 平台,批量插入消息到本地数据库,不发送到服务器,目前仅有私有云和 RCE 使用 api 标注 hidden
3424
+ * @hidden
3425
+ * @since 5.7.2
3426
+ * @param messages 批量插入的消息体
3427
+ * @param checkDuplicate 选择是否排重,默认 false
3428
+ * @defaultValues checkDuplicate = false
3429
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
3430
+ */
3431
+ declare function batchInsertMessage(messages: IInsertMessage[], checkDuplicate: boolean): Promise<IAsyncRes<boolean>>;
3432
+ /**
3433
+ * 获取会话所有消息数
3434
+ * @category Electron 独有
3435
+ * @description 本接口仅适用 Electron 平台,获取指定会话下的所有消息数
3436
+ * @param conversation
3437
+ * @since 5.7.2
3438
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 消息数
3456
3439
  * @example
3457
- * 按时间戳删除消息示例:
3440
+ * 获取会话所有消息数示例:
3458
3441
  * ```ts
3459
3442
  * const conversation = {
3460
3443
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3461
3444
  * targetId: 'targetId',
3462
- * }
3463
- * const timestamp = 1632728573423;
3464
- * const clearRes = await RongIMLib.clearHistoryMessages(conversation, timestamp);
3465
- * console.info('清除消息结果:', clearRes);
3445
+ * };
3446
+ * const res = await RongIMLib.electronExtension.getMessageCount(conversation);
3447
+ * console.info('获取会话所有消息数结果:', res);
3466
3448
  * ```
3467
3449
  */
3468
- declare function clearHistoryMessages(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
3450
+ declare function getMessageCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
3469
3451
  /**
3470
- * @hidden
3471
- * 批量删除多个会话的远端消息
3472
- * @category 消息
3473
- * @description 批量删除服务端多个会话早于(含)发送时间的所有远端消息(Electron 平台可以删除对应的本地消息)
3474
- * @param conversations 会话列表,最大数量为 20
3475
- * @param isDeleteLocal 是否删除本地消息, 仅 Electron 平台支持,默认为 false
3476
- * @since 5.9.0
3477
- * 时间戳,传 0 清除所有消息
3478
- * 支持的会话类型:单聊, 群聊, 聊天室, 系统消息
3479
- * @example
3480
- * 批量删除多个会话的远端消息示例:
3481
- * ```ts
3482
- * batchClearHistoryMessages([
3483
- * {
3484
- * conversationType: ConversationType.PRIVATE,
3485
- * targetId: 'targetId',
3486
- * timestamp: 0,
3487
- * channelId: '',
3488
- * }, true]).then(res => {
3489
- * console.log(res);
3490
- * });
3491
- * ```
3452
+ * 获取单聊消息的送达时间
3453
+ * @param messageUId 消息 UID
3454
+ * @hidden 暂时仅 BEEM 使用,无需在文档公开
3455
+ * @description 暂仅支持 Electron 平台
3492
3456
  */
3493
- declare function batchClearRemoteHistoryMessages(clearMessageOption: IClearMessageOption[], isDeleteLocal?: boolean): Promise<IAsyncRes<void>>;
3457
+ declare function getPrivateMessageDeliverTime(messageUId: string): Promise<IAsyncRes<number>>;
3494
3458
  /**
3495
- * 更新(添加、替换)消息扩展属性
3496
- * @description 消息扩展功能可为消息增加基于 Key/Value 的状态标识。消息的扩展信息可在发送前、后设置或更新,可用于实现消息评论、礼物领取、订单状态变化等业务需求。
3497
- * * **注意**:
3498
- * 1. 单条消息单次最多可设置 20 个扩展信息 KV 对,总计不可超过 300 个扩展信息 KV 对。
3499
- * 2. 消息扩展(Key、Value 扩展信息)会被存储。如已开通历史消息云存储功能,从服务端获取的历史消息也会携带已设置的扩展信息。
3500
- * 3. 仅支持单聊、群聊会话类型,不支持聊天室类型。
3501
- * 4. 仅当发送消息时指定 canIncludeExpansion 值为 true,才可对消息进行拓展。
3502
- * @category 消息
3503
- * @param expansion 要更新的消息扩展信息键值对
3504
- * @param message 要更新的原始消息体
3459
+ * 获取群组消息的送达状态
3460
+ * @param messageUId 消息 UID
3461
+ * @hidden 暂时仅 BEEM 使用,无需在文档公开
3462
+ * @description 暂仅支持 Electron 平台
3463
+ */
3464
+ declare function getGroupMessageDeliverList(targetId: string, messageUId: string): Promise<IAsyncRes<IGroupMessageDeliverInfo>>;
3465
+ /**
3466
+ * 设置融云消息重排开关
3467
+ * @category Electron 独有
3468
+ * @description 发送方弱网情况下发送消息,消息到达服务但发送方没有收到服务 ack,导致发送方认为消息发送失败
3469
+ * 此种情况下,服务端和接收方都会收到第一条消息
3470
+ * 此时发送方重发该消息,再次达到服务,那么此时服务端会有两条消息(消息内容相同,messageUid 不同
3471
+ * 接收方会收到两条内容相同 messageUId 不同的消息,SDK 此时会把第二条相同内容消息排重掉
3472
+ * 以此来保证重发的相同内容消息,发送方只有一条消息,接收方也只有一条消息
3473
+ *
3474
+ * 当消息量少时,消息排重影响不大;但是本地存在大量消息时,排重会出现性能问题
3475
+ * 当本地存在大量消息,且发生收消息卡顿时,建议将排重关闭
3505
3476
  *
3477
+ * @param checkDuplicate 是否使用融云消息重排机制 true: 开启, false: 关闭
3478
+ * @since 5.7.1
3479
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
3506
3480
  * @example
3507
- * 更新(添加、替换)消息扩展属性示例:
3481
+ * 设置融云消息重排开关示例:
3508
3482
  * ```ts
3509
- * const expansion = { key1: 'value1' };
3510
- * // message IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
3511
- * const updateRes = await RongIMLib.updateMessageExpansion(expansion, message);
3512
- * console.info('更新消息扩展属性结果:', updateRes);
3483
+ * const checkDuplicate = true;
3484
+ * const res = await RongIMLib.electronExtension.setCheckDuplicateMessage(checkDuplicate);
3485
+ * console.info('设置融云消息重排开关结果:', res);
3513
3486
  * ```
3514
- */
3515
- declare function updateMessageExpansion(expansion: {
3516
- [key: string]: any;
3517
- }, message: IAReceivedMessage): Promise<IAsyncRes<void>>;
3487
+ */
3488
+ declare function setCheckDuplicateMessage(checkDuplicate?: boolean): Promise<IAsyncRes<boolean>>;
3518
3489
  /**
3519
- * 删除扩展存储
3520
- * @description 删除消息扩展信息中指定的 Key
3521
- * @category 消息
3522
- * @params keys 需删除消息扩展的 keys
3523
- * @params message 原始消息体
3490
+ * 设置聊天室消息重排开关
3491
+ * @category Electron 独有
3492
+ * @description 仅支持聊天室消息重排开关,不支持其他会话类型,聊天室消息重排开关默认开启
3493
+ * 目前仅支持对 CUID 进行排重策略修改
3494
+ * @hidden 产品协商暂不对外提供
3495
+ * @since 5.9.9
3496
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
3524
3497
  * @example
3525
- * 删除扩展存储示例:
3498
+ * 设置聊天室消息重排开关示例:
3526
3499
  * ```ts
3527
- * const keys = ['key1'];
3528
- * // message IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
3529
- * const removeRes = await RongIMLib.removeMessageExpansionForKey(keys, message);
3530
- * console.info('删除扩展存储结果:', removeRes);
3500
+ * const checkDuplicate = true;
3501
+ * const res = await RongIMLib.electronExtension.setCheckChatRoomDuplicateMessage(checkDuplicate);
3502
+ * console.info('设置聊天室消息重排开关结果:', res);
3531
3503
  * ```
3532
- */
3533
- declare function removeMessageExpansionForKey(keys: string[], message: IAReceivedMessage): Promise<IAsyncRes<void>>;
3504
+ */
3505
+ declare function setCheckChatRoomDuplicateMessage(checkDuplicate?: boolean): Promise<IAsyncRes<boolean>>;
3534
3506
  /**
3535
- * 发送输入状态消息
3536
- * @description 发送输入状态消息,用于展示对方正在输入的状态
3537
- * @category 消息
3507
+ * 获取本地指定时间戳前后 N 条消息方法
3508
+ * @category Electron 独有
3509
+ * @description 本接口仅适用 Electron 平台,获取本地指定时间戳前后 N 条消息
3538
3510
  * @param conversation 会话信息
3539
- * @param typingContentType 输入状态消息类型
3540
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3541
- *
3511
+ * @param option 获取参数
3512
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data {@link IAReceivedMessage[]} 类型的消息列表
3513
+ * @since 5.9.8
3542
3514
  * @example
3543
- * 发送输入状态消息示例:
3515
+ * 获取本地指定时间戳前后 N 条消息示例:
3544
3516
  * ```ts
3545
3517
  * const conversation = {
3546
3518
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3547
3519
  * targetId: 'targetId',
3548
- * }
3549
- * const typingContentType = RongIMLib.MessageType.TEXT;
3550
- * const typingRes = await RongIMLib.sendTypingStatusMessage(conversation, typingContentType);
3551
- * console.info('发送typing消息结果:', typingRes);
3552
- * ```
3553
- */
3554
- declare function sendTypingStatusMessage(conversation: IConversationOption, typingContentType: string): Promise<IAsyncRes<IAReceivedMessage>>;
3555
- /**
3556
- * 获取群已读列表
3557
- * @category 消息
3558
- * @param targetId 群 ID
3559
- * @param messageUId 消息UID
3560
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IMessageReaderResponse} 类型
3561
- * @example
3562
- * ```ts
3563
- * const messageUId = 'messageUId';
3564
- * const targetId = 'targetId';
3565
- * const getReaderRes = await RongIMLib.getMessageReader(targetId, messageUId);
3566
- * console.info('获取群已读列表结果:', getReaderRes);
3520
+ * };
3521
+ * const option = {
3522
+ * timestamp: 0,
3523
+ * beforeCount: 10,
3524
+ * afterCount: 10,
3525
+ * };
3526
+ * const res = await RongIMLib.electronExtension.getMessagesAroundTimestamp(conversation, option);
3527
+ * console.info('获取本地指定时间戳前后 N 条消息结果:', res);
3567
3528
  * ```
3568
3529
  */
3569
- declare function getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
3530
+ declare function getMessagesAroundTimestamp(conversation: IConversationOption, option: {
3531
+ timestamp: number;
3532
+ beforeCount: number;
3533
+ afterCount: number;
3534
+ }): Promise<IAsyncRes<IAReceivedMessage[]>>;
3570
3535
  /**
3571
- * 注册自定义消息
3572
- * @description 注册自定义消息,用于定义自定义消息的类型,会影响消息的发送和接收
3573
- * * **注意**:
3574
- * 1. 注册自定义消息代码必须在发送、接收该自定义消息之前
3575
- * 2. 推荐将所有注册自定义消息代码放在 init 方法之后, connect 方法之前
3576
- * 3. 注册的消息类型名, 必须多端一致, 否则消息无法互通
3577
- * 4. 请勿使用 RC: 开头的类型名,以免和 SDK 默认的消息名称冲突,自定义消息的消息类型名如和 SDK 默认的消息类型名相同以 SDK 默认的消息定义名为准
3578
- * 5. 需要再 connect 之前调用防止手消息行为异常
3579
- * @category 消息
3580
- * @param messageType 消息类型
3581
- * @param isPersited 是否存储
3582
- * @param isCounted 是否计数
3583
- * @param searchProps 可搜索的属性,web 端无需设置,搜索字段值设置为数字时取值范围为 (-Math.pow(2, 64), Math.pow(2, 64)) 且为整数
3584
- * @param isStatusMessage 是否状态消息,状态消息不计数,不存储,接收方在线时才能收到
3585
- * @returns 返回一个 {@link BaseMessage} 类型的构造函数
3536
+ * 获取消息
3537
+ * @category Electron 独有
3538
+ * @description 获取本地消息, 通过本地消息 ID 或 messageUId 获取消息
3539
+ * @param messageId - 支持消息 messaegId 或 messageUId
3540
+ * @since v5.16.0
3586
3541
  * @example
3542
+ * 获取消息示例:
3587
3543
  * ```ts
3588
- * const messageType = 'CustomMessage';
3589
- * const isPersited = true;
3590
- * const isCounted = true;
3591
- * const searchProps = ['content']; // 搜索字段
3592
- * const isStatusMsg = false;
3593
- * const CustomMessage = RongIMLib.registerMessageType(messageType, isPersited, isCounted, searchProps, isStatusMsg);
3544
+ * const messageUId = 'BS4O-P5AO-D1O6-9GPP';
3545
+ * const res = await RongIMLib.electronExtension.getLocalMessage(messageUId);
3546
+ * console.info('获取消息结果:', res);
3594
3547
  * ```
3595
3548
  */
3596
- declare function registerMessageType<T>(messageType: string, isPersited: boolean, isCounted: boolean, searchProps?: string[], isStatusMessage?: boolean): new (content: T) => BaseMessage<T>;
3549
+ declare function getLocalMessage(messageId: number | string): Promise<RCResult<IAReceivedMessage>>;
3550
+
3597
3551
  /**
3598
- * 获取第一条未读消息
3599
- * @description 获取指定会话中的第一条未读消息,仅支持 Electron 平台
3600
- * @category 消息
3601
- * @param conversation
3602
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3603
- *
3552
+ * 清除本地数据
3553
+ * @category Electron 独有
3554
+ * @description 该方法用于清除本地数据,包括消息列表、会话列表、拉取消息的时间戳
3555
+ * * **注意**:清除后在此登录会作为新设备进行消息拉取切操作无法恢复,谨慎使用
3556
+ * @since 5.4.0
3557
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型,表示是否清除成功
3604
3558
  * @example
3605
- * 获取第一条未读消息示例:
3559
+ * 清除本地数据示例:
3606
3560
  * ```ts
3607
- * const conversation = {
3608
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3609
- * targetId: 'targetId',
3610
- * }
3611
- * const firstUnreadRes = await RongIMLib.getFirstUnreadMessage(conversation);
3612
- * console.info('获取第一条未读消息结果:', firstUnreadRes);
3561
+ * const res = await RongIMLib.electronExtension.clearLocalData();
3562
+ * console.info('清除本地数据结果:', res);
3613
3563
  * ```
3614
3564
  */
3615
- declare function getFirstUnreadMessage(conversation: IConversationOption): Promise<IAsyncRes<IAReceivedMessage | null>>;
3565
+ declare function clearLocalData(): Promise<IAsyncRes<boolean>>;
3616
3566
  /**
3617
- * 获取第一条未读消息信息
3618
- * @category 消息
3619
- * @since 5.9.0
3620
- * @param conversation 会话信息
3621
- * @description 获取指定会话中的第一条未读消息信息
3622
- * * **注意**:
3623
- * 1. 当没有未读消息时,返回的 data 为 null
3624
- * 2. 当第一条未读消息被撤回时,此信息不会更新
3625
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IFirstUnreadMessageInfo} 类型
3626
- * @example
3627
- * 获取第一条未读消息信息示例:
3628
- * ```ts
3629
- * const conversation = {
3630
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3631
- * targetId: 'targetId',
3632
- * }
3633
- * const firstUnreadMessageInfoRes = await RongIMLib.getFirstUnreadMessageInfo(conversation);
3634
- * console.info('获取第一条未读消息信息结果:', firstUnreadMessageInfoRes);
3635
- * ```
3567
+ * 获取是否使用 Electron 扩展
3568
+ * @category Electron 独有
3569
+ * @description 该方法用于判断当前是否使用 Electron 扩展
3570
+ * @since 5.8.3
3571
+ * @returns {boolean} 是否使用 Electron 扩展
3572
+ * @example
3573
+ * 获取是否使用 Electron 扩展示例:
3574
+ * ```ts
3575
+ * const res = await RongIMLib.electronExtension.enable();
3576
+ * console.info('获取是否使用 Electron 扩展结果:', res);
3577
+ * ```
3636
3578
  */
3637
- declare function getFirstUnreadMessageInfo(conversation: IConversationOption): Promise<IAsyncRes<IFirstUnreadMessageInfo | null>>;
3579
+ declare function enable(): boolean;
3580
+
3581
+ declare const index_getAllConversationList: typeof getAllConversationList;
3582
+ declare const index_getConversationList: typeof getConversationList;
3583
+ declare const index_getConversations: typeof getConversations;
3584
+ declare const index_searchMessageInTimeRange: typeof searchMessageInTimeRange;
3585
+ declare const index_searchMessagesByUser: typeof searchMessagesByUser;
3586
+ declare const index_getHistoryMessagesByMessageTypes: typeof getHistoryMessagesByMessageTypes;
3587
+ declare const index_getContinuousMessages: typeof getContinuousMessages;
3588
+ declare const index_setMessageStatusToRead: typeof setMessageStatusToRead;
3589
+ declare const index_setMessageReceivedStatusInfo: typeof setMessageReceivedStatusInfo;
3590
+ declare const index_setMessageSentStatus: typeof setMessageSentStatus;
3591
+ declare const index_setMessageContent: typeof setMessageContent;
3592
+ declare const index_deleteMessagesByTimestamp: typeof deleteMessagesByTimestamp;
3593
+ declare const index_batchClearMessagesByTimestamp: typeof batchClearMessagesByTimestamp;
3594
+ declare const index_batchInsertMessage: typeof batchInsertMessage;
3595
+ declare const index_getMessageCount: typeof getMessageCount;
3596
+ declare const index_getPrivateMessageDeliverTime: typeof getPrivateMessageDeliverTime;
3597
+ declare const index_getGroupMessageDeliverList: typeof getGroupMessageDeliverList;
3598
+ declare const index_setCheckDuplicateMessage: typeof setCheckDuplicateMessage;
3599
+ declare const index_setCheckChatRoomDuplicateMessage: typeof setCheckChatRoomDuplicateMessage;
3600
+ declare const index_getMessagesAroundTimestamp: typeof getMessagesAroundTimestamp;
3601
+ declare const index_getLocalMessage: typeof getLocalMessage;
3602
+ declare const index_clearLocalData: typeof clearLocalData;
3603
+ declare const index_enable: typeof enable;
3604
+ declare namespace index {
3605
+ export {
3606
+ index_getAllConversationList as getAllConversationList,
3607
+ index_getConversationList as getConversationList,
3608
+ searchConversationByContent$1 as searchConversationByContent,
3609
+ index_getConversations as getConversations,
3610
+ searchMessages$1 as searchMessages,
3611
+ index_searchMessageInTimeRange as searchMessageInTimeRange,
3612
+ index_searchMessagesByUser as searchMessagesByUser,
3613
+ index_getHistoryMessagesByMessageTypes as getHistoryMessagesByMessageTypes,
3614
+ index_getContinuousMessages as getContinuousMessages,
3615
+ index_setMessageStatusToRead as setMessageStatusToRead,
3616
+ setMessageReceivedStatus$1 as setMessageReceivedStatus,
3617
+ index_setMessageReceivedStatusInfo as setMessageReceivedStatusInfo,
3618
+ index_setMessageSentStatus as setMessageSentStatus,
3619
+ index_setMessageContent as setMessageContent,
3620
+ deleteMessages$1 as deleteMessages,
3621
+ clearMessages$1 as clearMessages,
3622
+ index_deleteMessagesByTimestamp as deleteMessagesByTimestamp,
3623
+ index_batchClearMessagesByTimestamp as batchClearMessagesByTimestamp,
3624
+ insertMessage$1 as insertMessage,
3625
+ index_batchInsertMessage as batchInsertMessage,
3626
+ index_getMessageCount as getMessageCount,
3627
+ index_getPrivateMessageDeliverTime as getPrivateMessageDeliverTime,
3628
+ index_getGroupMessageDeliverList as getGroupMessageDeliverList,
3629
+ index_setCheckDuplicateMessage as setCheckDuplicateMessage,
3630
+ index_setCheckChatRoomDuplicateMessage as setCheckChatRoomDuplicateMessage,
3631
+ index_getMessagesAroundTimestamp as getMessagesAroundTimestamp,
3632
+ index_getLocalMessage as getLocalMessage,
3633
+ index_clearLocalData as clearLocalData,
3634
+ index_enable as enable,
3635
+ };
3636
+ }
3637
+
3638
3638
  /**
3639
- * 向本地插入一条消息,不发送到服务器
3640
- * @category 消息
3641
- * @deprecated 请使用 {@link RongIMLib.ElectronExtension.insertMessage} 代替
3639
+ * 获取本地消息
3640
+ * @deprecated 自 5.16.0 开始,该接口废弃,请使用 `electronExtension` 模块的 `getLocalMessage` 代替。
3642
3641
  */
3643
- declare function insertMessage$1(conversation: IConversationOption, content: IReceivedMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
3642
+ declare const getMessage: typeof getLocalMessage;
3644
3643
  /**
3645
- * 获取消息
3646
- * @description 获取本地消息, 通过本地消息 ID 或 messageUId 获取消息, 仅支持 Electron 平台
3644
+ * 发送消息
3645
+ * @description 发送消息的基础接口,可用来发送 IMLib 中的内置类型消息或自定义消息。针对不同的特定消息类型
3646
+ * @category 消息
3647
+ * @param conversation 会话信息
3648
+ * @param message 消息体,类型为 BaseMessage 的子类,如 TextMessage、ImageMessage,通过 new TextMessage() 获取
3649
+ * @param options 发送消息配置项
3650
+ *
3651
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3652
+ *
3653
+ * @example
3654
+ * 发送文本消息示例:
3655
+ * ```ts
3656
+ * const content = {content: 'hello world'};
3657
+ * const message = new RongIMLib.TextMessage(content);
3658
+ * const conversation = {
3659
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3660
+ * targetId: 'targetId'
3661
+ * }
3662
+ * const sendRes = await RongIMLib.sendMessage(conversation, message);
3663
+ * console.info('消息发送结果:', sendRes);
3664
+ * ```
3665
+ */
3666
+ declare function sendMessage(conversation: IConversationOption, message: BaseMessage, options?: ISendMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
3667
+ /**
3668
+ * 发送文本消息
3669
+ * @description 发送文本消息的快捷方式,等同于使用 new TextMessage() 创建消息体后调用 sendMessage() 方法
3670
+ * @category 消息
3671
+ * @param conversation 会话信息
3672
+ * @param messageBody 消息体
3673
+ * @param options 发送消息配置项
3674
+ *
3675
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3676
+ *
3677
+ * @example
3678
+ * 发送文本消息示例:
3679
+ * ```ts
3680
+ * const messageBody = {content: 'hello world'};
3681
+ * const conversation = {
3682
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3683
+ * targetId: 'targetId'
3684
+ * }
3685
+ * const sendRes = await RongIMLib.sendTextMessage(conversation, messageBody);
3686
+ * console.info('消息发送结果:', sendRes);
3687
+ * ```
3688
+ */
3689
+ declare function sendTextMessage(conversation: IConversationOption, messageBody: ITextMessageBody, options?: ISendMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
3690
+ /**
3691
+ * 发送消息基础类型
3692
+ * @category Type
3693
+ */
3694
+ declare type ISendBody = IUserInfo & IExtraData & {
3695
+ file: File;
3696
+ } & IMentionedInfo & IAuditInfo;
3697
+ /**
3698
+ * 发送文件消息配置项
3699
+ * @category Type
3700
+ */
3701
+ declare type ISendFileMessageOptions = ISendBody;
3702
+ /**
3703
+ * 发送文件消息
3704
+ * @description 发送文件消息的快捷方式,等同于使用 new FileMessage() 创建消息体后调用 sendMessage() 方法,支持文件上传,上传成功后自动发送消息
3705
+ * @category 消息
3706
+ * @param conversation 会话信息
3707
+ * @param msgBody 消息体,其中 file 为待上传文件引用
3708
+ * @param hooks 上传文件过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3709
+ * @param sendOptions 文件消息配置项,类型为 {@link IUploadMessageOption} 可选
3710
+ *
3711
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3712
+ *
3713
+ * @example
3714
+ * 发送文本消息示例:
3715
+ * ```ts
3716
+ * const msgBody = { file }; // file 为待上传文件
3717
+ * const conversation = {
3718
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3719
+ * targetId: 'targetId'
3720
+ * }
3721
+ * const sendRes = await RongIMLib.sendFileMessage(conversation, msgBody);
3722
+ * console.info('消息发送结果:', sendRes);
3723
+ * ```
3724
+ */
3725
+ declare const sendFileMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3726
+ /**
3727
+ * 发送图片消息配置项
3728
+ * @category Type
3729
+ */
3730
+ declare type ISendImageMessageOptions = ISendBody;
3731
+ /**
3732
+ * 发送图片消息
3733
+ * @description 发送图片消息的快捷方式,等同于使用 new ImageMessage() 创建消息体后调用 sendMessage() 方法,支持图片上传,上传成功后自动发送消息
3647
3734
  * @category 消息
3648
- * @param messageId 本地消息 ID 或 messageUId
3735
+ * @param conversation 会话信息
3736
+ * @param msgBody 消息体,其中 file 为待上传图片引用
3737
+ * @param hooks 上传图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3738
+ * @param sendOptions 图片消息配置项,类型为 {@link IImageMessageOption} 可选
3739
+ *
3649
3740
  * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3650
3741
  * @example
3651
- * 获取消息示例:
3742
+ * 发送图片消息示例:
3652
3743
  * ```ts
3653
- * const messageUId = 'BS4O-P5AO-D1O6-9GPP';
3654
- * const getMessageRes = await RongIMLib.getMessage(messageUId);
3655
- * console.info('获取消息结果:', getMessageRes);
3744
+ * const msgBody = { file }; // file 为待上传图片
3745
+ * const conversation = {
3746
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3747
+ * targetId: 'targetId'
3748
+ * }
3749
+ * const sendRes = await RongIMLib.sendImageMessage(conversation, msgBody);
3750
+ * console.info('消息发送结果:', sendRes);
3656
3751
  * ```
3657
- */
3658
- declare function getMessage(messageId: number | string): Promise<IAsyncRes<IAReceivedMessage>>;
3752
+ */
3753
+ declare const sendImageMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IImageMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3659
3754
  /**
3660
- * 获取会话下所有未读的 @ 消息
3755
+ * 发送 GIF 图片消息
3756
+ * @description 发送 GIF 图片消息的快捷方式,等同于使用 new GIFMessage() 创建消息体后调用 sendMessage() 方法,支持 GIF 图片上传,上传成功后自动发送消息
3661
3757
  * @category 消息
3662
3758
  * @param conversation 会话信息
3663
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage[]} 类型
3759
+ * @param msgBody 消息体,其中 file 为待上传 GIF 图片引用
3760
+ * @param hooks 上传 GIF 图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3761
+ * @param sendOptions GIF 图片消息配置项,类型为 {@link IGIFMessageOption} 可选
3762
+ *
3763
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3664
3764
  * @example
3665
- * 获取会话下所有未读的 @ 消息示例:
3765
+ * 发送 GIF 图片消息示例:
3666
3766
  * ```ts
3767
+ * const msgBody = { file }; // file 为待上传 GIF 图片
3667
3768
  * const conversation = {
3668
3769
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3669
- * targetId: 'targetId',
3770
+ * targetId: 'targetId'
3670
3771
  * }
3671
- * const getUnreadMentionedRes = await RongIMLib.getUnreadMentionedMessages(conversation);
3672
- * console.info('获取会话下所有未读的 @ 消息结果:', getUnreadMentionedRes);
3772
+ * const sendRes = await RongIMLib.sendGIFMessage(conversation, msgBody);
3773
+ * console.info('消息发送结果:', sendRes);
3673
3774
  * ```
3674
3775
  */
3675
- declare function getUnreadMentionedMessages(conversation: IConversationOption): IAsyncRes<IAReceivedMessage[]>;
3676
- /**
3677
- * 按关键字搜索会话内的消息
3678
- * @category 消息
3679
- * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.searchMessages} 方法
3680
- */
3681
- declare function searchMessages$1(conversation: IConversationOption, keyword: string, timestamp: number, count: number): Promise<IAsyncRes<{
3682
- messages: IAReceivedMessage[];
3683
- count: number | undefined;
3684
- }>>;
3685
- /**
3686
- * 从本地消息数据库中删除某一会话指定时间之前的消息数据
3687
- * @category 消息
3688
- * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.deleteMessagesByTimestamp} 方法
3689
- */
3690
- declare function deleteLocalMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<IAsyncRes<void>>;
3691
- /**
3692
- * 清空会话下历史消息
3693
- * @category 消息
3694
- * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.clearMessages} 方法
3695
- */
3696
- declare function clearMessages$1(conversation: IConversationOption): Promise<IAsyncRes<void>>;
3697
- /**
3698
- * 按内容搜索会话
3699
- * @category 消息
3700
- * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.searchConversationByContent} 方法
3701
- */
3702
- declare function searchConversationByContent$1(keyword: string, conversationTypes?: ConversationType[], messageTypes?: string[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[] | undefined>>;
3776
+ declare const sendGIFMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3703
3777
  /**
3704
- * 清除时间戳前的未读数
3705
- * @description 清除时间戳前的未读数,仅支持 Electron 平台。
3778
+ * 发送高清语音消息
3779
+ * @description 待发送的文件必须为 AAC 音频文件。
3780
+ * 发送高清语音消息的快捷方式,等同于使用 new HQVoiceMessage() 创建消息体后调用 sendMessage() 方法,支持高清语音上传,上传成功后自动发送消息
3706
3781
  * @category 消息
3707
3782
  * @param conversation 会话信息
3708
- * @param timestamp 清理未读时间戳
3709
- *
3783
+ * @param msgBody 消息体,其中 file 为待上传高清语音引用
3784
+ * @param hooks 上传高清语音过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3785
+ * @param sendOptions 高清语音消息配置项,类型为 {@link ISendHQVoiceMessageOptions} 可选
3786
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3710
3787
  * @example
3711
- * 清除时间戳前的未读数示例:
3788
+ * 发送高清语音消息示例:
3712
3789
  * ```ts
3790
+ * const msgBody = { file }; // file 为待上传高清语音
3713
3791
  * const conversation = {
3714
3792
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3715
- * targetId: 'targetId',
3793
+ * targetId: 'targetId'
3716
3794
  * }
3717
- * const timestamp = 1626955200000;
3718
- * const clearRes = await RongIMLib.clearUnreadCountByTimestamp(conversation, timestamp);
3719
- * console.info('清除时间戳前的未读数结果:', clearRes);
3795
+ * const sendRes = await RongIMLib.sendHQVoiceMessage(conversation, msgBody);
3796
+ * console.info('消息发送结果:', sendRes);
3720
3797
  * ```
3721
- */
3722
- declare function clearUnreadCountByTimestamp(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
3723
- /**
3724
- * 设置消息接收状态
3725
- * @category 消息
3726
- * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.setMessageReceivedStatusInfo} 方法
3727
3798
  */
3728
- declare function setMessageReceivedStatus$1(messageId: number, receivedStatus: number): Promise<IAsyncRes<void>>;
3729
-
3799
+ declare const sendHQVoiceMessage: (conversation: IConversationOption, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3730
3800
  /**
3731
- * 创建标签
3732
- * @description 创建标签系统,用于对会话进行管理。SDK 创建的标签会被同步到服务端
3733
- * SDK 支持使用一个或多个标签标记会话,可用于会话的分组显示、获取会话列表等操作,并提供了多个接口用于移除会话上的标签
3734
- * * **注意**:每个用户最多可以创建 20 个标签
3735
- * @category 标签
3736
- * @param tag 标签信息,包含标签 ID 和标签名称,类型为 {@link ITagParam}
3737
- * @returns 创建成功返回 code 为 0,失败返回错误码
3738
- * @example 创建标签示例:
3739
- * ```ts
3740
- * const tag = {
3741
- * tagId: 'tagId',
3742
- * tagName: 'tagName',
3743
- * };
3744
- * const res = await RongIMLib.addTag(tag);
3745
- * console.log('创建标签结果:', res);
3746
- * ```
3747
- */
3748
- declare function addTag(tag: ITagParam): Promise<IAsyncRes<void>>;
3749
- /**
3750
- * 删除标签
3751
- * @category 标签
3752
- * @param tagId 标签 ID
3753
- * @returns 删除成功返回 code 为 0,失败返回错误码
3754
- * @example 删除标签示例:
3755
- * ```ts
3756
- * const tagId = 'tagId';
3757
- * const res = await RongIMLib.removeTag(tagId);
3758
- * console.log('删除标签结果:', res);
3759
- * ```
3801
+ * 发送小视频消息配置项
3802
+ * @category Type
3760
3803
  */
3761
- declare function removeTag(tagId: string): Promise<IAsyncRes<void>>;
3762
- /**
3763
- * 编辑标签
3764
- * @description 编辑标签名称,标签名称最大长度为 15 个字符, 标签 ID,长度不能超过 10 个字符
3765
- * @category 标签
3766
- * @param tag 标签信息, 包含标签 ID 和标签名称,类型为 {@link ITagParam}
3767
- * @returns 编辑成功返回 code 为 0,失败返回错误码
3768
- * @example 编辑标签示例:
3769
- * ```ts
3770
- * const tag = {
3771
- * tagId: 'tagId',
3772
- * tagName: 'tagName',
3773
- * };
3774
- * const res = await RongIMLib.updateTag(tag);
3775
- * console.log('编辑标签结果:', res);
3776
- * ```
3777
- */
3778
- declare function updateTag(tag: ITagParam): Promise<IAsyncRes<void>>;
3804
+ declare type ISendSightMessageOptions = {
3805
+ duration: number;
3806
+ thumbnail: string;
3807
+ name?: string;
3808
+ } & ISendBody;
3779
3809
  /**
3780
- * 获取标签列表
3781
- * @category 标签
3782
- * @description 获取当前用户的标签列表
3783
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为标签列表,类型为 {@link ITagInfo} 数组或者 undefined
3784
- * @example 获取标签列表示例:
3810
+ * 发送小视频消息
3811
+ * @category 消息
3812
+ * @description 发送的小视频消息必须是 MP4 文件,且音频编码为 AAC,视频编码 H264,否则可能造成 iOS 或 Android 接收后不可播放问题。
3813
+ * 发送小视频消息的快捷方式,等同于使用 new SightMessage() 创建消息体后调用 sendMessage() 方法,支持小视频上传,上传成功后自动发送消息
3814
+ * @param conversation 会话信息
3815
+ * @param msgBody 消息体,其中 file 为待上传小视频引用
3816
+ * @param hooks 上传小视频过程中的回调钩子,类型为 {@link IUploadHooks} 可选
3817
+ * @param sendOptions 小视频消息配置项,类型为 {@link ISendSightMessageOptions} 可选
3818
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
3819
+ * @example
3820
+ * 发送小视频消息示例:
3785
3821
  * ```ts
3786
- * const res = await RongIMLib.getTags();
3787
- * console.log('获取标签列表结果:', res);
3822
+ * const msgBody = { file, duration: 10, thumbnail: 'base64' }; // file 为待上传小视频,duration 为小视频时长,thumbnail 为小视频封面 base64
3823
+ * const conversation = {
3824
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3825
+ * targetId: 'targetId'
3826
+ * }
3827
+ * const sendRes = await RongIMLib.sendSightMessage(conversation, msgBody);
3828
+ * console.info('消息发送结果:', sendRes);
3788
3829
  * ```
3789
3830
  */
3790
- declare function getTags(): Promise<IAsyncRes<ITagInfo[] | undefined>>;
3791
- /**
3792
- * 获取会话下的标签
3793
- * @description 根据会话信息获取具体某个会话下的标签列表
3794
- * @category 标签
3795
- * @param conversation 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption}
3796
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为标签列表,类型为 {@link IConversationTag} 数组或者 undefined
3797
- * @example 获取会话下的标签示例:
3798
- * ```ts
3799
- * const conversation = {
3800
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3801
- * targetId: 'targetId',
3802
- * };
3803
- * const res = await RongIMLib.getTagsFromConversation(conversation);
3804
- * console.log('获取会话下的标签结果:', res);
3805
- * ```
3806
- */
3807
- declare function getTagsFromConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[] | undefined>>;
3831
+ declare const sendSightMessage: (conversation: IConversationOption, msgBody: ISendSightMessageOptions, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<IAsyncRes<IAReceivedMessage>>;
3808
3832
  /**
3809
- * 添加会话到指定标签
3810
- * @description 添加会话到指定标签,一个会话可以添加到多个标签
3833
+ * 获取历史消息
3834
+ * @category 消息
3835
+ * @description 获取历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
3836
+ * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
3837
+ * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
3811
3838
  * * **注意**:
3812
- * 1. 每个标签下最多可以添加 1000 个会话
3813
- * 2. 如果标签下已添加 1000 个会话,继续在该标签下添加会话仍会成功,但会导致最早添加标签的会话被移除标签
3814
- * 3. 同一个会话可以设置多个不同的标签
3815
- * @category 标签
3816
- * @param tagId 标签 ID
3817
- * @param conversations 会话信息,包含会话类型、会话 ID channelId,类型为 {@link IConversationOption} 数组
3818
- * @example 添加会话到指定标签示例:
3839
+ * 1. Electron 获取的是本地数据库
3840
+ * 2. Web 获取的是远端历史消息,Web 端不具备持久化的数据存储能力,无法在本地持久化存储历史消息记录与会话列表,因此需要从融云服务端获取数据。
3841
+ * 3. 请确保已开通单群聊消息云端存储服务,如未开通服务请移步到融云开发者后台的 IM 服务管理模块开启。
3842
+ * @param conversation 会话信息
3843
+ * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
3844
+ * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
3845
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link GetHistoryMessageResult} 类型
3846
+ *
3847
+ * @example
3848
+ * 获取历史消息示例:
3819
3849
  * ```ts
3820
- * const tagId = 'tagId';
3821
- * const conversations = [{
3850
+ * const conversation = {
3822
3851
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3823
3852
  * targetId: 'targetId',
3824
- * }];
3825
- * const res = await RongIMLib.addConversationsToTag(tagId, conversations);
3826
- * console.log('添加会话到指定标签结果:', res);
3827
- * ```
3853
+ * }
3854
+ * const messages = await RongIMLib.getHistoryMessages(conversation);
3855
+ * console.info('获取历史消息结果:', messages);
3828
3856
  */
3829
- declare function addConversationsToTag(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
3857
+ declare function getHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
3830
3858
  /**
3831
- * 从指定标签中删除多个会话
3832
- * @description 从指定标签中删除多个会话,此操作仅解除会话与标签的关系,并不会删除会话数据
3833
- * @category 标签
3834
- * @param tagId 标签 ID
3835
- * @param conversations 会话信息,包含会话类型、会话 ID channelId,类型为 {@link IConversationOption} 数组
3836
- * @example 从指定标签中删除多个会话示例:
3859
+ * 获取远程历史消息
3860
+ * @category 消息
3861
+ * @description 获取远程历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
3862
+ * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
3863
+ * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK 5.7.4,范围为 [1-100]。默认值 `20`
3864
+ * * **注意**:
3865
+ * 需要开启单群聊消息云存储服务后,才可以从远端拉取历史消息,服务请移步到融云开发者后台的 IM 服务管理模块开启。
3866
+ *
3867
+ * @param conversation 会话信息
3868
+ * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
3869
+ * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
3870
+ *
3871
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link GetHistoryMessageResult} 类型
3872
+ * @example
3873
+ * 获取远程历史消息示例:
3837
3874
  * ```ts
3838
- * const tagId = 'tagId';
3839
- * const conversations = [{
3875
+ * const conversation = {
3840
3876
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3841
3877
  * targetId: 'targetId',
3842
- * }];
3843
- * const res = await RongIMLib.removeConversationsFromTag(tagId, conversations);
3844
- * console.log('从指定标签中删除多个会话果:', res);
3845
- * ```
3878
+ * }
3879
+ * const messages = await RongIMLib.getRemoteHistoryMessages(conversation);
3880
+ * console.info('获取远程历史消息结果:', messages);
3846
3881
  */
3847
- declare function removeConversationsFromTag(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
3882
+ declare function getRemoteHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
3848
3883
  /**
3849
- * 从指定会话中删除多个标签
3850
- * @description 从指定会话中删除多个标签,此操作仅解除会话与标签的关系,并不会删除会话数据
3851
- * @category 标签
3852
- * @param conversation 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption}
3853
- * @param tagIds 要删除的标签列表
3854
- * @example 从指定会话中删除多个标签示例:
3884
+ * 发送单聊已读回执
3885
+ * @description 发送单聊已读回执,用于标记已读消息
3886
+ * * **实现已读功能步骤:**
3887
+ * 1. 在用户查看了某单聊会话的未读消息后,调用 sendReadReceiptMessage 发送已读回执。
3888
+ * 2. 通过 addEventListener 设置消息回执监听器。
3889
+ * 3. SDK 在收到消息已读回执时派发 READ_RECEIPT_RECEIVED 事件。
3890
+ *
3891
+ * * **注意**:
3892
+ * 1. 在 Web 平台,SDK 不会记录每个会话和消息的已读状态,您需要在 localStorage 中记录每个会话的已读时间。在渲染消息列表时,根据 localStorage 中时间判断消息是否已读,更新对应的消息界面。
3893
+ * 2. 在 Electron 平台,收到 READ_RECEIPT_RECEIVED 通知时,您需要调用
3894
+ * {@link electronExtension.setMessageStatusToRead} 方法更新消息已读状态,并更新对应的消息界面。
3895
+ * 3. 调用 `sendReadReceiptMessage` 接口不会清除未读数,需单独调用清除未读数接口 {@link clearMessagesUnreadStatus}。
3896
+ *
3897
+ * @param targetId 目标 ID
3898
+ * @param messageUId 消息唯一标识,可在 Message 中获取
3899
+ * @param timestamp 消息的发送时间,可通过 Message 中 sendTime 获取
3900
+ * @category 消息
3901
+ * @example
3902
+ * 单聊消息回执示例:
3855
3903
  * ```ts
3856
- * const conversation = {
3857
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3858
- * targetId: 'targetId',
3859
- * };
3860
- * const tagIds = ['tagId1', 'tagId2'];
3861
- * const res = await RongIMLib.removeTagsFromConversation(conversation, tagIds);
3862
- * console.log('从指定会话中删除多个标签结果:', res);
3904
+ * const targetId = 'targetId';
3905
+ * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
3906
+ * const timestamp = 1632728573423;
3907
+ *
3908
+ * const readReceiptRes = await RongIMLib.sendReadReceiptMessage(targetId, messageUId, timestamp);
3909
+ * console.info('单聊消息回执:', readReceiptRes)
3863
3910
  * ```
3864
3911
  */
3865
- declare function removeTagsFromConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<void>>;
3912
+ declare function sendReadReceiptMessage(targetId: string, messageUId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<void>>;
3866
3913
  /**
3867
- * 从多个会话中删除指定的标签
3868
- * @description 从多个会话中删除指定的标签,此操作仅解除会话与标签的关系,并不会删除会话数据
3869
- * @category 标签
3870
- * @param tagId 标签 ID
3871
- * @param conversations 会话信息列表
3872
- * @example 从多个会话中删除指定的标签示例:
3914
+ * 发送群已读回执请求
3915
+ * @description 实现群聊中按需获取己方发送消息的阅读状态请求。与群聊已读回执响应接口 {@link sendReadReceiptResponseV2} 配套使用。单独调用无法实现群回执能力
3916
+ *
3917
+ * @category 消息
3918
+ * @param targetId 目标 ID
3919
+ * @param messageUIds 消息UID列表
3920
+ *
3921
+ *@example
3922
+ * 群已读回执请求示例:
3873
3923
  * ```ts
3874
- * const tagId = 'tagId';
3875
- * const conversations = [{
3876
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3877
- * targetId: 'targetId',
3878
- * }];
3879
- * const res = await RongIMLib.removeTagFromConversations(tagId, conversations);
3880
- * console.log('从多个会话中删除指定的标签:', res);
3924
+ * const targetId = 'targetId';
3925
+ * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
3926
+ * const readReceiptRes = await RongIMLib.sendReadReceiptRequest(targetId, messageUId);
3927
+ * console.info('群已读回执请求:', readReceiptRes)
3881
3928
  * ```
3882
3929
  */
3883
- declare function removeTagFromConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
3930
+ declare function sendReadReceiptRequest(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<void>>;
3884
3931
  /**
3885
- * 分页获取标签下会话列表
3886
- * @category 标签
3887
- * @param tagId 标签id
3888
- * @param count 获取数量
3889
- * @param timestamp 会话中消息的时间戳
3890
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为会话列表,类型为 {@link IAReceivedConversationByTag} 数组或者 undefined
3891
- * 从 SDK 版本 @since 5.7.0 开始该接口的返回数据类型由 {@link IReceivedConversationByTag} 变更为 {@link IAReceivedConversationByTag}
3892
- * @example 分页获取标签下会话列表示例:
3893
- * ```ts
3894
- * const tagId = 'tagId';
3895
- * const count = 10;
3896
- * const timestamp = 0;
3897
- * const res = await RongIMLib.getConversationsFromTagByPage(tagId, count, timestamp);
3898
- * console.log('分页获取标签下会话列表结果:', res);
3899
- * ```
3932
+ * @category 消息
3933
+ * @deprecated 已废弃,@since 5.1.1。请替换使用 {@link sendReadReceiptResponseV2} 方法
3900
3934
  */
3901
- declare function getConversationsFromTagByPage(tagId: string, count: number, startTime: number): Promise<IAsyncRes<IAReceivedConversationByTag[] | undefined>>;
3935
+ declare function sendReadReceiptResponse(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes<void>>;
3902
3936
  /**
3903
- * 根据标签获取未读消息数
3904
- * @category 标签
3905
- * @param tagId 标签id
3906
- * @param containMuted 是否包含免打扰
3907
- * @example 根据标签获取未读消息数示例:
3937
+ * 发送群阅读回执响应V2
3938
+ * @description 实现群聊中按需获取己方发送消息的阅读状态响应。
3939
+ * 与群聊已读回执请求接口 {@link sendReadReceiptRequest} 配套使用。单独调用无法实现群回执能力
3940
+ * * **注意**:
3941
+ * 5.9.4 版本之后,SDK 内部维护了已读回执请求信息,并在历史消息列表里携带已读回执信息:readReceiptInfo, 在 Web 平台和 Electron 平台实现不同之处:
3942
+ * Web 和 Electron 平台的区别:
3943
+ * 1. 在 Web 平台,SDK 内部会缓存每个群会话的最新 30 个已读回执信息(以已读回执请求的发送时间为准),缓存有效期为 24H。
3944
+ * 在发送消息回执响应时无需传 messageList 字段,SDK 会把该会话下的所有请求组织好然后发送响应。
3945
+ *
3946
+ * 2. 在 Electron 平台,用户需先获取历史消息,取出 message.messageDirection = MessageDirection.RECEIVE , readReceiptInfo.
3947
+ * isReceiptRequestMessage = true 并且 readReceiptInfo.hasRespond = false 的数据组织成参数 messageList 来发送回执响应。
3948
+ * @category 消息
3949
+ * @param targetId 群组Id
3950
+ * @param messageList 要回执的消息列表,结构为: \{senderUserId: [messageUId1, messageUId2]\}
3951
+ * @since 5.1.1
3952
+ * @example
3953
+ * 群已读回执响应示例:
3908
3954
  * ```ts
3909
- * const tagId = 'tagId';
3910
- * const containMuted = false;
3911
- * const res = await RongIMLib.getUnreadCountByTag(tagId, containMuted);
3912
- * console.log('根据标签获取未读消息数结果:', res);
3913
- * ```
3955
+ * const targetId = 'targetId';
3956
+ * const messageList = {
3957
+ * 'senderUserId': ['messageUId1', 'messageUId2'],
3958
+ * }
3959
+ * const readReceiptRes = await RongIMLib.sendReadReceiptResponseV2(targetId, messageList);
3960
+ * console.info('群已读回执响应:', readReceiptRes);
3914
3961
  */
3915
- declare function getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number | undefined>>;
3962
+ declare function sendReadReceiptResponseV2(targetId: string, messageList?: {
3963
+ [senderUserId: string]: string[];
3964
+ }, channelId?: string): Promise<IAsyncRes<void>>;
3916
3965
  /**
3917
- * 设置标签中会话置顶
3918
- * @description 设置在指定标签下置顶的会话。如果根据标签获取会话,可在获取的会话中可以看到该属性。请注意与会话列表中的会话置顶相区分
3919
- * @category 标签
3920
- * @param tagId 标签id
3921
- * @param conversation 会话
3922
- * @param status 状态
3923
- * @example 设置标签中会话置顶示例:
3966
+ * 多端同步阅读状态
3967
+ * @description 由于未读消息数存储在本地,服务器不存未读消息数量。当用户多端登录时,需要同步未读消息数以保证多端未读数一致
3968
+ * @param conversation 会话信息
3969
+ * @param timestamp 需要同步消息阅读的时间戳,可以在消息体中通过消息的 sendTime 获取
3970
+ * @category 消息
3971
+ * @example
3972
+ * 多端同步阅读状态示例:
3924
3973
  * ```ts
3925
- * const tagId = 'tagId';
3926
3974
  * const conversation = {
3927
3975
  * conversationType: RongIMLib.ConversationType.PRIVATE,
3928
3976
  * targetId: 'targetId',
3929
- * };
3930
- * const isTop = true;
3931
- * const res = await RongIMLib.setConversationToTopInTag(tagId, conversation, isTop);
3932
- * console.log('设置标签中会话置顶结果:', res);
3977
+ * }
3978
+ * const timestamp = 1632728573423; // 阅读消息的 sendTime
3979
+ * const syncReadStatusRes = await RongIMLib.sendSyncReadStatusMessage(conversation, timestamp);
3980
+ * console.info('多端同步阅读状态:', syncReadStatusRes);
3933
3981
  * ```
3934
3982
  */
3935
- declare function setConversationToTopInTag(tagId: string, conversation: IConversationOption, isTop: boolean): Promise<IAsyncRes<void>>;
3936
-
3937
- /**
3938
- * 创建文件上传任务
3939
- * @param uploadInfo
3940
- * @hidden
3941
- * @returns
3942
- */
3943
- declare function createUploadTask(uploadInfo: IUploadInfo): Promise<IAsyncRes<UploadTask>>;
3944
- /**
3945
- * 停止文件上传任务
3946
- * @hidden
3947
- * @param taskId
3948
- * @returns
3949
- */
3950
- declare function stopUploadTask(taskId: number): Promise<IAsyncRes<boolean>>;
3951
- /**
3952
- * 上传文件
3953
- * @hidden
3954
- */
3955
- declare function upload(uploadInfo: IUploadInfo): Promise<IAsyncRes<IUploadResult>>;
3983
+ declare function sendSyncReadStatusMessage(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
3956
3984
  /**
3957
- * 获取文件 token
3958
- * @description 上传文件时,获取文件 token
3985
+ * 发送已读回执(V4 版本)
3986
+ *
3987
+ * 调用此接口后,消息的发送者会收到 EVENTS.MESSAGE_READ_RECEIPT_V4 事件通知
3988
+ *
3989
+ * 调用此接口需在开发者后台开通服务
3990
+ * @since 5.9.0
3959
3991
  * @hidden
3960
- * @param fileType 上传类型, 通过 RongIMLib.FILE_TYPE 获取
3961
- * @param fileName 上传文件名,Server 通过文件名生成百度上传认证, 若不传 engine 自动生成
3962
- * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
3963
- * @param queryString STC 分段上传时的查询字符串
3964
- * `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
3965
- * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`,filename为空
3966
- * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`,
3967
- * filename为第一个步骤生成的filename
3968
- * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`,filename为第一个步骤生成的filename
3992
+ * @param conversation 会话信息,支持单聊、群聊
3993
+ * @param endMsgUId 结束消息 UId
3994
+ * @param startMsgUId 开始消息UId, 仅群聊时有效
3995
+ * @example
3996
+ * ```js
3997
+ * const con = {
3998
+ * conversationType: ConversationType.Group,
3999
+ * targetId: 'targetId'
4000
+ * }
4001
+ * sendReadReceiptMessageV4(con, 'endMsgUId', 'startMsgUId').then(res => {
4002
+ * if (res.code === ErrorCode.success) {
4003
+ * console.log('send success')
4004
+ * } else {
4005
+ * console.log('send error', res.msg)
4006
+ * }
4007
+ * })
4008
+ * ```
3969
4009
  */
3970
- declare function getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<IAsyncRes<IUploadAuth & {
3971
- bos: string;
3972
- qiniu: string;
3973
- ossConfig: string;
3974
- }>>;
4010
+ declare function sendReadReceiptMessageV4(conversation: IConversationOption, endMsgUId: string, startMsgUId?: string): Promise<IAsyncRes<void>>;
3975
4011
  /**
3976
- * 获取下载鉴权信息
3977
- * @param url 文件 URL 地址
3978
- * @description 通过文件 URL 地址获取下载鉴权信息,用于下载文件时的鉴权
4012
+ * 获取消息的已读回执列表
4013
+ *
4014
+ * 调用此接口需在开发者后台开通服务
4015
+ * @since 5.9.0
3979
4016
  * @hidden
3980
- * token: RCX 存储鉴权 token,优先使用
3981
- * downloadAuthInfo: RCX 升级后,公有云私有化部署的下载鉴权信息
4017
+ * @param conversation 会话信息, 仅支持群聊
4018
+ * @param messageUId 消息 UId
4019
+ * @example
4020
+ * ```js
4021
+ * const con = {
4022
+ * conversationType: ConversationType.Group,
4023
+ * targetId: 'targetId'
4024
+ * }
4025
+ * getMessageReadReceiptV4(con, 'MsgUId').then(res => {
4026
+ * if (res.code === ErrorCode.success) {
4027
+ * console.log('send success', res.data)
4028
+ * } else {
4029
+ * console.log('send error', res.msg)
4030
+ * }
4031
+ * })
4032
+ * ```
3982
4033
  */
3983
- declare function getDownloadAuth(url: string): Promise<IAsyncRes<{
3984
- deadline: number;
3985
- token?: string;
3986
- downloadAuthInfo?: IDownloadAuth;
3987
- }>>;
4034
+ declare function getMessageReadReceiptV4(conversation: IConversationOption, messageUId: string): Promise<IAsyncRes<IMessageReadReceiptV4Response>>;
3988
4035
  /**
3989
- * 获取文件的下载地址
4036
+ * 获取消息的已读回执列表
4037
+ *
4038
+ * 调用此接口需在开发者后台开通服务
4039
+ * @since 5.9.0
3990
4040
  * @hidden
3991
- * @param fileType 文件类型
3992
- * @param fileName 文件名
3993
- * @param saveName 下载后的存储文件名
3994
- * @param uploadRes 上传成功返回的数据,百度 bos 上传地址即为下载地址,IM Server 不会返回百度 bos 下载地址,通过用户层传入再返回
3995
- * @param serverType 使用的存储服务标识
3996
- * @returns
3997
- */
3998
- declare function getFileUrl(fileType: FileType, filename?: string, saveName?: string, uploadRes?: {
3999
- isBosRes: boolean;
4000
- downloadUrl: string;
4001
- }, serverType?: UploadMethod): Promise<IAsyncRes<{
4002
- downloadUrl: string;
4003
- }>>;
4004
-
4005
- /**
4006
- * @deprecated 从 5.6.0 版本开始,此定义失效
4007
- * @category 基础
4041
+ * @param conversation 会话信息, 仅支持群聊
4042
+ * @param messageUIds 消息 UId 列表
4043
+ * @example
4044
+ * ```js
4045
+ * const con = {
4046
+ * conversationType: ConversationType.Group,
4047
+ * targetId: 'targetId'
4048
+ * }
4049
+ * batchGetMessageReadReceiptInfoV4(con, ['MsgUId']).then(res => {
4050
+ * if (res.code === ErrorCode.success) {
4051
+ * console.log('send success', res.data)
4052
+ * } else {
4053
+ * console.log('send error', res.msg)
4054
+ * }
4055
+ * })
4056
+ * ```
4008
4057
  */
4009
- declare const ConnectType: {
4010
- COMET: string;
4011
- WEBSOCKET: string;
4012
- };
4058
+ declare function batchGetMessageReadReceiptInfoV4(conversation: IConversationOption, messageUIds: string[]): Promise<IAsyncRes<IGroupReadReceiptData[]>>;
4013
4059
  /**
4014
- * 消息类型
4060
+ * 撤回消息
4061
+ * @description 融云对撤回消息的操作者不作限制。
4062
+ * 如需避免用户撤回非本人发送的消息,可以提交工单申请打开IMLib SDK 只允许撤回自己发送的消息。从融云服务端进行限制,禁止用户撤回非本人发送的消息。
4015
4063
  * @category 消息
4064
+ * @param conversation 会话信息
4065
+ * @param options 撤回消息参数
4066
+ * @example
4067
+ * 撤回消息示例:
4068
+ * ```ts
4069
+ * const conversation = {
4070
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4071
+ * targetId: 'targetId',
4072
+ * }
4073
+ * const options = {
4074
+ * messageUId: 'messageUId',
4075
+ * sentTime: 1632728573423,
4076
+ * }
4077
+ * const recallRes = await RongIMLib.recallMessage(conversation, options);
4078
+ * console.info('撤回消息结果:', recallRes);
4079
+ * ```
4080
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
4016
4081
  */
4017
- declare const MessageType: {
4018
- TEXT: string;
4019
- VOICE: string;
4020
- HQ_VOICE: string;
4021
- IMAGE: string;
4022
- GIF: string;
4023
- RICH_CONTENT: string;
4024
- LOCATION: string;
4025
- FILE: string;
4026
- SIGHT: string;
4027
- COMBINE: string;
4028
- COMBINE_V2: string;
4029
- CHRM_KV_NOTIFY: string;
4030
- LOG_COMMAND: string;
4031
- EXPANSION_NOTIFY: string;
4032
- REFERENCE: string;
4033
- RECALL_MESSAGE_TYPE: string;
4034
- };
4035
-
4082
+ declare function recallMessage(conversation: IConversationOption, options: IRecallMessageOptions): Promise<RCResult<IAReceivedMessage>>;
4036
4083
  /**
4037
- * 获取全部本地会话列表
4038
- * @category Electron 独有
4039
- * @description 本接口仅适用 Electron 平台获取全部本地会话列表
4040
- * * **注意**:此接口不包含超级群会话
4041
- * @param channelId 频道 ID,不传则获取全部频道 ID 类型
4042
- * @since 5.4.0
4043
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
4084
+ * 按消息 UId 删除消息
4085
+ * @category 消息
4086
+ * @description 根据消息的 ID、时间戳和方向(发送或接收)从服务端删除指定单个会话中的一条或一组消息。
4087
+ * * **注意**:
4088
+ * 1. 删除消息仅会删除本端消息,不会删除对端消息。A B 之间的消息,A 删除消息后,B 仍然可以看到消息。如 B 需要无法查看需要调用撤回消息 {@link recallMessage}接口。
4089
+ * 2. 仅适用于 App Key 已开通单群聊消息云端存储 的 App。
4090
+ * 3. 服务端默认不会删除对应的离线消息补偿,如需彻底删除消息补偿,请提交工单,申请开通删除服务端历史消息时同时删除多端补偿的离线消息。
4091
+ *
4092
+ * @param conversation 会话信息
4093
+ * @param messages 消息列表
4044
4094
  * @example
4045
- * 获取全部本地会话列表示例:
4095
+ * 按消息 UId 删除消息示例:
4046
4096
  * ```ts
4047
- * const conversationList = await RongIMLib.electronExtension.getAllConversationList();
4048
- * console.log('获取全部本地会话列表结果:', conversationList);
4097
+ * const conversation = {
4098
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4099
+ * targetId: 'targetId',
4100
+ * };
4101
+ * const messages = [{
4102
+ * messageUId: 'BS4O-P5AO-D1O6-9GPP', // 消息 UId
4103
+ * sentTime: 1632728573423, // 消息发送时间
4104
+ * messageDirection: RongIMLib.MessageDirection.SEND, // 消息方向
4105
+ * }];
4106
+ * const deleteRes = await RongIMLib.deleteMessages(conversation, messages);
4107
+ * console.info('删除消息结果:', deleteRes);
4049
4108
  * ```
4050
4109
  */
4051
- declare function getAllConversationList(channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
4110
+ declare function deleteMessages(conversation: IConversationOption, messages: {
4111
+ /**
4112
+ * 消息 id
4113
+ */
4114
+ messageUId: string;
4115
+ /**
4116
+ * 消息发送时间
4117
+ */
4118
+ sentTime: number;
4119
+ /**
4120
+ * 消息方向
4121
+ * * 1: 发送
4122
+ * * 2: 接收
4123
+ */
4124
+ messageDirection: MessageDirection;
4125
+ }[]): Promise<IAsyncRes<void>>;
4052
4126
  /**
4053
- * 分页获取本地会话列表
4054
- * @category Electron 独有
4055
- * @description 本接口仅适用 Electron 平台分页获取本地会话列表,
4056
- * * **注意**:不包含超级群会话
4057
- * @param startTime 获取会话起始时间,需要精确到毫秒,0 表示当前时间
4058
- * @param count 分页数量
4059
- * @param channelId 频道 ID,不传则获取全部频道 ID 类型
4060
- * @param topPriority 是否置顶优先
4061
- * @defaultValue topPriority false
4062
- * @since 5.4.0
4063
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
4127
+ * 按时间戳删除消息
4128
+ * @description 根据时间戳删除指定单个会话中早于(含)指定时间戳的所有消息。
4129
+ * @category 消息
4130
+ * @param conversation 会话
4131
+ * @param timestamp 清除时间点, 该时间之前的消息将被清除
4132
+ *
4064
4133
  * @example
4065
- * 分页获取本地会话列表示例:
4134
+ * 按时间戳删除消息示例:
4066
4135
  * ```ts
4067
- * const startTime = 0;
4068
- * const count = 10;
4069
- * const conversationList = await RongIMLib.electronExtension.getConversationList(startTime, count);
4070
- * console.log('分页获取本地会话列表结果:', conversationList);
4136
+ * const conversation = {
4137
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4138
+ * targetId: 'targetId',
4139
+ * }
4140
+ * const timestamp = 1632728573423;
4141
+ * const clearRes = await RongIMLib.clearHistoryMessages(conversation, timestamp);
4142
+ * console.info('清除消息结果:', clearRes);
4071
4143
  * ```
4072
4144
  */
4073
- declare function getConversationList(startTime: number, count: number, channelId?: string, topPriority?: boolean): Promise<IAsyncRes<IAReceivedConversation[]>>;
4145
+ declare function clearHistoryMessages(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
4074
4146
  /**
4075
- * 搜索本地会话列表
4076
- * @category Electron 独有
4077
- * @description 本接口仅适用 Electron 平台搜索本地会话列表
4078
- * * **注意**:
4079
- * 1. 不包含超级群会话
4080
- * 2. 支持查询自定义消息类型,需要再注册自定义消息时设置搜索字段,否则无法搜索 ,详细请查看 {@link registerMessageType} searchProps 参数
4081
- * @param keyword 搜索关键字
4082
- * @param messageTypes 消息类型
4083
- * @param channelId 频道 ID,不传则获取全部频道 ID 类型
4084
- * @since 5.4.0
4085
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
4147
+ * @hidden
4148
+ * 批量删除多个会话的远端消息
4149
+ * @category 消息
4150
+ * @description 批量删除服务端多个会话早于(含)发送时间的所有远端消息(Electron 平台可以删除对应的本地消息)
4151
+ * @param conversations 会话列表,最大数量为 20
4152
+ * @param isDeleteLocal 是否删除本地消息, Electron 平台支持,默认为 false
4153
+ * @since 5.9.0
4154
+ * 时间戳,传 0 清除所有消息
4155
+ * 支持的会话类型:单聊, 群聊, 聊天室, 系统消息
4086
4156
  * @example
4087
- * 搜索本地会话列表示例:
4157
+ * 批量删除多个会话的远端消息示例:
4088
4158
  * ```ts
4089
- * const keyword = 'keyword';
4090
- * const messageTypes = [RongIMLib.MessageType.TEXT];
4091
- * const conversationList = await RongIMLib.electronExtension.searchConversationByContent(keyword, messageTypes);
4092
- * console.log('搜索本地会话列表结果:', conversationList);
4159
+ * batchClearHistoryMessages([
4160
+ * {
4161
+ * conversationType: ConversationType.PRIVATE,
4162
+ * targetId: 'targetId',
4163
+ * timestamp: 0,
4164
+ * channelId: '',
4165
+ * }, true]).then(res => {
4166
+ * console.log(res);
4167
+ * });
4093
4168
  * ```
4094
4169
  */
4095
- declare function searchConversationByContent(keyword: string, messageTypes: string[], channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
4170
+ declare function batchClearRemoteHistoryMessages(clearMessageOption: IClearMessageOption[], isDeleteLocal?: boolean): Promise<IAsyncRes<void>>;
4096
4171
  /**
4097
- * 批量获取会话列表
4098
- * @category Electron 独有
4099
- * @description 本接口仅适用 Electron 平台批量获取会话列表,通过提供会话的唯一标标识属性返回 {@link IReceivedConversation} 类型的会话信息
4172
+ * 更新(添加、替换)消息扩展属性
4173
+ * @description 消息扩展功能可为消息增加基于 Key/Value 的状态标识。消息的扩展信息可在发送前、后设置或更新,可用于实现消息评论、礼物领取、订单状态变化等业务需求。
4100
4174
  * * **注意**:
4101
- * 1. 仅支持单群聊系统会话
4102
- * @since 5.9.9
4103
- * @param conversations 需要获取会话的信息,一次最多获取 100 个会话
4104
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
4175
+ * 1. 单条消息单次最多可设置 20 个扩展信息 KV 对,总计不可超过 300 个扩展信息 KV 对。
4176
+ * 2. 消息扩展(Key、Value 扩展信息)会被存储。如已开通历史消息云存储功能,从服务端获取的历史消息也会携带已设置的扩展信息。
4177
+ * 3. 仅支持单聊、群聊会话类型,不支持聊天室类型。
4178
+ * 4. 仅当发送消息时指定 canIncludeExpansion 值为 true,才可对消息进行拓展。
4179
+ * @category 消息
4180
+ * @param expansion 要更新的消息扩展信息键值对
4181
+ * @param message 要更新的原始消息体
4182
+ *
4105
4183
  * @example
4106
- * 批量获取会话列表示例:
4184
+ * 更新(添加、替换)消息扩展属性示例:
4107
4185
  * ```ts
4108
- * const conversations = [{ conversationType: RongIMLib.ConversationType.PRIVATE, targetId: 'targetId' }];
4109
- * const conversationList = await RongIMLib.electronExtension.getConversations(conversations);
4110
- * console.log('批量获取会话列表结果:', conversationList);
4186
+ * const expansion = { key1: 'value1' };
4187
+ * // message IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
4188
+ * const updateRes = await RongIMLib.updateMessageExpansion(expansion, message);
4189
+ * console.info('更新消息扩展属性结果:', updateRes);
4111
4190
  * ```
4112
- */
4113
- declare function getConversations(conversations: IConversationOption[]): Promise<IAsyncRes<IAReceivedConversation[]>>;
4114
-
4191
+ */
4192
+ declare function updateMessageExpansion(expansion: {
4193
+ [key: string]: any;
4194
+ }, message: IAReceivedMessage): Promise<IAsyncRes<void>>;
4115
4195
  /**
4116
- * 根据关键字搜索本地消息
4117
- * @category Electron 独有
4118
- * @description 本接口仅适用 Electron 平台搜索本地消息
4119
- * * **注意**:
4120
- * 1. 文本类型消息只支持搜索 content,文件类型消息只支持搜索 name
4121
- * 2. 自定义消息根据 registerMessageType 的 searchProps 参数决定
4122
- * 3. 引用消息不支持搜索
4123
- * 4. 如果不传 channelId,则在所有 channelId 中搜索消息
4124
- * 5. 如果不传 messageTypes,则搜索所有支持搜索的消息类型
4125
- * @since 5.4.0
4126
- * @param conversation 会话信息
4127
- * @param keyword 搜索关键字
4128
- * @param startTime 搜索时间, 搜索该时间之前的消息
4129
- * @param count 获取的数量
4130
- * @param messageTypes 消息类型,@since 5.9.8 开始支持按照消息类型搜索,支持范围:文本(RC:TxtMsg)、文件(RC:FileMsg)、设置 {@link searchProps} 的自定义消息
4131
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4196
+ * 删除扩展存储
4197
+ * @description 删除消息扩展信息中指定的 Key
4198
+ * @category 消息
4199
+ * @params keys 需删除消息扩展的 keys
4200
+ * @params message 原始消息体
4132
4201
  * @example
4133
- * 根据关键字搜索本地消息示例:
4202
+ * 删除扩展存储示例:
4134
4203
  * ```ts
4135
- * const conversation = {
4136
- * conversationType: RongIMLib.ConversationType.PRIVATE,
4137
- * targetId: 'targetId',
4138
- * };
4139
- * const keyword = 'keyword';
4140
- * const startTime = Date.now();
4141
- * const count = 10;
4142
- * const res = await RongIMLib.electronExtension.searchMessages(conversation, keyword, startTime, count);
4143
- * console.info('根据关键字搜索本地消息结果:', res);
4204
+ * const keys = ['key1'];
4205
+ * // message 为 IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
4206
+ * const removeRes = await RongIMLib.removeMessageExpansionForKey(keys, message);
4207
+ * console.info('删除扩展存储结果:', removeRes);
4144
4208
  * ```
4145
- */
4146
- declare function searchMessages(conversation: IConversationOption, keyword: string, startTime: number, count: number, messageTypes?: string[]): Promise<IAsyncRes<{
4147
- messages: IAReceivedMessage[];
4148
- count: number | undefined;
4149
- }>>;
4209
+ */
4210
+ declare function removeMessageExpansionForKey(keys: string[], message: IAReceivedMessage): Promise<IAsyncRes<void>>;
4150
4211
  /**
4151
- * 在指定时间范围内搜索本地消息
4152
- * @category Electron 独有
4153
- * @description 本接口仅适用 Electron 平台搜索本地消息
4154
- * @since 5.4.0
4212
+ * 发送输入状态消息
4213
+ * @description 发送输入状态消息,用于展示对方正在输入的状态
4214
+ * @category 消息
4155
4215
  * @param conversation 会话信息
4156
- * @param option 搜索参数,类型为 {@link ISearchMessageInTimeRangeOption}
4157
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4216
+ * @param typingContentType 输入状态消息类型
4217
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
4218
+ *
4158
4219
  * @example
4159
- * 在指定时间范围内搜索本地消息示例:
4220
+ * 发送输入状态消息示例:
4160
4221
  * ```ts
4161
4222
  * const conversation = {
4162
4223
  * conversationType: RongIMLib.ConversationType.PRIVATE,
4163
- * targetId: 'targetId'
4164
- * }
4165
- * const option = {
4166
- * keyword: 'keyword',
4167
- * startTime: 0,
4168
- * endTime: 1632728573423,
4224
+ * targetId: 'targetId',
4169
4225
  * }
4170
- * const res = await RongIMLib.electronExtension.searchMessageInTimeRange(conversation, option)
4171
- * console.info('在指定时间范围内搜索本地消息结果:', res);
4226
+ * const typingContentType = RongIMLib.MessageType.TEXT;
4227
+ * const typingRes = await RongIMLib.sendTypingStatusMessage(conversation, typingContentType);
4228
+ * console.info('发送typing消息结果:', typingRes);
4172
4229
  * ```
4173
4230
  */
4174
- declare function searchMessageInTimeRange(conversation: {
4175
- conversationType: ConversationType;
4176
- targetId: string;
4177
- }, option: ISearchMessageInTimeRangeOption): Promise<IAsyncRes<{
4178
- messages: IAReceivedMessage[];
4179
- }>>;
4231
+ declare function sendTypingStatusMessage(conversation: IConversationOption, typingContentType: string): Promise<IAsyncRes<IAReceivedMessage>>;
4180
4232
  /**
4181
- * 根据用户 ID 搜索本地消息
4182
- * @category Electron 独有
4183
- * @description 本接口仅适用 Electron 平台在指定会话的所有频道中根据用户 ID 搜索时间范围内的消息
4184
- * @param conversation 会话信息
4185
- * @param count 获取的数量
4186
- * @param startTime 搜索时间,搜索时间之前的消息
4187
- * @param userId 用户 ID
4188
- * @since 5.7.10
4189
- * @return 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4233
+ * 获取群已读列表
4234
+ * @category 消息
4235
+ * @param targetId ID
4236
+ * @param messageUId 消息UID
4237
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IMessageReaderResponse} 类型
4190
4238
  * @example
4191
- * 根据用户 ID 搜索本地消息示例:
4239
+ * ```ts
4240
+ * const messageUId = 'messageUId';
4241
+ * const targetId = 'targetId';
4242
+ * const getReaderRes = await RongIMLib.getMessageReader(targetId, messageUId);
4243
+ * console.info('获取群已读列表结果:', getReaderRes);
4244
+ * ```
4245
+ */
4246
+ declare function getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
4247
+ /**
4248
+ * 注册自定义消息
4249
+ * @description 注册自定义消息,用于定义自定义消息的类型,会影响消息的发送和接收
4250
+ * * **注意**:
4251
+ * 1. 注册自定义消息代码必须在发送、接收该自定义消息之前
4252
+ * 2. 推荐将所有注册自定义消息代码放在 init 方法之后, connect 方法之前
4253
+ * 3. 注册的消息类型名, 必须多端一致, 否则消息无法互通
4254
+ * 4. 请勿使用 RC: 开头的类型名,以免和 SDK 默认的消息名称冲突,自定义消息的消息类型名如和 SDK 默认的消息类型名相同以 SDK 默认的消息定义名为准
4255
+ * 5. 需要再 connect 之前调用防止手消息行为异常
4256
+ * @category 消息
4257
+ * @param messageType 消息类型
4258
+ * @param isPersited 是否存储
4259
+ * @param isCounted 是否计数
4260
+ * @param searchProps 可搜索的属性,web 端无需设置,搜索字段值设置为数字时取值范围为 (-Math.pow(2, 64), Math.pow(2, 64)) 且为整数
4261
+ * @param isStatusMessage 是否状态消息,状态消息不计数,不存储,接收方在线时才能收到
4262
+ * @returns 返回一个 {@link BaseMessage} 类型的构造函数
4263
+ * @example
4264
+ * ```ts
4265
+ * const messageType = 'CustomMessage';
4266
+ * const isPersited = true;
4267
+ * const isCounted = true;
4268
+ * const searchProps = ['content']; // 搜索字段
4269
+ * const isStatusMsg = false;
4270
+ * const CustomMessage = RongIMLib.registerMessageType(messageType, isPersited, isCounted, searchProps, isStatusMsg);
4271
+ * ```
4272
+ */
4273
+ declare function registerMessageType<T>(messageType: string, isPersited: boolean, isCounted: boolean, searchProps?: string[], isStatusMessage?: boolean): new (content: T) => BaseMessage<T>;
4274
+ /**
4275
+ * 获取第一条未读消息
4276
+ * @description 获取指定会话中的第一条未读消息,仅支持 Electron 平台
4277
+ * @category 消息
4278
+ * @param conversation
4279
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
4280
+ *
4281
+ * @example
4282
+ * 获取第一条未读消息示例:
4192
4283
  * ```ts
4193
4284
  * const conversation = {
4194
4285
  * conversationType: RongIMLib.ConversationType.PRIVATE,
4195
- * targetId: 'targetId'
4196
- * };
4197
- * const userId = 'userId';
4198
- * const startTime = Date.now();
4199
- * const count = 10;
4200
- * const res = await RongIMLib.electronExtension.searchMessagesByUser(conversation, userId, startTime, count);
4201
- * console.info('根据用户 ID 搜索本地消息', res);
4286
+ * targetId: 'targetId',
4287
+ * }
4288
+ * const firstUnreadRes = await RongIMLib.getFirstUnreadMessage(conversation);
4289
+ * console.info('获取第一条未读消息结果:', firstUnreadRes);
4202
4290
  * ```
4203
4291
  */
4204
- declare function searchMessagesByUser(conversation: IConversationOption, userId: string, startTime: number, count: number): Promise<IAsyncRes<{
4205
- messages: IAReceivedMessage[];
4206
- }>>;
4292
+ declare function getFirstUnreadMessage(conversation: IConversationOption): Promise<IAsyncRes<IAReceivedMessage | null>>;
4207
4293
  /**
4208
- * 获取会话中指定类型的消息
4209
- * @category Electron 独有
4210
- * @description 本接口仅适用 Electron 平台获取会话中指定类型的消息
4294
+ * 获取第一条未读消息信息
4295
+ * @category 消息
4296
+ * @since 5.9.0
4211
4297
  * @param conversation 会话信息
4212
- * @param option 配置参数,类型为 {@link IGetHistoryMessagesByTypesOption}
4213
- * @since 5.4.0
4214
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4298
+ * @description 获取指定会话中的第一条未读消息信息
4299
+ * * **注意**:
4300
+ * 1. 当没有未读消息时,返回的 data null
4301
+ * 2. 当第一条未读消息被撤回时,此信息不会更新
4302
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IFirstUnreadMessageInfo} 类型
4215
4303
  * @example
4216
- * 获取会话中指定类型的消息示例:
4304
+ * 获取第一条未读消息信息示例:
4217
4305
  * ```ts
4218
4306
  * const conversation = {
4219
4307
  * conversationType: RongIMLib.ConversationType.PRIVATE,
4220
- * targetId: 'targetId'
4221
- * };
4222
- * const options = { messageTypes: [RongIMLib.MessageType.TEXT] };
4223
- * const res = await RongIMLib.electronExtension.getHistoryMessagesByMessageTypes(conversation, option);
4224
- * console.info('获取会话中指定类型的消息结果:', res);
4308
+ * targetId: 'targetId',
4309
+ * }
4310
+ * const firstUnreadMessageInfoRes = await RongIMLib.getFirstUnreadMessageInfo(conversation);
4311
+ * console.info('获取第一条未读消息信息结果:', firstUnreadMessageInfoRes);
4225
4312
  * ```
4226
4313
  */
4227
- declare function getHistoryMessagesByMessageTypes(conversation: IConversationOption, option: IGetHistoryMessagesByTypesOption): Promise<IAsyncRes<{
4228
- /**
4229
- * @deprecated 字段已废弃即将删除,推荐使用 list
4230
- */
4231
- messages: IAReceivedMessage[];
4232
- } & GetHistoryMessageResult>>;
4314
+ declare function getFirstUnreadMessageInfo(conversation: IConversationOption): Promise<IAsyncRes<IFirstUnreadMessageInfo | null>>;
4233
4315
  /**
4234
- * 获取本地与远端历史消息
4235
- * @category Electron 独有
4236
- * @description 本接口仅适用 Electron 平台且需要业务层开启`单群聊云存储服务`
4237
- * 方法与 {@link getRemoteHistoryMessages} 的区别是 getContinuousMessages 会先查询指定会话存储本地数据库的消息,
4238
- * 当本地消息无法满足查询条件时,再查询在单群聊消息云端存储中的历史消息,以返回连续且相邻的消息对象列表
4239
- * * **注意**:
4240
- * 1. 分页获取时,下次传的时间戳必须使用 getContinuousMessages 接口返回的 timestamp
4241
- * 2. 获取历史消息逻辑:优先获取本地数据历史消息,本地获取不到再获取远端历史消息,但是该情况可能会因为离线或者补偿消息存储天数影响,出现消息断档现象
4242
- * 消息断档现象:因为离线或者补偿消息存储天数影响,存储在本地数据库中消息存在不连续或者说中间某段时间消息丢失
4243
- * 比如离线消息和补偿消息都为 1 天,第一天 A 给 B 发送 1, 2, 3,第二天 A 给 B 发送 4, 5, 6,
4244
- * B 第二天再登入,由于离线消息和补偿消息都为 1 天,所以 B 只能收到 4, 5, 6。 1, 2, 3 消息丢失
4245
- * 3. option 中的 Count 字段仅支持 1-100 范围
4316
+ * 向本地插入一条消息,不发送到服务器
4317
+ * @category 消息
4318
+ * @deprecated 请使用 {@link RongIMLib.ElectronExtension.insertMessage} 代替
4319
+ */
4320
+ declare function insertMessage(conversation: IConversationOption, content: IReceivedMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
4321
+ /**
4322
+ * 获取会话下所有未读的 @ 消息
4323
+ * @category 消息
4246
4324
  * @param conversation 会话信息
4247
- * @param option 参数配置,类型为 {@link GetHistoryMessageOption}
4248
- * @since 5.9.6
4249
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 中包含 {@link IAReceivedMessage} 类型数组
4325
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 结构为 {@link IAReceivedMessage[]} 类型
4250
4326
  * @example
4251
- * 获取本地与远端历史消息示例:
4327
+ * 获取会话下所有未读的 @ 消息示例:
4252
4328
  * ```ts
4253
4329
  * const conversation = {
4254
4330
  * conversationType: RongIMLib.ConversationType.PRIVATE,
4255
- * targetId: 'targetId'
4256
- * };
4257
- * const options = { timestamp: 0, count: 20, order: 0 };
4258
- * const res = await RongIMLib.electronExtension.getContinuousMessages(conversation, option);
4259
- * console.info('获取本地与远端历史消息结果:', res);
4331
+ * targetId: 'targetId',
4332
+ * }
4333
+ * const getUnreadMentionedRes = await RongIMLib.getUnreadMentionedMessages(conversation);
4334
+ * console.info('获取会话下所有未读的 @ 消息结果:', getUnreadMentionedRes);
4260
4335
  * ```
4261
4336
  */
4262
- declare function getContinuousMessages(conversation: IConversationOption, options: GetHistoryMessageOption): Promise<IAsyncRes<{
4263
- list: IAReceivedMessage[];
4264
- timestamp: number;
4265
- hasMore: boolean;
4337
+ declare function getUnreadMentionedMessages(conversation: IConversationOption): IAsyncRes<IAReceivedMessage[]>;
4338
+ /**
4339
+ * 按关键字搜索会话内的消息
4340
+ * @category 消息
4341
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.searchMessages} 方法
4342
+ */
4343
+ declare function searchMessages(conversation: IConversationOption, keyword: string, timestamp: number, count: number): Promise<IAsyncRes<{
4344
+ messages: IAReceivedMessage[];
4345
+ count: number | undefined;
4266
4346
  }>>;
4267
4347
  /**
4268
- * 通过时间戳设置消息状态为对方已读
4269
- * @category Electron 独有
4270
- * @description 将自己发送的指定时间之前的消息设置为对方已读,状态值为 SentStatus.READ
4348
+ * 从本地消息数据库中删除某一会话指定时间之前的消息数据
4349
+ * @category 消息
4350
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.deleteMessagesByTimestamp} 方法
4351
+ */
4352
+ declare function deleteLocalMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<IAsyncRes<void>>;
4353
+ /**
4354
+ * 清空会话下历史消息
4355
+ * @category 消息
4356
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.clearMessages} 方法
4357
+ */
4358
+ declare function clearMessages(conversation: IConversationOption): Promise<IAsyncRes<void>>;
4359
+ /**
4360
+ * 按内容搜索会话
4361
+ * @category 消息
4362
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.searchConversationByContent} 方法
4363
+ */
4364
+ declare function searchConversationByContent(keyword: string, conversationTypes?: ConversationType[], messageTypes?: string[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[] | undefined>>;
4365
+ /**
4366
+ * 清除时间戳前的未读数
4367
+ * @description 清除时间戳前的未读数,仅支持 Electron 平台。
4368
+ * @category 消息
4271
4369
  * @param conversation 会话信息
4272
- * @param timestamp 消息的发送时间,将该时间之前的消息设置为已读
4273
- * @since 5.4.0
4274
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
4370
+ * @param timestamp 清理未读时间戳
4371
+ *
4275
4372
  * @example
4276
- * 通过时间戳设置消息状态为对方已读示例:
4373
+ * 清除时间戳前的未读数示例:
4277
4374
  * ```ts
4278
4375
  * const conversation = {
4279
- * conversationType: RongIMLib.ConversationType.PRIVATE,
4280
- * targetId: 'targetId'
4281
- * };
4282
- * const timestamp = Date.now();
4283
- * const res = await RongIMLib.electronExtension.setMessageStatusToRead(conversation, timestamp);
4284
- * console.info('通过时间戳设置消息状态为对方已读结果:', res);
4376
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4377
+ * targetId: 'targetId',
4378
+ * }
4379
+ * const timestamp = 1626955200000;
4380
+ * const clearRes = await RongIMLib.clearUnreadCountByTimestamp(conversation, timestamp);
4381
+ * console.info('清除时间戳前的未读数结果:', clearRes);
4285
4382
  * ```
4383
+ */
4384
+ declare function clearUnreadCountByTimestamp(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
4385
+ /**
4386
+ * 设置消息接收状态
4387
+ * @category 消息
4388
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.setMessageReceivedStatusInfo} 方法
4286
4389
  */
4287
- declare function setMessageStatusToRead(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<boolean>>;
4390
+ declare function setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<IAsyncRes<void>>;
4288
4391
  /**
4289
- * 设置消息的接收状态
4290
- * @param messageId 消息 ID
4291
- * @param receivedStatus 接受状态
4292
- * @since 5.4.0
4293
- * @deprecated @since 5.9.3 MLib SDK 版本 ≧ 5.9.3,建议使用 {@link setMessageReceivedStatusInfo} 接口替换
4392
+ * 请求流式消息内容;请求成功后,数据将通过 `Events.STREAM_MESSAGE_RESPONSE` 事件通知
4393
+ * @param messageUId
4394
+ * @since v5.16.0
4294
4395
  */
4295
- declare function setMessageReceivedStatus(messageId: number, receivedStatus: ReceivedStatus): Promise<IAsyncRes<void>>;
4396
+ declare function requestStreamMessageContent(messageUId: string): Promise<RCResult>;
4397
+
4296
4398
  /**
4297
- * 设置消息的接收状态
4298
- * @category Electron 独有
4299
- * @description 本接口仅适用 Electron 平台设置消息的接收状态,支持多状态同时设置
4300
- * 设置对方发送的消息 自己的接受状态信息
4301
- * @param messageId 消息 ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
4302
- * @param receivedStatusInfo 接受状态信息,类型为 {@link IReceivedStatusInfo}
4303
- * @since 5.9.3
4304
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4305
- * @example
4306
- * 设置消息的接收状态示例:
4399
+ * 创建标签
4400
+ * @description 创建标签系统,用于对会话进行管理。SDK 创建的标签会被同步到服务端
4401
+ * SDK 支持使用一个或多个标签标记会话,可用于会话的分组显示、获取会话列表等操作,并提供了多个接口用于移除会话上的标签
4402
+ * * **注意**:每个用户最多可以创建 20 个标签
4403
+ * @category 标签
4404
+ * @param tag 标签信息,包含标签 ID 和标签名称,类型为 {@link ITagParam}
4405
+ * @returns 创建成功返回 code 为 0,失败返回错误码
4406
+ * @example 创建标签示例:
4307
4407
  * ```ts
4308
- * const messageId = 123;
4309
- * const receivedStatusInfo = {
4310
- * isRead: true,
4311
- * isListened: true,
4312
- * };
4313
- * const res = await RongIMLib.electronExtension.setMessageReceivedStatusInfo(messageId, receivedStatusInfo);
4314
- * console.info('设置消息的接收状态结果:', res);
4408
+ * const tag = {
4409
+ * tagId: 'tagId',
4410
+ * tagName: 'tagName',
4411
+ * };
4412
+ * const res = await RongIMLib.addTag(tag);
4413
+ * console.log('创建标签结果:', res);
4315
4414
  * ```
4316
4415
  */
4317
- declare function setMessageReceivedStatusInfo(messageId: number, receivedStatusInfo: IReceivedStatusInfo): Promise<IAsyncRes<void>>;
4416
+ declare function addTag(tag: ITagParam): Promise<IAsyncRes<void>>;
4318
4417
  /**
4319
- * 设置消息的发送状态
4320
- * @category Electron 独有
4321
- * @description 本接口仅适用 Electron 平台设置自己发送的消息的发送状态
4322
- * @param messageId 消息ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
4323
- * @param sentStatus 消息的发送状态,类型为 {@link SentStatus}
4324
- * @since 5.4.0
4325
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4326
- * @example
4327
- * 设置消息的发送状态示例:
4418
+ * 删除标签
4419
+ * @category 标签
4420
+ * @param tagId 标签 ID
4421
+ * @returns 删除成功返回 code 0,失败返回错误码
4422
+ * @example 删除标签示例:
4328
4423
  * ```ts
4329
- * const messageId = 123;
4330
- * const sentStatus = RongIMLib.SentStatus.SENT;
4331
- * const res = await RongIMLib.electronExtension.setMessageSentStatus(messageId, sentStatus);
4332
- * console.info('设置消息的发送状态结果:', res);
4424
+ * const tagId = 'tagId';
4425
+ * const res = await RongIMLib.removeTag(tagId);
4426
+ * console.log('删除标签结果:', res);
4333
4427
  * ```
4334
4428
  */
4335
- declare function setMessageSentStatus(messageId: number, sentStatus: SentStatus): Promise<IAsyncRes<void>>;
4429
+ declare function removeTag(tagId: string): Promise<IAsyncRes<void>>;
4336
4430
  /**
4337
- * 修改消息内容
4338
- * @category Electron 独有
4339
- * @description 本接口仅适用 Electron 平台修改消息内容,目前仅私有云使用 RCE api 暂不对外
4340
- * @hidden
4341
- * @param messageId 消息 ID
4342
- * @param content 消息 content
4343
- * @param messageType 消息类型,如果设置了消息类型,会使该消息无法被搜索
4344
- * @since 5.4.0
4345
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4346
- * @example
4347
- * 修改消息内容示例:
4431
+ * 编辑标签
4432
+ * @description 编辑标签名称,标签名称最大长度为 15 个字符, 标签 ID,长度不能超过 10 个字符
4433
+ * @category 标签
4434
+ * @param tag 标签信息, 包含标签 ID 和标签名称,类型为 {@link ITagParam}
4435
+ * @returns 编辑成功返回 code 为 0,失败返回错误码
4436
+ * @example 编辑标签示例:
4348
4437
  * ```ts
4349
- * const messageId = 123;
4350
- * const content = {
4351
- * content: 'new content',
4438
+ * const tag = {
4439
+ * tagId: 'tagId',
4440
+ * tagName: 'tagName',
4352
4441
  * };
4353
- * const messageType = 'RC:TxtMsg';
4354
- * const res = await RongIMLib.electronExtension.setMessageContent(messageId, content, messageType);
4355
- * console.info('修改消息内容结果:', res);
4442
+ * const res = await RongIMLib.updateTag(tag);
4443
+ * console.log('编辑标签结果:', res);
4444
+ * ```
4445
+ */
4446
+ declare function updateTag(tag: ITagParam): Promise<IAsyncRes<void>>;
4447
+ /**
4448
+ * 获取标签列表
4449
+ * @category 标签
4450
+ * @description 获取当前用户的标签列表
4451
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为标签列表,类型为 {@link ITagInfo} 数组或者 undefined
4452
+ * @example 获取标签列表示例:
4453
+ * ```ts
4454
+ * const res = await RongIMLib.getTags();
4455
+ * console.log('获取标签列表结果:', res);
4356
4456
  * ```
4357
4457
  */
4358
- declare function setMessageContent(messageId: number, content: Object, messageType?: string): Promise<IAsyncRes<void>>;
4458
+ declare function getTags(): Promise<IAsyncRes<ITagInfo[] | undefined>>;
4359
4459
  /**
4360
- * 通过消息 ID 删除消息
4361
- * @category Electron 独有
4362
- * @description 本接口仅适用 Electron 平台
4363
- * 通过消息 ID 从本地消息数据库中删除指定的一条或一组消息数据。删除多条消息时,请确保消息 ID 均属于同一会话
4364
- * @param messageIds 消息 ID 列表, 需是同一会话的消息
4365
- * @since 5.4.0
4366
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4367
- * @example
4368
- * 通过消息 ID 删除消息示例:
4460
+ * 获取会话下的标签
4461
+ * @description 根据会话信息获取具体某个会话下的标签列表
4462
+ * @category 标签
4463
+ * @param conversation 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption}
4464
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为标签列表,类型为 {@link IConversationTag} 数组或者 undefined
4465
+ * @example 获取会话下的标签示例:
4466
+ * ```ts
4467
+ * const conversation = {
4468
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4469
+ * targetId: 'targetId',
4470
+ * };
4471
+ * const res = await RongIMLib.getTagsFromConversation(conversation);
4472
+ * console.log('获取会话下的标签结果:', res);
4473
+ * ```
4474
+ */
4475
+ declare function getTagsFromConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[] | undefined>>;
4476
+ /**
4477
+ * 添加会话到指定标签
4478
+ * @description 添加会话到指定标签,一个会话可以添加到多个标签
4479
+ * * **注意**:
4480
+ * 1. 每个标签下最多可以添加 1000 个会话
4481
+ * 2. 如果标签下已添加 1000 个会话,继续在该标签下添加会话仍会成功,但会导致最早添加标签的会话被移除标签
4482
+ * 3. 同一个会话可以设置多个不同的标签
4483
+ * @category 标签
4484
+ * @param tagId 标签 ID
4485
+ * @param conversations 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption} 数组
4486
+ * @example 添加会话到指定标签示例:
4369
4487
  * ```ts
4370
- * const messageIds = [1, 2];
4371
- * const res = await RongIMLib.electronExtension.deleteMessages(messageIds);
4372
- * console.info('通过消息 ID 删除消息结果:', res);
4488
+ * const tagId = 'tagId';
4489
+ * const conversations = [{
4490
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4491
+ * targetId: 'targetId',
4492
+ * }];
4493
+ * const res = await RongIMLib.addConversationsToTag(tagId, conversations);
4494
+ * console.log('添加会话到指定标签结果:', res);
4373
4495
  * ```
4374
4496
  */
4375
- declare function deleteMessages(messageIds: number[]): Promise<IAsyncRes<void>>;
4497
+ declare function addConversationsToTag(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
4376
4498
  /**
4377
- * 清空会话下历史消息
4378
- * @category Electron 独有
4379
- * @description 本接口仅适用 Electron 平台,从本地消息数据库中删除指定会话所有消息。
4380
- * @param conversation 会话信息
4381
- * @since 5.4.0
4382
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4383
- * @example
4384
- * 清空会话下历史消息示例:
4499
+ * 从指定标签中删除多个会话
4500
+ * @description 从指定标签中删除多个会话,此操作仅解除会话与标签的关系,并不会删除会话数据
4501
+ * @category 标签
4502
+ * @param tagId 标签 ID
4503
+ * @param conversations 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption} 数组
4504
+ * @example 从指定标签中删除多个会话示例:
4385
4505
  * ```ts
4386
- * const conversation = {
4506
+ * const tagId = 'tagId';
4507
+ * const conversations = [{
4387
4508
  * conversationType: RongIMLib.ConversationType.PRIVATE,
4388
4509
  * targetId: 'targetId',
4389
- * };
4390
- * const res = await RongIMLib.electronExtension.clearMessages(conversation);
4391
- * console.info('清空会话下历史消息结果:', res);
4510
+ * }];
4511
+ * const res = await RongIMLib.removeConversationsFromTag(tagId, conversations);
4512
+ * console.log('从指定标签中删除多个会话果:', res);
4392
4513
  * ```
4393
- */
4394
- declare function clearMessages(conversation: IConversationOption): Promise<IAsyncRes<void>>;
4514
+ */
4515
+ declare function removeConversationsFromTag(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
4395
4516
  /**
4396
- * 通过时间戳删除
4397
- * @category Electron 独有
4398
- * @description 本接口仅适用 Electron 平台,根据时间戳,从本地消息数据库中删除单个会话中早于该时间戳的消息数据。
4399
- * @param conversation 会话信息
4400
- * @param timestamp 指定删除该时间戳之前的消息
4401
- * @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
4402
- * 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
4403
- * @since 5.4.0
4404
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 void
4405
- * @example
4406
- * 通过时间戳删除示例:
4517
+ * 从指定会话中删除多个标签
4518
+ * @description 从指定会话中删除多个标签,此操作仅解除会话与标签的关系,并不会删除会话数据
4519
+ * @category 标签
4520
+ * @param conversation 会话信息,包含会话类型、会话 ID 和 channelId,类型为 {@link IConversationOption}
4521
+ * @param tagIds 要删除的标签列表
4522
+ * @example 从指定会话中删除多个标签示例:
4407
4523
  * ```ts
4408
4524
  * const conversation = {
4409
4525
  * conversationType: RongIMLib.ConversationType.PRIVATE,
4410
4526
  * targetId: 'targetId',
4411
4527
  * };
4412
- * const timestamp = Date.now();
4413
- * const cleanSpace = false;
4414
- * const res = await RongIMLib.electronExtension.deleteMessagesByTimestamp(conversation, timestamp, cleanSpace);
4415
- * console.info('通过时间戳删除结果:', res);
4528
+ * const tagIds = ['tagId1', 'tagId2'];
4529
+ * const res = await RongIMLib.removeTagsFromConversation(conversation, tagIds);
4530
+ * console.log('从指定会话中删除多个标签结果:', res);
4416
4531
  * ```
4417
- */
4418
- declare function deleteMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<IAsyncRes<void>>;
4532
+ */
4533
+ declare function removeTagsFromConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<void>>;
4419
4534
  /**
4420
- * 批量清除多个会话的本地消息
4421
- * @category Electron 独有
4422
- * @param options 会话列表,最大数量为 20
4423
- * @since 5.9.0
4424
- * @description 从本地消息数据库中批量删除多个会话指定时间之前的消息数据,
4425
- * 时间戳传 0 时,清除所有消息
4426
- * 支持的会话类型:单聊, 群聊, 聊天室, 系统消息
4427
- * @hidden
4428
- * @example
4535
+ * 从多个会话中删除指定的标签
4536
+ * @description 从多个会话中删除指定的标签,此操作仅解除会话与标签的关系,并不会删除会话数据
4537
+ * @category 标签
4538
+ * @param tagId 标签 ID
4539
+ * @param conversations 会话信息列表
4540
+ * @example 从多个会话中删除指定的标签示例:
4429
4541
  * ```ts
4542
+ * const tagId = 'tagId';
4430
4543
  * const conversations = [{
4431
- * conversationType: ConversationType.PRIVATE,
4544
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
4432
4545
  * targetId: 'targetId',
4433
- * timestamp: 0,
4434
- * channelId: '',
4435
- * }]
4436
- * const res = await RongIMLib.batchClearMessagesByTimestamp(conversations, 0);
4437
- * console.log('批量清除多个会话的本地消息结果:', res);
4546
+ * }];
4547
+ * const res = await RongIMLib.removeTagFromConversations(tagId, conversations);
4548
+ * console.log('从多个会话中删除指定的标签:', res);
4438
4549
  * ```
4439
4550
  */
4440
- declare function batchClearMessagesByTimestamp(options: IClearMessageOption[]): Promise<IAsyncRes<void>>;
4551
+ declare function removeTagFromConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<void>>;
4441
4552
  /**
4442
- * 向本地插入一条消息
4443
- * @category Electron 独有
4444
- * @description 本接口仅适用 Electron 平台,插入消息到本地数据库,不发送到服务器
4445
- * * **注意**:插入消息时,messageUId 将不会存入数据库
4446
- * @since 5.4.0
4447
- * @param conversation 会话信息
4448
- * @param message 消息体,@since 5.6.1 增加支持 {@link BaseMessage} 类型
4449
- * @param options 插入消息配置,类型为 {@link IInsertOptions}
4450
- * @defaultValues options = {}
4451
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedMessage} 类型的消息对象
4452
- * @example
4453
- * 插入消息示例:
4553
+ * 分页获取标签下会话列表
4554
+ * @category 标签
4555
+ * @param tagId 标签id
4556
+ * @param count 获取数量
4557
+ * @param timestamp 会话中消息的时间戳
4558
+ * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为会话列表,类型为 {@link IAReceivedConversationByTag} 数组或者 undefined
4559
+ * SDK 版本 @since 5.7.0 开始该接口的返回数据类型由 {@link IReceivedConversationByTag} 变更为 {@link IAReceivedConversationByTag}
4560
+ * @example 分页获取标签下会话列表示例:
4454
4561
  * ```ts
4455
- * const conversation = {
4456
- * conversationType: RongIMLib.ConversationType.PRIVATE,
4457
- * targetId: 'targetId',
4458
- * };
4459
- * const message = new RongIMLib.TextMessage({ content: 'hello' });
4460
- * const options = {
4461
- * searchContent: 'hello',
4462
- * };
4463
- * const res = await RongIMLib.electronExtension.insertMessage(conversation, message, options);
4464
- * console.info('插入消息结果:', res);
4562
+ * const tagId = 'tagId';
4563
+ * const count = 10;
4564
+ * const timestamp = 0;
4565
+ * const res = await RongIMLib.getConversationsFromTagByPage(tagId, count, timestamp);
4566
+ * console.log('分页获取标签下会话列表结果:', res);
4465
4567
  * ```
4466
4568
  */
4467
- declare function insertMessage(conversation: IConversationOption, message: IAReceivedMessage | BaseMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
4569
+ declare function getConversationsFromTagByPage(tagId: string, count: number, startTime: number): Promise<IAsyncRes<IAReceivedConversationByTag[] | undefined>>;
4468
4570
  /**
4469
- * 批量向本地插入消息
4470
- * @category Electron 独有
4471
- * @description 本接口仅适用 Electron 平台,批量插入消息到本地数据库,不发送到服务器,目前仅有私有云和 RCE 使用 api 标注 hidden
4472
- * @hidden
4473
- * @since 5.7.2
4474
- * @param messages 批量插入的消息体
4475
- * @param checkDuplicate 选择是否排重,默认 false
4476
- * @defaultValues checkDuplicate = false
4477
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
4571
+ * 根据标签获取未读消息数
4572
+ * @category 标签
4573
+ * @param tagId 标签id
4574
+ * @param containMuted 是否包含免打扰
4575
+ * @example 根据标签获取未读消息数示例:
4576
+ * ```ts
4577
+ * const tagId = 'tagId';
4578
+ * const containMuted = false;
4579
+ * const res = await RongIMLib.getUnreadCountByTag(tagId, containMuted);
4580
+ * console.log('根据标签获取未读消息数结果:', res);
4581
+ * ```
4478
4582
  */
4479
- declare function batchInsertMessage(messages: IInsertMessage[], checkDuplicate: boolean): Promise<IAsyncRes<boolean>>;
4583
+ declare function getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number | undefined>>;
4480
4584
  /**
4481
- * 获取会话所有消息数
4482
- * @category Electron 独有
4483
- * @description 本接口仅适用 Electron 平台,获取指定会话下的所有消息数
4484
- * @param conversation
4485
- * @since 5.7.2
4486
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 消息数
4487
- * @example
4488
- * 获取会话所有消息数示例:
4585
+ * 设置标签中会话置顶
4586
+ * @description 设置在指定标签下置顶的会话。如果根据标签获取会话,可在获取的会话中可以看到该属性。请注意与会话列表中的会话置顶相区分
4587
+ * @category 标签
4588
+ * @param tagId 标签id
4589
+ * @param conversation 会话
4590
+ * @param status 状态
4591
+ * @example 设置标签中会话置顶示例:
4489
4592
  * ```ts
4593
+ * const tagId = 'tagId';
4490
4594
  * const conversation = {
4491
4595
  * conversationType: RongIMLib.ConversationType.PRIVATE,
4492
4596
  * targetId: 'targetId',
4493
4597
  * };
4494
- * const res = await RongIMLib.electronExtension.getMessageCount(conversation);
4495
- * console.info('获取会话所有消息数结果:', res);
4598
+ * const isTop = true;
4599
+ * const res = await RongIMLib.setConversationToTopInTag(tagId, conversation, isTop);
4600
+ * console.log('设置标签中会话置顶结果:', res);
4496
4601
  * ```
4497
4602
  */
4498
- declare function getMessageCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
4603
+ declare function setConversationToTopInTag(tagId: string, conversation: IConversationOption, isTop: boolean): Promise<IAsyncRes<void>>;
4604
+
4499
4605
  /**
4500
- * 获取单聊消息的送达时间
4501
- * @param messageUId 消息 UID
4502
- * @hidden 暂时仅 BEEM 使用,无需在文档公开
4503
- * @description 暂仅支持 Electron 平台
4606
+ * 创建文件上传任务
4607
+ * @param uploadInfo
4608
+ * @hidden
4609
+ * @returns
4504
4610
  */
4505
- declare function getPrivateMessageDeliverTime(messageUId: string): Promise<IAsyncRes<number>>;
4611
+ declare function createUploadTask(uploadInfo: IUploadInfo): Promise<IAsyncRes<UploadTask>>;
4506
4612
  /**
4507
- * 获取群组消息的送达状态
4508
- * @param messageUId 消息 UID
4509
- * @hidden 暂时仅 BEEM 使用,无需在文档公开
4510
- * @description 暂仅支持 Electron 平台
4613
+ * 停止文件上传任务
4614
+ * @hidden
4615
+ * @param taskId
4616
+ * @returns
4511
4617
  */
4512
- declare function getGroupMessageDeliverList(targetId: string, messageUId: string): Promise<IAsyncRes<IGroupMessageDeliverInfo>>;
4618
+ declare function stopUploadTask(taskId: number): Promise<IAsyncRes<boolean>>;
4513
4619
  /**
4514
- * 设置融云消息重排开关
4515
- * @category Electron 独有
4516
- * @description 发送方弱网情况下发送消息,消息到达服务但发送方没有收到服务 ack,导致发送方认为消息发送失败
4517
- * 此种情况下,服务端和接收方都会收到第一条消息
4518
- * 此时发送方重发该消息,再次达到服务,那么此时服务端会有两条消息(消息内容相同,messageUid 不同
4519
- * 接收方会收到两条内容相同 messageUId 不同的消息,SDK 此时会把第二条相同内容消息排重掉
4520
- * 以此来保证重发的相同内容消息,发送方只有一条消息,接收方也只有一条消息
4521
- *
4522
- * 当消息量少时,消息排重影响不大;但是本地存在大量消息时,排重会出现性能问题
4523
- * 当本地存在大量消息,且发生收消息卡顿时,建议将排重关闭
4524
- *
4525
- * @param checkDuplicate 是否使用融云消息重排机制 true: 开启, false: 关闭
4526
- * @since 5.7.1
4527
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
4528
- * @example
4529
- * 设置融云消息重排开关示例:
4530
- * ```ts
4531
- * const checkDuplicate = true;
4532
- * const res = await RongIMLib.electronExtension.setCheckDuplicateMessage(checkDuplicate);
4533
- * console.info('设置融云消息重排开关结果:', res);
4534
- * ```
4620
+ * 上传文件
4621
+ * @hidden
4535
4622
  */
4536
- declare function setCheckDuplicateMessage(checkDuplicate?: boolean): Promise<IAsyncRes<boolean>>;
4623
+ declare function upload(uploadInfo: IUploadInfo): Promise<IAsyncRes<IUploadResult>>;
4537
4624
  /**
4538
- * 设置聊天室消息重排开关
4539
- * @category Electron 独有
4540
- * @description 仅支持聊天室消息重排开关,不支持其他会话类型,聊天室消息重排开关默认开启
4541
- * 目前仅支持对 CUID 进行排重策略修改
4542
- * @hidden 产品协商暂不对外提供
4543
- * @since 5.9.9
4544
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型的操作结果
4545
- * @example
4546
- * 设置聊天室消息重排开关示例:
4547
- * ```ts
4548
- * const checkDuplicate = true;
4549
- * const res = await RongIMLib.electronExtension.setCheckChatRoomDuplicateMessage(checkDuplicate);
4550
- * console.info('设置聊天室消息重排开关结果:', res);
4551
- * ```
4625
+ * 获取文件 token
4626
+ * @description 上传文件时,获取文件 token
4627
+ * @hidden
4628
+ * @param fileType 上传类型, 通过 RongIMLib.FILE_TYPE 获取
4629
+ * @param fileName 上传文件名,Server 通过文件名生成百度上传认证, 若不传 engine 自动生成
4630
+ * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
4631
+ * @param queryString STC 分段上传时的查询字符串
4632
+ * `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
4633
+ * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`,filename为空
4634
+ * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`,
4635
+ * filename为第一个步骤生成的filename
4636
+ * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`,filename为第一个步骤生成的filename
4552
4637
  */
4553
- declare function setCheckChatRoomDuplicateMessage(checkDuplicate?: boolean): Promise<IAsyncRes<boolean>>;
4638
+ declare function getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<IAsyncRes<IUploadAuth & {
4639
+ qiniu: string;
4640
+ ossConfig: string;
4641
+ }>>;
4554
4642
  /**
4555
- * 获取本地指定时间戳前后 N 条消息方法
4556
- * @category Electron 独有
4557
- * @description 本接口仅适用 Electron 平台,获取本地指定时间戳前后 N 条消息
4558
- * @param conversation 会话信息
4559
- * @param option 获取参数
4560
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 {@link IAReceivedMessage[]} 类型的消息列表
4561
- * @since 5.9.8
4562
- * @example
4563
- * 获取本地指定时间戳前后 N 条消息示例:
4564
- * ```ts
4565
- * const conversation = {
4566
- * conversationType: RongIMLib.ConversationType.PRIVATE,
4567
- * targetId: 'targetId',
4568
- * };
4569
- * const option = {
4570
- * timestamp: 0,
4571
- * beforeCount: 10,
4572
- * afterCount: 10,
4573
- * };
4574
- * const res = await RongIMLib.electronExtension.getMessagesAroundTimestamp(conversation, option);
4575
- * console.info('获取本地指定时间戳前后 N 条消息结果:', res);
4576
- * ```
4643
+ * 获取下载鉴权信息
4644
+ * @param url 文件 URL 地址
4645
+ * @description 通过文件 URL 地址获取下载鉴权信息,用于下载文件时的鉴权
4646
+ * @hidden
4647
+ * token: RCX 存储鉴权 token,优先使用
4648
+ * downloadAuthInfo: RCX 升级后,公有云私有化部署的下载鉴权信息
4577
4649
  */
4578
- declare function getMessagesAroundTimestamp(conversation: IConversationOption, option: {
4579
- timestamp: number;
4580
- beforeCount: number;
4581
- afterCount: number;
4582
- }): Promise<IAsyncRes<IAReceivedMessage[]>>;
4650
+ declare function getDownloadAuth(url: string): Promise<IAsyncRes<{
4651
+ deadline: number;
4652
+ token?: string;
4653
+ downloadAuthInfo?: IDownloadAuth;
4654
+ }>>;
4655
+ /**
4656
+ * 获取文件的下载地址
4657
+ * @hidden
4658
+ * @param fileType 文件类型
4659
+ * @param fileName 文件名
4660
+ * @param saveName 下载后的存储文件名
4661
+ * @param _ 已废弃
4662
+ * @param serverType 使用的存储服务标识
4663
+ * @returns
4664
+ */
4665
+ declare function getFileUrl(fileType: FileType, filename: string, saveName?: string, _?: {
4666
+ isBosRes: boolean;
4667
+ downloadUrl: string;
4668
+ }, serverType?: UploadMethod): Promise<IAsyncRes<{
4669
+ downloadUrl: string;
4670
+ }>>;
4583
4671
 
4584
4672
  /**
4585
- * 清除本地数据
4586
- * @category Electron 独有
4587
- * @description 该方法用于清除本地数据,包括消息列表、会话列表、拉取消息的时间戳
4588
- * * **注意**:清除后在此登录会作为新设备进行消息拉取切操作无法恢复,谨慎使用
4589
- * @since 5.4.0
4590
- * @returns 返回一个 {@link IAsyncRes} 类型 Promise,data 为 boolean 类型,表示是否清除成功
4591
- * @example
4592
- * 清除本地数据示例:
4593
- * ```ts
4594
- * const res = await RongIMLib.electronExtension.clearLocalData();
4595
- * console.info('清除本地数据结果:', res);
4596
- * ```
4673
+ * @deprecated 从 5.6.0 版本开始,此定义失效
4674
+ * @category 基础
4597
4675
  */
4598
- declare function clearLocalData(): Promise<IAsyncRes<boolean>>;
4676
+ declare const ConnectType: {
4677
+ COMET: string;
4678
+ WEBSOCKET: string;
4679
+ };
4599
4680
  /**
4600
- * 获取是否使用 Electron 扩展
4601
- * @category Electron 独有
4602
- * @description 该方法用于判断当前是否使用 Electron 扩展
4603
- * @since 5.8.3
4604
- * @returns {boolean} 是否使用 Electron 扩展
4605
- * @example
4606
- * 获取是否使用 Electron 扩展示例:
4607
- * ```ts
4608
- * const res = await RongIMLib.electronExtension.enable();
4609
- * console.info('获取是否使用 Electron 扩展结果:', res);
4610
- * ```
4681
+ * 消息类型
4682
+ * @category 消息
4611
4683
  */
4612
- declare function enable(): boolean;
4613
-
4614
- declare const index_getAllConversationList: typeof getAllConversationList;
4615
- declare const index_getConversationList: typeof getConversationList;
4616
- declare const index_searchConversationByContent: typeof searchConversationByContent;
4617
- declare const index_getConversations: typeof getConversations;
4618
- declare const index_searchMessages: typeof searchMessages;
4619
- declare const index_searchMessageInTimeRange: typeof searchMessageInTimeRange;
4620
- declare const index_searchMessagesByUser: typeof searchMessagesByUser;
4621
- declare const index_getHistoryMessagesByMessageTypes: typeof getHistoryMessagesByMessageTypes;
4622
- declare const index_getContinuousMessages: typeof getContinuousMessages;
4623
- declare const index_setMessageStatusToRead: typeof setMessageStatusToRead;
4624
- declare const index_setMessageReceivedStatus: typeof setMessageReceivedStatus;
4625
- declare const index_setMessageReceivedStatusInfo: typeof setMessageReceivedStatusInfo;
4626
- declare const index_setMessageSentStatus: typeof setMessageSentStatus;
4627
- declare const index_setMessageContent: typeof setMessageContent;
4628
- declare const index_deleteMessages: typeof deleteMessages;
4629
- declare const index_clearMessages: typeof clearMessages;
4630
- declare const index_deleteMessagesByTimestamp: typeof deleteMessagesByTimestamp;
4631
- declare const index_batchClearMessagesByTimestamp: typeof batchClearMessagesByTimestamp;
4632
- declare const index_insertMessage: typeof insertMessage;
4633
- declare const index_batchInsertMessage: typeof batchInsertMessage;
4634
- declare const index_getMessageCount: typeof getMessageCount;
4635
- declare const index_getPrivateMessageDeliverTime: typeof getPrivateMessageDeliverTime;
4636
- declare const index_getGroupMessageDeliverList: typeof getGroupMessageDeliverList;
4637
- declare const index_setCheckDuplicateMessage: typeof setCheckDuplicateMessage;
4638
- declare const index_setCheckChatRoomDuplicateMessage: typeof setCheckChatRoomDuplicateMessage;
4639
- declare const index_getMessagesAroundTimestamp: typeof getMessagesAroundTimestamp;
4640
- declare const index_clearLocalData: typeof clearLocalData;
4641
- declare const index_enable: typeof enable;
4642
- declare namespace index {
4643
- export {
4644
- index_getAllConversationList as getAllConversationList,
4645
- index_getConversationList as getConversationList,
4646
- index_searchConversationByContent as searchConversationByContent,
4647
- index_getConversations as getConversations,
4648
- index_searchMessages as searchMessages,
4649
- index_searchMessageInTimeRange as searchMessageInTimeRange,
4650
- index_searchMessagesByUser as searchMessagesByUser,
4651
- index_getHistoryMessagesByMessageTypes as getHistoryMessagesByMessageTypes,
4652
- index_getContinuousMessages as getContinuousMessages,
4653
- index_setMessageStatusToRead as setMessageStatusToRead,
4654
- index_setMessageReceivedStatus as setMessageReceivedStatus,
4655
- index_setMessageReceivedStatusInfo as setMessageReceivedStatusInfo,
4656
- index_setMessageSentStatus as setMessageSentStatus,
4657
- index_setMessageContent as setMessageContent,
4658
- index_deleteMessages as deleteMessages,
4659
- index_clearMessages as clearMessages,
4660
- index_deleteMessagesByTimestamp as deleteMessagesByTimestamp,
4661
- index_batchClearMessagesByTimestamp as batchClearMessagesByTimestamp,
4662
- index_insertMessage as insertMessage,
4663
- index_batchInsertMessage as batchInsertMessage,
4664
- index_getMessageCount as getMessageCount,
4665
- index_getPrivateMessageDeliverTime as getPrivateMessageDeliverTime,
4666
- index_getGroupMessageDeliverList as getGroupMessageDeliverList,
4667
- index_setCheckDuplicateMessage as setCheckDuplicateMessage,
4668
- index_setCheckChatRoomDuplicateMessage as setCheckChatRoomDuplicateMessage,
4669
- index_getMessagesAroundTimestamp as getMessagesAroundTimestamp,
4670
- index_clearLocalData as clearLocalData,
4671
- index_enable as enable,
4672
- };
4673
- }
4684
+ declare const MessageType: {
4685
+ TEXT: string;
4686
+ VOICE: string;
4687
+ HQ_VOICE: string;
4688
+ IMAGE: string;
4689
+ GIF: string;
4690
+ RICH_CONTENT: string;
4691
+ LOCATION: string;
4692
+ FILE: string;
4693
+ SIGHT: string;
4694
+ COMBINE: string;
4695
+ COMBINE_V2: string;
4696
+ CHRM_KV_NOTIFY: string;
4697
+ LOG_COMMAND: string;
4698
+ EXPANSION_NOTIFY: string;
4699
+ REFERENCE: string;
4700
+ RECALL_MESSAGE_TYPE: string;
4701
+ };
4674
4702
 
4675
4703
  /**
4676
4704
  * 设置代理
@@ -4795,9 +4823,7 @@ declare function getSubscribeUserStatus(subscribeType: SubscribeType, userIds: s
4795
4823
  * console.log('更新用户资料结果:', res);
4796
4824
  * ```
4797
4825
  */
4798
- declare function updateMyUserProfile(profile: IUserProfileInfo): Promise<IAsyncRes<{
4799
- errorKey: string;
4800
- }>>;
4826
+ declare function updateMyUserProfile(profile: IUserProfileInfo): Promise<IAsyncRes<IUpdateMyProfileFail>>;
4801
4827
  /**
4802
4828
  * 批量获取用户资料
4803
4829
  * @category 用户资料
@@ -4881,7 +4907,7 @@ declare function searchUserProfileByUniqueId(uniqueId: string): Promise<IAsyncRe
4881
4907
  * @category 群组
4882
4908
  * @since 5.12.0
4883
4909
  */
4884
- declare function createGroup(groupInfo: IGroupInfoOption, inviteeUserIds?: string[]): Promise<IAsyncRes<IProcessCode>>;
4910
+ declare function createGroup(groupInfo: IGroupInfoOption, inviteeUserIds?: string[]): Promise<IAsyncRes<ICreateGroupFail>>;
4885
4911
  /**
4886
4912
  * 设置群资料
4887
4913
  * @description 客户端创建群组需要开通 `信息托管功能` 和 `允许通过 SDK 创建、设置群组资料及权限` 服务,未开通时不支持此功能
@@ -4889,7 +4915,7 @@ declare function createGroup(groupInfo: IGroupInfoOption, inviteeUserIds?: strin
4889
4915
  * @category 群组
4890
4916
  * @since 5.12.0
4891
4917
  */
4892
- declare function updateGroupInfo(groupInfo: IGroupInfoOption): Promise<IAsyncRes<void>>;
4918
+ declare function updateGroupInfo(groupInfo: IGroupInfoOption): Promise<IAsyncRes<IErrorKeys>>;
4893
4919
  /**
4894
4920
  * 批量获取群组信息
4895
4921
  * @description 客户端创建群组需要开通 `信息托管功能`,未开通时不支持此功能,支持获取已存在的所有群组信息
@@ -4992,7 +5018,7 @@ declare function getGroupMembers(groupId: string, userIds: string[]): Promise<IA
4992
5018
  * @category 群组
4993
5019
  * @since 5.12.0
4994
5020
  */
4995
- declare function setGroupMemberInfo(groupId: string, userId: string, nickname: string, extra?: string): Promise<IAsyncRes<void>>;
5021
+ declare function setGroupMemberInfo(groupId: string, userId: string, nickname: string, extra?: string): Promise<IAsyncRes<IErrorKeys>>;
4996
5022
  /**
4997
5023
  * 根据昵称搜索群成员信息
4998
5024
  * @description 需要开启`信息托管功能` 功能,否则不支持此功能,Web 平台暂不支持
@@ -5186,7 +5212,7 @@ declare function refuseFriendApplication(userId: string): Promise<IAsyncRes<void
5186
5212
  */
5187
5213
  declare function setFriendInfo(userId: string, remark?: string, extProfile?: {
5188
5214
  [key: string]: string;
5189
- }): Promise<IAsyncRes<void>>;
5215
+ }): Promise<IAsyncRes<IErrorKeys>>;
5190
5216
  /**
5191
5217
  * 检查好友关系
5192
5218
  *
@@ -5266,4 +5292,6 @@ declare function setNotificationQuietHoursWithSetting(opts: INotificationQuietHo
5266
5292
  declare function removeNotificationQuietHoursSetting(): Promise<RCResult>;
5267
5293
  declare function getNotificationQuietHoursSetting(): Promise<RCResult<INotificationQuietHoursSetting>>;
5268
5294
 
5269
- 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, acceptFriendApplication, acceptGroupApplication, acceptGroupInvite, addConversationsToTag, addEventListener, addFriend, addGroupFollows, addGroupManagers, addTag, addToBlacklist, batchClearRemoteHistoryMessages, batchGetMessageReadReceiptInfoV4, batchRemoveConversation, batchSetConversationNotificationLevel, batchSetConversationToTop, bindRTCRoomForChatroom, checkFriends, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages$1 as clearMessages, clearMessagesUnreadStatus, clearRealtimeConUnreadCount, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, createGroup, createUploadTask, deleteFriends, deleteLocalMessagesByTimestamp, deleteMessages$1 as deleteMessages, destroy, disconnect, dismissGroup, 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, getFriendAddPermission, getFriendApplications, getFriends, getFriendsInfo, getGroupApplications, getGroupFollows, getGroupMembers, getGroupMembersByRole, getGroupsInfo, getHistoryMessages, getJoinedGroups, getJoinedGroupsByRole, getMessage, getMessageReadReceiptV4, getMessageReader, getMyUserProfile, getMyUserProfileVisibility, getNotificationQuietHoursSetting, getProxy, getRealtimeConTotalUnreadCount, getRealtimeConUnreadCounts, getRealtimeConversations, 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, inviteUsersToGroup, joinChatRoom, joinExistChatRoom, joinGroup, kickGroupMembers, modifyMessage, onceEventListener, quitChatRoom, quitGroup, recallMessage, refuseFriendApplication, refuseGroupApplication, refuseGroupInvite, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeFromBlacklist, removeGroupFollows, removeGroupManagers, removeMessageExpansionForKey, removeNotificationQuietHoursSetting, removeRealtimeConversations, removeTag, removeTagFromConversations, removeTagsFromConversation, saveTextMessageDraft, searchConversationByContent$1 as searchConversationByContent, searchFriendsInfo, searchGroupMembers, searchJoinedGroups, 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, setFriendAddPermission, setFriendInfo, setGroupMemberInfo, setGroupRemark, setMessageReceivedStatus$1 as setMessageReceivedStatus, setNotificationQuietHoursWithSetting, setProxy, setUltraGroupDefaultNotificationLevel, stopUploadTask, subscribeUserStatus, testProxy, transferGroupOwner, unSubscribeUserStatus, updateExpansionForUltraGroupMessage, updateGroupInfo, updateMessageExpansion, updateMyUserProfile, updateMyUserProfileVisibility, updateTag, upload };
5295
+ declare type IStreamMessageResponseEventData = IStreamMessageResponseEventData$1<IAReceivedMessage>;
5296
+
5297
+ export { BaseMessage, _default$b as CombineMessage, _default$a as CombineV2Message, CombineV2MessageContent, _default$3 as CommandMessage, ConnectType, EventListeners, Events, _default$9 as FileMessage, _default$8 as GIFMessage, GetHistoryMessageOption, GetHistoryMessageResult, _default$1 as GroupNotificationMessage, _default$e 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, IStreamMessageBody, IStreamMessageResponseEventData, ITextMessageBody, IThumbnailConfig, ITypingStatusEvent, IUploadConfig, IUploadHooks, IUploadInfo, IUploadMessageOption, IUploadResult, IUserInfo, IVoiceMessageBody, _default$f as ImageMessage, _default$2 as InformationNotificationMessage, _default$6 as LocationMessage, MentionedInfo, MessageAuditType, MessageConstructor, MessageType, _default$5 as ReferenceMessage, _default$4 as RichContentMessage, _default$d as SightMessage, _default as StreamMessage, _default$c as TextMessage, UploadTask, _default$7 as VoiceMessage, __addSDKVersion, acceptFriendApplication, acceptGroupApplication, acceptGroupInvite, addConversationsToTag, addEventListener, addFriend, addGroupFollows, addGroupManagers, addTag, addToBlacklist, batchClearRemoteHistoryMessages, batchGetMessageReadReceiptInfoV4, batchRemoveConversation, batchSetConversationNotificationLevel, batchSetConversationToTop, bindRTCRoomForChatroom, checkFriends, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages, clearMessagesUnreadStatus, clearRealtimeConUnreadCount, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, createGroup, createUploadTask, deleteFriends, deleteLocalMessagesByTimestamp, deleteMessages, destroy, disconnect, dismissGroup, 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, getFriendAddPermission, getFriendApplications, getFriends, getFriendsInfo, getGroupApplications, getGroupFollows, getGroupMembers, getGroupMembersByRole, getGroupsInfo, getHistoryMessages, getJoinedGroups, getJoinedGroupsByRole, getMessage, getMessageReadReceiptV4, getMessageReader, getMyUserProfile, getMyUserProfileVisibility, getNotificationQuietHoursSetting, getProxy, getRealtimeConTotalUnreadCount, getRealtimeConUnreadCounts, getRealtimeConversations, 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, installPlugin, inviteUsersToGroup, joinChatRoom, joinExistChatRoom, joinGroup, kickGroupMembers, modifyMessage, onceEventListener, quitChatRoom, quitGroup, recallMessage, refuseFriendApplication, refuseGroupApplication, refuseGroupInvite, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeFromBlacklist, removeGroupFollows, removeGroupManagers, removeMessageExpansionForKey, removeNotificationQuietHoursSetting, removeRealtimeConversations, removeTag, removeTagFromConversations, removeTagsFromConversation, requestStreamMessageContent, saveTextMessageDraft, searchConversationByContent, searchFriendsInfo, searchGroupMembers, searchJoinedGroups, searchMessages, searchUserProfileByUniqueId, sendFileMessage, sendGIFMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptMessageV4, sendReadReceiptRequest, sendReadReceiptResponse, sendReadReceiptResponseV2, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, sendUltraGroupTypingStatus, setChatRoomEntries, setChatRoomEntry, setConversationNotificationLevel, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setConversationTypeNotificationLevel, setFriendAddPermission, setFriendInfo, setGroupMemberInfo, setGroupRemark, setMessageReceivedStatus, setNotificationQuietHoursWithSetting, setProxy, setUltraGroupDefaultNotificationLevel, stopUploadTask, subscribeUserStatus, testProxy, transferGroupOwner, unSubscribeUserStatus, updateExpansionForUltraGroupMessage, updateGroupInfo, updateMessageExpansion, updateMyUserProfile, updateMyUserProfileVisibility, updateTag, upload };