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