@rongcloud/imlib-next 5.0.0-alpha.2 → 5.0.0-alpha.3
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/dist/index.d.ts +37 -57
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { LogLevel, MessageDirection, IReadReceiptInfo, IPushConfig, IPluginGenerator, ConnectionStatus, IEventListener, NotificationStatus, IConversationOption,
|
|
2
|
-
export { ConnectionStatus, ConversationType, IChatroomListenerData, IConversationOption, IDeletedExpansion, IExpansionListenerData, IPluginGenerator, IUpdatedExpansion, LogLevel, MessageDirection, NotificationStatus, ReceivedStatus, UploadMethod } from '@rongcloud/engine';
|
|
1
|
+
import { LogLevel, MessageDirection, IReadReceiptInfo, IPushConfig, IPluginGenerator, ConnectionStatus, IEventListener, NotificationStatus, IConversationOption, ConversationType, IChatroomInfo, IChatRoomEntry, IChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatRoomEntries, ErrorCode, IUserProfile, IMessageReaderResponse, IAsyncRes, IReceivedMessage, IReceivedConversation, ITagParam, ITagInfo, IConversationTag, IReceivedConversationByTag } from '@rongcloud/engine';
|
|
2
|
+
export { ConnectionStatus, ConversationType, IChatRoomEntries, IChatRoomEntry, IChatroomListenerData, IConversationOption, IDeletedExpansion, IExpansionListenerData, IPluginGenerator, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IUpdatedExpansion, LogLevel, MessageDirection, MessageType, NotificationStatus, ReceivedStatus, UploadMethod } from '@rongcloud/engine';
|
|
3
3
|
|
|
4
4
|
declare type IInitOption = {
|
|
5
5
|
/**
|
|
@@ -140,31 +140,11 @@ interface IAReceivedMessage {
|
|
|
140
140
|
* 推送扩展
|
|
141
141
|
*/
|
|
142
142
|
pushConfig?: IPushConfig;
|
|
143
|
+
/**
|
|
144
|
+
* CPP 独有字段 消息本地 ID
|
|
145
|
+
*/
|
|
146
|
+
messageId?: number;
|
|
143
147
|
}
|
|
144
|
-
declare type ISetChatroomEntryOption = {
|
|
145
|
-
key: string;
|
|
146
|
-
value: string;
|
|
147
|
-
isAutoDelete?: boolean;
|
|
148
|
-
isSendNotification?: boolean;
|
|
149
|
-
notificationExtra?: string;
|
|
150
|
-
};
|
|
151
|
-
declare type ISetChatroomEntriesOption = {
|
|
152
|
-
entries: {
|
|
153
|
-
key: string;
|
|
154
|
-
value: string;
|
|
155
|
-
}[];
|
|
156
|
-
isAutoDelete?: boolean;
|
|
157
|
-
notificationExtra?: string;
|
|
158
|
-
};
|
|
159
|
-
declare type IRemoveChatroomEntryOption = {
|
|
160
|
-
key: string;
|
|
161
|
-
isSendNotification?: boolean;
|
|
162
|
-
notificationExtra?: string;
|
|
163
|
-
};
|
|
164
|
-
declare type IRemoveChatroomEntriesOption = {
|
|
165
|
-
entries: string[];
|
|
166
|
-
notificationExtra?: string;
|
|
167
|
-
};
|
|
168
148
|
declare type GetHistoryMessageOption = {
|
|
169
149
|
/**
|
|
170
150
|
* 获取此时间之前的消息,0 为从当前时间拉取
|
|
@@ -318,6 +298,7 @@ interface IAReceivedConversation {
|
|
|
318
298
|
* 会话是否置顶
|
|
319
299
|
*/
|
|
320
300
|
isTop?: boolean;
|
|
301
|
+
channelId?: string;
|
|
321
302
|
}
|
|
322
303
|
interface ISendMessageOptions {
|
|
323
304
|
/**
|
|
@@ -450,7 +431,7 @@ declare function getConversationList(options: {
|
|
|
450
431
|
*/
|
|
451
432
|
declare function getConversation(options: IConversationOption): Promise<{
|
|
452
433
|
code: number;
|
|
453
|
-
data:
|
|
434
|
+
data: IAReceivedConversation | null | undefined;
|
|
454
435
|
}>;
|
|
455
436
|
/**
|
|
456
437
|
* 移除指定的会话实例
|
|
@@ -513,12 +494,12 @@ declare function clearMessagesUnreadStatus(options: IConversationOption): Promis
|
|
|
513
494
|
* * 1: 开启免打扰
|
|
514
495
|
* * 2: 关闭免打扰
|
|
515
496
|
*/
|
|
516
|
-
declare function setConversationNotificationStatus(
|
|
497
|
+
declare function setConversationNotificationStatus(options: IConversationOption, notificationStatus: NotificationStatus): Promise<void>;
|
|
517
498
|
/**
|
|
518
499
|
* 获取免打扰状态
|
|
519
500
|
* getConversationNotificationStatus
|
|
520
501
|
*/
|
|
521
|
-
declare function getConversationNotificationStatus(
|
|
502
|
+
declare function getConversationNotificationStatus(options: IConversationOption): Promise<{
|
|
522
503
|
code: number;
|
|
523
504
|
data: NotificationStatus | undefined;
|
|
524
505
|
}>;
|
|
@@ -530,7 +511,7 @@ declare function getBlockedConversationList(conversationTypeList: ConversationTy
|
|
|
530
511
|
/**
|
|
531
512
|
* 设置会话是否置顶
|
|
532
513
|
*/
|
|
533
|
-
declare function setConversationToTop(
|
|
514
|
+
declare function setConversationToTop(options: IConversationOption, isTop?: boolean): Promise<void>;
|
|
534
515
|
/**
|
|
535
516
|
* 获取置顶会话
|
|
536
517
|
*/
|
|
@@ -578,17 +559,17 @@ declare function getChatRoomInfo(targetId: string, options: {
|
|
|
578
559
|
* 设置聊天室自定义属性
|
|
579
560
|
* @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
|
|
580
561
|
*/
|
|
581
|
-
declare function setChatRoomEntry(targetId: string, options:
|
|
562
|
+
declare function setChatRoomEntry(targetId: string, options: IChatRoomEntry): Promise<void>;
|
|
582
563
|
/**
|
|
583
564
|
* 批量设置聊天室自定义属性
|
|
584
565
|
* @param options ISetChatroomEntryOption数组
|
|
585
566
|
*/
|
|
586
|
-
declare function setChatRoomEntries(targetId: string, options:
|
|
567
|
+
declare function setChatRoomEntries(targetId: string, options: IChatRoomEntries): Promise<void>;
|
|
587
568
|
/**
|
|
588
569
|
* 强制 增加/修改 任意聊天室属性
|
|
589
570
|
* @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
|
|
590
571
|
*/
|
|
591
|
-
declare function forceSetChatRoomEntry(targetId: string, options:
|
|
572
|
+
declare function forceSetChatRoomEntry(targetId: string, options: IChatRoomEntry): Promise<void>;
|
|
592
573
|
/**
|
|
593
574
|
* 删除聊天室属性
|
|
594
575
|
* @description 仅限于删除自己设置的聊天室属性
|
|
@@ -596,19 +577,19 @@ declare function forceSetChatRoomEntry(targetId: string, options: ISetChatroomEn
|
|
|
596
577
|
* @param isSendNotification? 删除成功后是否发送通知消息
|
|
597
578
|
* @param notificationExtra? RC:chrmKVNotiMsg 通知消息中携带的附加信息
|
|
598
579
|
*/
|
|
599
|
-
declare function removeChatRoomEntry(targetId: string, options:
|
|
580
|
+
declare function removeChatRoomEntry(targetId: string, options: IRemoveChatRoomEntry): Promise<void>;
|
|
600
581
|
/**
|
|
601
582
|
* 批量删除聊天室属性
|
|
602
583
|
* @description 仅限于删除自己设置的聊天室属性
|
|
603
584
|
* @param entries[] 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
|
|
604
585
|
* @param notificationExtra? RC:chrmKVNotiMsg 通知消息中携带的附加信息
|
|
605
586
|
*/
|
|
606
|
-
declare function removeChatRoomEntries(targetId: string, options:
|
|
587
|
+
declare function removeChatRoomEntries(targetId: string, options: IRemoveChatRoomEntries): Promise<void>;
|
|
607
588
|
/**
|
|
608
589
|
* 强制删除聊天室内的任意属性
|
|
609
590
|
* @description
|
|
610
591
|
*/
|
|
611
|
-
declare function forceRemoveChatRoomEntry(targetId: string, options:
|
|
592
|
+
declare function forceRemoveChatRoomEntry(targetId: string, options: IRemoveChatRoomEntry): Promise<void>;
|
|
612
593
|
/**
|
|
613
594
|
* 获取聊天室的指定属性
|
|
614
595
|
*/
|
|
@@ -681,7 +662,7 @@ declare function getRemoteHistoryMessages(conversation: IConversationOption, opt
|
|
|
681
662
|
/**
|
|
682
663
|
* 发送单聊已读回执
|
|
683
664
|
*/
|
|
684
|
-
declare function sendReadReceiptMessage(targetId: string, messageUId: string,
|
|
665
|
+
declare function sendReadReceiptMessage(targetId: string, messageUId: string, timestamp: number): Promise<{
|
|
685
666
|
code: ErrorCode;
|
|
686
667
|
data: IAReceivedMessage;
|
|
687
668
|
}>;
|
|
@@ -696,7 +677,7 @@ declare function sendReadReceiptRequest(targetId: string, messageUId: string): P
|
|
|
696
677
|
/**
|
|
697
678
|
* 发送群阅读回执响应
|
|
698
679
|
*/
|
|
699
|
-
declare function sendReadReceiptResponse(targetId: string, messageUIds: string[]): Promise<any>;
|
|
680
|
+
declare function sendReadReceiptResponse(targetId: string, messageUIds: string[], channelId?: string): Promise<any>;
|
|
700
681
|
/**
|
|
701
682
|
* 多端同步阅读状态
|
|
702
683
|
* @param conversation
|
|
@@ -755,22 +736,23 @@ declare function deleteMessages(conversation: IConversationOption, messages: {
|
|
|
755
736
|
* * 2: 接收
|
|
756
737
|
*/
|
|
757
738
|
messageDirection: MessageDirection;
|
|
758
|
-
}[]): Promise<
|
|
739
|
+
}[]): Promise<{
|
|
740
|
+
code: number;
|
|
741
|
+
}>;
|
|
759
742
|
/**
|
|
760
743
|
* 按时间戳删除消息
|
|
744
|
+
* @param conversation 会话
|
|
745
|
+
* @param timestamp 清除时间点, 该时间之前的消息将被清除
|
|
761
746
|
*/
|
|
762
|
-
declare function clearHistoryMessages(conversation: IConversationOption,
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
*/
|
|
766
|
-
timestamp: number;
|
|
767
|
-
}): Promise<void>;
|
|
747
|
+
declare function clearHistoryMessages(conversation: IConversationOption, timestamp: number): Promise<{
|
|
748
|
+
code: ErrorCode;
|
|
749
|
+
}>;
|
|
768
750
|
/**
|
|
769
751
|
* 更新(添加、替换)消息扩展属性
|
|
770
752
|
* @param expansion 要更新的消息扩展信息键值对
|
|
771
753
|
* @param message 要更新的原始消息体
|
|
772
754
|
*/
|
|
773
|
-
declare function updateMessageExpansion(
|
|
755
|
+
declare function updateMessageExpansion(expansion: {
|
|
774
756
|
[key: string]: any;
|
|
775
757
|
}, message: IAReceivedMessage): Promise<void>;
|
|
776
758
|
/**
|
|
@@ -778,7 +760,7 @@ declare function updateMessageExpansion(conversation: IConversationOption, expan
|
|
|
778
760
|
* @params keys 需删除消息扩展的 keys
|
|
779
761
|
* @params message 原始消息体
|
|
780
762
|
*/
|
|
781
|
-
declare function removeMessageExpansionForKey(
|
|
763
|
+
declare function removeMessageExpansionForKey(keys: string[], message: IAReceivedMessage): Promise<void>;
|
|
782
764
|
/**
|
|
783
765
|
* 发送typing消息
|
|
784
766
|
* @param typingContentType 输入状态消息类型
|
|
@@ -839,14 +821,13 @@ declare function getUnreadMentionedMessages(conversation: IConversationOption):
|
|
|
839
821
|
data: IAReceivedMessage[];
|
|
840
822
|
}>;
|
|
841
823
|
/**
|
|
842
|
-
*
|
|
824
|
+
* 按关键字搜索会话内的消息
|
|
825
|
+
* @param conversation 会话
|
|
843
826
|
* @param keyword 搜索内容
|
|
844
|
-
* @param conversationType 会话类型
|
|
845
|
-
* @param targetId 目标 ID
|
|
846
827
|
* @param timestamp 搜索时间, 搜索该时间之前的消息
|
|
847
828
|
* @param count 获取的数量
|
|
848
829
|
*/
|
|
849
|
-
declare function
|
|
830
|
+
declare function searchMessages(conversation: IConversationOption, keyword: string, timestamp: number, count: number): Promise<{
|
|
850
831
|
code: ErrorCode.SUCCESS;
|
|
851
832
|
data: {
|
|
852
833
|
messages: IAReceivedMessage[];
|
|
@@ -855,14 +836,13 @@ declare function searchMessageByContent(conversation: IConversationOption, keywo
|
|
|
855
836
|
}>;
|
|
856
837
|
/**
|
|
857
838
|
* 从本地消息数据库中删除某一会话指定时间之前的消息数据
|
|
858
|
-
* @param
|
|
859
|
-
* @param targetId 目标 ID
|
|
839
|
+
* @param conversation 会话
|
|
860
840
|
* @param timestamp 指定删除该时间戳之前的消息
|
|
861
841
|
* @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
|
|
862
842
|
* 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
|
|
863
843
|
*/
|
|
864
844
|
declare function deleteLocalMessagesByTimestamp(conversation: IConversationOption, timestamp: number, cleanSpace: boolean): Promise<{
|
|
865
|
-
code:
|
|
845
|
+
code: number;
|
|
866
846
|
}>;
|
|
867
847
|
/**
|
|
868
848
|
* 清空会话下历史消息
|
|
@@ -871,7 +851,7 @@ declare function deleteLocalMessagesByTimestamp(conversation: IConversationOptio
|
|
|
871
851
|
* @param callback
|
|
872
852
|
*/
|
|
873
853
|
declare function clearMessages(conversation: IConversationOption): Promise<{
|
|
874
|
-
code:
|
|
854
|
+
code: number;
|
|
875
855
|
}>;
|
|
876
856
|
/**
|
|
877
857
|
* 按内容搜索会话
|
|
@@ -890,7 +870,7 @@ declare function searchConversationByContent(keyword: string, conversationTypes?
|
|
|
890
870
|
* @param callback
|
|
891
871
|
*/
|
|
892
872
|
declare function clearUnreadCountByTimestamp(conversation: IConversationOption, timestamp: number): Promise<{
|
|
893
|
-
code:
|
|
873
|
+
code: number;
|
|
894
874
|
}>;
|
|
895
875
|
/**
|
|
896
876
|
* 设置消息接收状态
|
|
@@ -1126,4 +1106,4 @@ declare const MESSAGE_TYPE: {
|
|
|
1126
1106
|
REFERENCE: string;
|
|
1127
1107
|
};
|
|
1128
1108
|
|
|
1129
|
-
export { _default$1 as CombineMessage, _default as FileMessage, GetHistoryMessageOption, GetHistoryMessageResult, _default$4 as HQVoiceMessage, IAReceivedConversation, IAReceivedMessage, ICombineMessageBody, IConversationUpdateItem, IHQVoiceMessageBody, IImageMessageBody, IInitOption, IReceivedUpdateConversation,
|
|
1109
|
+
export { _default$1 as CombineMessage, _default as FileMessage, GetHistoryMessageOption, GetHistoryMessageResult, _default$4 as HQVoiceMessage, IAReceivedConversation, IAReceivedMessage, ICombineMessageBody, IConversationUpdateItem, IHQVoiceMessageBody, IImageMessageBody, IInitOption, IReceivedUpdateConversation, ISendMessageBody, ISendMessageOptions, ISightMessageBody, ITextMessageBody, _default$5 as ImageMessage, MESSAGE_TYPE, MentionedInfo, _default$3 as SightMessage, _default$2 as TextMessage, WatchEvent, addConversationsToTag, addEvent, addTag, clearEvents, clearHistoryMessages, clearMessages, clearMessagesUnreadStatus, clearTextMessageDraft, clearUnreadCountByTimestamp, connect, deleteLocalMessagesByTimestamp, deleteMessages, disconnect, forceRemoveChatRoomEntry, forceSetChatRoomEntry, getAllChatRoomEntries, getBlockedConversationList, getChatRoomEntry, getChatRoomInfo, getChatroomHistoryMessages, getConnectionStatus, getConversation, getConversationList, getConversationNotificationStatus, getConversationsFromTagByPage, getCurrentUserId, getFirstUnreadMessage, getHistoryMessages, getMessage, getMessageReader, getRemoteHistoryMessages, getServerTime, getTags, getTagsFromConversation, getTextMessageDraft, getTopConversationList, getTotalUnreadCount, getUnreadCount, getUnreadCountByTag, getUnreadMentionedMessages, init, insertMessage, installPlugin, joinChatRoom, joinExistChatRoom, onceEvent, quitChatRoom, recallMessage, registerMessageType, removeAllEvents, removeChatRoomEntries, removeChatRoomEntry, removeConversation, removeConversationsFromTag, removeEvent, removeMessageExpansionForKey, removeTag, removeTagFromConversations, removeTagsFromConversation, saveTextMessageDraft, searchConversationByContent, searchMessages, sendCombineMessage, sendFileMessage, sendHQVoiceMessage, sendImageMessage, sendMessage, sendReadReceiptMessage, sendReadReceiptRequest, sendReadReceiptResponse, sendSightMessage, sendSyncReadStatusMessage, sendTextMessage, sendTypingStatusMessage, setChatRoomEntries, setChatRoomEntry, setConversationNotificationStatus, setConversationToTop, setConversationToTopInTag, setMessageReceivedStatus, updateMessageExpansion, updateTag };
|