@rongcloud/engine 0.0.1-alpha.1 → 0.0.1-c-rs-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.
Files changed (189) hide show
  1. package/README.md +1 -5
  2. package/index.cjs +18594 -16
  3. package/index.cjs.js +18594 -16
  4. package/index.d.ts +18 -16255
  5. package/index.esm.js +18416 -15
  6. package/index.mjs +18416 -15
  7. package/package.json +15 -14
  8. package/src/RCIMEngine.d.ts +1000 -0
  9. package/src/RCIMEngine.d.ts.map +1 -0
  10. package/src/common/BuildConfig.d.ts +42 -0
  11. package/src/common/BuildConfig.d.ts.map +1 -0
  12. package/src/internal/IEngine.d.ts +1054 -0
  13. package/src/internal/IEngine.d.ts.map +1 -0
  14. package/src/internal/NativeEngine.d.ts +336 -0
  15. package/src/internal/NativeEngine.d.ts.map +1 -0
  16. package/src/internal/WebEngine.d.ts +1 -0
  17. package/src/internal/WebEngine.d.ts.map +1 -0
  18. package/src/internal/message/MessageMapper.d.ts +96 -0
  19. package/src/internal/message/MessageMapper.d.ts.map +1 -0
  20. package/src/internal/message/MessageMetadata.d.ts +42 -0
  21. package/src/internal/message/MessageMetadata.d.ts.map +1 -0
  22. package/src/legacy/APIContext.d.ts +13 -0
  23. package/src/legacy/APIContext.d.ts.map +1 -0
  24. package/src/legacy/AppStorage.d.ts +14 -0
  25. package/src/legacy/AppStorage.d.ts.map +1 -0
  26. package/src/legacy/AreaCode.d.ts +22 -0
  27. package/src/legacy/AreaCode.d.ts.map +1 -0
  28. package/src/legacy/BasicLogger.d.ts +38 -0
  29. package/src/legacy/BasicLogger.d.ts.map +1 -0
  30. package/src/legacy/ChatroomEntryType.d.ts +12 -0
  31. package/src/legacy/ChatroomEntryType.d.ts.map +1 -0
  32. package/src/legacy/ChatroomSyncStatus.d.ts +13 -0
  33. package/src/legacy/ChatroomSyncStatus.d.ts.map +1 -0
  34. package/src/legacy/ChatroomSyncStatusReason.d.ts +13 -0
  35. package/src/legacy/ChatroomSyncStatusReason.d.ts.map +1 -0
  36. package/src/legacy/ChatroomUserChangeType.d.ts +10 -0
  37. package/src/legacy/ChatroomUserChangeType.d.ts.map +1 -0
  38. package/src/legacy/ChrmMemBanType.d.ts +25 -0
  39. package/src/legacy/ChrmMemBanType.d.ts.map +1 -0
  40. package/src/legacy/ChrmMemOperateType.d.ts +13 -0
  41. package/src/legacy/ChrmMemOperateType.d.ts.map +1 -0
  42. package/src/legacy/ConnectionStatus.d.ts +53 -0
  43. package/src/legacy/ConnectionStatus.d.ts.map +1 -0
  44. package/src/legacy/ConversationType.d.ts +138 -0
  45. package/src/legacy/ConversationType.d.ts.map +1 -0
  46. package/src/legacy/EConnectProtocol.d.ts +15 -0
  47. package/src/legacy/EConnectProtocol.d.ts.map +1 -0
  48. package/src/legacy/ErrorCode.d.ts +2247 -0
  49. package/src/legacy/ErrorCode.d.ts.map +1 -0
  50. package/src/legacy/EventEmitter.d.ts +36 -0
  51. package/src/legacy/EventEmitter.d.ts.map +1 -0
  52. package/src/legacy/FileType.d.ts +20 -0
  53. package/src/legacy/FileType.d.ts.map +1 -0
  54. package/src/legacy/HttpMethod.d.ts +11 -0
  55. package/src/legacy/HttpMethod.d.ts.map +1 -0
  56. package/src/legacy/IMessage.d.ts +106 -0
  57. package/src/legacy/IMessage.d.ts.map +1 -0
  58. package/src/legacy/INaviInfo.d.ts +398 -0
  59. package/src/legacy/INaviInfo.d.ts.map +1 -0
  60. package/src/legacy/INet.d.ts +43 -0
  61. package/src/legacy/INet.d.ts.map +1 -0
  62. package/src/legacy/IPluginGenerator.d.ts +28 -0
  63. package/src/legacy/IPluginGenerator.d.ts.map +1 -0
  64. package/src/legacy/IPromiseResult.d.ts +18 -0
  65. package/src/legacy/IPromiseResult.d.ts.map +1 -0
  66. package/src/legacy/IPushConfig.d.ts +64 -0
  67. package/src/legacy/IPushConfig.d.ts.map +1 -0
  68. package/src/legacy/ISendMsgOptions.d.ts +22 -0
  69. package/src/legacy/ISendMsgOptions.d.ts.map +1 -0
  70. package/src/legacy/InterruptionLevel.d.ts +12 -0
  71. package/src/legacy/InterruptionLevel.d.ts.map +1 -0
  72. package/src/legacy/LogDBProxy.d.ts +26 -0
  73. package/src/legacy/LogDBProxy.d.ts.map +1 -0
  74. package/src/legacy/LogEnums.d.ts +23 -0
  75. package/src/legacy/LogEnums.d.ts.map +1 -0
  76. package/src/legacy/LogL.d.ts +39 -0
  77. package/src/legacy/LogL.d.ts.map +1 -0
  78. package/src/legacy/LogTagId.d.ts +67 -0
  79. package/src/legacy/LogTagId.d.ts.map +1 -0
  80. package/src/legacy/MessageBlockType.d.ts +14 -0
  81. package/src/legacy/MessageBlockType.d.ts.map +1 -0
  82. package/src/legacy/MessageDirection.d.ts +25 -0
  83. package/src/legacy/MessageDirection.d.ts.map +1 -0
  84. package/src/legacy/MessageRegister.d.ts +18 -0
  85. package/src/legacy/MessageRegister.d.ts.map +1 -0
  86. package/src/legacy/NotificationLevel.d.ts +38 -0
  87. package/src/legacy/NotificationLevel.d.ts.map +1 -0
  88. package/src/legacy/PluginContext.d.ts +63 -0
  89. package/src/legacy/PluginContext.d.ts.map +1 -0
  90. package/src/legacy/PushImportanceHonor.d.ts +29 -0
  91. package/src/legacy/PushImportanceHonor.d.ts.map +1 -0
  92. package/src/legacy/RCConnectionStatus.d.ts +39 -0
  93. package/src/legacy/RCConnectionStatus.d.ts.map +1 -0
  94. package/src/legacy/RCResult.d.ts +65 -0
  95. package/src/legacy/RCResult.d.ts.map +1 -0
  96. package/src/legacy/ReceivedStatus.d.ts +46 -0
  97. package/src/legacy/ReceivedStatus.d.ts.map +1 -0
  98. package/src/legacy/SentStatus.d.ts +53 -0
  99. package/src/legacy/SentStatus.d.ts.map +1 -0
  100. package/src/legacy/SimpleLogger.d.ts +13 -0
  101. package/src/legacy/SimpleLogger.d.ts.map +1 -0
  102. package/src/legacy/UploadMethod.d.ts +19 -0
  103. package/src/legacy/UploadMethod.d.ts.map +1 -0
  104. package/src/legacy/VersionManage.d.ts +15 -0
  105. package/src/legacy/VersionManage.d.ts.map +1 -0
  106. package/src/legacy/assert.d.ts +37 -0
  107. package/src/legacy/assert.d.ts.map +1 -0
  108. package/src/legacy/constants.d.ts +6 -0
  109. package/src/legacy/constants.d.ts.map +1 -0
  110. package/src/legacy/forEach.d.ts +24 -0
  111. package/src/legacy/forEach.d.ts.map +1 -0
  112. package/src/legacy/index.d.ts +61 -0
  113. package/src/legacy/index.d.ts.map +1 -0
  114. package/src/legacy/logger-interfaces.d.ts +34 -0
  115. package/src/legacy/logger-interfaces.d.ts.map +1 -0
  116. package/src/legacy/logger-stub.d.ts +7 -0
  117. package/src/legacy/logger-stub.d.ts.map +1 -0
  118. package/src/legacy/others.d.ts +16 -0
  119. package/src/legacy/others.d.ts.map +1 -0
  120. package/src/legacy/rtc/Codec.d.ts +38 -0
  121. package/src/legacy/rtc/Codec.d.ts.map +1 -0
  122. package/src/legacy/rtc/IRTC.d.ts +99 -0
  123. package/src/legacy/rtc/IRTC.d.ts.map +1 -0
  124. package/src/legacy/rtc/RTC.d.ts +101 -0
  125. package/src/legacy/rtc/RTC.d.ts.map +1 -0
  126. package/src/legacy/rtc/RTCPluginContext.d.ts +62 -0
  127. package/src/legacy/rtc/RTCPluginContext.d.ts.map +1 -0
  128. package/src/legacy/rtc/index.d.ts +10 -0
  129. package/src/legacy/rtc/index.d.ts.map +1 -0
  130. package/src/legacy/runtime/IRuntime.d.ts +45 -0
  131. package/src/legacy/runtime/IRuntime.d.ts.map +1 -0
  132. package/src/legacy/runtime/index.d.ts +5 -0
  133. package/src/legacy/runtime/index.d.ts.map +1 -0
  134. package/src/legacy/session.d.ts +7 -0
  135. package/src/legacy/session.d.ts.map +1 -0
  136. package/src/legacy/validator.d.ts +55 -0
  137. package/src/legacy/validator.d.ts.map +1 -0
  138. package/src/types/ConversationTypes.d.ts +54 -0
  139. package/src/types/ConversationTypes.d.ts.map +1 -0
  140. package/src/types/EngineTypes.d.ts +27 -0
  141. package/src/types/EngineTypes.d.ts.map +1 -0
  142. package/src/types/message/MediaMessageContent.d.ts +25 -0
  143. package/src/types/message/MediaMessageContent.d.ts.map +1 -0
  144. package/src/types/message/MessageContent.d.ts +80 -0
  145. package/src/types/message/MessageContent.d.ts.map +1 -0
  146. package/src/types/message/MessageContentInfo.d.ts +76 -0
  147. package/src/types/message/MessageContentInfo.d.ts.map +1 -0
  148. package/src/types/message/MessageTypes.d.ts +84 -0
  149. package/src/types/message/MessageTypes.d.ts.map +1 -0
  150. package/src/types/message/content/index.d.ts +3 -0
  151. package/src/types/message/content/index.d.ts.map +1 -0
  152. package/src/types/message/content/media/CombineMessage.d.ts +44 -0
  153. package/src/types/message/content/media/CombineMessage.d.ts.map +1 -0
  154. package/src/types/message/content/media/FileMessage.d.ts +44 -0
  155. package/src/types/message/content/media/FileMessage.d.ts.map +1 -0
  156. package/src/types/message/content/media/HQVoiceMessage.d.ts +35 -0
  157. package/src/types/message/content/media/HQVoiceMessage.d.ts.map +1 -0
  158. package/src/types/message/content/media/ImageMessage.d.ts +47 -0
  159. package/src/types/message/content/media/ImageMessage.d.ts.map +1 -0
  160. package/src/types/message/content/media/SightMessage.d.ts +49 -0
  161. package/src/types/message/content/media/SightMessage.d.ts.map +1 -0
  162. package/src/types/message/content/media/index.d.ts +6 -0
  163. package/src/types/message/content/media/index.d.ts.map +1 -0
  164. package/src/types/message/content/normal/CommandMessage.d.ts +39 -0
  165. package/src/types/message/content/normal/CommandMessage.d.ts.map +1 -0
  166. package/src/types/message/content/normal/CommandNotificationMessage.d.ts +39 -0
  167. package/src/types/message/content/normal/CommandNotificationMessage.d.ts.map +1 -0
  168. package/src/types/message/content/normal/InformationNotificationMessage.d.ts +35 -0
  169. package/src/types/message/content/normal/InformationNotificationMessage.d.ts.map +1 -0
  170. package/src/types/message/content/normal/LocationMessage.d.ts +109 -0
  171. package/src/types/message/content/normal/LocationMessage.d.ts.map +1 -0
  172. package/src/types/message/content/normal/ReadReceiptMessage.d.ts +49 -0
  173. package/src/types/message/content/normal/ReadReceiptMessage.d.ts.map +1 -0
  174. package/src/types/message/content/normal/RecallNotificationMessage.d.ts +70 -0
  175. package/src/types/message/content/normal/RecallNotificationMessage.d.ts.map +1 -0
  176. package/src/types/message/content/normal/RichContentMessage.d.ts +52 -0
  177. package/src/types/message/content/normal/RichContentMessage.d.ts.map +1 -0
  178. package/src/types/message/content/normal/TextMessage.d.ts +40 -0
  179. package/src/types/message/content/normal/TextMessage.d.ts.map +1 -0
  180. package/src/types/message/content/normal/UnknownMessage.d.ts +45 -0
  181. package/src/types/message/content/normal/UnknownMessage.d.ts.map +1 -0
  182. package/src/types/message/content/normal/VoiceMessage.d.ts +43 -0
  183. package/src/types/message/content/normal/VoiceMessage.d.ts.map +1 -0
  184. package/src/types/message/content/normal/index.d.ts +11 -0
  185. package/src/types/message/content/normal/index.d.ts.map +1 -0
  186. package/src/utils/JsonConverter.d.ts +39 -0
  187. package/src/utils/JsonConverter.d.ts.map +1 -0
  188. package/src/utils/ObjectChecker.d.ts +56 -0
  189. package/src/utils/ObjectChecker.d.ts.map +1 -0
