@rongcloud/imlib-next 5.46.1-alpha.3 → 5.48.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { FileType, APIContext, RCResult, IPluginGenerator, MessageTypeDescription, LogLevel, EnableLogL, AreaCode, LogDBProxy, IConversationCachePolicy, IReceivedMessage, IGetHistoryMessageOption, IReceivedConversation, IPushConfig, IAuditInfoKeyInMessage, IQuoteInfo, IRecallMsgOptions, IConversationOption, ITypingMessage, IUpdateItem, ErrorCode, IChatroomListenerData, IExpansionListenerData, IUserSettingsChangedEvent, IBlockedMessageInfo, IOperateStatusNotify, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUserGroupStatusInfo, IReadReceiptData, ISyncReadStatusData, ISubscribeUserStatusInfo, ISubscribeRelationInfo, SubscribeType, IUserProfileInfo, IGroupOperationInfo, IGroupInfoChanged, IGroupMemberInfoChanged, IGroupApplicationInfo, IGroupRemarkChangedSync, IGroupFollowsChangedSync, IFriendAdd, IFriendDelete, IFriendApplicationStatusChange, IFriendInfoChangedSync, IStreamMessageResponseEventData as IStreamMessageResponseEventData$1, ReadReceiptResponseV5, ISpeechToTextResponse, TranslateItem, IRobotInfo, IMessageReactionEvent, IGetUltraGroupListOption, IUltraGroupConversation, NotificationLevel, IUltraGroupOption, IUltraGroupUnreadMentionedOption, IUltraUnreadMsg, IUltraGroupUnreadInfo, IConversationIdentifier, ITextMessageContent, IUserExtraKeyInMessage, IExtraDataKeyInMessage, IMentionedInfoKeyInMessage, IMessageReadReceiptV4Response, IGroupReadReceiptData, MessageDirection, IClearMessageOption, IMessageReaderResponse, IFirstUnreadMessageInfo, ConversationType, ReadReceiptInfoV5, IMessageIdentifier, ReadReceiptUsersOption, ReadReceiptUsersResult, IConvertSpeechToTextOption, TranslateMessagesParams, TranslateTextsParams, IModifyMessageParams, ITagParam, ITagInfo, IConversationTag, ICombineMessageContent, ICombineV2MessageContent, ICommandMessageContent, IFileMessageContent, IGIFMessageContent, IGroupNotificationMessageContent, IImageMessageContent, IInformationNotificationMessageContent, ILocationMessageContent, IReferenceMessageContent, IRichContentMessageContent, ISightMessageContent, IStreamMessageContent, IHQVoiceMessageContent, IVoiceMessageContent, IUploadAuth, IDownloadAuth, UploadMethod, IEditedMessageDraft, IGetHistoryMessagesByTypesOption, ReceivedStatus, IReceivedStatusInfo, SentStatus, IInsertMessage, ISearchMessageParams, IProxy, IUpdateMyProfileFail, UserProfileVisibility, ISubscribeUserOnlineStatus, IGroupInfoOption, ICreateGroupFail, IErrorKeys, IGroupInfo, IQuitGroupConfig, GroupMemberRole, IGetGroupMembersOption, IPagingQueryResult, IGroupMemberInfo, IPagingQueryOption, IProcessCode, IInviteUserToGroupResponse, GroupApplicationDirection, GroupApplicationStatus, IFollowsInfo, DirectionType, IFriendRelationInfo, QueryFriendsDirectionType, IFriendInfo, FriendApplicationType, FriendApplicationStatus, IFriendApplicationInfo, FriendAddPermission, RCConnectionStatus, AppSettings, INotificationQuietHoursSetting, IGetConversationListByTimestampParams, ConversationBatchDeletionParams, TranslateStrategy, NotificationStatus, IConversationUnreadCount, IGetUnreadMentionMeConversationListParams, IConversationListLoaderOptions, ConversationListLoader, IGetConversationsIncludingRobotsOption, IChatroomJoinResponse, IChatroomInfo, IChatroomEntry, IChatroomEntries, IRemoveChatroomEntry, IRTCRoomBindOption, MentionedInfo, IUpdateMessageReactionParam, IMessageReactionSummaryQueryParam, IMessageReaction, IGetMessageReactionsParam, IMessageReactionsResult, IGetMessageReactionUsersParam, IMessageReactionUsersResult } from '@rongcloud/engine';
2
- export { AppSettings, AreaCode, ChatroomEntryType, ChatroomSyncStatusReason, ChatroomUserChangeType, ChrmMemBanType, ChrmMemOperateType, ChrmSyncStatus, ConnectionStatus, ConversationBatchDeletionParams, ConversationListLoader, ConversationType, ConversationUnreadCountFilter, DirectionType, EnableLogL, ErrorCode, FileType, FilterRobotType, FriendAddPermission, FriendApplicationStatus, FriendApplicationType, FriendRelationType, GroupApplicationDirection, GroupApplicationStatus, GroupApplicationType, GroupInviteHandlePermission, GroupJoinPermission, GroupMemberInfoEditPermission, GroupMemberRole, GroupOperation, GroupOperationPermission, GroupReadReceiptVersion, IAndroidPushConfig, IAsyncRes, IAuditInfoKeyInMessage, IAuditInfoValueInMessage, IBlockedMessageInfo, IChannelAndUserGroupChangeData, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomJoinResponse, IChatroomListenerData, IChatroomNotifyBan, IChatroomNotifyBlock, IChatroomNotifyMultiLoginSync, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IClearMessageOption, ICombineMessageContent, ICombineV2MessageContent, ICombinedMessage, ICommandMessageContent, ICommandNotificationMessageContent, IConversationCachePolicy, IConversationFilter, IConversationIdentifier, IConversationListLoaderOptions, IConversationOption, IConversationTag, IConversationTagFilter, IConvertHQVoiceMessageToTextOption, IConvertSpeechToTextOption, IConvertVoiceMessageToTextOption, ICreateGroupFail, IDataManagementInfo, IDeletedExpansion, IDownloadAuth, IEditedMessageDraft, IErrorKeys, IEventListener, IExpansionListenerData, IExtraDataKeyInMessage, IFileMessageContent, IFirstUnreadMessageInfo, IFollowsInfo, IFriendAdd, IFriendApplicationInfo, IFriendApplicationStatusChange, IFriendDelete, IFriendInfo, IFriendInfoChangedSync, IFriendRelationInfo, IGIFMessageContent, IGetConversationListByTimestampParams, IGetConversationsIncludingRobotsOption, IGetGroupMembersOption, IGetHistoryMessagesByTypesOption, IGetMessageReactionUsersParam, IGetMessageReactionsParam, IGetUltraGroupListOption, IGetUnreadMentionMeConversationListParams, IGooglePushConfig, IGroupApplicationInfo, IGroupFollowsChangedSync, IGroupFollowsList, IGroupFollowsUserInfo, IGroupInfo, IGroupInfoChanged, IGroupInfoOption, IGroupMemberInfo, IGroupMemberInfoChanged, IGroupMembers, IGroupNotificationMessageContent, IGroupOperationInfo, IGroupReadReceiptData, IGroupRemarkChangedSync, IHQVoiceMessageContent, IHarmonyOSPushConfig, IImageMessageContent, IInformationNotificationMessageContent, IInsertMessage, IInviteUserToGroupResponse, ILocationMessageContent, ILogData, IMentionedInfoKeyInMessage, IMessageDesc, IMessageExtraData, IMessageFilter, IMessageIdentifier, IMessageReaction, IMessageReactionEvent, IMessageReactionEventData, IMessageReactionSummaryQueryParam, IMessageReactionUser, IMessageReactionUsersResult, IMessageReactionsResult, IMessageReadReceiptV4Response, IMessageReader, IMessageReaderResponse, IModifyMessageParams, INotificationQuietHoursSetting, IOperateInfo, IOperateStatusNotify, IOperateSummary, IPagingQueryOption, IPagingQueryResult, IPlatformOnlineStatus, IPrivateReadReceiptData, IProcessCode, IPromiseResult, IProxy, IPushConfig, IQuitGroupConfig, IQuoteInfo, IRTCRoomBindOption, IReadReceiptData, IReadReceiptInfo, IReadReceiptResponseInfo, IRecallCommandMessageContent, IRecallNotificationMessageContent, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IReceivedStatusInfo, IReferContentInMessage, IReferContentKeyInMessage, IReferenceMessageContent, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IResponse, IRichContentMessageContent, IRobotInfo, ISearchMessageParams, ISearchMessagesResult, ISightMessageContent, ISpeechToTextInfo, ISpeechToTextResponse, IStreamMessageContent, IStreamMessageResponseChunkData, ISubscribeRelationInfo, ISubscribeStatusDetail, ISubscribeUserOnlineStatus, ISubscribeUserStatusInfo, ISyncReadStatusData, ITagInfo, ITagParam, ITextMessageContent, ITimeRange, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadInfo, IUltraGroupUnreadMentionedOption, IUltraUnreadMsg, IUpdateItem, IUpdateMessageReactionParam, IUpdateMyProfileFail, IUpdatedExpansion, IUploadAuth, IUserExtraKeyInMessage, IUserExtraValueInMessage, IUserGroupChangeData, IUserGroupStatusInfo, IUserProfile, IUserProfileInfo, IUserSettingsChangedEvent, IVoiceMessageContent, IiOSPushConfig, InterruptionLevel, LogDBProxy, LogL, LogLevel, MentionedInfo, MentionedType, MessageAuditType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageReactionOperationType, MessageType, NotificationLevel, NotificationStatus, OnlineStatus, OperateStatus, Platform, Platform as PlatformInfo, PushImportanceHonor, PushNotificationQuietHoursLevel, QueryFriendsDirectionType, QuoteMessageStatus, RCConnectionStatus, RCResult, ReadReceiptInfoV5, ReadReceiptResponseV5, ReadReceiptUser, ReadReceiptUsersOption, ReadReceiptUsersResult, ReceivedStatus, ReferenceMessageStatus, SentStatus, SpeechToTextStatus, StreamMessageResponseEventType, SubscribeOperationType, SubscribeType, TranslateInfo, TranslateItem, TranslateMessageParam, TranslateMessagesParams, TranslateMode, TranslateStatus, TranslateStrategy, TranslateTextParam, TranslateTextsParams, UltraGroupChannelChangeType, UltraGroupChannelType, UploadMethod, UserProfileVisibility, UserSettingsChangedKey, UserType, createLogDBProxy, fail, ok } from '@rongcloud/engine';
1
+ import { getFileToken as getFileToken$1, getFileUrl as getFileUrl$1, FileType, RCResult, IPluginGenerator, MessageTypeDescription, IReceivedMessage, IGetHistoryMessageOption, LogLevel, EnableLogL, AreaCode, LogDBProxy, IConversationCachePolicy, IConversationOption, IReceivedConversation, IUpdateItem, ITypingMessage, IPushConfig, IAuditInfoKeyInMessage, IQuoteInfo, IRecallMsgOptions, ErrorCode, IChatroomListenerData, IExpansionListenerData, IUserSettingsChangedEvent, IBlockedMessageInfo, IOperateStatusNotify, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUserGroupStatusInfo, IReadReceiptData, ISyncReadStatusData, ISubscribeUserStatusInfo, ISubscribeRelationInfo, SubscribeType, IUserProfileInfo, IGroupOperationInfo, IGroupInfoChanged, IGroupMemberInfoChanged, IGroupApplicationInfo, IGroupRemarkChangedSync, IGroupFollowsChangedSync, IFriendAdd, IFriendDelete, IFriendApplicationStatusChange, IFriendInfoChangedSync, IStreamMessageResponseEventData as IStreamMessageResponseEventData$1, ReadReceiptResponseV5, ISpeechToTextResponse, TranslateItem, IRobotInfo, IMessageReactionEvent, IUltraGroupOption, NotificationLevel, IUltraUnreadMsg, IGetUltraGroupListOption, IUltraGroupConversation, IUltraGroupUnreadInfo, IUltraGroupUnreadMentionedOption, IClearMessageOption, IInsertMessage, IGetHistoryMessagesByTypesOption, ISearchMessageParams, ReceivedStatus, IReceivedStatusInfo, SentStatus, IConversationIdentifier, IUserExtraKeyInMessage, IExtraDataKeyInMessage, IMentionedInfoKeyInMessage, IGroupReadReceiptData, MessageDirection, IFirstUnreadMessageInfo, IMessageCountDetailOptions, IMessageCountDetail, ReadReceiptInfoV5, IMessageIdentifier, IMessageReadReceiptV4Response, IMessageReaderResponse, ReadReceiptUsersResult, ReadReceiptUsersOption, IModifyMessageParams, IConvertSpeechToTextOption, ConversationType, ITextMessageContent, TranslateMessagesParams, TranslateTextsParams, ITagParam, ITagInfo, IConversationTag, ICombineMessageContent, ICombineV2MessageContent, ICommandMessageContent, IFileMessageContent, IGIFMessageContent, IGroupNotificationMessageContent, IImageMessageContent, IInformationNotificationMessageContent, ILocationMessageContent, IReferenceMessageContent, IRichContentMessageContent, ISightMessageContent, IStreamMessageContent, IHQVoiceMessageContent, IVoiceMessageContent, IDownloadAuth, IUploadAuth, UploadMethod, IEditedMessageDraft, IProxy, UserProfileVisibility, ISubscribeUserOnlineStatus, IUpdateMyProfileFail, IProcessCode, IGroupInfoOption, ICreateGroupFail, IPagingQueryOption, GroupApplicationDirection, GroupApplicationStatus, IPagingQueryResult, IFollowsInfo, IGroupMemberInfo, GroupMemberRole, IGetGroupMembersOption, IGroupInfo, IInviteUserToGroupResponse, IQuitGroupConfig, IErrorKeys, DirectionType, IFriendRelationInfo, FriendAddPermission, FriendApplicationType, FriendApplicationStatus, IFriendApplicationInfo, QueryFriendsDirectionType, IFriendInfo, AppSettings, RCConnectionStatus, INotificationQuietHoursSetting, IGetConversationListByTimestampParams, ConversationBatchDeletionParams, TranslateStrategy, IConversationListLoaderOptions, ConversationListLoader, NotificationStatus, IGetConversationsIncludingRobotsOption, IConversationUnreadCount, IGetUnreadMentionMeConversationListParams, IRTCRoomBindOption, IRemoveChatroomEntry, IChatroomEntry, IChatroomInfo, IChatroomJoinResponse, IChatroomEntries, MentionedInfo, IUpdateMessageReactionParam, IMessageReactionSummaryQueryParam, IMessageReaction, IGetMessageReactionUsersParam, IMessageReactionUsersResult, IGetMessageReactionsParam, IMessageReactionsResult } from '@rongcloud/engine';
2
+ export { AppSettings, AreaCode, ChatroomEntryType, ChatroomSyncStatusReason, ChatroomUserChangeType, ChrmMemBanType, ChrmMemOperateType, ChrmSyncStatus, ConnectionStatus, ConversationBatchDeletionParams, ConversationListLoader, ConversationType, ConversationUnreadCountFilter, DirectionType, EnableLogL, ErrorCode, FileType, FilterRobotType, FriendAddPermission, FriendApplicationStatus, FriendApplicationType, FriendRelationType, GroupApplicationDirection, GroupApplicationStatus, GroupApplicationType, GroupInviteHandlePermission, GroupJoinPermission, GroupMemberInfoEditPermission, GroupMemberRole, GroupOperation, GroupOperationPermission, GroupReadReceiptVersion, IAndroidPushConfig, IAsyncRes, IAuditInfoKeyInMessage, IAuditInfoValueInMessage, IBlockedMessageInfo, IChannelAndUserGroupChangeData, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomJoinResponse, IChatroomListenerData, IChatroomNotifyBan, IChatroomNotifyBlock, IChatroomNotifyMultiLoginSync, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IClearMessageOption, ICombineMessageContent, ICombineV2MessageContent, ICombinedMessage, ICommandMessageContent, ICommandNotificationMessageContent, IConversationCachePolicy, IConversationFilter, IConversationIdentifier, IConversationListLoaderOptions, IConversationOption, IConversationTag, IConversationTagFilter, IConvertHQVoiceMessageToTextOption, IConvertSpeechToTextOption, IConvertVoiceMessageToTextOption, ICreateGroupFail, IDataManagementInfo, IDeletedExpansion, IDownloadAuth, IEditedMessageDraft, IErrorKeys, IEventListener, IExpansionListenerData, IExtraDataKeyInMessage, IFileMessageContent, IFirstUnreadMessageInfo, IFollowsInfo, IFriendAdd, IFriendApplicationInfo, IFriendApplicationStatusChange, IFriendDelete, IFriendInfo, IFriendInfoChangedSync, IFriendRelationInfo, IGIFMessageContent, IGetConversationListByTimestampParams, IGetConversationsIncludingRobotsOption, IGetGroupMembersOption, IGetHistoryMessagesByTypesOption, IGetMessageReactionUsersParam, IGetMessageReactionsParam, IGetUltraGroupListOption, IGetUnreadMentionMeConversationListParams, IGooglePushConfig, IGroupApplicationInfo, IGroupFollowsChangedSync, IGroupFollowsList, IGroupFollowsUserInfo, IGroupInfo, IGroupInfoChanged, IGroupInfoOption, IGroupMemberInfo, IGroupMemberInfoChanged, IGroupMembers, IGroupNotificationMessageContent, IGroupOperationInfo, IGroupReadReceiptData, IGroupRemarkChangedSync, IHQVoiceMessageContent, IHarmonyOSPushConfig, IImageMessageContent, IInformationNotificationMessageContent, IInsertMessage, IInviteUserToGroupResponse, ILocationMessageContent, ILogData, IMentionedInfoKeyInMessage, IMessageCountDetail, IMessageCountDetailOptions, IMessageDesc, IMessageExtraData, IMessageFilter, IMessageIdentifier, IMessageReaction, IMessageReactionEvent, IMessageReactionEventData, IMessageReactionSummaryQueryParam, IMessageReactionUser, IMessageReactionUsersResult, IMessageReactionsResult, IMessageReadReceiptV4Response, IMessageReader, IMessageReaderResponse, IModifyMessageParams, INotificationQuietHoursSetting, IOperateInfo, IOperateStatusNotify, IOperateSummary, IPagingQueryOption, IPagingQueryResult, IPlatformOnlineStatus, IPrivateReadReceiptData, IProcessCode, IPromiseResult, IProxy, IPushConfig, IQuitGroupConfig, IQuoteInfo, IRTCRoomBindOption, IReadReceiptData, IReadReceiptInfo, IReadReceiptResponseInfo, IRecallCommandMessageContent, IRecallNotificationMessageContent, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IReceivedStatusInfo, IReferContentInMessage, IReferContentKeyInMessage, IReferenceMessageContent, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IResponse, IRichContentMessageContent, IRobotInfo, ISearchMessageParams, ISearchMessagesResult, ISightMessageContent, ISpeechToTextInfo, ISpeechToTextResponse, IStreamMessageContent, IStreamMessageResponseChunkData, ISubscribeRelationInfo, ISubscribeStatusDetail, ISubscribeUserOnlineStatus, ISubscribeUserStatusInfo, ISyncReadStatusData, ITagInfo, ITagParam, ITextMessageContent, ITimeRange, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadInfo, IUltraGroupUnreadMentionedOption, IUltraUnreadMsg, IUpdateItem, IUpdateMessageReactionParam, IUpdateMyProfileFail, IUpdatedExpansion, IUploadAuth, IUserExtraKeyInMessage, IUserExtraValueInMessage, IUserGroupChangeData, IUserGroupStatusInfo, IUserProfile, IUserProfileInfo, IUserSettingsChangedEvent, IVoiceMessageContent, IiOSPushConfig, InterruptionLevel, LogDBProxy, LogL, LogLevel, MentionedInfo, MentionedType, MessageAuditType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageReactionOperationType, MessageType, NotificationLevel, NotificationStatus, OnlineStatus, OperateStatus, Platform, Platform as PlatformInfo, PushImportanceHonor, PushNotificationQuietHoursLevel, QueryFriendsDirectionType, QuoteMessageStatus, RCConnectionStatus, RCResult, ReadReceiptInfoV5, ReadReceiptResponseV5, ReadReceiptUser, ReadReceiptUsersOption, ReadReceiptUsersResult, ReceivedStatus, ReferenceMessageStatus, SentStatus, SpeechToTextStatus, StreamMessageResponseEventType, SubscribeOperationType, SubscribeType, TranslateInfo, TranslateItem, TranslateMessageParam, TranslateMessagesParams, TranslateMode, TranslateStatus, TranslateStrategy, TranslateTextParam, TranslateTextsParams, UltraGroupChannelChangeType, UltraGroupChannelType, UploadMethod, UserProfileVisibility, UserSettingsChangedKey, UserType, createLogDBProxy, fail, ok } from '@rongcloud/engine';
3
3
 
4
4
  /**
5
5
  * 缩略图配置
@@ -81,24 +81,20 @@ interface IUploadResult {
81
81
  */
82
82
  height?: number;
83
83
  }
84
- declare type TGetFileToken = typeof APIContext.prototype.getFileToken;
85
- declare type TGetFileUrl = typeof APIContext.prototype.getFileUrl;
84
+ type TGetFileToken = typeof getFileToken$1;
85
+ type TGetFileUrl = typeof getFileUrl$1;
86
86
 
87
87
  /**
88
88
  * 上传任务
89
89
  * @hidden
90
90
  */
91
91
  declare class UploadTask {
92
-
93
-
94
92
  readonly id: number;
95
93
  constructor(info: IUploadInfo, config: IUploadConfig);
96
94
  /**
97
95
  * 中断上传
98
96
  */
99
97
  abort(): void;
100
-
101
-
102
98
  awaitResult(): Promise<RCResult<IUploadResult>>;
103
99
  }
104
100
 
