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