easemob-websdk 4.1.7 → 4.2.0-beta

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.
@@ -1,7 +1,10 @@
1
1
  import { Reaction } from './reactionApi';
2
2
  import { TranslationResult } from './translation';
3
3
  import { ChatThread, ChatThreadOverview } from './threadApi';
4
- type MessageType =
4
+ import { CreateCombineMsgParameters } from '../message/combine';
5
+ import { SendMsgResult } from './engineCore';
6
+ import { FileObj } from '../message/img';
7
+ declare type MessageType =
5
8
  | 'read'
6
9
  | 'delivery'
7
10
  | 'channel'
@@ -12,24 +15,18 @@ type MessageType =
12
15
  | 'img'
13
16
  | 'audio'
14
17
  | 'file'
15
- | 'video';
16
-
17
- type ChatType = 'singleChat' | 'groupChat' | 'chatRoom';
18
-
19
- /** Message online state type. */
20
- /** 消息在线状态类型。 */
21
- export enum ONLINESTATETYPE {
18
+ | 'video'
19
+ | 'combine';
20
+ declare type ChatType = 'singleChat' | 'groupChat' | 'chatRoom';
21
+ /** The online/offline states of messages. */
22
+ export declare enum ONLINESTATETYPE {
22
23
  /** Offline message. */
23
- /** 离线消息。 */
24
24
  OFFLINE = 0,
25
25
  /** Online message. */
26
- /** 在线消息。 */
27
26
  ONLINE = 1,
28
27
  /** Unknown state. */
29
- /** 未知状态。 */
30
28
  UNKNOWN = 2,
31
29
  /** Message online status is not enabled. */
32
- /** 未启用消息在线状态。 */
33
30
  NONE = 3,
34
31
  }
35
32
  interface ReadMsgSetParameters {
@@ -49,26 +46,16 @@ interface ReadParameters {
49
46
  type: 'read';
50
47
  id: string;
51
48
  }
52
-
53
49
  interface CreateReadMsgParameters {
54
- /** The receiver. */
55
- /** 消息接收方。 */
50
+ /** The recipient. */
56
51
  to: string;
57
- /** The sender, only can be yourself and can not de changed. */
58
- /** 消息发送方,只能是自己,不可改变。*/
52
+ /** The sender, which can only be the current user and can not be changed. */
59
53
  from?: string;
60
54
  /** The message type. */
61
- /** 消息类型。 */
62
55
  type: 'read';
63
56
  /** The ID of the read message */
64
- /** 已读消息的 ID。 */
65
57
  id: string;
66
58
  }
67
-
68
- interface DeliveryParameters {
69
- id: string;
70
- type: 'delivery';
71
- }
72
59
  interface DeliveryMsgSetParameters {
73
60
  ackId: string;
74
61
  to: string;
@@ -83,35 +70,27 @@ interface DeliveryMsgBody {
83
70
  from?: string;
84
71
  onlineState?: ONLINESTATETYPE;
85
72
  }
86
-
87
73
  interface CreateDeliveryMsgParameters {
88
- /** The delivered message ID. */
89
- /** 送达消息 ID。 */
74
+ /** The ID of the delivered message. */
90
75
  ackId: string;
91
76
  /** The message type. */
92
- /** 消息类型。 */
93
77
  type: 'delivery';
94
- /** The receiver. */
95
- /** 消息接收方。 */
78
+ /** The recipient. */
96
79
  to: string;
97
- /** The sender, only can be yourself and can not de changed. */
98
- /** 消息发送方,只能是自己,不可改变。*/
80
+ /** The sender, which can only be the current user and can not be changed. */
99
81
  from?: string;
100
82
  }
101
-
102
- interface TextParameters {
103
- type: 'txt';
104
- id: string;
105
- }
106
83
  interface TextMsgSetParameters {
107
84
  chatType: ChatType;
108
85
  to: string;
109
86
  msg: string;
110
87
  from?: string;
111
88
  roomType?: boolean;
112
- success?: () => void;
89
+ success?: (data: SendMsgResult) => void;
113
90
  fail?: () => void;
114
- ext?: { [key: string]: any };
91
+ ext?: {
92
+ [key: string]: any;
93
+ };
115
94
  }
116
95
  interface TextMsgBody {
117
96
  id: string;
@@ -122,10 +101,14 @@ interface TextMsgBody {
122
101
  from?: string;
123
102
  roomType?: boolean;
124
103
  group?: string;
125
- success?: () => void;
104
+ success?: (data: SendMsgResult) => void;
126
105
  fail?: () => void;
127
- ext?: { [key: string]: any };
128
- msgConfig?: { [key: string]: any };
106
+ ext?: {
107
+ [key: string]: any;
108
+ };
109
+ msgConfig?: {
110
+ [key: string]: any;
111
+ };
129
112
  time: number;
130
113
  reactions?: Reaction;
131
114
  translations?: TranslationResult;
@@ -134,32 +117,23 @@ interface TextMsgBody {
134
117
  onlineState?: ONLINESTATETYPE;
135
118
  priority?: MessagePriority;
136
119
  deliverOnlineOnly?: boolean;
120
+ modifiedInfo?: ModifiedMsgInfo;
137
121
  }
138
-
139
122
  interface CreateTextMsgParameters {
140
- /** Session type. */
141
- /** 会话类型。 */
123
+ /** The conversation type. */
142
124
  chatType: ChatType;
143
- /** Message type. */
144
- /** 消息类型。 */
125
+ /** The message type. */
145
126
  type: 'txt';
146
- /** The receiver. */
147
- /** 消息接收方。 */
127
+ /** The recipient. */
148
128
  to: string;
149
129
  /** The message content. */
150
- /** 消息内容。 */
151
130
  msg: string;
152
- /** The sender, only can be yourself and can not de changed. */
153
- /** 消息发送方,只能是自己,不可改变。*/
131
+ /** The sender, which can only be the current user and can not be changed. */
154
132
  from?: string;
155
133
  /** Message extension. */
156
- /** 消息扩展。 */
157
- ext?: { [key: string]: any };
158
- }
159
-
160
- interface CmdParameters {
161
- type: 'cmd';
162
- id: string;
134
+ ext?: {
135
+ [key: string]: any;
136
+ };
163
137
  }
164
138
  interface CmdMsgSetParameters {
165
139
  chatType: ChatType;
@@ -167,11 +141,12 @@ interface CmdMsgSetParameters {
167
141
  action: string;
168
142
  from?: string;
169
143
  roomType?: boolean;
170
- success?: () => void;
144
+ success?: (data: SendMsgResult) => void;
171
145
  fail?: () => void;
172
- ext?: { [key: string]: any };
146
+ ext?: {
147
+ [key: string]: any;
148
+ };
173
149
  }
174
-
175
150
  interface CmdMsgBody {
176
151
  id: string;
177
152
  chatType: ChatType;
@@ -181,10 +156,14 @@ interface CmdMsgBody {
181
156
  from?: string;
182
157
  roomType?: boolean;
183
158
  group?: string;
184
- success?: () => void;
159
+ success?: (data: SendMsgResult) => void;
185
160
  fail?: () => void;
186
- ext?: { [key: string]: any };
187
- msgConfig?: { [key: string]: any };
161
+ ext?: {
162
+ [key: string]: any;
163
+ };
164
+ msgConfig?: {
165
+ [key: string]: any;
166
+ };
188
167
  time: number;
189
168
  reactions?: Reaction;
190
169
  chatThread?: ChatThread;
@@ -193,60 +172,60 @@ interface CmdMsgBody {
193
172
  priority?: MessagePriority;
194
173
  deliverOnlineOnly?: boolean;
195
174
  }
196
-
197
175
  interface CreateCmdMsgParameters {
198
176
  /** The message type. */
199
- /** 消息类型。 */
200
177
  type: 'cmd';
201
- /** The session type. */
202
- /** 会话类型。 */
178
+ /** The conversation type. */
203
179
  chatType: ChatType;
204
- /** The receiver. */
205
- /** 消息接收方。 */
180
+ /** The recipient. */
206
181
  to: string;
207
182
  /** The command. */
208
- /** 指令。 */
209
183
  action: string;
210
- /** The sender, only can be yourself and can not de changed. */
211
- /** 消息发送方,只能是自己,不可改变。*/
184
+ /** The sender, which can only be the current user and can not be changed. */
212
185
  from?: string;
213
- // roomType?: boolean,
214
186
  /** The message extension. */
215
- /** 消息扩展。 */
216
- ext?: { [key: string]: any };
217
- }
218
-
219
- interface CustomParameters {
220
- type: 'custom';
221
- id: string;
187
+ ext?: {
188
+ [key: string]: any;
189
+ };
222
190
  }
223
191
  interface CustomMsgSetParameters {
224
192
  chatType: ChatType;
225
193
  to: string;
226
194
  customEvent: string;
227
- customExts: { [key: string]: any };
195
+ customExts: {
196
+ [key: string]: any;
197
+ };
228
198
  from?: string;
229
199
  roomType?: boolean;
230
200
  success?: () => void;
231
201
  fail?: () => void;
232
- ext?: { [key: string]: any };
202
+ ext?: {
203
+ [key: string]: any;
204
+ };
233
205
  }
234
-
235
206
  interface CustomMsgBody {
236
207
  id: string;
237
208
  chatType: ChatType;
238
209
  type: 'custom';
239
210
  to: string;
240
211
  customEvent: string;
241
- customExts: { [key: string]: any };
212
+ customExts: {
213
+ [key: string]: any;
214
+ };
242
215
  from?: string;
243
216
  roomType?: boolean;
244
217
  group?: string;
245
- params?: { [key: string]: any };
246
- success?: () => void;
218
+ params?: {
219
+ [key: string]: any;
220
+ };
221
+ success?: (data: SendMsgResult) => void;
247
222
  fail?: () => void;
248
- ext?: { [key: string]: any };
249
- msgConfig?: { [key: string]: any };
223
+ ext?: {
224
+ [key: string]: any;
225
+ };
226
+ msgConfig?: {
227
+ [key: string]: any;
228
+ };
250
229
  time: number;
251
230
  reactions?: Reaction;
252
231
  chatThread?: ChatThread;
@@ -255,34 +234,25 @@ interface CustomMsgBody {
255
234
  priority?: MessagePriority;
256
235
  deliverOnlineOnly?: boolean;
257
236
  }
258
-
259
237
  interface CreateCustomMsgParameters {
260
238
  /** The message type. */
261
- /** 消息类型。 */
262
239
  type: 'custom';
263
- /** The session type. */
264
- /** 会话类型。 */
240
+ /** The conversation type. */
265
241
  chatType: ChatType;
266
- /** The receiver. */
267
- /** 消息接收方。 */
242
+ /** The recipient. */
268
243
  to: string;
269
244
  /** The custom event. */
270
- /** 自定义事件。 */
271
245
  customEvent: string;
272
246
  /** The custom event extension. */
273
- /** 自定事件扩展。 */
274
- customExts: { [key: string]: any };
275
- /** The sender, only can be yourself and can not de changed. */
276
- /** 消息发送方,只能是自己,不可改变。*/
247
+ customExts: {
248
+ [key: string]: any;
249
+ };
250
+ /** The sender, which can only be the current user and can not be changed. */
277
251
  from?: string;
278
252
  /** Message extension. */
279
- /** 消息扩展。 */
280
- ext?: { [key: string]: any };
281
- }
282
-
283
- interface LocationParameters {
284
- type: 'loc';
285
- id: string;
253
+ ext?: {
254
+ [key: string]: any;
255
+ };
286
256
  }
287
257
  interface LocationMsgSetParameters {
288
258
  chatType: ChatType;
@@ -293,11 +263,12 @@ interface LocationMsgSetParameters {
293
263
  lng: number;
294
264
  from?: string;
295
265
  roomType?: boolean;
296
- success?: () => void;
266
+ success?: (data: SendMsgResult) => void;
297
267
  fail?: () => void;
298
- ext?: { [key: string]: any };
268
+ ext?: {
269
+ [key: string]: any;
270
+ };
299
271
  }
300
-
301
272
  interface LocationMsgBody {
302
273
  id: string;
303
274
  chatType: ChatType;
@@ -310,10 +281,14 @@ interface LocationMsgBody {
310
281
  from?: string;
311
282
  roomType?: boolean;
312
283
  group?: string;
313
- success?: () => void;
284
+ success?: (data: SendMsgResult) => void;
314
285
  fail?: () => void;
315
- ext?: { [key: string]: any };
316
- msgConfig?: { [key: string]: any };
286
+ ext?: {
287
+ [key: string]: any;
288
+ };
289
+ msgConfig?: {
290
+ [key: string]: any;
291
+ };
317
292
  time: number;
318
293
  reactions?: Reaction;
319
294
  chatThread?: ChatThread;
@@ -322,46 +297,32 @@ interface LocationMsgBody {
322
297
  priority?: MessagePriority;
323
298
  deliverOnlineOnly?: boolean;
324
299
  }
325
-
326
300
  interface CreateLocationMsgParameters {
327
301
  /** The message type. */
328
- /** 消息类型。 */
329
302
  type: 'loc';
330
- /** The session type. */
331
- /** 会话类型。 */
303
+ /** The conversation type. */
332
304
  chatType: ChatType;
333
- /** The receiver. */
334
- /** 消息接收方。 */
305
+ /** The recipient. */
335
306
  to: string;
336
307
  /** The building name. */
337
- /** 建筑物名称。 */
338
308
  buildingName: string;
339
309
  /** Address. */
340
- /** 地址。 */
341
310
  addr: string;
342
311
  /** The latitude. */
343
- /** 纬度。 */
344
312
  lat: number;
345
313
  /** The longitude. */
346
- /** 精度。 */
347
314
  lng: number;
348
- /** The sender, only can be yourself and can not de changed. */
349
- /** 消息发送方,只能是自己,不可改变。*/
315
+ /** The sender, which can only be the current user and can not be changed. */
350
316
  from?: string;
351
317
  /** Message extension. */
352
- /** 消息扩展。 */
353
- ext?: { [key: string]: any };
354
- }
355
-
356
- interface ImgParameters {
357
- type: 'img';
358
- id: string;
318
+ ext?: {
319
+ [key: string]: any;
320
+ };
359
321
  }
360
-
361
322
  interface ImgMsgSetParameters {
362
323
  chatType: ChatType;
363
324
  to: string;
364
- file: object;
325
+ file?: FileObj;
365
326
  width?: number;
366
327
  height?: number;
367
328
  file_length?: number;
@@ -369,23 +330,26 @@ interface ImgMsgSetParameters {
369
330
  from?: string;
370
331
  roomType?: boolean;
371
332
  group?: string;
372
- success?: () => void;
333
+ success?: (data: SendMsgResult) => void;
373
334
  fail?: () => void;
374
- ext?: { [key: string]: any };
335
+ ext?: {
336
+ [key: string]: any;
337
+ };
375
338
  url?: string;
376
339
  onFileUploadError?: (error: any) => void;
377
340
  onFileUploadComplete?: (data: any) => void;
378
341
  onFileUploadProgress?: (data: any) => void;
379
342
  uploadError?: () => void;
380
343
  uploadComplete?: () => void;
381
- msgConfig?: { [key: string]: any };
344
+ msgConfig?: {
345
+ [key: string]: any;
346
+ };
382
347
  body?: {
383
348
  url: string;
384
349
  type: string;
385
350
  filename: string;
386
351
  };
387
352
  }
388
-
389
353
  interface ImgMsgBody extends ImgMsgSetParameters {
390
354
  id: string;
391
355
  type: 'img';
@@ -400,79 +364,60 @@ interface ImgMsgBody extends ImgMsgSetParameters {
400
364
  priority?: MessagePriority;
401
365
  deliverOnlineOnly?: boolean;
402
366
  }
403
-
404
367
  interface CreateImgMsgParameters {
405
- /** Message type. */
406
- /** 消息类型。 */
368
+ /** The message type. */
407
369
  type: 'img';
408
- /** Session type. */
409
- /** 会话类型。 */
370
+ /** The conversation type. */
410
371
  chatType: ChatType;
411
372
  /** The file object. */
412
- /** 文件对象。 */
413
373
  file: File;
414
- /** The file URL. If the file has been uploaded, you can directly use the URL. */
415
- /** 文件 url,如果文件已经上传可以直接使用 url。 */
374
+ /** The file URL. If the file has been uploaded, you can directly use the URL. */
416
375
  url?: string;
417
376
  /** The image width. */
418
- /** 图片宽度。 */
419
377
  width?: number;
420
378
  /** The image height. */
421
- /** 图片高度。 */
422
379
  height?: number;
423
- /** The receiver. */
424
- /** 消息接收方。 */
380
+ /** The recipient. */
425
381
  to: string;
426
- /** The sender, only can be yourself and can not de changed. */
427
- /** 消息发送方,只能是自己,不可改变。*/
382
+ /** The sender, which can only be the current user and can not be changed. */
428
383
  from?: string;
429
384
  /** The image file length. */
430
- /** 图片文件大小。 */
431
385
  file_length: number;
432
386
  /** The callback of file upload error. */
433
- /** 文件上传错误的回调。 */
434
387
  onFileUploadError?: (error: any) => void;
435
- /** The callback of file upload complete. */
436
- /** 文件上传完成的回调。 */
388
+ /** The callback of file upload completion. */
437
389
  onFileUploadComplete?: (data: any) => void;
438
390
  /** The callback of file upload progress. */
439
- /** 文件上传进度的回调。 */
440
391
  onFileUploadProgress?: (data: any) => void;
441
392
  /** Message extension. */
442
- /** 消息扩展。 */
443
- ext?: { [key: string]: any };
393
+ ext?: {
394
+ [key: string]: any;
395
+ };
444
396
  /** The message body. */
445
- /** 消息体。 */
446
397
  body?: {
447
398
  /** The file URL. */
448
- /** 文件 url。 */
449
399
  url: string;
450
400
  /** The file type. */
451
- /** 文件类型。 */
452
401
  type: string;
453
- /** The file type. */
454
- /** 文件名。 */
402
+ /** The file name. */
455
403
  filename: string;
456
404
  };
457
405
  }
458
-
459
- interface AudioParameters {
460
- type: 'audio';
461
- id: string;
462
- }
463
406
  interface AudioMsgSetParameters {
464
407
  chatType: ChatType;
465
408
  file: object;
466
409
  filename: string;
467
- length: number;
468
- file_length: number;
410
+ length?: number;
411
+ file_length?: number;
469
412
  fileInputId?: string;
470
413
  to: string;
471
414
  from?: string;
472
415
  roomType?: boolean;
473
- success?: () => void;
416
+ success?: (data: SendMsgResult) => void;
474
417
  fail?: () => void;
475
- ext?: { [key: string]: any };
418
+ ext?: {
419
+ [key: string]: any;
420
+ };
476
421
  apiUrl?: string;
477
422
  onFileUploadError?: (err: any) => void;
478
423
  onFileUploadComplete?: (data: any) => void;
@@ -483,7 +428,6 @@ interface AudioMsgSetParameters {
483
428
  filename: string;
484
429
  };
485
430
  }
486
-
487
431
  interface AudioMsgBody extends AudioMsgSetParameters {
488
432
  id: string;
489
433
  type: 'audio';
@@ -492,7 +436,9 @@ interface AudioMsgBody extends AudioMsgSetParameters {
492
436
  filetype?: string;
493
437
  accessToken?: string;
494
438
  group?: string;
495
- msgConfig?: { [key: string]: any };
439
+ msgConfig?: {
440
+ [key: string]: any;
441
+ };
496
442
  time: number;
497
443
  reactions?: Reaction;
498
444
  chatThread?: ChatThread;
@@ -501,80 +447,60 @@ interface AudioMsgBody extends AudioMsgSetParameters {
501
447
  priority?: MessagePriority;
502
448
  deliverOnlineOnly?: boolean;
503
449
  }
504
-
505
450
  interface CreateAudioMsgParameters {
506
451
  /** The message type. */
507
- /** 消息类型。 */
508
452
  type: 'video';
509
- /** The session type. */
510
- /** 会话类型。 */
453
+ /** The conversation type. */
511
454
  chatType: ChatType;
512
455
  /** The file object. */
513
- /** 文件对象。 */
514
456
  file: object;
515
457
  /** The file name. */
516
- /** 文件名。 */
517
458
  filename: string;
518
459
  /** The video duration. */
519
- /** 视频时长。 */
520
460
  length: number;
521
461
  /** The video file length. */
522
- /** 视频文件大小。 */
523
462
  file_length: number;
524
463
  /** The input ID of the uploaded file. */
525
- /** 上传文件的input ID。 */
526
464
  fileInputId?: string;
527
- /** The receiver. */
528
- /** 消息的接收方。 */
465
+ /** The recipient. */
529
466
  to: string;
530
- /** The sender, only can be yourself and can not de changed. */
531
- /** 消息发送方,只能是自己,不可改变。*/
467
+ /** The sender, which can only be the current user and can not be changed. */
532
468
  from?: string;
533
469
  /** Message extension. */
534
- /** 消息扩展。 */
535
- ext?: { [key: string]: any };
536
- // apiUrl?: string,
470
+ ext?: {
471
+ [key: string]: any;
472
+ };
537
473
  /** The callback of file upload error. */
538
- /** 文件上传错误的回调。 */
539
474
  onFileUploadError?: (error: any) => void;
540
- /** The callback of file upload complete. */
541
- /** 文件上传完成的回调。 */
475
+ /** The callback of file upload completion. */
542
476
  onFileUploadComplete?: (data: any) => void;
543
477
  /** The callback of file upload progress. */
544
- /** 文件上传进度的回调。 */
545
478
  onFileUploadProgress?: (data: any) => void;
546
479
  /** The message body. */
547
- /** 消息体。 */
548
480
  body?: {
549
481
  /** The file URL. */
550
- /** 文件 url。 */
551
482
  url: string;
552
483
  /** The file type. */
553
- /** 文件类型。 */
554
484
  type: string;
555
485
  /** The file type. */
556
- /** 文件名。 */
557
486
  filename: string;
558
487
  };
559
488
  }
560
-
561
- interface VideoParameters {
562
- type: 'video';
563
- id: string;
564
- }
565
489
  interface VideoMsgSetParameters {
566
490
  chatType: ChatType;
567
491
  file: object;
568
- filename: string;
569
- length: number;
570
- file_length: number;
492
+ filename?: string;
493
+ length?: number;
494
+ file_length?: number;
571
495
  fileInputId?: string;
572
496
  to: string;
573
497
  from?: string;
574
498
  roomType?: boolean;
575
- success?: () => void;
499
+ success?: (data: SendMsgResult) => void;
576
500
  fail?: () => void;
577
- ext?: { [key: string]: any };
501
+ ext?: {
502
+ [key: string]: any;
503
+ };
578
504
  apiUrl?: string;
579
505
  onFileUploadError?: (err: any) => void;
580
506
  onFileUploadComplete?: (data: any) => void;
@@ -585,7 +511,6 @@ interface VideoMsgSetParameters {
585
511
  filename: string;
586
512
  };
587
513
  }
588
-
589
514
  interface VideoMsgBody extends VideoMsgSetParameters {
590
515
  id: string;
591
516
  type: 'video';
@@ -593,7 +518,9 @@ interface VideoMsgBody extends VideoMsgSetParameters {
593
518
  secret?: string;
594
519
  filetype?: string;
595
520
  accessToken?: string;
596
- msgConfig?: { [key: string]: any };
521
+ msgConfig?: {
522
+ [key: string]: any;
523
+ };
597
524
  group?: string;
598
525
  time: number;
599
526
  reactions?: Reaction;
@@ -603,89 +530,68 @@ interface VideoMsgBody extends VideoMsgSetParameters {
603
530
  priority?: MessagePriority;
604
531
  deliverOnlineOnly?: boolean;
605
532
  }
606
-
607
533
  interface CreateVideoMsgParameters {
608
534
  /** The message type. */
609
- /** 消息类型。 */
610
535
  type: 'video';
611
- /** The session type. */
612
- /** 会话类型。 */
536
+ /** The conversation type. */
613
537
  chatType: ChatType;
614
538
  /** The file object. */
615
- /** 文件对象。 */
616
539
  file: object;
617
540
  /** The file name. */
618
- /** 文件名。 */
619
541
  filename: string;
620
542
  /** The video duration. */
621
- /** 视频时长。 */
622
543
  length: number;
623
544
  /** The video file length. */
624
- /** 视频文件大小。 */
625
545
  file_length: number;
626
546
  /** The input ID of the uploaded file. */
627
- /** 上传文件的input ID。 */
628
547
  fileInputId?: string;
629
- /** The receiver. */
630
- /** 消息的接收方。 */
548
+ /** The recipient. */
631
549
  to: string;
632
- /** The sender, only can be yourself and can not de changed. */
633
- /** 消息发送方,只能是自己,不可改变。*/
550
+ /** The sender, which can only be the current user and can not be changed. */
634
551
  from?: string;
635
552
  /** Message extension. */
636
- /** 消息扩展。 */
637
- ext?: { [key: string]: any };
638
- // apiUrl?: string,
553
+ ext?: {
554
+ [key: string]: any;
555
+ };
639
556
  /** The callback of file upload error. */
640
- /** 文件上传错误的回调。 */
641
557
  onFileUploadError?: (error: any) => void;
642
- /** The callback of file upload complete. */
643
- /** 文件上传完成的回调。 */
558
+ /** The callback of file upload completion. */
644
559
  onFileUploadComplete?: (data: any) => void;
645
560
  /** The callback of file upload progress. */
646
- /** 文件上传进度的回调。 */
647
561
  onFileUploadProgress?: (data: any) => void;
648
562
  /** The message body. */
649
- /** 消息体。 */
650
563
  body?: {
651
564
  /** The file URL. */
652
- /** 文件 url。 */
653
565
  url: string;
654
566
  /** The file type. */
655
- /** 文件类型。 */
656
567
  type: string;
657
- /** The file type. */
658
- /** 文件名。 */
568
+ /** The file name. */
659
569
  filename: string;
660
570
  };
661
571
  }
662
-
663
- interface FileParameters {
664
- type: 'file';
665
- id: string;
666
- }
667
572
  interface FileMsgSetParameters {
668
573
  chatType: ChatType;
669
574
  file: any;
670
- filename: string;
575
+ filename?: string;
671
576
  fileInputId?: string;
672
577
  to: string;
673
578
  from?: string;
674
579
  roomType?: boolean;
675
- success?: () => void;
580
+ success?: (data: SendMsgResult) => void;
676
581
  fail?: () => void;
677
- ext?: { [key: string]: any };
582
+ ext?: {
583
+ [key: string]: any;
584
+ };
678
585
  apiUrl?: string;
679
- onFileUploadError?: () => void;
680
- onFileUploadComplete?: () => void;
681
- onFileUploadProgress?: () => void;
586
+ onFileUploadError?: (err: any) => void;
587
+ onFileUploadComplete?: (data: any) => void;
588
+ onFileUploadProgress?: (data: any) => void;
682
589
  body?: {
683
590
  url: string;
684
591
  type: string;
685
592
  filename: string;
686
593
  };
687
594
  }
688
-
689
595
  interface FileMsgBody extends FileMsgSetParameters {
690
596
  id: string;
691
597
  type: 'file';
@@ -696,7 +602,9 @@ interface FileMsgBody extends FileMsgSetParameters {
696
602
  file_length?: number;
697
603
  filetype?: string;
698
604
  accessToken?: string;
699
- msgConfig?: { [key: string]: any };
605
+ msgConfig?: {
606
+ [key: string]: any;
607
+ };
700
608
  time: number;
701
609
  reactions?: Reaction;
702
610
  chatThread?: ChatThread;
@@ -705,96 +613,81 @@ interface FileMsgBody extends FileMsgSetParameters {
705
613
  priority?: MessagePriority;
706
614
  deliverOnlineOnly?: boolean;
707
615
  }
708
-
709
616
  interface CreateFileMsgParameters {
710
617
  /** The message type. */
711
- /** 消息类型。 */
712
618
  type: 'file';
713
- /** The session type. */
714
- /** 会话类型。 */
619
+ /** The conversation type. */
715
620
  chatType: ChatType;
716
621
  /** The file object. */
717
- /** 文件对象。 */
718
622
  file: any;
719
623
  /** The file name. */
720
- /** 文件名。 */
721
624
  filename: string;
722
625
  /** The input ID of the uploaded file. */
723
- /** 上传文件的input ID。 */
724
626
  fileInputId?: string;
725
- /** The receiver. */
726
- /** 消息的接收方。 */
627
+ /** The recipient. */
727
628
  to: string;
728
- /** The sender, only can be yourself and can not de changed. */
729
- /** 消息发送方,只能是自己,不可改变。*/
629
+ /** The sender, which can only be the current user and can not be changed. */
730
630
  from?: string;
731
631
  /** Message extension. */
732
- /** 消息扩展。 */
733
- ext?: { [key: string]: any };
734
- // apiUrl?: string,
632
+ ext?: {
633
+ [key: string]: any;
634
+ };
735
635
  /** The callback of file upload error. */
736
- /** 文件上传错误的回调。 */
737
636
  onFileUploadError?: (error: any) => void;
738
- /** The callback of file upload complete. */
739
- /** 文件上传完成的回调。 */
637
+ /** The callback of file upload completion. */
740
638
  onFileUploadComplete?: (data: any) => void;
741
639
  /** The callback of file upload progress. */
742
- /** 文件上传进度的回调。 */
743
640
  onFileUploadProgress?: (data: any) => void;
744
641
  /** The message body. */
745
- /** 消息体。 */
746
642
  body?: {
747
643
  /** The file URL. */
748
- /** 文件 url。 */
749
644
  url: string;
750
645
  /** The file type. */
751
- /** 文件类型。 */
752
646
  type: string;
753
- /** The file type. */
754
- /** 文件名。 */
647
+ /** The file name. */
755
648
  filename: string;
756
649
  };
757
650
  }
758
-
759
651
  interface ReceivedMsgBody {
760
652
  id: string;
761
653
  mid: string;
762
654
  to: string;
763
655
  time: number;
764
656
  }
765
-
766
657
  interface RecallMsgBody {
767
658
  id: string;
768
659
  from: string;
769
660
  to: string;
770
661
  mid: string;
771
662
  }
772
-
663
+ interface ModifiedMsgInfo {
664
+ /** Gets the user ID of the operator that modified the message last time. */
665
+ operatorId: string;
666
+ /** Gets the number of times a message is modified. A message can be modified at most five times.*/
667
+ operationCount: number;
668
+ /** Gets the UNIX timestamp of the last message modification, in milliseconds. */
669
+ operationTime: number;
670
+ }
671
+ /** The modified message. */
672
+ declare type ModifiedMsg = TextMsgBody;
773
673
  interface MuteMsgBody {
774
674
  mid: string;
775
675
  }
776
-
777
676
  interface ContactMsgBody {
778
- /** The message type, subscribe: request a contact, unsubscribed: cancel or refuse to add contact, subscribed: added contact successfully. */
779
- /** 消息类型 subscribe: 请求加好友,unsubscribed: 取消或决绝加好友,subscribed: 加好友成功。 */
677
+ /** The message type: subscribe: requests a contact; unsubscribed: cancels or refuses to add a contact; subscribed: succeeds in adding a contact. */
780
678
  type: 'subscribe' | 'unsubscribed' | 'subscribed';
781
- /** The message receiver. */
782
- /** 消息接收者。 */
679
+ /** The message recipient. */
783
680
  to: string;
784
681
  /** The message sender. */
785
- /** 消息发送者。 */
786
682
  from: string;
787
683
  /** Reason. */
788
- /** 原因。 */
789
684
  status?: string;
790
685
  }
791
-
792
686
  interface ChannelMsgSetParameters {
793
687
  chatType: ChatType;
794
688
  to: string;
795
689
  from?: string;
796
690
  }
797
-
798
691
  interface ChannelMsgBody extends ChannelMsgSetParameters {
799
692
  id: string;
800
693
  group?: string;
@@ -802,27 +695,75 @@ interface ChannelMsgBody extends ChannelMsgSetParameters {
802
695
  time: number;
803
696
  onlineState?: ONLINESTATETYPE;
804
697
  }
805
- interface ChannelParameters {
806
- type: 'channel';
807
- id: string;
808
- }
809
-
810
698
  interface CreateChannelMsgParameters {
811
699
  /** The message type. */
812
- /** 消息类型。 */
813
700
  type: 'channel';
814
- /** The session type. */
815
- /** 会话类型。 */
701
+ /** The conversation type. */
816
702
  chatType: ChatType;
817
- /** The receiver. */
818
- /** 消息接收方。 */
703
+ /** The recipient. */
819
704
  to: string;
820
- /** The sender, only can be yourself and can not de changed. */
821
- /** 消息发送方,只能是自己,不可改变。*/
705
+ /** The sender, which can only be the current user and can not be changed. */
822
706
  from?: string;
823
707
  }
824
-
825
- type MessagesType =
708
+ interface CombineMsgBody {
709
+ /** The message ID. */
710
+ id: string;
711
+ /** The conversation type. */
712
+ chatType: ChatType;
713
+ /** The message type. */
714
+ type: 'combine';
715
+ /** The recipient. */
716
+ to: string;
717
+ /** The sender, which can only be the current user and can not be changed.*/
718
+ from?: string;
719
+ /** Message extension. */
720
+ ext?: {
721
+ [key: string]: any;
722
+ };
723
+ /** Whether message read receipts are required during a group conversation. */
724
+ msgConfig?: {
725
+ allowGroupAck?: boolean;
726
+ languages?: string[];
727
+ };
728
+ /** Time. */
729
+ time: number;
730
+ /** Whether the message is a threaded message. */
731
+ isChatThread?: boolean;
732
+ /** The message priority. */
733
+ priority?: MessagePriority;
734
+ /** Whether the message is delivered only when the recipient(s) is/are online:
735
+ * - `true`: The message is delivered only when the recipient(s) is/are online. If the recipient is offline, the message is discarded.
736
+ * - (Default) `false`: The message is delivered when the recipient(s) is/are online. If the recipient(s) is/are offline, the message will not be delivered to them until they get online.
737
+ */
738
+ deliverOnlineOnly?: boolean;
739
+ /** The list of message recipients. */
740
+ receiverList?: string[];
741
+ /** The file URL. */
742
+ url?: string;
743
+ /** The secret key required to download the file. */
744
+ secret?: string;
745
+ /** The file size. */
746
+ file_length?: number;
747
+ /** The file name. */
748
+ filename: string;
749
+ /** The title of the combined message. */
750
+ title: string;
751
+ /** The summary list of the combined message. */
752
+ summary: string;
753
+ /** The Reaction list of the message. */
754
+ reactions?: Reaction;
755
+ /** The information of a threaded message. */
756
+ chatThread?: ChatThread;
757
+ /** The overview of a threaded message. */
758
+ chatThreadOverview?: ChatThreadOverview;
759
+ /** The online state. */
760
+ onlineState?: ONLINESTATETYPE;
761
+ /** The compatible text of the combined message. */
762
+ compatibleText: string;
763
+ /** The level of the combined message. */
764
+ combineLevel: number;
765
+ }
766
+ declare type MessagesType =
826
767
  | TextMsgBody
827
768
  | DeliveryMsgBody
828
769
  | ChannelMsgBody
@@ -833,9 +774,9 @@ type MessagesType =
833
774
  | AudioMsgBody
834
775
  | VideoMsgBody
835
776
  | FileMsgBody
836
- | ReadMsgBody;
837
-
838
- type MessageSetParameters =
777
+ | ReadMsgBody
778
+ | CombineMsgBody;
779
+ declare type MessageSetParameters =
839
780
  | ReadMsgSetParameters
840
781
  | DeliveryMsgSetParameters
841
782
  | ChannelMsgSetParameters
@@ -847,8 +788,7 @@ type MessageSetParameters =
847
788
  | AudioMsgSetParameters
848
789
  | VideoMsgSetParameters
849
790
  | FileMsgSetParameters;
850
-
851
- type CreateMsgType =
791
+ declare type CreateMsgType =
852
792
  | CreateTextMsgParameters
853
793
  | CreateImgMsgParameters
854
794
  | CreateCmdMsgParameters
@@ -859,9 +799,9 @@ type CreateMsgType =
859
799
  | CreateChannelMsgParameters
860
800
  | CreateDeliveryMsgParameters
861
801
  | CreateReadMsgParameters
802
+ | CreateCombineMsgParameters
862
803
  | CreateAudioMsgParameters;
863
-
864
- type MessageBody =
804
+ declare type MessageBody =
865
805
  | ReadMsgBody
866
806
  | DeliveryMsgBody
867
807
  | ChannelMsgBody
@@ -872,24 +812,20 @@ type MessageBody =
872
812
  | ImgMsgBody
873
813
  | AudioMsgBody
874
814
  | VideoMsgBody
875
- | FileMsgBody;
876
-
877
- /** The delivery priority of chat room messages.
878
- * Currently, this attribute is available only to chat room messages. If this attribute is not set, messages are assigned a medium priority. */
815
+ | FileMsgBody
816
+ | CombineMsgBody;
879
817
  /**
880
- * 聊天室消息的到达优先级。
881
- * 目前,仅聊天室消息支持该属性,不传默认为中优先级。*/
882
- type MessagePriority =
818
+ * The priority of chat room messages.
819
+ *
820
+ * Currently, this attribute is available only to chat room messages. If this attribute is not set, messages are assigned a medium priority. */
821
+
822
+ declare type MessagePriority =
883
823
  /** High. */
884
- /** 高。*/
885
824
  | 'high'
886
825
  /** Medium. */
887
- /** 中。*/
888
826
  | 'normal'
889
827
  /** Low. */
890
- /** 低。*/
891
828
  | 'low';
892
-
893
829
  interface PriorityExt {
894
830
  chatroom_msg_tag: number;
895
831
  }
@@ -909,6 +845,9 @@ export type {
909
845
  FileMsgSetParameters,
910
846
  ChatType,
911
847
  TextMsgBody,
848
+ CombineMsgBody,
849
+ ModifiedMsg,
850
+ ModifiedMsgInfo,
912
851
  DeliveryMsgBody,
913
852
  ChannelMsgBody,
914
853
  CmdMsgBody,