@rongcloud/imlib-next 5.3.4 → 5.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +275 -45
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1,5 +1,58 @@
|
|
|
1
|
-
import { LogLevel, MessageDirection, IReadReceiptInfo, IPushConfig, IPluginGenerator, IAsyncRes, ConnectionStatus, IEventListener, NotificationStatus, NotificationLevel, IUserProfile, IConversationOption, ConversationType, ErrorCode, IBaseConversationInfo, IConversationState,
|
|
2
|
-
export { ConnectionStatus, ConversationType, ErrorCode, IBlockedMessageInfo, IChatRoomEntries, IChatRoomEntry, IChatroomListenerData, IConversationOption, IConversationState, IDeletedExpansion, IExpansionListenerData, IPluginGenerator, IRTCRoomBindOption, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IUpdatedExpansion, LogLevel, MentionedType, MessageBlockType, MessageDirection, NotificationLevel, NotificationStatus, ReceivedStatus, UploadMethod, logger } from '@rongcloud/engine';
|
|
1
|
+
import { LogLevel, MessageDirection, ReceivedStatus, IReadReceiptInfo, IPushConfig, IPluginGenerator, IAsyncRes, ConnectionStatus, IEventListener, NotificationStatus, NotificationLevel, IUserProfile, IConversationOption, ConversationType, ErrorCode, IBaseConversationInfo, IConversationState, IGetUltraGroupListOption, IUltraGroupConversation, IUltraGroupOption, IChatroomInfo, IChatRoomEntry, IChatroomEntries, IRemoveChatRoomEntry, IRemoveChatRoomEntries, IRTCRoomBindOption, MentionedType, IMessageReaderResponse, IReceivedMessage, IReceivedConversation, ITagParam, ITagInfo, IConversationTag, IReceivedConversationByTag, FileType, IUploadAuth, UploadMethod } from '@rongcloud/engine';
|
|
2
|
+
export { ChatroomEntryType, ChatroomUserChangeType, ConnectionStatus, ConversationType, ErrorCode, FileType, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBlockedMessageInfo, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListenerData, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IConversationOption, IConversationState, IConversationTag, IDeletedExpansion, IEventListener, IExpansionListenerData, IGetUltraGroupListOption, IGooglePushConfig, ILogExtensions, ILogInfo, ILogInit, IMessageReader, IMessageReaderResponse, IPluginGenerator, IPushConfig, IRTCRoomBindOption, IReadReceiptInfo, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, ITagInfo, ITagParam, IUltraGroupConversation, IUltraGroupOption, IUpdatedExpansion, IUploadAuth, IUserProfile, IiOSPushConfig, LogLevel, LogSource, LogTagId, MentionedType, MessageBlockType, MessageDirection, NotificationLevel, NotificationStatus, ReceivedStatus, UltraGroupChannelType, UploadMethod, logger } from '@rongcloud/engine';
|
|
3
|
+
|
|
4
|
+
declare enum Events {
|
|
5
|
+
CONNECTING = "CONNECTING",
|
|
6
|
+
CONNECTED = "CONNECTED",
|
|
7
|
+
DISCONNECT = "DISCONNECT",
|
|
8
|
+
SUSPEND = "SUSPEND",
|
|
9
|
+
MESSAGES = "MESSAGES",
|
|
10
|
+
READ_RECEIPT_RECEIVED = "READ_RECEIPT_RECEIVED",
|
|
11
|
+
MESSAGE_RECEIPT_REQUEST = "MESSAGE_RECEIPT_REQUEST",
|
|
12
|
+
MESSAGE_RECEIPT_RESPONSE = "MESSAGE_RECEIPT_RESPONSE",
|
|
13
|
+
CONVERSATION = "CONVERSATION",
|
|
14
|
+
CHATROOM = "CHATROOM",
|
|
15
|
+
EXPANSION = "EXPANSION",
|
|
16
|
+
PULL_OFFLINE_MESSAGE_FINISHED = "PULL_OFFLINE_MESSAGE_FINISHED",
|
|
17
|
+
TAG = "TAG",
|
|
18
|
+
CONVERSATION_TAG = "CONVERSATION_TAG",
|
|
19
|
+
TYPING_STATUS = "TYPING_STATUS",
|
|
20
|
+
MESSAGE_BLOCKED = "MESSAGE_BLOCKED",
|
|
21
|
+
ULTRA_GROUP_ENABLE = "ULTRA_GROUP_ENABLE",
|
|
22
|
+
OPERATE_STATUS = "OPERATE_STATUS",
|
|
23
|
+
ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED = "ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",
|
|
24
|
+
ULTRA_GROUP_MESSAGE_MODIFIED = "ULTRA_GROUP_MESSAGE_MODIFIED",
|
|
25
|
+
ULTRA_GROUP_MESSAGE_RECALLED = "ULTRA_GROUP_MESSAGE_RECALLED",
|
|
26
|
+
ULTRA_GROUP_CHANNEL_TYPE_CHANGE = "ULTRA_GROUP_CHANNEL_TYPE_CHANGE",
|
|
27
|
+
ULTRA_GROUP_CHANNEL_DELETE = "ULTRA_GROUP_CHANNEL_DELETE",
|
|
28
|
+
ULTRA_GROUP_CHANNEL_USER_KICKED = "ULTRA_GROUP_CHANNEL_USER_KICKED"
|
|
29
|
+
}
|
|
30
|
+
declare enum SentStatus {
|
|
31
|
+
/**
|
|
32
|
+
* 发送中。
|
|
33
|
+
*/
|
|
34
|
+
SENDING = 10,
|
|
35
|
+
/**
|
|
36
|
+
* 发送失败。
|
|
37
|
+
*/
|
|
38
|
+
FAILED = 20,
|
|
39
|
+
/**
|
|
40
|
+
* 已发送。
|
|
41
|
+
*/
|
|
42
|
+
SENT = 30,
|
|
43
|
+
/**
|
|
44
|
+
* 对方已接收。
|
|
45
|
+
*/
|
|
46
|
+
RECEIVED = 40,
|
|
47
|
+
/**
|
|
48
|
+
* 对方已读。
|
|
49
|
+
*/
|
|
50
|
+
READ = 50,
|
|
51
|
+
/**
|
|
52
|
+
* 对方已销毁。
|
|
53
|
+
*/
|
|
54
|
+
DESTROYED = 60
|
|
55
|
+
}
|
|
3
56
|
|
|
4
57
|
declare type IInitOption = {
|
|
5
58
|
/**
|
|
@@ -34,6 +87,10 @@ declare type IInitOption = {
|
|
|
34
87
|
* 是否校验证书,默认为 true
|
|
35
88
|
*/
|
|
36
89
|
checkCA?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* 七牛上传文件地址域名(仅私有云)
|
|
92
|
+
*/
|
|
93
|
+
uploadDomain?: string;
|
|
37
94
|
};
|
|
38
95
|
/**
|
|
39
96
|
* 用户收到的消息结构
|
|
@@ -131,7 +188,11 @@ interface IAReceivedMessage {
|
|
|
131
188
|
/**
|
|
132
189
|
* 消息接收状态
|
|
133
190
|
*/
|
|
134
|
-
receivedStatus:
|
|
191
|
+
receivedStatus: ReceivedStatus;
|
|
192
|
+
/**
|
|
193
|
+
* 消息的发送状态,Electron 平台独有字段
|
|
194
|
+
*/
|
|
195
|
+
sentStatus: SentStatus;
|
|
135
196
|
/**
|
|
136
197
|
* 消息已读回执信息,导航配置grpRRVer=1时群组类型消息内存在, 其他情况为undefined
|
|
137
198
|
*/
|
|
@@ -141,7 +202,7 @@ interface IAReceivedMessage {
|
|
|
141
202
|
*/
|
|
142
203
|
pushConfig?: IPushConfig;
|
|
143
204
|
/**
|
|
144
|
-
*
|
|
205
|
+
* 消息本地 ID,Electron 平台独有字段
|
|
145
206
|
*/
|
|
146
207
|
messageId?: number;
|
|
147
208
|
}
|
|
@@ -161,6 +222,12 @@ declare type GetHistoryMessageOption = {
|
|
|
161
222
|
*/
|
|
162
223
|
order?: 0 | 1;
|
|
163
224
|
};
|
|
225
|
+
interface IGetHistoryMessagesByTypesOption extends GetHistoryMessageOption {
|
|
226
|
+
/**
|
|
227
|
+
* 消息类型
|
|
228
|
+
*/
|
|
229
|
+
messageTypes: string[];
|
|
230
|
+
}
|
|
164
231
|
declare type GetHistoryMessageResult = {
|
|
165
232
|
list: IAReceivedMessage[];
|
|
166
233
|
hasMore: boolean;
|
|
@@ -220,6 +287,10 @@ declare function removeEventListeners(eventType: string): void;
|
|
|
220
287
|
*/
|
|
221
288
|
declare function clearEventListeners(): void;
|
|
222
289
|
declare function __addSDKVersion(name: string, version: string): void;
|
|
290
|
+
/**
|
|
291
|
+
* 获取 deviceId
|
|
292
|
+
*/
|
|
293
|
+
declare function getDeviceId(): string;
|
|
223
294
|
|
|
224
295
|
declare class BaseMessage<T = any> {
|
|
225
296
|
readonly messageType: string;
|
|
@@ -384,6 +455,10 @@ interface ISendMessageOptions {
|
|
|
384
455
|
* 移动端推送配置
|
|
385
456
|
*/
|
|
386
457
|
pushConfig?: IPushConfig;
|
|
458
|
+
/**
|
|
459
|
+
* 消息发送之前的回调
|
|
460
|
+
*/
|
|
461
|
+
onSendBefore?: (message: IAReceivedMessage) => void;
|
|
387
462
|
}
|
|
388
463
|
/**
|
|
389
464
|
* 文件消息配置
|
|
@@ -507,12 +582,22 @@ interface IUploadHooks {
|
|
|
507
582
|
url: string;
|
|
508
583
|
}) => (void | BaseMessage);
|
|
509
584
|
}
|
|
585
|
+
/**
|
|
586
|
+
* 在时间区间内搜索消息的参数配置
|
|
587
|
+
*/
|
|
588
|
+
interface ISearchMessageInTimeRangeOption {
|
|
589
|
+
keyword: string;
|
|
590
|
+
startTime: number;
|
|
591
|
+
endTime: number;
|
|
592
|
+
offset?: number;
|
|
593
|
+
limit?: number;
|
|
594
|
+
}
|
|
510
595
|
|
|
511
596
|
/**
|
|
512
597
|
* 获取会话列表
|
|
513
598
|
* @param options
|
|
514
599
|
*/
|
|
515
|
-
declare function getConversationList(options?: {
|
|
600
|
+
declare function getConversationList$1(options?: {
|
|
516
601
|
/**
|
|
517
602
|
* 会话数量
|
|
518
603
|
*/
|
|
@@ -543,20 +628,20 @@ declare function getConversation(options: IConversationOption): Promise<IAsyncRe
|
|
|
543
628
|
declare function removeConversation(options: IConversationOption): Promise<IAsyncRes<void>>;
|
|
544
629
|
/**
|
|
545
630
|
* 获取会话文本草稿
|
|
546
|
-
* @params conversationType
|
|
631
|
+
* @params conversationType 会话类型
|
|
547
632
|
* @params targetId 目标 ID
|
|
548
633
|
*/
|
|
549
634
|
declare function getTextMessageDraft(options: IConversationOption): Promise<IAsyncRes<string>>;
|
|
550
635
|
/**
|
|
551
636
|
* 设置会话文本草稿
|
|
552
|
-
* @params conversationType
|
|
637
|
+
* @params conversationType 会话类型
|
|
553
638
|
* @params targetId 目标 ID
|
|
554
639
|
* @params draft 草稿内容
|
|
555
640
|
*/
|
|
556
641
|
declare function saveTextMessageDraft(options: IConversationOption, draft: string): Promise<IAsyncRes<void>>;
|
|
557
642
|
/**
|
|
558
643
|
* 删除会话文本草稿
|
|
559
|
-
* @params conversationType
|
|
644
|
+
* @params conversationType 会话类型
|
|
560
645
|
* @params targetId 目标 ID
|
|
561
646
|
*/
|
|
562
647
|
declare function clearTextMessageDraft(options: IConversationOption): Promise<IAsyncRes<void>>;
|
|
@@ -650,7 +735,7 @@ declare function getAllConversationState(): Promise<IAsyncRes<IConversationState
|
|
|
650
735
|
/**
|
|
651
736
|
* 获取超级群会话列表
|
|
652
737
|
*/
|
|
653
|
-
declare function getUltraGroupList(): Promise<IAsyncRes<
|
|
738
|
+
declare function getUltraGroupList(options?: IGetUltraGroupListOption): Promise<IAsyncRes<IUltraGroupConversation[]>>;
|
|
654
739
|
/**
|
|
655
740
|
* 获取超级群免打扰列表
|
|
656
741
|
*/
|
|
@@ -810,6 +895,26 @@ declare function getAllChatRoomEntries(targetId: string): Promise<IAsyncRes<{
|
|
|
810
895
|
declare function getChatroomHistoryMessages(targetId: string, options: GetHistoryMessageOption): Promise<IAsyncRes<GetHistoryMessageResult>>;
|
|
811
896
|
declare function bindRTCRoomForChatroom(option: IRTCRoomBindOption): Promise<IAsyncRes>;
|
|
812
897
|
|
|
898
|
+
/**
|
|
899
|
+
* 添加用户到黑名单
|
|
900
|
+
* @param userId 用户 ID
|
|
901
|
+
*/
|
|
902
|
+
declare function addToBlacklist(userId: string): Promise<IAsyncRes>;
|
|
903
|
+
/**
|
|
904
|
+
* 从黑名单中移除用户
|
|
905
|
+
* @param userId 用户 ID
|
|
906
|
+
*/
|
|
907
|
+
declare function removeFromBlacklist(userId: string): Promise<IAsyncRes>;
|
|
908
|
+
/**
|
|
909
|
+
* 获取黑名单列表
|
|
910
|
+
*/
|
|
911
|
+
declare function getBlacklist(): Promise<IAsyncRes<string[]>>;
|
|
912
|
+
/**
|
|
913
|
+
* 查询用户是否在黑名单中
|
|
914
|
+
* @param userId 用户 ID
|
|
915
|
+
*/
|
|
916
|
+
declare function getBlacklistStatus(userId: string): Promise<IAsyncRes<boolean>>;
|
|
917
|
+
|
|
813
918
|
/**
|
|
814
919
|
* 群组内的消息包含的 @ 数据
|
|
815
920
|
*/
|
|
@@ -1083,7 +1188,7 @@ declare function sendSyncReadStatusMessage(conversation: IConversationOption, la
|
|
|
1083
1188
|
code: ErrorCode.SUCCESS;
|
|
1084
1189
|
msg?: undefined;
|
|
1085
1190
|
} | {
|
|
1086
|
-
code: ErrorCode.TIMEOUT | ErrorCode.UNKNOWN | ErrorCode.PARAMETER_ERROR | ErrorCode.EXTRA_METHOD_UNDEFINED | ErrorCode.MAIN_PROCESS_ERROR | ErrorCode.PARAMETER_CHANGED | ErrorCode.
|
|
1191
|
+
code: ErrorCode.TIMEOUT | ErrorCode.UNKNOWN | ErrorCode.PARAMETER_ERROR | ErrorCode.EXTRA_METHOD_UNDEFINED | ErrorCode.MAIN_PROCESS_ERROR | ErrorCode.PARAMETER_CHANGED | ErrorCode.RC_DISCUSSION_GROUP_ID_INVALID | ErrorCode.SEND_FREQUENCY_TOO_FAST | ErrorCode.NOT_IN_DISCUSSION | ErrorCode.FORBIDDEN_IN_GROUP | ErrorCode.RECALL_MESSAGE | ErrorCode.NOT_IN_GROUP | ErrorCode.NOT_IN_CHATROOM | ErrorCode.FORBIDDEN_IN_CHATROOM | ErrorCode.RC_CHATROOM_USER_KICKED | ErrorCode.RC_CHATROOM_NOT_EXIST | ErrorCode.RC_CHATROOM_IS_FULL | ErrorCode.RC_CHATROOM_PATAMETER_INVALID | ErrorCode.CHATROOM_GET_HISTORYMSG_ERROR | ErrorCode.CHATROOM_NOT_OPEN_HISTORYMSG_STORE | ErrorCode.CHATROOM_KV_EXCEED | ErrorCode.CHATROOM_KV_OVERWRITE_INVALID | ErrorCode.CHATROOM_KV_STORE_NOT_OPEN | ErrorCode.CHATROOM_KEY_NOT_EXIST | ErrorCode.CHATROOM_KV_SET_ERROR | ErrorCode.SENSITIVE_SHIELD | ErrorCode.SENSITIVE_REPLACE | ErrorCode.JOIN_IN_DISCUSSION | ErrorCode.CREATE_DISCUSSION | ErrorCode.INVITE_DICUSSION | ErrorCode.GET_USERINFO_ERROR | ErrorCode.REJECTED_BY_BLACKLIST | ErrorCode.RC_NET_CHANNEL_INVALID | ErrorCode.RC_NET_UNAVAILABLE | ErrorCode.RC_MSG_RESP_TIMEOUT | ErrorCode.RC_HTTP_SEND_FAIL | ErrorCode.RC_HTTP_REQ_TIMEOUT | ErrorCode.RC_HTTP_RECV_FAIL | ErrorCode.RC_NAVI_RESOURCE_ERROR | ErrorCode.RC_NODE_NOT_FOUND | ErrorCode.RC_DOMAIN_NOT_RESOLVE | ErrorCode.RC_SOCKET_NOT_CREATED | ErrorCode.RC_SOCKET_DISCONNECTED | ErrorCode.RC_PING_SEND_FAIL | ErrorCode.RC_PONG_RECV_FAIL | ErrorCode.RC_MSG_SEND_FAIL | ErrorCode.RC_MSG_CONTENT_EXCEED_LIMIT | ErrorCode.RC_CONN_ACK_TIMEOUT | ErrorCode.RC_CONN_PROTO_VERSION_ERROR | ErrorCode.RC_CONN_ID_REJECT | ErrorCode.RC_CONN_SERVER_UNAVAILABLE | ErrorCode.RC_CONN_USER_OR_PASSWD_ERROR | ErrorCode.RC_CONN_NOT_AUTHRORIZED | ErrorCode.RC_CONN_REDIRECTED | ErrorCode.RC_CONN_PACKAGE_NAME_INVALID | ErrorCode.RC_CONN_APP_BLOCKED_OR_DELETED | ErrorCode.RC_CONN_USER_BLOCKED | ErrorCode.RC_DISCONN_KICK | ErrorCode.RC_DISCONN_EXCEPTION | ErrorCode.RC_DISCONN_SAME_CLIENT_ON_LINE | ErrorCode.RC_APP_AUTH_NOT_PASS | ErrorCode.RC_OTP_USED | ErrorCode.RC_PLATFORM_ERROR | ErrorCode.RC_QUERY_ACK_NO_DATA | ErrorCode.RC_MSG_DATA_INCOMPLETE | ErrorCode.BIZ_ERROR_CLIENT_NOT_INIT | ErrorCode.BIZ_ERROR_DATABASE_ERROR | ErrorCode.BIZ_ERROR_INVALID_PARAMETER | ErrorCode.BIZ_ERROR_NO_CHANNEL | ErrorCode.BIZ_ERROR_RECONNECT_SUCCESS | ErrorCode.BIZ_ERROR_CONNECTING | ErrorCode.MSG_ROAMING_SERVICE_UNAVAILABLE | ErrorCode.MSG_INSERT_ERROR | ErrorCode.MSG_DEL_ERROR | ErrorCode.TAG_EXISTS | ErrorCode.TAG_NOT_EXIST | ErrorCode.NO_TAG_IN_CONVER | ErrorCode.CONVER_REMOVE_ERROR | ErrorCode.CONVER_GETLIST_ERROR | ErrorCode.CONVER_SETOP_ERROR | ErrorCode.CONVER_TOTAL_UNREAD_ERROR | ErrorCode.CONVER_TYPE_UNREAD_ERROR | ErrorCode.CONVER_ID_TYPE_UNREAD_ERROR | ErrorCode.EXPANSION_LIMIT_EXCEET | ErrorCode.MESSAGE_KV_NOT_SUPPORT | ErrorCode.CONVER_OUT_LIMIT_ERROR | ErrorCode.CONVER_GET_ERROR | ErrorCode.GROUP_SYNC_ERROR | ErrorCode.GROUP_MATCH_ERROR | ErrorCode.READ_RECEIPT_ERROR | ErrorCode.PACKAGE_ENVIRONMENT_ERROR | ErrorCode.CAN_NOT_RECONNECT | ErrorCode.SERVER_UNAVAILABLE | ErrorCode.HOSTNAME_ERROR | ErrorCode.HAS_OHTER_SAME_CLIENT_ON_LINE | ErrorCode.METHOD_NOT_AVAILABLE | ErrorCode.METHOD_NOT_SUPPORT | ErrorCode.MSG_LIMIT_ERROR | ErrorCode.METHOD_ONLY_SUPPORT_ULTRA_GROUP | ErrorCode.UPLOAD_FILE_FAILED | ErrorCode.CHATROOM_ID_ISNULL | ErrorCode.CHARTOOM_JOIN_ERROR | ErrorCode.CHATROOM_HISMESSAGE_ERROR | ErrorCode.CHATROOM_KV_NOT_FOUND | ErrorCode.BLACK_ADD_ERROR | ErrorCode.BLACK_GETSTATUS_ERROR | ErrorCode.BLACK_REMOVE_ERROR | ErrorCode.DRAF_GET_ERROR | ErrorCode.DRAF_SAVE_ERROR | ErrorCode.DRAF_REMOVE_ERROR | ErrorCode.SUBSCRIBE_ERROR | ErrorCode.NOT_SUPPORT | ErrorCode.QNTKN_FILETYPE_ERROR | ErrorCode.QNTKN_GET_ERROR | ErrorCode.COOKIE_ENABLE | ErrorCode.HAVNODEVICEID | ErrorCode.DEVICEIDISHAVE | ErrorCode.FEILD | ErrorCode.VOIPISNULL | ErrorCode.NOENGINETYPE | ErrorCode.NULLCHANNELNAME | ErrorCode.VOIPDYANMICERROR | ErrorCode.NOVOIP | ErrorCode.INTERNALERRROR | ErrorCode.VOIPCLOSE | ErrorCode.ULTRA_GROUP_USER_NOT_IN_PRIVATE_CHANNEL | ErrorCode.CANCEL | ErrorCode.REJECT | ErrorCode.HANGUP | ErrorCode.BUSYLINE | ErrorCode.NO_RESPONSE | ErrorCode.ENGINE_UN_SUPPORTED | ErrorCode.NETWORK_ERROR | ErrorCode.REMOTE_CANCEL | ErrorCode.REMOTE_REJECT | ErrorCode.REMOTE_HANGUP | ErrorCode.REMOTE_BUSYLINE | ErrorCode.REMOTE_NO_RESPONSE | ErrorCode.REMOTE_ENGINE_UN_SUPPORTED | ErrorCode.REMOTE_NETWORK_ERROR | ErrorCode.VOIP_NOT_AVALIABLE | ErrorCode.CHATROOM_KV_STORE_NOT_ALL_SUCCESS | ErrorCode.CHATROOM_KV_STORE_OUT_LIMIT;
|
|
1087
1192
|
msg: string | undefined;
|
|
1088
1193
|
}>;
|
|
1089
1194
|
/**
|
|
@@ -1092,9 +1197,9 @@ declare function sendSyncReadStatusMessage(conversation: IConversationOption, la
|
|
|
1092
1197
|
*/
|
|
1093
1198
|
declare function recallMessage(conversation: IConversationOption, options: IRecallMessageOptions): Promise<IAsyncRes<IAReceivedMessage>>;
|
|
1094
1199
|
/**
|
|
1095
|
-
* 按消息
|
|
1200
|
+
* 按消息 UId 删除消息
|
|
1096
1201
|
*/
|
|
1097
|
-
declare function deleteMessages(conversation: IConversationOption, messages: {
|
|
1202
|
+
declare function deleteMessages$1(conversation: IConversationOption, messages: {
|
|
1098
1203
|
/**
|
|
1099
1204
|
* 消息 id
|
|
1100
1205
|
*/
|
|
@@ -1161,8 +1266,9 @@ declare function getFirstUnreadMessage(conversation: IConversationOption): Promi
|
|
|
1161
1266
|
* @param targetId 目标 ID
|
|
1162
1267
|
* @param content 消息体
|
|
1163
1268
|
* @param callback
|
|
1269
|
+
* @deprecated
|
|
1164
1270
|
*/
|
|
1165
|
-
declare function insertMessage(conversation: IConversationOption, content: IReceivedMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
|
|
1271
|
+
declare function insertMessage$1(conversation: IConversationOption, content: IReceivedMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
|
|
1166
1272
|
/**
|
|
1167
1273
|
* 获取消息
|
|
1168
1274
|
* @param messageId 本地消息 ID 或 messageUId
|
|
@@ -1176,12 +1282,14 @@ declare function getMessage(messageId: number): Promise<IAsyncRes<IAReceivedMess
|
|
|
1176
1282
|
declare function getUnreadMentionedMessages(conversation: IConversationOption): IAsyncRes<IAReceivedMessage[]>;
|
|
1177
1283
|
/**
|
|
1178
1284
|
* 按关键字搜索会话内的消息
|
|
1285
|
+
* @deprecated 已废弃,推荐使用 electronExtension.searchMessages 方法
|
|
1179
1286
|
* @param conversation 会话
|
|
1180
1287
|
* @param keyword 搜索内容
|
|
1181
1288
|
* @param timestamp 搜索时间, 搜索该时间之前的消息
|
|
1182
1289
|
* @param count 获取的数量
|
|
1290
|
+
* @deprecated
|
|
1183
1291
|
*/
|
|
1184
|
-
declare function searchMessages(conversation: IConversationOption, keyword: string, timestamp: number, count: number): Promise<IAsyncRes<{
|
|
1292
|
+
declare function searchMessages$1(conversation: IConversationOption, keyword: string, timestamp: number, count: number): Promise<IAsyncRes<{
|
|
1185
1293
|
messages: IAReceivedMessage[];
|
|
1186
1294
|
count: number | undefined;
|
|
1187
1295
|
}>>;
|
|
@@ -1191,21 +1299,22 @@ declare function searchMessages(conversation: IConversationOption, keyword: stri
|
|
|
1191
1299
|
* @param timestamp 指定删除该时间戳之前的消息
|
|
1192
1300
|
* @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
|
|
1193
1301
|
* 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
|
|
1302
|
+
* @deprecated
|
|
1194
1303
|
*/
|
|
1195
1304
|
declare function deleteLocalMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<IAsyncRes<void>>;
|
|
1196
1305
|
/**
|
|
1197
1306
|
* 清空会话下历史消息
|
|
1198
|
-
* @param
|
|
1199
|
-
* @
|
|
1200
|
-
* @param callback
|
|
1307
|
+
* @param conversation 会话
|
|
1308
|
+
* @deprecated
|
|
1201
1309
|
*/
|
|
1202
|
-
declare function clearMessages(conversation: IConversationOption): Promise<IAsyncRes<void>>;
|
|
1310
|
+
declare function clearMessages$1(conversation: IConversationOption): Promise<IAsyncRes<void>>;
|
|
1203
1311
|
/**
|
|
1204
1312
|
* 按内容搜索会话
|
|
1205
1313
|
* @param keyword 关键字
|
|
1206
1314
|
* @param conversationTypes 会话类型数组
|
|
1315
|
+
* @deprecated
|
|
1207
1316
|
*/
|
|
1208
|
-
declare function searchConversationByContent(keyword: string, conversationTypes?: ConversationType[], customMessageType?: string[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[] | undefined>>;
|
|
1317
|
+
declare function searchConversationByContent$1(keyword: string, conversationTypes?: ConversationType[], customMessageType?: string[], channelId?: string): Promise<IAsyncRes<IReceivedConversation[] | undefined>>;
|
|
1209
1318
|
/**
|
|
1210
1319
|
* 清除时间戳前的未读数
|
|
1211
1320
|
* @param conversationType 会话类型
|
|
@@ -1216,8 +1325,9 @@ declare function searchConversationByContent(keyword: string, conversationTypes?
|
|
|
1216
1325
|
declare function clearUnreadCountByTimestamp(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<void>>;
|
|
1217
1326
|
/**
|
|
1218
1327
|
* 设置消息接收状态
|
|
1328
|
+
* @deprecated
|
|
1219
1329
|
*/
|
|
1220
|
-
declare function setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<IAsyncRes<void>>;
|
|
1330
|
+
declare function setMessageReceivedStatus$1(messageId: number, receivedStatus: number): Promise<IAsyncRes<void>>;
|
|
1221
1331
|
|
|
1222
1332
|
/**
|
|
1223
1333
|
* 创建标签
|
|
@@ -1288,30 +1398,6 @@ declare function getUnreadCountByTag(tagId: string, containMuted: boolean): Prom
|
|
|
1288
1398
|
*/
|
|
1289
1399
|
declare function setConversationToTopInTag(tagId: string, conversation: IConversationOption, isTop: boolean): Promise<IAsyncRes<void>>;
|
|
1290
1400
|
|
|
1291
|
-
declare enum Events {
|
|
1292
|
-
CONNECTING = "CONNECTING",
|
|
1293
|
-
CONNECTED = "CONNECTED",
|
|
1294
|
-
DISCONNECT = "DISCONNECT",
|
|
1295
|
-
SUSPEND = "SUSPEND",
|
|
1296
|
-
MESSAGES = "MESSAGES",
|
|
1297
|
-
READ_RECEIPT_RECEIVED = "READ_RECEIPT_RECEIVED",
|
|
1298
|
-
MESSAGE_RECEIPT_REQUEST = "MESSAGE_RECEIPT_REQUEST",
|
|
1299
|
-
MESSAGE_RECEIPT_RESPONSE = "MESSAGE_RECEIPT_RESPONSE",
|
|
1300
|
-
CONVERSATION = "CONVERSATION",
|
|
1301
|
-
CHATROOM = "CHATROOM",
|
|
1302
|
-
EXPANSION = "EXPANSION",
|
|
1303
|
-
PULL_OFFLINE_MESSAGE_FINISHED = "PULL_OFFLINE_MESSAGE_FINISHED",
|
|
1304
|
-
TAG = "TAG",
|
|
1305
|
-
CONVERSATION_TAG = "CONVERSATION_TAG",
|
|
1306
|
-
TYPING_STATUS = "TYPING_STATUS",
|
|
1307
|
-
MESSAGE_BLOCKED = "MESSAGE_BLOCKED",
|
|
1308
|
-
ULTRA_GROUP_ENABLE = "ULTRA_GROUP_ENABLE",
|
|
1309
|
-
OPERATE_STATUS = "OPERATE_STATUS",
|
|
1310
|
-
ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED = "ULTRA_GROUP_MESSAGE_EXPANSION_UPDATED",
|
|
1311
|
-
ULTRA_GROUP_MESSAGE_MODIFIED = "ULTRA_GROUP_MESSAGE_MODIFIED",
|
|
1312
|
-
ULTRA_GROUP_MESSAGE_RECALLED = "ULTRA_GROUP_MESSAGE_RECALLED"
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
1401
|
/**
|
|
1316
1402
|
* 获取文件 token
|
|
1317
1403
|
* @description 上传文件时,获取文件 token
|
|
@@ -1369,4 +1455,148 @@ declare const MessageType: {
|
|
|
1369
1455
|
RECALL_MESSAGE_TYPE: string;
|
|
1370
1456
|
};
|
|
1371
1457
|
|
|
1372
|
-
|
|
1458
|
+
/**
|
|
1459
|
+
* 获取全部会话列表
|
|
1460
|
+
* @param channelId 频道 ID,不传则获取全部频道 ID 类型
|
|
1461
|
+
*/
|
|
1462
|
+
declare function getAllConversationList(channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
|
|
1463
|
+
/**
|
|
1464
|
+
* 获取会话列表
|
|
1465
|
+
* @param startTime 起始时间
|
|
1466
|
+
* @param count 数量
|
|
1467
|
+
* @param channelId 频道 ID,不传则获取全部频道 ID 类型
|
|
1468
|
+
*/
|
|
1469
|
+
declare function getConversationList(startTime: number, count: number, channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
|
|
1470
|
+
/**
|
|
1471
|
+
* 根据消息内容搜索会话列表
|
|
1472
|
+
* @param keyword 搜索关键字
|
|
1473
|
+
* @param messageTypes 消息类型
|
|
1474
|
+
* @param channelId 频道 ID,不传则获取全部频道 ID 类型
|
|
1475
|
+
*/
|
|
1476
|
+
declare function searchConversationByContent(keyword: string, messageTypes: string[], channelId?: string): Promise<IAsyncRes<IAReceivedConversation[]>>;
|
|
1477
|
+
|
|
1478
|
+
/**
|
|
1479
|
+
* 搜索消息
|
|
1480
|
+
* 如果不传 channelId,则在所有 channelId 中搜索消息
|
|
1481
|
+
* @param conversation 会话
|
|
1482
|
+
* @param keyword 搜索关键字
|
|
1483
|
+
* @param startTime 搜索起始时间
|
|
1484
|
+
* @param count 数量
|
|
1485
|
+
*/
|
|
1486
|
+
declare function searchMessages(conversation: IConversationOption, keyword: string, startTime: number, count: number): Promise<IAsyncRes<{
|
|
1487
|
+
messages: IAReceivedMessage[];
|
|
1488
|
+
count: number | undefined;
|
|
1489
|
+
}>>;
|
|
1490
|
+
/**
|
|
1491
|
+
* 在时间范围内搜索消息
|
|
1492
|
+
* @param conversation 会话
|
|
1493
|
+
* @param option 配置
|
|
1494
|
+
*/
|
|
1495
|
+
declare function searchMessageInTimeRange(conversation: {
|
|
1496
|
+
conversationType: ConversationType;
|
|
1497
|
+
targetId: string;
|
|
1498
|
+
}, option: ISearchMessageInTimeRangeOption): Promise<IAsyncRes<{
|
|
1499
|
+
messages: IAReceivedMessage[];
|
|
1500
|
+
}>>;
|
|
1501
|
+
/**
|
|
1502
|
+
* 获取指定消息类型的历史消息
|
|
1503
|
+
* @param conversation 会话
|
|
1504
|
+
* @param option 配置参数
|
|
1505
|
+
*/
|
|
1506
|
+
declare function getHistoryMessagesByMessageTypes(conversation: IConversationOption, option: IGetHistoryMessagesByTypesOption): Promise<IAsyncRes<{
|
|
1507
|
+
messages: IAReceivedMessage[];
|
|
1508
|
+
hasMore: boolean;
|
|
1509
|
+
}>>;
|
|
1510
|
+
/**
|
|
1511
|
+
* 将自己发送的指定时间之前的消息标记对方已读,状态值为 SentStatus.READ
|
|
1512
|
+
* @param conversation 会话
|
|
1513
|
+
* @param timestamp 时间戳
|
|
1514
|
+
*/
|
|
1515
|
+
declare function setMessageStatusToRead(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes<boolean>>;
|
|
1516
|
+
/**
|
|
1517
|
+
* 设置对方发送的消息 自己的接受状态
|
|
1518
|
+
* @param messageId 消息 ID
|
|
1519
|
+
* @param receivedStatus 接受状态
|
|
1520
|
+
*/
|
|
1521
|
+
declare function setMessageReceivedStatus(messageId: number, receivedStatus: ReceivedStatus): Promise<IAsyncRes>;
|
|
1522
|
+
/**
|
|
1523
|
+
* 设置自己发送的消息的发送状态
|
|
1524
|
+
* @param messageId 消息ID
|
|
1525
|
+
* @param sentStatus 发送状态
|
|
1526
|
+
*/
|
|
1527
|
+
declare function setMessageSentStatus(messageId: number, sentStatus: SentStatus): Promise<IAsyncRes>;
|
|
1528
|
+
/**
|
|
1529
|
+
* 修改消息内容
|
|
1530
|
+
* @param messageId 消息 ID
|
|
1531
|
+
* @param content 消息 content
|
|
1532
|
+
* @param messageType 消息类型,如果设置了消息类型,会使该消息无法被搜索
|
|
1533
|
+
*/
|
|
1534
|
+
declare function setMessageContent(messageId: number, content: Object, messageType?: string): Promise<IAsyncRes>;
|
|
1535
|
+
/**
|
|
1536
|
+
* 删除消息
|
|
1537
|
+
* @param messageIds 消息 ID 列表, 需是同一会话的消息
|
|
1538
|
+
*/
|
|
1539
|
+
declare function deleteMessages(messageIds: number[]): Promise<IAsyncRes>;
|
|
1540
|
+
/**
|
|
1541
|
+
* 清空会话下历史消息
|
|
1542
|
+
* @param conversation 会话
|
|
1543
|
+
*/
|
|
1544
|
+
declare function clearMessages(conversation: IConversationOption): Promise<IAsyncRes<void>>;
|
|
1545
|
+
/**
|
|
1546
|
+
* 从本地消息数据库中删除某一会话指定时间之前的消息数据
|
|
1547
|
+
* @param conversation 会话
|
|
1548
|
+
* @param timestamp 指定删除该时间戳之前的消息
|
|
1549
|
+
* @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
|
|
1550
|
+
* 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
|
|
1551
|
+
*/
|
|
1552
|
+
declare function deleteMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<IAsyncRes<void>>;
|
|
1553
|
+
/**
|
|
1554
|
+
* 向本地插入一条消息,不发送到服务器
|
|
1555
|
+
* @param conversationType 会话类型
|
|
1556
|
+
* @param targetId 目标 ID
|
|
1557
|
+
* @param message 消息体
|
|
1558
|
+
* @param callback
|
|
1559
|
+
*/
|
|
1560
|
+
declare function insertMessage(conversation: IConversationOption, message: IAReceivedMessage, options?: IInsertOptions): Promise<IAsyncRes<IAReceivedMessage>>;
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* 清除本地数据, 包括消息列表、会话列表、拉取消息的时间戳
|
|
1564
|
+
*/
|
|
1565
|
+
declare function clearLocalData(): Promise<IAsyncRes<boolean>>;
|
|
1566
|
+
|
|
1567
|
+
declare const index_getAllConversationList: typeof getAllConversationList;
|
|
1568
|
+
declare const index_getConversationList: typeof getConversationList;
|
|
1569
|
+
declare const index_searchConversationByContent: typeof searchConversationByContent;
|
|
1570
|
+
declare const index_searchMessages: typeof searchMessages;
|
|
1571
|
+
declare const index_searchMessageInTimeRange: typeof searchMessageInTimeRange;
|
|
1572
|
+
declare const index_getHistoryMessagesByMessageTypes: typeof getHistoryMessagesByMessageTypes;
|
|
1573
|
+
declare const index_setMessageStatusToRead: typeof setMessageStatusToRead;
|
|
1574
|
+
declare const index_setMessageReceivedStatus: typeof setMessageReceivedStatus;
|
|
1575
|
+
declare const index_setMessageSentStatus: typeof setMessageSentStatus;
|
|
1576
|
+
declare const index_setMessageContent: typeof setMessageContent;
|
|
1577
|
+
declare const index_deleteMessages: typeof deleteMessages;
|
|
1578
|
+
declare const index_clearMessages: typeof clearMessages;
|
|
1579
|
+
declare const index_deleteMessagesByTimestamp: typeof deleteMessagesByTimestamp;
|
|
1580
|
+
declare const index_insertMessage: typeof insertMessage;
|
|
1581
|
+
declare const index_clearLocalData: typeof clearLocalData;
|
|
1582
|
+
declare namespace index {
|
|
1583
|
+
export {
|
|
1584
|
+
index_getAllConversationList as getAllConversationList,
|
|
1585
|
+
index_getConversationList as getConversationList,
|
|
1586
|
+
index_searchConversationByContent as searchConversationByContent,
|
|
1587
|
+
index_searchMessages as searchMessages,
|
|
1588
|
+
index_searchMessageInTimeRange as searchMessageInTimeRange,
|
|
1589
|
+
index_getHistoryMessagesByMessageTypes as getHistoryMessagesByMessageTypes,
|
|
1590
|
+
index_setMessageStatusToRead as setMessageStatusToRead,
|
|
1591
|
+
index_setMessageReceivedStatus as setMessageReceivedStatus,
|
|
1592
|
+
index_setMessageSentStatus as setMessageSentStatus,
|
|
1593
|
+
index_setMessageContent as setMessageContent,
|
|
1594
|
+
index_deleteMessages as deleteMessages,
|
|
1595
|
+
index_clearMessages as clearMessages,
|
|
1596
|
+
index_deleteMessagesByTimestamp as deleteMessagesByTimestamp,
|
|
1597
|
+
index_insertMessage as insertMessage,
|
|
1598
|
+
index_clearLocalData as clearLocalData,
|
|
1599
|
+
};
|
|
1600
|
+
}
|
|
1601
|
+
|
|
1602
|
+
export { BaseMessage, _default$6 as CombineMessage, ConnectType, Events, _default$5 as FileMessage, _default$4 as GIFMessage, GetHistoryMessageOption, GetHistoryMessageResult, _default$9 as HQVoiceMessage, IAReceivedConversation, IAReceivedMessage, ICombineMessageBody, IConversationUpdateItem, IExtraData, IFileMessageBody, IGIFMessageBody, IGetHistoryMessagesByTypesOption, IHQVoiceMessageBody, IImageMessageBody, IImageMessageOption, IInitOption, IInsertOptions, ILocationMessageBody, IMessageDesc, IRecallMessageOptions, IReceivedUpdateConversation, IReferenceMessageBody, IRichContentMessageBody, ISearchMessageInTimeRangeOption, ISendBody, ISendFileMessageOptions, ISendImageMessageOptions, ISendMessageOptions, ISendSightMessageOptions, ISightMessageBody, ITextMessageBody, IThumbnailConfig, IUploadHooks, IUploadMessageOption, IUserInfo, IVoiceMessageBody, _default$a as ImageMessage, _default$2 as LocationMessage, MentionedInfo$1 as MentionedInfo, MentionedInfo as MentionedInfoBody, MessageConstructor, MessageType, _default$1 as ReferenceMessage, _default as RichContentMessage, SentStatus, _default$8 as SightMessage, _default$7 as TextMessage, _default$3 as VoiceMessage, __addSDKVersion, addConversationsToTag, addEventListener, addTag, addToBlacklist, bindRTCRoomForChatroom, clearAllMessagesUnreadStatus, clearEventListeners, clearHistoryMessages, clearMessages$1 as clearMessages, clearMessagesUnreadStatus, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, deleteLocalMessagesByTimestamp, deleteMessages$1 as deleteMessages, disconnect, index as electronExtension, forceRemoveChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, getAllConversationState, getAllUltraGroupUnreadCount, getAllUltraGroupUnreadMentionedCount, getAllUnreadMentionedCount, getBlacklist, getBlacklistStatus, getBlockUltraGroupList, getBlockedConversationList, getChatRoomEntry, getChatRoomInfo, getChatroomHistoryMessages, getConnectionStatus, getConversation, getConversationList$1 as getConversationList, getConversationNotificationLevel, getConversationNotificationStatus, getConversationsFromTagByPage, getCurrentUserId, getDeviceId, getFileToken, getFileUrl, getFirstUnreadMessage, getHistoryMessages, getMessage, getMessageReader, getRemoteHistoryMessages, getServerTime, getTags, getTagsFromConversation, getTextMessageDraft, getTopConversationList, getTotalUnreadCount, getUltraGroupDefaultNotificationLevel, getUltraGroupList, getUltraGroupMessageListByMessageUId, getUltraGroupUnreadCountByTargetId, getUltraGroupUnreadMentionedCountByTargetId, getUnreadCount, getUnreadCountByTag, getUnreadMentionedCount, getUnreadMentionedMessages, init, insertMessage$1 as insertMessage, installPlugin, joinChatRoom, joinExistChatRoom, modifyMessage, onceEventListener, quitChatRoom, recallMessage, registerMessageType, removeAllExpansionForUltraGroupMessage, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEventListener, removeEventListeners, removeExpansionForUltraGroupMessage, removeFromBlacklist, removeMessageExpansionForKey, removeTag, removeTagFromConversations, removeTagsFromConversation, saveTextMessageDraft, searchConversationByContent$1 as searchConversationByContent, searchMessages$1 as searchMessages, sendFileMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptRequest, sendReadReceiptResponse, sendReadReceiptResponseV2, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, sendUltraGroupTypingStatus, setChatRoomEntries, setChatRoomEntry, setConversationNotificationLevel, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setMessageReceivedStatus$1 as setMessageReceivedStatus, setUltraGroupDefaultNotificationLevel, updateExpansionForUltraGroupMessage, updateMessageExpansion, updateTag };
|