@rongcloud/imlib-v2-adapter 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -0
- package/README.md +1 -0
- package/index.d.ts +1834 -0
- package/index.esm.js +1 -0
- package/index.js +1 -0
- package/package.json +26 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,1834 @@
|
|
|
1
|
+
import { IPushConfig, IUserProfile, ConversationType, MessageDirection, ReceivedStatus, IReadReceiptInfo, LogLevel, IConversationTag, ConnectionStatus, ITypingMessage, IBlockedMessageInfo, IChatroomListenerData, ErrorCode, APIContext, IMessageReaderResponse, NotificationStatus, IRemoveChatroomEntry, IPluginGenerator, INaviInfo, IChatroomEntry, IChatroomEntries, FileType, IUploadAuth, UploadMethod, ITagParam, ITagInfo, IExtraMethod, IRTCUsers, IRTCRoomInfo, IJoinRTCRoomData, RTCApiType, KVString, IRtcTokenData, RTCMode, LogType, Logger, MentionedType as MentionedType$1 } from '@rongcloud/engine';
|
|
2
|
+
export { ConnectionStatus, ConversationType, ErrorCode, FileType, IDeletedExpansion, IExpansionListenerData, IMessageReaderResponse, IRemoveChatroomEntry, IUpdatedExpansion, LogLevel, MessageDirection, ReceivedStatus, UploadMethod } from '@rongcloud/engine';
|
|
3
|
+
|
|
4
|
+
declare enum SentStatus {
|
|
5
|
+
/**
|
|
6
|
+
* 发送中。
|
|
7
|
+
*/
|
|
8
|
+
SENDING = 10,
|
|
9
|
+
/**
|
|
10
|
+
* 发送失败。
|
|
11
|
+
*/
|
|
12
|
+
FAILED = 20,
|
|
13
|
+
/**
|
|
14
|
+
* 已发送。
|
|
15
|
+
*/
|
|
16
|
+
SENT = 30,
|
|
17
|
+
/**
|
|
18
|
+
* 对方已接收。
|
|
19
|
+
*/
|
|
20
|
+
RECEIVED = 40,
|
|
21
|
+
/**
|
|
22
|
+
* 对方已读。
|
|
23
|
+
*/
|
|
24
|
+
READ = 50,
|
|
25
|
+
/**
|
|
26
|
+
* 对方已销毁。
|
|
27
|
+
*/
|
|
28
|
+
DESTROYED = 60
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare enum GetChatRoomType {
|
|
32
|
+
NONE = 0,
|
|
33
|
+
SQQUENCE = 1,
|
|
34
|
+
REVERSE = 2
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface ISendOptionsV2 {
|
|
38
|
+
/**
|
|
39
|
+
* 接收定向消息的用户 id,用于向群聊中的指定人员发送定向消息,其他人无法查看
|
|
40
|
+
*/
|
|
41
|
+
userIds?: string[];
|
|
42
|
+
/**
|
|
43
|
+
* 为 ture 时, 当对方为 iOS 设备且未在线时,其将收到 Voip Push. 此配置对 Android 无影响
|
|
44
|
+
*/
|
|
45
|
+
isVoipPush?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* 是否发送静默消息
|
|
48
|
+
* @description
|
|
49
|
+
* 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
|
|
50
|
+
*/
|
|
51
|
+
disableNotification: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* 消息是否支持拓展内容
|
|
54
|
+
*/
|
|
55
|
+
canIncludeExpansion?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* 消息拓展内容数据
|
|
58
|
+
*/
|
|
59
|
+
expansion?: {
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* 过滤黑/白名单
|
|
64
|
+
*/
|
|
65
|
+
isFilerWhiteBlacklist: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* 推送扩展消息
|
|
68
|
+
*/
|
|
69
|
+
pushConfig?: IPushConfig;
|
|
70
|
+
/**
|
|
71
|
+
* 是否为状态消息
|
|
72
|
+
*/
|
|
73
|
+
isStatusMessage?: boolean;
|
|
74
|
+
/**
|
|
75
|
+
* 是否为状态消息
|
|
76
|
+
* @deprecated
|
|
77
|
+
* 该参数已废弃,请使用 `isStatusMessage` 替代该参数。在 `isStatusMessage` 有值的情况下,该参数将失效
|
|
78
|
+
*/
|
|
79
|
+
isStatus?: boolean;
|
|
80
|
+
}
|
|
81
|
+
interface IRecallOptionsV2 {
|
|
82
|
+
/**
|
|
83
|
+
* 是否发送静默消息
|
|
84
|
+
* @description
|
|
85
|
+
* 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
|
|
86
|
+
*/
|
|
87
|
+
disableNotification: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* 推送扩展消息
|
|
90
|
+
*/
|
|
91
|
+
pushConfig?: IPushConfig;
|
|
92
|
+
/**
|
|
93
|
+
* 消息中携带的扩展字段
|
|
94
|
+
*/
|
|
95
|
+
extra?: string;
|
|
96
|
+
/**
|
|
97
|
+
* 消息中携带的用户信息
|
|
98
|
+
*/
|
|
99
|
+
user?: IUserProfile;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* v2 版本中要吐给应用层的消息结构
|
|
103
|
+
*/
|
|
104
|
+
interface IReceivedMessageV2 {
|
|
105
|
+
receiptResponse?: any;
|
|
106
|
+
/**
|
|
107
|
+
* 会话标识预留字段
|
|
108
|
+
*/
|
|
109
|
+
channelId?: string;
|
|
110
|
+
conversationType: ConversationType;
|
|
111
|
+
targetId: string;
|
|
112
|
+
senderUserId: string;
|
|
113
|
+
content: any;
|
|
114
|
+
objectName: string;
|
|
115
|
+
messageType: string;
|
|
116
|
+
messageId: number;
|
|
117
|
+
messageUId: string;
|
|
118
|
+
messageDirection: MessageDirection;
|
|
119
|
+
offLineMessage: boolean;
|
|
120
|
+
sentStatus: SentStatus;
|
|
121
|
+
sentTime: number;
|
|
122
|
+
receivedStatus: ReceivedStatus;
|
|
123
|
+
receivedTime: number;
|
|
124
|
+
canIncludeExpansion: boolean;
|
|
125
|
+
expansion: {
|
|
126
|
+
[key: string]: string;
|
|
127
|
+
} | null;
|
|
128
|
+
disableNotification: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* 消息已读回执信息,导航配置grpRRVer=1时群组类型消息内存在, 其他情况为undefined
|
|
131
|
+
*/
|
|
132
|
+
readReceiptInfo?: IReadReceiptInfo;
|
|
133
|
+
pushConfig?: IPushConfig;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @todo 非直接对用户暴露的数据类
|
|
137
|
+
* 基础消息数据类
|
|
138
|
+
*/
|
|
139
|
+
declare class BaseMessage<T = any> {
|
|
140
|
+
readonly messageType: string;
|
|
141
|
+
readonly objectName: string;
|
|
142
|
+
content: T;
|
|
143
|
+
readonly isPersited: boolean;
|
|
144
|
+
readonly isCounted: boolean;
|
|
145
|
+
constructor(messageType: string, objectName: string, content: T, isPersited?: boolean, isCounted?: boolean);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
interface IConversationStatus {
|
|
149
|
+
/**
|
|
150
|
+
* 是否置顶
|
|
151
|
+
*/
|
|
152
|
+
isTop?: boolean;
|
|
153
|
+
/**
|
|
154
|
+
* 是否免打扰
|
|
155
|
+
* @description
|
|
156
|
+
* 1. 开启免打扰
|
|
157
|
+
* 2. 关闭免打扰
|
|
158
|
+
*/
|
|
159
|
+
notificationStatus?: 1 | 2;
|
|
160
|
+
/**
|
|
161
|
+
* 标签
|
|
162
|
+
*/
|
|
163
|
+
tags?: IConversationTag[];
|
|
164
|
+
}
|
|
165
|
+
interface IReceivedConversationStatus extends IConversationStatus {
|
|
166
|
+
/**
|
|
167
|
+
* 会话类型
|
|
168
|
+
*/
|
|
169
|
+
conversationType: ConversationType;
|
|
170
|
+
/**
|
|
171
|
+
* 会话目标 ID
|
|
172
|
+
*/
|
|
173
|
+
targetId: string;
|
|
174
|
+
/**
|
|
175
|
+
* 更新时间
|
|
176
|
+
*/
|
|
177
|
+
updatedTime: number;
|
|
178
|
+
/**
|
|
179
|
+
* 会话标识
|
|
180
|
+
*/
|
|
181
|
+
channelId: string;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* 从服务端收到更新监听数据信息
|
|
185
|
+
*/
|
|
186
|
+
interface IReceivedUpdatedExpansion {
|
|
187
|
+
/**
|
|
188
|
+
* 新增、修改的扩展信息
|
|
189
|
+
*/
|
|
190
|
+
expansion: {
|
|
191
|
+
[key: string]: string;
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* 扩展消息的 messageUId
|
|
195
|
+
*/
|
|
196
|
+
messageUId: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* 从服务端收到的删除监听数据信息
|
|
200
|
+
*/
|
|
201
|
+
interface IReceivedDeletedExpansion {
|
|
202
|
+
/**
|
|
203
|
+
* 删除扩展的 keys
|
|
204
|
+
*/
|
|
205
|
+
deletedKeys: string[];
|
|
206
|
+
/**
|
|
207
|
+
* 扩展消息的 messageUId
|
|
208
|
+
*/
|
|
209
|
+
messageUId: string;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* 初始化参数配置
|
|
213
|
+
*/
|
|
214
|
+
interface IInitOption {
|
|
215
|
+
/**
|
|
216
|
+
* 私有云部署导航地址,公有云可传空
|
|
217
|
+
*/
|
|
218
|
+
navi?: string;
|
|
219
|
+
/**
|
|
220
|
+
* 私有云部署 API 地址,公有云可传空
|
|
221
|
+
*/
|
|
222
|
+
api?: string;
|
|
223
|
+
/**
|
|
224
|
+
* 连接方式,默认使用 'websocket'
|
|
225
|
+
*/
|
|
226
|
+
connectionType?: 'websocket' | 'comet';
|
|
227
|
+
/**
|
|
228
|
+
* 输出日志等级
|
|
229
|
+
*/
|
|
230
|
+
logLevel?: LogLevel;
|
|
231
|
+
/**
|
|
232
|
+
* 修改默认日志输出函数
|
|
233
|
+
*/
|
|
234
|
+
logStdout?: (logLevel: LogLevel, content: string) => void;
|
|
235
|
+
/**
|
|
236
|
+
* 调试模式,开启后 SDK 自动向控制台输出日志
|
|
237
|
+
* @deprecated
|
|
238
|
+
*/
|
|
239
|
+
debug?: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* 网络嗅探配置,SDK 自动重连时通过此配置进行网络探测
|
|
242
|
+
* @deprecated
|
|
243
|
+
*/
|
|
244
|
+
detect?: {
|
|
245
|
+
/**
|
|
246
|
+
* 网络嗅探地址。默认嗅探地址仅为测试 http 请求是否可以正常发送,并非真实地址,返回 404 属于正常情况
|
|
247
|
+
* @default https://cdn.ronghub.com/im_detecting
|
|
248
|
+
*/
|
|
249
|
+
url: string;
|
|
250
|
+
/**
|
|
251
|
+
* 网络嗅探间隔时间,单位:毫秒
|
|
252
|
+
* @default 1500
|
|
253
|
+
*/
|
|
254
|
+
intervalTime: number;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* @deprecated 该参数已废弃
|
|
258
|
+
*/
|
|
259
|
+
protobuf?: string;
|
|
260
|
+
/**
|
|
261
|
+
* @deprecated
|
|
262
|
+
*/
|
|
263
|
+
dbPath?: string;
|
|
264
|
+
/**
|
|
265
|
+
* typing 过期时间
|
|
266
|
+
*/
|
|
267
|
+
typingExpireTime?: number;
|
|
268
|
+
/**
|
|
269
|
+
* 是否打开 IndexDB 存储, 默认为 true
|
|
270
|
+
*/
|
|
271
|
+
indexDBSwitch?: boolean;
|
|
272
|
+
/**
|
|
273
|
+
* 是否校验证书,默认为 true
|
|
274
|
+
*/
|
|
275
|
+
checkCA?: boolean;
|
|
276
|
+
/**
|
|
277
|
+
* 群聊天回执超时时间, 最大值15天,最小1天,单位:天
|
|
278
|
+
* @default 1
|
|
279
|
+
*/
|
|
280
|
+
readReceiptTimeout?: number;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* 消息监听器
|
|
284
|
+
*/
|
|
285
|
+
interface IReceiveMessageListener {
|
|
286
|
+
/**
|
|
287
|
+
* 消息回调
|
|
288
|
+
* @param message 接收到的消息
|
|
289
|
+
* @param leftCount 该参数废弃,值将始终为 undefined
|
|
290
|
+
* @param hasMore c++ 协议栈配套参数,消息是否收取结束
|
|
291
|
+
*/
|
|
292
|
+
onReceived(message: IReceivedMessageV2, leftCount?: number, hasMore?: boolean): void;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* 连接监听器
|
|
296
|
+
*/
|
|
297
|
+
interface IConnectionStatusListener {
|
|
298
|
+
onChanged(status: ConnectionStatus): void;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* 会话状态监听器
|
|
302
|
+
*/
|
|
303
|
+
interface IConversationStatusListener {
|
|
304
|
+
/**
|
|
305
|
+
* 状态回调
|
|
306
|
+
*/
|
|
307
|
+
onChanged(status: IReceivedConversationStatus[]): void;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* 消息扩展监听器
|
|
311
|
+
*/
|
|
312
|
+
interface IMessageExpansionListener {
|
|
313
|
+
onUpdated(data: IReceivedUpdatedExpansion): void;
|
|
314
|
+
onDeleted(data: IReceivedDeletedExpansion): void;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* 标签监听器
|
|
318
|
+
*/
|
|
319
|
+
interface ITagListener {
|
|
320
|
+
onChanged(): void;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* 离线拉取完成监听器
|
|
324
|
+
*/
|
|
325
|
+
interface IPullFinishedListener {
|
|
326
|
+
onFinished(): void;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* typing监听器
|
|
330
|
+
*/
|
|
331
|
+
interface ITypingListener {
|
|
332
|
+
onChanged(info: ITypingMessage[]): void;
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* 敏感词回调监听器
|
|
336
|
+
*/
|
|
337
|
+
interface IMessageBlockedListener {
|
|
338
|
+
onReceived(info: IBlockedMessageInfo): void;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* 聊天室监听器
|
|
342
|
+
*/
|
|
343
|
+
interface IChatRoomListener {
|
|
344
|
+
onChanged(info: IChatroomListenerData): void;
|
|
345
|
+
}
|
|
346
|
+
/**
|
|
347
|
+
* 连接回调
|
|
348
|
+
*/
|
|
349
|
+
interface IConnectCallback {
|
|
350
|
+
/**
|
|
351
|
+
* 连接成功回调
|
|
352
|
+
* @param userId
|
|
353
|
+
*/
|
|
354
|
+
onSuccess(userId: string): void;
|
|
355
|
+
/**
|
|
356
|
+
* 连接用 token 失效回调
|
|
357
|
+
*/
|
|
358
|
+
onTokenIncorrect(): void;
|
|
359
|
+
/**
|
|
360
|
+
* 连接失败回调
|
|
361
|
+
* @param errorcode 错误码
|
|
362
|
+
*/
|
|
363
|
+
onError(errorcode: number): void;
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* 重连配置
|
|
367
|
+
*/
|
|
368
|
+
interface IReconnectOptions {
|
|
369
|
+
/**
|
|
370
|
+
* 是否自动重连
|
|
371
|
+
* @default false
|
|
372
|
+
*/
|
|
373
|
+
auto?: boolean;
|
|
374
|
+
/**
|
|
375
|
+
* 用于网络嗅探的地址。auto 为 true 时, 此参数必填
|
|
376
|
+
*/
|
|
377
|
+
url?: string;
|
|
378
|
+
/**
|
|
379
|
+
* 网络嗅探频率, 单位为毫秒。auto 为 true 时, 此参数必填
|
|
380
|
+
*/
|
|
381
|
+
rate?: number[];
|
|
382
|
+
}
|
|
383
|
+
interface IErrorCallback {
|
|
384
|
+
/**
|
|
385
|
+
* 失败回调
|
|
386
|
+
* @param error
|
|
387
|
+
*/
|
|
388
|
+
onError(error: ErrorCode, data?: unknown): void;
|
|
389
|
+
}
|
|
390
|
+
interface ISuccessCallback<T, O = void> {
|
|
391
|
+
/**
|
|
392
|
+
* 成功回调
|
|
393
|
+
* @param data
|
|
394
|
+
*/
|
|
395
|
+
onSuccess(data: T, other?: O): void;
|
|
396
|
+
}
|
|
397
|
+
interface ICallback<T = void, O = void> extends ISuccessCallback<T, O>, IErrorCallback {
|
|
398
|
+
}
|
|
399
|
+
interface ISendCallback<T = void, O = void> extends ICallback<T, O> {
|
|
400
|
+
onBefore?(messageId: number): void;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* V2 API Conversation
|
|
404
|
+
*/
|
|
405
|
+
interface IV2Conversation {
|
|
406
|
+
/**
|
|
407
|
+
* 多组织会话业务标识
|
|
408
|
+
*/
|
|
409
|
+
channelId: string;
|
|
410
|
+
/**
|
|
411
|
+
* 会话类型
|
|
412
|
+
*/
|
|
413
|
+
conversationType: ConversationType;
|
|
414
|
+
/**
|
|
415
|
+
* 接收方 ID
|
|
416
|
+
*/
|
|
417
|
+
targetId: string;
|
|
418
|
+
/**
|
|
419
|
+
* 当前会话的未读消息数
|
|
420
|
+
*/
|
|
421
|
+
unreadMessageCount: number;
|
|
422
|
+
/**
|
|
423
|
+
* 会话中的最后一条消息
|
|
424
|
+
*/
|
|
425
|
+
latestMessage: IReceivedMessageV2 | null;
|
|
426
|
+
/**
|
|
427
|
+
* ~~会话最后一条消息 ID~~
|
|
428
|
+
* @deprecated
|
|
429
|
+
* 该属性已废弃,请通过 `latestMessage` 取值
|
|
430
|
+
*/
|
|
431
|
+
latestMessageId?: number;
|
|
432
|
+
/**
|
|
433
|
+
* ~~会话中最后一条消息的消息标识, 融云内置消息以 "RC:" 开头~~
|
|
434
|
+
* @deprecated
|
|
435
|
+
* 该属性已废弃,请通过 `latestMessage` 取值
|
|
436
|
+
*/
|
|
437
|
+
objectName?: string;
|
|
438
|
+
/**
|
|
439
|
+
* ~~会话中最后一条消息融云服务端的发送时间~~
|
|
440
|
+
* @deprecated
|
|
441
|
+
* 该属性已废弃,请通过 `latestMessage` 取值
|
|
442
|
+
*/
|
|
443
|
+
sentTime?: number;
|
|
444
|
+
/**
|
|
445
|
+
* 会话置顶状态
|
|
446
|
+
*/
|
|
447
|
+
isTop: boolean;
|
|
448
|
+
/**
|
|
449
|
+
* 会话免打扰状态: 1 开启免打扰、 2 关闭免打扰
|
|
450
|
+
*/
|
|
451
|
+
notificationStatus: 1 | 2;
|
|
452
|
+
/**
|
|
453
|
+
* ~~最后一条消息接收状态~~
|
|
454
|
+
* @deprecated
|
|
455
|
+
* 该属性已废弃,请通过 `latestMessage` 取值
|
|
456
|
+
*/
|
|
457
|
+
receivedStatus?: number;
|
|
458
|
+
/**
|
|
459
|
+
* 会话中最后一条消息发送状态 TODO 待确认是否弃用
|
|
460
|
+
*/
|
|
461
|
+
/**
|
|
462
|
+
* 按照消息搜索会话时,匹配到的消息数量
|
|
463
|
+
*/
|
|
464
|
+
matchCount?: number;
|
|
465
|
+
}
|
|
466
|
+
/**
|
|
467
|
+
* V2 API ConversationContainTag
|
|
468
|
+
*/
|
|
469
|
+
interface IV2ConversationContainTag extends IV2Conversation {
|
|
470
|
+
/**
|
|
471
|
+
* 在tag中是否置顶
|
|
472
|
+
*/
|
|
473
|
+
isTopInTag: boolean;
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* 按 messageUId 删除消息
|
|
477
|
+
*/
|
|
478
|
+
interface IDeleteMessge {
|
|
479
|
+
/**
|
|
480
|
+
* 消息 UId
|
|
481
|
+
*/
|
|
482
|
+
messageUId: string;
|
|
483
|
+
/**
|
|
484
|
+
* 消息发送时间
|
|
485
|
+
*/
|
|
486
|
+
sentTime: number;
|
|
487
|
+
/**
|
|
488
|
+
* 消息方向
|
|
489
|
+
*/
|
|
490
|
+
messageDirection: MessageDirection;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* getFileUrl 返回数据接口
|
|
494
|
+
*/
|
|
495
|
+
interface IGetFileUrl {
|
|
496
|
+
/**
|
|
497
|
+
* 上传后的文件下载地址
|
|
498
|
+
*/
|
|
499
|
+
downloadUrl: string;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* 按时间戳删除消息
|
|
503
|
+
*/
|
|
504
|
+
interface IDelteByTime {
|
|
505
|
+
conversationType: number;
|
|
506
|
+
targetId: string;
|
|
507
|
+
timestamp: number;
|
|
508
|
+
}
|
|
509
|
+
interface IV2ChatRoomInfo {
|
|
510
|
+
/**
|
|
511
|
+
* 成员列表
|
|
512
|
+
* @todo 需确认数组元素的数据结构
|
|
513
|
+
*/
|
|
514
|
+
userInfos: {
|
|
515
|
+
/**
|
|
516
|
+
* 用户 id
|
|
517
|
+
*/
|
|
518
|
+
id: string;
|
|
519
|
+
/**
|
|
520
|
+
* 加入聊天室的时间
|
|
521
|
+
*/
|
|
522
|
+
time: number;
|
|
523
|
+
}[];
|
|
524
|
+
/**
|
|
525
|
+
* 房间内总人数
|
|
526
|
+
*/
|
|
527
|
+
userTotalNums: number;
|
|
528
|
+
}
|
|
529
|
+
interface IInsertOptions {
|
|
530
|
+
/**
|
|
531
|
+
* 插入消息是否计入未读数: true 计数 false 不计数, 默认不计数
|
|
532
|
+
*/
|
|
533
|
+
isUnread?: boolean;
|
|
534
|
+
/**
|
|
535
|
+
* 消息搜索关键字
|
|
536
|
+
*/
|
|
537
|
+
searchContent?: string;
|
|
538
|
+
}
|
|
539
|
+
interface IIMClientOptions {
|
|
540
|
+
/**
|
|
541
|
+
* 群回执超时时间,单位天,最大15天
|
|
542
|
+
*/
|
|
543
|
+
readReceiptTimeout: number;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
declare class ChannelClient {
|
|
547
|
+
private readonly _context;
|
|
548
|
+
readonly channelId: string;
|
|
549
|
+
private readonly _isCPPMode;
|
|
550
|
+
private readonly _readReceiptTimeout;
|
|
551
|
+
private readonly _storage;
|
|
552
|
+
/**
|
|
553
|
+
* 草稿数据
|
|
554
|
+
*/
|
|
555
|
+
private readonly _draftMap;
|
|
556
|
+
constructor(_context: APIContext, channelId: string, _isCPPMode: boolean, _readReceiptTimeout: number);
|
|
557
|
+
/**
|
|
558
|
+
* 获取会话列表
|
|
559
|
+
* @param callback 结果回调
|
|
560
|
+
* @param conversationTypes 会话类型,为 null 时,返回全部会话
|
|
561
|
+
* @param count 获取数量,默认 300
|
|
562
|
+
*/
|
|
563
|
+
getConversationList(callback: ICallback<IV2Conversation[]>, conversationTypes: Number[] | null, count?: number): void;
|
|
564
|
+
/**
|
|
565
|
+
* 获取指定会话
|
|
566
|
+
* @deprecated
|
|
567
|
+
* @param conversationType
|
|
568
|
+
* @param targetId
|
|
569
|
+
* @param callback
|
|
570
|
+
*/
|
|
571
|
+
getConversation(conversationType: ConversationType, targetId: string, callback: ICallback<IV2Conversation | null>): void;
|
|
572
|
+
/**
|
|
573
|
+
* 删除指定会话
|
|
574
|
+
* @param conversationType 会话类型
|
|
575
|
+
* @param targetId 会话 target_id
|
|
576
|
+
* @param callback 删除回调
|
|
577
|
+
*/
|
|
578
|
+
removeConversation(conversationType: ConversationType, targetId: string, callback: ICallback<void>): void;
|
|
579
|
+
/**
|
|
580
|
+
* 保存草稿
|
|
581
|
+
* @description 草稿存储在内存中,如刷新或者关闭页面会导致草稿丢失。
|
|
582
|
+
* 草稿功能并未在 v3 SDK 版本红实现,由 Bridge 模块实现
|
|
583
|
+
* @param conversationType
|
|
584
|
+
* @param targetId
|
|
585
|
+
* @param draftText
|
|
586
|
+
*/
|
|
587
|
+
saveTextMessageDraft(conversationType: ConversationType, targetId: string, draftText: string): boolean;
|
|
588
|
+
/**
|
|
589
|
+
* 获取草稿信息
|
|
590
|
+
* @description 未登录或无草稿数据时将返回 undefined
|
|
591
|
+
* @param conversationType
|
|
592
|
+
* @param targetId
|
|
593
|
+
*/
|
|
594
|
+
getTextMessageDraft(conversationType: ConversationType, targetId: string): string | undefined;
|
|
595
|
+
/**
|
|
596
|
+
* 删除草稿
|
|
597
|
+
* @param conversationType
|
|
598
|
+
* @param targetId
|
|
599
|
+
*/
|
|
600
|
+
clearTextMessageDraft(conversationType: ConversationType, targetId: string): boolean;
|
|
601
|
+
/**
|
|
602
|
+
* 获取当前组织下的所有会话的消息未读数
|
|
603
|
+
* @description
|
|
604
|
+
* 1. 清除浏览器缓存会导致会话未读数不准确
|
|
605
|
+
* 2. 会话消息未读数存储在 WebStorage 中, 若浏览器不支持或禁用 WebStorage,未读消息数将不会保存,浏览器页面刷新未读消息数将不会存在
|
|
606
|
+
* @param callback
|
|
607
|
+
* @param conversationTypes 要获取未读数的会话类型,若为空,则默认获取单聊、群聊及系统消息未读数
|
|
608
|
+
* @param includeMuted 是否包含免打扰会话(web 暂未实现)
|
|
609
|
+
*/
|
|
610
|
+
getTotalUnreadCount(callback: ICallback<number>, conversationTypes?: ConversationType[], includeMuted?: boolean): void;
|
|
611
|
+
/**
|
|
612
|
+
* 获取指定会话的消息未读数
|
|
613
|
+
* @todo
|
|
614
|
+
* @param conversationType
|
|
615
|
+
* @param targetId
|
|
616
|
+
* @param callback
|
|
617
|
+
*/
|
|
618
|
+
getUnreadCount(conversationType: ConversationType, targetId: string, callback: ICallback<number>): void;
|
|
619
|
+
/**
|
|
620
|
+
* 删除指定类型会话,该方法已弃用
|
|
621
|
+
* @description
|
|
622
|
+
* 仅可在协议栈连接下调用
|
|
623
|
+
* @param callback
|
|
624
|
+
* @param {ConversationType[]} ? types
|
|
625
|
+
*/
|
|
626
|
+
clearConversations(callback: ICallback<boolean>, conversationTypes: ConversationType[]): void;
|
|
627
|
+
/**
|
|
628
|
+
* 清除指定会话未读数
|
|
629
|
+
* @param conversationType
|
|
630
|
+
* @param targetId
|
|
631
|
+
* @param callback
|
|
632
|
+
*/
|
|
633
|
+
clearUnreadCount(conversationType: ConversationType, targetId: string, callback: ICallback<boolean>): void;
|
|
634
|
+
/**
|
|
635
|
+
* 清除全部会话未读数
|
|
636
|
+
* @param callback
|
|
637
|
+
*/
|
|
638
|
+
clearAllUnreadCount(callback: ICallback<boolean>): void;
|
|
639
|
+
/**
|
|
640
|
+
* 获取第一个未读消息,仅在协议栈下可调用
|
|
641
|
+
* @param conversationType 会话类型
|
|
642
|
+
* @param targetId 目标 ID
|
|
643
|
+
* @param callback
|
|
644
|
+
* @returns
|
|
645
|
+
*/
|
|
646
|
+
getFirstUnreadMessage(conversationType: ConversationType, targetId: string, callback: ICallback<IReceivedMessageV2 | null>): void;
|
|
647
|
+
/**
|
|
648
|
+
* 设置会话状态:是否置顶、是否免打扰
|
|
649
|
+
* @param conversationType
|
|
650
|
+
* @param targetId
|
|
651
|
+
* @param status
|
|
652
|
+
* @param callback
|
|
653
|
+
*/
|
|
654
|
+
setConversationStatus(conversationType: ConversationType, targetId: string, status: IConversationStatus, callback: ICallback): void;
|
|
655
|
+
/**
|
|
656
|
+
* 发送消息
|
|
657
|
+
* @param conversationType 会话类型
|
|
658
|
+
* @param targetId 接收方 id,当会话类型为单聊时,该值为单聊对象的 userId,为群聊时,该值应为群组 groupId
|
|
659
|
+
* @param msg 消息体
|
|
660
|
+
* @param callback 回调函数
|
|
661
|
+
* @param isMentioned `是否为 @ 消息`
|
|
662
|
+
* @param pushContent 移动端在接收到消息推送时用于显示的推送信息
|
|
663
|
+
* @param pushData Push 通知时附加信息
|
|
664
|
+
* @param methodType 1 : 多客服(客服后台使用); 2 : 消息撤回
|
|
665
|
+
* @param options 其他设置项
|
|
666
|
+
*/
|
|
667
|
+
sendMessage(conversationType: ConversationType, targetId: string, msg: BaseMessage, callback: ISendCallback<IReceivedMessageV2>, isMentioned?: boolean, pushContent?: string, pushData?: string, options?: ISendOptionsV2): void;
|
|
668
|
+
/**
|
|
669
|
+
* 消息撤回
|
|
670
|
+
* @param message
|
|
671
|
+
*/
|
|
672
|
+
sendRecallMessage(message: IReceivedMessageV2, callback: ICallback<IReceivedMessageV2>, options?: IRecallOptionsV2): void;
|
|
673
|
+
/**
|
|
674
|
+
* 发送正在输入状态消息
|
|
675
|
+
* @description
|
|
676
|
+
* 正在输入状态消息,不存储、不计数、不推送
|
|
677
|
+
* @param conversationType 会话类型
|
|
678
|
+
* @param targetId 会话 id
|
|
679
|
+
* @param typingContentType 正在输入的消息 ObjectName,如 RC:TxtMsg
|
|
680
|
+
* @param callback
|
|
681
|
+
*/
|
|
682
|
+
sendTypingStatusMessage(conversationType: ConversationType, targetId: string, typingContentType: string, callback: ICallback<IReceivedMessageV2>): void;
|
|
683
|
+
/**
|
|
684
|
+
* 发送已读回执
|
|
685
|
+
* @description
|
|
686
|
+
* @param conversationType
|
|
687
|
+
* @param targetId
|
|
688
|
+
* @param callback
|
|
689
|
+
*/
|
|
690
|
+
sendReceiptResponse(conversationType: ConversationType, targetId: string, callback: ICallback<IReceivedMessageV2 | null>): void;
|
|
691
|
+
/**
|
|
692
|
+
* 发送群已读回执
|
|
693
|
+
* @param messageUIds
|
|
694
|
+
* @param targetId
|
|
695
|
+
* @param callback
|
|
696
|
+
*/
|
|
697
|
+
sendReadReceiptMessage(messageUIds: string[], targetId: string, callback: ICallback): void;
|
|
698
|
+
/**
|
|
699
|
+
* 获取群已读列表
|
|
700
|
+
* @param messageUIds
|
|
701
|
+
* @param targetId
|
|
702
|
+
* @param callback
|
|
703
|
+
*/
|
|
704
|
+
getMessageReader(messageUId: string, targetId: string, callback: ICallback<IMessageReaderResponse>): void;
|
|
705
|
+
/**
|
|
706
|
+
* 更新消息扩展
|
|
707
|
+
* @param expansionDic 要更新的消息扩展信息键值对
|
|
708
|
+
* @param message 要更新的原始消息体
|
|
709
|
+
*/
|
|
710
|
+
updateMessageExpansion(expansionDic: {
|
|
711
|
+
[key: string]: string;
|
|
712
|
+
}, message: IReceivedMessageV2, callback: ICallback): void;
|
|
713
|
+
/**
|
|
714
|
+
* 删除消息扩展属性
|
|
715
|
+
* @param keys 消息扩展信息中待删除的 key 的列表
|
|
716
|
+
* @param message 要删除消息扩展的原始消息体
|
|
717
|
+
*/
|
|
718
|
+
removeMessageExpansionForKey(keys: string[], message: IReceivedMessageV2, callback: ICallback): void;
|
|
719
|
+
/**
|
|
720
|
+
* 从服务端拉取指定会话的历史消息
|
|
721
|
+
* @param conversationType 会话类型
|
|
722
|
+
* @param targetId 会话 ID
|
|
723
|
+
* @param timestamp 获取时间戳, 0 为从当前时间拉取
|
|
724
|
+
* @param count 拉取条数,获取条数, 范围 1 - 20
|
|
725
|
+
* @param order 获取顺序,默认为 0。0 为升序,获取消息发送时间比 timestamp 更早的消息;1 为降序。
|
|
726
|
+
* @param objectname
|
|
727
|
+
*/
|
|
728
|
+
getHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, callback: ICallback<Array<IReceivedMessageV2>, boolean>, objectName?: string, order?: 0 | 1): void;
|
|
729
|
+
/**
|
|
730
|
+
* 通过 messageUId 删除消息
|
|
731
|
+
* @param conversationType 会话类型
|
|
732
|
+
* @param targetId 会话 id
|
|
733
|
+
* @param messages 要删除的消息 []
|
|
734
|
+
* @param callback
|
|
735
|
+
*/
|
|
736
|
+
deleteRemoteMessages(conversationType: ConversationType, targetId: string, messages: IDeleteMessge[], callback: ICallback): void;
|
|
737
|
+
/**
|
|
738
|
+
* 通过时间戳删除消息
|
|
739
|
+
* @param param
|
|
740
|
+
* @param callback
|
|
741
|
+
*/
|
|
742
|
+
clearRemoteHistoryMessages(param: IDelteByTime, callback: ICallback): void;
|
|
743
|
+
getConversationListWithAllChannel(callback: ICallback<IV2Conversation[]>): void;
|
|
744
|
+
getConversationListWithAllChannelByPage(callback: ICallback<IV2Conversation[]>, index: number, limit: number): void;
|
|
745
|
+
/**
|
|
746
|
+
* 向本地插入一条消息,不发送到服务器
|
|
747
|
+
* @param conversationType 会话类型
|
|
748
|
+
* @param targetId 目标 ID
|
|
749
|
+
* @param content 消息体
|
|
750
|
+
* @param callback
|
|
751
|
+
*/
|
|
752
|
+
insertMessage(conversationType: ConversationType, targetId: string, content: IReceivedMessageV2, callback: ICallback<IReceivedMessageV2>, options?: IInsertOptions): void;
|
|
753
|
+
/**
|
|
754
|
+
* 从本地消息数据库中删除某一会话指定时间之前的消息数据
|
|
755
|
+
* @param conversationType 会话类型
|
|
756
|
+
* @param targetId 目标 ID
|
|
757
|
+
* @param timestamp 指定删除该时间戳之前的消息
|
|
758
|
+
* @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
|
|
759
|
+
* 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
|
|
760
|
+
*/
|
|
761
|
+
deleteLocalMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, callback: ICallback<boolean>): void;
|
|
762
|
+
/**
|
|
763
|
+
* 协议栈获取远端历史消息
|
|
764
|
+
* @param conversationType 会话类型
|
|
765
|
+
* @param targetId 会话 ID
|
|
766
|
+
* @param timestamp 获取时间戳, 0 为从当前时间拉取
|
|
767
|
+
* @param count 拉取条数,获取条数, 范围 1 - 20
|
|
768
|
+
*/
|
|
769
|
+
getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, callback: ICallback<Array<IReceivedMessageV2>, boolean>, options: {
|
|
770
|
+
order?: 0 | 1;
|
|
771
|
+
}): void;
|
|
772
|
+
/**
|
|
773
|
+
* 清空会话下历史消息
|
|
774
|
+
* @param conversationType 会话类型
|
|
775
|
+
* @param targetId 目标 ID
|
|
776
|
+
* @param callback
|
|
777
|
+
*/
|
|
778
|
+
clearMessages(conversationType: ConversationType, targetId: string, callback: ICallback<boolean>): void;
|
|
779
|
+
/**
|
|
780
|
+
* 按内容搜索会话
|
|
781
|
+
* @param keyword 关键字
|
|
782
|
+
* @param conversationTypes 会话类型数组
|
|
783
|
+
*/
|
|
784
|
+
searchConversationByContent(keyword: string, callback: ICallback<IV2Conversation[]>, conversationTypes?: ConversationType[], customMessageType?: string[]): void;
|
|
785
|
+
/**
|
|
786
|
+
* 按内容搜索会话内容的消息
|
|
787
|
+
* @param keyword 搜索内容
|
|
788
|
+
* @param conversationType 会话类型
|
|
789
|
+
* @param targetId 目标 ID
|
|
790
|
+
* @param timestamp 搜索时间, 搜索该时间之前的消息
|
|
791
|
+
* @param count 获取的数量
|
|
792
|
+
*/
|
|
793
|
+
searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, callback: ICallback<IReceivedMessageV2[], number>): void;
|
|
794
|
+
/**
|
|
795
|
+
* 获取会话下所有未读的 @ 消息
|
|
796
|
+
* @param conversationType 会话类型
|
|
797
|
+
* @param targetId 目标 ID
|
|
798
|
+
*/
|
|
799
|
+
getUnreadMentionedMessages(conversationType: ConversationType, targetId: string): IReceivedMessageV2[];
|
|
800
|
+
/**
|
|
801
|
+
* 清除时间戳前的未读数
|
|
802
|
+
* @param conversationType 会话类型
|
|
803
|
+
* @param targetId 目标 ID
|
|
804
|
+
* @param timestamp 目标 ID
|
|
805
|
+
* @param callback
|
|
806
|
+
*/
|
|
807
|
+
clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, callback: ICallback<boolean>): void;
|
|
808
|
+
/**
|
|
809
|
+
* 获取会话免打扰状态
|
|
810
|
+
* @param conversationType 会话类型
|
|
811
|
+
* @param targetId 目标 ID
|
|
812
|
+
* @param callback
|
|
813
|
+
*/
|
|
814
|
+
getConversationNotificationStatus(conversationType: ConversationType, targetId: string, callback: ICallback<NotificationStatus>): void;
|
|
815
|
+
}
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* @deprecated
|
|
819
|
+
*/
|
|
820
|
+
declare type IRemoveChatRoomEntryOption = IRemoveChatroomEntry;
|
|
821
|
+
interface IConversationOption {
|
|
822
|
+
type: ConversationType;
|
|
823
|
+
targetId: string;
|
|
824
|
+
channelId?: string;
|
|
825
|
+
}
|
|
826
|
+
declare type RTCRoomOption = {
|
|
827
|
+
id: string;
|
|
828
|
+
roomId: string;
|
|
829
|
+
mode: RTCMode;
|
|
830
|
+
broadcastType: number;
|
|
831
|
+
};
|
|
832
|
+
declare class IMClient {
|
|
833
|
+
private readonly _context;
|
|
834
|
+
private readonly _options;
|
|
835
|
+
private readonly _channelClient;
|
|
836
|
+
private readonly _defaultChannelClient;
|
|
837
|
+
private readonly _isCPPMode;
|
|
838
|
+
constructor(_context: APIContext, _options: IIMClientOptions);
|
|
839
|
+
/**
|
|
840
|
+
* 协议栈方法校验
|
|
841
|
+
*/
|
|
842
|
+
private assertCPPMode;
|
|
843
|
+
/**
|
|
844
|
+
* 装载插件,并返回相应的插件实例
|
|
845
|
+
* @param plugin
|
|
846
|
+
* @param options
|
|
847
|
+
*/
|
|
848
|
+
install<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
|
|
849
|
+
/**
|
|
850
|
+
* 获取 channel proxy 实例
|
|
851
|
+
* @param channelId 会话标识 ID
|
|
852
|
+
*/
|
|
853
|
+
getChannel(channelId: string): ChannelClient | null;
|
|
854
|
+
/**
|
|
855
|
+
* 批量删除 channel proxy 实例
|
|
856
|
+
* @param channelIds 会话标识 ID
|
|
857
|
+
*/
|
|
858
|
+
deleteChannels(channelIds: string[]): void;
|
|
859
|
+
/**
|
|
860
|
+
* 获取导航新 RTC Lib 使用
|
|
861
|
+
*/
|
|
862
|
+
getNavi(): INaviInfo | {};
|
|
863
|
+
/**
|
|
864
|
+
* 获取 SDK 信息 RTC Lib 使用
|
|
865
|
+
*/
|
|
866
|
+
getSDKInfo(): {
|
|
867
|
+
version: string;
|
|
868
|
+
};
|
|
869
|
+
/**
|
|
870
|
+
* 获取 App 信息,RTC Lib 使用
|
|
871
|
+
*/
|
|
872
|
+
getAppInfo(): {
|
|
873
|
+
appKey: string;
|
|
874
|
+
};
|
|
875
|
+
/**
|
|
876
|
+
* 获取当前用户 ID
|
|
877
|
+
*/
|
|
878
|
+
getCurrentUserId(): string;
|
|
879
|
+
/**
|
|
880
|
+
* 断开当前连接
|
|
881
|
+
* @description 相较于原 SDK 2.0 版本的 disconnect,此方法会返回一个 Promise 对象
|
|
882
|
+
* @returns Promise<void>
|
|
883
|
+
*/
|
|
884
|
+
disconnect(): Promise<void>;
|
|
885
|
+
/**
|
|
886
|
+
* 该方法等价于 disconnect
|
|
887
|
+
*/
|
|
888
|
+
logout(): Promise<void>;
|
|
889
|
+
/**
|
|
890
|
+
* 清除内存或本地缓存数据
|
|
891
|
+
*/
|
|
892
|
+
clearCache(): void;
|
|
893
|
+
/**
|
|
894
|
+
* 获取会话列表,相对于 2.0 的接口,该接口结果中不再展开会话中最后一条消息的数据
|
|
895
|
+
* @param callback 结果回调
|
|
896
|
+
* @param conversationTypes 会话类型,为 null 时,返回全部会话
|
|
897
|
+
* @param count 获取数量,默认 300
|
|
898
|
+
*/
|
|
899
|
+
getConversationList(callback: ICallback<IV2Conversation[]>, conversationTypes: Number[] | null, count?: number): void;
|
|
900
|
+
getConversationListWithAllChannel(callback: ICallback<IV2Conversation[]>): void;
|
|
901
|
+
/**
|
|
902
|
+
* @param index
|
|
903
|
+
* @param limit
|
|
904
|
+
* @returns
|
|
905
|
+
*/
|
|
906
|
+
getConversationListWithAllChannelByPage(callback: ICallback<IV2Conversation[]>, index: number, limit?: number): void;
|
|
907
|
+
/**
|
|
908
|
+
* 获取指定会话
|
|
909
|
+
* @description 相较于 2.0 中从本地缓存获取会话,当前方法从服务器拉取
|
|
910
|
+
* @param conversationType
|
|
911
|
+
* @param targetId
|
|
912
|
+
* @param callback
|
|
913
|
+
*/
|
|
914
|
+
getConversation(conversationType: ConversationType, targetId: string, callback: ICallback<IV2Conversation | null>): void;
|
|
915
|
+
/**
|
|
916
|
+
* 删除指定会话
|
|
917
|
+
* @param conversationType 会话类型
|
|
918
|
+
* @param targetId 会话 target_id
|
|
919
|
+
* @param callback 删除回调
|
|
920
|
+
*/
|
|
921
|
+
removeConversation(conversationType: ConversationType, targetId: string, callback: ICallback<void>): void;
|
|
922
|
+
/**
|
|
923
|
+
* 保存草稿
|
|
924
|
+
* @description 草稿存储在内存中,如刷新或者关闭页面会导致草稿丢失。
|
|
925
|
+
* 草稿功能并未在 v3 SDK 版本红实现,由 Bridge 模块实现
|
|
926
|
+
* @param conversationType
|
|
927
|
+
* @param targetId
|
|
928
|
+
* @param draftText
|
|
929
|
+
*/
|
|
930
|
+
saveTextMessageDraft(conversationType: ConversationType, targetId: string, draftText: string): boolean;
|
|
931
|
+
/**
|
|
932
|
+
* 获取草稿信息
|
|
933
|
+
* @description 未登录或无草稿数据时将返回 undefined
|
|
934
|
+
* @param conversationType
|
|
935
|
+
* @param targetId
|
|
936
|
+
*/
|
|
937
|
+
getTextMessageDraft(conversationType: ConversationType, targetId: string): string | undefined;
|
|
938
|
+
/**
|
|
939
|
+
* 删除草稿
|
|
940
|
+
* @param conversationType
|
|
941
|
+
* @param targetId
|
|
942
|
+
*/
|
|
943
|
+
clearTextMessageDraft(conversationType: ConversationType, targetId: string): boolean;
|
|
944
|
+
/**
|
|
945
|
+
* 获取所有会话的消息未读数
|
|
946
|
+
* @description
|
|
947
|
+
* 1. 清除浏览器缓存会导致会话未读数不准确
|
|
948
|
+
* 2. 会话消息未读数存储在 WebStorage 中, 若浏览器不支持或禁用 WebStorage,未读消息数将不会保存,浏览器页面刷新未读消息数将不会存在
|
|
949
|
+
* @param callback
|
|
950
|
+
* @param conversationTypes 要获取未读数的会话类型,若为空,则默认获取单聊、群聊及系统消息未读数(web 暂未实现)
|
|
951
|
+
* @param includeMuted 是否包含免打扰会话(web 暂未实现)
|
|
952
|
+
*/
|
|
953
|
+
getTotalUnreadCount(callback: ICallback<number>, conversationTypes?: ConversationType[], includeMuted?: boolean): void;
|
|
954
|
+
/**
|
|
955
|
+
* 获取指定会话的消息未读数
|
|
956
|
+
* @todo
|
|
957
|
+
* @param conversationType
|
|
958
|
+
* @param targetId
|
|
959
|
+
* @param callback
|
|
960
|
+
*/
|
|
961
|
+
getUnreadCount(conversationType: ConversationType, targetId: string, callback: ICallback<number>): void;
|
|
962
|
+
/**
|
|
963
|
+
* 该方法已弃用~~按会话类型获取消息未读数~~
|
|
964
|
+
* @deprecated
|
|
965
|
+
* @param conversationType
|
|
966
|
+
* @param callback
|
|
967
|
+
*/
|
|
968
|
+
getConversationUnreadCount(conversationType: ConversationType, callback: ICallback<number>): void;
|
|
969
|
+
/**
|
|
970
|
+
* 删除指定类型会话,该方法已弃用
|
|
971
|
+
* @description
|
|
972
|
+
* 仅可在协议栈连接下调用
|
|
973
|
+
* @param callback
|
|
974
|
+
* @param {ConversationType[]} ? types
|
|
975
|
+
*/
|
|
976
|
+
clearConversations(callback: ICallback<boolean>, conversationTypes: ConversationType[]): void;
|
|
977
|
+
/**
|
|
978
|
+
* 清除指定会话未读数
|
|
979
|
+
* @param conversationType
|
|
980
|
+
* @param targetId
|
|
981
|
+
* @param callback
|
|
982
|
+
*/
|
|
983
|
+
clearUnreadCount(conversationType: ConversationType, targetId: string, callback: ICallback<boolean>): void;
|
|
984
|
+
/**
|
|
985
|
+
* 清除全部会话未读数
|
|
986
|
+
* @param conversationType
|
|
987
|
+
* @param targetId
|
|
988
|
+
* @param callback
|
|
989
|
+
*/
|
|
990
|
+
clearAllUnreadCount(callback: ICallback<boolean>): void;
|
|
991
|
+
/**
|
|
992
|
+
* 设置会话状态:是否置顶、是否免打扰
|
|
993
|
+
* @param conversationType
|
|
994
|
+
* @param targetId
|
|
995
|
+
* @param status
|
|
996
|
+
* @param callback
|
|
997
|
+
*/
|
|
998
|
+
setConversationStatus(conversationType: ConversationType, targetId: string, status: IConversationStatus, callback: ICallback): void;
|
|
999
|
+
/**
|
|
1000
|
+
* 发送消息
|
|
1001
|
+
* @param conversationType 会话类型
|
|
1002
|
+
* @param targetId 接收方 id,当会话类型为单聊时,该值为单聊对象的 userId,为群聊时,该值应为群组 groupId
|
|
1003
|
+
* @param msg 消息体
|
|
1004
|
+
* @param callback 回调函数
|
|
1005
|
+
* @param isMentioned `是否为 @ 消息`
|
|
1006
|
+
* @param pushContent 移动端在接收到消息推送时用于显示的推送信息
|
|
1007
|
+
* @param pushData Push 通知时附加信息
|
|
1008
|
+
* @param methodType 该参数已废弃 ~~1 : 多客服(客服后台使用); 2 : 消息撤回~~
|
|
1009
|
+
* @param options 其他设置项
|
|
1010
|
+
*/
|
|
1011
|
+
sendMessage(conversationType: ConversationType, targetId: string, msg: BaseMessage, callback: ISendCallback<IReceivedMessageV2>, isMentioned?: boolean, pushContent?: string, pushData?: string, methodType?: number, options?: ISendOptionsV2): void;
|
|
1012
|
+
/**
|
|
1013
|
+
* 消息撤回
|
|
1014
|
+
* @param message
|
|
1015
|
+
*/
|
|
1016
|
+
sendRecallMessage(message: IReceivedMessageV2, callback: ICallback<IReceivedMessageV2>, options?: ISendOptionsV2): void;
|
|
1017
|
+
/**
|
|
1018
|
+
* 发送正在输入状态消息
|
|
1019
|
+
* @description
|
|
1020
|
+
* 正在输入状态消息,不存储、不计数、不推送
|
|
1021
|
+
* @param conversationType 会话类型
|
|
1022
|
+
* @param targetId 会话 id
|
|
1023
|
+
* @param typingContentType 正在输入的消息 ObjectName,如 RC:TxtMsg
|
|
1024
|
+
* @param callback
|
|
1025
|
+
*/
|
|
1026
|
+
sendTypingStatusMessage(conversationType: ConversationType, targetId: string, typingContentType: string, callback: ICallback<IReceivedMessageV2>): void;
|
|
1027
|
+
/**
|
|
1028
|
+
* 发送已读回执
|
|
1029
|
+
* @description
|
|
1030
|
+
* @param conversationType
|
|
1031
|
+
* @param targetId
|
|
1032
|
+
* @param callback
|
|
1033
|
+
*/
|
|
1034
|
+
sendReceiptResponse(conversationType: ConversationType, targetId: string, callback: ICallback<IReceivedMessageV2 | null>): void;
|
|
1035
|
+
/**
|
|
1036
|
+
* 发送群已读回执
|
|
1037
|
+
* @param messageUIds
|
|
1038
|
+
* @param targetId
|
|
1039
|
+
* @param callback
|
|
1040
|
+
*/
|
|
1041
|
+
sendReadReceiptMessage(messageUIds: string[], targetId: string, callback: ICallback): void;
|
|
1042
|
+
/**
|
|
1043
|
+
* 获取群已读列表
|
|
1044
|
+
* @param messageUIds
|
|
1045
|
+
* @param targetId
|
|
1046
|
+
* @param callback
|
|
1047
|
+
*/
|
|
1048
|
+
getMessageReader(messageUId: string, targetId: string, callback: ICallback<IMessageReaderResponse>): void;
|
|
1049
|
+
/**
|
|
1050
|
+
* 更新消息扩展
|
|
1051
|
+
* @param expansionDic 要更新的消息扩展信息键值对
|
|
1052
|
+
* @param message 要更新的原始消息体
|
|
1053
|
+
*/
|
|
1054
|
+
updateMessageExpansion(expansionDic: {
|
|
1055
|
+
[key: string]: string;
|
|
1056
|
+
}, message: IReceivedMessageV2, callback: ICallback): void;
|
|
1057
|
+
/**
|
|
1058
|
+
* 删除消息扩展属性
|
|
1059
|
+
* @param keys 消息扩展信息中待删除的 key 的列表
|
|
1060
|
+
* @param message 要删除消息扩展的原始消息体
|
|
1061
|
+
*/
|
|
1062
|
+
removeMessageExpansionForKey(keys: string[], message: IReceivedMessageV2, callback: ICallback): void;
|
|
1063
|
+
/**
|
|
1064
|
+
* 从服务端拉取指定会话的历史消息
|
|
1065
|
+
* @param conversationType 会话类型
|
|
1066
|
+
* @param targetId 会话 ID
|
|
1067
|
+
* @param timestamp 获取时间戳, 0 为从当前时间拉取
|
|
1068
|
+
* @param count 拉取条数,获取条数, 范围 1 - 20
|
|
1069
|
+
* @param callback
|
|
1070
|
+
* @param objectName
|
|
1071
|
+
* @param order 获取顺序,默认为 0。0 为升序,获取消息发送时间比 timestamp 更早的消息;1 为降序。
|
|
1072
|
+
*/
|
|
1073
|
+
getHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, callback: ICallback<Array<IReceivedMessageV2>, boolean>, objectName?: string, order?: 0 | 1): void;
|
|
1074
|
+
/**
|
|
1075
|
+
* 加入聊天室
|
|
1076
|
+
* @param chatRoomId 聊天室 id
|
|
1077
|
+
* @param count 拉取聊天室消息数量
|
|
1078
|
+
* @param callback
|
|
1079
|
+
*/
|
|
1080
|
+
joinChatRoom(chatRoomId: string, count: number, callback: ICallback): void;
|
|
1081
|
+
/**
|
|
1082
|
+
* 退出聊天室
|
|
1083
|
+
* @param chatRoomId 聊天室 id
|
|
1084
|
+
* @param callback
|
|
1085
|
+
*/
|
|
1086
|
+
quitChatRoom(chatRoomId: string, callback: ICallback): void;
|
|
1087
|
+
/**
|
|
1088
|
+
* 获取聊天室信息
|
|
1089
|
+
* @param chatRoomId 聊天室 id
|
|
1090
|
+
* @param count 获取人数, 范围 0 - 20
|
|
1091
|
+
* 1. 传入 0 获取到的聊天室信息将或仅包含成员总数,不包含具体的成员列表
|
|
1092
|
+
* 2. 传入其他大于 0 的值返回聊天室信息,结果仅包含包含不多于 20 人的成员信息和当前成员总数。最大值为 20
|
|
1093
|
+
* @param order 排序方式,1 为正序,2 为倒序
|
|
1094
|
+
* @param callback
|
|
1095
|
+
*/
|
|
1096
|
+
getChatRoomInfo(chatRoomId: string, count: number, order: 1 | 2, callback: ICallback<IV2ChatRoomInfo>): void;
|
|
1097
|
+
/**
|
|
1098
|
+
* 在指定聊天室中设置自定义属性
|
|
1099
|
+
* @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
|
|
1100
|
+
* @param chatRoomId 聊天室房间 id
|
|
1101
|
+
* @param chatroomEntry 属性信息
|
|
1102
|
+
* @param callback
|
|
1103
|
+
*/
|
|
1104
|
+
setChatroomEntry(chatRoomId: string, chatroomEntry: IChatroomEntry, callback: ICallback): void;
|
|
1105
|
+
/**
|
|
1106
|
+
* 批量设置聊天室自定义属性
|
|
1107
|
+
* @param options ISetChatroomEntryOption数组
|
|
1108
|
+
*/
|
|
1109
|
+
setChatRoomEntries(chatRoomId: string, options: IChatroomEntries, callback: ICallback): void;
|
|
1110
|
+
/**
|
|
1111
|
+
* 在指定聊天室中强制增加 / 修改任意聊天室属性
|
|
1112
|
+
* @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
|
|
1113
|
+
* @param chatRoomId 聊天室房间 id
|
|
1114
|
+
* @param chatroomEntry 属性信息
|
|
1115
|
+
* @param callback
|
|
1116
|
+
*/
|
|
1117
|
+
forceSetChatroomEntry(chatRoomId: string, chatroomEntry: IChatroomEntry, callback: ICallback): void;
|
|
1118
|
+
/**
|
|
1119
|
+
* 删除聊天室属性
|
|
1120
|
+
* @description 该方法仅限于删除自己设置的聊天室属性
|
|
1121
|
+
* @param chatRoomId 聊天室房间 id
|
|
1122
|
+
* @param chatroomEntry 要移除的属性信息
|
|
1123
|
+
* @param callback
|
|
1124
|
+
*/
|
|
1125
|
+
removeChatroomEntry(chatRoomId: string, chatroomEntry: IRemoveChatroomEntry | IRemoveChatRoomEntryOption, callback: ICallback): void;
|
|
1126
|
+
/**
|
|
1127
|
+
* 批量删除聊天室属性
|
|
1128
|
+
* @description 仅限于删除自己设置的聊天室属性
|
|
1129
|
+
* @param options entries属性名称集合, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
|
|
1130
|
+
*/
|
|
1131
|
+
removeChatRoomEntries(chatRoomId: string, options: {
|
|
1132
|
+
entries: string[];
|
|
1133
|
+
}, callback: ICallback): void;
|
|
1134
|
+
/**
|
|
1135
|
+
* 强制删除任意聊天室属性
|
|
1136
|
+
* @description 该方法仅限于删除自己设置的聊天室属性
|
|
1137
|
+
* @param chatRoomId 聊天室房间 id
|
|
1138
|
+
* @param chatroomEntry 要移除的属性信息
|
|
1139
|
+
* @param callback
|
|
1140
|
+
*/
|
|
1141
|
+
forceRemoveChatroomEntry(chatRoomId: string, chatroomEntry: IRemoveChatroomEntry | IRemoveChatRoomEntryOption, callback: ICallback): void;
|
|
1142
|
+
/**
|
|
1143
|
+
* 获取聊天室中的指定属性
|
|
1144
|
+
* @param chatRoomId 聊天室房间 id
|
|
1145
|
+
* @param key 属性键名
|
|
1146
|
+
* @param callback
|
|
1147
|
+
*/
|
|
1148
|
+
getChatroomEntry(chatRoomId: string, key: string, callback: ICallback<string>): void;
|
|
1149
|
+
/**
|
|
1150
|
+
* 获取聊天室内的所有属性
|
|
1151
|
+
* @param chatRoomId 聊天室房间 id
|
|
1152
|
+
* @param callback
|
|
1153
|
+
*/
|
|
1154
|
+
getAllChatroomEntries(chatRoomId: string, callback: ICallback<{
|
|
1155
|
+
[key: string]: string;
|
|
1156
|
+
}>): void;
|
|
1157
|
+
/**
|
|
1158
|
+
* 拉取聊天室内的历史消息
|
|
1159
|
+
* @param chatRoomId
|
|
1160
|
+
* @param count 拉取消息条数, 有效值范围 1 - 20
|
|
1161
|
+
* @param order 获取顺序,默认值为 0。
|
|
1162
|
+
* * 0:降序,用于获取早于指定时间戳发送的消息
|
|
1163
|
+
* * 1:升序,用于获取晚于指定时间戳发送的消息
|
|
1164
|
+
* @param callback
|
|
1165
|
+
* @param timestamp v3.0 版本中的新增参数,用于指定拉取消息用到的时间戳。默认值为0,表示按当前时间拉取
|
|
1166
|
+
*/
|
|
1167
|
+
getChatRoomHistoryMessages(chatRoomId: string, count: number, order: 0 | 1, callback: ICallback<IReceivedMessageV2[], boolean>, timestamp?: number): void;
|
|
1168
|
+
/**
|
|
1169
|
+
* @deprecated
|
|
1170
|
+
*/
|
|
1171
|
+
setDeviceInfo(option: {
|
|
1172
|
+
id: string;
|
|
1173
|
+
}): void;
|
|
1174
|
+
/**
|
|
1175
|
+
* 获取当前 IM 连接状态
|
|
1176
|
+
*/
|
|
1177
|
+
getCurrentConnectionStatus(): ConnectionStatus;
|
|
1178
|
+
/**
|
|
1179
|
+
* 通过 messageUId 删除消息
|
|
1180
|
+
* @param conversationType 会话类型
|
|
1181
|
+
* @param targetId 会话 id
|
|
1182
|
+
* @param messages 要删除的消息 []
|
|
1183
|
+
* @param callback
|
|
1184
|
+
*/
|
|
1185
|
+
deleteRemoteMessages(conversationType: ConversationType, targetId: string, messages: IDeleteMessge[], callback: ICallback): void;
|
|
1186
|
+
/**
|
|
1187
|
+
* 通过时间戳删除消息
|
|
1188
|
+
* @param conversationType 会话类型
|
|
1189
|
+
* @param targetId 会话 id
|
|
1190
|
+
* @param timestamp 清除时间点, 该时间之前的消息将被清除
|
|
1191
|
+
* @param callback
|
|
1192
|
+
*/
|
|
1193
|
+
/**
|
|
1194
|
+
* 通过时间戳删除消息
|
|
1195
|
+
* @param param
|
|
1196
|
+
* @param callback
|
|
1197
|
+
*/
|
|
1198
|
+
clearRemoteHistoryMessages(param: IDelteByTime, callback: ICallback): void;
|
|
1199
|
+
/**
|
|
1200
|
+
* 获取存储服务鉴权信息
|
|
1201
|
+
* @param fileType 文件类型
|
|
1202
|
+
* @param callback
|
|
1203
|
+
* @param fileName 文件名称
|
|
1204
|
+
* @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
|
|
1205
|
+
* @param queryString STC 分段上传时的查询字符串
|
|
1206
|
+
* @description
|
|
1207
|
+
* `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
|
|
1208
|
+
* 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`,filename为空
|
|
1209
|
+
* 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`,filename为第一个步骤生成的filename
|
|
1210
|
+
* 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`,filename为第一个步骤生成的filename
|
|
1211
|
+
* @returns
|
|
1212
|
+
*/
|
|
1213
|
+
getFileToken(fileType: FileType, callback: ICallback<IUploadAuth & {
|
|
1214
|
+
bos: string;
|
|
1215
|
+
qiniu: string;
|
|
1216
|
+
}>, fileName?: string, httpMethod?: 'PUT' | 'POST', queryString?: string): void;
|
|
1217
|
+
/**
|
|
1218
|
+
* 获取文件地址
|
|
1219
|
+
* @param fileType 上传类型
|
|
1220
|
+
* @param filename 上传后的文件名
|
|
1221
|
+
* @param saveName 下载存储文件名
|
|
1222
|
+
* @param callback 结果回调函数
|
|
1223
|
+
* @param serverType 存储服务标识
|
|
1224
|
+
* @param uploadRes 上传插件返回的数据
|
|
1225
|
+
*/
|
|
1226
|
+
getFileUrl(fileType: FileType, fileName: string, saveName: string, callback: ICallback<IGetFileUrl>, uploadRes?: {
|
|
1227
|
+
isBosRes: boolean;
|
|
1228
|
+
downloadUrl: string;
|
|
1229
|
+
}, serverType?: UploadMethod): void;
|
|
1230
|
+
/**
|
|
1231
|
+
* 创建标签
|
|
1232
|
+
* @param tag 标签信息
|
|
1233
|
+
*/
|
|
1234
|
+
createTag(tag: ITagParam, callback: ICallback): void;
|
|
1235
|
+
/**
|
|
1236
|
+
* 删除标签
|
|
1237
|
+
* @param tagId 标签 ID
|
|
1238
|
+
*/
|
|
1239
|
+
removeTag(tagId: string, callback: ICallback): void;
|
|
1240
|
+
/**
|
|
1241
|
+
* 编辑标签
|
|
1242
|
+
* @param tag 标签信息
|
|
1243
|
+
*/
|
|
1244
|
+
updateTag(tag: ITagParam, callback: ICallback): void;
|
|
1245
|
+
/**
|
|
1246
|
+
* 获取标签列表
|
|
1247
|
+
*/
|
|
1248
|
+
getTagList(callback: ICallback<ITagInfo[]>): void;
|
|
1249
|
+
/**
|
|
1250
|
+
* 获取会话下的标签
|
|
1251
|
+
* @param conversation 会话信息
|
|
1252
|
+
*/
|
|
1253
|
+
getTagsForConversation(conversation: IConversationOption, callback: ICallback<IConversationTag[]>): void;
|
|
1254
|
+
/**
|
|
1255
|
+
* 添加会话到指定标签
|
|
1256
|
+
* @param tagId 标签 ID
|
|
1257
|
+
* @param conversations 要添加的会话列表
|
|
1258
|
+
*/
|
|
1259
|
+
addTagForConversations(tagId: string, conversations: IConversationOption[], callback: ICallback): void;
|
|
1260
|
+
/**
|
|
1261
|
+
* 删除指定标签中会话
|
|
1262
|
+
* @param tagId 标签 ID
|
|
1263
|
+
* @param conversations 要删除的会话列表
|
|
1264
|
+
*/
|
|
1265
|
+
removeTagForConversations(tagId: string, conversations: IConversationOption[], callback: ICallback): void;
|
|
1266
|
+
/**
|
|
1267
|
+
* 删除指定会话中标签
|
|
1268
|
+
* @param conversation 会话
|
|
1269
|
+
* @param tagIds 要删除的标签列表
|
|
1270
|
+
*/
|
|
1271
|
+
removeTagsForConversation(conversation: IConversationOption, tagIds: string[], callback: ICallback): void;
|
|
1272
|
+
/**
|
|
1273
|
+
* 分页获取标签下会话列表
|
|
1274
|
+
* @param tagId 标签id
|
|
1275
|
+
* @param count 获取数量
|
|
1276
|
+
* @param timestamp 会话时间戳
|
|
1277
|
+
*/
|
|
1278
|
+
getConversationListByTag(tagId: string, count: number, startTime: number, callback: ICallback<IV2ConversationContainTag[]>): void;
|
|
1279
|
+
/**
|
|
1280
|
+
* 根据标签获取未读消息数
|
|
1281
|
+
* @param tagId 标签id
|
|
1282
|
+
* @param containMuted 是否包含免打扰
|
|
1283
|
+
*/
|
|
1284
|
+
getUnreadCountByTag(tagId: string, containMuted: boolean, callback: ICallback<number>): void;
|
|
1285
|
+
/**
|
|
1286
|
+
* 设置标签中会话置顶
|
|
1287
|
+
* @param tagId 标签id
|
|
1288
|
+
* @param conversation 会话
|
|
1289
|
+
* @param status 状态
|
|
1290
|
+
*/
|
|
1291
|
+
setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
|
|
1292
|
+
isTop: boolean;
|
|
1293
|
+
}, callback: ICallback): void;
|
|
1294
|
+
/**
|
|
1295
|
+
* 调用非标准接口 - 所谓非标准接口,是为某些特定需求或产品临时添加的,暂未采纳为标准接口的方法。
|
|
1296
|
+
* @param method 接口定义名称
|
|
1297
|
+
* @param callback 回调函数
|
|
1298
|
+
* @param args 参数列表
|
|
1299
|
+
*/
|
|
1300
|
+
callExtra(method: string | keyof IExtraMethod, callback: ICallback<unknown, unknown>, ...args: any[]): void;
|
|
1301
|
+
/**
|
|
1302
|
+
* 是否有远端未读消息 ( C++ )
|
|
1303
|
+
* @description
|
|
1304
|
+
*/
|
|
1305
|
+
hasRemoteUnreadMessages(token: string, callback: ICallback<Boolean>): void;
|
|
1306
|
+
/**
|
|
1307
|
+
* 设置用户在线状态监听器
|
|
1308
|
+
*/
|
|
1309
|
+
setUserStatusListener(config: {
|
|
1310
|
+
userIds: string[];
|
|
1311
|
+
}, listener: Function): void;
|
|
1312
|
+
/**
|
|
1313
|
+
* 设置用户在线状态
|
|
1314
|
+
* @param status 在线 10、离开 11、忙碌 12
|
|
1315
|
+
*/
|
|
1316
|
+
setUserStatus(status: number, callback: ICallback<Boolean>): void;
|
|
1317
|
+
/**
|
|
1318
|
+
* 获取用户在线状态
|
|
1319
|
+
* @param userId 用户 ID
|
|
1320
|
+
*/
|
|
1321
|
+
getUserStatus(userId: string, callback: ICallback<{
|
|
1322
|
+
status?: number;
|
|
1323
|
+
}>): void;
|
|
1324
|
+
/**
|
|
1325
|
+
* 加入黑名单
|
|
1326
|
+
* @param userId 用户 ID
|
|
1327
|
+
*/
|
|
1328
|
+
addToBlacklist(userId: string, callback: ICallback): void;
|
|
1329
|
+
/**
|
|
1330
|
+
* 将指定用户移除黑名单
|
|
1331
|
+
* @param userId 用户 ID
|
|
1332
|
+
*/
|
|
1333
|
+
removeFromBlacklist(userId: string, callback: ICallback): void;
|
|
1334
|
+
/**
|
|
1335
|
+
* 获取黑名单列表
|
|
1336
|
+
*/
|
|
1337
|
+
getBlacklist(callback: ICallback<string[]>): void;
|
|
1338
|
+
/**
|
|
1339
|
+
* 获取指定人员在黑名单中的状态
|
|
1340
|
+
* @param userId 用户 ID
|
|
1341
|
+
*/
|
|
1342
|
+
getBlacklistStatus(userId: string, callback: ICallback<string>): void;
|
|
1343
|
+
/**
|
|
1344
|
+
* 向本地插入一条消息,不发送到服务器
|
|
1345
|
+
* @param conversationType 会话类型
|
|
1346
|
+
* @param targetId 目标 ID
|
|
1347
|
+
* @param content 消息体
|
|
1348
|
+
* @param callback
|
|
1349
|
+
*/
|
|
1350
|
+
insertMessage(conversationType: ConversationType, targetId: string, content: IReceivedMessageV2, callback: ICallback<IReceivedMessageV2>, options?: IInsertOptions): void;
|
|
1351
|
+
/**
|
|
1352
|
+
* 获取远端历史消息
|
|
1353
|
+
* @param conversationType 会话类型
|
|
1354
|
+
* @param targetId 会话 ID
|
|
1355
|
+
* @param timestamp 获取时间戳, 0 为从当前时间拉取
|
|
1356
|
+
* @param count 拉取条数,获取条数, 范围 1 - 20
|
|
1357
|
+
* @param options.order 获取顺序, 默认为 0
|
|
1358
|
+
*/
|
|
1359
|
+
getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, callback: ICallback<Array<IReceivedMessageV2>, boolean>, options?: {
|
|
1360
|
+
order?: 0 | 1;
|
|
1361
|
+
}): void;
|
|
1362
|
+
/**
|
|
1363
|
+
* 删除本地消息
|
|
1364
|
+
* @param _ 会话类型,参数无效
|
|
1365
|
+
* @param __ 目标 ID,参数无效
|
|
1366
|
+
* @param messageIds 消息 ID 数组
|
|
1367
|
+
* @param callback
|
|
1368
|
+
*/
|
|
1369
|
+
deleteLocalMessages(_: ConversationType, __: string, messageIds: number[], callback: ICallback<boolean>): void;
|
|
1370
|
+
/**
|
|
1371
|
+
* 从本地消息数据库中删除某一会话指定时间之前的消息数据
|
|
1372
|
+
* @param conversationType 会话类型
|
|
1373
|
+
* @param targetId 目标 ID
|
|
1374
|
+
* @param timestamp 指定删除该时间戳之前的消息
|
|
1375
|
+
* @param cleanSpace 指定删除该时间戳之前的消息。是否清理数据条目所使用的磁盘空间。清理磁盘空间会阻塞进程且耗时较长,不推荐使用。
|
|
1376
|
+
* 数据在被抹除的情况下,未清理的磁盘空间会在后续存储操作中复用,且对数据查询无影响
|
|
1377
|
+
* @param callback
|
|
1378
|
+
*/
|
|
1379
|
+
deleteLocalMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, callback: ICallback<boolean>): void;
|
|
1380
|
+
/**
|
|
1381
|
+
* 清空会话下历史消息
|
|
1382
|
+
* @param conversationType 会话类型
|
|
1383
|
+
* @param targetId 目标 ID
|
|
1384
|
+
* @param callback
|
|
1385
|
+
*/
|
|
1386
|
+
clearMessages(conversationType: ConversationType, targetId: string, callback: ICallback<boolean>): void;
|
|
1387
|
+
/**
|
|
1388
|
+
* 获取消息
|
|
1389
|
+
* @param messageId 本地消息 ID 或 messageUId
|
|
1390
|
+
*/
|
|
1391
|
+
getMessage(messageId: number, callback: ICallback<IReceivedMessageV2>): void;
|
|
1392
|
+
/**
|
|
1393
|
+
* 设置消息发送状态
|
|
1394
|
+
*/
|
|
1395
|
+
setMessageSentStatus(messageId: number, sentStatus: number, callback: ICallback<boolean>): void;
|
|
1396
|
+
/**
|
|
1397
|
+
* 设置消息接收状态
|
|
1398
|
+
*/
|
|
1399
|
+
setMessageReceivedStatus(messageId: number, receivedStatus: number, callback: ICallback<boolean>): void;
|
|
1400
|
+
/**
|
|
1401
|
+
* 设置消息内容
|
|
1402
|
+
* @param messageId 本地消息 ID
|
|
1403
|
+
* @param content 消息内容
|
|
1404
|
+
* @param objectName 消息类型
|
|
1405
|
+
*/
|
|
1406
|
+
setMessageContent(messageId: number, content: any, objectName: string): void;
|
|
1407
|
+
/**
|
|
1408
|
+
* 设置消息搜索字段
|
|
1409
|
+
* @param messageId 本地消息 ID
|
|
1410
|
+
* @param content 消息内容
|
|
1411
|
+
* @param searchFiles 搜索字段
|
|
1412
|
+
*/
|
|
1413
|
+
setMessageSearchField(messageId: number, content: any, searchFiles: string): void;
|
|
1414
|
+
/**
|
|
1415
|
+
* 按内容搜索会话
|
|
1416
|
+
* @param keyword 关键字
|
|
1417
|
+
* @param conversationTypes 会话类型数组
|
|
1418
|
+
* @param customMessageTypes 自定义消息类型,若关键字属于自定义消息类型,需传入
|
|
1419
|
+
*/
|
|
1420
|
+
searchConversationByContent(keyword: string, callback: ICallback<IV2Conversation[]>, conversationTypes?: ConversationType[], customMessageTypes?: string[]): void;
|
|
1421
|
+
/**
|
|
1422
|
+
* 按内容搜索会话内的消息
|
|
1423
|
+
* @param keyword 搜索内容
|
|
1424
|
+
* @param conversationType 会话类型
|
|
1425
|
+
* @param targetId 目标 ID
|
|
1426
|
+
* @param timestamp 搜索时间, 搜索该时间之前的消息
|
|
1427
|
+
* @param count 获取的数量
|
|
1428
|
+
*/
|
|
1429
|
+
searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, callback: ICallback<IReceivedMessageV2[], number>): void;
|
|
1430
|
+
/**
|
|
1431
|
+
* 获取会话下所有未读的 @ 消息
|
|
1432
|
+
* @param conversationType 会话类型
|
|
1433
|
+
* @param targetId 目标 ID
|
|
1434
|
+
*/
|
|
1435
|
+
getUnreadMentionedMessages(conversationType: ConversationType, targetId: string): IReceivedMessageV2[] | null;
|
|
1436
|
+
/**
|
|
1437
|
+
* 清除时间戳前的未读数
|
|
1438
|
+
* @param conversationType 会话类型
|
|
1439
|
+
* @param targetId 目标 ID
|
|
1440
|
+
* @param timestamp 目标 ID
|
|
1441
|
+
* @param callback
|
|
1442
|
+
*/
|
|
1443
|
+
clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, callback: ICallback<boolean>): void;
|
|
1444
|
+
/**
|
|
1445
|
+
* 获取第一个未读消息
|
|
1446
|
+
* @param conversationType 会话类型
|
|
1447
|
+
* @param targetId 目标 ID
|
|
1448
|
+
* @param callback
|
|
1449
|
+
* @returns
|
|
1450
|
+
*/
|
|
1451
|
+
getFirstUnreadMessage(conversationType: ConversationType, targetId: string, callback: ICallback<IReceivedMessageV2 | null>): void;
|
|
1452
|
+
/**
|
|
1453
|
+
* 获取会话免打扰状态
|
|
1454
|
+
* @param conversationType 会话类型
|
|
1455
|
+
* @param targetId 目标 ID
|
|
1456
|
+
* @param callback
|
|
1457
|
+
*/
|
|
1458
|
+
getConversationNotificationStatus(conversationType: ConversationType, targetId: string, callback: ICallback<NotificationStatus>): void;
|
|
1459
|
+
/**
|
|
1460
|
+
* 获取服务器时间
|
|
1461
|
+
*/
|
|
1462
|
+
getServerTime(): number;
|
|
1463
|
+
getRTCUserInfoList(room: RTCRoomOption, callback: ICallback<{
|
|
1464
|
+
[userId: string]: {
|
|
1465
|
+
uris?: string;
|
|
1466
|
+
};
|
|
1467
|
+
}>): void;
|
|
1468
|
+
getRTCUserList(room: RTCRoomOption, callback: ICallback<IRTCUsers>): void;
|
|
1469
|
+
setRTCUserInfo(room: RTCRoomOption, info: {
|
|
1470
|
+
key: string;
|
|
1471
|
+
value: string;
|
|
1472
|
+
}, callback: ICallback<boolean>): void;
|
|
1473
|
+
removeRTCUserInfo(room: RTCRoomOption, info: {
|
|
1474
|
+
keys: string[];
|
|
1475
|
+
}, callback: ICallback<boolean>): void;
|
|
1476
|
+
getRTCRoomInfo(room: RTCRoomOption, callback: ICallback<IRTCRoomInfo>): void;
|
|
1477
|
+
setRTCRoomInfo(room: RTCRoomOption, info: any, callback: ICallback<boolean>): void;
|
|
1478
|
+
removeRTCRoomInfo(room: RTCRoomOption, info: any, callback: ICallback<boolean>): void;
|
|
1479
|
+
joinRTCRoom(room: RTCRoomOption, callback: ICallback<IJoinRTCRoomData>): void;
|
|
1480
|
+
quitRTCRoom(room: RTCRoomOption, callback: ICallback<boolean>): void;
|
|
1481
|
+
RTCPing(room: RTCRoomOption, callback: ICallback<boolean>): void;
|
|
1482
|
+
setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, callback: ICallback<boolean>, message?: {
|
|
1483
|
+
name: string;
|
|
1484
|
+
content: string;
|
|
1485
|
+
}): void;
|
|
1486
|
+
getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, callback: ICallback<KVString>): void;
|
|
1487
|
+
removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, callback: ICallback<boolean>, message?: {
|
|
1488
|
+
name: string;
|
|
1489
|
+
content: string;
|
|
1490
|
+
}): void;
|
|
1491
|
+
setRTCUserData(roomId: string, key: string, value: string, isInner: boolean, callback: ICallback<boolean>, message?: {
|
|
1492
|
+
name: string;
|
|
1493
|
+
content: string;
|
|
1494
|
+
}): void;
|
|
1495
|
+
setRTCUserTotalRes(roomId: string, message: {
|
|
1496
|
+
name: string;
|
|
1497
|
+
content: string;
|
|
1498
|
+
}, valueInfo: string, objectName: string, callback: ICallback<boolean>): void;
|
|
1499
|
+
getRTCUserData(roomId: string, keys: string[], isInner: boolean, callback: ICallback<KVString>): void;
|
|
1500
|
+
removeRTCUserData(roomId: string, keys: string[], isInner: boolean, callback: ICallback<boolean>, message?: {
|
|
1501
|
+
name: string;
|
|
1502
|
+
content: string;
|
|
1503
|
+
}): void;
|
|
1504
|
+
setRTCRoomData(roomId: string, key: string, value: string, isInner: boolean, callback: ICallback<boolean>, message?: {
|
|
1505
|
+
name: string;
|
|
1506
|
+
content: string;
|
|
1507
|
+
}): void;
|
|
1508
|
+
getRTCRoomData(roomId: string, keys: string[], isInner: boolean, callback: ICallback<KVString>): void;
|
|
1509
|
+
removeRTCRoomData(roomId: string, keys: string[], isInner: boolean, callback: ICallback<boolean>, message?: any): void;
|
|
1510
|
+
setRTCOutData(roomId: string, data: any, type: number, callback: ICallback<boolean>, message?: any): void;
|
|
1511
|
+
getRTCOutData(roomId: string, userIds: string[], callback: ICallback): void;
|
|
1512
|
+
getRTCToken(room: RTCRoomOption, callback: ICallback<IRtcTokenData>): void;
|
|
1513
|
+
setRTCState(room: RTCRoomOption, content: {
|
|
1514
|
+
report: string;
|
|
1515
|
+
}, callback: ICallback<boolean>): void;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
declare class MessageTag {
|
|
1519
|
+
/**
|
|
1520
|
+
* 是否计数
|
|
1521
|
+
*/
|
|
1522
|
+
isCounted: boolean;
|
|
1523
|
+
/**
|
|
1524
|
+
* 是否存储
|
|
1525
|
+
*/
|
|
1526
|
+
isPersited: boolean;
|
|
1527
|
+
constructor(
|
|
1528
|
+
/**
|
|
1529
|
+
* 是否计数
|
|
1530
|
+
*/
|
|
1531
|
+
isCounted: boolean,
|
|
1532
|
+
/**
|
|
1533
|
+
* 是否存储
|
|
1534
|
+
*/
|
|
1535
|
+
isPersited: boolean);
|
|
1536
|
+
}
|
|
1537
|
+
|
|
1538
|
+
declare type IRTCConnectionStatusListener = (status: ConnectionStatus) => void;
|
|
1539
|
+
declare type IRTCMsgListener = (msg: IReceivedMessageV2) => void;
|
|
1540
|
+
declare type ICallLibReceivedMsgListener = {
|
|
1541
|
+
onReceived?: (msg: IReceivedMessageV2) => void;
|
|
1542
|
+
};
|
|
1543
|
+
declare const _default$i: {
|
|
1544
|
+
/**
|
|
1545
|
+
* 初始化 IM SDK
|
|
1546
|
+
* @param appkey
|
|
1547
|
+
* @param _ 该参数已废弃,为保持向前兼容,保留占位参数
|
|
1548
|
+
* @param options
|
|
1549
|
+
*/
|
|
1550
|
+
init(appkey: string, _: void, options?: IInitOption): void;
|
|
1551
|
+
/**
|
|
1552
|
+
* 单例模式,用于获取 IMClient 实例
|
|
1553
|
+
*/
|
|
1554
|
+
getInstance(): IMClient;
|
|
1555
|
+
/**
|
|
1556
|
+
* 添加连接状态变更事件监听
|
|
1557
|
+
* @param listener
|
|
1558
|
+
*/
|
|
1559
|
+
setConnectionStatusListener(listener: IConnectionStatusListener): void;
|
|
1560
|
+
/**
|
|
1561
|
+
* 添加消息监听器
|
|
1562
|
+
* @param listener
|
|
1563
|
+
*/
|
|
1564
|
+
setOnReceiveMessageListener(listener: IReceiveMessageListener): void;
|
|
1565
|
+
/**
|
|
1566
|
+
* 会话状态监听器
|
|
1567
|
+
* @param listener
|
|
1568
|
+
*/
|
|
1569
|
+
setConversationStatusListener(listener: IConversationStatusListener): void;
|
|
1570
|
+
/**
|
|
1571
|
+
* 消息扩展监听
|
|
1572
|
+
*/
|
|
1573
|
+
setMessageExpansionListener(listener: IMessageExpansionListener): void;
|
|
1574
|
+
/**
|
|
1575
|
+
* tag监听
|
|
1576
|
+
*/
|
|
1577
|
+
setTagListener(listener: ITagListener): void;
|
|
1578
|
+
/**
|
|
1579
|
+
* 会话中tag状态监听
|
|
1580
|
+
*/
|
|
1581
|
+
setConversationTagListener(listener: ITagListener): void;
|
|
1582
|
+
/**
|
|
1583
|
+
* 用于拉取完毕监听
|
|
1584
|
+
*/
|
|
1585
|
+
setPullOffLineFinished(listener: IPullFinishedListener): void;
|
|
1586
|
+
/**
|
|
1587
|
+
* typing监听
|
|
1588
|
+
*/
|
|
1589
|
+
setTypingStatusListener(listenner: ITypingListener): void;
|
|
1590
|
+
/**
|
|
1591
|
+
* 敏感词监听
|
|
1592
|
+
*/
|
|
1593
|
+
setMessageBlockedListener(listenner: IMessageBlockedListener): void;
|
|
1594
|
+
/**
|
|
1595
|
+
* 聊天室信息监听
|
|
1596
|
+
*/
|
|
1597
|
+
setChatRoomStatusListener(listenner: IChatRoomListener): void;
|
|
1598
|
+
/**
|
|
1599
|
+
* 连接 IM 服务
|
|
1600
|
+
* @param token 用于连接鉴权
|
|
1601
|
+
* @param callback 连接状态回调
|
|
1602
|
+
*/
|
|
1603
|
+
connect(token: string, callback: IConnectCallback): Promise<void>;
|
|
1604
|
+
/**
|
|
1605
|
+
* 重连 im 服务
|
|
1606
|
+
* @description Web IM 3.0 开始 SDK 内部会进行自动重连,不需要主动调用此方法。此方法建议主动断开连接后,再次链接时调用。
|
|
1607
|
+
* @param callback 重连状态回调
|
|
1608
|
+
* @param options 该参数已废弃
|
|
1609
|
+
*/
|
|
1610
|
+
reconnect(callback: IConnectCallback, options?: IReconnectOptions | undefined): void;
|
|
1611
|
+
/**
|
|
1612
|
+
* 已注册的消息类型定义
|
|
1613
|
+
*/
|
|
1614
|
+
RegisterMessage: {
|
|
1615
|
+
[messageType: string]: ThisType<BaseMessage<any>>;
|
|
1616
|
+
};
|
|
1617
|
+
/**
|
|
1618
|
+
* 已注册的消息类型映射
|
|
1619
|
+
*/
|
|
1620
|
+
RegisterMessageTypeMapping: {
|
|
1621
|
+
[key: string]: string;
|
|
1622
|
+
};
|
|
1623
|
+
/**
|
|
1624
|
+
* 根据 messageType 获取对应的消息 objectName 值
|
|
1625
|
+
* 若无记录,则返回原字符串
|
|
1626
|
+
* @param messageType
|
|
1627
|
+
* @todo 优化算法
|
|
1628
|
+
*/
|
|
1629
|
+
getMessageObjectName(messageType: string): string;
|
|
1630
|
+
/**
|
|
1631
|
+
* 注册自定义消息
|
|
1632
|
+
* @param messageType v2 中定义的消息类型,如:TextMessage
|
|
1633
|
+
* @param objectName 与移动端对齐的消息结构类型,如:RC:TxtMsg
|
|
1634
|
+
* @param mesasgeTag 是否存储或计数标记
|
|
1635
|
+
* @param searchProps 消息属性名称列表
|
|
1636
|
+
*/
|
|
1637
|
+
registerMessageType(messageType: string, objectName: string, mesasgeTag: MessageTag, searchProps: string[]): void;
|
|
1638
|
+
/**
|
|
1639
|
+
* 创建 Logger 实例
|
|
1640
|
+
* @param tag 标签,以 'RC' 开头的为 SDK 内部使用
|
|
1641
|
+
* @returns Logger
|
|
1642
|
+
*/
|
|
1643
|
+
createLogger(tag: string, type: LogType): Logger | null;
|
|
1644
|
+
/**
|
|
1645
|
+
* RTC Lib 内部使用消息监听器
|
|
1646
|
+
*/
|
|
1647
|
+
messageWatch(watcher: IRTCMsgListener): void;
|
|
1648
|
+
/**
|
|
1649
|
+
* RTC Lib 内部使用状态监听器
|
|
1650
|
+
*/
|
|
1651
|
+
statusWatch(watcher: IRTCConnectionStatusListener): void;
|
|
1652
|
+
/**
|
|
1653
|
+
* 兼容 RTC Lib
|
|
1654
|
+
*/
|
|
1655
|
+
MessageType: {
|
|
1656
|
+
TextMessage: string;
|
|
1657
|
+
ImageMessage: string;
|
|
1658
|
+
ReferenceMessage: string;
|
|
1659
|
+
DiscussionNotificationMessage: string;
|
|
1660
|
+
VoiceMessage: string;
|
|
1661
|
+
RichContentMessage: string;
|
|
1662
|
+
HandshakeMessage: string;
|
|
1663
|
+
UnknownMessage: string;
|
|
1664
|
+
LocationMessage: string;
|
|
1665
|
+
InformationNotificationMessage: string;
|
|
1666
|
+
ContactNotificationMessage: string;
|
|
1667
|
+
ProfileNotificationMessage: string;
|
|
1668
|
+
CommandNotificationMessage: string;
|
|
1669
|
+
CommandMessage: string;
|
|
1670
|
+
TypingStatusMessage: string;
|
|
1671
|
+
ChangeModeResponseMessage: string;
|
|
1672
|
+
ChangeModeMessage: string;
|
|
1673
|
+
EvaluateMessage: string;
|
|
1674
|
+
HandShakeMessage: string;
|
|
1675
|
+
HandShakeResponseMessage: string;
|
|
1676
|
+
SuspendMessage: string;
|
|
1677
|
+
TerminateMessage: string;
|
|
1678
|
+
CustomerContact: string;
|
|
1679
|
+
CustomerStatusUpdateMessage: string;
|
|
1680
|
+
SyncReadStatusMessage: string;
|
|
1681
|
+
ReadReceiptRequestMessage: string;
|
|
1682
|
+
ReadReceiptResponseMessage: string;
|
|
1683
|
+
FileMessage: string;
|
|
1684
|
+
HQVoiceMessage: string;
|
|
1685
|
+
GIFMessage: string;
|
|
1686
|
+
SightMessage: string;
|
|
1687
|
+
AcceptMessage: string;
|
|
1688
|
+
RingingMessage: string;
|
|
1689
|
+
SummaryMessage: string;
|
|
1690
|
+
HungupMessage: string;
|
|
1691
|
+
InviteMessage: string;
|
|
1692
|
+
MediaModifyMessage: string;
|
|
1693
|
+
MemberModifyMessage: string;
|
|
1694
|
+
JrmfRedPacketMessage: string;
|
|
1695
|
+
JrmfRedPacketOpenedMessage: string;
|
|
1696
|
+
GroupNotificationMessage: string;
|
|
1697
|
+
PublicServiceRichContentMessage: string;
|
|
1698
|
+
PublicServiceMultiRichContentMessage: string;
|
|
1699
|
+
PublicServiceCommandMessage: string;
|
|
1700
|
+
RecallCommandMessage: string;
|
|
1701
|
+
ReadReceiptMessage: string;
|
|
1702
|
+
RCCombineMessage: string;
|
|
1703
|
+
ChrmKVNotificationMessage: string;
|
|
1704
|
+
LogCommandMessage: string;
|
|
1705
|
+
};
|
|
1706
|
+
/**
|
|
1707
|
+
* 兼容 CallLib 消息监听
|
|
1708
|
+
*/
|
|
1709
|
+
_voipProvider: ICallLibReceivedMsgListener;
|
|
1710
|
+
};
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* 群组内的消息包含的 @ 数据
|
|
1714
|
+
*/
|
|
1715
|
+
declare class MentionedInfo {
|
|
1716
|
+
type?: MentionedType$1 | undefined;
|
|
1717
|
+
userIdList?: string[] | undefined;
|
|
1718
|
+
mentionedContent?: string | undefined;
|
|
1719
|
+
constructor(type?: MentionedType$1 | undefined, userIdList?: string[] | undefined, mentionedContent?: string | undefined);
|
|
1720
|
+
}
|
|
1721
|
+
|
|
1722
|
+
declare const _default$h: any;
|
|
1723
|
+
|
|
1724
|
+
declare const _default$g: any;
|
|
1725
|
+
|
|
1726
|
+
declare const _default$f: any;
|
|
1727
|
+
|
|
1728
|
+
declare const _default$e: any;
|
|
1729
|
+
|
|
1730
|
+
declare const _default$d: any;
|
|
1731
|
+
|
|
1732
|
+
declare const _default$c: any;
|
|
1733
|
+
|
|
1734
|
+
declare const _default$b: any;
|
|
1735
|
+
|
|
1736
|
+
declare const _default$a: any;
|
|
1737
|
+
|
|
1738
|
+
declare const _default$9: any;
|
|
1739
|
+
|
|
1740
|
+
declare const _default$8: any;
|
|
1741
|
+
|
|
1742
|
+
declare const _default$7: any;
|
|
1743
|
+
|
|
1744
|
+
declare const _default$6: any;
|
|
1745
|
+
|
|
1746
|
+
declare const _default$5: any;
|
|
1747
|
+
|
|
1748
|
+
declare const _default$4: any;
|
|
1749
|
+
|
|
1750
|
+
declare class Message implements IReceivedMessageV2 {
|
|
1751
|
+
conversationType: ConversationType;
|
|
1752
|
+
targetId: string;
|
|
1753
|
+
senderUserId: string;
|
|
1754
|
+
content: Object;
|
|
1755
|
+
objectName: string;
|
|
1756
|
+
messageType: string;
|
|
1757
|
+
messageId: number;
|
|
1758
|
+
messageUId: string;
|
|
1759
|
+
messageDirection: MessageDirection;
|
|
1760
|
+
offLineMessage: boolean;
|
|
1761
|
+
sentStatus: SentStatus;
|
|
1762
|
+
sentTime: number;
|
|
1763
|
+
receivedStatus: ReceivedStatus;
|
|
1764
|
+
receivedTime: number;
|
|
1765
|
+
canIncludeExpansion: boolean;
|
|
1766
|
+
expansion: {
|
|
1767
|
+
[key: string]: string;
|
|
1768
|
+
};
|
|
1769
|
+
receiptResponse: any;
|
|
1770
|
+
disableNotification: boolean;
|
|
1771
|
+
constructor(conversationType: ConversationType, targetId: string, senderUserId: string, content: Object, objectName: string, messageType: string, messageId: number, messageUId: string, messageDirection: MessageDirection, offLineMessage: boolean, sentStatus: SentStatus, sentTime: number, receivedStatus: ReceivedStatus, receivedTime: number, canIncludeExpansion: boolean, expansion: {
|
|
1772
|
+
[key: string]: string;
|
|
1773
|
+
}, receiptResponse: any, disableNotification: boolean);
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
declare enum VoIPMediaType {
|
|
1777
|
+
MEDIA_AUDIO = 1,
|
|
1778
|
+
MEDIA_VEDIO = 2,
|
|
1779
|
+
MEDIA_VIDEO = 2
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
declare const AcceptMessage: any;
|
|
1783
|
+
declare const RingingMessage: any;
|
|
1784
|
+
declare const SummaryMessage: any;
|
|
1785
|
+
declare const HungupMessage: any;
|
|
1786
|
+
declare const InviteMessage: any;
|
|
1787
|
+
declare const MediaModifyMessage: any;
|
|
1788
|
+
declare const MemberModifyMessage: any;
|
|
1789
|
+
|
|
1790
|
+
declare const _default$3: any;
|
|
1791
|
+
|
|
1792
|
+
declare const _default$2: any;
|
|
1793
|
+
|
|
1794
|
+
/**
|
|
1795
|
+
* 群组 @ 类型
|
|
1796
|
+
* V2 与 engine 定义的 MentionedType 不一致,需重新定义
|
|
1797
|
+
*/
|
|
1798
|
+
declare enum MentionedType {
|
|
1799
|
+
/**
|
|
1800
|
+
* 所有人
|
|
1801
|
+
*/
|
|
1802
|
+
ALL = 1,
|
|
1803
|
+
/**
|
|
1804
|
+
* 部分人
|
|
1805
|
+
*/
|
|
1806
|
+
PART = 2
|
|
1807
|
+
}
|
|
1808
|
+
|
|
1809
|
+
declare const _default$1: any;
|
|
1810
|
+
|
|
1811
|
+
declare const _default: any;
|
|
1812
|
+
|
|
1813
|
+
declare const ConnectionState: {
|
|
1814
|
+
ACCEPTED: number;
|
|
1815
|
+
UNACCEPTABLE_PROTOCOL_VERSION: number;
|
|
1816
|
+
IDENTIFIER_REJECTED: number;
|
|
1817
|
+
SERVER_UNAVAILABLE: number;
|
|
1818
|
+
TOKEN_INCORRECT: number;
|
|
1819
|
+
NOT_AUTHORIZED: number;
|
|
1820
|
+
REDIRECT: number;
|
|
1821
|
+
PACKAGE_ERROR: number;
|
|
1822
|
+
APP_BLOCK_OR_DELETE: number;
|
|
1823
|
+
BLOCK: number;
|
|
1824
|
+
TOKEN_EXPIRE: number;
|
|
1825
|
+
DEVICE_ERROR: number;
|
|
1826
|
+
HOSTNAME_ERROR: number;
|
|
1827
|
+
HASOHTERSAMECLIENTONLINE: number;
|
|
1828
|
+
IN_OTHER_CLUSTER: number;
|
|
1829
|
+
APP_AUTH_NOT_PASS: number;
|
|
1830
|
+
OTP_USED: number;
|
|
1831
|
+
PLATFORM_ERROR: number;
|
|
1832
|
+
};
|
|
1833
|
+
|
|
1834
|
+
export { AcceptMessage, ChannelClient, ConnectionState, _default$a as FileMessage, _default$8 as GIFMessage, GetChatRoomType, _default$b as HQVoiceMessage, HungupMessage, IV2Conversation as IConversation, IInitOption, IMClient, IReceivedConversationStatus, IRemoveChatRoomEntryOption, _default$e as ImageMessage, InviteMessage, _default$g as LocationMessage, MediaModifyMessage, MemberModifyMessage, MentionedInfo, MentionedType, Message, MessageTag, _default as PublicServiceMultiRichContentMessage, _default$1 as PublicServiceRichContentMessage, _default$4 as RCCombineMessage, _default$7 as ReadReceiptMessage, _default$6 as ReadReceiptRequestMessage, _default$5 as ReadReceiptResponseMessage, _default$2 as ReferenceMessage, _default$d as RichContentMessage, RingingMessage, _default$i as RongIMClient, SentStatus, _default$9 as SightMessage, SummaryMessage, _default$3 as SyncReadStatusMessage, _default$h as TextMessage, _default$f as TypingStatusMessage, VoIPMediaType, _default$c as VoiceMessage };
|