vanshi-sdk 1.0.4

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.
@@ -0,0 +1,1202 @@
1
+ /**
2
+ * 接口 [查询群消息已读成员列表。↗](https://yapi.whatimcloud.com/project/123/interface/api/9403) 的 **返回类型**
3
+ *
4
+ * @分类 [会话消息↗](https://yapi.whatimcloud.com/project/123/interface/api/cat_766)
5
+ * @请求头 `POST /sdk/queryGroupMessageReceiptReadMemberList`
6
+ * @更新时间 `2026-04-27 17:08:54`
7
+ */
8
+ interface YapiPostSdkQueryGroupMessageReceiptReadMemberListApiResponse {
9
+ code: string;
10
+ message: string;
11
+ data: YapiPostSdkQueryGroupMessageReceiptReadMemberData;
12
+ }
13
+ interface YapiPostSdkQueryGroupMessageReceiptReadMemberData {
14
+ nextFlag: string;
15
+ userList: YapiPostSdkQueryGroupMessageReceiptReadMemberListUserListData[];
16
+ groupID: string;
17
+ }
18
+ interface YapiPostSdkQueryGroupMessageReceiptReadMemberListUserListData {
19
+ /**
20
+ * 群组成员昵称。
21
+ */
22
+ memberNickname: string;
23
+ /**
24
+ * 群角色,1:群主,2:管理员,3:群成员。
25
+ */
26
+ memberRole: string;
27
+ /**
28
+ * 群成员头像 URL。
29
+ */
30
+ memberAvatarUrl: string;
31
+ userID: string;
32
+ userName: string;
33
+ /**
34
+ * 用户头像
35
+ */
36
+ userAvatarUrl: string;
37
+ /**
38
+ * 群成员禁言过期时间。为 0 时即不禁言,为 -1 时即永久禁言。
39
+ */
40
+ muteExpiredTime: string;
41
+ }
42
+
43
+ /**
44
+ * 接口 [查询群消息未读成员列表。↗](https://yapi.whatimcloud.com/project/123/interface/api/9396) 的 **返回类型**
45
+ *
46
+ * @分类 [会话消息↗](https://yapi.whatimcloud.com/project/123/interface/api/cat_766)
47
+ * @请求头 `POST /sdk/queryGroupMessageReceiptUnreadMemberList`
48
+ * @更新时间 `2026-04-29 15:01:12`
49
+ */
50
+ interface YapiPostSdkQueryGroupMessageReceiptUnreadMemberListApiResponse {
51
+ code: string;
52
+ message: string;
53
+ data: YapiPostSdkQueryGroupMessageReceiptUnreadMemberData;
54
+ }
55
+ interface YapiPostSdkQueryGroupMessageReceiptUnreadMemberData {
56
+ nextFlag: string;
57
+ userList: YapiPostSdkQueryGroupMessageReceiptUnreadMemberListUserListData[];
58
+ groupID: string;
59
+ }
60
+ interface YapiPostSdkQueryGroupMessageReceiptUnreadMemberListUserListData {
61
+ /**
62
+ * 群组成员昵称。
63
+ */
64
+ memberNickname: string;
65
+ /**
66
+ * 群角色,1:群主,2:管理员,3:群成员。
67
+ */
68
+ memberRole: string;
69
+ /**
70
+ * 群成员头像 URL。
71
+ */
72
+ memberAvatarUrl: string;
73
+ userID: string;
74
+ userName: string;
75
+ /**
76
+ * 用户头像
77
+ */
78
+ userAvatarUrl: string;
79
+ /**
80
+ * 群成员禁言过期时间。为 0 时即不禁言,为 -1 时即永久禁言。
81
+ */
82
+ muteExpiredTime: string;
83
+ }
84
+
85
+ /**
86
+ * 接口 [查询一批消息的回执信息↗](https://yapi.whatimcloud.com/project/123/interface/api/9389) 的 **返回类型**
87
+ *
88
+ * @分类 [会话消息↗](https://yapi.whatimcloud.com/project/123/interface/api/cat_766)
89
+ * @请求头 `POST /sdk/queryMessageReceiptsInfo`
90
+ * @更新时间 `2026-04-27 16:39:08`
91
+ */
92
+ interface YapiPostSdkQueryMessageReceiptsInfoApiResponse {
93
+ code: string;
94
+ message: string;
95
+ data: YapiPostSdkQueryMessageReceiptsInfoListData[];
96
+ }
97
+ interface YapiPostSdkQueryMessageReceiptsInfoListData {
98
+ /**
99
+ * 回执的状态。
100
+ */
101
+ status: string;
102
+ /**
103
+ * 消息 ID。
104
+ */
105
+ messageID: string;
106
+ /**
107
+ * 会话 ID。
108
+ */
109
+ conversationID: string;
110
+ /**
111
+ * 会话类型。
112
+ */
113
+ conversationType: string;
114
+ /**
115
+ * 表示该回执的已读人数。
116
+ */
117
+ readMemberCount: string;
118
+ /**
119
+ * 表示该回执的未读人数
120
+ */
121
+ unreadMemberCount: string;
122
+ /**
123
+ * 消息回执已读时的服务端时间戳。
124
+ */
125
+ readTime: string;
126
+ }
127
+
128
+ /**
129
+ * 接口 [设置一批消息的回执变成已读↗](https://yapi.whatimcloud.com/project/123/interface/api/9382) 的 **返回类型**
130
+ *
131
+ * @分类 [会话消息↗](https://yapi.whatimcloud.com/project/123/interface/api/cat_766)
132
+ * @请求头 `POST /sdk/sendMessageReceiptsRead`
133
+ * @更新时间 `2026-04-27 14:10:58`
134
+ */
135
+ interface YapiPostSdkSendMessageReceiptsReadApiResponse {
136
+ code: string;
137
+ message: string;
138
+ data: string;
139
+ }
140
+
141
+ interface IYapiPostSdkClearConversationTotalUnreadMessageCountApiResponse {
142
+ code: string
143
+ message: string
144
+ data: string
145
+ }
146
+
147
+ interface IYapiPostSdkClearConversationUnreadMessageCountApiResponse {
148
+ code: string
149
+ message: string
150
+ data: IYapiPostSdkClearConversationUnreadMessageCountData
151
+ }
152
+ interface IYapiPostSdkClearConversationUnreadMessageCountData {
153
+ conversationID: string
154
+ conversationType: string
155
+ }
156
+
157
+ interface IYapiPostSdkDeleteConversationApiRequest {
158
+
159
+ conversationID: string
160
+
161
+ conversationType: number
162
+
163
+ config: boolean
164
+ }
165
+
166
+
167
+ interface IYapiPostSdkDeleteConversationApiResponse {
168
+ code: string
169
+ message: string
170
+ data: IYapiPostSdkDeleteConversationListData[]
171
+ }
172
+ interface IYapiPostSdkDeleteConversationListData {
173
+
174
+ conversationID: string
175
+
176
+ conversationType: string
177
+ }
178
+
179
+ interface IYapiPostSdkSendMediaMessageApiResponse {
180
+ code: string
181
+ message: string
182
+ data: YapiPostSdkSendMediaMessageData
183
+ }
184
+
185
+ interface YapiPostSdkSendMediaMessageData {
186
+ /**
187
+ * 消息
188
+ */
189
+ massage: string
190
+ /**
191
+ * 消息类型:
192
+ * 1:普通文本消息
193
+ * 2:自定义二进制消息,可用于传递自定义的二进制消息。该消息类型不支持离线消息和本地存储。
194
+ * 0:未知类型
195
+ * 20:弹幕消息,可用于直播间发送的弹幕
196
+ * 11:图片消息,可用于发送图片消息,仅支持 .jpg, .jpeg, .png, .bmp, .gif, .tiff 图片类型
197
+ * 12:文件消息
198
+ * 13:音频消息
199
+ * 14:视频消息
200
+ * 30:系统消息
201
+ * 31:系统消息
202
+ * 100:合并消息
203
+ * 200:自定义消息
204
+ * 32:Tips 消息
205
+ * 10:组合消息,可用于发送文本、富媒体文件、自定义消息的组合消息。
206
+ *
207
+ */
208
+ type: string
209
+ /**
210
+ * 消息拓展
211
+ */
212
+ extendedData: string
213
+ /**
214
+ * 消息 id
215
+ */
216
+ messageID: string
217
+ /**
218
+ * 排序 key
219
+ */
220
+ orderKey: string
221
+ /**
222
+ * 客户端 id
223
+ */
224
+ clientSid: string
225
+ /**
226
+ * 消息表 id
227
+ */
228
+ localMessageID: string
229
+ /**
230
+ * 会话 id
231
+ */
232
+ conversationID: string
233
+ /**
234
+ * 会话类型
235
+ */
236
+ conversationType: number
237
+ /**
238
+ * 发送者 id
239
+ */
240
+ senderUserID: string
241
+ /**
242
+ * 0 发送 1 接收
243
+ */
244
+ direction: number
245
+ /**
246
+ * 消息发送时间戳
247
+ */
248
+ timestamp: string
249
+ /**
250
+ * 0 不是回执。1 回执进行中。2 回执已完成。3 回执已过期。4 回执已失败。
251
+ */
252
+ receiptStatus: number
253
+ /**
254
+ * 是否服务端发送消息
255
+ */
256
+ isServerMessage: boolean
257
+ /**
258
+ * 是否是全员推送消息
259
+ */
260
+ isBroadcastMessage: boolean
261
+ /**
262
+ * 标识该消息是否为群定向消息
263
+ */
264
+ isGroupTargetedMessage: string
265
+ /**
266
+ * id
267
+ */
268
+ id: string
269
+ /**
270
+ * 文件下载地址
271
+ */
272
+ fileDownloadUrl: string
273
+ /**
274
+ * 如果是视频/语音,时长
275
+ */
276
+ duration: string
277
+ /**
278
+ * 文件名字
279
+ */
280
+ fileName: string
281
+ /**
282
+ * 缩略图
283
+ */
284
+ thumbnailDownloadUrl: string
285
+ /**
286
+ * 缩略图宽度
287
+ */
288
+ thumbnailWidth: string
289
+ /**
290
+ * 缩略图高度
291
+ */
292
+ thumbnailHeight: string
293
+ }
294
+
295
+ interface IConversation {
296
+ conversationID?: string;
297
+ conversationName?: string;
298
+ type?: number;
299
+ unreadMessageCount?: number;
300
+ notificationStatus?: number;
301
+ isPinned?: boolean;
302
+ }
303
+ interface ApiResponse {
304
+ code: string;
305
+ message: string;
306
+ data: string;
307
+ }
308
+ interface MentionedInfoList {
309
+ messageID: string;
310
+ fromUserID: string;
311
+ type: string;
312
+ messageSeq: number;
313
+ }
314
+ interface LastMessageData {
315
+ /**
316
+ * 标识这条消息的唯一 ID。
317
+ */
318
+ msgId: string;
319
+ /**
320
+ * 1:普通文本消息
321
+ * 2:自定义二进制消息,可用于传递自定义的二进制消息。该消息类型不支持离线消息和本地存储。
322
+ * 0:未知类型
323
+ * 20:弹幕消息,可用于直播间发送的弹幕
324
+ * 11:图片消息,可用于发送图片消息,仅支持 .jpg, .jpeg, .png, .bmp, .gif, .tiff 图片类型
325
+ * 12:文件消息
326
+ * 13:音频消息
327
+ * 14:视频消息
328
+ * 30:系统消息
329
+ * 31:系统消息
330
+ * 100:合并消息
331
+ * 200:自定义消息
332
+ * 32:Tips 消息
333
+ * 10:组合消息,可用于发送文本、富媒体文件、自定义消息的组合消息。
334
+ *
335
+ */
336
+ type: string;
337
+ /**
338
+ * * 详情描述:标识一条消息的发送时间。
339
+ */
340
+ timestamp: number;
341
+ /**
342
+ * 展示本条消息发送者的 userID
343
+ */
344
+ fromUserId: string;
345
+ /**
346
+ * 会话 id
347
+ */
348
+ conversationID: string;
349
+ /**
350
+ * 0-发送,1-接收
351
+ */
352
+ direction: number;
353
+ /**
354
+ * 0-发送中,1-发送成功,2-发送失败
355
+ */
356
+ sentStatus: number;
357
+ /**
358
+ * 0 单聊会话 1 房间会话 2 群聊会话 3 未知
359
+ */
360
+ conversationType: number;
361
+ /**
362
+ * orderKey 越大消息越新,可用于消息排序。
363
+ */
364
+ orderKey: number;
365
+ /**
366
+ * SDK 本地生成的 MessageID,开发者无需关注。
367
+ */
368
+ localMessageID: string;
369
+ /**
370
+ * 0-不是回执。,1-回执进行中。2-回执已完成。3-回执已过期。3-回执已失败。
371
+ */
372
+ receiptStatus: number;
373
+ /**
374
+ * 消息拓展字段。
375
+ */
376
+ extendedData: string;
377
+ /**
378
+ * 该消息是否是全员推送消息。
379
+ */
380
+ isBroadcastMessage: boolean;
381
+ /**
382
+ * 是否需要提醒所有人。业务表现可为“@所有人”。
383
+ */
384
+ isMentionAll: boolean;
385
+ /**
386
+ * 提醒一批相关的用户。业务表现可为“@某用户” 。
387
+ */
388
+ mentionedUserIDs: string[];
389
+ /**
390
+ * 回复消息树对应的根消息的回复消息数量。
391
+ */
392
+ rootRepliedCount: number;
393
+ /**
394
+ * 回复消息引用的源消息的信息。
395
+ */
396
+ repliedInfo: string;
397
+ /**
398
+ * 该消息的最后一次置顶的置顶者。
399
+ */
400
+ pinnedUserID: string;
401
+ /**
402
+ * 该消息最后一次置顶的置顶时间。
403
+ */
404
+ pinnedTime: number;
405
+ /**
406
+ * 消息内容
407
+ */
408
+ message: string;
409
+ }
410
+ interface ConversationItem {
411
+ conversationID: string;
412
+ conversationName: string;
413
+ type: number;
414
+ unreadMessageCount: number;
415
+ lastMessage: LastMessageData;
416
+ orderKey: number;
417
+ notificationStatus: string;
418
+ conversationAvatarUrl: string;
419
+ isPinned: boolean;
420
+ mentionedInfoList: MentionedInfoList[];
421
+ conversationAlias: string;
422
+ draft: string;
423
+ }
424
+
425
+ interface queryHistoryMessageParams {
426
+ conversationID: string;
427
+ conversationType: string;
428
+ config: {
429
+ nextMessage?: {
430
+ type: string;
431
+ messageID: string;
432
+ };
433
+ count: number | string;
434
+ reverse?: boolean;
435
+ };
436
+ }
437
+ interface ZIMMessageItem {
438
+ /**
439
+ * 消息类型。
440
+ */
441
+ type: string;
442
+ /**
443
+ * 消息的唯一 ID
444
+ */
445
+ messageID: string;
446
+ /**
447
+ * 消息的发送时间。
448
+ */
449
+ timestamp: number;
450
+ /**
451
+ * 消息发送者的 userID。
452
+ */
453
+ senderUserID: string;
454
+ /**
455
+ * 会话的 ID,相同会话类型下的 ID 是唯一的。
456
+ */
457
+ conversationID: string;
458
+ /**
459
+ * 用于描述消息的方向是发送还是接收。0 消息已发送。1 消息已接受。
460
+ */
461
+ direction: number;
462
+ /**
463
+ * 描述消息的发送状态。消息发送中。1 消息发送成功。2 消息发送失败。
464
+ */
465
+ sentStatus: number;
466
+ /**
467
+ * 该消息所属会话的类型。
468
+ */
469
+ conversationType: number;
470
+ /**
471
+ * 表示该消息在会话中的序号。
472
+ */
473
+ conversationSeq: string;
474
+ /**
475
+ * orderKey 越大消息越新,可用于消息排序。
476
+ */
477
+ orderKey: string;
478
+ /**
479
+ * 描述该消息的回执状态。0 不是回执。1 回执进行中。2 回执已完成。3 回执已过期。4 回执已失败。
480
+ */
481
+ receiptStatus: number;
482
+ /**
483
+ * 该消息是否是全员推送消息。
484
+ */
485
+ isBroadcastMessage: string;
486
+ /**
487
+ * 是否需要提醒所有人。业务表现可为“@所有人”。
488
+ */
489
+ isMentionAll: boolean;
490
+ /**
491
+ * 提醒一批相关的用户。业务表现可为“@某用户”。
492
+ */
493
+ mentionedUserIDs: string[];
494
+ /**
495
+ * 本条消息最新的编辑者的 userID。
496
+ */
497
+ editorUserID: string;
498
+ /**
499
+ * 本条消息最新的编辑时间戳。
500
+ */
501
+ editedTime: string;
502
+ /**
503
+ * 该消息最后一次置顶的置顶时间。
504
+ */
505
+ pinnedTime: string;
506
+ /**
507
+ * 该消息的最后一次置顶的置顶者。
508
+ */
509
+ pinnedUserID: string;
510
+ /**
511
+ * 消息记录
512
+ */
513
+ message: string;
514
+ /**
515
+ * 文件下载地址 (多媒体消息会有记录)
516
+ */
517
+ fileDownloadUrl: string;
518
+ /**
519
+ * 如果是视频/语音,时长(多媒体消息会有记录)
520
+ */
521
+ duration: string;
522
+ /**
523
+ * 文件名字 (多媒体消息会有记录)
524
+ */
525
+ fileName: string;
526
+ /**
527
+ * 缩略图 (多媒体消息会有记录)
528
+ */
529
+ thumbnailDownloadUrl: string;
530
+ /**
531
+ * 缩略图宽度 (多媒体消息会有记录)
532
+ */
533
+ thumbnailWidth: string;
534
+ /**
535
+ * 缩略图高度 (多媒体消息会有记录)
536
+ */
537
+ thumbnailHeight: string;
538
+ }
539
+ interface ZIMMessageQueriedResult {
540
+ messageList: ZIMMessageItem[];
541
+ conversationID: string;
542
+ conversationType: string;
543
+ }
544
+ declare enum ZIMConversationType {
545
+ Unknown = -1,
546
+ Peer = 0,
547
+ Room = 1,
548
+ Group = 2
549
+ }
550
+ declare enum SEDMessageType$1 {
551
+ Unknown = "0",
552
+ Command = "2",
553
+ Barrage = "20",
554
+ Text = "1",
555
+ Image = "11",
556
+ File = "12",
557
+ Audio = "13",
558
+ Video = "14",
559
+ System = "30",
560
+ Revoke = "31",
561
+ Tips = "32",
562
+ Combine = "100",
563
+ Custom = "200"
564
+ }
565
+ interface ZIMSEDMessage {
566
+ message: string;
567
+ type: SEDMessageType$1;
568
+ /**
569
+ * 自定义的拓展字段
570
+ */
571
+ extendedData: string;
572
+ }
573
+ interface ZIMSEDMediaMessage {
574
+ message: string;
575
+ type: SEDMessageType$1;
576
+ /**
577
+ * 自定义的拓展字段
578
+ */
579
+ extendedData: string;
580
+ file?: File;
581
+ thumbnailHeight?: string;
582
+ thumbnailWidth?: string;
583
+ duration?: string;
584
+ thumbnailDownloadUrl?: string;
585
+ fileDownloadUrl?: string;
586
+ fileName?: string;
587
+ fileSize?: string;
588
+ }
589
+ interface ZIMMessageSeDResult {
590
+ /**
591
+ * 消息
592
+ */
593
+ massage: string;
594
+ /**
595
+ * 消息类型:
596
+ * 1:普通文本消息
597
+ * 2:自定义二进制消息,可用于传递自定义的二进制消息。该消息类型不支持离线消息和本地存储。
598
+ * 0:未知类型
599
+ * 20:弹幕消息,可用于直播间发送的弹幕
600
+ * 11:图片消息,可用于发送图片消息,仅支持 .jpg, .jpeg, .png, .bmp, .gif, .tiff 图片类型
601
+ * 12:文件消息
602
+ * 13:音频消息
603
+ * 14:视频消息
604
+ * 30:系统消息
605
+ * 31:系统消息
606
+ * 100:合并消息
607
+ * 200:自定义消息
608
+ * 32:Tips 消息
609
+ * 10:组合消息,可用于发送文本、富媒体文件、自定义消息的组合消息。
610
+ *
611
+ */
612
+ type: SEDMessageType$1;
613
+ /**
614
+ * 消息拓展
615
+ */
616
+ extendedData: string;
617
+ /**
618
+ * 消息 id
619
+ */
620
+ messageID: string;
621
+ /**
622
+ * 排序 key
623
+ */
624
+ orderKey: string;
625
+ /**
626
+ * 客户端 id
627
+ */
628
+ clientSid: string;
629
+ /**
630
+ * 消息表 id
631
+ */
632
+ localMessageID: string;
633
+ /**
634
+ * 会话 id
635
+ */
636
+ conversationID: string;
637
+ /**
638
+ * 会话类型
639
+ */
640
+ conversationType: ZIMConversationType;
641
+ /**
642
+ * 发送者 id
643
+ */
644
+ senderUserID: string;
645
+ /**
646
+ * 0 发送 1 接收
647
+ */
648
+ direction: number;
649
+ /**
650
+ * 消息发送时间戳
651
+ */
652
+ timestamp: string;
653
+ /**
654
+ * 0 不是回执。1 回执进行中。2 回执已完成。3 回执已过期。4 回执已失败。
655
+ */
656
+ receiptStatus: number;
657
+ /**
658
+ * 是否服务端发送消息
659
+ */
660
+ isServerMessage: boolean;
661
+ /**
662
+ * 是否是全员推送消息
663
+ */
664
+ isBroadcastMessage: boolean;
665
+ /**
666
+ * 标识该消息是否为群定向消息
667
+ */
668
+ isGroupTargetedMessage: string;
669
+ /**
670
+ * id
671
+ */
672
+ id: string;
673
+ }
674
+ interface ZIMMessageRevokeConfig {
675
+ revokeExtendedData?: string;
676
+ }
677
+
678
+ interface ZIM {
679
+ create(): Promise<void>;
680
+ logout(): Promise<boolean>;
681
+ isConnected(): boolean;
682
+ on(event: string, handler: (...args: any[]) => void): void;
683
+ off(event: string, handler?: (...args: any[]) => void): void;
684
+ login(values: {
685
+ token: string;
686
+ }): Promise<boolean>;
687
+ queryConversation(params: {
688
+ count: number;
689
+ nextConversation: IConversation | undefined;
690
+ conversationName?: string;
691
+ }): Promise<ConversationItem[]>;
692
+ deleteAllConversations(): Promise<ApiResponse>;
693
+ deleteConversation(params: {
694
+ conversationID: string;
695
+ conversationType: ZIMConversationType;
696
+ config?: boolean;
697
+ }): Promise<IYapiPostSdkDeleteConversationApiResponse>;
698
+ clearConversationTotalUnreadMessageCount(): Promise<IYapiPostSdkClearConversationTotalUnreadMessageCountApiResponse>;
699
+ clearConversationUnreadMessageCount(conversationID: string, conversationType: ZIMConversationType): Promise<IYapiPostSdkClearConversationUnreadMessageCountApiResponse>;
700
+ queryHistoryMessage(params: queryHistoryMessageParams): Promise<ZIMMessageQueriedResult>;
701
+ sendMessage(params: {
702
+ message: ZIMSEDMessage;
703
+ toConversationID: string;
704
+ conversationType: ZIMConversationType;
705
+ }): Promise<ZIMMessageSeDResult>;
706
+ sendMediaMessage(params: {
707
+ message: ZIMSEDMediaMessage;
708
+ toConversationID: string;
709
+ conversationType: ZIMConversationType;
710
+ }): Promise<IYapiPostSdkSendMediaMessageApiResponse['data']>;
711
+ deleteAllConversationMessages(): Promise<{
712
+ code: string;
713
+ message: string;
714
+ data: string;
715
+ }>;
716
+ deleteAllMessage(conversationID: string, conversationType: ZIMConversationType): Promise<{
717
+ code: string;
718
+ message: string;
719
+ data: string;
720
+ }>;
721
+ deleteMessages(conversationID: string, conversationType: ZIMConversationType, messageList: {
722
+ messageID: string;
723
+ type: string;
724
+ }[]): Promise<{
725
+ code: string;
726
+ message: string;
727
+ data: string;
728
+ }>;
729
+ revokeMessage(message: {
730
+ messageID: string;
731
+ type: number;
732
+ }, config?: ZIMMessageRevokeConfig): Promise<{
733
+ code: string;
734
+ message: string;
735
+ data: string;
736
+ }>;
737
+ sendMessageReceiptsRead(conversationID: string, conversationType: ZIMConversationType, messageList: string[]): Promise<YapiPostSdkSendMessageReceiptsReadApiResponse>;
738
+ queryMessageReceiptsInfo(conversationID: string, conversationType: ZIMConversationType, messageList: string[]): Promise<YapiPostSdkQueryMessageReceiptsInfoApiResponse>;
739
+ queryGroupMessageReceiptUnreadMemberList(groupID: string, config: {
740
+ count: string;
741
+ nextFlag: string;
742
+ }, message: {
743
+ messageID: string;
744
+ }): Promise<YapiPostSdkQueryGroupMessageReceiptUnreadMemberListApiResponse>;
745
+ queryGroupMessageReceiptReadMemberList(groupID: string, config: {
746
+ count: string;
747
+ nextFlag: string;
748
+ }, message: {
749
+ messageID: string;
750
+ }): Promise<YapiPostSdkQueryGroupMessageReceiptReadMemberListApiResponse>;
751
+ }
752
+
753
+ interface IYapiPostSdkQueryConversationApiRequest {
754
+ nextConversation?: IYapiPostSdkQueryConversationApiRequestNextConversation
755
+
756
+ count: number
757
+ conversationName?: string
758
+ }
759
+
760
+ interface IYapiPostSdkQueryConversationApiRequestNextConversation {
761
+
762
+ conversationID?: string
763
+ }
764
+
765
+ interface IYapiPostSdkDeleteAllConversationsApiResponse {
766
+ code: string
767
+ message: string
768
+ data: string
769
+ }
770
+
771
+ /**
772
+ * 查询会话列表
773
+ * @param payload 查询参数
774
+ * @returns 会话列表数据
775
+ */
776
+ declare function queryConversation(payload: IYapiPostSdkQueryConversationApiRequest): Promise<ConversationItem[]>;
777
+ /**
778
+ * 删除全部会话
779
+ * @param payload 删除参数
780
+ * @returns 删除结果
781
+ */
782
+ declare function deleteAllConversations(): Promise<IYapiPostSdkDeleteAllConversationsApiResponse>;
783
+ /**
784
+ * 删除单个会话
785
+ * @param payload 删除参数 (需要 conversationID, conversationType, config)
786
+ * @returns 删除结果
787
+ */
788
+ declare function deleteConversation(payload: IYapiPostSdkDeleteConversationApiRequest): Promise<IYapiPostSdkDeleteConversationApiResponse>;
789
+ /**
790
+ * 清除全部会话未读数
791
+ * @param payload 清除参数(无需要参数)
792
+ * @returns 清除结果
793
+ */
794
+ declare function clearConversationTotalUnreadMessageCount(): Promise<IYapiPostSdkClearConversationTotalUnreadMessageCountApiResponse>;
795
+ /**
796
+ * 清除单个会话未读数
797
+ * @param payload 清除参数 (需要 conversationID, conversationType)
798
+ * @returns 清除结果
799
+ */
800
+ declare function clearConversationUnreadMessageCount(conversationID: string, conversationType: string | number): Promise<IYapiPostSdkClearConversationUnreadMessageCountApiResponse>;
801
+
802
+ declare function initSocket(): Promise<void>;
803
+ declare function isSocketConnected(): boolean;
804
+ declare function on(event: string, handler: (...args: any[]) => void): void;
805
+ declare function off(event: string, handler?: (...args: any[]) => void): void;
806
+
807
+ interface IYapiPostSdkLoginApiRequest {
808
+ token: string;
809
+ }
810
+
811
+ declare function login(payload: IYapiPostSdkLoginApiRequest): Promise<boolean>;
812
+ declare function logout(disconnect?: boolean): Promise<boolean>;
813
+
814
+ interface IYapiPostSdkSendMessageApiRequest {
815
+ message: IYapiPostSdkSendMessageApiRequestMessage
816
+ /**
817
+ * 消息需要发送的会话 ID。
818
+ */
819
+ toConversationID: string
820
+ /**
821
+ * 类型。Peer=(0) 单聊会话。Room=(1) 房间会话。Group=(2) 群聊会话。Unknown=(3) 未知。
822
+ */
823
+ conversationType: number
824
+ }
825
+
826
+ interface IYapiPostSdkSendMessageApiRequestMessage {
827
+ /**
828
+ * 消息内容
829
+ */
830
+ message: string
831
+ /**
832
+ * 消息类型:
833
+ * 1:普通文本消息
834
+ * 2:自定义二进制消息,可用于传递自定义的二进制消息。该消息类型不支持离线消息和本地存储。
835
+ * 0:未知类型
836
+ * 20:弹幕消息,可用于直播间发送的弹幕
837
+ * 11:图片消息,可用于发送图片消息,仅支持 .jpg, .jpeg, .png, .bmp, .gif, .tiff 图片类型
838
+ * 12:文件消息
839
+ * 13:音频消息
840
+ * 14:视频消息
841
+ * 30:系统消息
842
+ * 31:系统消息
843
+ * 100:合并消息
844
+ * 200:自定义消息
845
+ * 32:Tips 消息
846
+ * 10:组合消息,可用于发送文本、富媒体文件、自定义消息的组合消息。
847
+ *
848
+ */
849
+ type: string
850
+ /**
851
+ * 自定义的拓展字段
852
+ */
853
+ extendedData: string
854
+ }
855
+ declare enum SEDMessageType {
856
+ Unknown = '0',
857
+ Command = '2',
858
+ Barrage = '20',
859
+ Text = '1',
860
+ Image = '11',
861
+ File = '12',
862
+ Audio = '13',
863
+ Video = '14',
864
+ System = '30',
865
+ Revoke = '31',
866
+ Tips = '32',
867
+ Combine = '100',
868
+ Custom = '200'
869
+ }
870
+ interface YapiPostSdkSendMessageMessage {
871
+ /**
872
+ * 消息
873
+ */
874
+ massage: string
875
+ /**
876
+ * 消息类型:
877
+ * 1:普通文本消息
878
+ * 2:自定义二进制消息,可用于传递自定义的二进制消息。该消息类型不支持离线消息和本地存储。
879
+ * 0:未知类型
880
+ * 20:弹幕消息,可用于直播间发送的弹幕
881
+ * 11:图片消息,可用于发送图片消息,仅支持 .jpg, .jpeg, .png, .bmp, .gif, .tiff 图片类型
882
+ * 12:文件消息
883
+ * 13:音频消息
884
+ * 14:视频消息
885
+ * 30:系统消息
886
+ * 31:系统消息
887
+ * 100:合并消息
888
+ * 200:自定义消息
889
+ * 32:Tips 消息
890
+ * 10:组合消息,可用于发送文本、富媒体文件、自定义消息的组合消息。
891
+ *
892
+ */
893
+ type: SEDMessageType
894
+ /**
895
+ * 消息拓展
896
+ */
897
+ extendedData: string
898
+ /**
899
+ * 消息 id
900
+ */
901
+ messageID: string
902
+ /**
903
+ * 排序 key
904
+ */
905
+ orderKey: string
906
+ /**
907
+ * 客户端 id
908
+ */
909
+ clientSid: string
910
+ /**
911
+ * 消息表 id
912
+ */
913
+ localMessageID: string
914
+ /**
915
+ * 会话 id
916
+ */
917
+ conversationID: string
918
+ /**
919
+ * 会话类型
920
+ */
921
+ conversationType: number
922
+ /**
923
+ * 发送者 id
924
+ */
925
+ senderUserID: string
926
+ /**
927
+ * 0 发送 1 接收
928
+ */
929
+ direction: number
930
+ /**
931
+ * 消息发送时间戳
932
+ */
933
+ timestamp: string
934
+ /**
935
+ * 0 不是回执。1 回执进行中。2 回执已完成。3 回执已过期。4 回执已失败。
936
+ */
937
+ receiptStatus: number
938
+ /**
939
+ * 是否服务端发送消息
940
+ */
941
+ isServerMessage: boolean
942
+ /**
943
+ * 是否是全员推送消息
944
+ */
945
+ isBroadcastMessage: boolean
946
+ /**
947
+ * 标识该消息是否为群定向消息
948
+ */
949
+ isGroupTargetedMessage: string
950
+ /**
951
+ * id
952
+ */
953
+ id: string
954
+ }
955
+
956
+ interface IYapiPostSdkSendMessageApiResponse {
957
+ code: string
958
+ message: string
959
+ data: YapiPostSdkSendMessageMessage
960
+ }
961
+
962
+ interface IYapiPostSdkQueryHistoryMessageApiRequest {
963
+
964
+ conversationID: string
965
+
966
+ conversationType: string
967
+ config: IYapiPostSdkQueryHistoryMessageApiRequestConfig
968
+ }
969
+ interface IYapiPostSdkQueryHistoryMessageApiRequestConfig {
970
+ nextMessage?: IYapiPostSdkQueryHistoryMessageApiRequestNextMessageConfig
971
+
972
+ count: string
973
+
974
+ reverse?: boolean
975
+ }
976
+
977
+ interface IYapiPostSdkQueryHistoryMessageApiRequestNextMessageConfig {
978
+
979
+ type: string
980
+
981
+ messageID: string
982
+ }
983
+
984
+
985
+ interface IYapiPostSdkQueryHistoryMessageApiResponse {
986
+ code: string
987
+ message: string
988
+ data: IYapiPostSdkQueryHistoryMessageData
989
+ }
990
+ interface IYapiPostSdkQueryHistoryMessageData {
991
+ messageList: YapiPostSdkQueryHistoryMessageListMessageListData[]
992
+
993
+ conversationID: string
994
+
995
+ conversationType: string
996
+ }
997
+ interface YapiPostSdkQueryHistoryMessageListMessageListData {
998
+ /**
999
+ * 消息类型。
1000
+ */
1001
+ type: string
1002
+ /**
1003
+ * 消息的唯一 ID
1004
+ */
1005
+ messageID: string
1006
+ /**
1007
+ * 消息的发送时间。
1008
+ */
1009
+ timestamp: number
1010
+ /**
1011
+ * 消息发送者的 userID。
1012
+ */
1013
+ senderUserID: string
1014
+ /**
1015
+ * 会话的 ID,相同会话类型下的 ID 是唯一的。
1016
+ */
1017
+ conversationID: string
1018
+ /**
1019
+ * 用于描述消息的方向是发送还是接收。0 消息已发送。1 消息已接受。
1020
+ */
1021
+ direction: number
1022
+ /**
1023
+ * 描述消息的发送状态。消息发送中。1 消息发送成功。2 消息发送失败。
1024
+ */
1025
+ sentStatus: number
1026
+ /**
1027
+ * 该消息所属会话的类型。
1028
+ */
1029
+ conversationType: number
1030
+ /**
1031
+ * 表示该消息在会话中的序号。
1032
+ */
1033
+ conversationSeq: string
1034
+ /**
1035
+ * orderKey 越大消息越新,可用于消息排序。
1036
+ */
1037
+ orderKey: string
1038
+ /**
1039
+ * 描述该消息的回执状态。0 不是回执。1 回执进行中。2 回执已完成。3 回执已过期。4 回执已失败。
1040
+ */
1041
+ receiptStatus: number
1042
+ /**
1043
+ * 该消息是否是全员推送消息。
1044
+ */
1045
+ isBroadcastMessage: string
1046
+ /**
1047
+ * 是否需要提醒所有人。业务表现可为“@所有人”。
1048
+ */
1049
+ isMentionAll: boolean
1050
+ /**
1051
+ * 提醒一批相关的用户。业务表现可为“@某用户”。
1052
+ */
1053
+ mentionedUserIDs: string[]
1054
+ /**
1055
+ * 本条消息最新的编辑者的 userID。
1056
+ */
1057
+ editorUserID: string
1058
+ /**
1059
+ * 本条消息最新的编辑时间戳。
1060
+ */
1061
+ editedTime: string
1062
+ /**
1063
+ * 该消息最后一次置顶的置顶时间。
1064
+ */
1065
+ pinnedTime: string
1066
+ /**
1067
+ * 该消息的最后一次置顶的置顶者。
1068
+ */
1069
+ pinnedUserID: string
1070
+ /**
1071
+ * 消息记录
1072
+ */
1073
+ message: string
1074
+ /**
1075
+ * 文件下载地址 (多媒体消息会有记录)
1076
+ */
1077
+ fileDownloadUrl: string
1078
+ /**
1079
+ * 如果是视频/语音,时长(多媒体消息会有记录)
1080
+ */
1081
+ duration: string
1082
+ /**
1083
+ * 文件名字 (多媒体消息会有记录)
1084
+ */
1085
+ fileName: string
1086
+ /**
1087
+ * 缩略图 (多媒体消息会有记录)
1088
+ */
1089
+ thumbnailDownloadUrl: string
1090
+ /**
1091
+ * 缩略图宽度 (多媒体消息会有记录)
1092
+ */
1093
+ thumbnailWidth: string
1094
+ /**
1095
+ * 缩略图高度 (多媒体消息会有记录)
1096
+ */
1097
+ thumbnailHeight: string
1098
+ }
1099
+
1100
+ interface IYapiPostSdkDeleteAllConversationMessagesApiResponse {
1101
+ code: string
1102
+ message: string
1103
+ data: string
1104
+ }
1105
+
1106
+ interface IYapiPostSdkDeleteMessagesApiResponse {
1107
+ code: string
1108
+ message: string
1109
+ data: string
1110
+ }
1111
+
1112
+ interface IYapiPostSdkRevokeMessageApiRequest {
1113
+ message: IYapiPostSdkRevokeMessageApiRequestMessage
1114
+
1115
+ config?: YapiPostSdkRevokeMessageApiRequestConfig
1116
+ }
1117
+
1118
+ interface YapiPostSdkRevokeMessageApiRequestConfig {
1119
+ revokeExtendedData: string
1120
+ }
1121
+
1122
+ interface IYapiPostSdkRevokeMessageApiRequestMessage {
1123
+
1124
+ type?: number
1125
+
1126
+ messageID?: string
1127
+ }
1128
+
1129
+
1130
+ interface IYapiPostSdkRevokeMessageApiResponse {
1131
+ code: string
1132
+ message: string
1133
+ data: string
1134
+ }
1135
+
1136
+ /**
1137
+ * 发送消息
1138
+ * @param payload 发送消息参数
1139
+ * @returns 发送结果
1140
+ */
1141
+ declare function sendMessage(payload: IYapiPostSdkSendMessageApiRequest): Promise<IYapiPostSdkSendMessageApiResponse['data']>;
1142
+ /**
1143
+ * 发送媒体消息
1144
+ * @param payload 发送媒体消息参数
1145
+ * @returns 发送结果
1146
+ */
1147
+ declare function sendMediaMessage(payload: {
1148
+ message: ZIMSEDMediaMessage;
1149
+ toConversationID: string;
1150
+ conversationType: ZIMConversationType;
1151
+ }): Promise<IYapiPostSdkSendMediaMessageApiResponse['data']>;
1152
+ /**
1153
+ * 查询历史消息
1154
+ * @param payload 查询参数
1155
+ * @returns 历史消息列表
1156
+ */
1157
+ declare function queryHistoryMessage(payload: IYapiPostSdkQueryHistoryMessageApiRequest): Promise<IYapiPostSdkQueryHistoryMessageApiResponse['data']>;
1158
+ /**
1159
+ * 删除所有会话的所有消息
1160
+ * @param payload 删除参数
1161
+ * @returns 删除结果
1162
+ */
1163
+ declare function deleteAllConversationMessages(): Promise<IYapiPostSdkDeleteAllConversationMessagesApiResponse>;
1164
+ /**
1165
+ * 删除消息
1166
+ * @param payload 删除消息参数
1167
+ * @returns 删除结果
1168
+ */
1169
+ declare function deleteMessages(conversationID: string, conversationType: ZIMConversationType, messageList: {
1170
+ messageID: string;
1171
+ type: string;
1172
+ }[]): Promise<IYapiPostSdkDeleteMessagesApiResponse>;
1173
+ /**
1174
+ * 撤回消息
1175
+ * @param payload 撤回消息参数
1176
+ * @returns 撤回结果
1177
+ */
1178
+ declare function revokeMessage(message: IYapiPostSdkRevokeMessageApiRequest['message'], config?: IYapiPostSdkRevokeMessageApiRequest['config']): Promise<IYapiPostSdkRevokeMessageApiResponse>;
1179
+ declare function deleteAllMessage(conversationID: string, conversationType: ZIMConversationType): Promise<{
1180
+ code: string;
1181
+ message: string;
1182
+ data: string;
1183
+ }>;
1184
+
1185
+ declare function sendMessageReceiptsRead(conversationID: string, conversationType: ZIMConversationType, messageList: string[]): Promise<YapiPostSdkSendMessageReceiptsReadApiResponse>;
1186
+ declare function queryMessageReceiptsInfo(conversationID: string, conversationType: ZIMConversationType, messageList: string[]): Promise<YapiPostSdkQueryMessageReceiptsInfoApiResponse>;
1187
+ declare function queryGroupMessageReceiptUnreadMemberList(groupID: string, config: {
1188
+ count: string;
1189
+ nextFlag: string;
1190
+ }, message: {
1191
+ messageID: string;
1192
+ }): Promise<YapiPostSdkQueryGroupMessageReceiptUnreadMemberListApiResponse>;
1193
+ declare function queryGroupMessageReceiptReadMemberList(groupID: string, config: {
1194
+ count: string;
1195
+ nextFlag: string;
1196
+ }, message: {
1197
+ messageID: string;
1198
+ }): Promise<YapiPostSdkQueryGroupMessageReceiptReadMemberListApiResponse>;
1199
+
1200
+ declare const VanshiSdk: ZIM;
1201
+
1202
+ export { clearConversationTotalUnreadMessageCount, clearConversationUnreadMessageCount, initSocket as create, VanshiSdk as default, deleteAllConversationMessages, deleteAllConversations, deleteAllMessage, deleteConversation, deleteMessages, isSocketConnected as isConnected, login, logout, off, on, queryConversation, queryGroupMessageReceiptReadMemberList, queryGroupMessageReceiptUnreadMemberList, queryHistoryMessage, queryMessageReceiptsInfo, revokeMessage, sendMediaMessage, sendMessage, sendMessageReceiptsRead };