@@ -111,9 +107,9 @@ declare class UploadTask {
111
107
  */
112
108
  declare function installPlugin<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
113
109
 
114
- declare type API = (...args: any[]) => any;
110
+ type API = (...args: any[]) => any;
115
111
  /** 可监控的 API */
116
- declare type MonitorableAPI<T extends API = API> = T & {
112
+ type MonitorableAPI<T extends API = API> = T & {
117
113
  /** API 是否可被监控 */
118
114
  monitorable: boolean;
119
115
  /** 方法名 */
@@ -122,8 +118,8 @@ declare type MonitorableAPI<T extends API = API> = T & {
122
118
  original: T;
123
119
  };
124
120
  /** 监听器类型 */
125
- declare type Monitor<T extends MonitorableAPI = MonitorableAPI> = (args: Parameters<T['original']>, result: ReturnType<T['original']>) => void;
126
- declare type Transformer<T extends MonitorableAPI<API> = MonitorableAPI<API>> = (args: Parameters<T['original']>) => Parameters<T['original']>;
121
+ type Monitor<T extends MonitorableAPI = MonitorableAPI> = (args: Parameters<T['original']>, result: ReturnType<T['original']>) => void;
122
+ type Transformer<T extends MonitorableAPI<API> = MonitorableAPI<API>> = (args: Parameters<T['original']>) => Parameters<T['original']>;
127
123
  /**
128
124
  * 为 API 添加监听器,以监控调用行为,当指定 API 被调用时,会触发回调
129
125
  * @param api - 需要监控的 API 函数
@@ -172,7 +168,7 @@ declare function connect(token: string, reconnectKickEnable?: boolean): Promise<
172
168
  * console.info('成功断开');
173
169
  * ```
174
170
  */
175
- declare const disconnect: MonitorableAPI<(closeDB?: boolean | undefined, disablePush?: boolean | undefined) => Promise<void>>;
171
+ declare const disconnect: MonitorableAPI<(closeDB?: boolean, disablePush?: boolean) => Promise<void>>;
176
172
 
177
173
  /**
178
174
  * 事件监听名称
@@ -489,7 +485,7 @@ declare class BuiltinMessage<T = any> extends BaseMessage<T> {
489
485
  * 消息类型构造函数
490
486
  * @category Type
491
487
  */
492
- declare type MessageConstructor<T> = new (content: T) => BaseMessage<T>;
488
+ type MessageConstructor<T> = new (content: T) => BaseMessage<T>;
493
489
 
494
490
  /**
495
491
  * 初始化配置项
@@ -638,7 +634,7 @@ interface GetHistoryMessageOption extends Omit<IGetHistoryMessageOption, 'messag
638
634
  * 获取历史消息返回结构
639
635
  * @category Type
640
636
  */
641
- declare type GetHistoryMessageResult = {
637
+ type GetHistoryMessageResult = {
642
638
  list: IAReceivedMessage[];
643
639
  hasMore: boolean;
644
640
  };
@@ -664,7 +660,7 @@ interface IAReceivedConversationByTag extends IAReceivedConversation {
664
660
  * 超级群会话数据结构
665
661
  * @category Interface
666
662
  */
667
- declare type IAUltraGroupReceivedConversation = IAReceivedConversation;
663
+ type IAUltraGroupReceivedConversation = IAReceivedConversation;
668
664
  /**
669
665
  * 发送消息参数结构
670
666
  * @category Interface
@@ -1037,13 +1033,13 @@ interface IMessageResult {
1037
1033
  * @since 5.26.0
1038
1034
  * @deprecated 该接口已废弃,后续版本将移除,请直接使用 {@link IMessageResult} 替代
1039
1035
  */
1040
- declare type IRefreshReferenceMessageResult = IMessageResult;
1036
+ type IRefreshReferenceMessageResult = IMessageResult;
1041
1037
 
1042
1038
  /**
1043
1039
  * 事件监听器
1044
1040
  * @category Type
1045
1041
  */
1046
- declare type EventListeners = {
1042
+ type EventListeners = {
1047
1043
  [Events.CONNECTING]: () => void;
1048
1044
  [Events.CONNECTED]: () => void;
1049
1045
  [Events.DISCONNECT]: (code: ErrorCode) => void;
@@ -1495,717 +1491,1215 @@ declare function getBlacklist(): Promise<RCResult<string[]>>;
1495
1491
  declare function getBlacklistStatus(userId: string): Promise<RCResult<boolean>>;
1496
1492
 
1497
1493
  /**
1498
- * 获取本地消息
1499
- * @deprecated 自 5.16.0 开始,该接口废弃,请使用 `electronExtension` 模块的 `getLocalMessage` 代替。
1500
- */
1501
- declare const getMessage: typeof getLocalMessage;
1502
- /**
1503
- * 发送消息
1504
- * @description 发送消息的基础接口,可用来发送 IMLib 中的内置类型消息或自定义消息。针对不同的特定消息类型
1505
- * @category 消息
1506
- * @param conversation 会话信息
1507
- * @param message 消息体,类型为 BaseMessage 的子类,如 TextMessage、ImageMessage,通过 new TextMessage() 获取
1508
- * @param options 发送消息配置项
1509
- *
1510
- * @returns 返回一个 {@link RCResult} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
1511
- *
1512
- * @example
1513
- * 发送文本消息示例:
1514
- * ```ts
1515
- * const content = {content: 'hello world'};
1516
- * const message = new RongIMLib.TextMessage(content);
1517
- * const conversation = {
1518
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1519
- * targetId: 'targetId'
1520
- * }
1521
- * const sendRes = await RongIMLib.sendMessage(conversation, message);
1522
- * console.info('消息发送结果:', sendRes);
1523
- * ```
1524
- */
1525
- declare const sendMessage: MonitorableAPI<(conversation: IConversationIdentifier, message: BaseMessage, options?: ISendMessageOptions | undefined) => Promise<RCResult<IAReceivedMessage>>>;
1526
- /**
1527
- * 发送文本消息
1528
- * @description 发送文本消息的快捷方式,等同于使用 new TextMessage() 创建消息体后调用 sendMessage() 方法
1529
- * @category 消息
1494
+ * 根据关键字搜索本地消息
1495
+ * @deprecated 已废弃。请替换使用 {@link searchMessagesWithParams} 方法
1496
+ * @category Electron 独有
1497
+ * @description 本接口仅适用 Electron 平台搜索本地消息
1498
+ * **注意**:
1499
+ * 1. 文本类型消息只支持搜索 content,文件类型消息只支持搜索 name
1500
+ * 2. 自定义消息根据 registerMessageType 的 searchProps 参数决定
1501
+ * 3. 引用消息不支持搜索
1502
+ * 4. 如果不传 channelId,则在所有 channelId 中搜索消息
1503
+ * 5. 如果不传 messageTypes,则搜索所有支持搜索的消息类型
1504
+ * @since 5.4.0
1530
1505
  * @param conversation 会话信息
1531
- * @param messageBody 消息体
1532
- * @param options 发送消息配置项
1506
+ * @param keyword 搜索关键字
1507
+ * @param startTime 搜索时间,搜索该时间之前的消息
1508
+ * @param count 获取的数量
1509
+ * @param messageTypes 消息类型,@since 5.9.8 开始支持按照消息类型搜索,支持范围:文本(RC:TxtMsg)、文件(RC:FileMsg)、设置 {@link searchProps} 的自定义消息
1533
1510
  * @example
1534
- * 发送文本消息示例:
1511
+ * 根据关键字搜索本地消息示例:
1535
1512
  * ```ts
1536
- * const messageBody = {content: 'hello world'};
1537
1513
  * const conversation = {
1538
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1539
- * targetId: 'targetId'
1540
- * }
1541
- * const sendRes = await RongIMLib.sendTextMessage(conversation, messageBody);
1542
- * console.info('消息发送结果:', sendRes);
1514
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1515
+ * targetId: 'targetId',
1516
+ * };
1517
+ * const keyword = 'keyword';
1518
+ * const startTime = Date.now();
1519
+ * const count = 10;
1520
+ * const res = await RongIMLib.electronExtension.searchMessages(conversation, keyword, startTime, count);
1521
+ * console.info('根据关键字搜索本地消息结果:', res);
1543
1522
  * ```
1544
1523
  */
1545
- declare function sendTextMessage(conversation: IConversationOption, messageBody: ITextMessageContent, options?: ISendMessageOptions): Promise<RCResult<IAReceivedMessage>>;
1546
- /**
1547
- * 发送消息基础类型
1548
- * @category Type
1549
- */
1550
- declare type ISendBody = IUserExtraKeyInMessage & IExtraDataKeyInMessage & {
1551
- file: File;
1552
- } & IMentionedInfoKeyInMessage & IAuditInfoKeyInMessage;
1553
- /**
1554
- * 发送文件消息配置项
1555
- * @category Type
1556
- */
1557
- declare type ISendFileMessageOptions = ISendBody;
1524
+ declare function searchMessages$1(conversation: IConversationOption, keyword: string, startTime: number, count: number, messageTypes?: string[]): Promise<RCResult<ISearchMessagesResult>>;
1558
1525
  /**
1559
- * 发送文件消息
1560
- * @description 发送文件消息的快捷方式,等同于使用 new FileMessage() 创建消息体后调用 sendMessage() 方法,支持文件上传,上传成功后自动发送消息
1561
- * @category 消息
1526
+ * 在指定时间范围内搜索本地消息
1527
+ * @category Electron 独有
1528
+ * @description 本接口仅适用 Electron 平台搜索本地消息
1529
+ * @since 5.4.0
1562
1530
  * @param conversation 会话信息
1563
- * @param msgBody 消息体,其中 file 为待上传文件引用
1564
- * @param hooks 上传文件过程中的回调钩子,类型为 {@link IUploadHooks} 可选
1565
- * @param sendOptions 文件消息配置项,类型为 {@link IUploadMessageOption} 可选
1531
+ * @param option 搜索参数,类型为 {@link ISearchMessageInTimeRangeOption}
1566
1532
  * @example
1567
- * 发送文本消息示例:
1533
+ * 在指定时间范围内搜索本地消息示例:
1568
1534
  * ```ts
1569
- * const msgBody = { file }; // file 为待上传文件
1570
1535
  * const conversation = {
1571
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1572
- * targetId: 'targetId'
1536
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1537
+ * targetId: 'targetId'
1573
1538
  * }
1574
- * const sendRes = await RongIMLib.sendFileMessage(conversation, msgBody);
1575
- * console.info('消息发送结果:', sendRes);
1539
+ * const option = {
1540
+ * keyword: 'keyword',
1541
+ * startTime: 0,
1542
+ * endTime: 1632728573423,
1543
+ * }
1544
+ * const res = await RongIMLib.electronExtension.searchMessageInTimeRange(conversation, option)
1545
+ * console.info('在指定时间范围内搜索本地消息结果:', res);
1576
1546
  * ```
1577
1547
  */
1578
- declare const sendFileMessage: (conversation: IConversationIdentifier, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
1579
- /**
1580
- * 发送图片消息配置项
1581
- * @category Type
1582
- */
1583
- declare type ISendImageMessageOptions = ISendBody;
1548
+ declare function searchMessageInTimeRange(conversation: IConversationOption, option: ISearchMessageInTimeRangeOption): Promise<RCResult<ISearchMessagesResult>>;
1584
1549
  /**
1585
- * 发送图片消息
1586
- * @description 发送图片消息的快捷方式,等同于使用 new ImageMessage() 创建消息体后调用 sendMessage() 方法,支持图片上传,上传成功后自动发送消息
1587
- * @category 消息
1550
+ * 根据用户 ID 搜索本地消息
1551
+ * @category Electron 独有
1552
+ * @description 本接口仅适用 Electron 平台在指定会话的所有频道中根据用户 ID 搜索时间范围内的消息
1588
1553
  * @param conversation 会话信息
1589
- * @param msgBody 消息体,其中 file 为待上传图片引用
1590
- * @param hooks 上传图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
1591
- * @param sendOptions 图片消息配置项,类型为 {@link IImageMessageOption} 可选
1554
+ * @param count 获取的数量
1555
+ * @param startTime 搜索时间,搜索时间之前的消息
1556
+ * @param userId 用户 ID
1557
+ * @since 5.7.10
1592
1558
  * @example
1593
- * 发送图片消息示例:
1559
+ * 根据用户 ID 搜索本地消息示例:
1594
1560
  * ```ts
1595
- * const msgBody = { file }; // file 为待上传图片
1596
1561
  * const conversation = {
1597
1562
  * conversationType: RongIMLib.ConversationType.PRIVATE,
1598
1563
  * targetId: 'targetId'
1599
- * }
1600
- * const sendRes = await RongIMLib.sendImageMessage(conversation, msgBody);
1601
- * console.info('消息发送结果:', sendRes);
1564
+ * };
1565
+ * const userId = 'userId';
1566
+ * const startTime = Date.now();
1567
+ * const count = 10;
1568
+ * const res = await RongIMLib.electronExtension.searchMessagesByUser(conversation, userId, startTime, count);
1569
+ * console.info('根据用户 ID 搜索本地消息', res);
1602
1570
  * ```
1603
1571
  */
1604
- declare const sendImageMessage: (conversation: IConversationIdentifier, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IImageMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
1572
+ declare function searchMessagesByUser(conversation: IConversationOption, userId: string, startTime: number, count: number): Promise<RCResult<Pick<ISearchMessagesResult, 'messages'>>>;
1605
1573
  /**
1606
- * 发送 GIF 图片消息
1607
- * @description 发送 GIF 图片消息的快捷方式,等同于使用 new GIFMessage() 创建消息体后调用 sendMessage() 方法,支持 GIF 图片上传,上传成功后自动发送消息
1608
- * @category 消息
1574
+ * 获取会话中指定类型的消息
1575
+ * @category Electron 独有
1576
+ * @description 本接口仅适用 Electron 平台获取会话中指定类型的消息
1609
1577
  * @param conversation 会话信息
1610
- * @param msgBody 消息体,其中 file 为待上传 GIF 图片引用
1611
- * @param hooks 上传 GIF 图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
1612
- * @param sendOptions GIF 图片消息配置项,类型为 {@link IGIFMessageOption} 可选
1578
+ * @param option 配置参数,类型为 {@link IGetHistoryMessagesByTypesOption}
1579
+ * @since 5.4.0
1613
1580
  * @example
1614
- * 发送 GIF 图片消息示例:
1581
+ * 获取会话中指定类型的消息示例:
1615
1582
  * ```ts
1616
- * const msgBody = { file }; // file 为待上传 GIF 图片
1617
1583
  * const conversation = {
1618
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1619
- * targetId: 'targetId'
1620
- * }
1621
- * const sendRes = await RongIMLib.sendGIFMessage(conversation, msgBody);
1622
- * console.info('消息发送结果:', sendRes);
1584
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1585
+ * targetId: 'targetId'
1586
+ * };
1587
+ * const options = { messageTypes: [RongIMLib.MessageType.TEXT] };
1588
+ * const res = await RongIMLib.electronExtension.getHistoryMessagesByMessageTypes(conversation, option);
1589
+ * console.info('获取会话中指定类型的消息结果:', res);
1623
1590
  * ```
1624
1591
  */
1625
- declare const sendGIFMessage: (conversation: IConversationIdentifier, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
1592
+ declare function getHistoryMessagesByMessageTypes(conversation: IConversationOption, option: IGetHistoryMessagesByTypesOption): Promise<RCResult<{
1593
+ /**
1594
+ * @deprecated 字段已废弃即将删除,推荐使用 list
1595
+ */
1596
+ messages: IAReceivedMessage[];
1597
+ } & GetHistoryMessageResult>>;
1626
1598
  /**
1627
- * 发送高清语音消息
1628
- * @description 待发送的文件必须为 AAC 音频文件。
1629
- * 发送高清语音消息的快捷方式,等同于使用 new HQVoiceMessage() 创建消息体后调用 sendMessage() 方法,支持高清语音上传,上传成功后自动发送消息
1630
- * @category 消息
1599
+ * 获取本地与远端历史消息
1600
+ * @category Electron 独有
1601
+ * @description 本接口仅适用 Electron 平台且需要业务层开启 `单群聊云存储服务`
1602
+ * 方法与 {@link getRemoteHistoryMessages} 的区别是 getContinuousMessages 会先查询指定会话存储本地数据库的消息,
1603
+ * 当本地消息无法满足查询条件时,再查询在单群聊消息云端存储中的历史消息,以返回连续且相邻的消息对象列表
1604
+ * **注意**:
1605
+ * 1. 分页获取时,下次传的时间戳必须使用 getContinuousMessages 接口返回的 timestamp
1606
+ * 2. 获取历史消息逻辑:优先获取本地数据历史消息,本地获取不到再获取远端历史消息,但是该情况可能会因为离线或者补偿消息存储天数影响,出现消息断档现象
1607
+ * 3. 该功能不适用于超级群会话。
1608
+ * 消息断档现象:因为离线或者补偿消息存储天数影响,存储在本地数据库中消息存在不连续或者说中间某段时间消息丢失
1609
+ * 比如离线消息和补偿消息都为 1 天,第一天 A 给 B 发送 1, 2, 3,第二天 A 给 B 发送 4, 5, 6,
1610
+ * B 第二天再登入,由于离线消息和补偿消息都为 1 天,所以 B 只能收到 4, 5, 6。1, 2, 3 消息丢失
1611
+ * 3. option 中的 Count 字段仅支持 1-100 范围
1631
1612
  * @param conversation 会话信息
1632
- * @param msgBody 消息体,其中 file 为待上传高清语音引用
1633
- * @param hooks 上传高清语音过程中的回调钩子,类型为 {@link IUploadHooks} 可选
1634
- * @param sendOptions 高清语音消息配置项,类型为 {@link ISendHQVoiceMessageOptions} 可选
1613
+ * @param option 参数配置,类型为 {@link GetHistoryMessageOption}
1614
+ * @since 5.9.6
1635
1615
  * @example
1636
- * 发送高清语音消息示例:
1616
+ * 获取本地与远端历史消息示例:
1637
1617
  * ```ts
1638
- * const msgBody = { file }; // file 为待上传高清语音
1639
1618
  * const conversation = {
1640
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1641
- * targetId: 'targetId'
1642
- * }
1643
- * const sendRes = await RongIMLib.sendHQVoiceMessage(conversation, msgBody);
1644
- * console.info('消息发送结果:', sendRes);
1619
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1620
+ * targetId: 'targetId'
1621
+ * };
1622
+ * const options = { timestamp: 0, count: 20, order: 0 };
1623
+ * const res = await RongIMLib.electronExtension.getContinuousMessages(conversation, option);
1624
+ * console.info('获取本地与远端历史消息结果:', res);
1645
1625
  * ```
1646
1626
  */
1647
- declare const sendHQVoiceMessage: (conversation: IConversationIdentifier, msgBody: ISendBody, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
1648
- /**
1649
- * 发送小视频消息配置项
1650
- * @category Type
1651
- */
1652
- declare type ISendSightMessageOptions = {
1653
- duration: number;
1654
- thumbnail: string;
1655
- name?: string;
1656
- } & ISendBody;
1627
+ declare function getContinuousMessages(conversation: IConversationOption, options: GetHistoryMessageOption): Promise<RCResult<{
1628
+ list: IAReceivedMessage[];
1629
+ timestamp: number;
1630
+ hasMore: boolean;
1631
+ }>>;
1657
1632
  /**
1658
- * 发送小视频消息
1659
- * @category 消息
1660
- * @description 发送的小视频消息必须是 MP4 文件,且音频编码为 AAC,视频编码 H264,否则可能造成 iOS 或 Android 接收后不可播放问题。
1661
- * 发送小视频消息的快捷方式,等同于使用 new SightMessage() 创建消息体后调用 sendMessage() 方法,支持小视频上传,上传成功后自动发送消息
1633
+ * 通过时间戳设置消息状态为对方已读
1634
+ * @category Electron 独有
1635
+ * @description 将自己发送的指定时间之前的消息设置为对方已读,状态值为 SentStatus.READ
1662
1636
  * @param conversation 会话信息
1663
- * @param msgBody 消息体,其中 file 为待上传小视频引用
1664
- * @param hooks 上传小视频过程中的回调钩子,类型为 {@link IUploadHooks} 可选
1665
- * @param sendOptions 小视频消息配置项,类型为 {@link ISendSightMessageOptions} 可选
1637
+ * @param timestamp 消息的发送时间,将该时间之前的消息设置为已读
1638
+ * @since 5.4.0
1666
1639
  * @example
1667
- * 发送小视频消息示例:
1640
+ * 通过时间戳设置消息状态为对方已读示例:
1668
1641
  * ```ts
1669
- * const msgBody = { file, duration: 10, thumbnail: 'base64' }; // file 为待上传小视频,duration 为小视频时长,thumbnail 为小视频封面 base64
1670
1642
  * const conversation = {
1671
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1672
- * targetId: 'targetId'
1673
- * }
1674
- * const sendRes = await RongIMLib.sendSightMessage(conversation, msgBody);
1675
- * console.info('消息发送结果:', sendRes);
1643
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1644
+ * targetId: 'targetId'
1645
+ * };
1646
+ * const timestamp = Date.now();
1647
+ * const res = await RongIMLib.electronExtension.setMessageStatusToRead(conversation, timestamp);
1648
+ * console.info('通过时间戳设置消息状态为对方已读结果:', res);
1676
1649
  * ```
1677
1650
  */
1678
- declare const sendSightMessage: (conversation: IConversationIdentifier, msgBody: ISendSightMessageOptions, hooks?: IUploadHooks | undefined, sendOptions?: IUploadMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
1651
+ declare function setMessageStatusToRead(conversation: IConversationOption, timestamp: number): Promise<RCResult<boolean>>;
1679
1652
  /**
1680
- * 获取历史消息
1681
- * @category 消息
1682
- * @description 获取历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
1683
- * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
1684
- * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
1685
- * **注意**:
1686
- * 1. Electron 获取的是本地数据库
1687
- * 2. Web 获取的是远端历史消息,Web 端不具备持久化的数据存储能力,无法在本地持久化存储历史消息记录与会话列表,因此需要从融云服务端获取数据。
1688
- * 3. 请确保已开通单群聊消息云端存储服务,如未开通服务请移步到融云开发者后台的 IM 服务管理模块开启。
1689
- * @param conversation 会话信息
1690
- * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
1691
- * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
1692
- * @example
1693
- * 获取历史消息示例:
1694
- * ```ts
1695
- * const conversation = {
1696
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1697
- * targetId: 'targetId',
1698
- * }
1699
- * const messages = await RongIMLib.getHistoryMessages(conversation);
1700
- * console.info('获取历史消息结果:', messages);
1653
+ * 设置消息的接收状态
1654
+ * @category Electron 独有
1655
+ * @param messageId 消息 ID
1656
+ * @param receivedStatus 接受状态
1657
+ * @since 5.4.0
1658
+ * @deprecated @since 5.9.3 MLib SDK 版本 ≧ 5.9.3,建议使用 {@link setMessageReceivedStatusInfo} 接口替换
1701
1659
  */
1702
- declare function getHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<RCResult<GetHistoryMessageResult>>;
1660
+ declare function setMessageReceivedStatus$1(messageId: number, receivedStatus: ReceivedStatus): Promise<RCResult>;
1703
1661
  /**
1704
- * 获取远程历史消息
1705
- * @category 消息
1706
- * @description 获取远程历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
1707
- * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
1708
- * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
1709
- * **注意**:
1710
- * 需要开启单群聊消息云存储服务后,才可以从远端拉取历史消息,服务请移步到融云开发者后台的 IM 服务管理模块开启。
1711
- *
1712
- * @param conversation 会话信息
1713
- * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
1714
- * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
1662
+ * 设置消息的接收状态
1663
+ * @category Electron 独有
1664
+ * @description 本接口仅适用 Electron 平台设置消息的接收状态,支持多状态同时设置
1665
+ * 设置对方发送的消息 自己的接受状态信息
1666
+ * @param messageId 消息 ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
1667
+ * @param receivedStatusInfo 接受状态信息,类型为 {@link IReceivedStatusInfo}
1668
+ * @since 5.9.3
1715
1669
  * @example
1716
- * 获取远程历史消息示例:
1670
+ * 设置消息的接收状态示例:
1717
1671
  * ```ts
1718
- * const conversation = {
1719
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1720
- * targetId: 'targetId',
1721
- * }
1722
- * const messages = await RongIMLib.getRemoteHistoryMessages(conversation);
1723
- * console.info('获取远程历史消息结果:', messages);
1672
+ * const messageId = 123;
1673
+ * const receivedStatusInfo = {
1674
+ * isRead: true,
1675
+ * isListened: true,
1676
+ * };
1677
+ * const res = await RongIMLib.electronExtension.setMessageReceivedStatusInfo(messageId, receivedStatusInfo);
1678
+ * console.info('设置消息的接收状态结果:', res);
1679
+ * ```
1724
1680
  */
1725
- declare function getRemoteHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<RCResult<GetHistoryMessageResult>>;
1681
+ declare function setMessageReceivedStatusInfo(messageId: number, receivedStatusInfo: IReceivedStatusInfo): Promise<RCResult>;
1726
1682
  /**
1727
- * 发送单聊已读回执
1728
- * @description 发送单聊已读回执,用于标记已读消息
1729
- * **实现已读功能步骤:**
1730
- * 1. 在用户查看了某单聊会话的未读消息后,调用 sendReadReceiptMessage 发送已读回执。
1731
- * 2. 通过 addEventListener 设置消息回执监听器。
1732
- * 3. SDK 在收到消息已读回执时派发 READ_RECEIPT_RECEIVED 事件。
1733
- *
1734
- * * **注意**:
1735
- * 1. 在 Web 平台,SDK 不会记录每个会话和消息的已读状态,您需要在 LocalStorage 中记录每个会话的已读时间。在渲染消息列表时,根据 LocalStorage 中时间判断消息是否已读,更新对应的消息界面。
1736
- * 2. 在 Electron 平台,收到 READ_RECEIPT_RECEIVED 通知时,您需要调用
1737
- * {@link electronExtension.setMessageStatusToRead} 方法更新消息已读状态,并更新对应的消息界面。
1738
- * 3. 调用 `sendReadReceiptMessage` 接口不会清除未读数,需单独调用清除未读数接口 {@link clearMessagesUnreadStatus}。
1739
- *
1740
- * @param targetId 目标 ID
1741
- * @param messageUId 消息唯一标识,可在 Message 中获取
1742
- * @param timestamp 消息的发送时间,可通过 Message 中 sendTime 获取
1743
- * @category 消息
1683
+ * 设置消息的发送状态
1684
+ * @category Electron 独有
1685
+ * @description 本接口仅适用 Electron 平台设置自己发送的消息的发送状态
1686
+ * @param messageId 消息 ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
1687
+ * @param sentStatus 消息的发送状态,类型为 {@link SentStatus}
1688
+ * @since 5.4.0
1744
1689
  * @example
1745
- * 单聊消息回执示例:
1690
+ * 设置消息的发送状态示例:
1746
1691
  * ```ts
1747
- * const targetId = 'targetId';
1748
- * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
1749
- * const timestamp = 1632728573423;
1750
- *
1751
- * const readReceiptRes = await RongIMLib.sendReadReceiptMessage(targetId, messageUId, timestamp);
1752
- * console.info('单聊消息回执:', readReceiptRes)
1692
+ * const messageId = 123;
1693
+ * const sentStatus = RongIMLib.SentStatus.SENT;
1694
+ * const res = await RongIMLib.electronExtension.setMessageSentStatus(messageId, sentStatus);
1695
+ * console.info('设置消息的发送状态结果:', res);
1753
1696
  * ```
1754
1697
  */
1755
- declare function sendReadReceiptMessage(targetId: string, messageUId: string, timestamp: number, channelId?: string): Promise<RCResult>;
1698
+ declare function setMessageSentStatus(messageId: number, sentStatus: SentStatus): Promise<RCResult>;
1756
1699
  /**
1757
- * 发送群已读回执请求
1758
- * @description 实现群聊中按需获取己方发送消息的阅读状态请求。与群聊已读回执响应接口 {@link sendReadReceiptResponseV2} 配套使用。单独调用无法实现群回执能力
1759
- *
1760
- * @category 消息
1761
- * @param targetId 目标 ID
1762
- * @param messageUIds 消息 UID 列表
1763
- *
1764
- *@example
1765
- * 群已读回执请求示例:
1700
+ * 修改消息内容
1701
+ * @category Electron 独有
1702
+ * @description 本接口仅适用 Electron 平台修改消息内容,目前仅私有云使用 RCE api 暂不对外
1703
+ * @param messageId 消息 ID
1704
+ * @param content 消息 content
1705
+ * @param messageType 消息类型
1706
+ * @since 5.4.0
1707
+ * @example
1708
+ * 修改消息内容示例:
1766
1709
  * ```ts
1767
- * const targetId = 'targetId';
1768
- * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
1769
- * const readReceiptRes = await RongIMLib.sendReadReceiptRequest(targetId, messageUId);
1770
- * console.info('群已读回执请求:', readReceiptRes)
1710
+ * const messageId = 123;
1711
+ * const content = {
1712
+ * content: 'new content',
1713
+ * };
1714
+ * const messageType = 'RC:TxtMsg';
1715
+ * const res = await RongIMLib.electronExtension.setMessageContent(messageId, content, messageType);
1716
+ * console.info('修改消息内容结果:', res);
1771
1717
  * ```
1772
1718
  */
1773
- declare function sendReadReceiptRequest(targetId: string, messageUId: string, channelId?: string): Promise<RCResult>;
1774
- /**
1775
- * @category 消息
1776
- * @deprecated 已废弃,@since 5.1.1。请替换使用 {@link sendReadReceiptResponseV2} 方法
1777
- */
1778
- declare function sendReadReceiptResponse(targetId: string, messageUIds: string[], channelId?: string): Promise<RCResult>;
1719
+ declare function setMessageContent(messageId: number, content: Object, messageType: string): Promise<RCResult>;
1779
1720
  /**
1780
- * 发送群阅读回执响应,根据导航配置开关,内部使用群已读回执 v2 或 v1 版本
1781
- * @description 实现群聊中按需获取己方发送消息的阅读状态响应。
1782
- * 与群聊已读回执请求接口 {@link sendReadReceiptRequest} 配套使用。单独调用无法实现群回执能力
1783
- * **注意**:
1784
- * 5.9.4 版本之后,SDK 内部维护了已读回执请求信息,并在历史消息列表里携带已读回执信息:readReceiptInfo, 在 Web 平台和 Electron 平台实现不同之处:
1785
- * Web 和 Electron 平台的区别:
1786
- * 1. 在 Web 平台,SDK 内部会缓存每个群会话的最新 30 个已读回执信息(以已读回执请求的发送时间为准),缓存有效期为 24H。
1787
- * 在发送消息回执响应时无需传 messageList 字段,SDK 会把该会话下的所有请求组织好然后发送响应。
1788
- *
1789
- * 2. 在 Electron 平台,用户需先获取历史消息,取出 message.messageDirection = MessageDirection.RECEIVE , readReceiptInfo.
1790
- * isReceiptRequestMessage = true 并且 readReceiptInfo.hasRespond = false 的数据组织成参数 messageList 来发送回执响应。
1791
- * @category 消息
1792
- * @param targetId 群组 Id
1793
- * @param messageList 要回执的消息列表,结构为: \{senderUserId: [messageUId1, messageUId2]\}
1794
- * @since 5.1.1
1721
+ * 通过消息 ID 列表删除本地消息
1722
+ * @category Electron 独有
1723
+ * @description 本接口仅适用 Electron 平台
1724
+ * 通过消息 ID 从本地消息数据库中删除指定的一条或一组消息数据。删除多条消息时,请确保消息 ID 均属于同一会话
1725
+ * @param messageIds 消息 ID 列表,需是同一会话的消息
1726
+ * @since 5.4.0
1795
1727
  * @example
1796
- * 群已读回执响应示例:
1728
+ * 通过消息 ID 删除消息示例:
1797
1729
  * ```ts
1798
- * const targetId = 'targetId';
1799
- * const messageList = {
1800
- * 'senderUserId': ['messageUId1', 'messageUId2'],
1801
- * }
1802
- * const readReceiptRes = await RongIMLib.sendReadReceiptResponseV2(targetId, messageList);
1803
- * console.info('群已读回执响应:', readReceiptRes);
1730
+ * const messageIds = [1, 2];
1731
+ * const res = await RongIMLib.electronExtension.deleteMessages(messageIds);
1732
+ * console.info('通过消息 ID 删除消息结果:', res);
1733
+ * ```
1804
1734
  */
1805
- declare function sendReadReceiptResponseV2(targetId: string, messageList: Record<string, string[]>, channelId?: string): Promise<RCResult>;
1735
+ declare function deleteMessages$1(messageIds: number[]): Promise<RCResult>;
1806
1736
  /**
1807
- * 多端同步阅读状态
1808
- * @description 由于未读消息数存储在本地,服务器不存未读消息数量。当用户多端登录时,需要同步未读消息数以保证多端未读数一致
1737
+ * 清空会话下历史消息
1738
+ * @category Electron 独有
1739
+ * @description 本接口仅适用 Electron 平台,从本地消息数据库中删除指定会话所有消息。
1809
1740
  * @param conversation 会话信息
1810
- * @param timestamp 需要同步消息阅读的时间戳,可以在消息体中通过消息的 sendTime 获取
1811
- * @category 消息
1741
+ * @since 5.4.0
1812
1742
  * @example
1813
- * 多端同步阅读状态示例:
1743
+ * 清空会话下历史消息示例:
1814
1744
  * ```ts
1815
1745
  * const conversation = {
1816
1746
  * conversationType: RongIMLib.ConversationType.PRIVATE,
1817
1747
  * targetId: 'targetId',
1818
- * }
1819
- * const timestamp = 1632728573423; // 阅读消息的 sendTime
1820
- * const syncReadStatusRes = await RongIMLib.sendSyncReadStatusMessage(conversation, timestamp);
1821
- * console.info('多端同步阅读状态:', syncReadStatusRes);
1748
+ * };
1749
+ * const res = await RongIMLib.electronExtension.clearMessages(conversation);
1750
+ * console.info('清空会话下历史消息结果:', res);
1822
1751
  * ```
1823
1752
  */
1824
- declare function sendSyncReadStatusMessage(conversation: IConversationIdentifier, timestamp: number): Promise<RCResult>;
1753
+ declare function clearMessages$1(conversation: IConversationOption): Promise<RCResult>;
1825
1754
  /**
1826
- * 发送已读回执(V4 版本)
1827
- *
1828
- * 调用此接口后,消息的发送者会收到 EVENTS.MESSAGE_READ_RECEIPT_V4 事件通知
1829
- *
1830
- * 调用此接口需在开发者后台开通服务
1831
- * @since 5.9.0
1832
- * @hidden
1833
- * @param conversation 会话信息,支持单聊、群聊
1834
- * @param endMsgUId 结束消息 UId
1835
- * @param startMsgUId 开始消息 UId, 仅群聊时有效
1755
+ * 通过时间戳删除指定会话本地消息
1756
+ * @category Electron 独有
1757
+ * @description 本接口仅适用 Electron 平台,根据时间戳,从本地消息数据库中删除单个会话中早于该时间戳的消息数据。
1758
+ * @param conversation 会话信息
1759
+ * @param timestamp 指定删除该时间戳之前的消息
1760
+ * @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
1761
+ * 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
1762
+ * @since 5.4.0
1836
1763
  * @example
1837
- * ```js
1838
- * const con = {
1839
- * conversationType: ConversationType.Group,
1840
- * targetId: 'targetId'
1841
- * }
1842
- * sendReadReceiptMessageV4(con, 'endMsgUId', 'startMsgUId').then(res => {
1843
- * if (res.code === ErrorCode.success) {
1844
- * console.log('send success')
1845
- * } else {
1846
- * console.log('send error', res.msg)
1847
- * }
1848
- * })
1764
+ * 通过时间戳删除示例:
1765
+ * ```ts
1766
+ * const conversation = {
1767
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1768
+ * targetId: 'targetId',
1769
+ * };
1770
+ * const timestamp = Date.now();
1771
+ * const cleanSpace = false;
1772
+ * const res = await RongIMLib.electronExtension.deleteMessagesByTimestamp(conversation, timestamp, cleanSpace);
1773
+ * console.info('通过时间戳删除结果:', res);
1849
1774
  * ```
1850
1775
  */
1851
- declare function sendReadReceiptMessageV4(conversation: IConversationOption, endMsgUId: string, startMsgUId?: string): Promise<RCResult>;
1776
+ declare function deleteMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<RCResult>;
1852
1777
  /**
1853
- * 获取消息的已读回执列表
1854
- *
1855
- * 调用此接口需在开发者后台开通服务
1778
+ * 批量清除多个会话的本地消息
1779
+ * @category Electron 独有
1780
+ * @param options 会话列表,最大数量为 20
1856
1781
  * @since 5.9.0
1782
+ * @description 从本地消息数据库中批量删除多个会话指定时间之前的消息数据,
1783
+ * 时间戳传 0 时,清除所有消息
1784
+ * 支持的会话类型:单聊,群聊,聊天室,系统消息
1857
1785
  * @hidden
1858
- * @param conversation 会话信息,仅支持群聊
1859
- * @param messageUId 消息 UId
1860
1786
  * @example
1861
- * ```js
1862
- * const con = {
1863
- * conversationType: ConversationType.Group,
1864
- * targetId: 'targetId'
1865
- * }
1866
- * getMessageReadReceiptV4(con, 'MsgUId').then(res => {
1867
- * if (res.code === ErrorCode.success) {
1868
- * console.log('send success', res.data)
1869
- * } else {
1870
- * console.log('send error', res.msg)
1871
- * }
1872
- * })
1787
+ * ```ts
1788
+ * const conversations = [{
1789
+ * conversationType: ConversationType.PRIVATE,
1790
+ * targetId: 'targetId',
1791
+ * timestamp: 0,
1792
+ * channelId: '',
1793
+ * }]
1794
+ * const res = await RongIMLib.electronExtension.batchClearMessagesByTimestamp(conversations, 0);
1795
+ * console.log('批量清除多个会话的本地消息结果:', res);
1873
1796
  * ```
1874
1797
  */
1875
- declare function getMessageReadReceiptV4(conversation: IConversationIdentifier, messageUId: string): Promise<RCResult<IMessageReadReceiptV4Response>>;
1798
+ declare function batchClearMessagesByTimestamp(options: IClearMessageOption[]): Promise<RCResult>;
1876
1799
  /**
1877
- * 获取消息的已读回执列表
1878
- *
1879
- * 调用此接口需在开发者后台开通服务
1880
- * @since 5.9.0
1881
- * @hidden
1882
- * @param conversation 会话信息,仅支持群聊
1883
- * @param messageUIds 消息 UId 列表
1884
- * @example
1885
- * ```js
1886
- * const con = {
1887
- * conversationType: ConversationType.Group,
1888
- * targetId: 'targetId'
1889
- * }
1890
- * batchGetMessageReadReceiptInfoV4(con, ['MsgUId']).then(res => {
1891
- * if (res.code === ErrorCode.success) {
1892
- * console.log('send success', res.data)
1893
- * } else {
1894
- * console.log('send error', res.msg)
1895
- * }
1896
- * })
1897
- * ```
1898
- */
1899
- declare function batchGetMessageReadReceiptInfoV4(conversation: IConversationIdentifier, messageUIds: string[]): Promise<RCResult<IGroupReadReceiptData[]>>;
1900
- /**
1901
- * 撤回消息
1902
- * @description 融云对撤回消息的操作者不作限制。
1903
- * 如需避免用户撤回非本人发送的消息,可以提交工单申请打开 IMLib SDK 只允许撤回自己发送的消息。从融云服务端进行限制,禁止用户撤回非本人发送的消息。
1904
- * @category 消息
1800
+ * 向本地插入一条消息
1801
+ * @category Electron 独有
1802
+ * @description 本接口仅适用 Electron 平台,插入消息到本地数据库,不发送到服务器
1803
+ * **注意**:插入消息时,messageUId 将不会存入数据库
1804
+ * @since 5.4.0
1905
1805
  * @param conversation 会话信息
1906
- * @param options 撤回消息参数
1806
+ * @param message 消息体,@since 5.6.1 增加支持 {@link BaseMessage} 类型
1807
+ * @param options 插入消息配置,类型为 {@link IInsertOptions}
1808
+ * @defaultValues options = {}
1907
1809
  * @example
1908
- * 撤回消息示例:
1810
+ * 插入消息示例:
1909
1811
  * ```ts
1910
1812
  * const conversation = {
1911
1813
  * conversationType: RongIMLib.ConversationType.PRIVATE,
1912
1814
  * targetId: 'targetId',
1913
- * }
1815
+ * };
1816
+ * const message = new RongIMLib.TextMessage({ content: 'hello' });
1914
1817
  * const options = {
1915
- * messageUId: 'messageUId',
1916
- * sentTime: 1632728573423,
1917
- * }
1918
- * const recallRes = await RongIMLib.recallMessage(conversation, options);
1919
- * console.info('撤回消息结果:', recallRes);
1818
+ * searchContent: 'hello',
1819
+ * };
1820
+ * const res = await RongIMLib.electronExtension.insertMessage(conversation, message, options);
1821
+ * console.info('插入消息结果:', res);
1920
1822
  * ```
1921
1823
  */
1922
- declare const recallMessage: MonitorableAPI<(conversation: IConversationOption, options: IRecallMessageOptions) => Promise<RCResult<IAReceivedMessage>>>;
1824
+ declare function insertMessage$1(conversation: IConversationOption, message: IAReceivedMessage | BaseMessage, options?: IInsertOptions): Promise<RCResult<IAReceivedMessage>>;
1923
1825
  /**
1924
- * 按消息 UId 删除远端消息
1925
- * @category 消息
1926
- * @description 根据消息的 ID、时间戳和方向(发送或接收)从服务端删除指定单个会话中的一条或一组消息。
1927
- * **注意**:
1928
- * 1. 删除消息仅会删除本端消息,不会删除对端消息。A 与 B 之间的消息,A 删除消息后,B 仍然可以看到消息。如 B 需要无法查看需要调用撤回消息 {@link recallMessage}接口。
1929
- * 2. 仅适用于 App Key 已开通单群聊消息云端存储 的 App。
1930
- * 3. 服务端默认不会删除对应的离线消息补偿,如需彻底删除消息补偿,请提交工单,申请开通删除服务端历史消息时同时删除多端补偿的离线消息。
1931
- *
1932
- * @param conversation 会话信息
1933
- * @param messages 消息列表
1826
+ * 批量向本地插入消息
1827
+ * @category Electron 独有
1828
+ * @description 本接口仅适用 Electron 平台,批量插入消息到本地数据库,不发送到服务器。
1829
+ * @since 5.7.2
1830
+ * @param messages 批量插入的消息体
1831
+ * @param checkDuplicate 选择是否排重
1832
+ */
1833
+ declare function batchInsertMessage(messages: IInsertMessage[], checkDuplicate: boolean): Promise<RCResult<boolean>>;
1834
+ /**
1835
+ * 获取会话所有消息数
1836
+ * @category Electron 独有
1837
+ * @description 本接口仅适用 Electron 平台,获取指定会话下的所有消息数
1838
+ * @param conversation
1839
+ * @since 5.7.2
1934
1840
  * @example
1935
- * 按消息 UId 删除消息示例:
1841
+ * 获取会话所有消息数示例:
1936
1842
  * ```ts
1937
1843
  * const conversation = {
1938
1844
  * conversationType: RongIMLib.ConversationType.PRIVATE,
1939
1845
  * targetId: 'targetId',
1940
1846
  * };
1941
- * const messages = [{
1942
- * messageUId: 'BS4O-P5AO-D1O6-9GPP', // 消息 UId
1943
- * sentTime: 1632728573423, // 消息发送时间
1944
- * messageDirection: RongIMLib.MessageDirection.SEND, // 消息方向
1945
- * }];
1946
- * const deleteRes = await RongIMLib.deleteMessages(conversation, messages);
1947
- * console.info('删除消息结果:', deleteRes);
1847
+ * const res = await RongIMLib.electronExtension.getMessageCount(conversation);
1848
+ * console.info('获取会话所有消息数结果:', res);
1948
1849
  * ```
1949
1850
  */
1950
- declare function deleteMessages$1(conversation: IConversationOption, messages: {
1951
- /**
1952
- * 消息 id
1953
- */
1954
- messageUId: string;
1955
- /**
1956
- * 消息发送时间
1957
- */
1958
- sentTime: number;
1959
- /**
1960
- * 消息方向
1961
- * * 1: 发送
1962
- * * 2: 接收
1963
- */
1964
- messageDirection: MessageDirection;
1965
- }[]): Promise<RCResult>;
1851
+ declare function getMessageCount(conversation: IConversationOption): Promise<RCResult<number>>;
1966
1852
  /**
1967
- * 按时间戳删除消息
1968
- * @description 根据时间戳删除指定单个会话中早于(含)指定时间戳的所有消息。
1969
- * @category 消息
1970
- * @param conversation 会话
1971
- * @param timestamp 清除时间点,该时间之前的消息将被清除
1853
+ * 设置融云消息重排开关
1854
+ * @category Electron 独有
1855
+ * @description 发送方弱网情况下发送消息,消息到达服务但发送方没有收到服务 ack,导致发送方认为消息发送失败
1856
+ * 此种情况下,服务端和接收方都会收到第一条消息
1857
+ * 此时发送方重发该消息,再次达到服务,那么此时服务端会有两条消息(消息内容相同,messageUid 不同
1858
+ * 接收方会收到两条内容相同 messageUId 不同的消息,SDK 此时会把第二条相同内容消息排重掉
1859
+ * 以此来保证重发的相同内容消息,发送方只有一条消息,接收方也只有一条消息
1972
1860
  *
1861
+ * 当消息量少时,消息排重影响不大;但是本地存在大量消息时,排重会出现性能问题
1862
+ * 当本地存在大量消息,且发生收消息卡顿时,建议将排重关闭
1863
+ *
1864
+ * @param checkDuplicate 是否使用融云消息重排机制 true: 开启,false: 关闭
1865
+ * @since 5.7.1
1973
1866
  * @example
1974
- * 按时间戳删除消息示例:
1975
- * ```ts
1976
- * const conversation = {
1977
- * conversationType: RongIMLib.ConversationType.PRIVATE,
1978
- * targetId: 'targetId',
1979
- * }
1980
- * const timestamp = 1632728573423;
1981
- * const clearRes = await RongIMLib.clearHistoryMessages(conversation, timestamp);
1982
- * console.info('清除消息结果:', clearRes);
1983
- * ```
1984
- */
1985
- declare function clearHistoryMessages(conversation: IConversationOption, timestamp: number): Promise<RCResult>;
1986
- /**
1987
- * @hidden
1988
- * 批量删除多个会话的远端消息
1989
- * @category 消息
1990
- * @description 批量删除服务端多个会话早于(含)发送时间的所有远端消息(Electron 平台可以删除对应的本地消息)
1991
- * @param conversations 会话列表,最大数量为 20
1992
- * @param isDeleteLocal 是否删除本地消息,仅 Electron 平台支持,默认为 false
1993
- * @since 5.9.0
1994
- * 时间戳,传 0 清除所有消息
1995
- * 支持的会话类型:单聊,群聊,聊天室,系统消息
1996
- * @example
1997
- * 批量删除多个会话的远端消息示例:
1998
- * ```ts
1999
- * batchClearHistoryMessages([
2000
- * {
2001
- * conversationType: ConversationType.PRIVATE,
2002
- * targetId: 'targetId',
2003
- * timestamp: 0,
2004
- * channelId: '',
2005
- * }, true]).then(res => {
2006
- * console.log(res);
2007
- * });
2008
- * ```
2009
- */
2010
- declare function batchClearRemoteHistoryMessages(clearMessageOption: IClearMessageOption[], isDeleteLocal?: boolean): Promise<RCResult>;
2011
- /**
2012
- * 更新(添加、替换)消息扩展属性
2013
- * @description 消息扩展功能可为消息增加基于 Key/Value 的状态标识。消息的扩展信息可在发送前、后设置或更新,可用于实现消息评论、礼物领取、订单状态变化等业务需求。
2014
- * **注意**:
2015
- * 1. 单条消息单次最多可设置 20 个扩展信息 KV 对,总计不可超过 300 个扩展信息 KV 对。
2016
- * 2. 消息扩展(Key、Value 扩展信息)会被存储。如已开通历史消息云存储功能,从服务端获取的历史消息也会携带已设置的扩展信息。
2017
- * 3. 仅支持单聊、群聊、超级群会话类型,不支持聊天室类型。
2018
- * 4. 仅当发送消息时指定 canIncludeExpansion 值为 true,才可对消息进行拓展。
2019
- * @category 消息
2020
- * @param expansion 要更新的消息扩展信息键值对
2021
- * @param message 要更新的原始消息体
2022
- * @example
2023
- * 更新(添加、替换)消息扩展属性示例:
1867
+ * 设置融云消息重排开关示例:
2024
1868
  * ```ts
2025
- * const expansion = { key1: 'value1' };
2026
- * // message 为 IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
2027
- * const updateRes = await RongIMLib.updateMessageExpansion(expansion, message);
2028
- * console.info('更新消息扩展属性结果:', updateRes);
1869
+ * const checkDuplicate = true;
1870
+ * const res = await RongIMLib.electronExtension.setCheckDuplicateMessage(checkDuplicate);
1871
+ * console.info('设置融云消息重排开关结果:', res);
2029
1872
  * ```
2030
1873
  */
2031
- declare function updateMessageExpansion(expansion: Record<string, string>, message: IAReceivedMessage): Promise<RCResult>;
1874
+ declare function setCheckDuplicateMessage(checkDuplicate?: boolean): Promise<RCResult<boolean>>;
2032
1875
  /**
2033
- * 删除扩展存储
2034
- * @description 删除消息扩展信息中指定的 Key
2035
- * @category 消息
2036
- * @params keys 需删除消息扩展的 keys
2037
- * @params message 原始消息体
1876
+ * 设置聊天室消息重排开关
1877
+ * @category Electron 独有
1878
+ * @description 仅支持聊天室消息重排开关,不支持其他会话类型,聊天室消息重排开关默认开启
1879
+ * 目前仅支持对 CUID 进行排重策略修改
1880
+ * @hidden 产品协商暂不对外提供
1881
+ * @since 5.9.9
2038
1882
  * @example
2039
- * 删除扩展存储示例:
1883
+ * 设置聊天室消息重排开关示例:
2040
1884
  * ```ts
2041
- * const keys = ['key1'];
2042
- * // message 为 IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
2043
- * const removeRes = await RongIMLib.removeMessageExpansionForKey(keys, message);
2044
- * console.info('删除扩展存储结果:', removeRes);
1885
+ * const checkDuplicate = true;
1886
+ * const res = await RongIMLib.electronExtension.setCheckChatRoomDuplicateMessage(checkDuplicate);
1887
+ * console.info('设置聊天室消息重排开关结果:', res);
2045
1888
  * ```
2046
1889
  */
2047
- declare function removeMessageExpansionForKey(keys: string[], message: IAReceivedMessage): Promise<RCResult>;
1890
+ declare function setCheckChatRoomDuplicateMessage(checkDuplicate?: boolean): Promise<RCResult>;
2048
1891
  /**
2049
- * 发送输入状态消息
2050
- * @description 发送输入状态消息,用于展示对方正在输入的状态
2051
- * @category 消息
1892
+ * 获取本地指定时间戳前后 N 条消息方法
1893
+ * @category Electron 独有
1894
+ * @description 本接口仅适用 Electron 平台,获取本地指定时间戳前后 N 条消息
2052
1895
  * @param conversation 会话信息
2053
- * @param typingContentType 输入状态消息类型
2054
- * @returns 返回一个 {@link RCResult} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
1896
+ * @param option 获取参数
1897
+ * @since 5.9.8
2055
1898
  * @example
2056
- * 发送输入状态消息示例:
1899
+ * 获取本地指定时间戳前后 N 条消息示例:
2057
1900
  * ```ts
2058
1901
  * const conversation = {
2059
- * conversationType: RongIMLib.ConversationType.PRIVATE,
2060
- * targetId: 'targetId',
2061
- * }
2062
- * const typingContentType = RongIMLib.MessageType.TEXT;
2063
- * const typingRes = await RongIMLib.sendTypingStatusMessage(conversation, typingContentType);
2064
- * console.info('发送 typing 消息结果:', typingRes);
1902
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
1903
+ * targetId: 'targetId',
1904
+ * };
1905
+ * const option = {
1906
+ * timestamp: 0,
1907
+ * beforeCount: 10,
1908
+ * afterCount: 10,
1909
+ * };
1910
+ * const res = await RongIMLib.electronExtension.getMessagesAroundTimestamp(conversation, option);
1911
+ * console.info('获取本地指定时间戳前后 N 条消息结果:', res);
2065
1912
  * ```
2066
1913
  */
2067
- declare function sendTypingStatusMessage(conversation: IConversationOption, typingContentType: string): Promise<RCResult<IAReceivedMessage>>;
1914
+ declare function getMessagesAroundTimestamp(conversation: IConversationOption, option: {
1915
+ timestamp: number;
1916
+ beforeCount: number;
1917
+ afterCount: number;
1918
+ }): Promise<RCResult<IAReceivedMessage[]>>;
2068
1919
  /**
2069
- * 获取群已读列表,需开通群已读回执服务 V2 版本,否则无法使用
2070
- * @category 消息
2071
- * @param targetId 群 ID
2072
- * @param messageUId 消息 UID
2073
- * @returns 返回一个 {@link RCResult} 类型 Promise,data 结构为 {@link IMessageReaderResponse} 类型
1920
+ * 获取消息
1921
+ * @category Electron 独有
1922
+ * @description 获取本地消息,通过本地消息 ID 或 messageUId 获取消息
1923
+ * @param messageId - 支持消息 messaegId 或 messageUId
1924
+ * @since v5.16.0
2074
1925
  * @example
1926
+ * 获取消息示例:
2075
1927
  * ```ts
2076
- * const messageUId = 'messageUId';
2077
- * const targetId = 'targetId';
2078
- * const getReaderRes = await RongIMLib.getMessageReader(targetId, messageUId);
2079
- * console.info('获取群已读列表结果:', getReaderRes);
1928
+ * const messageUId = 'BS4O-P5AO-D1O6-9GPP';
1929
+ * const res = await RongIMLib.electronExtension.getLocalMessage(messageUId);
1930
+ * console.info('获取消息结果:', res);
2080
1931
  * ```
2081
1932
  */
2082
- declare function getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<RCResult<IMessageReaderResponse>>;
1933
+ declare function getLocalMessage(messageId: number | string): Promise<RCResult<IAReceivedMessage>>;
2083
1934
  /**
2084
- * 注册自定义消息
2085
- * @description 注册自定义消息,用于定义自定义消息的类型,会影响消息的发送和接收
2086
- * **注意**:
2087
- * 1. 注册自定义消息代码必须在发送、接收该自定义消息之前
2088
- * 2. 推荐将所有注册自定义消息代码放在 init 方法之后,connect 方法之前
2089
- * 3. 注册的消息类型名,必须多端一致,否则消息无法互通
2090
- * 4. 请勿使用 RC: 开头的类型名,以免和 SDK 默认的消息名称冲突,自定义消息的消息类型名如和 SDK 默认的消息类型名相同以 SDK 默认的消息定义名为准
2091
- * 5. 需要再 connect 之前调用防止手消息行为异常
2092
- * @category 消息
2093
- * @param messageType 消息类型
2094
- * @param isPersited 是否存储
2095
- * @param isCounted 是否计数
2096
- * @param searchProps 可搜索的属性,web 端无需设置,搜索字段值设置为数字时取值范围为 (-Math.pow(2, 64), Math.pow(2, 64)) 且为整数
2097
- * @param isStatusMessage 是否状态消息,状态消息不计数,不存储,接收方在线时才能收到
2098
- * @returns 返回一个 {@link BaseMessage} 类型的构造函数
1935
+ * 全局搜索本地消息
1936
+ * @category Electron 独有
1937
+ * @since 5.22.0
1938
+ * @description 本接口仅适用 Electron 平台,全局搜索本地消息,支持跨会话搜索等通用场景
1939
+ * @param params 搜索参数
2099
1940
  * @example
1941
+ * 根据参数搜索消息示例:
2100
1942
  * ```ts
2101
- * const messageType = 'CustomMessage';
2102
- * const isPersited = true;
2103
- * const isCounted = true;
2104
- * const searchProps = ['content']; // 搜索字段
2105
- * const isStatusMsg = false;
2106
- * const CustomMessage = RongIMLib.registerMessageType(messageType, isPersited, isCounted, searchProps, isStatusMsg);
1943
+ * const params = {
1944
+ * keyword: 'test',
1945
+ * count: 10,
1946
+ * offset: 0,
1947
+ * order: 0,
1948
+ * range: {
1949
+ * startTime: 0,
1950
+ * endTime: 0,
1951
+ * },
1952
+ * conversationFilter: {
1953
+ * conversationTypes: [RongIMLib.ConversationType.PRIVATE, RongIMLib.ConversationType.GROUP],
1954
+ * targetIds: ['targetId1', 'targetId2'],
1955
+ * },
1956
+ * messageFilter: {
1957
+ * messageTypes: [RongIMLib.MessageType.TEXT],
1958
+ * },
1959
+ * };
1960
+ * const res = await RongIMLib.electronExtension.searchMessagesWithParams(params);
1961
+ * if (res.isOk) {
1962
+ * console.info('搜索消息结果:', res.data.messages, res.data.matchedCount);
1963
+ * } else {
1964
+ * console.error('搜索消息失败:', res.code);
1965
+ * }
2107
1966
  * ```
2108
1967
  */
2109
- declare function registerMessageType<T>(messageType: string, isPersited: boolean, isCounted: boolean, searchProps?: string[], isStatusMessage?: boolean): new (content: T) => BaseMessage<T>;
1968
+ declare function searchMessagesWithParams(params: ISearchMessageParams): Promise<RCResult<ISearchMessagesResult>>;
2110
1969
  /**
2111
- * 获取第一条未读消息
2112
- * @description 获取指定会话中的第一条未读消息,仅支持 Electron 平台
1970
+ * 设置语音转文字内容可见性
1971
+ * @param messageId 消息 ID,为本地消息 ID,非消息 UId
1972
+ * @param isVisible 是否可见
1973
+ * @since 5.22.0
1974
+ */
1975
+ declare function setMessageSpeechToTextVisible(messageId: number, isVisible: boolean): Promise<RCResult>;
1976
+ /**
1977
+ * 按时间戳清除超级群下所有子频道会话的本地消息
1978
+ * @param targetId 超级群 ID
1979
+ * @param timestamp 时间戳
1980
+ * @since 5.28.0
1981
+ */
1982
+ declare function deleteUltraGroupMessagesForAllChannel(targetId: string, timestamp: number): Promise<RCResult>;
1983
+ /**
1984
+ * 获取会话下所有未读的 @ 消息
1985
+ * @param conversation 会话信息
1986
+ * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedMessage[]} 类型的消息列表
1987
+ * @since 5.28.0
1988
+ */
1989
+ declare function getUnreadMentionedMessages$1(conversation: IConversationOption): Promise<RCResult<IAReceivedMessage[]>>;
1990
+
1991
+ /**
1992
+ * 获取本地消息
1993
+ * @deprecated 自 5.16.0 开始,该接口废弃,请使用 `electronExtension` 模块的 `getLocalMessage` 代替。
1994
+ */
1995
+ declare const getMessage: typeof getLocalMessage;
1996
+ /**
1997
+ * 发送消息
1998
+ * @description 发送消息的基础接口,可用来发送 IMLib 中的内置类型消息或自定义消息。针对不同的特定消息类型
1999
+ * @category 消息
2000
+ * @param conversation 会话信息
2001
+ * @param message 消息体,类型为 BaseMessage 的子类,如 TextMessage、ImageMessage,通过 new TextMessage() 获取
2002
+ * @param options 发送消息配置项
2003
+ *
2004
+ * @returns 返回一个 {@link RCResult} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2005
+ *
2006
+ * @example
2007
+ * 发送文本消息示例:
2008
+ * ```ts
2009
+ * const content = {content: 'hello world'};
2010
+ * const message = new RongIMLib.TextMessage(content);
2011
+ * const conversation = {
2012
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2013
+ * targetId: 'targetId'
2014
+ * }
2015
+ * const sendRes = await RongIMLib.sendMessage(conversation, message);
2016
+ * console.info('消息发送结果:', sendRes);
2017
+ * ```
2018
+ */
2019
+ declare const sendMessage: MonitorableAPI<(conversation: IConversationIdentifier, message: BaseMessage, options?: ISendMessageOptions) => Promise<RCResult<IAReceivedMessage>>>;
2020
+ /**
2021
+ * 发送文本消息
2022
+ * @description 发送文本消息的快捷方式,等同于使用 new TextMessage() 创建消息体后调用 sendMessage() 方法
2113
2023
  * @category 消息
2114
- * @param conversation
2024
+ * @param conversation 会话信息
2025
+ * @param messageBody 消息体
2026
+ * @param options 发送消息配置项
2115
2027
  * @example
2116
- * 获取第一条未读消息示例:
2028
+ * 发送文本消息示例:
2117
2029
  * ```ts
2030
+ * const messageBody = {content: 'hello world'};
2118
2031
  * const conversation = {
2119
2032
  * conversationType: RongIMLib.ConversationType.PRIVATE,
2120
- * targetId: 'targetId',
2033
+ * targetId: 'targetId'
2121
2034
  * }
2122
- * const firstUnreadRes = await RongIMLib.getFirstUnreadMessage(conversation);
2123
- * console.info('获取第一条未读消息结果:', firstUnreadRes);
2035
+ * const sendRes = await RongIMLib.sendTextMessage(conversation, messageBody);
2036
+ * console.info('消息发送结果:', sendRes);
2124
2037
  * ```
2125
2038
  */
2126
- declare function getFirstUnreadMessage(conversation: IConversationOption): Promise<RCResult<IAReceivedMessage | null>>;
2039
+ declare function sendTextMessage(conversation: IConversationOption, messageBody: ITextMessageContent, options?: ISendMessageOptions): Promise<RCResult<IAReceivedMessage>>;
2127
2040
  /**
2128
- * 获取第一条未读消息信息
2041
+ * 发送消息基础类型
2042
+ * @category Type
2043
+ */
2044
+ type ISendBody = IUserExtraKeyInMessage & IExtraDataKeyInMessage & {
2045
+ file: File;
2046
+ } & IMentionedInfoKeyInMessage & IAuditInfoKeyInMessage;
2047
+ /**
2048
+ * 发送文件消息配置项
2049
+ * @category Type
2050
+ */
2051
+ type ISendFileMessageOptions = ISendBody;
2052
+ /**
2053
+ * 发送文件消息
2054
+ * @description 发送文件消息的快捷方式,等同于使用 new FileMessage() 创建消息体后调用 sendMessage() 方法,支持文件上传,上传成功后自动发送消息
2129
2055
  * @category 消息
2130
- * @since 5.9.0
2131
2056
  * @param conversation 会话信息
2132
- * @description 获取指定会话中的第一条未读消息信息
2133
- * **注意**:
2134
- * 1. 当没有未读消息时,返回的 data 为 null
2135
- * 2. 当第一条未读消息被撤回时,此信息不会更新
2057
+ * @param msgBody 消息体,其中 file 为待上传文件引用
2058
+ * @param hooks 上传文件过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2059
+ * @param sendOptions 文件消息配置项,类型为 {@link IUploadMessageOption} 可选
2136
2060
  * @example
2137
- * 获取第一条未读消息信息示例:
2061
+ * 发送文本消息示例:
2138
2062
  * ```ts
2063
+ * const msgBody = { file }; // file 为待上传文件
2139
2064
  * const conversation = {
2140
- * conversationType: RongIMLib.ConversationType.PRIVATE,
2141
- * targetId: 'targetId',
2065
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2066
+ * targetId: 'targetId'
2142
2067
  * }
2143
- * const firstUnreadMessageInfoRes = await RongIMLib.getFirstUnreadMessageInfo(conversation);
2144
- * console.info('获取第一条未读消息信息结果:', firstUnreadMessageInfoRes);
2068
+ * const sendRes = await RongIMLib.sendFileMessage(conversation, msgBody);
2069
+ * console.info('消息发送结果:', sendRes);
2145
2070
  * ```
2146
2071
  */
2147
- declare function getFirstUnreadMessageInfo(conversation: IConversationOption): Promise<RCResult<IFirstUnreadMessageInfo | null>>;
2148
- /**
2149
- * 向本地插入一条消息,不发送到服务器
2150
- * @category 消息
2151
- * @deprecated 请使用 {@link electronExtension.insertMessage} 代替
2152
- */
2153
- declare function insertMessage$1(conversation: IConversationOption, content: IReceivedMessage, options?: IInsertOptions): Promise<RCResult<IAReceivedMessage>>;
2072
+ declare const sendFileMessage: (conversation: IConversationIdentifier, msgBody: ISendBody, hooks?: IUploadHooks, sendOptions?: IUploadMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
2154
2073
  /**
2155
- * 获取会话下所有未读的 @ 消息
2156
- * @deprecated 该方法已废弃,请使用 {@link electronExtension.getUnreadMentionedMessages} 方法
2074
+ * 发送图片消息配置项
2075
+ * @category Type
2157
2076
  */
2158
- declare function getUnreadMentionedMessages$1(_: IConversationOption): RCResult<IAReceivedMessage[]>;
2077
+ type ISendImageMessageOptions = ISendBody;
2159
2078
  /**
2160
- * 按关键字搜索会话内的消息
2079
+ * 发送图片消息
2080
+ * @description 发送图片消息的快捷方式,等同于使用 new ImageMessage() 创建消息体后调用 sendMessage() 方法,支持图片上传,上传成功后自动发送消息
2161
2081
  * @category 消息
2162
- * @deprecated 已废弃,请替换使用 {@link electronExtension.searchMessagesWithParams} 方法
2163
- */
2164
- declare function searchMessages$1(conversation: IConversationOption, keyword: string, timestamp: number, count: number): Promise<RCResult<ISearchMessagesResult>>;
2082
+ * @param conversation 会话信息
2083
+ * @param msgBody 消息体,其中 file 为待上传图片引用
2084
+ * @param hooks 上传图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2085
+ * @param sendOptions 图片消息配置项,类型为 {@link IImageMessageOption} 可选
2086
+ * @example
2087
+ * 发送图片消息示例:
2088
+ * ```ts
2089
+ * const msgBody = { file }; // file 为待上传图片
2090
+ * const conversation = {
2091
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2092
+ * targetId: 'targetId'
2093
+ * }
2094
+ * const sendRes = await RongIMLib.sendImageMessage(conversation, msgBody);
2095
+ * console.info('消息发送结果:', sendRes);
2096
+ * ```
2097
+ */
2098
+ declare const sendImageMessage: (conversation: IConversationIdentifier, msgBody: ISendBody, hooks?: IUploadHooks, sendOptions?: IImageMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
2165
2099
  /**
2166
- * 从本地消息数据库中删除某一会话指定时间之前的消息数据
2100
+ * 发送 GIF 图片消息
2101
+ * @description 发送 GIF 图片消息的快捷方式,等同于使用 new GIFMessage() 创建消息体后调用 sendMessage() 方法,支持 GIF 图片上传,上传成功后自动发送消息
2167
2102
  * @category 消息
2168
- * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.deleteMessagesByTimestamp} 方法
2103
+ * @param conversation 会话信息
2104
+ * @param msgBody 消息体,其中 file 为待上传 GIF 图片引用
2105
+ * @param hooks 上传 GIF 图片过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2106
+ * @param sendOptions GIF 图片消息配置项,类型为 {@link IGIFMessageOption} 可选
2107
+ * @example
2108
+ * 发送 GIF 图片消息示例:
2109
+ * ```ts
2110
+ * const msgBody = { file }; // file 为待上传 GIF 图片
2111
+ * const conversation = {
2112
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2113
+ * targetId: 'targetId'
2114
+ * }
2115
+ * const sendRes = await RongIMLib.sendGIFMessage(conversation, msgBody);
2116
+ * console.info('消息发送结果:', sendRes);
2117
+ * ```
2169
2118
  */
2170
- declare function deleteLocalMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<RCResult>;
2119
+ declare const sendGIFMessage: (conversation: IConversationIdentifier, msgBody: ISendBody, hooks?: IUploadHooks, sendOptions?: IUploadMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
2171
2120
  /**
2172
- * 清空会话下历史消息
2121
+ * 发送高清语音消息
2122
+ * @description 待发送的文件必须为 AAC 音频文件。
2123
+ * 发送高清语音消息的快捷方式,等同于使用 new HQVoiceMessage() 创建消息体后调用 sendMessage() 方法,支持高清语音上传,上传成功后自动发送消息
2173
2124
  * @category 消息
2174
- * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.clearMessages} 方法
2125
+ * @param conversation 会话信息
2126
+ * @param msgBody 消息体,其中 file 为待上传高清语音引用
2127
+ * @param hooks 上传高清语音过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2128
+ * @param sendOptions 高清语音消息配置项,类型为 {@link ISendHQVoiceMessageOptions} 可选
2129
+ * @example
2130
+ * 发送高清语音消息示例:
2131
+ * ```ts
2132
+ * const msgBody = { file }; // file 为待上传高清语音
2133
+ * const conversation = {
2134
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2135
+ * targetId: 'targetId'
2136
+ * }
2137
+ * const sendRes = await RongIMLib.sendHQVoiceMessage(conversation, msgBody);
2138
+ * console.info('消息发送结果:', sendRes);
2139
+ * ```
2175
2140
  */
2176
- declare function clearMessages$1(conversation: IConversationOption): Promise<RCResult>;
2141
+ declare const sendHQVoiceMessage: (conversation: IConversationIdentifier, msgBody: ISendBody, hooks?: IUploadHooks, sendOptions?: IUploadMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
2177
2142
  /**
2178
- * 按内容搜索会话
2179
- * @category 消息
2180
- * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.searchConversationByContent} 方法
2143
+ * 发送小视频消息配置项
2144
+ * @category Type
2181
2145
  */
2182
- declare function searchConversationByContent$1(keyword: string, conversationTypes?: ConversationType[], messageTypes?: string[], channelId?: string): Promise<RCResult<IAReceivedConversation[] | undefined>>;
2146
+ type ISendSightMessageOptions = {
2147
+ duration: number;
2148
+ thumbnail: string;
2149
+ name?: string;
2150
+ } & ISendBody;
2183
2151
  /**
2184
- * 清除时间戳前的未读数
2185
- * @description 清除时间戳前的未读数,仅支持 Electron 平台,不支持清理超级群会话
2152
+ * 发送小视频消息
2186
2153
  * @category 消息
2154
+ * @description 发送的小视频消息必须是 MP4 文件,且音频编码为 AAC,视频编码 H264,否则可能造成 iOS 或 Android 接收后不可播放问题。
2155
+ * 发送小视频消息的快捷方式,等同于使用 new SightMessage() 创建消息体后调用 sendMessage() 方法,支持小视频上传,上传成功后自动发送消息
2187
2156
  * @param conversation 会话信息
2188
- * @param timestamp 清理未读时间戳
2189
- *
2157
+ * @param msgBody 消息体,其中 file 为待上传小视频引用
2158
+ * @param hooks 上传小视频过程中的回调钩子,类型为 {@link IUploadHooks} 可选
2159
+ * @param sendOptions 小视频消息配置项,类型为 {@link ISendSightMessageOptions} 可选
2190
2160
  * @example
2191
- * 清除时间戳前的未读数示例:
2161
+ * 发送小视频消息示例:
2192
2162
  * ```ts
2163
+ * const msgBody = { file, duration: 10, thumbnail: 'base64' }; // file 为待上传小视频,duration 为小视频时长,thumbnail 为小视频封面 base64
2193
2164
  * const conversation = {
2194
- * conversationType: RongIMLib.ConversationType.PRIVATE,
2195
- * targetId: 'targetId',
2165
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2166
+ * targetId: 'targetId'
2196
2167
  * }
2197
- * const timestamp = 1626955200000;
2198
- * const clearRes = await RongIMLib.clearUnreadCountByTimestamp(conversation, timestamp);
2199
- * console.info('清除时间戳前的未读数结果:', clearRes);
2168
+ * const sendRes = await RongIMLib.sendSightMessage(conversation, msgBody);
2169
+ * console.info('消息发送结果:', sendRes);
2200
2170
  * ```
2201
2171
  */
2202
- declare function clearUnreadCountByTimestamp(conversation: IConversationIdentifier, timestamp: number): Promise<RCResult>;
2172
+ declare const sendSightMessage: (conversation: IConversationIdentifier, msgBody: ISendSightMessageOptions, hooks?: IUploadHooks, sendOptions?: IUploadMessageOption | undefined) => Promise<RCResult<IAReceivedMessage>>;
2203
2173
  /**
2204
- * 设置消息接收状态
2174
+ * 获取历史消息
2175
+ * @category 消息
2176
+ * @description 获取历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
2177
+ * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
2178
+ * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
2179
+ * **注意**:
2180
+ * 1. Electron 获取的是本地数据库
2181
+ * 2. Web 获取的是远端历史消息,Web 端不具备持久化的数据存储能力,无法在本地持久化存储历史消息记录与会话列表,因此需要从融云服务端获取数据。
2182
+ * 3. 请确保已开通单群聊消息云端存储服务,如未开通服务请移步到融云开发者后台的 IM 服务管理模块开启。
2183
+ * @param conversation 会话信息
2184
+ * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
2185
+ * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
2186
+ * @example
2187
+ * 获取历史消息示例:
2188
+ * ```ts
2189
+ * const conversation = {
2190
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2191
+ * targetId: 'targetId',
2192
+ * }
2193
+ * const messages = await RongIMLib.getHistoryMessages(conversation);
2194
+ * console.info('获取历史消息结果:', messages);
2195
+ */
2196
+ declare function getHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<RCResult<GetHistoryMessageResult>>;
2197
+ /**
2198
+ * 获取远程历史消息
2199
+ * @category 消息
2200
+ * @description 获取远程历史消息,支持分页加载,可指定时间戳、数量、排序方式等参数进行分页获取。
2201
+ * 1. Count 最大值为 100,超过 100 时返回错误码 34232:开发者接口调用时传入的 count 非法
2202
+ * 2. 如果 `SDK < 5.7.4`,范围为 [1-20];如果 SDK ≧ 5.7.4,范围为 [1-100]。默认值 `20`
2203
+ * **注意**:
2204
+ * 需要开启单群聊消息云存储服务后,才可以从远端拉取历史消息,服务请移步到融云开发者后台的 IM 服务管理模块开启。
2205
+ *
2206
+ * @param conversation 会话信息
2207
+ * @param options 获取历史消息配置项,类型为 {@link GetHistoryMessageOption} 可选
2208
+ * @defaultValue options = { timestamp: 0, count: 20, order: 0 }
2209
+ * @example
2210
+ * 获取远程历史消息示例:
2211
+ * ```ts
2212
+ * const conversation = {
2213
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2214
+ * targetId: 'targetId',
2215
+ * }
2216
+ * const messages = await RongIMLib.getRemoteHistoryMessages(conversation);
2217
+ * console.info('获取远程历史消息结果:', messages);
2218
+ */
2219
+ declare function getRemoteHistoryMessages(conversation: IConversationOption, options?: GetHistoryMessageOption): Promise<RCResult<GetHistoryMessageResult>>;
2220
+ /**
2221
+ * 发送单聊已读回执
2222
+ * @description 发送单聊已读回执,用于标记已读消息
2223
+ * **实现已读功能步骤:**
2224
+ * 1. 在用户查看了某单聊会话的未读消息后,调用 sendReadReceiptMessage 发送已读回执。
2225
+ * 2. 通过 addEventListener 设置消息回执监听器。
2226
+ * 3. SDK 在收到消息已读回执时派发 READ_RECEIPT_RECEIVED 事件。
2227
+ *
2228
+ * * **注意**:
2229
+ * 1. 在 Web 平台,SDK 不会记录每个会话和消息的已读状态,您需要在 LocalStorage 中记录每个会话的已读时间。在渲染消息列表时,根据 LocalStorage 中时间判断消息是否已读,更新对应的消息界面。
2230
+ * 2. 在 Electron 平台,收到 READ_RECEIPT_RECEIVED 通知时,您需要调用
2231
+ * {@link electronExtension.setMessageStatusToRead} 方法更新消息已读状态,并更新对应的消息界面。
2232
+ * 3. 调用 `sendReadReceiptMessage` 接口不会清除未读数,需单独调用清除未读数接口 {@link clearMessagesUnreadStatus}。
2233
+ *
2234
+ * @param targetId 目标 ID
2235
+ * @param messageUId 消息唯一标识,可在 Message 中获取
2236
+ * @param timestamp 消息的发送时间,可通过 Message 中 sendTime 获取
2237
+ * @category 消息
2238
+ * @example
2239
+ * 单聊消息回执示例:
2240
+ * ```ts
2241
+ * const targetId = 'targetId';
2242
+ * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
2243
+ * const timestamp = 1632728573423;
2244
+ *
2245
+ * const readReceiptRes = await RongIMLib.sendReadReceiptMessage(targetId, messageUId, timestamp);
2246
+ * console.info('单聊消息回执:', readReceiptRes)
2247
+ * ```
2248
+ */
2249
+ declare function sendReadReceiptMessage(targetId: string, messageUId: string, timestamp: number, channelId?: string): Promise<RCResult>;
2250
+ /**
2251
+ * 发送群已读回执请求
2252
+ * @description 实现群聊中按需获取己方发送消息的阅读状态请求。与群聊已读回执响应接口 {@link sendReadReceiptResponseV2} 配套使用。单独调用无法实现群回执能力
2253
+ *
2254
+ * @category 消息
2255
+ * @param targetId 目标 ID
2256
+ * @param messageUIds 消息 UID 列表
2257
+ *
2258
+ *@example
2259
+ * 群已读回执请求示例:
2260
+ * ```ts
2261
+ * const targetId = 'targetId';
2262
+ * const messageUId = 'BS4O-QEBR-VJM6-9GPP';
2263
+ * const readReceiptRes = await RongIMLib.sendReadReceiptRequest(targetId, messageUId);
2264
+ * console.info('群已读回执请求:', readReceiptRes)
2265
+ * ```
2266
+ */
2267
+ declare function sendReadReceiptRequest(targetId: string, messageUId: string, channelId?: string): Promise<RCResult>;
2268
+ /**
2269
+ * @category 消息
2270
+ * @deprecated 已废弃,@since 5.1.1。请替换使用 {@link sendReadReceiptResponseV2} 方法
2271
+ */
2272
+ declare function sendReadReceiptResponse(targetId: string, messageUIds: string[], channelId?: string): Promise<RCResult>;
2273
+ /**
2274
+ * 发送群阅读回执响应,根据导航配置开关,内部使用群已读回执 v2 或 v1 版本
2275
+ * @description 实现群聊中按需获取己方发送消息的阅读状态响应。
2276
+ * 与群聊已读回执请求接口 {@link sendReadReceiptRequest} 配套使用。单独调用无法实现群回执能力
2277
+ * **注意**:
2278
+ * 5.9.4 版本之后,SDK 内部维护了已读回执请求信息,并在历史消息列表里携带已读回执信息:readReceiptInfo, 在 Web 平台和 Electron 平台实现不同之处:
2279
+ * Web 和 Electron 平台的区别:
2280
+ * 1. 在 Web 平台,SDK 内部会缓存每个群会话的最新 30 个已读回执信息(以已读回执请求的发送时间为准),缓存有效期为 24H。
2281
+ * 在发送消息回执响应时无需传 messageList 字段,SDK 会把该会话下的所有请求组织好然后发送响应。
2282
+ *
2283
+ * 2. 在 Electron 平台,用户需先获取历史消息,取出 message.messageDirection = MessageDirection.RECEIVE , readReceiptInfo.
2284
+ * isReceiptRequestMessage = true 并且 readReceiptInfo.hasRespond = false 的数据组织成参数 messageList 来发送回执响应。
2285
+ * @category 消息
2286
+ * @param targetId 群组 Id
2287
+ * @param messageList 要回执的消息列表,结构为: \{senderUserId: [messageUId1, messageUId2]\}
2288
+ * @since 5.1.1
2289
+ * @example
2290
+ * 群已读回执响应示例:
2291
+ * ```ts
2292
+ * const targetId = 'targetId';
2293
+ * const messageList = {
2294
+ * 'senderUserId': ['messageUId1', 'messageUId2'],
2295
+ * }
2296
+ * const readReceiptRes = await RongIMLib.sendReadReceiptResponseV2(targetId, messageList);
2297
+ * console.info('群已读回执响应:', readReceiptRes);
2298
+ */
2299
+ declare function sendReadReceiptResponseV2(targetId: string, messageList: Record<string, string[]>, channelId?: string): Promise<RCResult>;
2300
+ /**
2301
+ * 多端同步阅读状态
2302
+ * @description 由于未读消息数存储在本地,服务器不存未读消息数量。当用户多端登录时,需要同步未读消息数以保证多端未读数一致
2303
+ * @param conversation 会话信息
2304
+ * @param timestamp 需要同步消息阅读的时间戳,可以在消息体中通过消息的 sendTime 获取
2305
+ * @category 消息
2306
+ * @example
2307
+ * 多端同步阅读状态示例:
2308
+ * ```ts
2309
+ * const conversation = {
2310
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2311
+ * targetId: 'targetId',
2312
+ * }
2313
+ * const timestamp = 1632728573423; // 阅读消息的 sendTime
2314
+ * const syncReadStatusRes = await RongIMLib.sendSyncReadStatusMessage(conversation, timestamp);
2315
+ * console.info('多端同步阅读状态:', syncReadStatusRes);
2316
+ * ```
2317
+ */
2318
+ declare function sendSyncReadStatusMessage(conversation: IConversationIdentifier, timestamp: number): Promise<RCResult>;
2319
+ /**
2320
+ * 发送已读回执(V4 版本)
2321
+ *
2322
+ * 调用此接口后,消息的发送者会收到 EVENTS.MESSAGE_READ_RECEIPT_V4 事件通知
2323
+ *
2324
+ * 调用此接口需在开发者后台开通服务
2325
+ * @since 5.9.0
2326
+ * @hidden
2327
+ * @param conversation 会话信息,支持单聊、群聊
2328
+ * @param endMsgUId 结束消息 UId
2329
+ * @param startMsgUId 开始消息 UId, 仅群聊时有效
2330
+ * @example
2331
+ * ```js
2332
+ * const con = {
2333
+ * conversationType: ConversationType.Group,
2334
+ * targetId: 'targetId'
2335
+ * }
2336
+ * sendReadReceiptMessageV4(con, 'endMsgUId', 'startMsgUId').then(res => {
2337
+ * if (res.code === ErrorCode.success) {
2338
+ * console.log('send success')
2339
+ * } else {
2340
+ * console.log('send error', res.msg)
2341
+ * }
2342
+ * })
2343
+ * ```
2344
+ */
2345
+ declare function sendReadReceiptMessageV4(conversation: IConversationOption, endMsgUId: string, startMsgUId?: string): Promise<RCResult>;
2346
+ /**
2347
+ * 获取消息的已读回执列表
2348
+ *
2349
+ * 调用此接口需在开发者后台开通服务
2350
+ * @since 5.9.0
2351
+ * @hidden
2352
+ * @param conversation 会话信息,仅支持群聊
2353
+ * @param messageUId 消息 UId
2354
+ * @example
2355
+ * ```js
2356
+ * const con = {
2357
+ * conversationType: ConversationType.Group,
2358
+ * targetId: 'targetId'
2359
+ * }
2360
+ * getMessageReadReceiptV4(con, 'MsgUId').then(res => {
2361
+ * if (res.code === ErrorCode.success) {
2362
+ * console.log('send success', res.data)
2363
+ * } else {
2364
+ * console.log('send error', res.msg)
2365
+ * }
2366
+ * })
2367
+ * ```
2368
+ */
2369
+ declare function getMessageReadReceiptV4(conversation: IConversationIdentifier, messageUId: string): Promise<RCResult<IMessageReadReceiptV4Response>>;
2370
+ /**
2371
+ * 获取消息的已读回执列表
2372
+ *
2373
+ * 调用此接口需在开发者后台开通服务
2374
+ * @since 5.9.0
2375
+ * @hidden
2376
+ * @param conversation 会话信息,仅支持群聊
2377
+ * @param messageUIds 消息 UId 列表
2378
+ * @example
2379
+ * ```js
2380
+ * const con = {
2381
+ * conversationType: ConversationType.Group,
2382
+ * targetId: 'targetId'
2383
+ * }
2384
+ * batchGetMessageReadReceiptInfoV4(con, ['MsgUId']).then(res => {
2385
+ * if (res.code === ErrorCode.success) {
2386
+ * console.log('send success', res.data)
2387
+ * } else {
2388
+ * console.log('send error', res.msg)
2389
+ * }
2390
+ * })
2391
+ * ```
2392
+ */
2393
+ declare function batchGetMessageReadReceiptInfoV4(conversation: IConversationIdentifier, messageUIds: string[]): Promise<RCResult<IGroupReadReceiptData[]>>;
2394
+ /**
2395
+ * 撤回消息
2396
+ * @description 融云对撤回消息的操作者不作限制。
2397
+ * 如需避免用户撤回非本人发送的消息,可以提交工单申请打开 IMLib SDK 只允许撤回自己发送的消息。从融云服务端进行限制,禁止用户撤回非本人发送的消息。
2398
+ * @category 消息
2399
+ * @param conversation 会话信息
2400
+ * @param options 撤回消息参数
2401
+ * @example
2402
+ * 撤回消息示例:
2403
+ * ```ts
2404
+ * const conversation = {
2405
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2406
+ * targetId: 'targetId',
2407
+ * }
2408
+ * const options = {
2409
+ * messageUId: 'messageUId',
2410
+ * sentTime: 1632728573423,
2411
+ * }
2412
+ * const recallRes = await RongIMLib.recallMessage(conversation, options);
2413
+ * console.info('撤回消息结果:', recallRes);
2414
+ * ```
2415
+ */
2416
+ declare const recallMessage: MonitorableAPI<(conversation: IConversationOption, options: IRecallMessageOptions) => Promise<RCResult<IAReceivedMessage>>>;
2417
+ /**
2418
+ * 按消息 UId 删除远端消息
2419
+ * @category 消息
2420
+ * @description 根据消息的 ID、时间戳和方向(发送或接收)从服务端删除指定单个会话中的一条或一组消息。
2421
+ * **注意**:
2422
+ * 1. 删除消息仅会删除本端消息,不会删除对端消息。A 与 B 之间的消息,A 删除消息后,B 仍然可以看到消息。如 B 需要无法查看需要调用撤回消息 {@link recallMessage}接口。
2423
+ * 2. 仅适用于 App Key 已开通单群聊消息云端存储 的 App。
2424
+ * 3. 服务端默认不会删除对应的离线消息补偿,如需彻底删除消息补偿,请提交工单,申请开通删除服务端历史消息时同时删除多端补偿的离线消息。
2425
+ *
2426
+ * @param conversation 会话信息
2427
+ * @param messages 消息列表
2428
+ * @example
2429
+ * 按消息 UId 删除消息示例:
2430
+ * ```ts
2431
+ * const conversation = {
2432
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2433
+ * targetId: 'targetId',
2434
+ * };
2435
+ * const messages = [{
2436
+ * messageUId: 'BS4O-P5AO-D1O6-9GPP', // 消息 UId
2437
+ * sentTime: 1632728573423, // 消息发送时间
2438
+ * messageDirection: RongIMLib.MessageDirection.SEND, // 消息方向
2439
+ * }];
2440
+ * const deleteRes = await RongIMLib.deleteMessages(conversation, messages);
2441
+ * console.info('删除消息结果:', deleteRes);
2442
+ * ```
2443
+ */
2444
+ declare function deleteMessages(conversation: IConversationOption, messages: {
2445
+ /**
2446
+ * 消息 id
2447
+ */
2448
+ messageUId: string;
2449
+ /**
2450
+ * 消息发送时间
2451
+ */
2452
+ sentTime: number;
2453
+ /**
2454
+ * 消息方向
2455
+ * * 1: 发送
2456
+ * * 2: 接收
2457
+ */
2458
+ messageDirection: MessageDirection;
2459
+ }[]): Promise<RCResult>;
2460
+ /**
2461
+ * 按时间戳删除消息
2462
+ * @description 根据时间戳删除指定单个会话中早于(含)指定时间戳的所有消息。
2463
+ * @category 消息
2464
+ * @param conversation 会话
2465
+ * @param timestamp 清除时间点,该时间之前的消息将被清除
2466
+ *
2467
+ * @example
2468
+ * 按时间戳删除消息示例:
2469
+ * ```ts
2470
+ * const conversation = {
2471
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2472
+ * targetId: 'targetId',
2473
+ * }
2474
+ * const timestamp = 1632728573423;
2475
+ * const clearRes = await RongIMLib.clearHistoryMessages(conversation, timestamp);
2476
+ * console.info('清除消息结果:', clearRes);
2477
+ * ```
2478
+ */
2479
+ declare function clearHistoryMessages(conversation: IConversationOption, timestamp: number): Promise<RCResult>;
2480
+ /**
2481
+ * @hidden
2482
+ * 批量删除多个会话的远端消息
2483
+ * @category 消息
2484
+ * @description 批量删除服务端多个会话早于(含)发送时间的所有远端消息(Electron 平台可以删除对应的本地消息)
2485
+ * @param conversations 会话列表,最大数量为 20
2486
+ * @param isDeleteLocal 是否删除本地消息,仅 Electron 平台支持,默认为 false
2487
+ * @since 5.9.0
2488
+ * 时间戳,传 0 清除所有消息
2489
+ * 支持的会话类型:单聊,群聊,聊天室,系统消息
2490
+ * @example
2491
+ * 批量删除多个会话的远端消息示例:
2492
+ * ```ts
2493
+ * batchClearHistoryMessages([
2494
+ * {
2495
+ * conversationType: ConversationType.PRIVATE,
2496
+ * targetId: 'targetId',
2497
+ * timestamp: 0,
2498
+ * channelId: '',
2499
+ * }, true]).then(res => {
2500
+ * console.log(res);
2501
+ * });
2502
+ * ```
2503
+ */
2504
+ declare function batchClearRemoteHistoryMessages(clearMessageOption: IClearMessageOption[], isDeleteLocal?: boolean): Promise<RCResult>;
2505
+ /**
2506
+ * 更新(添加、替换)消息扩展属性
2507
+ * @description 消息扩展功能可为消息增加基于 Key/Value 的状态标识。消息的扩展信息可在发送前、后设置或更新,可用于实现消息评论、礼物领取、订单状态变化等业务需求。
2508
+ * **注意**:
2509
+ * 1. 单条消息单次最多可设置 20 个扩展信息 KV 对,总计不可超过 300 个扩展信息 KV 对。
2510
+ * 2. 消息扩展(Key、Value 扩展信息)会被存储。如已开通历史消息云存储功能,从服务端获取的历史消息也会携带已设置的扩展信息。
2511
+ * 3. 仅支持单聊、群聊、超级群会话类型,不支持聊天室类型。
2512
+ * 4. 仅当发送消息时指定 canIncludeExpansion 值为 true,才可对消息进行拓展。
2513
+ * @category 消息
2514
+ * @param expansion 要更新的消息扩展信息键值对
2515
+ * @param message 要更新的原始消息体
2516
+ * @example
2517
+ * 更新(添加、替换)消息扩展属性示例:
2518
+ * ```ts
2519
+ * const expansion = { key1: 'value1' };
2520
+ * // message 为 IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
2521
+ * const updateRes = await RongIMLib.updateMessageExpansion(expansion, message);
2522
+ * console.info('更新消息扩展属性结果:', updateRes);
2523
+ * ```
2524
+ */
2525
+ declare function updateMessageExpansion(expansion: Record<string, string>, message: IAReceivedMessage): Promise<RCResult>;
2526
+ /**
2527
+ * 删除扩展存储
2528
+ * @description 删除消息扩展信息中指定的 Key
2529
+ * @category 消息
2530
+ * @params keys 需删除消息扩展的 keys
2531
+ * @params message 原始消息体
2532
+ * @example
2533
+ * 删除扩展存储示例:
2534
+ * ```ts
2535
+ * const keys = ['key1'];
2536
+ * // message 为 IAReceivedMessage 类型消息体,此处不做具体示例,可在消息监听或者获取历史消息接口获取需要操作的 message
2537
+ * const removeRes = await RongIMLib.removeMessageExpansionForKey(keys, message);
2538
+ * console.info('删除扩展存储结果:', removeRes);
2539
+ * ```
2540
+ */
2541
+ declare function removeMessageExpansionForKey(keys: string[], message: IAReceivedMessage): Promise<RCResult>;
2542
+ /**
2543
+ * 发送输入状态消息
2544
+ * @description 发送输入状态消息,用于展示对方正在输入的状态
2545
+ * @category 消息
2546
+ * @param conversation 会话信息
2547
+ * @param typingContentType 输入状态消息类型
2548
+ * @returns 返回一个 {@link RCResult} 类型 Promise,data 结构为 {@link IAReceivedMessage} 类型
2549
+ * @example
2550
+ * 发送输入状态消息示例:
2551
+ * ```ts
2552
+ * const conversation = {
2553
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2554
+ * targetId: 'targetId',
2555
+ * }
2556
+ * const typingContentType = RongIMLib.MessageType.TEXT;
2557
+ * const typingRes = await RongIMLib.sendTypingStatusMessage(conversation, typingContentType);
2558
+ * console.info('发送 typing 消息结果:', typingRes);
2559
+ * ```
2560
+ */
2561
+ declare function sendTypingStatusMessage(conversation: IConversationOption, typingContentType: string): Promise<RCResult<IAReceivedMessage>>;
2562
+ /**
2563
+ * 获取群已读列表,需开通群已读回执服务 V2 版本,否则无法使用
2564
+ * @category 消息
2565
+ * @param targetId 群 ID
2566
+ * @param messageUId 消息 UID
2567
+ * @returns 返回一个 {@link RCResult} 类型 Promise,data 结构为 {@link IMessageReaderResponse} 类型
2568
+ * @example
2569
+ * ```ts
2570
+ * const messageUId = 'messageUId';
2571
+ * const targetId = 'targetId';
2572
+ * const getReaderRes = await RongIMLib.getMessageReader(targetId, messageUId);
2573
+ * console.info('获取群已读列表结果:', getReaderRes);
2574
+ * ```
2575
+ */
2576
+ declare function getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<RCResult<IMessageReaderResponse>>;
2577
+ /**
2578
+ * 注册自定义消息
2579
+ * @description 注册自定义消息,用于定义自定义消息的类型,会影响消息的发送和接收
2580
+ * **注意**:
2581
+ * 1. 注册自定义消息代码必须在发送、接收该自定义消息之前
2582
+ * 2. 推荐将所有注册自定义消息代码放在 init 方法之后,connect 方法之前
2583
+ * 3. 注册的消息类型名,必须多端一致,否则消息无法互通
2584
+ * 4. 请勿使用 RC: 开头的类型名,以免和 SDK 默认的消息名称冲突,自定义消息的消息类型名如和 SDK 默认的消息类型名相同以 SDK 默认的消息定义名为准
2585
+ * 5. 需要再 connect 之前调用防止手消息行为异常
2586
+ * @category 消息
2587
+ * @param messageType 消息类型
2588
+ * @param isPersited 是否存储
2589
+ * @param isCounted 是否计数
2590
+ * @param searchProps 可搜索的属性,web 端无需设置,搜索字段值设置为数字时取值范围为 (-Math.pow(2, 64), Math.pow(2, 64)) 且为整数
2591
+ * @param isStatusMessage 是否状态消息,状态消息不计数,不存储,接收方在线时才能收到
2592
+ * @returns 返回一个 {@link BaseMessage} 类型的构造函数
2593
+ * @example
2594
+ * ```ts
2595
+ * const messageType = 'CustomMessage';
2596
+ * const isPersited = true;
2597
+ * const isCounted = true;
2598
+ * const searchProps = ['content']; // 搜索字段
2599
+ * const isStatusMsg = false;
2600
+ * const CustomMessage = RongIMLib.registerMessageType(messageType, isPersited, isCounted, searchProps, isStatusMsg);
2601
+ * ```
2602
+ */
2603
+ declare function registerMessageType<T>(messageType: string, isPersited: boolean, isCounted: boolean, searchProps?: string[], isStatusMessage?: boolean): new (content: T) => BaseMessage<T>;
2604
+ /**
2605
+ * 获取第一条未读消息
2606
+ * @description 获取指定会话中的第一条未读消息,仅支持 Electron 平台
2607
+ * @category 消息
2608
+ * @param conversation
2609
+ * @example
2610
+ * 获取第一条未读消息示例:
2611
+ * ```ts
2612
+ * const conversation = {
2613
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2614
+ * targetId: 'targetId',
2615
+ * }
2616
+ * const firstUnreadRes = await RongIMLib.getFirstUnreadMessage(conversation);
2617
+ * console.info('获取第一条未读消息结果:', firstUnreadRes);
2618
+ * ```
2619
+ */
2620
+ declare function getFirstUnreadMessage(conversation: IConversationOption): Promise<RCResult<IAReceivedMessage | null>>;
2621
+ /**
2622
+ * 获取第一条未读消息信息
2623
+ * @category 消息
2624
+ * @since 5.9.0
2625
+ * @param conversation 会话信息
2626
+ * @description 获取指定会话中的第一条未读消息信息
2627
+ * **注意**:
2628
+ * 1. 当没有未读消息时,返回的 data 为 null
2629
+ * 2. 当第一条未读消息被撤回时,此信息不会更新
2630
+ * @example
2631
+ * 获取第一条未读消息信息示例:
2632
+ * ```ts
2633
+ * const conversation = {
2634
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2635
+ * targetId: 'targetId',
2636
+ * }
2637
+ * const firstUnreadMessageInfoRes = await RongIMLib.getFirstUnreadMessageInfo(conversation);
2638
+ * console.info('获取第一条未读消息信息结果:', firstUnreadMessageInfoRes);
2639
+ * ```
2640
+ */
2641
+ declare function getFirstUnreadMessageInfo(conversation: IConversationOption): Promise<RCResult<IFirstUnreadMessageInfo | null>>;
2642
+ /**
2643
+ * 向本地插入一条消息,不发送到服务器
2644
+ * @category 消息
2645
+ * @deprecated 请使用 {@link electronExtension.insertMessage} 代替
2646
+ */
2647
+ declare function insertMessage(conversation: IConversationOption, content: IReceivedMessage, options?: IInsertOptions): Promise<RCResult<IAReceivedMessage>>;
2648
+ /**
2649
+ * 获取会话下所有未读的 @ 消息
2650
+ * @deprecated 该方法已废弃,请使用 {@link electronExtension.getUnreadMentionedMessages} 方法
2651
+ */
2652
+ declare function getUnreadMentionedMessages(_: IConversationOption): RCResult<IAReceivedMessage[]>;
2653
+ /**
2654
+ * 按关键字搜索会话内的消息
2655
+ * @category 消息
2656
+ * @deprecated 已废弃,请替换使用 {@link electronExtension.searchMessagesWithParams} 方法
2657
+ */
2658
+ declare function searchMessages(conversation: IConversationOption, keyword: string, timestamp: number, count: number): Promise<RCResult<ISearchMessagesResult>>;
2659
+ /**
2660
+ * 从本地消息数据库中删除某一会话指定时间之前的消息数据
2661
+ * @category 消息
2662
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.deleteMessagesByTimestamp} 方法
2663
+ */
2664
+ declare function deleteLocalMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<RCResult>;
2665
+ /**
2666
+ * 清空会话下历史消息
2667
+ * @category 消息
2668
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.clearMessages} 方法
2669
+ */
2670
+ declare function clearMessages(conversation: IConversationOption): Promise<RCResult>;
2671
+ /**
2672
+ * 按内容搜索会话
2673
+ * @category 消息
2674
+ * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.searchConversationByContent} 方法
2675
+ */
2676
+ declare function searchConversationByContent$1(keyword: string, conversationTypes?: ConversationType[], messageTypes?: string[], channelId?: string): Promise<RCResult<IAReceivedConversation[] | undefined>>;
2677
+ /**
2678
+ * 清除时间戳前的未读数
2679
+ * @description 清除时间戳前的未读数,仅支持 Electron 平台,不支持清理超级群会话
2680
+ * @category 消息
2681
+ * @param conversation 会话信息
2682
+ * @param timestamp 清理未读时间戳
2683
+ *
2684
+ * @example
2685
+ * 清除时间戳前的未读数示例:
2686
+ * ```ts
2687
+ * const conversation = {
2688
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
2689
+ * targetId: 'targetId',
2690
+ * }
2691
+ * const timestamp = 1626955200000;
2692
+ * const clearRes = await RongIMLib.clearUnreadCountByTimestamp(conversation, timestamp);
2693
+ * console.info('清除时间戳前的未读数结果:', clearRes);
2694
+ * ```
2695
+ */
2696
+ declare function clearUnreadCountByTimestamp(conversation: IConversationIdentifier, timestamp: number): Promise<RCResult>;
2697
+ /**
2698
+ * 设置消息接收状态
2205
2699
  * @category 消息
2206
2700
  * @deprecated 已废弃,@since 5.4.0。请替换使用 {@link electronExtension.setMessageReceivedStatusInfo} 方法
2207
2701
  */
2208
- declare function setMessageReceivedStatus$1(messageId: number, receivedStatus: number): Promise<RCResult>;
2702
+ declare function setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<RCResult>;
2209
2703
  /**
2210
2704
  * 请求流式消息内容;请求成功后,数据将通过 `Events.STREAM_MESSAGE_RESPONSE` 事件通知
2211
2705
  * @param messageUId
@@ -2384,6 +2878,16 @@ interface IGetMessagesByUIdsParams {
2384
2878
  * ```
2385
2879
  */
2386
2880
  declare function getMessagesByUIds(params: IGetMessagesByUIdsParams): Promise<RCResult<IMessageResult[]>>;
2881
+ /**
2882
+ * 获取指定会话在时间范围内的消息数量明细,仅支持 Electron 平台。
2883
+ * 仅支持单聊、群聊、超级群和系统会话。
2884
+ * 按查询时系统时区划分自然日,最多查询 180 个自然日,结果按日期从新到旧排列。
2885
+ * 频道 ID 按传入值精确匹配,空字符串不会转换为默认频道。
2886
+ * @param identifier 会话标识
2887
+ * @param options 查询时间范围,单位为毫秒
2888
+ * @returns 消息数量明细,Web 平台返回 {@link ErrorCode.NOT_SUPPORT}。
2889
+ */
2890
+ declare function getMessageCountDetail(identifier: IConversationIdentifier, options: IMessageCountDetailOptions): Promise<RCResult<Array<IMessageCountDetail>>>;
2387
2891
 
2388
2892
  /**
2389
2893
  * 创建标签
@@ -2551,921 +3055,423 @@ declare function removeTagFromConversations(tagId: string, conversations: IConve
2551
3055
  * @example 分页获取标签下会话列表示例:
2552
3056
  * ```ts
2553
3057
  * const tagId = 'tagId';
2554
- * const count = 10;
2555
- * const timestamp = 0;
2556
- * const res = await RongIMLib.getConversationsFromTagByPage(tagId, count, timestamp);
2557
- * console.log('分页获取标签下会话列表结果:', res);
2558
- * ```
2559
- */
2560
- declare function getConversationsFromTagByPage(tagId: string, count: number, startTime: number): Promise<RCResult<IAReceivedConversationByTag[]>>;
2561
- /**
2562
- * 根据标签获取未读消息数
2563
- * @category 标签
2564
- * @param tagId 标签 id
2565
- * @param containMuted 是否包含免打扰
2566
- * @example 根据标签获取未读消息数示例:
2567
- * ```ts
2568
- * const tagId = 'tagId';
2569
- * const containMuted = false;
2570
- * const res = await RongIMLib.getUnreadCountByTag(tagId, containMuted);
2571
- * console.log('根据标签获取未读消息数结果:', res);
2572
- * ```
2573
- */
2574
- declare function getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<RCResult<number>>;
2575
- /**
2576
- * 设置标签中会话置顶
2577
- * @description 设置在指定标签下置顶的会话。如果根据标签获取会话,可在获取的会话中可以看到该属性。请注意与会话列表中的会话置顶相区分
2578
- * @category 标签
2579
- * @param tagId 标签 id
2580
- * @param conversation 会话
2581
- * @param status 状态
2582
- * @example 设置标签中会话置顶示例:
2583
- * ```ts
2584
- * const tagId = 'tagId';
2585
- * const conversation = {
2586
- * conversationType: RongIMLib.ConversationType.PRIVATE,
2587
- * targetId: 'targetId',
2588
- * };
2589
- * const isTop = true;
2590
- * const res = await RongIMLib.setConversationToTopInTag(tagId, conversation, isTop);
2591
- * console.log('设置标签中会话置顶结果:', res);
2592
- * ```
2593
- */
2594
- declare function setConversationToTopInTag(tagId: string, conversation: IConversationOption, isTop: boolean): Promise<RCResult>;
2595
-
2596
- /**
2597
- * @deprecated - 已废弃,请使用 `ICombineMessageContent` 替代
2598
- * @category Interface
2599
- */
2600
- declare type ICombineMessageBody = ICombineMessageContent;
2601
-
2602
- /**
2603
- * 合并转发消息类型
2604
- */
2605
- declare class CombineMessage extends BuiltinMessage<ICombineMessageContent> {
2606
- constructor(content: ICombineMessageContent);
2607
- }
2608
-
2609
- /**
2610
- * 合并转发消息 v2 版本 Content 结构
2611
- * @category Type
2612
- * @hidden
2613
- * @deprecated - 已废弃,请使用 `ICombineV2MessageContent` 替代
2614
- */
2615
- declare type CombineV2MessageContent = ICombineV2MessageContent;
2616
-
2617
- /**
2618
- * 合并转发消息 v2 版本
2619
- * @since 5.22.0
2620
- */
2621
- declare class CombineV2Message extends BuiltinMessage<ICombineV2MessageContent> {
2622
- constructor(content: ICombineV2MessageContent);
2623
- }
2624
-
2625
- /**
2626
- * 命令消息
2627
- * @category Interface
2628
- * @deprecated - 已废弃,请使用 `ICommandMessageContent` 替代
2629
- */
2630
- declare type ICommandMessageBody = ICommandMessageContent;
2631
-
2632
- /**
2633
- * 命令消息类型
2634
- */
2635
- declare class CommandMessage extends BuiltinMessage<ICommandMessageContent> {
2636
- constructor(content: ICommandMessageContent);
2637
- }
2638
-
2639
- /**
2640
- * 文件消息
2641
- * @category Interface
2642
- * @deprecated - 已废弃,请使用 `IFileMessageContent` 替代
2643
- */
2644
- declare type IFileMessageBody = IFileMessageContent;
2645
-
2646
- declare class FileMessage extends BuiltinMessage<IFileMessageContent> {
2647
- constructor(content: IFileMessageContent);
2648
- }
2649
-
2650
- /**
2651
- * @category Interface
2652
- * @deprecated - 已废弃,请使用 `IGIFMessageContent` 替代
2653
- */
2654
- declare type IGIFMessageBody = IGIFMessageContent;
2655
-
2656
- declare class GIFMessage extends BuiltinMessage<IGIFMessageContent> {
2657
- constructor(content: IGIFMessageContent);
2658
- }
2659
-
2660
- /**
2661
- * 群组通知消息
2662
- * @category Interface
2663
- * @deprecated - 已废弃,请使用 `IGroupNotificationMessageContent` 替代
2664
- */
2665
- declare type IGroupNotificationMessageBody = IGroupNotificationMessageContent;
2666
-
2667
- declare class GroupNotificationMessage extends BuiltinMessage<IGroupNotificationMessageContent> {
2668
- constructor(content: IGroupNotificationMessageContent);
2669
- }
2670
-
2671
- /**
2672
- * 图片消息
2673
- * @category Interface
2674
- * @deprecated - 已废弃,请使用 `IImageMessageContent` 替代
2675
- */
2676
- declare type IImageMessageBody = IImageMessageContent;
2677
-
2678
- declare class ImageMessage extends BuiltinMessage<IImageMessageContent> {
2679
- constructor(content: IImageMessageContent);
2680
- }
2681
-
2682
- /**
2683
- * 小灰条消息
2684
- * @category Interface
2685
- * @deprecated - 已废弃,请使用 `IInformationNotificationMessageContent` 替代
3058
+ * const count = 10;
3059
+ * const timestamp = 0;
3060
+ * const res = await RongIMLib.getConversationsFromTagByPage(tagId, count, timestamp);
3061
+ * console.log('分页获取标签下会话列表结果:', res);
3062
+ * ```
2686
3063
  */
2687
- declare type IInformationNotificationMessageBody = IInformationNotificationMessageContent;
2688
-
2689
- declare class InformationNotificationMessage extends BuiltinMessage<IInformationNotificationMessageContent> {
2690
- constructor(content: IInformationNotificationMessageContent);
2691
- }
2692
-
3064
+ declare function getConversationsFromTagByPage(tagId: string, count: number, startTime: number): Promise<RCResult<IAReceivedConversationByTag[]>>;
2693
3065
  /**
2694
- * 位置消息数据
2695
- * @category Interface
2696
- * @deprecated - 已废弃,请使用 `ILocationMessageContent` 替代
3066
+ * 根据标签获取未读消息数
3067
+ * @category 标签
3068
+ * @param tagId 标签 id
3069
+ * @param containMuted 是否包含免打扰
3070
+ * @example 根据标签获取未读消息数示例:
3071
+ * ```ts
3072
+ * const tagId = 'tagId';
3073
+ * const containMuted = false;
3074
+ * const res = await RongIMLib.getUnreadCountByTag(tagId, containMuted);
3075
+ * console.log('根据标签获取未读消息数结果:', res);
3076
+ * ```
2697
3077
  */
2698
- declare type ILocationMessageBody = ILocationMessageContent;
2699
-
3078
+ declare function getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<RCResult<number>>;
2700
3079
  /**
2701
- * 位置消息
3080
+ * 设置标签中会话置顶
3081
+ * @description 设置在指定标签下置顶的会话。如果根据标签获取会话,可在获取的会话中可以看到该属性。请注意与会话列表中的会话置顶相区分
3082
+ * @category 标签
3083
+ * @param tagId 标签 id
3084
+ * @param conversation 会话
3085
+ * @param status 状态
3086
+ * @example 设置标签中会话置顶示例:
3087
+ * ```ts
3088
+ * const tagId = 'tagId';
3089
+ * const conversation = {
3090
+ * conversationType: RongIMLib.ConversationType.PRIVATE,
3091
+ * targetId: 'targetId',
3092
+ * };
3093
+ * const isTop = true;
3094
+ * const res = await RongIMLib.setConversationToTopInTag(tagId, conversation, isTop);
3095
+ * console.log('设置标签中会话置顶结果:', res);
3096
+ * ```
2702
3097
  */
2703
- declare class LocationMessage extends BuiltinMessage<ILocationMessageContent> {
2704
- constructor(content: ILocationMessageContent);
2705
- }
3098
+ declare function setConversationToTopInTag(tagId: string, conversation: IConversationOption, isTop: boolean): Promise<RCResult>;
2706
3099
 
2707
3100
  /**
2708
- * 引用消息
3101
+ * @deprecated - 已废弃,请使用 `ICombineMessageContent` 替代
2709
3102
  * @category Interface
2710
- * @deprecated - 已废弃,请使用 `IReferenceMessageContent` 替代
2711
3103
  */
2712
- declare type IReferenceMessageBody = IReferenceMessageContent;
2713
-
2714
- declare class ReferenceMessage extends BuiltinMessage<IReferenceMessageContent> {
2715
- constructor(content: IReferenceMessageContent);
2716
- }
3104
+ type ICombineMessageBody = ICombineMessageContent;
2717
3105
 
2718
3106
  /**
2719
- * 富文本消息
2720
- * @category Interface
2721
- * @deprecated - 已废弃,请使用 `IRichContentMessageContent` 替代
3107
+ * 合并转发消息类型
2722
3108
  */
2723
- declare type IRichContentMessageBody = IRichContentMessageContent;
2724
-
2725
- declare class RichContentMessage extends BuiltinMessage<IRichContentMessageContent> {
2726
- constructor(content: IRichContentMessageContent);
3109
+ declare class CombineMessage extends BuiltinMessage<ICombineMessageContent> {
3110
+ constructor(content: ICombineMessageContent);
2727
3111
  }
2728
3112
 
2729
3113
  /**
2730
- * 短视频消息 content 数据
2731
- * @deprecated - 已废弃,请使用 `ISightMessageContent` 替代
2732
- * @category Interface
3114
+ * 合并转发消息 v2 版本 Content 结构
3115
+ * @category Type
3116
+ * @hidden
3117
+ * @deprecated - 已废弃,请使用 `ICombineV2MessageContent` 替代
2733
3118
  */
2734
- declare type ISightMessageBody = ISightMessageContent;
3119
+ type CombineV2MessageContent = ICombineV2MessageContent;
2735
3120
 
2736
3121
  /**
2737
- * 短视频消息
3122
+ * 合并转发消息 v2 版本
3123
+ * @since 5.22.0
2738
3124
  */
2739
- declare class SightMessage extends BuiltinMessage<ISightMessageBody> {
2740
- constructor(content: ISightMessageBody);
3125
+ declare class CombineV2Message extends BuiltinMessage<ICombineV2MessageContent> {
3126
+ constructor(content: ICombineV2MessageContent);
2741
3127
  }
2742
3128
 
2743
3129
  /**
2744
- * 流式消息内容结构
3130
+ * 命令消息
2745
3131
  * @category Interface
2746
- * @deprecated - 已废弃,请使用 `IStreamMessageContent` 替代
3132
+ * @deprecated - 已废弃,请使用 `ICommandMessageContent` 替代
2747
3133
  */
2748
- declare type IStreamMessageBody = IStreamMessageContent;
3134
+ type ICommandMessageBody = ICommandMessageContent;
2749
3135
 
2750
3136
  /**
2751
- * 文本消息 content 数据
2752
- * @deprecated - 已废弃,请使用 `ITextMessageContent` 替代
2753
- * @category Interface
3137
+ * 命令消息类型
2754
3138
  */
2755
- declare type ITextMessageBody = ITextMessageContent;
2756
-
2757
- declare class TextMessage extends BuiltinMessage<ITextMessageContent> {
2758
- constructor(content: ITextMessageContent);
3139
+ declare class CommandMessage extends BuiltinMessage<ICommandMessageContent> {
3140
+ constructor(content: ICommandMessageContent);
2759
3141
  }
2760
3142
 
2761
3143
  /**
2762
- * 高清语音消息 content 数据
2763
- * @category Interface
2764
- * @deprecated - 已废弃,使用 IHQVoiceMessageContent 代替
2765
- */
2766
- declare type IHQVoiceMessageBody = IHQVoiceMessageContent;
2767
- /**
2768
- * 高清语音消息类型
2769
- */
2770
- declare class HQVoiceMessage extends BuiltinMessage<IHQVoiceMessageContent> {
2771
- constructor(content: IHQVoiceMessageContent);
2772
- }
2773
- /**
2774
- * 语音消息 content 数据
3144
+ * 文件消息
2775
3145
  * @category Interface
2776
- * @deprecated - 已废弃,使用 IVoiceMessageContent 代替
2777
- */
2778
- declare type IVoiceMessageBody = IVoiceMessageContent;
2779
- declare class VoiceMessage extends BuiltinMessage<IVoiceMessageContent> {
2780
- constructor(content: IVoiceMessageContent);
2781
- }
2782
-
2783
- /**
2784
- * 创建文件上传任务
2785
- * @param uploadInfo
2786
- * @hidden
2787
- * @returns
2788
- */
2789
- declare function createUploadTask(uploadInfo: IUploadInfo): Promise<RCResult<UploadTask>>;
2790
- /**
2791
- * 停止文件上传任务
2792
- * @hidden
2793
- * @param taskId
2794
- * @returns
2795
- */
2796
- declare function stopUploadTask(taskId: number): Promise<RCResult<boolean>>;
2797
- /**
2798
- * 上传文件
2799
- * @hidden
2800
- */
2801
- declare function upload(uploadInfo: IUploadInfo): Promise<RCResult<IUploadResult>>;
2802
- /**
2803
- * 获取文件 token
2804
- * @description 上传文件时,获取文件 token
2805
- * @hidden
2806
- * @param fileType 上传类型,通过 RongIMLib.FILE_TYPE 获取
2807
- * @param fileName 上传文件名,Server 通过文件名生成百度上传认证,若不传 engine 自动生成
2808
- * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
2809
- * @param queryString STC 分段上传时的查询字符串
2810
- * `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
2811
- * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploads`,filename 为空
2812
- * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`,
2813
- * filename 为第一个步骤生成的 filename
2814
- * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`,filename 为第一个步骤生成的 filename
2815
- */
2816
- declare function getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<RCResult<IUploadAuth & {
2817
- qiniu: string;
2818
- ossConfig: string;
2819
- }>>;
2820
- /**
2821
- * 获取私有云下载鉴权信息
2822
- * @hidden
2823
- * @description
2824
- * 接口返回值中:
2825
- * * 应将 token 作为第一优先检查条件,当其有值时,拼接 `url?token=${token}` 进行下载
2826
- * * 当 !token 时,检查 downloadAuthInfo 数据:
2827
- * 1. (!downloadAuthInfo || downloadAuthInfo.type === 0):直接使用原始 url 下载
2828
- * 2. (downloadAuthInfo.type === 1):使用 downloadAuthInfo.url 进行下载
2829
- * 3. (downloadAuthInfo.type === 2):需要将 downloadAuthInfo.authParams 写入 Http 请求的 headers 中完成鉴权
2830
- * @param url 文件 URL 地址
2831
- * @description 通过文件 URL 地址获取下载鉴权信息,用于下载文件时的鉴权
2832
- * token: 存储鉴权 token,作为第一优先级检查
2833
- * downloadAuthInfo: RCX 升级后,公有云私有化部署的下载鉴权信息
2834
- */
2835
- declare function getDownloadAuth(url: string): Promise<RCResult<{
2836
- deadline: number;
2837
- token?: string;
2838
- downloadAuthInfo?: IDownloadAuth;
2839
- }>>;
2840
- /**
2841
- * 获取文件的下载地址
2842
- * @hidden
2843
- * @param fileType 文件类型
2844
- * @param fileName 文件名
2845
- * @param saveName 下载后的存储文件名
2846
- * @param _ 已废弃
2847
- * @param serverType 使用的存储服务标识
2848
- * @returns
3146
+ * @deprecated - 已废弃,请使用 `IFileMessageContent` 替代
2849
3147
  */
2850
- declare function getFileUrl(fileType: FileType, filename: string, saveName?: string, _?: {
2851
- isBosRes: boolean;
2852
- downloadUrl: string;
2853
- }, serverType?: UploadMethod): Promise<RCResult<{
2854
- downloadUrl: string;
2855
- }>>;
3148
+ type IFileMessageBody = IFileMessageContent;
3149
+
3150
+ declare class FileMessage extends BuiltinMessage<IFileMessageContent> {
3151
+ constructor(content: IFileMessageContent);
3152
+ }
2856
3153
 
2857
3154
  /**
2858
- * 获取全部会话列表
2859
- * @category Electron 独有
2860
- */
2861
- declare function getAllConversationList$1(channelId?: string): Promise<RCResult<IAReceivedConversation[]>>;
2862
- /**
2863
- * 分页获取本地会话列表
2864
- * @category Electron 独有
2865
- * @description 本接口仅适用 Electron 平台分页获取本地会话列表,
2866
- * * **注意**:不包含超级群会话
2867
- * @param startTime 获取会话起始时间,需要精确到毫秒,0 表示当前时间
2868
- * @param count 分页数量
2869
- * @param channelId 组织 ID,不传将获取所有组织所有会话;传入组织 ID 将分页获取组织下的会话列表
2870
- * @param topPriority 是否置顶优先
2871
- * @defaultValue topPriority false
2872
- * @since 5.4.0
2873
- * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
2874
- * @example
2875
- * 分页获取本地会话列表示例:
2876
- * ```ts
2877
- * const startTime = 0;
2878
- * const count = 10;
2879
- * const conversationList = await RongIMLib.electronExtension.getConversationList(startTime, count);
2880
- * console.log('分页获取本地会话列表结果:', conversationList);
2881
- * ```
2882
- */
2883
- declare function getConversationList$1(startTime: number, count: number, channelId?: string, topPriority?: boolean): Promise<RCResult<IAReceivedConversation[]>>;
2884
- /**
2885
- * 搜索本地会话列表
2886
- * @category Electron 独有
2887
- * @description
2888
- * * 本接口仅适用 Electron 平台搜索本地会话列表
2889
- * * 5.20.0 版本开始,该接口支持按会话类型搜索
2890
- *
2891
- * * **注意**:
2892
- * 1. 不包含超级群会话
2893
- * 2. 支持查询自定义消息类型,需要再注册自定义消息时设置搜索字段,否则无法搜索,详细请查看 {@link registerMessageType} 的 searchProps 参数
2894
- * @param keyword 搜索关键字
2895
- * @param messageTypes 消息类型
2896
- * @param channelId 频道 ID,不传则获取全部频道 ID 类型
2897
- * @param conversationTypes 会话类型,默认查询全部会话类型
2898
- * @since 5.4.0
2899
- * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
2900
- * @example
2901
- * 搜索本地会话列表示例:
2902
- * ```ts
2903
- * const keyword = 'keyword';
2904
- * const messageTypes = [RongIMLib.MessageType.TEXT];
2905
- * const conversationList = await RongIMLib.electronExtension.searchConversationByContent(keyword, messageTypes);
2906
- * console.log('搜索本地会话列表结果:', conversationList);
2907
- * ```
2908
- */
2909
- declare function searchConversationByContent(keyword: string, messageTypes: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<RCResult<IAReceivedConversation[]>>;
2910
- /**
2911
- * 批量获取会话列表
2912
- * @category Electron 独有
2913
- * @description 本接口仅适用 Electron 平台批量获取会话列表,通过提供会话的唯一标标识属性返回 {@link IReceivedConversation} 类型的会话信息
2914
- * @since 5.9.9
2915
- * @param conversations 需要获取会话的信息,一次最多获取 100 个会话
2916
- * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
2917
- * @example
2918
- * 批量获取会话列表示例:
2919
- * ```ts
2920
- * const conversations = [{ conversationType: RongIMLib.ConversationType.PRIVATE, targetId: 'targetId' }];
2921
- * const conversationList = await RongIMLib.electronExtension.getConversations(conversations);
2922
- * console.log('批量获取会话列表结果:', conversationList);
2923
- * ```
2924
- */
2925
- declare function getConversations(conversations: IConversationIdentifier[]): Promise<RCResult<IAReceivedConversation[]>>;
2926
- /**
2927
- * 分页获取未标记的会话列表
2928
- * @param timestamp 获取会话起始时间,需要精确到毫秒,0 表示当前时间
2929
- * @param count 获取会话数量,有效值 [1, 100],当值小于 1 时,取值 20;当值大于 100 时取 100;
2930
- * @param topPriority 是否置顶优先,默认 false
2931
- * @since 5.24.0
2932
- * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3155
+ * @category Interface
3156
+ * @deprecated - 已废弃,请使用 `IGIFMessageContent` 替代
2933
3157
  */
2934
- declare function getUntaggedConversationListByPage(timestamp: number, count: number, topPriority: boolean): Promise<RCResult<IAReceivedConversation[]>>;
3158
+ type IGIFMessageBody = IGIFMessageContent;
3159
+
3160
+ declare class GIFMessage extends BuiltinMessage<IGIFMessageContent> {
3161
+ constructor(content: IGIFMessageContent);
3162
+ }
3163
+
2935
3164
  /**
2936
- * 同步服务器会话列表至本地数据库,同步完成后,SDK 将通知 `Events.CONVERSATIONS_SYNCED` 事件。
2937
- * 该接口需要开通“同步服务端会话信息到本地”,且未开启“SDK 自动拉取服务端会话”功能时才能使用,否则将返回错误码。
2938
- * @category Electron 独有
2939
- * @since 5.26.2
3165
+ * 群组通知消息
3166
+ * @category Interface
3167
+ * @deprecated - 已废弃,请使用 `IGroupNotificationMessageContent` 替代
2940
3168
  */
2941
- declare function getRemoteConversations(): Promise<RCResult>;
3169
+ type IGroupNotificationMessageBody = IGroupNotificationMessageContent;
3170
+
3171
+ declare class GroupNotificationMessage extends BuiltinMessage<IGroupNotificationMessageContent> {
3172
+ constructor(content: IGroupNotificationMessageContent);
3173
+ }
3174
+
2942
3175
  /**
2943
- * Save conversation message edit draft, only one draft can be saved for the same conversation.
2944
- * @category Electron Only
2945
- * @param draft Draft content
2946
- * @param conversation Conversation information
2947
- * @since 5.28.0
3176
+ * 图片消息
3177
+ * @category Interface
3178
+ * @deprecated - 已废弃,请使用 `IImageMessageContent` 替代
2948
3179
  */
3180
+ type IImageMessageBody = IImageMessageContent;
3181
+
3182
+ declare class ImageMessage extends BuiltinMessage<IImageMessageContent> {
3183
+ constructor(content: IImageMessageContent);
3184
+ }
3185
+
2949
3186
  /**
2950
- * 保存会话消息编辑草稿,同一会话只能保存一条草稿
2951
- * @category Electron 独有
2952
- * @param draft 草稿
2953
- * @param identifier 会话
2954
- * @since 5.28.0
3187
+ * 小灰条消息
3188
+ * @category Interface
3189
+ * @deprecated - 已废弃,请使用 `IInformationNotificationMessageContent` 替代
2955
3190
  */
2956
- declare function saveEditedMessageDraft(draft: IEditedMessageDraft, identifier: IConversationIdentifier): Promise<RCResult>;
3191
+ type IInformationNotificationMessageBody = IInformationNotificationMessageContent;
3192
+
3193
+ declare class InformationNotificationMessage extends BuiltinMessage<IInformationNotificationMessageContent> {
3194
+ constructor(content: IInformationNotificationMessageContent);
3195
+ }
3196
+
2957
3197
  /**
2958
- * 获取会话消息编辑草稿,若没有草稿则返回 null
2959
- * @category Electron 独有
2960
- * @param conversation 会话
2961
- * @since 5.28.0
3198
+ * 位置消息数据
3199
+ * @category Interface
3200
+ * @deprecated - 已废弃,请使用 `ILocationMessageContent` 替代
2962
3201
  */
2963
- declare function getEditedMessageDraft(conversation: IConversationIdentifier): Promise<RCResult<IEditedMessageDraft | null>>;
3202
+ type ILocationMessageBody = ILocationMessageContent;
3203
+
2964
3204
  /**
2965
- * 清除会话消息编辑草稿
2966
- * @category Electron 独有
2967
- * @param conversation 会话
2968
- * @since 5.28.0
3205
+ * 位置消息
2969
3206
  */
2970
- declare function clearEditedMessageDraft(conversation: IConversationIdentifier): Promise<RCResult>;
3207
+ declare class LocationMessage extends BuiltinMessage<ILocationMessageContent> {
3208
+ constructor(content: ILocationMessageContent);
3209
+ }
2971
3210
 
2972
3211
  /**
2973
- * 根据关键字搜索本地消息
2974
- * @deprecated 已废弃。请替换使用 {@link searchMessagesWithParams} 方法
2975
- * @category Electron 独有
2976
- * @description 本接口仅适用 Electron 平台搜索本地消息
2977
- * **注意**:
2978
- * 1. 文本类型消息只支持搜索 content,文件类型消息只支持搜索 name
2979
- * 2. 自定义消息根据 registerMessageType 的 searchProps 参数决定
2980
- * 3. 引用消息不支持搜索
2981
- * 4. 如果不传 channelId,则在所有 channelId 中搜索消息
2982
- * 5. 如果不传 messageTypes,则搜索所有支持搜索的消息类型
2983
- * @since 5.4.0
2984
- * @param conversation 会话信息
2985
- * @param keyword 搜索关键字
2986
- * @param startTime 搜索时间,搜索该时间之前的消息
2987
- * @param count 获取的数量
2988
- * @param messageTypes 消息类型,@since 5.9.8 开始支持按照消息类型搜索,支持范围:文本(RC:TxtMsg)、文件(RC:FileMsg)、设置 {@link searchProps} 的自定义消息
2989
- * @example
2990
- * 根据关键字搜索本地消息示例:
2991
- * ```ts
2992
- * const conversation = {
2993
- * conversationType: RongIMLib.ConversationType.PRIVATE,
2994
- * targetId: 'targetId',
2995
- * };
2996
- * const keyword = 'keyword';
2997
- * const startTime = Date.now();
2998
- * const count = 10;
2999
- * const res = await RongIMLib.electronExtension.searchMessages(conversation, keyword, startTime, count);
3000
- * console.info('根据关键字搜索本地消息结果:', res);
3001
- * ```
3212
+ * 引用消息
3213
+ * @category Interface
3214
+ * @deprecated - 已废弃,请使用 `IReferenceMessageContent` 替代
3002
3215
  */
3003
- declare function searchMessages(conversation: IConversationOption, keyword: string, startTime: number, count: number, messageTypes?: string[]): Promise<RCResult<ISearchMessagesResult>>;
3216
+ type IReferenceMessageBody = IReferenceMessageContent;
3217
+
3218
+ declare class ReferenceMessage extends BuiltinMessage<IReferenceMessageContent> {
3219
+ constructor(content: IReferenceMessageContent);
3220
+ }
3221
+
3004
3222
  /**
3005
- * 在指定时间范围内搜索本地消息
3006
- * @category Electron 独有
3007
- * @description 本接口仅适用 Electron 平台搜索本地消息
3008
- * @since 5.4.0
3009
- * @param conversation 会话信息
3010
- * @param option 搜索参数,类型为 {@link ISearchMessageInTimeRangeOption}
3011
- * @example
3012
- * 在指定时间范围内搜索本地消息示例:
3013
- * ```ts
3014
- * const conversation = {
3015
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3016
- * targetId: 'targetId'
3017
- * }
3018
- * const option = {
3019
- * keyword: 'keyword',
3020
- * startTime: 0,
3021
- * endTime: 1632728573423,
3022
- * }
3023
- * const res = await RongIMLib.electronExtension.searchMessageInTimeRange(conversation, option)
3024
- * console.info('在指定时间范围内搜索本地消息结果:', res);
3025
- * ```
3223
+ * 富文本消息
3224
+ * @category Interface
3225
+ * @deprecated - 已废弃,请使用 `IRichContentMessageContent` 替代
3026
3226
  */
3027
- declare function searchMessageInTimeRange(conversation: IConversationOption, option: ISearchMessageInTimeRangeOption): Promise<RCResult<ISearchMessagesResult>>;
3227
+ type IRichContentMessageBody = IRichContentMessageContent;
3228
+
3229
+ declare class RichContentMessage extends BuiltinMessage<IRichContentMessageContent> {
3230
+ constructor(content: IRichContentMessageContent);
3231
+ }
3232
+
3028
3233
  /**
3029
- * 根据用户 ID 搜索本地消息
3030
- * @category Electron 独有
3031
- * @description 本接口仅适用 Electron 平台在指定会话的所有频道中根据用户 ID 搜索时间范围内的消息
3032
- * @param conversation 会话信息
3033
- * @param count 获取的数量
3034
- * @param startTime 搜索时间,搜索时间之前的消息
3035
- * @param userId 用户 ID
3036
- * @since 5.7.10
3037
- * @example
3038
- * 根据用户 ID 搜索本地消息示例:
3039
- * ```ts
3040
- * const conversation = {
3041
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3042
- * targetId: 'targetId'
3043
- * };
3044
- * const userId = 'userId';
3045
- * const startTime = Date.now();
3046
- * const count = 10;
3047
- * const res = await RongIMLib.electronExtension.searchMessagesByUser(conversation, userId, startTime, count);
3048
- * console.info('根据用户 ID 搜索本地消息', res);
3049
- * ```
3234
+ * 短视频消息 content 数据
3235
+ * @deprecated - 已废弃,请使用 `ISightMessageContent` 替代
3236
+ * @category Interface
3050
3237
  */
3051
- declare function searchMessagesByUser(conversation: IConversationOption, userId: string, startTime: number, count: number): Promise<RCResult<Pick<ISearchMessagesResult, 'messages'>>>;
3238
+ type ISightMessageBody = ISightMessageContent;
3239
+
3052
3240
  /**
3053
- * 获取会话中指定类型的消息
3054
- * @category Electron 独有
3055
- * @description 本接口仅适用 Electron 平台获取会话中指定类型的消息
3056
- * @param conversation 会话信息
3057
- * @param option 配置参数,类型为 {@link IGetHistoryMessagesByTypesOption}
3058
- * @since 5.4.0
3059
- * @example
3060
- * 获取会话中指定类型的消息示例:
3061
- * ```ts
3062
- * const conversation = {
3063
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3064
- * targetId: 'targetId'
3065
- * };
3066
- * const options = { messageTypes: [RongIMLib.MessageType.TEXT] };
3067
- * const res = await RongIMLib.electronExtension.getHistoryMessagesByMessageTypes(conversation, option);
3068
- * console.info('获取会话中指定类型的消息结果:', res);
3069
- * ```
3241
+ * 短视频消息
3070
3242
  */
3071
- declare function getHistoryMessagesByMessageTypes(conversation: IConversationOption, option: IGetHistoryMessagesByTypesOption): Promise<RCResult<{
3072
- /**
3073
- * @deprecated 字段已废弃即将删除,推荐使用 list
3074
- */
3075
- messages: IAReceivedMessage[];
3076
- } & GetHistoryMessageResult>>;
3243
+ declare class SightMessage extends BuiltinMessage<ISightMessageBody> {
3244
+ constructor(content: ISightMessageBody);
3245
+ }
3246
+
3077
3247
  /**
3078
- * 获取本地与远端历史消息
3079
- * @category Electron 独有
3080
- * @description 本接口仅适用 Electron 平台且需要业务层开启 `单群聊云存储服务`
3081
- * 方法与 {@link getRemoteHistoryMessages} 的区别是 getContinuousMessages 会先查询指定会话存储本地数据库的消息,
3082
- * 当本地消息无法满足查询条件时,再查询在单群聊消息云端存储中的历史消息,以返回连续且相邻的消息对象列表
3083
- * **注意**:
3084
- * 1. 分页获取时,下次传的时间戳必须使用 getContinuousMessages 接口返回的 timestamp
3085
- * 2. 获取历史消息逻辑:优先获取本地数据历史消息,本地获取不到再获取远端历史消息,但是该情况可能会因为离线或者补偿消息存储天数影响,出现消息断档现象
3086
- * 3. 该功能不适用于超级群会话。
3087
- * 消息断档现象:因为离线或者补偿消息存储天数影响,存储在本地数据库中消息存在不连续或者说中间某段时间消息丢失
3088
- * 比如离线消息和补偿消息都为 1 天,第一天 A 给 B 发送 1, 2, 3,第二天 A 给 B 发送 4, 5, 6,
3089
- * B 第二天再登入,由于离线消息和补偿消息都为 1 天,所以 B 只能收到 4, 5, 6。1, 2, 3 消息丢失
3090
- * 3. option 中的 Count 字段仅支持 1-100 范围
3091
- * @param conversation 会话信息
3092
- * @param option 参数配置,类型为 {@link GetHistoryMessageOption}
3093
- * @since 5.9.6
3094
- * @example
3095
- * 获取本地与远端历史消息示例:
3096
- * ```ts
3097
- * const conversation = {
3098
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3099
- * targetId: 'targetId'
3100
- * };
3101
- * const options = { timestamp: 0, count: 20, order: 0 };
3102
- * const res = await RongIMLib.electronExtension.getContinuousMessages(conversation, option);
3103
- * console.info('获取本地与远端历史消息结果:', res);
3104
- * ```
3248
+ * 流式消息内容结构
3249
+ * @category Interface
3250
+ * @deprecated - 已废弃,请使用 `IStreamMessageContent` 替代
3105
3251
  */
3106
- declare function getContinuousMessages(conversation: IConversationOption, options: GetHistoryMessageOption): Promise<RCResult<{
3107
- list: IAReceivedMessage[];
3108
- timestamp: number;
3109
- hasMore: boolean;
3110
- }>>;
3252
+ type IStreamMessageBody = IStreamMessageContent;
3253
+
3111
3254
  /**
3112
- * 通过时间戳设置消息状态为对方已读
3113
- * @category Electron 独有
3114
- * @description 将自己发送的指定时间之前的消息设置为对方已读,状态值为 SentStatus.READ
3115
- * @param conversation 会话信息
3116
- * @param timestamp 消息的发送时间,将该时间之前的消息设置为已读
3117
- * @since 5.4.0
3118
- * @example
3119
- * 通过时间戳设置消息状态为对方已读示例:
3120
- * ```ts
3121
- * const conversation = {
3122
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3123
- * targetId: 'targetId'
3124
- * };
3125
- * const timestamp = Date.now();
3126
- * const res = await RongIMLib.electronExtension.setMessageStatusToRead(conversation, timestamp);
3127
- * console.info('通过时间戳设置消息状态为对方已读结果:', res);
3128
- * ```
3255
+ * 文本消息 content 数据
3256
+ * @deprecated - 已废弃,请使用 `ITextMessageContent` 替代
3257
+ * @category Interface
3129
3258
  */
3130
- declare function setMessageStatusToRead(conversation: IConversationOption, timestamp: number): Promise<RCResult<boolean>>;
3259
+ type ITextMessageBody = ITextMessageContent;
3260
+
3261
+ declare class TextMessage extends BuiltinMessage<ITextMessageContent> {
3262
+ constructor(content: ITextMessageContent);
3263
+ }
3264
+
3131
3265
  /**
3132
- * 设置消息的接收状态
3133
- * @category Electron 独有
3134
- * @param messageId 消息 ID
3135
- * @param receivedStatus 接受状态
3136
- * @since 5.4.0
3137
- * @deprecated @since 5.9.3 MLib SDK 版本 ≧ 5.9.3,建议使用 {@link setMessageReceivedStatusInfo} 接口替换
3266
+ * 高清语音消息 content 数据
3267
+ * @category Interface
3268
+ * @deprecated - 已废弃,使用 IHQVoiceMessageContent 代替
3138
3269
  */
3139
- declare function setMessageReceivedStatus(messageId: number, receivedStatus: ReceivedStatus): Promise<RCResult>;
3270
+ type IHQVoiceMessageBody = IHQVoiceMessageContent;
3140
3271
  /**
3141
- * 设置消息的接收状态
3142
- * @category Electron 独有
3143
- * @description 本接口仅适用 Electron 平台设置消息的接收状态,支持多状态同时设置
3144
- * 设置对方发送的消息 自己的接受状态信息
3145
- * @param messageId 消息 ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
3146
- * @param receivedStatusInfo 接受状态信息,类型为 {@link IReceivedStatusInfo}
3147
- * @since 5.9.3
3148
- * @example
3149
- * 设置消息的接收状态示例:
3150
- * ```ts
3151
- * const messageId = 123;
3152
- * const receivedStatusInfo = {
3153
- * isRead: true,
3154
- * isListened: true,
3155
- * };
3156
- * const res = await RongIMLib.electronExtension.setMessageReceivedStatusInfo(messageId, receivedStatusInfo);
3157
- * console.info('设置消息的接收状态结果:', res);
3158
- * ```
3272
+ * 高清语音消息类型
3159
3273
  */
3160
- declare function setMessageReceivedStatusInfo(messageId: number, receivedStatusInfo: IReceivedStatusInfo): Promise<RCResult>;
3274
+ declare class HQVoiceMessage extends BuiltinMessage<IHQVoiceMessageContent> {
3275
+ constructor(content: IHQVoiceMessageContent);
3276
+ }
3161
3277
  /**
3162
- * 设置消息的发送状态
3163
- * @category Electron 独有
3164
- * @description 本接口仅适用 Electron 平台设置自己发送的消息的发送状态
3165
- * @param messageId 消息 ID,注意:需要传递的参数为 number 类型的 messageId 而非 string 类型的 messageUId
3166
- * @param sentStatus 消息的发送状态,类型为 {@link SentStatus}
3167
- * @since 5.4.0
3168
- * @example
3169
- * 设置消息的发送状态示例:
3170
- * ```ts
3171
- * const messageId = 123;
3172
- * const sentStatus = RongIMLib.SentStatus.SENT;
3173
- * const res = await RongIMLib.electronExtension.setMessageSentStatus(messageId, sentStatus);
3174
- * console.info('设置消息的发送状态结果:', res);
3175
- * ```
3278
+ * 语音消息 content 数据
3279
+ * @category Interface
3280
+ * @deprecated - 已废弃,使用 IVoiceMessageContent 代替
3176
3281
  */
3177
- declare function setMessageSentStatus(messageId: number, sentStatus: SentStatus): Promise<RCResult>;
3282
+ type IVoiceMessageBody = IVoiceMessageContent;
3283
+ declare class VoiceMessage extends BuiltinMessage<IVoiceMessageContent> {
3284
+ constructor(content: IVoiceMessageContent);
3285
+ }
3286
+
3178
3287
  /**
3179
- * 修改消息内容
3180
- * @category Electron 独有
3181
- * @description 本接口仅适用 Electron 平台修改消息内容,目前仅私有云使用 RCE api 暂不对外
3182
- * @param messageId 消息 ID
3183
- * @param content 消息 content
3184
- * @param messageType 消息类型
3185
- * @since 5.4.0
3186
- * @example
3187
- * 修改消息内容示例:
3188
- * ```ts
3189
- * const messageId = 123;
3190
- * const content = {
3191
- * content: 'new content',
3192
- * };
3193
- * const messageType = 'RC:TxtMsg';
3194
- * const res = await RongIMLib.electronExtension.setMessageContent(messageId, content, messageType);
3195
- * console.info('修改消息内容结果:', res);
3196
- * ```
3288
+ * 创建文件上传任务
3289
+ * @param uploadInfo
3290
+ * @hidden
3291
+ * @returns
3197
3292
  */
3198
- declare function setMessageContent(messageId: number, content: Object, messageType: string): Promise<RCResult>;
3293
+ declare function createUploadTask(uploadInfo: IUploadInfo): Promise<RCResult<UploadTask>>;
3199
3294
  /**
3200
- * 通过消息 ID 列表删除本地消息
3201
- * @category Electron 独有
3202
- * @description 本接口仅适用 Electron 平台
3203
- * 通过消息 ID 从本地消息数据库中删除指定的一条或一组消息数据。删除多条消息时,请确保消息 ID 均属于同一会话
3204
- * @param messageIds 消息 ID 列表,需是同一会话的消息
3205
- * @since 5.4.0
3206
- * @example
3207
- * 通过消息 ID 删除消息示例:
3208
- * ```ts
3209
- * const messageIds = [1, 2];
3210
- * const res = await RongIMLib.electronExtension.deleteMessages(messageIds);
3211
- * console.info('通过消息 ID 删除消息结果:', res);
3212
- * ```
3295
+ * 停止文件上传任务
3296
+ * @hidden
3297
+ * @param taskId
3298
+ * @returns
3213
3299
  */
3214
- declare function deleteMessages(messageIds: number[]): Promise<RCResult>;
3300
+ declare function stopUploadTask(taskId: number): Promise<RCResult<boolean>>;
3215
3301
  /**
3216
- * 清空会话下历史消息
3217
- * @category Electron 独有
3218
- * @description 本接口仅适用 Electron 平台,从本地消息数据库中删除指定会话所有消息。
3219
- * @param conversation 会话信息
3220
- * @since 5.4.0
3221
- * @example
3222
- * 清空会话下历史消息示例:
3223
- * ```ts
3224
- * const conversation = {
3225
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3226
- * targetId: 'targetId',
3227
- * };
3228
- * const res = await RongIMLib.electronExtension.clearMessages(conversation);
3229
- * console.info('清空会话下历史消息结果:', res);
3230
- * ```
3302
+ * 上传文件
3303
+ * @hidden
3231
3304
  */
3232
- declare function clearMessages(conversation: IConversationOption): Promise<RCResult>;
3305
+ declare function upload(uploadInfo: IUploadInfo): Promise<RCResult<IUploadResult>>;
3233
3306
  /**
3234
- * 通过时间戳删除指定会话本地消息
3235
- * @category Electron 独有
3236
- * @description 本接口仅适用 Electron 平台,根据时间戳,从本地消息数据库中删除单个会话中早于该时间戳的消息数据。
3237
- * @param conversation 会话信息
3238
- * @param timestamp 指定删除该时间戳之前的消息
3239
- * @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
3240
- * 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
3241
- * @since 5.4.0
3242
- * @example
3243
- * 通过时间戳删除示例:
3244
- * ```ts
3245
- * const conversation = {
3246
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3247
- * targetId: 'targetId',
3248
- * };
3249
- * const timestamp = Date.now();
3250
- * const cleanSpace = false;
3251
- * const res = await RongIMLib.electronExtension.deleteMessagesByTimestamp(conversation, timestamp, cleanSpace);
3252
- * console.info('通过时间戳删除结果:', res);
3253
- * ```
3307
+ * 获取文件 token
3308
+ * @description 上传文件时,获取文件 token
3309
+ * @hidden
3310
+ * @param fileType 上传类型,通过 RongIMLib.FILE_TYPE 获取
3311
+ * @param fileName 上传文件名,Server 通过文件名生成百度上传认证,若不传 engine 自动生成
3312
+ * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
3313
+ * @param queryString STC 分段上传时的查询字符串
3314
+ * `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
3315
+ * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploads`,filename 为空
3316
+ * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`,
3317
+ * filename 为第一个步骤生成的 filename
3318
+ * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`,filename 为第一个步骤生成的 filename
3254
3319
  */
3255
- declare function deleteMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<RCResult>;
3320
+ declare function getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<RCResult<IUploadAuth & {
3321
+ qiniu: string;
3322
+ ossConfig: string;
3323
+ }>>;
3256
3324
  /**
3257
- * 批量清除多个会话的本地消息
3258
- * @category Electron 独有
3259
- * @param options 会话列表,最大数量为 20
3260
- * @since 5.9.0
3261
- * @description 从本地消息数据库中批量删除多个会话指定时间之前的消息数据,
3262
- * 时间戳传 0 时,清除所有消息
3263
- * 支持的会话类型:单聊,群聊,聊天室,系统消息
3325
+ * 获取私有云下载鉴权信息
3264
3326
  * @hidden
3265
- * @example
3266
- * ```ts
3267
- * const conversations = [{
3268
- * conversationType: ConversationType.PRIVATE,
3269
- * targetId: 'targetId',
3270
- * timestamp: 0,
3271
- * channelId: '',
3272
- * }]
3273
- * const res = await RongIMLib.electronExtension.batchClearMessagesByTimestamp(conversations, 0);
3274
- * console.log('批量清除多个会话的本地消息结果:', res);
3275
- * ```
3327
+ * @description
3328
+ * 接口返回值中:
3329
+ * * 应将 token 作为第一优先检查条件,当其有值时,拼接 `url?token=${token}` 进行下载
3330
+ * * 当 !token 时,检查 downloadAuthInfo 数据:
3331
+ * 1. (!downloadAuthInfo || downloadAuthInfo.type === 0):直接使用原始 url 下载
3332
+ * 2. (downloadAuthInfo.type === 1):使用 downloadAuthInfo.url 进行下载
3333
+ * 3. (downloadAuthInfo.type === 2):需要将 downloadAuthInfo.authParams 写入 Http 请求的 headers 中完成鉴权
3334
+ * @param url 文件 URL 地址
3335
+ * @description 通过文件 URL 地址获取下载鉴权信息,用于下载文件时的鉴权
3336
+ * token: 存储鉴权 token,作为第一优先级检查
3337
+ * downloadAuthInfo: RCX 升级后,公有云私有化部署的下载鉴权信息
3276
3338
  */
3277
- declare function batchClearMessagesByTimestamp(options: IClearMessageOption[]): Promise<RCResult>;
3339
+ declare function getDownloadAuth(url: string): Promise<RCResult<{
3340
+ deadline: number;
3341
+ token?: string;
3342
+ downloadAuthInfo?: IDownloadAuth;
3343
+ }>>;
3278
3344
  /**
3279
- * 向本地插入一条消息
3280
- * @category Electron 独有
3281
- * @description 本接口仅适用 Electron 平台,插入消息到本地数据库,不发送到服务器
3282
- * **注意**:插入消息时,messageUId 将不会存入数据库
3283
- * @since 5.4.0
3284
- * @param conversation 会话信息
3285
- * @param message 消息体,@since 5.6.1 增加支持 {@link BaseMessage} 类型
3286
- * @param options 插入消息配置,类型为 {@link IInsertOptions}
3287
- * @defaultValues options = {}
3288
- * @example
3289
- * 插入消息示例:
3290
- * ```ts
3291
- * const conversation = {
3292
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3293
- * targetId: 'targetId',
3294
- * };
3295
- * const message = new RongIMLib.TextMessage({ content: 'hello' });
3296
- * const options = {
3297
- * searchContent: 'hello',
3298
- * };
3299
- * const res = await RongIMLib.electronExtension.insertMessage(conversation, message, options);
3300
- * console.info('插入消息结果:', res);
3301
- * ```
3345
+ * 获取文件的下载地址
3346
+ * @hidden
3347
+ * @param fileType 文件类型
3348
+ * @param fileName 文件名
3349
+ * @param saveName 下载后的存储文件名
3350
+ * @param _ 已废弃
3351
+ * @param serverType 使用的存储服务标识
3352
+ * @returns
3302
3353
  */
3303
- declare function insertMessage(conversation: IConversationOption, message: IAReceivedMessage | BaseMessage, options?: IInsertOptions): Promise<RCResult<IAReceivedMessage>>;
3354
+ declare function getFileUrl(fileType: FileType, filename: string, saveName?: string, _?: {
3355
+ isBosRes: boolean;
3356
+ downloadUrl: string;
3357
+ }, serverType?: UploadMethod): Promise<RCResult<{
3358
+ downloadUrl: string;
3359
+ }>>;
3360
+
3304
3361
  /**
3305
- * 批量向本地插入消息
3362
+ * 获取全部会话列表
3306
3363
  * @category Electron 独有
3307
- * @description 本接口仅适用 Electron 平台,批量插入消息到本地数据库,不发送到服务器。
3308
- * @since 5.7.2
3309
- * @param messages 批量插入的消息体
3310
- * @param checkDuplicate 选择是否排重
3311
3364
  */
3312
- declare function batchInsertMessage(messages: IInsertMessage[], checkDuplicate: boolean): Promise<RCResult<boolean>>;
3365
+ declare function getAllConversationList$1(channelId?: string): Promise<RCResult<IAReceivedConversation[]>>;
3313
3366
  /**
3314
- * 获取会话所有消息数
3367
+ * 分页获取本地会话列表
3315
3368
  * @category Electron 独有
3316
- * @description 本接口仅适用 Electron 平台,获取指定会话下的所有消息数
3317
- * @param conversation
3318
- * @since 5.7.2
3369
+ * @description 本接口仅适用 Electron 平台分页获取本地会话列表,
3370
+ * * **注意**:不包含超级群会话
3371
+ * @param startTime 获取会话起始时间,需要精确到毫秒,0 表示当前时间
3372
+ * @param count 分页数量
3373
+ * @param channelId 组织 ID,不传将获取所有组织所有会话;传入组织 ID 将分页获取组织下的会话列表
3374
+ * @param topPriority 是否置顶优先
3375
+ * @defaultValue topPriority false
3376
+ * @since 5.4.0
3377
+ * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3319
3378
  * @example
3320
- * 获取会话所有消息数示例:
3321
- * ```ts
3322
- * const conversation = {
3323
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3324
- * targetId: 'targetId',
3325
- * };
3326
- * const res = await RongIMLib.electronExtension.getMessageCount(conversation);
3327
- * console.info('获取会话所有消息数结果:', res);
3379
+ * 分页获取本地会话列表示例:
3380
+ * ```ts
3381
+ * const startTime = 0;
3382
+ * const count = 10;
3383
+ * const conversationList = await RongIMLib.electronExtension.getConversationList(startTime, count);
3384
+ * console.log('分页获取本地会话列表结果:', conversationList);
3328
3385
  * ```
3329
3386
  */
3330
- declare function getMessageCount(conversation: IConversationOption): Promise<RCResult<number>>;
3387
+ declare function getConversationList$1(startTime: number, count: number, channelId?: string, topPriority?: boolean): Promise<RCResult<IAReceivedConversation[]>>;
3331
3388
  /**
3332
- * 设置融云消息重排开关
3389
+ * 搜索本地会话列表
3333
3390
  * @category Electron 独有
3334
- * @description 发送方弱网情况下发送消息,消息到达服务但发送方没有收到服务 ack,导致发送方认为消息发送失败
3335
- * 此种情况下,服务端和接收方都会收到第一条消息
3336
- * 此时发送方重发该消息,再次达到服务,那么此时服务端会有两条消息(消息内容相同,messageUid 不同
3337
- * 接收方会收到两条内容相同 messageUId 不同的消息,SDK 此时会把第二条相同内容消息排重掉
3338
- * 以此来保证重发的相同内容消息,发送方只有一条消息,接收方也只有一条消息
3339
- *
3340
- * 当消息量少时,消息排重影响不大;但是本地存在大量消息时,排重会出现性能问题
3341
- * 当本地存在大量消息,且发生收消息卡顿时,建议将排重关闭
3391
+ * @description
3392
+ * * 本接口仅适用 Electron 平台搜索本地会话列表
3393
+ * * 5.20.0 版本开始,该接口支持按会话类型搜索
3342
3394
  *
3343
- * @param checkDuplicate 是否使用融云消息重排机制 true: 开启,false: 关闭
3344
- * @since 5.7.1
3395
+ * * **注意**:
3396
+ * 1. 不包含超级群会话
3397
+ * 2. 支持查询自定义消息类型,需要再注册自定义消息时设置搜索字段,否则无法搜索,详细请查看 {@link registerMessageType} 的 searchProps 参数
3398
+ * @param keyword 搜索关键字
3399
+ * @param messageTypes 消息类型
3400
+ * @param channelId 频道 ID,不传则获取全部频道 ID 类型
3401
+ * @param conversationTypes 会话类型,默认查询全部会话类型
3402
+ * @since 5.4.0
3403
+ * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3345
3404
  * @example
3346
- * 设置融云消息重排开关示例:
3405
+ * 搜索本地会话列表示例:
3347
3406
  * ```ts
3348
- * const checkDuplicate = true;
3349
- * const res = await RongIMLib.electronExtension.setCheckDuplicateMessage(checkDuplicate);
3350
- * console.info('设置融云消息重排开关结果:', res);
3407
+ * const keyword = 'keyword';
3408
+ * const messageTypes = [RongIMLib.MessageType.TEXT];
3409
+ * const conversationList = await RongIMLib.electronExtension.searchConversationByContent(keyword, messageTypes);
3410
+ * console.log('搜索本地会话列表结果:', conversationList);
3351
3411
  * ```
3352
3412
  */
3353
- declare function setCheckDuplicateMessage(checkDuplicate?: boolean): Promise<RCResult<boolean>>;
3413
+ declare function searchConversationByContent(keyword: string, messageTypes: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<RCResult<IAReceivedConversation[]>>;
3354
3414
  /**
3355
- * 设置聊天室消息重排开关
3415
+ * 批量获取会话列表
3356
3416
  * @category Electron 独有
3357
- * @description 仅支持聊天室消息重排开关,不支持其他会话类型,聊天室消息重排开关默认开启
3358
- * 目前仅支持对 CUID 进行排重策略修改
3359
- * @hidden 产品协商暂不对外提供
3417
+ * @description 本接口仅适用 Electron 平台批量获取会话列表,通过提供会话的唯一标标识属性返回 {@link IReceivedConversation} 类型的会话信息
3360
3418
  * @since 5.9.9
3419
+ * @param conversations 需要获取会话的信息,一次最多获取 100 个会话
3420
+ * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3361
3421
  * @example
3362
- * 设置聊天室消息重排开关示例:
3422
+ * 批量获取会话列表示例:
3363
3423
  * ```ts
3364
- * const checkDuplicate = true;
3365
- * const res = await RongIMLib.electronExtension.setCheckChatRoomDuplicateMessage(checkDuplicate);
3366
- * console.info('设置聊天室消息重排开关结果:', res);
3424
+ * const conversations = [{ conversationType: RongIMLib.ConversationType.PRIVATE, targetId: 'targetId' }];
3425
+ * const conversationList = await RongIMLib.electronExtension.getConversations(conversations);
3426
+ * console.log('批量获取会话列表结果:', conversationList);
3367
3427
  * ```
3368
3428
  */
3369
- declare function setCheckChatRoomDuplicateMessage(checkDuplicate?: boolean): Promise<RCResult>;
3429
+ declare function getConversations(conversations: IConversationIdentifier[]): Promise<RCResult<IAReceivedConversation[]>>;
3370
3430
  /**
3371
- * 获取本地指定时间戳前后 N 条消息方法
3372
- * @category Electron 独有
3373
- * @description 本接口仅适用 Electron 平台,获取本地指定时间戳前后 N 条消息
3374
- * @param conversation 会话信息
3375
- * @param option 获取参数
3376
- * @since 5.9.8
3377
- * @example
3378
- * 获取本地指定时间戳前后 N 条消息示例:
3379
- * ```ts
3380
- * const conversation = {
3381
- * conversationType: RongIMLib.ConversationType.PRIVATE,
3382
- * targetId: 'targetId',
3383
- * };
3384
- * const option = {
3385
- * timestamp: 0,
3386
- * beforeCount: 10,
3387
- * afterCount: 10,
3388
- * };
3389
- * const res = await RongIMLib.electronExtension.getMessagesAroundTimestamp(conversation, option);
3390
- * console.info('获取本地指定时间戳前后 N 条消息结果:', res);
3391
- * ```
3431
+ * 分页获取未标记的会话列表
3432
+ * @param timestamp 获取会话起始时间,需要精确到毫秒,0 表示当前时间
3433
+ * @param count 获取会话数量,有效值 [1, 100],当值小于 1 时,取值 20;当值大于 100 时取 100;
3434
+ * @param topPriority 是否置顶优先,默认 false
3435
+ * @since 5.24.0
3436
+ * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedConversation} 类型数组
3392
3437
  */
3393
- declare function getMessagesAroundTimestamp(conversation: IConversationOption, option: {
3394
- timestamp: number;
3395
- beforeCount: number;
3396
- afterCount: number;
3397
- }): Promise<RCResult<IAReceivedMessage[]>>;
3438
+ declare function getUntaggedConversationListByPage(timestamp: number, count: number, topPriority: boolean): Promise<RCResult<IAReceivedConversation[]>>;
3398
3439
  /**
3399
- * 获取消息
3440
+ * 同步服务器会话列表至本地数据库,同步完成后,SDK 将通知 `Events.CONVERSATIONS_SYNCED` 事件。
3441
+ * 该接口需要开通“同步服务端会话信息到本地”,且未开启“SDK 自动拉取服务端会话”功能时才能使用,否则将返回错误码。
3400
3442
  * @category Electron 独有
3401
- * @description 获取本地消息,通过本地消息 ID 或 messageUId 获取消息
3402
- * @param messageId - 支持消息 messaegId 或 messageUId
3403
- * @since v5.16.0
3404
- * @example
3405
- * 获取消息示例:
3406
- * ```ts
3407
- * const messageUId = 'BS4O-P5AO-D1O6-9GPP';
3408
- * const res = await RongIMLib.electronExtension.getLocalMessage(messageUId);
3409
- * console.info('获取消息结果:', res);
3410
- * ```
3443
+ * @since 5.26.2
3411
3444
  */
3412
- declare function getLocalMessage(messageId: number | string): Promise<RCResult<IAReceivedMessage>>;
3445
+ declare function getRemoteConversations(): Promise<RCResult>;
3413
3446
  /**
3414
- * 全局搜索本地消息
3415
- * @category Electron 独有
3416
- * @since 5.22.0
3417
- * @description 本接口仅适用 Electron 平台,全局搜索本地消息,支持跨会话搜索等通用场景
3418
- * @param params 搜索参数
3419
- * @example
3420
- * 根据参数搜索消息示例:
3421
- * ```ts
3422
- * const params = {
3423
- * keyword: 'test',
3424
- * count: 10,
3425
- * offset: 0,
3426
- * order: 0,
3427
- * range: {
3428
- * startTime: 0,
3429
- * endTime: 0,
3430
- * },
3431
- * conversationFilter: {
3432
- * conversationTypes: [RongIMLib.ConversationType.PRIVATE, RongIMLib.ConversationType.GROUP],
3433
- * targetIds: ['targetId1', 'targetId2'],
3434
- * },
3435
- * messageFilter: {
3436
- * messageTypes: [RongIMLib.MessageType.TEXT],
3437
- * },
3438
- * };
3439
- * const res = await RongIMLib.electronExtension.searchMessagesWithParams(params);
3440
- * if (res.isOk) {
3441
- * console.info('搜索消息结果:', res.data.messages, res.data.matchedCount);
3442
- * } else {
3443
- * console.error('搜索消息失败:', res.code);
3444
- * }
3445
- * ```
3447
+ * Save conversation message edit draft, only one draft can be saved for the same conversation.
3448
+ * @category Electron Only
3449
+ * @param draft Draft content
3450
+ * @param conversation Conversation information
3451
+ * @since 5.28.0
3446
3452
  */
3447
- declare function searchMessagesWithParams(params: ISearchMessageParams): Promise<RCResult<ISearchMessagesResult>>;
3448
3453
  /**
3449
- * 设置语音转文字内容可见性
3450
- * @param messageId 消息 ID,为本地消息 ID,非消息 UId
3451
- * @param isVisible 是否可见
3452
- * @since 5.22.0
3454
+ * 保存会话消息编辑草稿,同一会话只能保存一条草稿
3455
+ * @category Electron 独有
3456
+ * @param draft 草稿
3457
+ * @param identifier 会话
3458
+ * @since 5.28.0
3453
3459
  */
3454
- declare function setMessageSpeechToTextVisible(messageId: number, isVisible: boolean): Promise<RCResult>;
3460
+ declare function saveEditedMessageDraft(draft: IEditedMessageDraft, identifier: IConversationIdentifier): Promise<RCResult>;
3455
3461
  /**
3456
- * 按时间戳清除超级群下所有子频道会话的本地消息
3457
- * @param targetId 超级群 ID
3458
- * @param timestamp 时间戳
3462
+ * 获取会话消息编辑草稿,若没有草稿则返回 null
3463
+ * @category Electron 独有
3464
+ * @param conversation 会话
3459
3465
  * @since 5.28.0
3460
3466
  */
3461
- declare function deleteUltraGroupMessagesForAllChannel(targetId: string, timestamp: number): Promise<RCResult>;
3467
+ declare function getEditedMessageDraft(conversation: IConversationIdentifier): Promise<RCResult<IEditedMessageDraft | null>>;
3462
3468
  /**
3463
- * 获取会话下所有未读的 @ 消息
3464
- * @param conversation 会话信息
3465
- * @returns 返回一个 {@link RCResult} 类型 Promise,data 为 {@link IAReceivedMessage[]} 类型的消息列表
3469
+ * 清除会话消息编辑草稿
3470
+ * @category Electron 独有
3471
+ * @param conversation 会话
3466
3472
  * @since 5.28.0
3467
3473
  */
3468
- declare function getUnreadMentionedMessages(conversation: IConversationOption): Promise<RCResult<IAReceivedMessage[]>>;
3474
+ declare function clearEditedMessageDraft(conversation: IConversationIdentifier): Promise<RCResult>;
3469
3475
 
3470
3476
  /**
3471
3477
  * 清除本地数据
@@ -3497,78 +3503,72 @@ declare function clearLocalData(): Promise<RCResult<boolean>>;
3497
3503
  */
3498
3504
  declare function enable(): boolean;
3499
3505
 
3500
- declare const index_searchConversationByContent: typeof searchConversationByContent;
3506
+ declare const index_batchClearMessagesByTimestamp: typeof batchClearMessagesByTimestamp;
3507
+ declare const index_batchInsertMessage: typeof batchInsertMessage;
3508
+ declare const index_clearEditedMessageDraft: typeof clearEditedMessageDraft;
3509
+ declare const index_clearLocalData: typeof clearLocalData;
3510
+ declare const index_deleteMessagesByTimestamp: typeof deleteMessagesByTimestamp;
3511
+ declare const index_deleteUltraGroupMessagesForAllChannel: typeof deleteUltraGroupMessagesForAllChannel;
3512
+ declare const index_enable: typeof enable;
3513
+ declare const index_getContinuousMessages: typeof getContinuousMessages;
3501
3514
  declare const index_getConversations: typeof getConversations;
3502
- declare const index_getUntaggedConversationListByPage: typeof getUntaggedConversationListByPage;
3515
+ declare const index_getEditedMessageDraft: typeof getEditedMessageDraft;
3516
+ declare const index_getHistoryMessagesByMessageTypes: typeof getHistoryMessagesByMessageTypes;
3517
+ declare const index_getLocalMessage: typeof getLocalMessage;
3518
+ declare const index_getMessageCount: typeof getMessageCount;
3519
+ declare const index_getMessagesAroundTimestamp: typeof getMessagesAroundTimestamp;
3503
3520
  declare const index_getRemoteConversations: typeof getRemoteConversations;
3521
+ declare const index_getUntaggedConversationListByPage: typeof getUntaggedConversationListByPage;
3504
3522
  declare const index_saveEditedMessageDraft: typeof saveEditedMessageDraft;
3505
- declare const index_getEditedMessageDraft: typeof getEditedMessageDraft;
3506
- declare const index_clearEditedMessageDraft: typeof clearEditedMessageDraft;
3507
- declare const index_searchMessages: typeof searchMessages;
3523
+ declare const index_searchConversationByContent: typeof searchConversationByContent;
3508
3524
  declare const index_searchMessageInTimeRange: typeof searchMessageInTimeRange;
3509
3525
  declare const index_searchMessagesByUser: typeof searchMessagesByUser;
3510
- declare const index_getHistoryMessagesByMessageTypes: typeof getHistoryMessagesByMessageTypes;
3511
- declare const index_getContinuousMessages: typeof getContinuousMessages;
3512
- declare const index_setMessageStatusToRead: typeof setMessageStatusToRead;
3513
- declare const index_setMessageReceivedStatus: typeof setMessageReceivedStatus;
3526
+ declare const index_searchMessagesWithParams: typeof searchMessagesWithParams;
3527
+ declare const index_setCheckChatRoomDuplicateMessage: typeof setCheckChatRoomDuplicateMessage;
3528
+ declare const index_setCheckDuplicateMessage: typeof setCheckDuplicateMessage;
3529
+ declare const index_setMessageContent: typeof setMessageContent;
3514
3530
  declare const index_setMessageReceivedStatusInfo: typeof setMessageReceivedStatusInfo;
3515
3531
  declare const index_setMessageSentStatus: typeof setMessageSentStatus;
3516
- declare const index_setMessageContent: typeof setMessageContent;
3517
- declare const index_deleteMessages: typeof deleteMessages;
3518
- declare const index_clearMessages: typeof clearMessages;
3519
- declare const index_deleteMessagesByTimestamp: typeof deleteMessagesByTimestamp;
3520
- declare const index_batchClearMessagesByTimestamp: typeof batchClearMessagesByTimestamp;
3521
- declare const index_insertMessage: typeof insertMessage;
3522
- declare const index_batchInsertMessage: typeof batchInsertMessage;
3523
- declare const index_getMessageCount: typeof getMessageCount;
3524
- declare const index_setCheckDuplicateMessage: typeof setCheckDuplicateMessage;
3525
- declare const index_setCheckChatRoomDuplicateMessage: typeof setCheckChatRoomDuplicateMessage;
3526
- declare const index_getMessagesAroundTimestamp: typeof getMessagesAroundTimestamp;
3527
- declare const index_getLocalMessage: typeof getLocalMessage;
3528
- declare const index_searchMessagesWithParams: typeof searchMessagesWithParams;
3529
3532
  declare const index_setMessageSpeechToTextVisible: typeof setMessageSpeechToTextVisible;
3530
- declare const index_deleteUltraGroupMessagesForAllChannel: typeof deleteUltraGroupMessagesForAllChannel;
3531
- declare const index_getUnreadMentionedMessages: typeof getUnreadMentionedMessages;
3532
- declare const index_clearLocalData: typeof clearLocalData;
3533
- declare const index_enable: typeof enable;
3533
+ declare const index_setMessageStatusToRead: typeof setMessageStatusToRead;
3534
3534
  declare namespace index {
3535
3535
  export {
3536
+ index_batchClearMessagesByTimestamp as batchClearMessagesByTimestamp,
3537
+ index_batchInsertMessage as batchInsertMessage,
3538
+ index_clearEditedMessageDraft as clearEditedMessageDraft,
3539
+ index_clearLocalData as clearLocalData,
3540
+ clearMessages$1 as clearMessages,
3541
+ deleteMessages$1 as deleteMessages,
3542
+ index_deleteMessagesByTimestamp as deleteMessagesByTimestamp,
3543
+ index_deleteUltraGroupMessagesForAllChannel as deleteUltraGroupMessagesForAllChannel,
3544
+ index_enable as enable,
3536
3545
  getAllConversationList$1 as getAllConversationList,
3546
+ index_getContinuousMessages as getContinuousMessages,
3537
3547
  getConversationList$1 as getConversationList,
3538
- index_searchConversationByContent as searchConversationByContent,
3539
3548
  index_getConversations as getConversations,
3540
- index_getUntaggedConversationListByPage as getUntaggedConversationListByPage,
3549
+ index_getEditedMessageDraft as getEditedMessageDraft,
3550
+ index_getHistoryMessagesByMessageTypes as getHistoryMessagesByMessageTypes,
3551
+ index_getLocalMessage as getLocalMessage,
3552
+ index_getMessageCount as getMessageCount,
3553
+ index_getMessagesAroundTimestamp as getMessagesAroundTimestamp,
3541
3554
  index_getRemoteConversations as getRemoteConversations,
3555
+ getUnreadMentionedMessages$1 as getUnreadMentionedMessages,
3556
+ index_getUntaggedConversationListByPage as getUntaggedConversationListByPage,
3557
+ insertMessage$1 as insertMessage,
3542
3558
  index_saveEditedMessageDraft as saveEditedMessageDraft,
3543
- index_getEditedMessageDraft as getEditedMessageDraft,
3544
- index_clearEditedMessageDraft as clearEditedMessageDraft,
3545
- index_searchMessages as searchMessages,
3559
+ index_searchConversationByContent as searchConversationByContent,
3546
3560
  index_searchMessageInTimeRange as searchMessageInTimeRange,
3561
+ searchMessages$1 as searchMessages,
3547
3562
  index_searchMessagesByUser as searchMessagesByUser,
3548
- index_getHistoryMessagesByMessageTypes as getHistoryMessagesByMessageTypes,
3549
- index_getContinuousMessages as getContinuousMessages,
3550
- index_setMessageStatusToRead as setMessageStatusToRead,
3551
- index_setMessageReceivedStatus as setMessageReceivedStatus,
3563
+ index_searchMessagesWithParams as searchMessagesWithParams,
3564
+ index_setCheckChatRoomDuplicateMessage as setCheckChatRoomDuplicateMessage,
3565
+ index_setCheckDuplicateMessage as setCheckDuplicateMessage,
3566
+ index_setMessageContent as setMessageContent,
3567
+ setMessageReceivedStatus$1 as setMessageReceivedStatus,
3552
3568
  index_setMessageReceivedStatusInfo as setMessageReceivedStatusInfo,
3553
3569
  index_setMessageSentStatus as setMessageSentStatus,
3554
- index_setMessageContent as setMessageContent,
3555
- index_deleteMessages as deleteMessages,
3556
- index_clearMessages as clearMessages,
3557
- index_deleteMessagesByTimestamp as deleteMessagesByTimestamp,
3558
- index_batchClearMessagesByTimestamp as batchClearMessagesByTimestamp,
3559
- index_insertMessage as insertMessage,
3560
- index_batchInsertMessage as batchInsertMessage,
3561
- index_getMessageCount as getMessageCount,
3562
- index_setCheckDuplicateMessage as setCheckDuplicateMessage,
3563
- index_setCheckChatRoomDuplicateMessage as setCheckChatRoomDuplicateMessage,
3564
- index_getMessagesAroundTimestamp as getMessagesAroundTimestamp,
3565
- index_getLocalMessage as getLocalMessage,
3566
- index_searchMessagesWithParams as searchMessagesWithParams,
3567
3570
  index_setMessageSpeechToTextVisible as setMessageSpeechToTextVisible,
3568
- index_deleteUltraGroupMessagesForAllChannel as deleteUltraGroupMessagesForAllChannel,
3569
- index_getUnreadMentionedMessages as getUnreadMentionedMessages,
3570
- index_clearLocalData as clearLocalData,
3571
- index_enable as enable,
3571
+ index_setMessageStatusToRead as setMessageStatusToRead,
3572
3572
  };
3573
3573
  }
3574
3574
 
@@ -4307,7 +4307,7 @@ declare function getConversationListByTimestamp(params: IGetConversationListByTi
4307
4307
  * * 自 5.20.0 版本开始,该接口支持超级群会话获取
4308
4308
  * @description
4309
4309
  * @category 会话
4310
- * @param options 需要获取会话参数,类型为 {@link IConversationOption}
4310
+ * @param options 需要获取会话参数,类型为 {@link IConversationIdentifier}
4311
4311
  * @returns 返回一个 {@link RCResult} 类型 Promise,data 结构为 {@link IAReceivedConversation} 类型
4312
4312
  *
4313
4313
  * @example
@@ -4321,7 +4321,7 @@ declare function getConversationListByTimestamp(params: IGetConversationListByTi
4321
4321
  * console.info('获取指定会话数据结果:', conversation);
4322
4322
  * ```
4323
4323
  */
4324
- declare function getConversation(options: IConversationOption): Promise<RCResult<IAReceivedConversation>>;
4324
+ declare function getConversation(options: IConversationIdentifier): Promise<RCResult<IAReceivedConversation>>;
4325
4325
  /**
4326
4326
  * 移除指定的会话
4327
4327
  * * 自 5.20.0 版本开始,该接口支持删除超级群会话;
@@ -4341,7 +4341,7 @@ declare function getConversation(options: IConversationOption): Promise<RCResult
4341
4341
  * console.info('移除指定的会话结果:', conversation);
4342
4342
  * ```
4343
4343
  */
4344
- declare const removeConversation: MonitorableAPI<(options: IConversationOption, deleteRemotely?: boolean | undefined) => Promise<RCResult>>;
4344
+ declare const removeConversation: MonitorableAPI<(options: IConversationIdentifier, deleteRemotely?: boolean) => Promise<RCResult>>;
4345
4345
  /**
4346
4346
  * 批量删除会话
4347
4347
  * @category 会话
@@ -4365,7 +4365,7 @@ declare const removeConversation: MonitorableAPI<(options: IConversationOption,
4365
4365
  * })
4366
4366
  * ```
4367
4367
  */
4368
- declare function batchRemoveConversation(identifiers: IConversationOption[]): Promise<RCResult>;
4368
+ declare function batchRemoveConversation(identifiers: IConversationIdentifier[]): Promise<RCResult>;
4369
4369
  /**
4370
4370
  * 批量删除会话,支持同时删除单聊、群聊、超级群、系统会话等不同类型的多个会话
4371
4371
  * @param params 批量删除会话参数,类型为 {@link ConversationBatchDeletionParams}
@@ -4393,19 +4393,19 @@ declare function batchDeleteConversations(params: ConversationBatchDeletionParam
4393
4393
  * 获取会话文本草稿
4394
4394
  * @category 草稿
4395
4395
  * @description Web 端草稿为内存态保存,如刷新浏览器会导致已经设置的草稿丢失
4396
- * @param options 会话信息
4396
+ * @param identifier 会话信息
4397
4397
  * @example
4398
4398
  * 获取会话文本草稿示例:
4399
4399
  * ```ts
4400
- * const options = {
4400
+ * const identifier = {
4401
4401
  * conversationType: RongIMLib.ConversationType.PRIVATE,
4402
4402
  * targetId: 'targetId',
4403
4403
  * }
4404
- * const conversation = await RongIMLib.getTextMessageDraft(options);
4404
+ * const conversation = await RongIMLib.getTextMessageDraft(identifier);
4405
4405
  * console.info('获取会话文本草稿结果:', conversation);
4406
4406
  * ```
4407
4407
  */
4408
- declare function getTextMessageDraft(options: IConversationOption): Promise<RCResult<string>>;
4408
+ declare function getTextMessageDraft(identifier: IConversationIdentifier): Promise<RCResult<string>>;
4409
4409
  /**
4410
4410
  * 设置会话文本草稿
4411
4411
  * @category 草稿
@@ -4424,7 +4424,7 @@ declare function getTextMessageDraft(options: IConversationOption): Promise<RCRe
4424
4424
  * console.info('设置会话文本草稿结果:', conversation);
4425
4425
  * ```
4426
4426
  */
4427
- declare function saveTextMessageDraft(options: IConversationOption, draft: string): Promise<RCResult>;
4427
+ declare function saveTextMessageDraft(options: IConversationIdentifier, draft: string): Promise<RCResult>;
4428
4428
  /**
4429
4429
  * 删除会话文本草稿
4430
4430
  * @category 草稿
@@ -4440,7 +4440,7 @@ declare function saveTextMessageDraft(options: IConversationOption, draft: strin
4440
4440
  * console.info('删除会话文本草稿结果:', conversation);
4441
4441
  * ```
4442
4442
  */
4443
- declare function clearTextMessageDraft(options: IConversationOption): Promise<RCResult>;
4443
+ declare function clearTextMessageDraft(options: IConversationIdentifier): Promise<RCResult>;
4444
4444
  /**
4445
4445
  * 获取当前所有会话的消息未读数
4446
4446
  * @category 会话未读数
@@ -4516,7 +4516,7 @@ declare function getTotalUnreadMentionedCountByLevels(conversationTypes: Convers
4516
4516
  * console.info('获取指定会话的未读数结果:', unreadCount);
4517
4517
  * ```
4518
4518
  */
4519
- declare function getUnreadCount(options: IConversationOption): Promise<RCResult<number>>;
4519
+ declare function getUnreadCount(options: IConversationIdentifier): Promise<RCResult<number>>;
4520
4520
  /**
4521
4521
  * 清除指定会话未读数
4522
4522
  * @description 清除指定会话的未读数(不含聊天室会话类型)
@@ -4537,7 +4537,7 @@ declare function getUnreadCount(options: IConversationOption): Promise<RCResult<
4537
4537
  * console.info('清除指定会话未读数结果:', clearRes);
4538
4538
  * ```
4539
4539
  */
4540
- declare const clearMessagesUnreadStatus: MonitorableAPI<(options: IConversationOption) => Promise<RCResult>>;
4540
+ declare const clearMessagesUnreadStatus: MonitorableAPI<(options: IConversationIdentifier) => Promise<RCResult>>;
4541
4541
  /**
4542
4542
  * 清理全部未读数,不包含超级群会话
4543
4543
  * @description 5.20.0 版本开始新增支持 Electron 平台
@@ -4577,7 +4577,7 @@ declare function clearAllMessagesUnreadStatus(): Promise<RCResult>;
4577
4577
  * console.info('设置会话免打扰结果:', res);
4578
4578
  * ```
4579
4579
  */
4580
- declare const setConversationNotificationLevel: MonitorableAPI<(options: IConversationOption, notificationLevel: NotificationLevel) => Promise<RCResult>>;
4580
+ declare const setConversationNotificationLevel: MonitorableAPI<(options: IConversationIdentifier, notificationLevel: NotificationLevel) => Promise<RCResult>>;
4581
4581
  /**
4582
4582
  * 批量设置会话免打扰级别
4583
4583
  * @param conversations 会话列表,最大数量为 20
@@ -4603,20 +4603,20 @@ declare const setConversationNotificationLevel: MonitorableAPI<(options: IConver
4603
4603
  * })
4604
4604
  * ```
4605
4605
  */
4606
- declare function batchSetConversationNotificationLevel(conversations: IConversationOption[], notificationLevel: NotificationLevel): Promise<RCResult>;
4606
+ declare function batchSetConversationNotificationLevel(conversations: IConversationIdentifier[], notificationLevel: NotificationLevel): Promise<RCResult>;
4607
4607
  /**
4608
4608
  * 批量设置会话翻译策略
4609
4609
  * @param conversations 会话列表
4610
4610
  * @param strategy 翻译策略
4611
4611
  * @since 5.24.0
4612
4612
  */
4613
- declare function batchSetConversationTranslateStrategy(conversations: IConversationOption[], strategy: TranslateStrategy): Promise<RCResult>;
4613
+ declare function batchSetConversationTranslateStrategy(conversations: IConversationIdentifier[], strategy: TranslateStrategy): Promise<RCResult>;
4614
4614
  /**
4615
4615
  * 设置会话免打扰
4616
4616
  * @deprecated @since 5.3.0 已废弃,请使用 {@link setConversationNotificationLevel}
4617
4617
  * @category 会话
4618
4618
  */
4619
- declare function setConversationNotificationStatus(options: IConversationOption, notificationStatus: NotificationStatus): Promise<RCResult>;
4619
+ declare function setConversationNotificationStatus(options: IConversationIdentifier, notificationStatus: NotificationStatus): Promise<RCResult>;
4620
4620
  /**
4621
4621
  * 查询指定会话和频道免打扰
4622
4622
  * @description 查询通过 {@link setConversationNotificationLevel} 接口设置的指定会话和频道免打扰
@@ -4635,13 +4635,13 @@ declare function setConversationNotificationStatus(options: IConversationOption,
4635
4635
  * console.info('查询指定会话和频道免打扰结果:', conversation);
4636
4636
  * ```
4637
4637
  */
4638
- declare function getConversationNotificationLevel(options: IConversationOption): Promise<RCResult<NotificationLevel>>;
4638
+ declare function getConversationNotificationLevel(options: IConversationIdentifier): Promise<RCResult<NotificationLevel>>;
4639
4639
  /**
4640
4640
  * 获取免打扰状态
4641
4641
  * @category 会话
4642
4642
  * @deprecated 自 5.3.0 版本废弃,请使用 {@link getConversationNotificationLevel} 接口
4643
4643
  */
4644
- declare function getConversationNotificationStatus(options: IConversationOption): Promise<RCResult<NotificationStatus | undefined>>;
4644
+ declare function getConversationNotificationStatus(options: IConversationIdentifier): Promise<RCResult<NotificationStatus | undefined>>;
4645
4645
  /**
4646
4646
  * 获取免打扰状态列表
4647
4647
  * @description
@@ -4690,7 +4690,7 @@ declare function getConversationTypeNotificationLevel(conversationType: Conversa
4690
4690
  * console.info('设置会话是否置顶结果:', res);
4691
4691
  * ```
4692
4692
  */
4693
- declare const setConversationToTop: MonitorableAPI<(options: IConversationOption, isTop?: boolean, isUpdateTime?: boolean, isCreateConversation?: boolean) => Promise<RCResult>>;
4693
+ declare const setConversationToTop: MonitorableAPI<(options: IConversationIdentifier, isTop?: boolean, isUpdateTime?: boolean, isCreateConversation?: boolean) => Promise<RCResult>>;
4694
4694
  /**
4695
4695
  * 批量设置会话置顶
4696
4696
  * @param conversations 会话数组,最大数量为 20
@@ -4721,7 +4721,7 @@ declare const setConversationToTop: MonitorableAPI<(options: IConversationOption
4721
4721
  * })
4722
4722
  * ```
4723
4723
  */
4724
- declare function batchSetConversationToTop(conversations: IConversationOption[], isTop: boolean, isCreateConversation?: boolean, isUpdateTime?: boolean): Promise<RCResult>;
4724
+ declare function batchSetConversationToTop(conversations: IConversationIdentifier[], isTop: boolean, isCreateConversation?: boolean, isUpdateTime?: boolean): Promise<RCResult>;
4725
4725
  /**
4726
4726
  * 获取置顶会话列表
4727
4727
  * @description
@@ -4923,7 +4923,7 @@ declare function joinExistChatRoom(targetId: string, options: IChatroomJoinOpts)
4923
4923
  * ```
4924
4924
  */
4925
4925
  declare function quitChatRoom(targetId: string, extra?: string): Promise<RCResult>;
4926
- declare type IGetChatroomInfoOptions = {
4926
+ type IGetChatroomInfoOptions = {
4927
4927
  /**
4928
4928
  * 获取聊天室的人数,传值范围:0-20,默认为 0;当值为 0 时,仅返回聊天室内成员总数,不返回成员列表信息
4929
4929
  */
@@ -5221,25 +5221,25 @@ interface IReceivedUpdateConversation {
5221
5221
  * @category Type
5222
5222
  * @deprecated - 已废弃,请使用 `MentionedInfo` 替代
5223
5223
  */
5224
- declare type MentionedInfoBody = MentionedInfo;
5224
+ type MentionedInfoBody = MentionedInfo;
5225
5225
  /**
5226
5226
  * 用户信息结构
5227
5227
  * @category Interface
5228
5228
  * @deprecated - 已废弃,请使用 `IUserExtraKeyInMessage` 替代
5229
5229
  */
5230
- declare type IUserInfo = IUserExtraKeyInMessage;
5230
+ type IUserInfo = IUserExtraKeyInMessage;
5231
5231
  /**
5232
5232
  * 消息扩展结构
5233
5233
  * @category Interface
5234
5234
  * @deprecated - 已废弃,请使用 `IExtraDataKeyInMessage` 替代
5235
5235
  */
5236
- declare type IExtraData = IExtraDataKeyInMessage;
5236
+ type IExtraData = IExtraDataKeyInMessage;
5237
5237
  /**
5238
5238
  * 消息审核配置结构
5239
5239
  * @category Interface
5240
5240
  * @deprecated - 已废弃,请使用 `IAuditInfoKeyInMessage` 替代
5241
5241
  */
5242
- declare type IAuditInfo = IAuditInfoKeyInMessage;
5242
+ type IAuditInfo = IAuditInfoKeyInMessage;
5243
5243
  /**
5244
5244
  * 会话基础信息
5245
5245
  * @category Interface
@@ -5320,6 +5320,7 @@ declare function getMessageReactions(param: IGetMessageReactionsParam): Promise<
5320
5320
  */
5321
5321
  declare function getMessageReactionUsers(param: IGetMessageReactionUsersParam): Promise<RCResult<IMessageReactionUsersResult>>;
5322
5322
 
5323
- declare type IStreamMessageResponseEventData = IStreamMessageResponseEventData$1<IAReceivedMessage>;
5323
+ type IStreamMessageResponseEventData = IStreamMessageResponseEventData$1<IAReceivedMessage>;
5324
5324
 
5325
- export { BaseMessage, BuiltinMessage, CombineMessage, CombineV2Message, CombineV2MessageContent, CommandMessage, ConnectType, EventListeners, Events, FileMessage, GIFMessage, GetHistoryMessageOption, GetHistoryMessageResult, GroupNotificationMessage, HQVoiceMessage, IAReceivedConversation, IAReceivedConversationByTag, IAReceivedMessage, IAUltraGroupReceivedConversation, IAuditInfo, IBaseConversationInfo, IChatroomJoinOpts, ICombineMessageBody, ICommandMessageBody, IConversationEvent, IConversationState, IConversationUpdateItem, IExtraData, IFileMessageBody, IGIFMessageBody, IGetChatroomInfoOptions, IGetConversationListOptions, IGetMessagesByUIdsParams, IGroupNotificationMessageBody, IHQVoiceMessageBody, IImageMessageBody, IImageMessageOption, IInformationNotificationMessageBody, IInitOption, IInsertOptions, ILocationMessageBody, IMessageReceiptRequestEvent, IMessageReceiptResponseEvent, IMessageResult, IMessagesEvent, IReadReceiptReceivedEvent, IRecallMessageOptions, IReceivedUpdateConversation, IReferenceMessageBody, IRefreshReferenceMessageParams, IRefreshReferenceMessageResult, IRichContentMessageBody, ISearchMessageInTimeRangeOption, ISendBody, ISendFileMessageOptions, ISendImageMessageOptions, ISendMessageOptions, ISendSightMessageOptions, ISightMessageBody, IStreamMessageBody, IStreamMessageResponseEventData, ITextMessageBody, IThumbnailConfig, ITypingStatusEvent, IUploadConfig, IUploadHooks, IUploadInfo, IUploadMessageOption, IUploadResult, IUserInfo, IVoiceMessageBody, ImageMessage, InformationNotificationMessage, LocationMessage, MentionedInfoBody, MessageConstructor, Monitor, MonitorableAPI, ReferenceMessage, RichContentMessage, SightMessage, TextMessage, Transformer, UploadTask, VoiceMessage, __addSDKVersion, acceptFriendApplication, acceptGroupApplication, acceptGroupInvite, addConversationsToTag, addEventListener, addFriend, addGroupFollows, addGroupManagers, addMessageReaction, addMonitor, addTag, addToBlacklist, batchClearRemoteHistoryMessages, batchDeleteConversations, batchGetMessageReactionSummaries, batchGetMessageReadReceiptInfoV4, batchRemoveConversation, batchSetConversationNotificationLevel, batchSetConversationToTop, batchSetConversationTranslateStrategy, bindRTCRoomForChatroom, checkFriends, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages$1 as clearMessages, clearMessagesUnreadStatus, clearRealtimeConUnreadCount, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, createConversationListLoader, createGroup, createUploadTask, deleteFriends, deleteLocalMessagesByTimestamp, deleteMessages$1 as deleteMessages, destroy, disconnect, dismissGroup, index as electronExtension, forceRemoveChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, getAllConversationList, getAllRobots, getAllUltraGroupUnreadCount, getAllUltraGroupUnreadMentionedCount, getAllUnreadMentionedCount, getAppSettings, getAutoTranslateEnabled, getBlacklist, getBlacklistStatus, getBlockUltraGroupList, getBlockedConversationList, getChatRoomEntry, getChatRoomInfo, getChatroomHistoryMessages, getConnectionStatus, getConversation, getConversationList, getConversationListByTimestamp, getConversationNotificationLevel, getConversationNotificationStatus, getConversationTypeNotificationLevel, getConversationsFromTagByPage, getConversationsIncludingRobots, getCurrentUserId, getDeviceId, getDownloadAuth, getFileToken, getFileUrl, getFirstUnreadMessage, getFirstUnreadMessageInfo, getFriendAddPermission, getFriendApplications, getFriends, getFriendsInfo, getGroupApplications, getGroupFollows, getGroupMembers, getGroupMembersByRole, getGroupsInfo, getHistoryMessages, getJoinedGroups, getJoinedGroupsByRole, getMessage, getMessageReactionUsers, getMessageReactions, getMessageReadReceiptInfoV5, getMessageReadReceiptInfoV5ByIdentifiers, getMessageReadReceiptV4, getMessageReader, getMessagesByUIds, getMessagesReadReceiptByUsersV5, getMessagesReadReceiptUsersByPageV5, getMyUserProfile, getMyUserProfileVisibility, getNotificationQuietHoursSetting, getProxy, getRealtimeConTotalUnreadCount, getRealtimeConUnreadCounts, getRealtimeConversations, getRemoteHistoryMessages, getRobotById, getServerTime, getSubscribeUserList, getSubscribeUserStatus, getSubscribeUsersOnlineStatus, getTags, getTagsFromConversation, getTextMessageDraft, getTopConversationList, getTotalUnreadCount, getTotalUnreadCountByLevels, getTotalUnreadMentionedCountByLevels, getTranslationLanguage, getUltraGroupDefaultNotificationLevel, getUltraGroupFirstUnreadMessageTimestamp, getUltraGroupList, getUltraGroupMessageListByMessageUId, getUltraGroupUnreadCountByTargetId, getUltraGroupUnreadInfoList, getUltraGroupUnreadMentionedCountByTargetId, getUltraGroupUnreadMentionedMessages, getUnreadConversationList, getUnreadCount, getUnreadCountByTag, getUnreadMentionMeConversationList, getUnreadMentionedCount, getUnreadMentionedMessages$1 as getUnreadMentionedMessages, getUserProfiles, init, insertMessage$1 as insertMessage, installPlugin, inviteUsersToGroup, joinChatRoom, joinExistChatRoom, joinGroup, kickGroupMembers, markRemoteConversationAsRead, modifyMessage, modifyMessageWithParams, onceEventListener, quitChatRoom, quitGroup, recallMessage, refreshReferenceMessageWithParams, refuseFriendApplication, refuseGroupApplication, refuseGroupInvite, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeFromBlacklist, removeGroupFollows, removeGroupManagers, removeMessageExpansionForKey, removeMessageReaction, removeMonitor, removeNotificationQuietHoursSetting, removeRealtimeConversations, removeTag, removeTagFromConversations, removeTagsFromConversation, requestSpeechToTextForMessage, requestStreamMessageContent, saveTextMessageDraft, searchConversationByContent$1 as searchConversationByContent, searchFriendsInfo, searchGroupMembers, searchJoinedGroups, searchMessages$1 as searchMessages, searchUserProfileByUniqueId, sendFileMessage, sendGIFMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptMessageV4, sendReadReceiptRequest, sendReadReceiptResponse, sendReadReceiptResponseV2, sendReadReceiptResponseV5, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, sendUltraGroupTypingStatus, setAutoTranslateEnabled, setChatRoomEntries, setChatRoomEntry, setConversationNotificationLevel, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setConversationTypeNotificationLevel, setFriendAddPermission, setFriendInfo, setGroupMemberInfo, setGroupRemark, setMessageReceivedStatus$1 as setMessageReceivedStatus, setNotificationQuietHoursWithSetting, setProxy, setTranslationLanguage, setUltraGroupDefaultNotificationLevel, stopUploadTask, subscribeUserStatus, testProxy, transferGroupOwner, translateMessagesWithParams, translateTextsWithParams, unSubscribeUserStatus, updateExpansionForUltraGroupMessage, updateGroupInfo, updateMessageExpansion, updateMyUserProfile, updateMyUserProfileVisibility, updateTag, upload };
5325
+ export { BaseMessage, BuiltinMessage, CombineMessage, CombineV2Message, CommandMessage, ConnectType, Events, FileMessage, GIFMessage, GroupNotificationMessage, HQVoiceMessage, ImageMessage, InformationNotificationMessage, LocationMessage, ReferenceMessage, RichContentMessage, SightMessage, TextMessage, UploadTask, VoiceMessage, __addSDKVersion, acceptFriendApplication, acceptGroupApplication, acceptGroupInvite, addConversationsToTag, addEventListener, addFriend, addGroupFollows, addGroupManagers, addMessageReaction, addMonitor, addTag, addToBlacklist, batchClearRemoteHistoryMessages, batchDeleteConversations, batchGetMessageReactionSummaries, batchGetMessageReadReceiptInfoV4, batchRemoveConversation, batchSetConversationNotificationLevel, batchSetConversationToTop, batchSetConversationTranslateStrategy, bindRTCRoomForChatroom, checkFriends, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages, clearMessagesUnreadStatus, clearRealtimeConUnreadCount, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, createConversationListLoader, createGroup, createUploadTask, deleteFriends, deleteLocalMessagesByTimestamp, deleteMessages, destroy, disconnect, dismissGroup, index as electronExtension, forceRemoveChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, getAllConversationList, getAllRobots, getAllUltraGroupUnreadCount, getAllUltraGroupUnreadMentionedCount, getAllUnreadMentionedCount, getAppSettings, getAutoTranslateEnabled, getBlacklist, getBlacklistStatus, getBlockUltraGroupList, getBlockedConversationList, getChatRoomEntry, getChatRoomInfo, getChatroomHistoryMessages, getConnectionStatus, getConversation, getConversationList, getConversationListByTimestamp, getConversationNotificationLevel, getConversationNotificationStatus, getConversationTypeNotificationLevel, getConversationsFromTagByPage, getConversationsIncludingRobots, getCurrentUserId, getDeviceId, getDownloadAuth, getFileToken, getFileUrl, getFirstUnreadMessage, getFirstUnreadMessageInfo, getFriendAddPermission, getFriendApplications, getFriends, getFriendsInfo, getGroupApplications, getGroupFollows, getGroupMembers, getGroupMembersByRole, getGroupsInfo, getHistoryMessages, getJoinedGroups, getJoinedGroupsByRole, getMessage, getMessageCountDetail, getMessageReactionUsers, getMessageReactions, getMessageReadReceiptInfoV5, getMessageReadReceiptInfoV5ByIdentifiers, getMessageReadReceiptV4, getMessageReader, getMessagesByUIds, getMessagesReadReceiptByUsersV5, getMessagesReadReceiptUsersByPageV5, getMyUserProfile, getMyUserProfileVisibility, getNotificationQuietHoursSetting, getProxy, getRealtimeConTotalUnreadCount, getRealtimeConUnreadCounts, getRealtimeConversations, getRemoteHistoryMessages, getRobotById, getServerTime, getSubscribeUserList, getSubscribeUserStatus, getSubscribeUsersOnlineStatus, getTags, getTagsFromConversation, getTextMessageDraft, getTopConversationList, getTotalUnreadCount, getTotalUnreadCountByLevels, getTotalUnreadMentionedCountByLevels, getTranslationLanguage, getUltraGroupDefaultNotificationLevel, getUltraGroupFirstUnreadMessageTimestamp, getUltraGroupList, getUltraGroupMessageListByMessageUId, getUltraGroupUnreadCountByTargetId, getUltraGroupUnreadInfoList, getUltraGroupUnreadMentionedCountByTargetId, getUltraGroupUnreadMentionedMessages, getUnreadConversationList, getUnreadCount, getUnreadCountByTag, getUnreadMentionMeConversationList, getUnreadMentionedCount, getUnreadMentionedMessages, getUserProfiles, init, insertMessage, installPlugin, inviteUsersToGroup, joinChatRoom, joinExistChatRoom, joinGroup, kickGroupMembers, markRemoteConversationAsRead, modifyMessage, modifyMessageWithParams, onceEventListener, quitChatRoom, quitGroup, recallMessage, refreshReferenceMessageWithParams, refuseFriendApplication, refuseGroupApplication, refuseGroupInvite, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeFromBlacklist, removeGroupFollows, removeGroupManagers, removeMessageExpansionForKey, removeMessageReaction, removeMonitor, removeNotificationQuietHoursSetting, removeRealtimeConversations, removeTag, removeTagFromConversations, removeTagsFromConversation, requestSpeechToTextForMessage, requestStreamMessageContent, saveTextMessageDraft, searchConversationByContent$1 as searchConversationByContent, searchFriendsInfo, searchGroupMembers, searchJoinedGroups, searchMessages, searchUserProfileByUniqueId, sendFileMessage, sendGIFMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptMessageV4, sendReadReceiptRequest, sendReadReceiptResponse, sendReadReceiptResponseV2, sendReadReceiptResponseV5, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, sendUltraGroupTypingStatus, setAutoTranslateEnabled, setChatRoomEntries, setChatRoomEntry, setConversationNotificationLevel, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setConversationTypeNotificationLevel, setFriendAddPermission, setFriendInfo, setGroupMemberInfo, setGroupRemark, setMessageReceivedStatus, setNotificationQuietHoursWithSetting, setProxy, setTranslationLanguage, setUltraGroupDefaultNotificationLevel, stopUploadTask, subscribeUserStatus, testProxy, transferGroupOwner, translateMessagesWithParams, translateTextsWithParams, unSubscribeUserStatus, updateExpansionForUltraGroupMessage, updateGroupInfo, updateMessageExpansion, updateMyUserProfile, updateMyUserProfileVisibility, updateTag, upload };
5326
+ export type { CombineV2MessageContent, EventListeners, GetHistoryMessageOption, GetHistoryMessageResult, IAReceivedConversation, IAReceivedConversationByTag, IAReceivedMessage, IAUltraGroupReceivedConversation, IAuditInfo, IBaseConversationInfo, IChatroomJoinOpts, ICombineMessageBody, ICommandMessageBody, IConversationEvent, IConversationState, IConversationUpdateItem, IExtraData, IFileMessageBody, IGIFMessageBody, IGetChatroomInfoOptions, IGetConversationListOptions, IGetMessagesByUIdsParams, IGroupNotificationMessageBody, IHQVoiceMessageBody, IImageMessageBody, IImageMessageOption, IInformationNotificationMessageBody, IInitOption, IInsertOptions, ILocationMessageBody, IMessageReceiptRequestEvent, IMessageReceiptResponseEvent, IMessageResult, IMessagesEvent, IReadReceiptReceivedEvent, IRecallMessageOptions, IReceivedUpdateConversation, IReferenceMessageBody, IRefreshReferenceMessageParams, IRefreshReferenceMessageResult, IRichContentMessageBody, ISearchMessageInTimeRangeOption, ISendBody, ISendFileMessageOptions, ISendImageMessageOptions, ISendMessageOptions, ISendSightMessageOptions, ISightMessageBody, IStreamMessageBody, IStreamMessageResponseEventData, ITextMessageBody, IThumbnailConfig, ITypingStatusEvent, IUploadConfig, IUploadHooks, IUploadInfo, IUploadMessageOption, IUploadResult, IUserInfo, IVoiceMessageBody, MentionedInfoBody, MessageConstructor, Monitor, MonitorableAPI, Transformer };