@@ -0,0 +1,1000 @@
1
+ import { RcimEngineParams } from './types/EngineTypes';
2
+ import { RcimAppSettings, RcimBlacklistStatus, RcimChatroomInfo, RcimChatroomJoinedInfo, RcimChatroomKeyErrorInfo, RcimChatroomKvInfo, RcimChatroomMemberBannedInfo, RcimChatroomMemberBlockedInfo, RcimChatroomMemberChangeInfo, RcimChatroomMultiClientSyncInfo, RcimChatroomStatus, RcimConnectionStatus, RcimConversationIdentifier, RcimConversationStatusChangeItem, RcimConversationTagInfo, RcimConversationType, RcimDisconnectMode, RcimErrorCode, RcimInsertLogInfo, RcimMessageBlockInfo, RcimMessageExpansionKvInfo, RcimMessageFlag, RcimMessageIdentifier, RcimOrder, RcimPushNotificationMuteLevel, RcimReadReceiptInfoV5, RcimReadReceiptNotifyV5, RcimReadReceiptUserInfo, RcimReadReceiptUsersOption, RcimReadReceiptV2ReaderInfo, RcimReceivedInfo, RcimReceivedStatus, RcimSendMessageOption, RcimSendReadReceiptResponseMessageData, RcimSentStatus, RcimStreamMessageChunkInfo, RcimStreamMessageRequestEvent, RcimSubscribeType, RcimTypingStatus } from '@rongcloud/electron';
3
+ import { RcimMessage } from './types/message/MessageTypes';
4
+ import { MessageMapper } from './internal/message/MessageMapper';
5
+ import { RcimMessageContent, RcimMessageContentConstructor } from './types/message/MessageContent';
6
+ import { RcimConversation } from './types/ConversationTypes';
7
+ import { MessageMetadata } from './internal/message/MessageMetadata';
8
+ import { RcimRecallNotificationMessage } from './types/message/content/normal/RecallNotificationMessage';
9
+ /**
10
+ * ```
11
+ * 比如聊天室 kv 监听,在上层是一个 interface 包含三个监听方法,而 Rust 是三个独立的监听
12
+ *
13
+ * interface ChatroomKVStatusListener {
14
+ * onChatroomKVSync(roomId: string): void;
15
+ * onChatroomKVUpdate(roomId: string, entries: Map<string, string>): void;
16
+ * onChatroomKVRemove(roomId: string, entries: Map<string, string>): void;
17
+ * }
18
+ * ```
19
+ */
20
+ /**
21
+ * RCIMEngine 作为 SDK 对外暴露的主入口。
22
+ */
23
+ export declare class RCIMEngine {
24
+ private readonly engine;
25
+ private readonly deviceId;
26
+ private readonly messageMetadata;
27
+ private readonly messageMapper;
28
+ private consoleLevel;
29
+ constructor(appkey: string, param: RcimEngineParams);
30
+ private getCloudType;
31
+ getMessageMapper(): MessageMapper;
32
+ getMessageMetadata(): MessageMetadata;
33
+ /**
34
+ * 设置重连踢下线策略。
35
+ * @param isEnabled 是否开启
36
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
37
+ */
38
+ setReconnectKickPolicy(isEnabled: boolean): RcimErrorCode;
39
+ /**
40
+ * 连接 IM 服务。
41
+ * @param token 连接 token
42
+ * @param timeout 超时秒数
43
+ * @return Promise,code 为 RcimErrorCode,当 code 为 Success 时,userId 为登录用户 ID,否则为 undefined
44
+ */
45
+ connect(token: string, timeout: number): Promise<{
46
+ code: RcimErrorCode;
47
+ userId?: string;
48
+ }>;
49
+ /**
50
+ * 断开与融云服务的连接。
51
+ * @param mode 断开连接模式
52
+ * @return Promise,失败时抛出异常
53
+ */
54
+ disconnect(mode: RcimDisconnectMode): Promise<RcimErrorCode>;
55
+ /**
56
+ * 获取当前用户 ID。
57
+ * @return 当前用户 ID;失败时返回空字符串
58
+ */
59
+ getCurrentUserId(): string;
60
+ /**
61
+ * 获取 deviceId。
62
+ * @return deviceId
63
+ */
64
+ getDeviceId(): string;
65
+ /**
66
+ * 获取 SDK 信息 RTC Lib 使用
67
+ */
68
+ getSDKInfo(): {
69
+ version: string;
70
+ };
71
+ /**
72
+ * 获取当前连接状态。
73
+ * @return 当前连接状态;失败时返回 Idle
74
+ */
75
+ getConnectionStatus(): RcimConnectionStatus;
76
+ /**
77
+ * 获取本地时间与服务器时间的时间差。
78
+ * 通过当前本地时间 - 此接口返回的时间,即当前服务器时间。
79
+ * @return 时间差(毫秒);失败时返回 0
80
+ */
81
+ getDeltaTime(): number;
82
+ /**
83
+ * 获取配置信息,连接成功后调用。
84
+ * @return Promise,code 为 RcimErrorCode,appSettings 为配置信息(可选)
85
+ */
86
+ getAppSettings(): Promise<{
87
+ code: RcimErrorCode;
88
+ appSettings?: RcimAppSettings;
89
+ }>;
90
+ /**
91
+ * 按 key 列表批量获取导航数据。
92
+ * @param keys 需要获取的导航字段 key 列表
93
+ * @return Promise,code 为 RcimErrorCode,kvMap 为 key-value 映射
94
+ */
95
+ getNaviDataValues(keys: string[]): Promise<{
96
+ code: RcimErrorCode;
97
+ kvMap?: Record<string, string | null>;
98
+ }>;
99
+ /**
100
+ * 写入日志。
101
+ * 当 logInfo.level <= consoleLevel 时,同时输出到控制台。
102
+ * @param logInfo 日志数据
103
+ * @return Promise,code 为 RcimErrorCode
104
+ */
105
+ insertLog(logInfo: RcimInsertLogInfo): Promise<RcimErrorCode>;
106
+ /**
107
+ * 设置连接状态监听。
108
+ * @param listener 监听回调;传 null 取消监听
109
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
110
+ */
111
+ setConnectionStatusListener(listener: ((status: RcimConnectionStatus) => void) | null): RcimErrorCode;
112
+ /**
113
+ * 设置离线消息同步完成监听。
114
+ * @param listener 监听回调;传 null 取消监听
115
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
116
+ */
117
+ setOfflineMessageSyncCompletedListener(listener: (() => void) | null): RcimErrorCode;
118
+ /**
119
+ * 设置标签变化监听。
120
+ * @param listener 监听回调;传 null 取消监听
121
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
122
+ */
123
+ setTagListener(listener: (() => void) | null): RcimErrorCode;
124
+ /**
125
+ * 设置会话标签变化监听。
126
+ * @param listener 监听回调;传 null 取消监听
127
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
128
+ */
129
+ setConversationTagListener(listener: (() => void) | null): RcimErrorCode;
130
+ /**
131
+ * 创建标签。
132
+ * @param tagInfo 标签信息;只需要设置 tagId/tagName
133
+ * @return Promise,code 为 RcimErrorCode
134
+ */
135
+ addTag(tagInfo: {
136
+ tagId: string;
137
+ tagName: string;
138
+ }): Promise<RcimErrorCode>;
139
+ /**
140
+ * 获取标签列表。
141
+ * @return Promise,code 为 RcimErrorCode,tagInfoVec 为标签列表(可能为空数组)
142
+ */
143
+ getTags(): Promise<{
144
+ code: RcimErrorCode;
145
+ tagInfoVec: {
146
+ tagId: string;
147
+ tagName: string;
148
+ count: number;
149
+ timestamp: number;
150
+ }[];
151
+ }>;
152
+ /**
153
+ * 移除标签。
154
+ * @param tagId 标签 id
155
+ * @return Promise,code 为 RcimErrorCode
156
+ */
157
+ removeTag(tagId: string): Promise<RcimErrorCode>;
158
+ /**
159
+ * 更新标签信息(只支持修改 tagName)。
160
+ * @param tagInfo 标签信息;只需要设置 tagId/tagName
161
+ * @return Promise,code 为 RcimErrorCode
162
+ */
163
+ updateTag(tagInfo: {
164
+ tagId: string;
165
+ tagName: string;
166
+ }): Promise<RcimErrorCode>;
167
+ /**
168
+ * 获取会话的所有标签。
169
+ * @param conversation 会话标识
170
+ * @return Promise,code 为 RcimErrorCode,conTagInfoVec 为会话标签列表(可能为空数组)
171
+ */
172
+ getTagsFromConversation(conversation: RcimConversationIdentifier): Promise<{
173
+ code: RcimErrorCode;
174
+ conTagInfoVec: RcimConversationTagInfo[];
175
+ }>;
176
+ /**
177
+ * 添加会话到指定标签。
178
+ * @param tagId 标签 id
179
+ * @param convIdfVec 会话标识列表;长度范围 [1, 20]
180
+ * @return Promise,code 为 RcimErrorCode
181
+ */
182
+ addConversationsToTag(tagId: string, convIdfVec: RcimConversationIdentifier[]): Promise<RcimErrorCode>;
183
+ /**
184
+ * 从指定标签移除会话。
185
+ * @param tagId 标签 id
186
+ * @param convIdfVec 会话标识列表;长度范围 [1, 20]
187
+ * @return Promise,code 为 RcimErrorCode
188
+ */
189
+ removeConversationsFromTag(tagId: string, convIdfVec: RcimConversationIdentifier[]): Promise<RcimErrorCode>;
190
+ /**
191
+ * 从指定会话中移除标签。
192
+ * @param conversation 会话标识
193
+ * @param tagIdVec 标签 id 列表
194
+ * @return Promise,code 为 RcimErrorCode
195
+ */
196
+ removeTagsFromConversation(conversation: RcimConversationIdentifier, tagIdVec: string[]): Promise<RcimErrorCode>;
197
+ /**
198
+ * 分页获取标签中会话列表。
199
+ * @param tagId 标签 id
200
+ * @param timestamp 会话时间戳(获取这个时间戳之前的会话列表,0 表示从最新开始获取,单位:毫秒)
201
+ * @param count 获取数量(当实际取回会话数量小于 count 时,表明已取完)
202
+ * @return Promise,code 为 RcimErrorCode,conversationList 为会话列表(可能为空数组)
203
+ */
204
+ getConversationsFromTagByPage(tagId: string, timestamp: number, count: number): Promise<{
205
+ code: RcimErrorCode;
206
+ conversationList: RcimConversation[];
207
+ }>;
208
+ /**
209
+ * 根据标签获取未读消息数。
210
+ * @param tagId 标签 id
211
+ * @param containBlocked 是否包含免打扰会话
212
+ * @return Promise,code 为 RcimErrorCode,count 为未读数
213
+ */
214
+ getUnreadCountByTag(tagId: string, containBlocked: boolean): Promise<{
215
+ code: RcimErrorCode;
216
+ count: number;
217
+ }>;
218
+ /**
219
+ * 设置标签中的会话置顶。
220
+ * @param tagId 标签 id
221
+ * @param conversation 会话标识
222
+ * @param isTop 是否置顶
223
+ * @return Promise,code 为 RcimErrorCode
224
+ */
225
+ setConversationToTopInTag(tagId: string, conversation: RcimConversationIdentifier, isTop: boolean): Promise<RcimErrorCode>;
226
+ /**
227
+ * 将某个用户加入黑名单。
228
+ * @param userId 需要加入黑名单的用户 ID
229
+ * @return Promise,code 为 RcimErrorCode
230
+ */
231
+ addToBlackList(userId: string): Promise<RcimErrorCode>;
232
+ /**
233
+ * 将某个用户移出黑名单。
234
+ * @param userId 需要移出黑名单的用户 ID
235
+ * @return Promise,code 为 RcimErrorCode
236
+ */
237
+ removeFromBlackList(userId: string): Promise<RcimErrorCode>;
238
+ /**
239
+ * 获取当前用户设置的黑名单列表。
240
+ * @return Promise,code 为 RcimErrorCode,userIdVec 为黑名单用户 id 列表(可能为空数组)
241
+ */
242
+ getBlackList(): Promise<{
243
+ code: RcimErrorCode;
244
+ userIdVec: string[];
245
+ }>;
246
+ /**
247
+ * 获取指定用户在黑名单中的状态。
248
+ * @return Promise,code 为 RcimErrorCode,status 为黑名单状态枚举值(number)
249
+ */
250
+ getBlackListStatus(userId: string): Promise<{
251
+ code: RcimErrorCode;
252
+ status: RcimBlacklistStatus;
253
+ }>;
254
+ /**
255
+ * 发送 RTC 信令。
256
+ * @param roomId 房间 ID
257
+ * @param methodName 信令方法名
258
+ * @param isQuery 是否 Query 信令(false 表示 Publish)
259
+ * @param dataInfoVec 信令数据字节数组
260
+ * @param timeoutSec 超时秒数
261
+ * @param requestIdCallback 请求 ID 回调(可选)
262
+ * @return Promise,code 为 RcimErrorCode,infoVec 为返回字节数组
263
+ */
264
+ sendRtcSignaling(roomId: string, methodName: string, isQuery: boolean, dataInfoVec: Uint8Array, timeoutSec: number, requestIdCallback?: ((requestId: number) => void) | null): Promise<{
265
+ code: RcimErrorCode;
266
+ infoVec: Uint8Array;
267
+ }>;
268
+ /**
269
+ * 设置 RTC 房间事件监听。
270
+ * @param listener 回调函数,接收 RTC 信令的 protobuf 二进制数据;传 null 取消监听
271
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
272
+ */
273
+ setRtcRoomEventListener(listener: ((buffer: Uint8Array) => void) | null): RcimErrorCode;
274
+ /**
275
+ * 设置聊天室状态监听。
276
+ * @param listener 监听回调;传 null 取消监听
277
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
278
+ */
279
+ setChatroomStatusListener(listener: ((code: RcimErrorCode, roomId: string, status: RcimChatroomStatus, info?: RcimChatroomJoinedInfo) => void) | null): RcimErrorCode;
280
+ /**
281
+ * 设置聊天室 kv 同步监听。
282
+ *
283
+ * 只通知“该聊天室 kv 已同步完成”,如需获取 kv 明细请主动调用 `getChatroomAllKvs` / `getLocalChatroomKvByKeys`。
284
+ *
285
+ * @param listener 监听回调;传 null 取消监听
286
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
287
+ */
288
+ setChatroomKvSyncListener(listener: ((roomId: string) => void) | null): RcimErrorCode;
289
+ /**
290
+ * 设置聊天室 kv 更新监听。
291
+ * @param listener 监听回调;传 null 取消监听
292
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
293
+ */
294
+ setChatroomKvChangedListener(listener: ((roomId: string, kvVec: RcimChatroomKvInfo[]) => void) | null): RcimErrorCode;
295
+ /**
296
+ * 设置聊天室 kv 删除监听。
297
+ * @param listener 监听回调;传 null 取消监听
298
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
299
+ */
300
+ setChatroomKvDeleteListener(listener: ((roomId: string, kvVec: RcimChatroomKvInfo[]) => void) | null): RcimErrorCode;
301
+ /**
302
+ * 设置聊天室成员变化监听。
303
+ * @param listener 监听回调;传 null 取消监听
304
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
305
+ */
306
+ setChatroomMemberChangedListener(listener: ((changeInfo: RcimChatroomMemberChangeInfo) => void) | null): RcimErrorCode;
307
+ /**
308
+ * 设置聊天室成员禁言监听。
309
+ * @param listener 监听回调;传 null 取消监听
310
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
311
+ */
312
+ setChatroomMemberBannedListener(listener: ((banInfo: RcimChatroomMemberBannedInfo) => void) | null): RcimErrorCode;
313
+ /**
314
+ * 设置聊天室成员封禁监听。
315
+ * @param listener 监听回调;传 null 取消监听
316
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
317
+ */
318
+ setChatroomMemberBlockedListener(listener: ((blockInfo: RcimChatroomMemberBlockedInfo) => void) | null): RcimErrorCode;
319
+ /**
320
+ * 设置聊天室多端同步监听。
321
+ * @param listener 监听回调;传 null 取消监听
322
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
323
+ */
324
+ setChatroomMultiClientSyncListener(listener: ((syncInfo: RcimChatroomMultiClientSyncInfo) => void) | null): RcimErrorCode;
325
+ /**
326
+ * 设置会话状态监听。
327
+ * @param listener 监听回调;传 null 取消监听
328
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
329
+ */
330
+ setConversationStatusListener(listener: ((items: RcimConversationStatusChangeItem[]) => void) | null): RcimErrorCode;
331
+ /**
332
+ * 订阅事件。
333
+ * @param subscribeType 订阅类型
334
+ * @param userIdVec 订阅用户列表
335
+ * @param expiry 订阅有效期(秒)
336
+ * @return Promise,code 为 RcimErrorCode,failedUserIdVec 为失败用户列表
337
+ */
338
+ subscribeEvent(subscribeType: RcimSubscribeType, userIdVec: string[], expiry: number): Promise<{
339
+ code: RcimErrorCode;
340
+ failedUserIdVec: string[];
341
+ }>;
342
+ /**
343
+ * 设置消息扩展更新监听。
344
+ * @param listener 监听回调;传 null 取消监听
345
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
346
+ */
347
+ setMessageExpansionUpdateListener(listener: ((kvVec: RcimMessageExpansionKvInfo[], message?: RcimMessage) => void) | null): RcimErrorCode;
348
+ /**
349
+ * 设置消息扩展移除监听。
350
+ * @param listener 监听回调;传 null 取消监听
351
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
352
+ */
353
+ setMessageExpansionRemoveListener(listener: ((keyVec: string[], message?: RcimMessage) => void) | null): RcimErrorCode;
354
+ /**
355
+ * 设置消息接收监听。
356
+ * @param listener 监听回调;传 null 取消监听
357
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
358
+ */
359
+ setMessageReceivedListener(listener: ((message?: RcimMessage, info?: RcimReceivedInfo) => void) | null): RcimErrorCode;
360
+ /**
361
+ * 设置消息拦截监听。
362
+ * @param listener 监听回调;传 null 取消监听
363
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
364
+ */
365
+ setMessageBlockedListener(listener: ((info?: RcimMessageBlockInfo) => void) | null): RcimErrorCode;
366
+ /**
367
+ * 设置输入状态监听。
368
+ * @param listener 监听回调;传 null 取消监听
369
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
370
+ */
371
+ setTypingStatusListener(listener: ((convType: RcimConversationType, targetId: string, channelId: string | null, typingStatus: RcimTypingStatus[]) => void) | null): RcimErrorCode;
372
+ /**
373
+ * 设置输入状态上报间隔。
374
+ * @param intervalMs 上报间隔(毫秒),有效值 [1000, 60000],超出范围则设置不成功
375
+ * @return Promise,code 为 RcimErrorCode
376
+ */
377
+ setTypingStatusInterval(intervalMs: number): Promise<RcimErrorCode>;
378
+ /**
379
+ * 获取指定会话类型的未读消息数量。
380
+ * @param convTypeVec 待获取的会话类型数组,取值范围 [1, 300]
381
+ * @param isContainBlocked 是否包含免打扰;true 代表获取所有会话未读数之和;false 代表获取不包含免打扰会话的正常会话未读数之和
382
+ * @return Promise,code 为 RcimErrorCode,count 为未读消息数量
383
+ */
384
+ getUnreadCountByConversationTypes(convTypeVec: RcimConversationType[], isContainBlocked: boolean): Promise<{
385
+ code: RcimErrorCode;
386
+ count: number;
387
+ }>;
388
+ /**
389
+ * 获取指定会话的未读消息数。
390
+ * @param convType 会话类型
391
+ * @param targetId 会话目标 ID
392
+ * @param channelId 频道 ID;可为 null
393
+ * @return Promise,code 为 RcimErrorCode,count 为未读消息数量
394
+ */
395
+ getUnreadCount(convType: RcimConversationType, targetId: string, channelId?: string): Promise<{
396
+ code: RcimErrorCode;
397
+ count: number;
398
+ }>;
399
+ /**
400
+ * 获取本地会话。
401
+ * @param convType 会话类型
402
+ * @param targetId 会话目标 ID
403
+ * @param channelId 频道 ID;可为 null
404
+ * @return Promise,code 为 RcimErrorCode,当 code 为 Success 时,conversation 为会话对象,否则为 undefined
405
+ */
406
+ getLocalConversation(convType: RcimConversationType, targetId: string, channelId?: string): Promise<{
407
+ code: RcimErrorCode;
408
+ conversation?: RcimConversation;
409
+ }>;
410
+ /**
411
+ * 获取会话的免打扰状态。
412
+ * @param convType 待获取的会话类型
413
+ * @param targetId 待获取的会话目标 ID
414
+ * @param channelId 待获取的频道 ID,可为 null
415
+ * @return Promise,code 为 RcimErrorCode,当 code 为 Success 时,muteLevel 为免打扰等级,否则为 undefined
416
+ */
417
+ getLocalConversationMuteLevel(convType: RcimConversationType, targetId: string, channelId?: string): Promise<{
418
+ code: RcimErrorCode;
419
+ muteLevel?: RcimPushNotificationMuteLevel;
420
+ }>;
421
+ /**
422
+ * 批量获取本地会话。
423
+ * @param convTypeVec 待获取的会话类型数组,取值范围 [1, 100]
424
+ * @param sendTime 查询的起始发送时间,返回小于该时间的会话;如果为 0,则查询全部
425
+ * @param count 期望返回结果的最大个数,即分页查询的每页个数,取值范围 [1, 1000]
426
+ * @param topPriority 是否优先返回置顶会话
427
+ * @return Promise,code 为 RcimErrorCode,conversations 为会话列表(可能为空数组)
428
+ */
429
+ getLocalConversationList(convTypeVec: RcimConversationType[], sendTime: number, count: number, topPriority: boolean): Promise<{
430
+ code: RcimErrorCode;
431
+ conversations: RcimConversation[];
432
+ }>;
433
+ /**
434
+ * 根据会话类型和过滤条件获取会话列表(支持 channelId 过滤)。
435
+ * @param filterParams 过滤参数数组,每项包含 convType、可选 targetId 和 channelId
436
+ * @param sendTime 查询的起始发送时间,0 表示全部
437
+ * @param count 期望返回结果的最大个数,取值范围 [1, 1000]
438
+ * @param topPriority 是否优先返回置顶会话
439
+ * @param hiddenFilter 隐藏状态过滤,0=全部 1=仅隐藏 2=仅非隐藏
440
+ * @return Promise,code 为 RcimErrorCode,conversations 为会话列表(可能为空数组)
441
+ */
442
+ getLocalConversationListWithOption(filterParams: Array<{
443
+ convType: number;
444
+ targetId?: string | null;
445
+ channelId?: string | null;
446
+ }>, sendTime: number, count: number, topPriority: boolean, hiddenFilter: number): Promise<{
447
+ code: RcimErrorCode;
448
+ conversations: RcimConversation[];
449
+ }>;
450
+ /**
451
+ * 根据关键字搜索本地会话。
452
+ * @param convTypeVec 会话类型数组,取值范围 [1, 300]
453
+ * @param channelId 频道 ID;可为 null
454
+ * @param objNameVec 消息类型列表;可为 null,null 表示不过滤消息类型(即全部类型)
455
+ * @param keyword 搜索关键字,长度范围 [1, 256]
456
+ * @return Promise,code 为 RcimErrorCode,conversations 为会话列表(可能为空数组)
457
+ */
458
+ searchLocalConversations(convTypeVec: RcimConversationType[], channelId: string | undefined, objNameVec: string[] | null, keyword: string): Promise<{
459
+ code: RcimErrorCode;
460
+ conversations: RcimConversation[];
461
+ }>;
462
+ /**
463
+ * 按类型清除本地会话,只会移除本地数据库中指定类型的会话和消息。不会删除服务器数据。
464
+ * @param convTypeVec 待清除的会话类型数组,取值范围 [1, 100]
465
+ * @return Promise,code 为 RcimErrorCode
466
+ */
467
+ clearLocalConversations(convTypeVec: RcimConversationType[]): Promise<RcimErrorCode>;
468
+ /**
469
+ * 移除远端和本地的指定会话,但会话内的消息不会删除,当有新消息到达时,仍能看到已存储的本地历史消息。
470
+ * @param convIdfVec 待移除会话标识符数组,长度范围 [1, 20]
471
+ * @return Promise,code 为 RcimErrorCode
472
+ */
473
+ removeConversations(convIdfVec: RcimConversationIdentifier[]): Promise<RcimErrorCode>;
474
+ /**
475
+ * 清除指定会话的未读数。
476
+ * @param convType 会话类型
477
+ * @param targetId 会话目标 ID
478
+ * @param channelId 频道 ID;可为 null
479
+ * @return Promise,code 为 RcimErrorCode
480
+ */
481
+ clearMessagesUnreadStatus(convType: RcimConversationType, targetId: string, channelId?: string): Promise<RcimErrorCode>;
482
+ /**
483
+ * 根据发送时间清除指定会话未读数。
484
+ * @param convType 会话类型
485
+ * @param targetId 会话目标 ID
486
+ * @param channelId 频道 ID;可为 null
487
+ * @param sendTime 发送时间小于等于该值的所有消息都会被清除未读状态;必须 > 0
488
+ * @return Promise,code 为 RcimErrorCode
489
+ */
490
+ clearMessagesUnreadStatusBySendTime(convType: RcimConversationType, targetId: string, channelId: string | undefined, sendTime: number): Promise<RcimErrorCode>;
491
+ /**
492
+ * 清除指定会话时间戳之前的本地消息。
493
+ * @param convType 会话类型
494
+ * @param targetId 会话目标 ID
495
+ * @param channelId 频道 ID;可为 null
496
+ * @param sendTime 清除该时间戳之前的消息(毫秒);传 0 表示清除所有消息
497
+ * @return Promise,code 为 RcimErrorCode,value 为是否成功
498
+ */
499
+ clearLocalMessageByTimestamp(convType: RcimConversationType, targetId: string, channelId: string | undefined, sendTime: number): Promise<{
500
+ code: RcimErrorCode;
501
+ value: boolean;
502
+ }>;
503
+ /**
504
+ * 保存会话草稿。
505
+ * @param convType 会话类型
506
+ * @param targetId 会话目标 ID
507
+ * @param channelId 频道 ID;可为 null
508
+ * @param draft 草稿内容;传 null 表示清除草稿
509
+ * @return RcimErrorCode
510
+ */
511
+ saveTextMessageDraft(convType: RcimConversationType, targetId: string, channelId: string | undefined, draft: string | null): RcimErrorCode;
512
+ /**
513
+ * 获取会话草稿。
514
+ * @param convType 会话类型
515
+ * @param targetId 会话目标 ID
516
+ * @param channelId 频道 ID;可为 null
517
+ * @return code 为 RcimErrorCode,draft 为草稿内容(可能为 undefined)
518
+ */
519
+ getTextMessageDraft(convType: RcimConversationType, targetId: string, channelId?: string): {
520
+ code: RcimErrorCode;
521
+ draft?: string;
522
+ };
523
+ /**
524
+ * 批量设置会话通知免打扰等级。
525
+ * @param convIdfVec 会话标识符数组
526
+ * @param muteLevel 免打扰等级
527
+ * @return Promise,code 为 RcimErrorCode
528
+ */
529
+ muteConversations(convIdfVec: RcimConversationIdentifier[], muteLevel: RcimPushNotificationMuteLevel): Promise<RcimErrorCode>;
530
+ /**
531
+ * 批量置顶/取消置顶会话(从本地)。
532
+ * @param convIdfVec 会话标识符数组,长度范围 [1, 20]
533
+ * @param isPinned 是否置顶
534
+ * @param needCreate 如果会话不存在,是否需要创建
535
+ * @param needUpdateTime 是否需要更新会话时间戳
536
+ * @return Promise,code 为 RcimErrorCode
537
+ */
538
+ pinConversations(convIdfVec: RcimConversationIdentifier[], isPinned: boolean, needCreate: boolean, needUpdateTime: boolean): Promise<RcimErrorCode>;
539
+ /**
540
+ * 加入聊天室。
541
+ * @param chatroomId 待加入聊天室的 ID
542
+ * @param count 进入聊天室时自动拉取的消息数量,取值范围 [0, 50]
543
+ * @return Promise,code 为 RcimErrorCode,当 code 为 Success 时,info 为加入聊天室信息,否则为 undefined
544
+ */
545
+ joinChatroom(chatroomId: string, count: number): Promise<{
546
+ code: RcimErrorCode;
547
+ info?: RcimChatroomJoinedInfo;
548
+ }>;
549
+ /**
550
+ * 加入已存在的聊天室。
551
+ * @param chatroomId 待加入聊天室的 ID
552
+ * @param count 进入聊天室时自动拉取的消息数量,取值范围 [0, 50]
553
+ * @return Promise,code 为 RcimErrorCode,当 code 为 Success 时,info 为加入聊天室信息,否则为 undefined
554
+ */
555
+ joinExistingChatroom(chatroomId: string, count: number): Promise<{
556
+ code: RcimErrorCode;
557
+ info?: RcimChatroomJoinedInfo;
558
+ }>;
559
+ /**
560
+ * 退出聊天室。
561
+ * @param chatroomId 待退出聊天室的 ID
562
+ * @return Promise,code 为 RcimErrorCode
563
+ */
564
+ quitChatroom(chatroomId: string): Promise<RcimErrorCode>;
565
+ /**
566
+ * 获取聊天室信息。
567
+ * @param chatroomId 待查询聊天室的 ID
568
+ * @param count 期望查询人员信息的数量,取值范围 [0, 20]
569
+ * @param order 查询顺序(RcimOrder:0 降序,1 升序)
570
+ * @return Promise,code 为 RcimErrorCode,当 code 为 Success 时,info 为聊天室信息,否则为 undefined
571
+ */
572
+ getChatroomInfo(chatroomId: string, count: number, order: RcimOrder): Promise<{
573
+ code: RcimErrorCode;
574
+ info?: RcimChatroomInfo;
575
+ }>;
576
+ /**
577
+ * 设置聊天室自定义属性。
578
+ * @param chatroomId 聊天室 ID
579
+ * @param kvVec 待设置的 kv 数组,长度范围 [1, 10]
580
+ * @param autoDelete 是否自动删除
581
+ * @param isForce 是否强制覆盖
582
+ * @return Promise,code 为 RcimErrorCode,failedVec 为失败 kv 列表(可能为空)
583
+ */
584
+ setChatroomKvs(chatroomId: string, kvVec: RcimChatroomKvInfo[], autoDelete: boolean, isForce: boolean): Promise<{
585
+ code: RcimErrorCode;
586
+ failedVec: RcimChatroomKeyErrorInfo[];
587
+ }>;
588
+ /**
589
+ * 删除聊天室自定义属性。
590
+ * @param chatroomId 聊天室 ID
591
+ * @param keyVec 待删除的 key 数组,长度范围 [1, 10]
592
+ * @param isForce 是否强制删除
593
+ * @return Promise,code 为 RcimErrorCode,failedVec 为失败 kv 列表(可能为空)
594
+ */
595
+ deleteChatroomKvs(chatroomId: string, keyVec: string[], isForce: boolean): Promise<{
596
+ code: RcimErrorCode;
597
+ failedVec: RcimChatroomKeyErrorInfo[];
598
+ }>;
599
+ /**
600
+ * 获取聊天室自定义属性(按 key 列表,从本地)。
601
+ * @param chatroomId 聊天室 ID
602
+ * @param keyVec 待获取的 key 数组,长度范围 [1, 100]
603
+ * @return Promise,code 为 RcimErrorCode,kvVec 为 kv 列表(可能为空)
604
+ */
605
+ getLocalChatroomKvByKeys(chatroomId: string, keyVec: string[]): Promise<{
606
+ code: RcimErrorCode;
607
+ kvVec: RcimChatroomKvInfo[];
608
+ }>;
609
+ /**
610
+ * 获取聊天室全部自定义属性。
611
+ * @param chatroomId 聊天室 ID
612
+ * @return Promise,code 为 RcimErrorCode,kvVec 为 kv 列表(可能为空)
613
+ */
614
+ getChatroomAllKvs(chatroomId: string): Promise<{
615
+ code: RcimErrorCode;
616
+ kvVec: RcimChatroomKvInfo[];
617
+ }>;
618
+ /**
619
+ * 向本地插入一条消息,不发送到服务器。
620
+ * @param message 待插入的消息对象
621
+ * @return Promise,error 为错误码,message 为消息对象(可选)
622
+ */
623
+ insertLocalMessage(message: RcimMessage): Promise<{
624
+ error: RcimErrorCode;
625
+ message?: RcimMessage;
626
+ }>;
627
+ /**
628
+ * 向本地批量插入消息,不发送到服务器。
629
+ * @param messages 待插入的消息对象数组,长度 [1, 500]
630
+ * @return Promise,error 为错误码
631
+ */
632
+ insertLocalMessages(messages: RcimMessage[]): Promise<{
633
+ error: RcimErrorCode;
634
+ }>;
635
+ /**
636
+ * 发送消息。
637
+ * @param message 待发送的消息对象
638
+ * @param option 发送可选参数(可选)
639
+ * @param savedCallback 消息保存回调(可选)
640
+ * @return Promise,error 为错误码,message 为消息对象(可选)
641
+ */
642
+ sendMessage(message: RcimMessage, option?: RcimSendMessageOption, onMessageSaved?: (message: RcimMessage) => void): Promise<{
643
+ error: RcimErrorCode;
644
+ message?: RcimMessage;
645
+ }>;
646
+ /**
647
+ * 发送多媒体消息。
648
+ * @param message 待发送的消息对象
649
+ * @param option 发送可选参数(可选)
650
+ * @param savedCallback 消息保存回调(可选)
651
+ * @param progressCallback 上传进度回调(可选)
652
+ * @return Promise,error 为错误码,message 为消息对象(可选)
653
+ */
654
+ sendMediaMessage(message: RcimMessage, option?: RcimSendMessageOption, onMessageSaved?: (message: RcimMessage) => void, onMediaMessageProgress?: (message: RcimMessage, progress: number) => void): Promise<{
655
+ error: RcimErrorCode;
656
+ message?: RcimMessage;
657
+ }>;
658
+ /**
659
+ * 从本地数据库指定会话中,批量获取指定发送时间前后的一批类型消息。
660
+ * @param convType 待查询消息的会话类型
661
+ * @param targetId 待查询消息的会话目标 ID
662
+ * @param channelId 待查询消息的频道 ID,可为 null
663
+ * @param objNameVec 待查询消息的消息类型列表,可为 null 表示全部类型
664
+ * @param sendTime 待查询消息的发送时间,0 表示最近一条消息的发送时间
665
+ * @param beforeCount 获取此时间之前的消息数量
666
+ * @param afterCount 获取此时间之后的消息数量
667
+ * @return Promise,code 为错误码,messages 为消息列表(可能为空)
668
+ */
669
+ getLocalHistoryMessagesByTime(convType: RcimConversationType, targetId: string, channelId: string | undefined, objNameVec: string[] | null, sendTime: number, beforeCount: number, afterCount: number): Promise<{
670
+ code: RcimErrorCode;
671
+ messages: RcimMessage[];
672
+ }>;
673
+ /**
674
+ * 删除远端消息。
675
+ * @param convType 会话类型
676
+ * @param targetId 会话目标 ID
677
+ * @param channelId 频道 ID;可为 null
678
+ * @param messageVec 待删除的消息列表
679
+ * @param isDeleteLocal 是否同时删除本地消息
680
+ * @return Promise,code 为 RcimErrorCode
681
+ */
682
+ deleteRemoteMessages(convType: RcimConversationType, targetId: string, channelId: string | undefined, messageVec: RcimMessage[], isDeleteLocal: boolean): Promise<RcimErrorCode>;
683
+ /**
684
+ * 按消息类型获取本地消息列表。
685
+ * @param convType 会话类型
686
+ * @param targetId 会话目标 ID
687
+ * @param channelId 频道 ID;可为 null
688
+ * @param objNameVec 消息类型列表
689
+ * @param count 拉取数量
690
+ * @param startTime 起始时间戳
691
+ * @param order 排序方式(RcimOrder:0 降序,1 升序)
692
+ * @return Promise,code 为 RcimErrorCode,messages 为消息列表(可能为空)
693
+ */
694
+ getLocalMessagesByObjectName(convType: RcimConversationType, targetId: string, channelId: string | undefined, objNameVec: string[], count: number, startTime: number, order: RcimOrder): Promise<{
695
+ code: RcimErrorCode;
696
+ messages: RcimMessage[];
697
+ }>;
698
+ /**
699
+ * 根据关键字搜索指定会话的本地消息。
700
+ * @param convType 会话类型
701
+ * @param targetId 会话目标 ID
702
+ * @param channelId 频道 ID;可为 null
703
+ * @param keyword 搜索关键字
704
+ * @param count 返回的搜索结果数量
705
+ * @param startTime 起始发送时间
706
+ * @return Promise,code 为 RcimErrorCode,messages 为消息列表(可能为空)
707
+ */
708
+ searchLocalMessages(convType: RcimConversationType, targetId: string, channelId: string | undefined, keyword: string, count: number, startTime: number): Promise<{
709
+ code: RcimErrorCode;
710
+ messages: RcimMessage[];
711
+ }>;
712
+ /**
713
+ * 根据关键字和时间范围搜索指定会话的本地消息。
714
+ * @param convType 会话类型
715
+ * @param targetId 会话目标 ID
716
+ * @param channelId 频道 ID;可为 null
717
+ * @param keyword 搜索关键字
718
+ * @param count 返回的搜索结果数量,范围 [0, 100]
719
+ * @param startTime 开始时间(包含该时间)
720
+ * @param endTime 结束时间(包含该时间)
721
+ * @param offset 偏移量,范围 [0, INT32_MAX]
722
+ * @return Promise,code 为 RcimErrorCode,messages 为消息列表(可能为空)
723
+ */
724
+ searchLocalMessagesByTime(convType: RcimConversationType, targetId: string, channelId: string | undefined, keyword: string, count: number, startTime: number, endTime: number, offset: number): Promise<{
725
+ code: RcimErrorCode;
726
+ messages: RcimMessage[];
727
+ }>;
728
+ /**
729
+ * 获取会话中的 @ 消息。
730
+ * @param convType 待获取未读消息的会话类型
731
+ * @param targetId 待获取未读消息的会话目标 ID
732
+ * @param channelId 待获取未读消息的频道 ID,可为 null
733
+ * @param count 期望获取的消息数量,有效范围 [1, 100]
734
+ * @param order 获取消息的发送时间排序方式
735
+ * @return Promise,code 为 RcimErrorCode,messages 为消息列表(可能为空)
736
+ */
737
+ getUnreadMentionedMessages(convType: RcimConversationType, targetId: string, channelId: string | undefined, count: number, order: RcimOrder): Promise<{
738
+ code: RcimErrorCode;
739
+ messages: RcimMessage[];
740
+ }>;
741
+ /**
742
+ * 更新消息扩展属性。
743
+ * @param kvVec 待设置的消息扩展数组
744
+ * @param msgUid 消息 uid
745
+ * @return Promise,error 为错误码
746
+ */
747
+ updateMessageExpansion(kvVec: RcimMessageExpansionKvInfo[], msgUid: string): Promise<RcimErrorCode>;
748
+ /**
749
+ * 删除消息扩展属性。
750
+ * @param keyVec 待删除的消息扩展 key 数组,长度范围 [1, 20]
751
+ * @param msgUid 消息 uid
752
+ * @return Promise,error 为错误码
753
+ */
754
+ removeMessageExpansion(keyVec: string[], msgUid: string): Promise<RcimErrorCode>;
755
+ /**
756
+ * 发送正在输入状态消息。
757
+ * @param convType 会话类型
758
+ * @param targetId 会话目标 ID
759
+ * @param channelId 会话频道 ID,可为 null
760
+ * @param objectName 正在输入的消息 ObjectName,如 RC:TxtMsg
761
+ * @return Promise,error 为错误码
762
+ */
763
+ sendTypingStatus(convType: RcimConversationType, targetId: string, channelId: string | undefined, objectName: string): Promise<RcimErrorCode>;
764
+ /**
765
+ * 发起群聊消息已读回执响应(V1)。
766
+ * @param convType 会话类型
767
+ * @param targetId 会话目标 ID
768
+ * @param channelId 会话频道 ID,可为 null
769
+ * @param msgInfoVec 已读消息数据数组
770
+ * @return Promise,code 为 RcimErrorCode,messages 为消息列表(可能为空)
771
+ */
772
+ sendReadReceiptResponse(convType: RcimConversationType, targetId: string, channelId: string | undefined, msgInfoVec: RcimSendReadReceiptResponseMessageData[]): Promise<{
773
+ code: RcimErrorCode;
774
+ messages: RcimMessage[];
775
+ }>;
776
+ /**
777
+ * 发起群聊消息已读回执请求(V1)。
778
+ * @param messageUid 待发起已读回执请求消息 UID
779
+ * @return Promise,error 为错误码
780
+ */
781
+ sendReadReceiptRequest(messageUid: string): Promise<RcimErrorCode>;
782
+ /**
783
+ * 发起群聊消息已读回执 V2 响应。
784
+ * @param convType 会话类型
785
+ * @param targetId 会话目标 ID
786
+ * @param channelId 会话频道 ID,可为 null
787
+ * @param messageUIds 已读消息 UID 列表,长度范围 [1, 100]
788
+ * @return Promise,code 为错误码,messages 为消息列表(可能为空)
789
+ */
790
+ sendReadReceiptResponseV2(convType: RcimConversationType, targetId: string, channelId: string | undefined, messageUIds: string[]): Promise<{
791
+ code: RcimErrorCode;
792
+ messages: RcimMessage[];
793
+ }>;
794
+ /**
795
+ * 获取群聊已读 V2 的已读成员列表。
796
+ * @param convType 会话类型
797
+ * @param targetId 会话目标 ID
798
+ * @param channelId 会话频道 ID,可为 null
799
+ * @param messageUId 消息 UID
800
+ * @return Promise,code 为错误码,totalCount 为总人数,readerVec 为已读成员列表
801
+ */
802
+ getReadReceiptV2Readers(convType: RcimConversationType, targetId: string, channelId: string | undefined, messageUId: string): Promise<{
803
+ code: RcimErrorCode;
804
+ totalCount: number;
805
+ readerVec: RcimReadReceiptV2ReaderInfo[];
806
+ }>;
807
+ /**
808
+ * 设置已读回执监听(V5)。
809
+ * @param listener 监听回调;传 null 取消监听
810
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
811
+ */
812
+ setReadReceiptV5Listener(listener: ((readInfoVec: RcimReadReceiptNotifyV5[]) => void) | null): RcimErrorCode;
813
+ /**
814
+ * 发送已读回执(V5 版本)。
815
+ * @param identifier 会话标识符
816
+ * @param messageUIds 消息 UID 列表,长度范围 [1, 100]
817
+ * @return Promise,code 为错误码,messages 为消息列表(可能为空)
818
+ */
819
+ sendReadReceiptResponseV5(identifier: RcimConversationIdentifier, messageUIds: string[]): Promise<{
820
+ code: RcimErrorCode;
821
+ messages: RcimMessage[];
822
+ }>;
823
+ /**
824
+ * 获取消息已读人数信息(V5 版本)。
825
+ * @param identifier 会话标识符
826
+ * @param messageUIds 消息 UID 列表,长度范围 [1, 100]
827
+ * @return Promise,code 为错误码,infoVec 为已读回执信息列表(可能为空)
828
+ */
829
+ getMessageReadReceiptInfoV5(identifier: RcimConversationIdentifier, messageUIds: string[]): Promise<{
830
+ code: RcimErrorCode;
831
+ infoVec: RcimReadReceiptInfoV5[];
832
+ }>;
833
+ /**
834
+ * 跨会话批量获取消息已读人数信息(V5 版本)。
835
+ * @param identifiers 消息标识符列表,长度范围 [1, 100]
836
+ * @return Promise,code 为错误码,infoVec 为已读回执信息列表(可能为空)
837
+ */
838
+ getMessageReadReceiptInfoByIdentifierV5(identifiers: RcimMessageIdentifier[]): Promise<{
839
+ code: RcimErrorCode;
840
+ infoVec: RcimReadReceiptInfoV5[];
841
+ }>;
842
+ /**
843
+ * 分页获取消息已读/未读成员列表(V5 版本)。
844
+ * @param identifier 会话标识符
845
+ * @param messageUId 消息 UID
846
+ * @param option 分页参数(count 范围 [1, 100])
847
+ * @return Promise,code 为错误码;respondUserVec/notRespondUserVec 可能为空数组
848
+ */
849
+ getMessageReadReceiptUsersByPageV5(identifier: RcimConversationIdentifier, messageUId: string, option: RcimReadReceiptUsersOption): Promise<{
850
+ code: RcimErrorCode;
851
+ pageToken: string;
852
+ totalCount: number;
853
+ respondUserVec: RcimReadReceiptUserInfo[];
854
+ notRespondUserVec: RcimReadReceiptUserInfo[];
855
+ }>;
856
+ /**
857
+ * 按用户列表查询消息已读状态(V5 版本)。
858
+ * @param identifier 会话标识符
859
+ * @param messageUId 消息 UID
860
+ * @param userIdVec 待查询用户 ID 列表(至少 1 个)
861
+ * @return Promise,code 为错误码;respondUserVec/notRespondUserVec 可能为空数组
862
+ */
863
+ getMessageReadReceiptUsersByUsersV5(identifier: RcimConversationIdentifier, messageUId: string, userIdVec: string[]): Promise<{
864
+ code: RcimErrorCode;
865
+ respondUserVec: RcimReadReceiptUserInfo[];
866
+ notRespondUserVec: RcimReadReceiptUserInfo[];
867
+ }>;
868
+ /**
869
+ * 获取远端历史消息。
870
+ * @param convType 会话类型
871
+ * @param targetId 会话目标 ID
872
+ * @param channelId 频道 ID;可为 null
873
+ * @param sendTime 起始时间戳
874
+ * @param count 拉取数量
875
+ * @param order 排序方式(RcimOrder:0 降序,1 升序)
876
+ * @param isIncludeLocal 是否包含本地消息
877
+ * @return Promise,code 为 RcimErrorCode,messages 为消息列表(可能为空)
878
+ */
879
+ getRemoteHistoryMessages(convType: RcimConversationType, targetId: string, channelId: string | undefined, sendTime: number, count: number, order: RcimOrder, isIncludeLocal: boolean): Promise<{
880
+ code: RcimErrorCode;
881
+ messages: RcimMessage[];
882
+ }>;
883
+ /**
884
+ * 从远端服务器指定会话中,清除指定发送时间之前(含)的消息。
885
+ * @param convType 会话类型
886
+ * @param targetId 会话目标 ID
887
+ * @param channelId 频道 ID;可为 null
888
+ * @param leSendTime 锚点发送时间,删除小于等于该时间的消息;传 0 代表清除全部
889
+ * @return Promise,code 为 RcimErrorCode
890
+ */
891
+ cleanRemoteHistoryMessages(convType: RcimConversationType, targetId: string, channelId: string | undefined, leSendTime: number): Promise<RcimErrorCode>;
892
+ /**
893
+ * 按消息 ID 列表删除本地消息。
894
+ * @param msgIdVec 消息 ID 列表
895
+ * @return Promise,code 为 RcimErrorCode
896
+ */
897
+ deleteLocalMessagesByIds(msgIdVec: number[]): Promise<RcimErrorCode>;
898
+ /**
899
+ * 删除指定会话的本地消息。
900
+ * @param convType 会话类型
901
+ * @param targetId 会话目标 ID
902
+ * @param channelId 频道 ID;可为 undefined
903
+ * @return Promise,code 为 RcimErrorCode
904
+ */
905
+ deleteLocalMessages(convType: RcimConversationType, targetId: string, channelId?: string): Promise<RcimErrorCode>;
906
+ /**
907
+ * 根据消息 ID 获取本地消息。
908
+ * @param msgId 消息 ID
909
+ * @return Promise,error 为错误码,message 为消息对象(可选)
910
+ */
911
+ getLocalMessageById(msgId: number): Promise<{
912
+ error: RcimErrorCode;
913
+ message?: RcimMessage;
914
+ }>;
915
+ /**
916
+ * 通过 uid 获取本地消息。
917
+ * @param uid 消息 uid
918
+ * @return Promise,error 为错误码,message 为消息对象(可选)
919
+ */
920
+ getLocalMessageByUid(uid: string): Promise<{
921
+ error: RcimErrorCode;
922
+ message?: RcimMessage;
923
+ }>;
924
+ /**
925
+ * 获取会话中的第一条未读消息。
926
+ * @param convType 会话类型
927
+ * @param targetId 会话目标 ID
928
+ * @param channelId 频道 ID(可为 null)
929
+ * @return Promise,error 为错误码,message 为消息对象(可选)
930
+ */
931
+ getFirstUnreadMessage(convType: RcimConversationType, targetId: string, channelId?: string): Promise<{
932
+ error: RcimErrorCode;
933
+ message?: RcimMessage;
934
+ }>;
935
+ /**
936
+ * 撤回消息。
937
+ * @param message 待撤回的消息对象
938
+ * @return Promise,error 为错误码,recallNotify 为撤回消息通知(可选)
939
+ */
940
+ recallMessage(message: RcimMessage): Promise<{
941
+ error: RcimErrorCode;
942
+ recallNotify?: RcimRecallNotificationMessage;
943
+ }>;
944
+ /**
945
+ * 设置消息发送状态。
946
+ * @param messageId 消息 ID
947
+ * @param sentStatus 发送状态
948
+ * @return Promise,code 为 RcimErrorCode
949
+ */
950
+ setMessageSentStatus(messageId: number, sentStatus: RcimSentStatus): Promise<RcimErrorCode>;
951
+ /**
952
+ * 设置消息接收状态。
953
+ * @param messageId 消息 ID
954
+ * @param receivedStatus 接收状态
955
+ * @return Promise,code 为 RcimErrorCode
956
+ */
957
+ setMessageReceivedStatus(messageId: number, receivedStatus: RcimReceivedStatus): Promise<RcimErrorCode>;
958
+ /**
959
+ * 设置消息内容。
960
+ * @param messageId 消息 ID
961
+ * @param content 消息内容
962
+ * @param objectName 消息类型名
963
+ * @param searchableWords 可被搜索的内容
964
+ * @return Promise,code 为 RcimErrorCode
965
+ */
966
+ setMessageContent(messageId: number, content: RcimMessageContent, searchableWords: string): Promise<RcimErrorCode>;
967
+ /**
968
+ * 注册自定义消息类型,并且定义消息可搜索字段。
969
+ * 通过此接口自定义的消息类型,消息的 content 需要是 json 类型,SDK 解析可搜索字段时,
970
+ * 会通过此接口设置成 key,解析 json 中的对应的 value 值,并将 value 作为可搜索字段入库。
971
+ * @param clazz 消息内容构造器
972
+ * @param searchableKeyVec 可搜索字段 key 数组(可选)
973
+ * @return RcimErrorCode,Success 表示成功,其他表示失败
974
+ */
975
+ registerMessageTypeWithSearchableKey(clazz: RcimMessageContentConstructor, searchableKeyVec?: string[]): RcimErrorCode;
976
+ /**
977
+ * 注册自定义消息
978
+ * 直接通过 objectName 和 mesasgeFlag 注册自定义消息,此类消息在返回时候的类型为 RcimUnknownMessage
979
+ * 可以通过
980
+ * @param objectName 与移动端对齐的消息结构类型,如:RC:TxtMsg
981
+ * @param mesasgeFlag 是否存储或计数标记
982
+ * @param searchProps 可搜索字段 key 数组(可选)
983
+ */
984
+ registerMessageTypeWithSearchableKeyByObjectName(objectName: string, mesasgeFlag: RcimMessageFlag, searchProps: string[]): RcimErrorCode;
985
+ /**
986
+ * 设置流式消息事件监听。
987
+ * @param listener 流式消息事件监听回调函数(传 null 取消监听)
988
+ * @return RcimErrorCode,Success 表示成功
989
+ */
990
+ setStreamMessageRequestEventListener(listener: ((event: RcimStreamMessageRequestEvent, message?: RcimMessage, chunkInfo?: RcimStreamMessageChunkInfo, completeCode?: RcimErrorCode) => void) | null): RcimErrorCode;
991
+ /**
992
+ * 请求流式消息。
993
+ * @param messageUid 消息 UID
994
+ * @return Promise,error 为错误码
995
+ */
996
+ requestStreamMessage(messageUid: string): Promise<{
997
+ error: RcimErrorCode;
998
+ }>;
999
+ }
1000
+ //# sourceMappingURL=RCIMEngine.d.ts.map