k2-im 0.1.19 → 0.1.21
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/README.md +36 -0
- package/dist/browser.js +1 -1
- package/dist/chat-kit-pinia.d.ts +349 -24
- package/dist/chat-kit-pinia.js +1 -1
- package/dist/chat-kit-vue.d.ts +92 -6
- package/dist/chat-kit-vue.js +1 -1
- package/dist/chat-kit.d.ts +429 -30
- package/dist/chat-kit.js +1 -1
- package/dist/chunk-2GZMQCIP.js +1 -0
- package/dist/chunk-4X7RCGEV.js +1 -0
- package/dist/chunk-5I7S6LWE.js +2 -0
- package/dist/chunk-A2BLOVZ5.js +2 -0
- package/dist/chunk-DN4H5C7G.js +2 -0
- package/dist/chunk-P4HOR4XO.js +1 -0
- package/dist/chunk-YAM4YHKF.js +7 -0
- package/dist/i18n.d.ts +140 -7
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +574 -38
- package/dist/index.js +1 -1
- package/dist/sdk.d.ts +377 -24
- package/dist/sdk.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-CD5SF7WI.js +0 -1
- package/dist/chunk-KLEMN4CG.js +0 -1
- package/dist/chunk-NBLASAT2.js +0 -2
- package/dist/chunk-NVF5RDHB.js +0 -2
- package/dist/chunk-ULJD6ZA3.js +0 -7
- package/dist/chunk-W2FKET4Z.js +0 -1
- package/dist/chunk-YPS6Y5ZY.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ interface ConversationDraft$1 {
|
|
|
52
52
|
updatedAt: number;
|
|
53
53
|
}
|
|
54
54
|
/** 消息内容类型。sticker=表情/贴图(BMessage contentType=7);call=单聊通话记录(contentType=10);transfer=转账(contentType=16);miniProgram=小程序分享卡(contentType=22);redPacket=红包卡(contentType=25);game=小游戏(contentType=27);未知 wire 正文统一归一为 unknown。 */
|
|
55
|
-
type MessageContentType = 'text' | 'system' | 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'contact' | 'miniProgram' | 'game' | 'transfer' | 'call' | 'redPacket' | 'unknown';
|
|
55
|
+
type MessageContentType = 'text' | 'system' | 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'contact' | 'miniProgram' | 'game' | 'transfer' | 'call' | 'redPacket' | 'mediaAlbum' | 'unknown';
|
|
56
56
|
/**
|
|
57
57
|
* 发送态(客户端态):消息从本地创建到服务端确认的生命周期。
|
|
58
58
|
* `uploading` 仅媒体消息使用:文件上传阶段(uploading→pending→sending→sent);
|
|
@@ -62,7 +62,7 @@ type MessageSendStatus = 'pending' | 'uploading' | 'sending' | 'sent' | 'failed'
|
|
|
62
62
|
/** 送达/已读态(服务端态):消息在对端的回执状态。 */
|
|
63
63
|
type MessageReceipt = 'unread' | 'delivered' | 'read';
|
|
64
64
|
/** 群系统提示事件类型(结构化语义;UI/i18n 层据此渲染文案,**不在 mapper 写死中文**)。 */
|
|
65
|
-
type ImSystemEventType = 'direct_contact_established' | 'direct_contact_required' | 'direct_message_refused' | 'group_info_changed' | 'group_activated' | 'group_member_joined' | 'group_member_invited' | 'group_member_left' | 'group_member_removed' | 'group_master_changed' | 'group_dismissed' | 'group_member_renamed' | 'group_message_pinned' | 'group_message_unpinned' | 'channel_name_changed' | 'channel_avatar_changed' | 'channel_announcement_changed' | 'channel_member_joined' | 'channel_member_invited' | 'channel_member_left' | 'channel_member_removed' | 'channel_owner_transferred' | 'channel_admin_added' | 'channel_admin_removed' | 'channel_dismissed' | 'channel_all_muted' | 'channel_all_unmuted' | 'channel_created' | 'channel_private_chat_disabled' | 'channel_private_chat_enabled' | 'channel_member_renamed' | 'channel_member_muted' | 'channel_member_unmuted' | 'channel_message_pinned' | 'channel_message_unpinned' | 'channel_unknown' | 'red_packet_claimed' | 'red_packet_claimed_thunder' | 'unknown';
|
|
65
|
+
type ImSystemEventType = 'direct_contact_established' | 'direct_contact_required' | 'direct_message_refused' | 'group_info_changed' | 'group_activated' | 'group_member_joined' | 'group_member_invited' | 'group_member_left' | 'group_member_removed' | 'group_master_changed' | 'group_dismissed' | 'group_member_renamed' | 'group_message_pinned' | 'group_message_unpinned' | 'group_call_started' | 'group_call_ended' | 'group_call_missed' | 'channel_name_changed' | 'channel_avatar_changed' | 'channel_announcement_changed' | 'channel_member_joined' | 'channel_member_invited' | 'channel_member_left' | 'channel_member_removed' | 'channel_owner_transferred' | 'channel_admin_added' | 'channel_admin_removed' | 'channel_dismissed' | 'channel_all_muted' | 'channel_all_unmuted' | 'channel_created' | 'channel_private_chat_disabled' | 'channel_private_chat_enabled' | 'channel_member_renamed' | 'channel_member_muted' | 'channel_member_unmuted' | 'channel_message_pinned' | 'channel_message_unpinned' | 'channel_unknown' | 'red_packet_claimed' | 'red_packet_claimed_thunder' | 'unknown';
|
|
66
66
|
/** 系统提示结构化内容(contentType==='system'):存语义,不把最终中文句子当主数据源(UI/composable 据 eventType + 资料生成文案)。 */
|
|
67
67
|
interface ImSystemMessageBody {
|
|
68
68
|
eventType: ImSystemEventType;
|
|
@@ -129,6 +129,23 @@ type LastMessageSummary = {
|
|
|
129
129
|
} | {
|
|
130
130
|
kind: 'voice';
|
|
131
131
|
durationMs?: number;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* 媒体合集(contentType 28)。
|
|
135
|
+
*
|
|
136
|
+
* 只给结构化计数与配文,**不在这里拼「2 张照片, 1 个视频」这种文案**——中英文的量词、复数与
|
|
137
|
+
* 连接符各不相同,必须由 im-i18n 按 locale 组装。`caption` 非空时宿主优先显示配文(对齐三端)。
|
|
138
|
+
*
|
|
139
|
+
* `firstItemKind` 是第一项是照片还是视频。有配文时列表显示的是配文,光看计数无法决定该配
|
|
140
|
+
* 照片图标还是视频图标,三端统一按第一项取(对齐 iOS `IMMediaAlbumMessageBody`)。
|
|
141
|
+
* 入站解析后所有项都被丢弃时缺省,宿主据此不显示类型图标。
|
|
142
|
+
*/
|
|
143
|
+
| {
|
|
144
|
+
kind: 'mediaAlbum';
|
|
145
|
+
imageCount: number;
|
|
146
|
+
videoCount: number;
|
|
147
|
+
caption?: string;
|
|
148
|
+
firstItemKind?: 'image' | 'video';
|
|
132
149
|
} | {
|
|
133
150
|
kind: 'encrypted';
|
|
134
151
|
} | {
|
|
@@ -431,6 +448,59 @@ interface UnknownMessageBody {
|
|
|
431
448
|
reason: 'unsupported-content-type' | 'malformed-content';
|
|
432
449
|
}
|
|
433
450
|
/** 按 contentType 的结构化内容体。 */
|
|
451
|
+
/**
|
|
452
|
+
* 媒体合集单项:一张图片或一个视频。
|
|
453
|
+
*
|
|
454
|
+
* 对应协议 `content` JSON 里 `items[]` 的一个元素(wire `mediaType` 1=图片 2=视频)。
|
|
455
|
+
* 与 `ImImageBody` / `ImVideoBody` 的区别是它**不是**独立的一条消息——同一条合集消息里的
|
|
456
|
+
* 若干项共享消息级的撤回、已读、引用与转发语义。
|
|
457
|
+
*/
|
|
458
|
+
interface ImMediaAlbumItem {
|
|
459
|
+
/** 该项是图片还是视频;由协议 `mediaType` 归一而来,未知取值的项在解析阶段已被丢弃。 */
|
|
460
|
+
kind: 'image' | 'video';
|
|
461
|
+
/** 远端地址。加密项也是这个地址,解密用本项自己的 `teaKey`。 */
|
|
462
|
+
url: string;
|
|
463
|
+
/** 原始像素宽。宫格按它判定朝向,为 0 时宿主用兜底几何。 */
|
|
464
|
+
width: number;
|
|
465
|
+
/** 原始像素高。 */
|
|
466
|
+
height: number;
|
|
467
|
+
/**
|
|
468
|
+
* 视频时长,**毫秒**。
|
|
469
|
+
*
|
|
470
|
+
* 协议 `items[].duration` 本身就是毫秒,这里不做换算——注意这与单视频消息
|
|
471
|
+
* `ImVideoBody.duration`(秒)单位不同,所以刻意用 `durationMs` 命名区分。图片项没有此字段。
|
|
472
|
+
*/
|
|
473
|
+
durationMs?: number;
|
|
474
|
+
/** 远端缩略图地址;可能缺省,此时只能用 `thumbData`。 */
|
|
475
|
+
thumbUrl?: string;
|
|
476
|
+
/** 内嵌缩略图/封面 JPEG 字节。加密消息服务端出不了封面,宫格首屏只能靠它。 */
|
|
477
|
+
thumbData?: Uint8Array;
|
|
478
|
+
/** 原文件 MD5。 */
|
|
479
|
+
md5?: string;
|
|
480
|
+
/** 原文件大小(字节)。 */
|
|
481
|
+
size?: number;
|
|
482
|
+
/** 本项的文件解密 TEA key;`fileEncryptType` 为 0/2/3 时必有。 */
|
|
483
|
+
teaKey?: Uint8Array;
|
|
484
|
+
/** 文件加密类型:0=跟随消息 1=不加密 2=前 32 字节 TEA 3=完整 TEA。 */
|
|
485
|
+
fileEncryptType?: number;
|
|
486
|
+
/** 发送方勾选了「原图」。仅作展示角标,不影响下载与解密。 */
|
|
487
|
+
hd?: boolean;
|
|
488
|
+
}
|
|
489
|
+
/**
|
|
490
|
+
* 媒体合集正文(`contentType === 'mediaAlbum'`,协议 28)。
|
|
491
|
+
*
|
|
492
|
+
* 一条消息同时承载一段可选配文和 1–9 个图片/视频项。产品上的「图文消息」就是
|
|
493
|
+
* `items.length === 1 && caption` 非空的情形,所以**分档判断一律看 `items.length`,不要看 contentType**。
|
|
494
|
+
*
|
|
495
|
+
* `items` 为空数组只会出现在入站解析残缺时(所有项的 `mediaType` 都不认识,或都无法解密);
|
|
496
|
+
* 这种正文不可出站——出站编码会显式拒绝,避免把坏消息转发出去。
|
|
497
|
+
*/
|
|
498
|
+
interface ImMediaAlbumBody {
|
|
499
|
+
/** 配文;缺省与空串等价,出站不写空串。 */
|
|
500
|
+
caption?: string;
|
|
501
|
+
/** 媒体项,顺序即用户选择顺序(决定宫格 index 与首项朝向)。 */
|
|
502
|
+
items: readonly ImMediaAlbumItem[];
|
|
503
|
+
}
|
|
434
504
|
interface ImMessageBody {
|
|
435
505
|
/** P0 文本内容(明文,解密后的结果)。 */
|
|
436
506
|
text?: string;
|
|
@@ -458,6 +528,8 @@ interface ImMessageBody {
|
|
|
458
528
|
call?: ImCallRecordBody;
|
|
459
529
|
/** contentType==='redPacket' 时的红包卡片。 */
|
|
460
530
|
redPacket?: ImRedPacketBody;
|
|
531
|
+
/** contentType==='mediaAlbum' 时的媒体合集正文(配文 + 1~9 个图片/视频项)。 */
|
|
532
|
+
mediaAlbum?: ImMediaAlbumBody;
|
|
461
533
|
/** contentType==='unknown' 时的稳定未知正文,不含原始 wire type。 */
|
|
462
534
|
unknown?: UnknownMessageBody;
|
|
463
535
|
}
|
|
@@ -492,7 +564,7 @@ type ImMessageFailureReason = 'timeout' | 'rejected' | 'encrypt_failed' | 'netwo
|
|
|
492
564
|
* 失败**展示语义**码(强类型枚举,非裸串):供 im-i18n 按 locale 渲染失败气泡文案。
|
|
493
565
|
* 由 `reason` / `SendMediaFailReason` / ACK errcode 穷尽映射而来,与 im-i18n failure catalog 键一一对应(media.* 带 mediaKind 参数)。
|
|
494
566
|
*/
|
|
495
|
-
type ImFailureDisplayCode = 'media.empty' | 'media.noCrypto' | 'media.previewFailed' | 'media.encryptFailed' | 'media.uploadFailed' | 'media.cancelled' | 'media.invalidDuration' | 'media.uploadInterrupted' | 'contactRequired' | 'messageRefused' | 'forbiddenOrLeft' | 'contentRejected' | 'groupDismissed' | 'groupUnavailable' | 'channelDismissed' | 'channelMuted' | 'channelNotMember' | 'channelAdminRequired' | 'conversationUnsupported' | 'sendCanceled' | 'sessionLoggedOut' | 'timeout' | 'network' | 'unknown';
|
|
567
|
+
type ImFailureDisplayCode = 'media.empty' | 'media.noCrypto' | 'media.previewFailed' | 'media.encryptFailed' | 'media.uploadFailed' | 'media.cancelled' | 'media.invalidDuration' | 'media.uploadInterrupted' | 'media.contentTooLarge' | 'contactRequired' | 'messageRefused' | 'forbiddenOrLeft' | 'contentRejected' | 'groupDismissed' | 'groupUnavailable' | 'channelDismissed' | 'channelMuted' | 'channelNotMember' | 'channelAdminRequired' | 'conversationUnsupported' | 'sendCanceled' | 'sessionLoggedOut' | 'timeout' | 'network' | 'unknown';
|
|
496
568
|
interface ImMessageFailure {
|
|
497
569
|
/** 归一后的错误码(来自 MESChatAck.errcode 或本地失败码,本地码用负值)。 */
|
|
498
570
|
code: number;
|
|
@@ -520,7 +592,12 @@ interface MediaTaskUpdate {
|
|
|
520
592
|
direction: 'upload' | 'download';
|
|
521
593
|
state: 'queued' | 'running' | 'completed' | 'failed' | 'canceled';
|
|
522
594
|
percent: number;
|
|
523
|
-
/**
|
|
595
|
+
/**
|
|
596
|
+
* upload 任务子阶段。
|
|
597
|
+
*
|
|
598
|
+
* `waiting-upload-slot` 与 `state: 'queued'` 同时出现,表示还没开始传字节(在生成缩略图或在等上传槽位),
|
|
599
|
+
* 此时 percent 恒为 0;`transferring` 正在传字节;`finalizing` 是等待远端 URL 最终确认。
|
|
600
|
+
*/
|
|
524
601
|
phase?: 'waiting-upload-slot' | 'transferring' | 'finalizing';
|
|
525
602
|
failure?: ImMessageFailure;
|
|
526
603
|
}
|
|
@@ -839,15 +916,25 @@ interface ForwardTarget {
|
|
|
839
916
|
conversationId: string;
|
|
840
917
|
conversationType: ForwardTargetConversationType;
|
|
841
918
|
}
|
|
842
|
-
/**
|
|
843
|
-
|
|
919
|
+
/**
|
|
920
|
+
* 转发只接收稳定消息身份;编排层必须回 DomainState 重取正文和最新撤回/编辑状态。
|
|
921
|
+
*
|
|
922
|
+
* `itemIndex` 只对媒体合集有意义:带上它表示「把 `body.mediaAlbum.items[itemIndex]` 这一项当成一条
|
|
923
|
+
* 独立的图片/视频消息转发出去」,出站 contentType 是该项自己的 kind(image 或 video),不是源消息的
|
|
924
|
+
* mediaAlbum。不传(默认)就是整条原样转发,行为与该字段出现之前逐字节一致。
|
|
925
|
+
*/
|
|
926
|
+
type ForwardMessageSource = Pick<ImMessage, 'id' | 'conversationId' | 'conversationType'> & {
|
|
927
|
+
itemIndex?: number;
|
|
928
|
+
};
|
|
844
929
|
/** forwardMessages 入参:有序源消息回复(选中序;单条 = length 1)+ 目标列表(1..9)。 */
|
|
845
930
|
interface ForwardMessagesInput {
|
|
846
931
|
messages: ForwardMessageSource[];
|
|
847
932
|
targets: ForwardTarget[];
|
|
848
933
|
}
|
|
849
934
|
/** 单条「源消息 × 目标会话」转发结果原因。 */
|
|
850
|
-
type ForwardFailReason = 'empty-input' | 'too-many-targets' | 'unsupported-target-type' | 'type-not-allowed' | 'media-not-ready'
|
|
935
|
+
type ForwardFailReason = 'empty-input' | 'too-many-targets' | 'unsupported-target-type' | 'type-not-allowed' | 'media-not-ready'
|
|
936
|
+
/** 按合集项转发时 `itemIndex` 越界,或该项在最新正文里已经不存在。 */
|
|
937
|
+
| 'album-item-not-found' | 'conversation-blocked' | 'send-failed';
|
|
851
938
|
/** 单条源消息向一个目标的结果;目标必须携带类型,避免同 id 的 direct/GROUP/CHANNEL 结果碰撞。 */
|
|
852
939
|
type ForwardItemStatus = {
|
|
853
940
|
ok: true;
|
|
@@ -1644,9 +1731,23 @@ interface MediaAssetCacheKey {
|
|
|
1644
1731
|
messageId: string;
|
|
1645
1732
|
resourceVersion: string;
|
|
1646
1733
|
}
|
|
1647
|
-
/**
|
|
1734
|
+
/**
|
|
1735
|
+
* 已解密的真实媒体资产。
|
|
1736
|
+
*
|
|
1737
|
+
* 内容用 `Blob` 承载而不是 `Uint8Array`:图片、尤其视频可达上百 MB,读成 `Uint8Array` 就等于把整份
|
|
1738
|
+
* 媒体搬进 JS 堆;`Blob` 的字节由浏览器自己托管,写缓存、读缓存和交给 `<img>` / `<video>` 全程都不需要
|
|
1739
|
+
* 整读一遍。字段名从 `bytes` 改成 `blob` 是刻意的——改名让编译器强制每个读写点重新被检查,也不会留下
|
|
1740
|
+
* 「有时是字节、有时是 Blob」两条内存表现完全不同的路径。
|
|
1741
|
+
*
|
|
1742
|
+
* `Blob` 可结构化克隆,因此 IndexedDB 能直接存,未来跨 Worker 传递也不需要改形状。
|
|
1743
|
+
*/
|
|
1648
1744
|
interface MediaAssetCacheEntry extends MediaAssetCacheKey {
|
|
1649
|
-
|
|
1745
|
+
/** 解密后的真实媒体内容;字节量一律按 `blob.size` 核算(LRU、单条上限、诊断都用它)。 */
|
|
1746
|
+
blob: Blob;
|
|
1747
|
+
/**
|
|
1748
|
+
* 消息体声明的 MIME。保留该字段而不是依赖 `blob.type`:解密产物的 Blob 可能没有类型,也可能带的是
|
|
1749
|
+
* 下载响应的类型,与消息声明不一定一致;读缓存时要以消息声明为准。
|
|
1750
|
+
*/
|
|
1650
1751
|
mimeType?: string;
|
|
1651
1752
|
}
|
|
1652
1753
|
/** 单种媒体的 sibling 缓存策略。 */
|
|
@@ -1664,7 +1765,7 @@ interface MediaAssetCacheStrategyRegistry {
|
|
|
1664
1765
|
/**
|
|
1665
1766
|
* 明文媒体资产缓存 Port。
|
|
1666
1767
|
*
|
|
1667
|
-
* Core/SDK
|
|
1768
|
+
* Core/SDK 只通过该端口读写真实媒体内容(以 Blob 承载);IndexedDB、配额与 LRU 由浏览器实现负责。
|
|
1668
1769
|
*/
|
|
1669
1770
|
interface MediaAssetCachePort {
|
|
1670
1771
|
get: (key: MediaAssetCacheKey) => Promise<MediaAssetCacheEntry | null>;
|
|
@@ -1684,8 +1785,14 @@ interface ImProfilePort {
|
|
|
1684
1785
|
clearCache?: () => void;
|
|
1685
1786
|
}
|
|
1686
1787
|
|
|
1687
|
-
/**
|
|
1688
|
-
|
|
1788
|
+
/**
|
|
1789
|
+
* 会话收藏可展示的内容类型;与 iOS `isSupportCollectionMsgType` 对齐。
|
|
1790
|
+
*
|
|
1791
|
+
* @remarks 这些值与收藏接口的 `content_type` 数值一一对应,而那个数值就是消息自己的 contentType
|
|
1792
|
+
* (1=文本 2=图片 3=视频 4=语音 5=位置 11=文件 **28=媒体合集**),不是另一套收藏专用枚举。
|
|
1793
|
+
* Android `MessageCollectExecute` 直接写 `message.getContentType()`,iOS 写 `msg.msgType`,两端一致。
|
|
1794
|
+
*/
|
|
1795
|
+
type ImSessionFavoriteKind = 'text' | 'image' | 'video' | 'voice' | 'location' | 'file' | 'mediaAlbum';
|
|
1689
1796
|
/** 服务端一条会话收藏快照;列表以 HTTP 为准,不回写原消息。 */
|
|
1690
1797
|
interface ImSessionFavoriteItem$1 {
|
|
1691
1798
|
readonly collectId: string;
|
|
@@ -2272,6 +2379,35 @@ type ImEvent = {
|
|
|
2272
2379
|
};
|
|
2273
2380
|
type ImEventListener = (event: ImEvent) => void;
|
|
2274
2381
|
|
|
2382
|
+
/** caption 长度上限,对齐 iOS 与旧 Web H5 的 1024。 */
|
|
2383
|
+
declare const MEDIA_ALBUM_CAPTION_MAX_LENGTH = 1024;
|
|
2384
|
+
/** 单条合集最多的项数,三端一致(Android CHOOSE_MAX_COUNT / iOS photoMaxNum / 旧 H5 MAX_COUNT)。 */
|
|
2385
|
+
declare const MEDIA_ALBUM_MAX_ITEMS = 9;
|
|
2386
|
+
/**
|
|
2387
|
+
* 预判一次媒体合集发送最终会建出哪种气泡。
|
|
2388
|
+
*
|
|
2389
|
+
* 发送编排按 R2/R3(与 Android、旧 Web H5 逐字一致)对「**恰好 1 项且没有配文**」**不发 28**,
|
|
2390
|
+
* 而是回落成普通图片 / 视频消息;纯空白配文等同于没有配文(对齐 Android `shouldUseMediaAlbum` 的 trim 判空)。
|
|
2391
|
+
* `hd` 不影响这个判定——回落路径上它本来就会丢掉,单图/单视频正文里没有这个字段。
|
|
2392
|
+
*
|
|
2393
|
+
* **为什么要对外暴露**:宿主判断「SDK 已受理」的时刻是乐观气泡落库,而不是发送 promise resolve
|
|
2394
|
+
* (后者要等所有项上传完并入 Outbox)。宿主要认出那条气泡就必须能预判它的 contentType,
|
|
2395
|
+
* 否则「只选 1 张图、不写配文」这一档永远等不到自己要找的 `mediaAlbum` 气泡。
|
|
2396
|
+
* **不要在宿主里重写这条规则**:它是协议侧的三端约定,写两份必然漂。
|
|
2397
|
+
*
|
|
2398
|
+
* 只覆盖**首次发送**。重发走的是已经成型的合集上下文,不会在中途改变消息类型。
|
|
2399
|
+
*
|
|
2400
|
+
* @param input.items 合集项;只读项数与首项的 `kind`。
|
|
2401
|
+
* @param input.caption 配文;`undefined` 与纯空白都算没有配文。
|
|
2402
|
+
* @returns 首次发送会建出的气泡 contentType。
|
|
2403
|
+
*/
|
|
2404
|
+
declare function resolveMediaAlbumSendContentType(input: {
|
|
2405
|
+
items: readonly {
|
|
2406
|
+
kind: 'image' | 'video';
|
|
2407
|
+
}[];
|
|
2408
|
+
caption?: string;
|
|
2409
|
+
}): 'mediaAlbum' | 'image' | 'video';
|
|
2410
|
+
|
|
2275
2411
|
/** 文本搜索命中的原文 UTF-16 区间;可直接用于 JavaScript `slice(start, end)`。 */
|
|
2276
2412
|
interface ImTextSearchRange {
|
|
2277
2413
|
start: number;
|
|
@@ -2544,6 +2680,10 @@ type ForwardCandidateMessage = ForwardContentCandidate & Pick<ImMessage, 'encryp
|
|
|
2544
2680
|
/**
|
|
2545
2681
|
* 多选转发时是否需要先提示用户“剔除后继续”。
|
|
2546
2682
|
* 覆盖语音、所有显式 unknown 与解密失败;原始 wire 类型不进入产品判定。
|
|
2683
|
+
*
|
|
2684
|
+
* 点名的都是**根本转不出去**的类型(语音、通话记录、unknown 都没有注册转发策略),提示的含义是
|
|
2685
|
+
* “这几条会被剔除”。已注册策略的类型一律不在此列——**媒体合集也不在**:它和图片/视频一样整条正文
|
|
2686
|
+
* 克隆、不重新上传,把它加进来会对一条能完整转发的消息发出假警告。
|
|
2547
2687
|
*/
|
|
2548
2688
|
declare function requiresForwardTypeConfirmation(message: ForwardCandidateMessage): boolean;
|
|
2549
2689
|
/**
|
|
@@ -2607,6 +2747,66 @@ declare function canReactToMessage(message: ReactionParentMessage): boolean;
|
|
|
2607
2747
|
|
|
2608
2748
|
type RecallFailReason = 'not-found' | 'not-own' | 'not-sent' | 'expired' | 'unsupported' | 'timeout' | 'server-expired' | 'failed' | 'disconnected';
|
|
2609
2749
|
|
|
2750
|
+
/** 浏览器 PushSubscription.toJSON() 的可移植数据;不依赖 DOM 或浏览器全局。 */
|
|
2751
|
+
interface ImWebPushSubscription {
|
|
2752
|
+
endpoint?: string;
|
|
2753
|
+
expirationTime?: number | null;
|
|
2754
|
+
keys?: Record<string, string>;
|
|
2755
|
+
}
|
|
2756
|
+
/** 状态不包含 endpoint、加密密钥或登录凭据,可安全用于设置页。 */
|
|
2757
|
+
interface ImPushSnapshot {
|
|
2758
|
+
status: 'idle' | 'pending' | 'syncing' | 'synced' | 'unconfirmed' | 'error' | 'disposed';
|
|
2759
|
+
error?: 'timeout' | 'invalid-ack' | 'server-rejected' | 'send-failed';
|
|
2760
|
+
/** unconfirmed 表示已收到旧后端默认错误码 ACK,不能据此证明绑定成功或失败。 */
|
|
2761
|
+
serverCode?: number;
|
|
2762
|
+
/** 超时等失败后等下一条连接恢复;不主动反复重报或制造重连。 */
|
|
2763
|
+
requiresReconnect?: boolean;
|
|
2764
|
+
}
|
|
2765
|
+
/**
|
|
2766
|
+
* 当前账号的推送绑定。浏览器授权、订阅和取消订阅由宿主拥有。
|
|
2767
|
+
* setWebSubscription 只提交同步意图;只有 snapshot.status === 'synced' 表示收到服务端成功 ACK。
|
|
2768
|
+
*/
|
|
2769
|
+
interface ImPushApi {
|
|
2770
|
+
/** 必须携带创建订阅时的账号,防止异步结果被交给另一个账号。离线时保留最新意图。 */
|
|
2771
|
+
setWebSubscription: (input: {
|
|
2772
|
+
userId: string;
|
|
2773
|
+
subscription: ImWebPushSubscription;
|
|
2774
|
+
}) => void;
|
|
2775
|
+
/** 停止本地同步并释放订阅数据;不宣称服务端解绑,宿主仍须调用 PushSubscription.unsubscribe()。 */
|
|
2776
|
+
clear: () => void;
|
|
2777
|
+
snapshot: () => ImPushSnapshot;
|
|
2778
|
+
/** 立即提供快照,返回退订函数;监听器的异常经宿主错误端口报告。 */
|
|
2779
|
+
subscribe: (listener: (snapshot: ImPushSnapshot) => void) => () => void;
|
|
2780
|
+
}
|
|
2781
|
+
|
|
2782
|
+
/** 收藏快照里的合集项;与写出的 wire `items[]` 互为读写。 */
|
|
2783
|
+
interface ImSessionFavoriteAlbumItem {
|
|
2784
|
+
readonly kind: 'image' | 'video';
|
|
2785
|
+
readonly width: number;
|
|
2786
|
+
readonly height: number;
|
|
2787
|
+
readonly url: string;
|
|
2788
|
+
readonly thumbUrl: string;
|
|
2789
|
+
readonly thumbDataUrl: string;
|
|
2790
|
+
readonly durationMs: number;
|
|
2791
|
+
readonly hd: boolean;
|
|
2792
|
+
}
|
|
2793
|
+
/**
|
|
2794
|
+
* 合集项封面:内嵌 thumbData → 明文 thumbUrl。
|
|
2795
|
+
* 远端 `url` 在加密会话里是密文对象,不能当 `<img src>`。
|
|
2796
|
+
*/
|
|
2797
|
+
declare function resolveSessionFavoriteAlbumItemPreviewUrl(item: ImSessionFavoriteAlbumItem): string;
|
|
2798
|
+
/**
|
|
2799
|
+
* 从收藏快照 `body.items` 读出合集项。
|
|
2800
|
+
*
|
|
2801
|
+
* `mediaType === 2` 是视频(Android / iOS / 出站同一套);其余完整项按图片。
|
|
2802
|
+
* 非对象、以及既没有远端地址也没有可展示封面的残缺项丢掉,不补默认图。
|
|
2803
|
+
*/
|
|
2804
|
+
declare function parseSessionFavoriteAlbumItems(body: Readonly<Record<string, unknown>>): readonly ImSessionFavoriteAlbumItem[];
|
|
2805
|
+
/**
|
|
2806
|
+
* 合集收藏配文。列表映射已经把 `caption` 写进 `item.text`。
|
|
2807
|
+
*/
|
|
2808
|
+
declare function resolveSessionFavoriteAlbumCaption(item: Pick<ImSessionFavoriteItem$1, 'kind' | 'text' | 'body'>): string;
|
|
2809
|
+
|
|
2610
2810
|
/**
|
|
2611
2811
|
* IM 语义文案 catalog 的键、参数和完整性合同。
|
|
2612
2812
|
* 键描述领域含义而非组件位置,使 Web/H5/SSR 可共享 formatter,宿主布局文案不进入此 schema。
|
|
@@ -2676,6 +2876,14 @@ interface ImSystemCatalog {
|
|
|
2676
2876
|
groupMessagePinned: string;
|
|
2677
2877
|
/** 移除置顶。参数:{operator}。 */
|
|
2678
2878
|
groupMessageUnpinned: string;
|
|
2879
|
+
/** 自己发起群通话。对齐 Android `you_started_a_group_call` / iOS `rea_yousendgroupmediasession`。 */
|
|
2880
|
+
groupCallStartedBySelf: string;
|
|
2881
|
+
/** 他人发起群通话。参数:{operator}。对齐 Android `somebody_started_a_group_call` / iOS `rea_othersendgroupmediasession`。 */
|
|
2882
|
+
groupCallStarted: string;
|
|
2883
|
+
/** 群通话已结束。对齐 Android `group_cal_ended` / iOS `rea_grouphaveend`。 */
|
|
2884
|
+
groupCallEnded: string;
|
|
2885
|
+
/** 群通话未接听。对齐 Android `group_call_missed` / iOS `rea_groupunconnect`。 */
|
|
2886
|
+
groupCallMissed: string;
|
|
2679
2887
|
channelNameChanged: string;
|
|
2680
2888
|
channelAvatarChanged: string;
|
|
2681
2889
|
channelAnnouncementChanged: string;
|
|
@@ -2755,6 +2963,19 @@ interface ImMediaCatalog {
|
|
|
2755
2963
|
gameDice: string;
|
|
2756
2964
|
/** 石头剪刀布消息的回复摘要。 */
|
|
2757
2965
|
gameRockPaperScissors: string;
|
|
2966
|
+
/**
|
|
2967
|
+
* 媒体合集:多张照片,参数 `{count}`(≥2;恰好 1 项时复用 `image`,避免每种语言再写一套单数模板)。
|
|
2968
|
+
*
|
|
2969
|
+
* 这一组与 `lastMessage.mediaAlbum*` 现在是**同一份词**(都不带方括号,决策 D26)。两边仍保留
|
|
2970
|
+
* 各自的 key,是因为两个界面的其它类型并不一致:会话列表给没有图标的类型加方括号,回复摘要一律不加。
|
|
2971
|
+
* 有配文的合集显示配文而不是这些文案,但那是调用方的取舍——与单视频消息的 `describe` 一样,
|
|
2972
|
+
* `formatMediaPlaceholder` 只负责类型占位,不读正文文本。
|
|
2973
|
+
*/
|
|
2974
|
+
mediaAlbumPhotos: string;
|
|
2975
|
+
/** 媒体合集:多个视频,参数 `{count}`(≥2;恰好 1 项时复用 `video`)。 */
|
|
2976
|
+
mediaAlbumVideos: string;
|
|
2977
|
+
/** 媒体合集:图片与视频混合,参数 `{photoCount}` `{videoCount}`(各语言自行决定量词与连接符)。 */
|
|
2978
|
+
mediaAlbumMixed: string;
|
|
2758
2979
|
}
|
|
2759
2980
|
/** 失败气泡文案(formatFailure 用;逐字对齐 core 现有 ImMessageFailure.message,阶段 4b 零回归)。 */
|
|
2760
2981
|
interface ImFailureCatalog {
|
|
@@ -2776,6 +2997,12 @@ interface ImFailureCatalog {
|
|
|
2776
2997
|
mediaInvalidDuration: string;
|
|
2777
2998
|
/** media.uploadInterrupted,参数 {label}。 */
|
|
2778
2999
|
mediaUploadInterrupted: string;
|
|
3000
|
+
/**
|
|
3001
|
+
* media.contentTooLarge:媒体合集的出站正文体积未通过发送前闸门。
|
|
3002
|
+
*
|
|
3003
|
+
* 与其它 media.* 不同,**不带 {label}**——一条合集里可能同时有照片和视频,没有单一媒体类型名。
|
|
3004
|
+
*/
|
|
3005
|
+
mediaContentTooLarge: string;
|
|
2779
3006
|
/** direct 0x8201:双方已不是好友。 */
|
|
2780
3007
|
contactRequired: string;
|
|
2781
3008
|
/** direct 0x8212:消息因对方黑名单策略被拒收。 */
|
|
@@ -2804,13 +3031,23 @@ interface ImFailureCatalog {
|
|
|
2804
3031
|
network: string;
|
|
2805
3032
|
unknown: string;
|
|
2806
3033
|
}
|
|
2807
|
-
/**
|
|
3034
|
+
/**
|
|
3035
|
+
* 会话列表预览文案(formatLastMessageSummary 用;system 复用 formatSystemMessage 带名版)。
|
|
3036
|
+
*
|
|
3037
|
+
* 方括号只保留给**列表里不带类型图标**的那些:语音、文件、名片、小程序、转账、通话、红包、
|
|
3038
|
+
* 小游戏、加密、不支持。它们没有图标,方括号是唯一能和「对方真的发了『语音』两个字」区分开的标记。
|
|
3039
|
+
*
|
|
3040
|
+
* 照片、视频、GIF、贴图和媒体合集在 PC/H5 会话列表里都带 16px 类型图标(设计稿 13328:305728),
|
|
3041
|
+
* 图标已经表明类型,所以文案不带方括号、与回复摘要 `media.*` 用同一份词(决策 D26)。
|
|
3042
|
+
*/
|
|
2808
3043
|
interface ImLastMessageCatalog {
|
|
3044
|
+
/** 单张照片,与 `media.image` 同词;列表里前面带照片图标,不加方括号。 */
|
|
2809
3045
|
image: string;
|
|
2810
|
-
/** GIF 会话摘要,例如 `
|
|
3046
|
+
/** GIF 会话摘要,例如 `GIF`;列表里前面带 GIF 图标。 */
|
|
2811
3047
|
gif: string;
|
|
2812
|
-
/** 静态贴图会话摘要,例如
|
|
3048
|
+
/** 静态贴图会话摘要,例如 `贴图`;列表里前面带贴图图标。 */
|
|
2813
3049
|
sticker: string;
|
|
3050
|
+
/** 单个视频,与 `media.video` 同词;列表里前面带视频图标。 */
|
|
2814
3051
|
video: string;
|
|
2815
3052
|
voice: string;
|
|
2816
3053
|
file: string;
|
|
@@ -2827,6 +3064,15 @@ interface ImLastMessageCatalog {
|
|
|
2827
3064
|
redPacket: string;
|
|
2828
3065
|
/** 小游戏消息的统一会话列表摘要;不在列表中暴露骰子/RPS 的具体类型。 */
|
|
2829
3066
|
game: string;
|
|
3067
|
+
/**
|
|
3068
|
+
* 媒体合集:多张照片,参数 `{count}`(≥2;恰好 1 项时复用 `image`,避免各语言再写一套单数模板)。
|
|
3069
|
+
* 有配文的合集直接显示配文,不用这些 key。合集在列表里带类型图标,所以同样不加方括号。
|
|
3070
|
+
*/
|
|
3071
|
+
mediaAlbumPhotos: string;
|
|
3072
|
+
/** 媒体合集:多个视频,参数 `{count}`(≥2;恰好 1 项时复用 `video`)。 */
|
|
3073
|
+
mediaAlbumVideos: string;
|
|
3074
|
+
/** 媒体合集:图片与视频混合,参数 `{photoCount}` `{videoCount}`(各语言自行决定量词与连接符)。 */
|
|
3075
|
+
mediaAlbumMixed: string;
|
|
2830
3076
|
encrypted: string;
|
|
2831
3077
|
/** 未注册或无法解析的正文。 */
|
|
2832
3078
|
unknown: string;
|
|
@@ -2842,7 +3088,7 @@ interface ImLastMessageCatalog {
|
|
|
2842
3088
|
* 二期收敛:kit 框架无关层不再直接产中文,改产本联合里的码 + 参数(如 {reason}/{label}/{size}),由宿主经 im-i18n 渲染。
|
|
2843
3089
|
* 动态原始报错(error.message)作为 `{reason}` 参数拼接,不入 catalog(属诊断,不翻译)。
|
|
2844
3090
|
*/
|
|
2845
|
-
type ImServiceTextKey = 'common.notConnected' | 'common.selectOrOpenConversation' | 'common.conversationTypeNotReady' | 'common.conversationNotReady' | `recall.${RecallFailReason}` | `edit.${EditFailReason}` | 'localDelete.done' | 'localDelete.notFound' | 'localDelete.inFlight' | 'localDelete.failed' | 'channelDelete.notFound' | 'channelDelete.unsupported' | 'channelDelete.notSent' | 'channelDelete.unavailable' | 'channelDelete.forbidden' | 'channelDelete.timeout' | 'channelDelete.failed' | 'channelDelete.disconnected' | 'directBlock.contactRequired' | 'groupBlock.left' | 'groupBlock.removed' | 'groupBlock.dismissed' | 'groupBlock.unknownRestricted' | 'channelBlock.guest' | 'channelBlock.left' | 'channelBlock.removed' | 'channelBlock.dismissed' | 'channelBlock.muted' | 'channelBlock.allMembersMuted' | 'channelBlock.currentUserMuted' | 'channelBlock.blacklisted' | 'channelBlock.unknownRestricted' | 'channelProfile.loadFailed' | 'channelProfile.notFound' | 'channelProfile.retryAction' | 'channelMembers.title' | 'channelMembers.searchPlaceholder' | 'channelMembers.loading' | 'channelMembers.loadFailed' | 'channelMembers.retryAction' | 'channelMembers.empty' | 'channelMembers.loadingMore' | 'channelMembers.loadMoreFailed' | 'channelMembers.exhausted' | 'channelMembers.loadMoreAction' | 'label.image' | 'label.video' | 'label.file' | 'label.sticker' | 'send.failed' | 'send.retryFailed' | 'send.cancelFailed' | 'send.mediaFailed' | 'send.mediaEmpty' | 'send.mediaCancelled' | 'send.mediaCountLimit' | 'send.mediaTooLarge' | 'send.videoTooLong' | 'send.videoDurationUnavailable' | 'send.voiceEmpty' | 'send.voiceStorageNotConfigured' | 'send.voiceCancelled' | 'send.voiceFailed' | 'media.voiceNotReady' | 'media.voiceLoadEmpty' | 'media.voiceLoadFailed' | 'media.videoOpenEmpty' | 'media.videoLoadFailed' | 'media.imageInvalid' | 'media.imageLoadFailed' | 'media.fileDownloadEmpty' | 'media.fileDownloadFailed' | 'conversation.muteEnableFailed' | 'conversation.muteDisableFailed' | 'read.markReadFailed' | 'pinned.forbidden' | 'pinned.network' | 'pinned.contract' | 'pinned.unsupported' | 'pinned.failed' | 'pinned.previewUnavailable' | 'pinned.locateFailed' | 'pinned.recalled' | 'pinned.deleted' | 'pinned.protected' | 'pinned.pinAction' | 'pinned.unpinAction' | 'pinned.unpinConfirm' | 'pinned.cancelAction' | 'lifecycle.missingLoginState' | 'lifecycle.prepareFailed' | 'lifecycle.missingConnectParams' | 'lifecycle.connectFailed' | 'lifecycle.disposed' | 'forward.emptyInput' | 'forward.allSkipped' | 'forward.partialSkipped' | 'forward.done' | 'forward.failed';
|
|
3091
|
+
type ImServiceTextKey = 'common.notConnected' | 'common.selectOrOpenConversation' | 'common.conversationTypeNotReady' | 'common.conversationNotReady' | `recall.${RecallFailReason}` | `edit.${EditFailReason}` | 'localDelete.done' | 'localDelete.notFound' | 'localDelete.inFlight' | 'localDelete.failed' | 'channelDelete.notFound' | 'channelDelete.unsupported' | 'channelDelete.notSent' | 'channelDelete.unavailable' | 'channelDelete.forbidden' | 'channelDelete.timeout' | 'channelDelete.failed' | 'channelDelete.disconnected' | 'directBlock.contactRequired' | 'groupBlock.left' | 'groupBlock.removed' | 'groupBlock.dismissed' | 'groupBlock.unknownRestricted' | 'channelBlock.guest' | 'channelBlock.left' | 'channelBlock.removed' | 'channelBlock.dismissed' | 'channelBlock.muted' | 'channelBlock.allMembersMuted' | 'channelBlock.currentUserMuted' | 'channelBlock.blacklisted' | 'channelBlock.unknownRestricted' | 'channelProfile.loadFailed' | 'channelProfile.notFound' | 'channelProfile.retryAction' | 'channelMembers.title' | 'channelMembers.searchPlaceholder' | 'channelMembers.loading' | 'channelMembers.loadFailed' | 'channelMembers.retryAction' | 'channelMembers.empty' | 'channelMembers.loadingMore' | 'channelMembers.loadMoreFailed' | 'channelMembers.exhausted' | 'channelMembers.loadMoreAction' | 'label.image' | 'label.video' | 'label.file' | 'label.sticker' | 'send.failed' | 'send.retryFailed' | 'send.cancelFailed' | 'send.mediaFailed' | 'send.mediaEmpty' | 'send.mediaCancelled' | 'send.mediaCountLimit' | 'send.mediaTooLarge' | 'send.mediaFormatMismatch' | 'send.videoTooLong' | 'send.videoDurationUnavailable' | 'send.voiceEmpty' | 'send.voiceStorageNotConfigured' | 'send.voiceCancelled' | 'send.voiceFailed' | 'media.uploadWaiting' | 'media.voiceNotReady' | 'media.voiceLoadEmpty' | 'media.voiceLoadFailed' | 'media.videoOpenEmpty' | 'media.videoLoadFailed' | 'media.imageInvalid' | 'media.imageLoadFailed' | 'media.fileDownloadEmpty' | 'media.fileDownloadFailed' | 'conversation.muteEnableFailed' | 'conversation.muteDisableFailed' | 'conversation.backgroundLoadFailed' | 'read.markReadFailed' | 'storage.failed' | 'sync.failed' | 'draft.saveFailed' | 'history.returnLatestFailed' | 'pinned.forbidden' | 'pinned.network' | 'pinned.contract' | 'pinned.unsupported' | 'pinned.failed' | 'pinned.previewUnavailable' | 'pinned.locateFailed' | 'pinned.recalled' | 'pinned.deleted' | 'pinned.protected' | 'pinned.pinAction' | 'pinned.unpinAction' | 'pinned.unpinConfirm' | 'pinned.cancelAction' | 'lifecycle.missingLoginState' | 'lifecycle.prepareFailed' | 'lifecycle.missingConnectParams' | 'lifecycle.connectFailed' | 'lifecycle.disposed' | 'forward.emptyInput' | 'forward.allSkipped' | 'forward.partialSkipped' | 'forward.done' | 'forward.failed';
|
|
2846
3092
|
/** 命令/生命周期操作提示 catalog(key 齐全,模板含 {reason}/{label}/{size} 占位)。 */
|
|
2847
3093
|
type ImServiceCatalog = Record<ImServiceTextKey, string>;
|
|
2848
3094
|
/** 星期文案键按 JavaScript `Date#getDay()` 的 Sunday-first 顺序命名。 */
|
|
@@ -2938,6 +3184,11 @@ interface ImI18n {
|
|
|
2938
3184
|
durationMs?: number;
|
|
2939
3185
|
stickerImageType?: number;
|
|
2940
3186
|
gameType?: ImGameType;
|
|
3187
|
+
callKind?: 'audio' | 'video';
|
|
3188
|
+
mediaAlbum?: {
|
|
3189
|
+
imageCount: number;
|
|
3190
|
+
videoCount: number;
|
|
3191
|
+
};
|
|
2941
3192
|
}) => string;
|
|
2942
3193
|
formatMentionAll: () => string;
|
|
2943
3194
|
formatFailure: (displayCode: ImFailureDisplayCode, opts?: {
|
|
@@ -3000,6 +3251,16 @@ interface FormatMediaPlaceholderContext {
|
|
|
3000
3251
|
gameType?: ImGameType;
|
|
3001
3252
|
/** 通话记录媒体类型;缺失时不把损坏正文伪装成语音或视频通话。 */
|
|
3002
3253
|
callKind?: 'audio' | 'video';
|
|
3254
|
+
/**
|
|
3255
|
+
* 媒体合集的项数构成;缺失或两个计数都是 0 时返回空串,不假装有内容。
|
|
3256
|
+
*
|
|
3257
|
+
* **不含配文**:与单视频消息的 `describe` 一样,本函数只负责类型占位,正文文本由调用方决定
|
|
3258
|
+
* 要不要优先显示(引用摘要通常会把配文走自己的表情/@ 分段管线,不该从这里绕过去)。
|
|
3259
|
+
*/
|
|
3260
|
+
mediaAlbum?: {
|
|
3261
|
+
imageCount: number;
|
|
3262
|
+
videoCount: number;
|
|
3263
|
+
};
|
|
3003
3264
|
}
|
|
3004
3265
|
/**
|
|
3005
3266
|
* 媒体消息 → 单行占位文案(回复摘要 / 会话预览降级用)。对齐 use-message-preview:
|
|
@@ -3357,9 +3618,19 @@ interface MediaTransferAdapterConfig {
|
|
|
3357
3618
|
rangeDownload?: boolean;
|
|
3358
3619
|
/**
|
|
3359
3620
|
* 媒体发送阶段的并发上限;由 im-core 消费,adapter 本身仍只负责单个上传任务。
|
|
3360
|
-
*
|
|
3621
|
+
*
|
|
3622
|
+
* 并发按媒体体积分两档:图片与不超过分片阈值(16 MiB)的小文件走单次 PutObject、不占分片缓冲,
|
|
3623
|
+
* 缺省 5;视频与超过阈值(或字节数未知)的文件走分片,每路各带分片缓冲,缺省 3。
|
|
3624
|
+
* 两档都只接受 1-6 的整数,超出范围由 core 显式报错。
|
|
3625
|
+
* - 传一个数字:所有媒体共用这一个并发数,与分档前的语义一致。
|
|
3626
|
+
* - 传 `{ total, largeFiles }`:显式分档,`largeFiles` 不得超过 `total`。
|
|
3361
3627
|
*/
|
|
3362
|
-
maxConcurrentUploads?: number
|
|
3628
|
+
maxConcurrentUploads?: number | {
|
|
3629
|
+
/** 在途上传总数上限(两档合计);缺省 5。 */
|
|
3630
|
+
total?: number;
|
|
3631
|
+
/** 其中大文件档的上限(视频、超过分片阈值或字节数未知的内容);缺省 min(3, total)。 */
|
|
3632
|
+
largeFiles?: number;
|
|
3633
|
+
};
|
|
3363
3634
|
}
|
|
3364
3635
|
|
|
3365
3636
|
/**
|
|
@@ -3572,7 +3843,10 @@ interface VoiceRecordingSession {
|
|
|
3572
3843
|
resume: () => Promise<void>;
|
|
3573
3844
|
/** 定稿:落地当前段(如在录)→ 拼接全部 PCM → Speex/Ogg 编码。会话随之关闭。 */
|
|
3574
3845
|
finish: () => Promise<VoiceRecordingResult>;
|
|
3575
|
-
/**
|
|
3846
|
+
/**
|
|
3847
|
+
* 取消:丢弃全部段落,释放麦克风。幂等。
|
|
3848
|
+
* 定稿失败或定稿超时之后仍可调用,用来确保麦克风被收回。
|
|
3849
|
+
*/
|
|
3576
3850
|
cancel: () => void;
|
|
3577
3851
|
/** 试听:已落地 PCM 拼接为 WAV(暂停态调用;录制态请先 pause)。 */
|
|
3578
3852
|
previewWav: () => Promise<VoicePreviewWav>;
|
|
@@ -3704,12 +3978,16 @@ interface ImMessageReactions {
|
|
|
3704
3978
|
aggregates: readonly ImMessageReactionAggregate[];
|
|
3705
3979
|
}
|
|
3706
3980
|
/** 可渲染媒体正文;密钥和底层文件加密策略只允许留在 SDK/Core。 */
|
|
3707
|
-
interface ImMessageViewBody extends Omit<ImMessageBody, 'image' | 'video' | 'voice' | 'file' | 'sticker'> {
|
|
3981
|
+
interface ImMessageViewBody extends Omit<ImMessageBody, 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'mediaAlbum'> {
|
|
3708
3982
|
image?: Readonly<Omit<NonNullable<ImMessageBody['image']>, 'teaKey' | 'fileEncryptType'>>;
|
|
3709
3983
|
video?: Readonly<Omit<NonNullable<ImMessageBody['video']>, 'teaKey' | 'fileEncryptType'>>;
|
|
3710
3984
|
voice?: Readonly<Omit<NonNullable<ImMessageBody['voice']>, 'teaKey' | 'fileEncryptType'>>;
|
|
3711
3985
|
file?: Readonly<Omit<NonNullable<ImMessageBody['file']>, 'teaKey' | 'fileEncryptType'>>;
|
|
3712
3986
|
sticker?: Readonly<NonNullable<ImMessageBody['sticker']>>;
|
|
3987
|
+
/** 合集的每一项都带自己的密钥材料,逐项剥离后才交给产品层;按项下载走 SDK handle,不需要这些字段。 */
|
|
3988
|
+
mediaAlbum?: Readonly<Omit<NonNullable<ImMessageBody['mediaAlbum']>, 'items'> & {
|
|
3989
|
+
items: readonly Readonly<Omit<ImMediaAlbumItem, 'teaKey' | 'fileEncryptType'>>[];
|
|
3990
|
+
}>;
|
|
3713
3991
|
}
|
|
3714
3992
|
/**
|
|
3715
3993
|
* 官方 Chat Kit 与宿主消息线程使用的完整稳定消息 DTO。
|
|
@@ -3785,6 +4063,44 @@ interface MiniProgramMessageOptions {
|
|
|
3785
4063
|
interface TransferMessageOptions {
|
|
3786
4064
|
replyToMessageId?: string;
|
|
3787
4065
|
}
|
|
4066
|
+
/**
|
|
4067
|
+
* 媒体合集里的一项:一张图片或一个视频。
|
|
4068
|
+
*
|
|
4069
|
+
* @remarks `kind` 由**调用方**按 MIME 分类,SDK 不嗅探文件内容——宿主的文件选择器本来就要按类型分流
|
|
4070
|
+
* (GIF 得走 `sendGif`),再让 SDK 猜一次只会多一处口径不一致。
|
|
4071
|
+
*/
|
|
4072
|
+
interface MediaAlbumItemInput {
|
|
4073
|
+
/** 这一项是图片还是视频。 */
|
|
4074
|
+
kind: 'image' | 'video';
|
|
4075
|
+
/** 原文件;`File` 可直接传,`Blob` 需调用方保证 `type` 可判定。 */
|
|
4076
|
+
file: File | Blob;
|
|
4077
|
+
/** 宿主创建的本地 object URL,仅供上传中的宫格显示这一格;URL 释放由宿主生命周期负责。 */
|
|
4078
|
+
localPreviewUrl?: string;
|
|
4079
|
+
/**
|
|
4080
|
+
* 这一项的本地宽高(视频再带时长与首帧)。
|
|
4081
|
+
*
|
|
4082
|
+
* 不传时 SDK 会自己读一次(与单图/单视频同一条预览路径)。宫格的格子几何按原始宽高算,
|
|
4083
|
+
* 缺了它整条消息的格子比例会在上传完成时跳变。
|
|
4084
|
+
*/
|
|
4085
|
+
localPreviewMetadata?: ImagePreviewMetadata | VideoPreviewMetadata;
|
|
4086
|
+
}
|
|
4087
|
+
/**
|
|
4088
|
+
* 媒体合集发送选项。
|
|
4089
|
+
*
|
|
4090
|
+
* @remarks 恰好 1 项且没有配文时,SDK 内部会回落成普通图片/视频消息(与 Android / iOS / 旧 H5 一致),
|
|
4091
|
+
* 此时返回的仍是同样的 `SendMessageResult`,调用方不需要区分。
|
|
4092
|
+
*/
|
|
4093
|
+
interface MediaAlbumMessageOptions {
|
|
4094
|
+
/** 配文,最长 1024 字符;纯空白等同于没有配文。超长由 SDK 明确拒绝,**不静默截断**。 */
|
|
4095
|
+
caption?: string;
|
|
4096
|
+
replyToMessageId?: string;
|
|
4097
|
+
/**
|
|
4098
|
+
* 发送方勾选了「原图」,写进每一项的 `hd` 标记。
|
|
4099
|
+
*
|
|
4100
|
+
* 本期不做任何图片/视频压缩,勾与不勾都发原文件,这个字段只让接收端显示「原图」角标。
|
|
4101
|
+
*/
|
|
4102
|
+
hd?: boolean;
|
|
4103
|
+
}
|
|
3788
4104
|
/**
|
|
3789
4105
|
* 本地视频的固有尺寸、时长与首帧封面。
|
|
3790
4106
|
*
|
|
@@ -4879,6 +5195,22 @@ type ConversationLastMessageSummary = {
|
|
|
4879
5195
|
} | {
|
|
4880
5196
|
kind: 'voice';
|
|
4881
5197
|
durationMs?: number;
|
|
5198
|
+
}
|
|
5199
|
+
/**
|
|
5200
|
+
* 媒体合集(一条消息内 1~9 个图片/视频 + 可选配文)。
|
|
5201
|
+
*
|
|
5202
|
+
* 只给计数与配文,数量文案由宿主经 im-i18n 按 locale 组装;有配文时优先显示配文。
|
|
5203
|
+
* 两个计数都为 0 表示入站正文残缺(所有项都无法解析),宿主应按未知正文处理。
|
|
5204
|
+
*
|
|
5205
|
+
* `firstItemKind` 是第一项是照片还是视频。有配文时列表显示的是配文,光看计数决定不了该配
|
|
5206
|
+
* 照片图标还是视频图标,三端统一按第一项取;正文残缺时缺省,宿主据此不显示类型图标。
|
|
5207
|
+
*/
|
|
5208
|
+
| {
|
|
5209
|
+
kind: 'mediaAlbum';
|
|
5210
|
+
imageCount: number;
|
|
5211
|
+
videoCount: number;
|
|
5212
|
+
caption?: string;
|
|
5213
|
+
firstItemKind?: 'image' | 'video';
|
|
4882
5214
|
} | {
|
|
4883
5215
|
kind: 'encrypted';
|
|
4884
5216
|
} | {
|
|
@@ -5331,6 +5663,16 @@ interface ConversationMessageApi {
|
|
|
5331
5663
|
sendFile: (file: File | Blob, options?: FileMessageOptions) => Promise<SendMessageResult>;
|
|
5332
5664
|
/** 发送 GIF 贴图;原文件明文上传 sticker bucket,消息固定 EXPRESSION/LINK/GIF。 */
|
|
5333
5665
|
sendGif: (file: File | Blob, options?: GifMessageOptions) => Promise<SendMessageResult>;
|
|
5666
|
+
/**
|
|
5667
|
+
* 发送媒体合集:1~9 个图片/视频合成**一条**消息,可带一段配文。
|
|
5668
|
+
*
|
|
5669
|
+
* @remarks 全部项上传成功才发出;任一项失败整条失败,不发半条消息。恰好 1 项且没有配文时
|
|
5670
|
+
* SDK 内部回落成普通图片/视频消息(三端一致)。**校验是整条的**——某一项超限会拒绝整条,
|
|
5671
|
+
* 因为协议上它就是一条消息,没有「发一半」这种状态。
|
|
5672
|
+
*
|
|
5673
|
+
* GIF 不能进合集(三端一致),调用方要先按 MIME 把它拆出去走 `sendGif`。
|
|
5674
|
+
*/
|
|
5675
|
+
sendMediaAlbum: (items: readonly MediaAlbumItemInput[], options?: MediaAlbumMessageOptions) => Promise<SendMessageResult>;
|
|
5334
5676
|
/** 发送已经托管在远端的静态贴图;资源和贴图包身份均为必填合同。 */
|
|
5335
5677
|
sendSticker: (asset: ImStickerAssetInput, options?: ExpressionMessageOptions) => Promise<SendMessageResult>;
|
|
5336
5678
|
/** 发送已经托管在远端的 GIF;Giphy 没有 package identity,输入不得提供 packageId。 */
|
|
@@ -5411,6 +5753,43 @@ interface ConversationMessageApi {
|
|
|
5411
5753
|
* ```
|
|
5412
5754
|
*/
|
|
5413
5755
|
forward: (messageIds: readonly string[], targets: readonly ConversationRef<ProductHandleConversationType>[]) => Promise<ForwardMessagesResult>;
|
|
5756
|
+
/**
|
|
5757
|
+
* 把媒体合集里的第 `itemIndex` 项,当成**一条独立的图片或视频消息**转发到多个目标会话。
|
|
5758
|
+
*
|
|
5759
|
+
* 用途:全屏预览里点转发时,用户要转的是当前正在看的这一格,而不是整条合集。
|
|
5760
|
+
*
|
|
5761
|
+
* @remarks
|
|
5762
|
+
* 与 `forward` 的区别是产出的消息类型变了(合集 → 图片/视频),所以是独立方法而不是给 `forward`
|
|
5763
|
+
* 放宽入参。与 `forward` 相同的是:复用该项已有的远端地址与解密 key,**不重新上传**;目标会话仍由
|
|
5764
|
+
* direct/GROUP/CHANNEL 各自的 SendStrategy 组帧入 Outbox。
|
|
5765
|
+
*
|
|
5766
|
+
* 视频项在合集里的时长是毫秒,转成单视频消息时 SDK 会换算成协议要求的秒,调用方不需要处理。
|
|
5767
|
+
* 合集项上的「原图」角标与远端缩略图地址不会带到单媒体消息上——单图/单视频正文没有这两个字段。
|
|
5768
|
+
*
|
|
5769
|
+
* 三种情况进 `failed`:源消息不是媒体合集(`IM_SDK_FORWARD_CONTENT_UNSUPPORTED`)、
|
|
5770
|
+
* `itemIndex` 越界或该项已不存在(`IM_SDK_MEDIA_ALBUM_ITEM_INVALID`)、该项还没有可复用的远端地址
|
|
5771
|
+
* (还在上传或入站残缺,`IM_SDK_FORWARD_MEDIA_NOT_READY`,可重试)。
|
|
5772
|
+
*
|
|
5773
|
+
* **还有一类结果三个数组会全空**:源消息已撤回、已被双删、解密失败、在本地已经查不到,
|
|
5774
|
+
* 或它的类型本身就不可转发时,这条消息在预检阶段就被剔除,只出现在 `skippedSourceMessageIds` 里。
|
|
5775
|
+
* 这与 `forward` 的批量语义一致(批量转发本来就要把不可转的源剔掉再发其余的),
|
|
5776
|
+
* 但单条调用时它意味着**什么都没发出去**。所以调用方判成功要看 `sent`,
|
|
5777
|
+
* 不要只判 `failed.length > 0`——那样在「预览期间原消息被撤回」这种竞态下会既不发送也不提示。
|
|
5778
|
+
*
|
|
5779
|
+
* @param messageId 当前 handle 中的合集消息 id。
|
|
5780
|
+
* @param itemIndex 宫格里的项下标,从 0 起;必须是非负整数。
|
|
5781
|
+
* @param targets 目标会话,最多 9 个。
|
|
5782
|
+
* @example
|
|
5783
|
+
* ```ts
|
|
5784
|
+
* const result = await handle.messages.forwardMediaAlbumItem('message-42', 2, [
|
|
5785
|
+
* { conversationType: 'direct', conversationId: '1001' },
|
|
5786
|
+
* ])
|
|
5787
|
+
* // 一条都没发出去就要提示:失败原因在 failed 里,源消息被剔除时 failed 也是空的。
|
|
5788
|
+
* if (result.sent.length === 0)
|
|
5789
|
+
* showError(result.failed[0]?.error.code ?? 'IM_SDK_FORWARD_CONTENT_UNSUPPORTED')
|
|
5790
|
+
* ```
|
|
5791
|
+
*/
|
|
5792
|
+
forwardMediaAlbumItem: (messageId: string, itemIndex: number, targets: readonly ConversationRef<ProductHandleConversationType>[]) => Promise<ForwardMessagesResult>;
|
|
5414
5793
|
/**
|
|
5415
5794
|
* 按 id 向服务端取回本地没有的消息,并回填进本地历史。
|
|
5416
5795
|
*
|
|
@@ -5629,6 +6008,14 @@ interface ImMessageRef {
|
|
|
5629
6008
|
conversation: ConversationRef<ProductHandleConversationType>;
|
|
5630
6009
|
/** 当前会话内的稳定消息 id。 */
|
|
5631
6010
|
messageId: string;
|
|
6011
|
+
/**
|
|
6012
|
+
* 媒体合集里的第几项(从 0 起)。
|
|
6013
|
+
*
|
|
6014
|
+
* **只有合集消息需要它,也只有合集消息接受它**:一条合集是一条消息、多个文件,光靠 messageId
|
|
6015
|
+
* 指不到具体某一项。给单媒体消息传这个字段会被显式拒绝,而不是忽略——忽略的话调用方以为自己
|
|
6016
|
+
* 在下载第 3 项,实际拿到的是整条消息的唯一媒体。
|
|
6017
|
+
*/
|
|
6018
|
+
itemIndex?: number;
|
|
5632
6019
|
}
|
|
5633
6020
|
/**
|
|
5634
6021
|
* 可观察媒体上传/下载任务的只读产品投影。
|
|
@@ -5643,13 +6030,27 @@ interface ImMediaTask {
|
|
|
5643
6030
|
messageId: string;
|
|
5644
6031
|
/** 关联消息的精确会话 sibling。 */
|
|
5645
6032
|
ref: ConversationRef<ProductHandleConversationType>;
|
|
6033
|
+
/**
|
|
6034
|
+
* 媒体合集的项下标;单媒体消息与全部上传任务为 undefined。
|
|
6035
|
+
*
|
|
6036
|
+
* 一条合集的多项共用同一个 messageId,各自是独立的下载任务。调用方按 messageId 找任务时
|
|
6037
|
+
* 必须连这个字段一起比,否则并发下载两项时会把另一项的进度读成自己的。
|
|
6038
|
+
* 上传任务不带下标:一条合集整体只有一条上传进度(所有项都传完才算这条消息发出去)。
|
|
6039
|
+
*/
|
|
6040
|
+
itemIndex?: number;
|
|
5646
6041
|
/** upload 来自发送链路,download 来自本产品 API。 */
|
|
5647
6042
|
direction: 'upload' | 'download';
|
|
5648
6043
|
/** 终态 completed/failed/canceled 不会被同一尝试的迟到 progress 回退。 */
|
|
5649
6044
|
state: 'queued' | 'running' | 'completed' | 'failed' | 'canceled';
|
|
5650
6045
|
/** 0-100 的归一化整数。 */
|
|
5651
6046
|
percent: number;
|
|
5652
|
-
/**
|
|
6047
|
+
/**
|
|
6048
|
+
* upload 子阶段。
|
|
6049
|
+
*
|
|
6050
|
+
* `waiting-upload-slot` 与 `state: 'queued'` 同时出现,表示这条媒体还没开始传字节(在生成缩略图或在
|
|
6051
|
+
* 等上传槽位),此时 `percent` 恒为 0——宿主应显示「等待中」而不是把 0 当成停住的进度。
|
|
6052
|
+
* `transferring` 是正在传字节,`finalizing` 是字节已传完、在等对象存储确认。
|
|
6053
|
+
*/
|
|
5653
6054
|
phase?: 'waiting-upload-slot' | 'transferring' | 'finalizing';
|
|
5654
6055
|
/** 可供产品按 code/category 决策的稳定错误;不含底层 URL、密钥或响应正文。 */
|
|
5655
6056
|
error?: ImSdkErrorShape;
|
|
@@ -5705,6 +6106,31 @@ interface ImMediaTasksApi {
|
|
|
5705
6106
|
* @throws 持久缓存读取失败时抛 `IM_SDK_MEDIA_CACHE_READ_FAILED`,不能把存储故障伪装成 cache miss。
|
|
5706
6107
|
*/
|
|
5707
6108
|
getCached: (message: ImMessageRef) => Promise<Blob | null>;
|
|
6109
|
+
/**
|
|
6110
|
+
* 为宿主手里的**本地**图片/视频文件预读展示元信息:尺寸、视频时长、视频首帧封面的 JPEG 字节。
|
|
6111
|
+
*
|
|
6112
|
+
* 给「发送前预览」这类场景用:宿主要在用户还没点发送时就把缩略图画出来,而浏览器读不出视频的
|
|
6113
|
+
* 首帧——`<video preload="metadata">` 在 iOS Safari 上只加载元信息、**不解码任何一帧**,
|
|
6114
|
+
* 拿它当缩略图会得到一个空白格子(还会白占一路解码)。
|
|
6115
|
+
*
|
|
6116
|
+
* 返回的对象可以**原样**作为 `localPreviewMetadata` 交给 `sendImage` / `sendVideo` /
|
|
6117
|
+
* `sendMediaAlbum`:发送链路会跳过重复解码,上传中的气泡也从第一帧就有封面。
|
|
6118
|
+
* 视频封面用的就是发送链路那套规格(长边 320、JPEG),所以弹层里看到的与最终发出去的是同一张。
|
|
6119
|
+
*
|
|
6120
|
+
* @param input.kind 按文件类型选解码路径;`'video'` 才会抽首帧与读时长。
|
|
6121
|
+
* @param input.file 本地文件;不会被上传,也不会进任何缓存。
|
|
6122
|
+
* @param input.signal 宿主放弃时中止解码(例如预览弹层被关掉)。
|
|
6123
|
+
* @returns 解码成功返回元信息;**浏览器确实读不出这个文件**(格式不支持、解码超时)时返回 `null`,
|
|
6124
|
+
* 调用方应当显式呈现「这个文件读不出来」,不要拿空白格子糊过去。失败原因会记入 SDK 结构化诊断。
|
|
6125
|
+
* @throws 宿主通过 `signal` 中止时抛 `AbortError`——那是调用方自己的取消,不能和「读不出来」混为一谈。
|
|
6126
|
+
* @throws runtime 已 logout/dispose 时抛 `IM_SDK_MEDIA_RUNTIME_INACTIVE`;
|
|
6127
|
+
* 未装配预览端口时抛 `IM_SDK_MEDIA_PREVIEW_UNAVAILABLE`,不静默返回 `null`。
|
|
6128
|
+
*/
|
|
6129
|
+
prepareLocalPreview: <TKind extends 'image' | 'video'>(input: {
|
|
6130
|
+
kind: TKind;
|
|
6131
|
+
file: Blob;
|
|
6132
|
+
signal?: AbortSignal;
|
|
6133
|
+
}) => Promise<(TKind extends 'video' ? VideoPreviewMetadata : ImagePreviewMetadata) | null>;
|
|
5708
6134
|
}
|
|
5709
6135
|
|
|
5710
6136
|
/**
|
|
@@ -6153,14 +6579,8 @@ interface ImSearchApi {
|
|
|
6153
6579
|
readonly messages: ImMessageSearchApi;
|
|
6154
6580
|
}
|
|
6155
6581
|
|
|
6156
|
-
/**
|
|
6157
|
-
* 会话收藏稳定产品门面。
|
|
6158
|
-
*
|
|
6159
|
-
* 本模块不缓存服务端列表;每次 list/add/delete 都以当前账号 provider 为准。
|
|
6160
|
-
* 收藏快照与原聊天消息解耦:原消息删除、撤回或编辑不会回写收藏。
|
|
6161
|
-
*/
|
|
6162
|
-
|
|
6163
6582
|
type ImSessionFavoriteItem = Readonly<ImSessionFavoriteItem$1>;
|
|
6583
|
+
|
|
6164
6584
|
/** 产品层会话收藏 API。 */
|
|
6165
6585
|
interface ImSessionFavoritesApi {
|
|
6166
6586
|
list: () => Promise<readonly ImSessionFavoriteItem[]>;
|
|
@@ -6171,7 +6591,13 @@ interface ImSessionFavoritesApi {
|
|
|
6171
6591
|
}) => Promise<ImSessionFavoriteItem>;
|
|
6172
6592
|
delete: (collectIds: readonly string[]) => Promise<void>;
|
|
6173
6593
|
}
|
|
6174
|
-
/**
|
|
6594
|
+
/**
|
|
6595
|
+
* 对齐 iOS Cell:文本 / 图 / 视频 / 语音 / 文件 / 媒体合集可收藏;表情、名片、通话等不可。
|
|
6596
|
+
*
|
|
6597
|
+
* 两端的收藏类型判定都是**黑名单**(iOS `isSupportCollectionMsgType` 排除名片/通话/表情/游戏/未知;
|
|
6598
|
+
* Android `isCanCollectByType` 排除通话/表情/名片/未知/解密失败),媒体合集不在黑名单里,
|
|
6599
|
+
* 收藏接口的 `content_type` 直接用消息自己的 28。
|
|
6600
|
+
*/
|
|
6175
6601
|
declare function resolveSessionFavoriteKindFromMessage(message: ImMessageView): ImSessionFavoriteKind | null;
|
|
6176
6602
|
/**
|
|
6177
6603
|
* 组收藏快照明文。content 空则返回 null,对齐 iOS `collectMsg:YES` 不写空 body。
|
|
@@ -6689,6 +7115,8 @@ interface AdvancedConversationsApi extends ImConversationsApi, ImConversationBac
|
|
|
6689
7115
|
* ```
|
|
6690
7116
|
*/
|
|
6691
7117
|
interface ImProductClient {
|
|
7118
|
+
/** 当前设备推送订阅的服务端绑定与同步状态。 */
|
|
7119
|
+
readonly push: ImPushApi;
|
|
6692
7120
|
readonly session: ImSessionApi;
|
|
6693
7121
|
readonly capabilities: ImConversationCapabilitiesApi;
|
|
6694
7122
|
readonly conversations: ImConversationListApi;
|
|
@@ -6867,6 +7295,13 @@ type ConversationListPreviewSegment = {
|
|
|
6867
7295
|
kind: 'legacy-emoji-placeholder';
|
|
6868
7296
|
text: string;
|
|
6869
7297
|
};
|
|
7298
|
+
/**
|
|
7299
|
+
* 会话列表摘要文字前面那个类型图标的种类;宿主各自把它映射成自己的 SVG 组件。
|
|
7300
|
+
*
|
|
7301
|
+
* `mediaAlbum` 专指「照片和视频混装」的合集,产品用相机图标;只有照片或只有视频的合集归到
|
|
7302
|
+
* `image` / `video`,因为用户看到的文案也是「2张照片」「2个视频」。
|
|
7303
|
+
*/
|
|
7304
|
+
type ConversationListPreviewMediaKind = 'image' | 'video' | 'gif' | 'sticker' | 'mediaAlbum';
|
|
6870
7305
|
/** 由各宿主按当前产品语言注入的会话列表标签。 */
|
|
6871
7306
|
interface ConversationListPresentationLabels {
|
|
6872
7307
|
/** 没有草稿和最后消息时显示的占位文案。 */
|
|
@@ -6902,6 +7337,13 @@ interface ConversationListPresentation {
|
|
|
6902
7337
|
preview: string;
|
|
6903
7338
|
/** 不包含 @我提示与发送者前缀的摘要分段。 */
|
|
6904
7339
|
previewSegments: readonly ConversationListPreviewSegment[];
|
|
7340
|
+
/**
|
|
7341
|
+
* 摘要前面该显示哪个类型图标;不需要图标时缺省。
|
|
7342
|
+
*
|
|
7343
|
+
* 草稿、撤回、管理员删除、系统事件显示的是整句话而不是类型占位,一律不给图标;语音、文件、
|
|
7344
|
+
* 名片等没有产品 glyph 的类型同样不给,它们的文案自带方括号来和真实文本区分。
|
|
7345
|
+
*/
|
|
7346
|
+
previewMediaKind?: ConversationListPreviewMediaKind;
|
|
6905
7347
|
/** 群聊或社群普通消息的发送者前缀;其它摘要为空串。 */
|
|
6906
7348
|
senderPrefix: string;
|
|
6907
7349
|
/** 未读 @ 提示;草稿、系统、撤回和管理员删除摘要为空串。 */
|
|
@@ -6976,6 +7418,26 @@ declare function resolveBestMediaPresentationSource<TValue>(candidates: readonly
|
|
|
6976
7418
|
/** 返回 candidate 是否允许替换当前源;资源质量只能保持或提高,不能异步降级。 */
|
|
6977
7419
|
declare function canPromoteMediaPresentationSource(current: MediaPresentationSourceQuality, candidate: MediaPresentationSourceQuality): boolean;
|
|
6978
7420
|
|
|
7421
|
+
/** 新消息提醒所需的领域与宿主事实;本模块不读取浏览器、路由或全局设置。 */
|
|
7422
|
+
interface MessageNotificationInput {
|
|
7423
|
+
source: 'live' | 'offline';
|
|
7424
|
+
senderId: string;
|
|
7425
|
+
accountId: string;
|
|
7426
|
+
contentType: string;
|
|
7427
|
+
muted: boolean;
|
|
7428
|
+
globallyEnabled: boolean;
|
|
7429
|
+
visibilityState: 'visible' | 'hidden';
|
|
7430
|
+
permission: 'default' | 'denied' | 'granted' | null;
|
|
7431
|
+
}
|
|
7432
|
+
type MessageNotificationDecision = {
|
|
7433
|
+
show: true;
|
|
7434
|
+
} | {
|
|
7435
|
+
show: false;
|
|
7436
|
+
reason: 'not-live' | 'unsupported' | 'permission-denied' | 'page-visible' | 'self-message' | 'system-message' | 'conversation-muted' | 'globally-disabled';
|
|
7437
|
+
};
|
|
7438
|
+
/** PC/H5 共用的实时消息提醒规则;离线历史回放不逐条弹通知。 */
|
|
7439
|
+
declare function resolveMessageNotificationDecision(input: MessageNotificationInput): MessageNotificationDecision;
|
|
7440
|
+
|
|
6979
7441
|
/**
|
|
6980
7442
|
* 官方 Chat Kit 和受控诊断工具使用的 SDK internal 入口。
|
|
6981
7443
|
* 它暴露完整 client、adapter 装配和领域原子,但仍不属于普通产品 API;生产宿主不得据此解析协议或持有密钥。
|
|
@@ -7168,6 +7630,13 @@ interface ChatMediaMessageRef {
|
|
|
7168
7630
|
conversationId: string;
|
|
7169
7631
|
/** 需要查找本地媒体预览的消息 ID。 */
|
|
7170
7632
|
messageId: string;
|
|
7633
|
+
/**
|
|
7634
|
+
* 媒体合集的项下标(第几格)。
|
|
7635
|
+
*
|
|
7636
|
+
* 一条合集的 9 格共用同一个 messageId,各自是独立资源;不带下标会让它们落到同一个注册表键上,
|
|
7637
|
+
* 后绑定的一格把先绑定的挤掉并撤销其地址。单媒体消息不传这个字段。
|
|
7638
|
+
*/
|
|
7639
|
+
itemIndex?: number;
|
|
7171
7640
|
}
|
|
7172
7641
|
/**
|
|
7173
7642
|
* Chat Kit 提供给共享 Store 和业务 Service 的账号运行接口。
|
|
@@ -7662,6 +8131,31 @@ declare namespace forward_service {
|
|
|
7662
8131
|
export type { forward_service_ForwardCommandHooks as ForwardCommandHooks, forward_service_ImForwardOperationResult as ImForwardOperationResult };
|
|
7663
8132
|
}
|
|
7664
8133
|
|
|
8134
|
+
/**
|
|
8135
|
+
* 为宿主手里的本地图片/视频文件预读展示元信息(尺寸、视频时长、视频首帧封面 JPEG 字节)。
|
|
8136
|
+
*
|
|
8137
|
+
* 给「发送前预览」用:宿主要在用户点发送之前就把缩略图画出来。**不要用 `<video>` 当缩略图**——
|
|
8138
|
+
* `preload="metadata"` 在 iOS Safari 上只加载元信息、不解码任何一帧,格子会是空白的,
|
|
8139
|
+
* 而且 N 个文件就是 N 路解码。
|
|
8140
|
+
*
|
|
8141
|
+
* 返回值可以**原样**作为 `localPreviewMetadata` 传给发送命令:发送链路会跳过重复解码,
|
|
8142
|
+
* 上传中的气泡也从第一帧就有封面。视频封面用的就是发送链路那套规格,弹层里看到的与发出去的是同一张。
|
|
8143
|
+
*
|
|
8144
|
+
* @param runtime 当前账号 runtime。
|
|
8145
|
+
* @param input 预读入参。
|
|
8146
|
+
* @param input.kind 文件类型;`'video'` 才会抽首帧与读时长。
|
|
8147
|
+
* @param input.file 本地文件;不上传、不进缓存。
|
|
8148
|
+
* @param input.signal 宿主放弃时中止解码(例如弹层被关掉)。
|
|
8149
|
+
* @returns 解码成功返回元信息;**浏览器确实读不出这个文件**时返回 `null`,
|
|
8150
|
+
* 调用方必须显式呈现「这个文件读不出来」,不要留一块空白让用户以为还在加载。
|
|
8151
|
+
* 账号切换、Client 未就绪同样返回 `null`(此时页面已经不该再画这一格)。
|
|
8152
|
+
* @throws 宿主自己通过 `signal` 中止时抛 `AbortError`;那是调用方的取消,不是文件读不出来。
|
|
8153
|
+
*/
|
|
8154
|
+
declare function prepareLocalMediaPreview<TKind extends 'image' | 'video'>(runtime: ChatRuntime, input: {
|
|
8155
|
+
kind: TKind;
|
|
8156
|
+
file: Blob;
|
|
8157
|
+
signal?: AbortSignal;
|
|
8158
|
+
}): Promise<(TKind extends 'video' ? VideoPreviewMetadata : ImagePreviewMetadata) | null>;
|
|
7665
8159
|
/** 根据文件头确认解密结果是否为 JPEG、PNG、GIF 或 WebP;不是已知图片时返回 `null`,避免页面显示裂图。 */
|
|
7666
8160
|
declare function detectImageMime(bytes: Uint8Array): string | null;
|
|
7667
8161
|
/** 根据文件头识别 WebM 或 MP4;无法识别时返回 `video/mp4`,由浏览器播放器继续判断是否能播放。 */
|
|
@@ -7671,8 +8165,11 @@ declare function detectVideoMime(bytes: Uint8Array): string;
|
|
|
7671
8165
|
*
|
|
7672
8166
|
* 命中时返回带 `url` 和 `release()` 的使用凭证;组件卸载或换源时必须释放。未命中时返回
|
|
7673
8167
|
* `undefined`,调用方继续走远端下载。
|
|
8168
|
+
*
|
|
8169
|
+
* 合集必须传 `itemIndex`:发送链路是**按格**把本地地址登记进注册表的,不带下标查的是一个
|
|
8170
|
+
* 不存在的键,结果是刚发出去的合集点开预览还要重新下载一遍远端。
|
|
7674
8171
|
*/
|
|
7675
|
-
declare function acquireMediaBlob(runtime: ChatRuntime, message: ImMessageView): MediaObjectUrlLease | undefined;
|
|
8172
|
+
declare function acquireMediaBlob(runtime: ChatRuntime, message: ImMessageView, itemIndex?: number): MediaObjectUrlLease | undefined;
|
|
7676
8173
|
/**
|
|
7677
8174
|
* 取得语音播放器需要的完整明文字节。
|
|
7678
8175
|
*
|
|
@@ -7689,6 +8186,26 @@ declare function loadVoiceBytes(runtime: ChatRuntime, message: ImMessageView, ho
|
|
|
7689
8186
|
declare function loadVideoObjectUrl(runtime: ChatRuntime, message: ImMessageView, hooks: ServiceNoteHooks, onProgress?: (percent: number) => void): Promise<string | null>;
|
|
7690
8187
|
/** 仅读取已缓存视频,命中时返回可播放 object URL;miss 不创建下载任务、不显示进度。 */
|
|
7691
8188
|
declare function loadCachedVideoObjectUrl(runtime: ChatRuntime, message: ImMessageView): Promise<string | null>;
|
|
8189
|
+
/**
|
|
8190
|
+
* 下载并解密媒体合集里的某一项,返回预览器可用的临时地址。
|
|
8191
|
+
*
|
|
8192
|
+
* 图片项与视频项走同一条路径:SDK 端按下标取到这一项的 url/teaKey 后,复用的就是单图/单视频的
|
|
8193
|
+
* 解密 loader,所以这里不需要按 kind 分流。图片项额外做一次真实格式校验(与 `loadImageObjectUrl`
|
|
8194
|
+
* 同一条门槛),不把无效二进制交给 `<img>`。
|
|
8195
|
+
*
|
|
8196
|
+
* 返回 `null` 表示下标越界、正文不是合集、内容非法或下载失败,失败原因经 `setNote` 反馈。
|
|
8197
|
+
* **唯一不反馈的失败是用户自己取消**(关预览浮层时取消这一项的在途下载):同样返回 `null`,但不提示。
|
|
8198
|
+
* **调用方在不再使用地址时必须 `URL.revokeObjectURL`。**
|
|
8199
|
+
*/
|
|
8200
|
+
declare function loadMediaAlbumItemObjectUrl(runtime: ChatRuntime, message: ImMessageView, itemIndex: number, hooks: ServiceNoteHooks, onProgress?: (percent: number) => void): Promise<string | null>;
|
|
8201
|
+
/**
|
|
8202
|
+
* 只读取合集某一项已持久化的明文资产并创建 object URL。
|
|
8203
|
+
*
|
|
8204
|
+
* 与 `loadCachedImageObjectUrl` 同一条合同:未缓存、下标越界、账号切换或缓存读取失败都返回 `null`,
|
|
8205
|
+
* 永不触发网络下载、不建下载任务、不显示用户提示,供预览器优先秒开已下载过的那一项。
|
|
8206
|
+
* 还在上传中的项地址是本地 `blob:`,不进这条路径——那一份要走 `acquireMediaBlob`。
|
|
8207
|
+
*/
|
|
8208
|
+
declare function loadCachedMediaAlbumItemObjectUrl(runtime: ChatRuntime, message: ImMessageView, itemIndex: number): Promise<string | null>;
|
|
7692
8209
|
/**
|
|
7693
8210
|
* 下载并解密原图,校验真实图片格式后返回大图查看器可使用的临时地址。
|
|
7694
8211
|
*
|
|
@@ -7714,22 +8231,28 @@ declare const media_service_acquireMediaBlob: typeof acquireMediaBlob;
|
|
|
7714
8231
|
declare const media_service_detectImageMime: typeof detectImageMime;
|
|
7715
8232
|
declare const media_service_detectVideoMime: typeof detectVideoMime;
|
|
7716
8233
|
declare const media_service_loadCachedImageObjectUrl: typeof loadCachedImageObjectUrl;
|
|
8234
|
+
declare const media_service_loadCachedMediaAlbumItemObjectUrl: typeof loadCachedMediaAlbumItemObjectUrl;
|
|
7717
8235
|
declare const media_service_loadCachedVideoObjectUrl: typeof loadCachedVideoObjectUrl;
|
|
7718
8236
|
declare const media_service_loadFileObjectUrl: typeof loadFileObjectUrl;
|
|
7719
8237
|
declare const media_service_loadImageObjectUrl: typeof loadImageObjectUrl;
|
|
8238
|
+
declare const media_service_loadMediaAlbumItemObjectUrl: typeof loadMediaAlbumItemObjectUrl;
|
|
7720
8239
|
declare const media_service_loadVideoObjectUrl: typeof loadVideoObjectUrl;
|
|
7721
8240
|
declare const media_service_loadVoiceBytes: typeof loadVoiceBytes;
|
|
8241
|
+
declare const media_service_prepareLocalMediaPreview: typeof prepareLocalMediaPreview;
|
|
7722
8242
|
declare namespace media_service {
|
|
7723
8243
|
export {
|
|
7724
8244
|
media_service_acquireMediaBlob as acquireMediaBlob,
|
|
7725
8245
|
media_service_detectImageMime as detectImageMime,
|
|
7726
8246
|
media_service_detectVideoMime as detectVideoMime,
|
|
7727
8247
|
media_service_loadCachedImageObjectUrl as loadCachedImageObjectUrl,
|
|
8248
|
+
media_service_loadCachedMediaAlbumItemObjectUrl as loadCachedMediaAlbumItemObjectUrl,
|
|
7728
8249
|
media_service_loadCachedVideoObjectUrl as loadCachedVideoObjectUrl,
|
|
7729
8250
|
media_service_loadFileObjectUrl as loadFileObjectUrl,
|
|
7730
8251
|
media_service_loadImageObjectUrl as loadImageObjectUrl,
|
|
8252
|
+
media_service_loadMediaAlbumItemObjectUrl as loadMediaAlbumItemObjectUrl,
|
|
7731
8253
|
media_service_loadVideoObjectUrl as loadVideoObjectUrl,
|
|
7732
8254
|
media_service_loadVoiceBytes as loadVoiceBytes,
|
|
8255
|
+
media_service_prepareLocalMediaPreview as prepareLocalMediaPreview,
|
|
7733
8256
|
};
|
|
7734
8257
|
}
|
|
7735
8258
|
|
|
@@ -8197,6 +8720,13 @@ declare function fetchConversationVoiceBatch(runtime: ChatRuntime, input: Browse
|
|
|
8197
8720
|
*/
|
|
8198
8721
|
declare function fetchNextConversationSearchBatch(runtime: ChatRuntime, pageToken: ImPageToken): Promise<SearchBatchResult>;
|
|
8199
8722
|
|
|
8723
|
+
type GifFileClassification = 'gif' | 'not-gif' | 'invalid-gif';
|
|
8724
|
+
/**
|
|
8725
|
+
* 同时核对 MIME 与文件头,避免 GIF 合同冲突的文件回落到普通 IMAGE 链路。
|
|
8726
|
+
*
|
|
8727
|
+
* 浏览器 MIME 可以为空;一旦 MIME 或文件头任一方声明 GIF,另一方就必须一致。
|
|
8728
|
+
*/
|
|
8729
|
+
declare function classifyGifFile(file: Blob): Promise<GifFileClassification>;
|
|
8200
8730
|
declare function isGifFile(file: Blob): Promise<boolean>;
|
|
8201
8731
|
|
|
8202
8732
|
/**
|
|
@@ -8330,12 +8860,18 @@ declare function sendVoice(runtime: ChatRuntime, input: {
|
|
|
8330
8860
|
conversationType: ConversationType | undefined;
|
|
8331
8861
|
refMessageId?: string;
|
|
8332
8862
|
}, hooks: SendCommandHooks): Promise<boolean>;
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
|
|
8337
|
-
|
|
8338
|
-
|
|
8863
|
+
declare function sendMediaAlbum(runtime: ChatRuntime, input: {
|
|
8864
|
+
items: readonly {
|
|
8865
|
+
kind: 'image' | 'video';
|
|
8866
|
+
file: File;
|
|
8867
|
+
localPreviewMetadata?: ImagePreviewMetadata | VideoPreviewMetadata;
|
|
8868
|
+
}[];
|
|
8869
|
+
conversationId: string;
|
|
8870
|
+
conversationType: ConversationType | undefined;
|
|
8871
|
+
caption?: string;
|
|
8872
|
+
hd?: boolean;
|
|
8873
|
+
refMessageId?: string;
|
|
8874
|
+
}, hooks: SendCommandHooks): Promise<boolean>;
|
|
8339
8875
|
declare function sendMediaFilesBatch(runtime: ChatRuntime, input: {
|
|
8340
8876
|
files: File[];
|
|
8341
8877
|
conversationId: string;
|
|
@@ -9130,5 +9666,5 @@ declare function resampleWaveform(data: readonly number[], targetCount: number):
|
|
|
9130
9666
|
*/
|
|
9131
9667
|
declare function placeholderWaveform(seed: string, count: number): number[];
|
|
9132
9668
|
|
|
9133
|
-
export { DEFAULT_EMOJI_ASSET_BASE, DEFAULT_LOADING_MINIMUM_VISIBLE_MS, DEFAULT_LOADING_SHOW_DELAY_MS, DEFAULT_LOCALE, EDIT_WINDOW_MS, EMOJI_CATALOG, EMOJI_GAME_DICE_STABLE_KEY, EMOJI_GAME_RPS_STABLE_KEY, EMOJI_TOKEN_RE, IM_CHAT_FONT_SCALES, IM_DIAGNOSTIC_CATEGORIES, IM_EMOJI_CATALOG, ImPinnedMessageOperationError, MAX_BATCH_FILES, MAX_RECENT_EMOJI_COUNT, MediaTransferError, REACTION_SUPPORTED_CONTENT_TYPES, SPIKE_STEP, UNICODE_EMOJI_CATALOG, blockReasonForChannelSession, blockReasonForChannelState, blockReasonForGroupState, blockReasonForSession, buildSessionFavoritePlainBody, calculateMediaBox, canEditMessage, canPinChannelMessage, canPinGroupMessage, canPinMessage, canPromoteMediaPresentationSource, canReactToMessage, canRecallMessage, canTransmit, canTransmitByType, canTransmitContent, cancelMediaUpload, captureRuntimeClientOperation, captureRuntimeOperation, classifyStickerImageType, createChatRuntime, createDelayedLoadingIndicator, createEmojiMatcher, createFaceToFaceGroupQrPayload, createImClient, createImConsoleDiagnosticSink, createImDiagnosticMemoryBuffer, createImI18n, createImTextSearchMatcher, createLinkMatcher, createNewMessageBadgeController, createSdkDiagnosticWriter, createThreadItems, createVoicePlayer, createVoiceRecordingSession, decideConversationAction, decideMemberTargetAction, decideMessageAction, detectVoiceCapabilities, emojiAssetUrl, emojiUrlByCode, extractSearchText, fetchConversationFileBatch, fetchConversationImageBatch, fetchConversationMessageBatch, fetchConversationVideoBatch, fetchConversationVoiceBatch, fetchNextConversationSearchBatch, formatChatDateSeparator, formatConversationDisplayTime, formatFailure, formatFileSize, formatLastMessageSummary, formatMediaDuration, formatMediaPlaceholder, formatMentionAll, formatServiceText, formatSystemMessage, forward_service as forwardService, getFileExtension, getImTextSearchInitial, getImTimeCatalog, getLocalDayKey, hasEmojiCandidate, hasLinkCandidate, highlightSegments, isGifFile, isMessageLocateScrollProtected, isMessageTailChangeFromOlderWindowTrim, isMessageViewportMeasurable, isMessageVisibleForNewMessageBadge, isPinnedMessageProtected, isVoiceStorageConfigured, loadOlderUntilBoundary, mediaBatchBudgetBytes, media_service as mediaService, mediaTransferErrorCodeOf, message_service as messageService, migrateImCachePrefix, normalizeImLocale, normalizeLinkHref, normalizeMediaUploadCredentials, parseUnicodeEmojiCode, pinnedMessage_service as pinnedMessageService, placeholderWaveform, prependRecentEmoji, profile_service as profileService, read_service as readService, refreshPrependMessageAnchorPosition, registerImCatalogOverrides, replaceInterruptedMediaFile, requiresConversationEncryption, requiresForwardTypeConfirmation, resampleWaveform, resetImCatalogOverrides, resolveBestMediaPresentationSource, resolveCenteredMessageScrollTop, resolveChannelAccess, resolveChannelMemberAvatarUrl, resolveChannelMemberDisplayName, resolveConversationListPresentation, resolveDisplayTimestamp, resolveEmojiToken, resolveFriendDisplayName, resolveImEmojiToken, resolveImProfileAccessDestination, resolveImThreadActiveDate, resolveMediaPresentation, resolveMemberDisplayName, resolveMessageBodyKind, resolveMessageTimelineTimestamp, resolvePrependMessageAnchor, resolvePrependMessageAnchorAdjustment, resolvePrependMessageAnchorPosition, resolvePublicNickname, resolveQuotedMessagePresentation, resolveSenderAvatarUrl, resolveSessionFavoriteKindFromMessage, resolveStandaloneEmojiMessage, resolveSurvivingMessageAnchorAdjustment, resolveTextSegments, resolveUnicodeEmoji, resolveVisibleMessageAnchorPositions, retryMessage, runMediaSendBatch, sendAsFilesBatch, sendBlockReasonForDecision, sendMediaFile, sendMediaFilesBatch, sendText, sendVoice, shouldCompleteInitialViewport, shouldFillInitialHistoryViewport, shouldFollowIncomingMessage, shouldLoadNewerHistoryPage, shouldPrefetchOlderHistory, shouldRestoreMessageViewportFocus, shouldShowChatDateSeparator, shouldTrackRemoteMessageForBadge, sortSessions, spikeCountForDuration, sumSessionsUnread, supportsConversationMention, unicodeEmojiTextFromCode, voiceErrorCodeOf };
|
|
9134
|
-
export type { ApplySessionResult, BrowseMessagesInput, CanPinMessageInput, CapabilityAvailability, CapabilityDecision, CapabilityReason, CenteredMessageScrollInput, ChannelAccessSnapshot, ChannelBaseSessionState, ChannelConversationCapabilities, ChannelConversationMessageApi, ChannelJoinApplication, ChannelJoinApplicationNotification, ChannelJoinApplicationPage, ChannelMember, ChannelMemberPage, ChannelMentionMember, ChannelMentionMemberPage, ChannelMiniProgramRel, ChannelMiniProgramRelConfigType, ChannelMuteReason, ChannelPermissionSet, ChannelProfile, ChannelRole, ChannelSessionState, ChatMediaMessageRef, ChatProfileAdapter, ChatRuntime, ChatRuntimeCredentials, ChatRuntimeFactories, ChatRuntimeHostDeps, ChatRuntimeOpResult, ContactCardInput, ContactMessageOptions, ConversationBackgroundPreset, ConversationBackgroundSelection, ConversationCapabilityAction, ConversationCapabilitySnapshot, ConversationDraft, ConversationDraftApi, ConversationEntryUnreadSnapshot, ConversationHandle, ConversationHandleSnapshot, ConversationInitialPosition, ConversationLastMessageSummary, ConversationListItem, ConversationListMention, ConversationListPresentation, ConversationListPresentationLabels, ConversationListPresentationOptions, ConversationListPreviewSegment, ConversationMessageApi, ConversationOpenOptions, ConversationRef, ConversationSearchCategory, ConversationSearchPage, ConversationSearchResult, ConversationSystemSummary, ConversationType, CreateThreadItemsInput, DelayedLoadingIndicator, DelayedLoadingIndicatorOptions, DirectConversationCapabilities, DirectConversationMessageApi, DraftInput, EditTextOptions, EmojiEntry, EmojiRecentItem, EmojiSegment, ExpressionMessageOptions, FileMessageOptions, FormatFailureContext, FormatLastMessageContext, FormatMediaPlaceholderContext, FormatServiceTextContext, FormatSystemMessageContext, FormatTimeDisplayContext, ForwardCommandHooks, ForwardFailReason, ForwardItemStatus, ForwardMessageFailure, ForwardMessagesInput, ForwardMessagesResult, ForwardTarget, ForwardedMessageRef, GameMessageOptions, GifMessageOptions, GroupConversationCapabilities, GroupConversationMessageApi, GroupMemberItem, GroupProfile, HighlightSegment, ImAppearanceSettingsApi, ImApplicationItem, ImApplicationRef, ImApplicationsApi, ImAuthIssue, ImAuthProvider, ImCacheOptions, ImCachePrefixMigrationContext, ImCachePrefixMigrator, ImCallKind, ImCallOutcome, ImCallRecordBody, ImCatalog, ImCatalogOverrides, ImChannelConversationAccessSnapshot, ImChannelMemberPresentation, ImChannelMentionApi, ImChannelMentionPresentation, ImChannelMiniProgramRel, ImChannelPermissions, ImChannelPinnedMessage, ImChannelProfile, ImChannelProfilePresentation, ImChannelRole, ImChannelState, ImChannelsApi, ImChatFontScale, ImClientOptions, ImConnectionState, ImContactBody, ImContactKind, ImContactProfile, ImContactRelationship, ImContactRemarkPhone, ImContactSearchResult, ImContactsApi, ImConversationBackgroundApi, ImConversationCapabilitiesApi, ImConversationListApi, ImConversationListSnapshot, ImConversationListState, ImConversationSearchApi, ImCoreApiOptions, ImCreateChannelInput, ImCreateChannelResult, ImCreateFaceToFaceGroupResult, ImCreateGroupInput, ImCreateGroupResult, ImCreatedChannel, ImCreatedGroup, ImDebugOptions, ImDiagnosticCategory, ImDiagnosticError, ImDiagnosticLayer, ImDiagnosticLevel, ImDiagnosticMemoryBuffer, ImDiagnosticMemoryBufferFilter, ImDiagnosticMemoryBufferOptions, ImDiagnosticMemoryBufferSnapshot, ImDiagnosticMessage, ImDiagnosticRecord, ImDiagnosticSink, ImDiagnosticWriter, ImDirectCallAnswerResult, ImDirectCallFailReason, ImDirectCallHangupInput, ImDirectCallHangupReason, ImDirectCallInviteInput, ImDirectCallNotifyAudioInput, ImDirectCallTargetInput, ImDirectCallsApi, ImDirectReadReceiptSettings, ImDirectoryApi, ImDirectoryFieldMatch, ImDirectoryItem, ImDirectoryKind, ImDirectoryPage, ImDirectorySearchApi, ImDirectorySearchItem, ImDirectorySearchResult, ImDraftsApi, ImEmojiCatalogEntry, ImEndpointProvider, ImEventsApi, ImExpressionAsset, ImExpressionAssetInput, ImExpressionEmojiRecentInput, ImExpressionFavoriteKind, ImExpressionOptions, ImExpressionRecentInput, ImExpressionRecentItem, ImExpressionRecentItemKind, ImExpressionsApi, ImFaceToFaceGroup, ImFailureCatalog, ImFileBody, ImForwardOperationResult, ImFriendshipRequestResult, ImGameBody, ImGameType, ImGifAssetInput, ImGiphyAsset, ImGiphyPage, ImGiphyPageOptions, ImGroupCallAnswerInput, ImGroupCallBusyInput, ImGroupCallCreateInput, ImGroupCallJoinInput, ImGroupCallMeetingSnapshot, ImGroupCallMember, ImGroupCallMemberStatus, ImGroupCallStatusInput, ImGroupCallTargetInput, ImGroupCallsApi, ImGroupConversationState, ImGroupMemberPresentation, ImGroupMentionApi, ImGroupPinnedMessage, ImGroupProfile, ImGroupsApi, ImI18n, ImImageBody, ImLastMessageCatalog, ImLifecycleSnapshot, ImLocalDataApi, ImLocalDataInfo, ImLocale, ImLogoutOptions, ImMediaBatchSendResult, ImMediaCatalog, ImMediaConfig, ImMediaTask, ImMediaTasksApi, ImMembershipJoinResult, ImMentionCatalog, ImMessageActionResult, ImMessageBodyKind, ImMessageMention, ImMessageReactionAggregate, ImMessageReactions, ImMessageRef, ImMessageSearchApi, ImMessageView, ImMessageViewBody, ImMessagesByIdResult, ImMiniProgramBody, ImMiniProgramShowType, ImOutboxApi, ImOutboxItem, ImPageToken, ImPartialCatalog, ImPinnedMessageActionResult, ImPinnedMessageErrorKind, ImPinnedMessageOperation, ImPinnedMessageSnapshot, ImProductApplicationUpdate, ImProductAuthInvalidReason, ImProductClient, ImProductEvent, ImProductEventError, ImProductEventMap, ImProductMessage, ImProfileAccessDestination, ImQuotedMessagePresentation, ImReactionChangeAction, ImReactionChangeResult, ImReadReceiptSettingsApi, ImRedPacketBody, ImRedPacketType, ImSdkErrorCategory, ImSdkErrorShape, ImSearchApi, ImServiceCatalog, ImServiceTextKey, ImSessionApi, ImSessionFavoriteItem, ImSessionFavoriteKind, ImSessionFavoritesApi, ImSessionLifecycleState, ImSettingsApi, ImStickerAssetInput, ImStickerBody, ImStickerPack, ImSupportedConversationRef, ImSystemCatalog, ImTextResolver, ImTextSearchMatch, ImTextSearchMatchOptions, ImTextSearchMatcher, ImTextSearchRange, ImThreadActiveDateSnapshot, ImThreadDateMarkerMetric, ImThreadDecoration, ImThreadEncryptionItem, ImThreadIntent, ImThreadItem, ImThreadPresentationAdapter, ImThreadReadActions, ImThreadReadTargetResolver, ImThreadViewportMetrics, ImTimeCatalog, ImTransferBody, ImTransferSessionType, ImTransferStatus, ImVideoBody, ImVoiceBody, ImWeekdayKey, ImageMessageOptions, ImagePreviewMetadata, IncomingMessageFollowInput, InitialHistoryViewportFillInput, InitialViewportCompletionInput, LinkSegment, LocalConversationHistoryClearResult, LocalMessageDeletionResult, MediaBatchBudgetOptions, MediaBatchLimitInfo, MediaLimitItem, MediaObjectUrlLease, MediaPresentationFit, MediaPresentationPolicy, MediaPresentationRule, MediaPresentationSourceCandidate, MediaPresentationSourceQuality, MediaSendBatchResult, MediaTransferErrorCode, MediaUploadCredentials, MediaUploadCredentialsProvider, MediaUploadCredentialsRequest, MemberTargetCapabilityAction, MemberTargetCapabilityInput, MentionCandidate, MentionCandidatePage, MentionInput, MessageCapabilityAction, MessageCapabilityInput, MessageContentType, MessageLocateScrollProtectionInput, MessageWindowInfo, MessageWindowPage, MessagesByIdFailure, MigrateImCachePrefixInput, MiniProgramMessageOptions, NewMessageBadgeController, NewMessageBadgeCountListener, NewMessageBadgeVisibilityInput, NewerHistoryPageTriggerInput, OlderHistoryPrefetchInput, PrependAnchorCandidate, PrependAnchorViewport, PrependMessageAnchorPosition, ProductConversationListType, ProductHandleConversationType, ProductMessageSearchPage, ProductMessageSearchResult, RemoteMessageBadgeTrackingInput, ResolveMediaPresentationInput, ResolveTextOptions, ResolvedConversationBackground, ResolvedMediaPresentation, RichExtraSegment, RuntimeClientOperation, RuntimeOperation, SearchBatchResult, SearchFilesInput, SearchMessagesInput, SearchTextMessagesInput, SegmentMatch, SegmentMatcher, SendCapabilityMode, SendCommandHooks, SendMessageResult, SendVoicePayload, SenderProfileEntry, ServiceNoteHooks, StandaloneEmojiMessage, StickerAssetKind, TextMessageOptions, TextSegment, TransferMessageOptions, UnicodeEmojiEntry, UnknownMessageBody, UserProfile, VideoMessageOptions, VideoPreviewMetadata, VoiceCapabilities, VoiceErrorCode, VoiceMessageMetadata, VoicePlayer, VoicePlayerOptions, VoicePlayerState, VoiceRecordingResult, VoiceRecordingSession, VoiceRecordingSessionOptions, VoiceRecordingState, VoiceToggleOptions };
|
|
9669
|
+
export { DEFAULT_EMOJI_ASSET_BASE, DEFAULT_LOADING_MINIMUM_VISIBLE_MS, DEFAULT_LOADING_SHOW_DELAY_MS, DEFAULT_LOCALE, EDIT_WINDOW_MS, EMOJI_CATALOG, EMOJI_GAME_DICE_STABLE_KEY, EMOJI_GAME_RPS_STABLE_KEY, EMOJI_TOKEN_RE, IM_CHAT_FONT_SCALES, IM_DIAGNOSTIC_CATEGORIES, IM_EMOJI_CATALOG, ImPinnedMessageOperationError, MAX_BATCH_FILES, MAX_RECENT_EMOJI_COUNT, MEDIA_ALBUM_CAPTION_MAX_LENGTH, MEDIA_ALBUM_MAX_ITEMS, MediaTransferError, REACTION_SUPPORTED_CONTENT_TYPES, SPIKE_STEP, UNICODE_EMOJI_CATALOG, blockReasonForChannelSession, blockReasonForChannelState, blockReasonForGroupState, blockReasonForSession, buildSessionFavoritePlainBody, calculateMediaBox, canEditMessage, canPinChannelMessage, canPinGroupMessage, canPinMessage, canPromoteMediaPresentationSource, canReactToMessage, canRecallMessage, canTransmit, canTransmitByType, canTransmitContent, cancelMediaUpload, captureRuntimeClientOperation, captureRuntimeOperation, classifyGifFile, classifyStickerImageType, createChatRuntime, createDelayedLoadingIndicator, createEmojiMatcher, createFaceToFaceGroupQrPayload, createImClient, createImConsoleDiagnosticSink, createImDiagnosticMemoryBuffer, createImI18n, createImTextSearchMatcher, createLinkMatcher, createNewMessageBadgeController, createSdkDiagnosticWriter, createThreadItems, createVoicePlayer, createVoiceRecordingSession, decideConversationAction, decideMemberTargetAction, decideMessageAction, detectVoiceCapabilities, emojiAssetUrl, emojiUrlByCode, extractSearchText, fetchConversationFileBatch, fetchConversationImageBatch, fetchConversationMessageBatch, fetchConversationVideoBatch, fetchConversationVoiceBatch, fetchNextConversationSearchBatch, formatChatDateSeparator, formatConversationDisplayTime, formatFailure, formatFileSize, formatLastMessageSummary, formatMediaDuration, formatMediaPlaceholder, formatMentionAll, formatServiceText, formatSystemMessage, forward_service as forwardService, getFileExtension, getImTextSearchInitial, getImTimeCatalog, getLocalDayKey, hasEmojiCandidate, hasLinkCandidate, highlightSegments, isGifFile, isMessageLocateScrollProtected, isMessageTailChangeFromOlderWindowTrim, isMessageViewportMeasurable, isMessageVisibleForNewMessageBadge, isPinnedMessageProtected, isVoiceStorageConfigured, loadOlderUntilBoundary, mediaBatchBudgetBytes, media_service as mediaService, mediaTransferErrorCodeOf, message_service as messageService, migrateImCachePrefix, normalizeImLocale, normalizeLinkHref, normalizeMediaUploadCredentials, parseSessionFavoriteAlbumItems, parseUnicodeEmojiCode, pinnedMessage_service as pinnedMessageService, placeholderWaveform, prependRecentEmoji, profile_service as profileService, read_service as readService, refreshPrependMessageAnchorPosition, registerImCatalogOverrides, replaceInterruptedMediaFile, requiresConversationEncryption, requiresForwardTypeConfirmation, resampleWaveform, resetImCatalogOverrides, resolveBestMediaPresentationSource, resolveCenteredMessageScrollTop, resolveChannelAccess, resolveChannelMemberAvatarUrl, resolveChannelMemberDisplayName, resolveConversationListPresentation, resolveDisplayTimestamp, resolveEmojiToken, resolveFriendDisplayName, resolveImEmojiToken, resolveImProfileAccessDestination, resolveImThreadActiveDate, resolveMediaAlbumSendContentType, resolveMediaPresentation, resolveMemberDisplayName, resolveMessageBodyKind, resolveMessageNotificationDecision, resolveMessageTimelineTimestamp, resolvePrependMessageAnchor, resolvePrependMessageAnchorAdjustment, resolvePrependMessageAnchorPosition, resolvePublicNickname, resolveQuotedMessagePresentation, resolveSenderAvatarUrl, resolveSessionFavoriteAlbumCaption, resolveSessionFavoriteAlbumItemPreviewUrl, resolveSessionFavoriteKindFromMessage, resolveStandaloneEmojiMessage, resolveSurvivingMessageAnchorAdjustment, resolveTextSegments, resolveUnicodeEmoji, resolveVisibleMessageAnchorPositions, retryMessage, runMediaSendBatch, sendAsFilesBatch, sendBlockReasonForDecision, sendMediaAlbum, sendMediaFile, sendMediaFilesBatch, sendText, sendVoice, shouldCompleteInitialViewport, shouldFillInitialHistoryViewport, shouldFollowIncomingMessage, shouldLoadNewerHistoryPage, shouldPrefetchOlderHistory, shouldRestoreMessageViewportFocus, shouldShowChatDateSeparator, shouldTrackRemoteMessageForBadge, sortSessions, spikeCountForDuration, sumSessionsUnread, supportsConversationMention, unicodeEmojiTextFromCode, voiceErrorCodeOf };
|
|
9670
|
+
export type { ApplySessionResult, BrowseMessagesInput, CanPinMessageInput, CapabilityAvailability, CapabilityDecision, CapabilityReason, CenteredMessageScrollInput, ChannelAccessSnapshot, ChannelBaseSessionState, ChannelConversationCapabilities, ChannelConversationMessageApi, ChannelJoinApplication, ChannelJoinApplicationNotification, ChannelJoinApplicationPage, ChannelMember, ChannelMemberPage, ChannelMentionMember, ChannelMentionMemberPage, ChannelMiniProgramRel, ChannelMiniProgramRelConfigType, ChannelMuteReason, ChannelPermissionSet, ChannelProfile, ChannelRole, ChannelSessionState, ChatMediaMessageRef, ChatProfileAdapter, ChatRuntime, ChatRuntimeCredentials, ChatRuntimeFactories, ChatRuntimeHostDeps, ChatRuntimeOpResult, ContactCardInput, ContactMessageOptions, ConversationBackgroundPreset, ConversationBackgroundSelection, ConversationCapabilityAction, ConversationCapabilitySnapshot, ConversationDraft, ConversationDraftApi, ConversationEntryUnreadSnapshot, ConversationHandle, ConversationHandleSnapshot, ConversationInitialPosition, ConversationLastMessageSummary, ConversationListItem, ConversationListMention, ConversationListPresentation, ConversationListPresentationLabels, ConversationListPresentationOptions, ConversationListPreviewMediaKind, ConversationListPreviewSegment, ConversationMessageApi, ConversationOpenOptions, ConversationRef, ConversationSearchCategory, ConversationSearchPage, ConversationSearchResult, ConversationSystemSummary, ConversationType, CreateThreadItemsInput, DelayedLoadingIndicator, DelayedLoadingIndicatorOptions, DirectConversationCapabilities, DirectConversationMessageApi, DraftInput, EditTextOptions, EmojiEntry, EmojiRecentItem, EmojiSegment, ExpressionMessageOptions, FileMessageOptions, FormatFailureContext, FormatLastMessageContext, FormatMediaPlaceholderContext, FormatServiceTextContext, FormatSystemMessageContext, FormatTimeDisplayContext, ForwardCommandHooks, ForwardFailReason, ForwardItemStatus, ForwardMessageFailure, ForwardMessagesInput, ForwardMessagesResult, ForwardTarget, ForwardedMessageRef, GameMessageOptions, GifFileClassification, GifMessageOptions, GroupConversationCapabilities, GroupConversationMessageApi, GroupMemberItem, GroupProfile, HighlightSegment, ImAppearanceSettingsApi, ImApplicationItem, ImApplicationRef, ImApplicationsApi, ImAuthIssue, ImAuthProvider, ImCacheOptions, ImCachePrefixMigrationContext, ImCachePrefixMigrator, ImCallKind, ImCallOutcome, ImCallRecordBody, ImCatalog, ImCatalogOverrides, ImChannelConversationAccessSnapshot, ImChannelMemberPresentation, ImChannelMentionApi, ImChannelMentionPresentation, ImChannelMiniProgramRel, ImChannelPermissions, ImChannelPinnedMessage, ImChannelProfile, ImChannelProfilePresentation, ImChannelRole, ImChannelState, ImChannelsApi, ImChatFontScale, ImClientOptions, ImConnectionState, ImContactBody, ImContactKind, ImContactProfile, ImContactRelationship, ImContactRemarkPhone, ImContactSearchResult, ImContactsApi, ImConversationBackgroundApi, ImConversationCapabilitiesApi, ImConversationListApi, ImConversationListSnapshot, ImConversationListState, ImConversationSearchApi, ImCoreApiOptions, ImCreateChannelInput, ImCreateChannelResult, ImCreateFaceToFaceGroupResult, ImCreateGroupInput, ImCreateGroupResult, ImCreatedChannel, ImCreatedGroup, ImDebugOptions, ImDiagnosticCategory, ImDiagnosticError, ImDiagnosticLayer, ImDiagnosticLevel, ImDiagnosticMemoryBuffer, ImDiagnosticMemoryBufferFilter, ImDiagnosticMemoryBufferOptions, ImDiagnosticMemoryBufferSnapshot, ImDiagnosticMessage, ImDiagnosticRecord, ImDiagnosticSink, ImDiagnosticWriter, ImDirectCallAnswerResult, ImDirectCallFailReason, ImDirectCallHangupInput, ImDirectCallHangupReason, ImDirectCallInviteInput, ImDirectCallNotifyAudioInput, ImDirectCallTargetInput, ImDirectCallsApi, ImDirectReadReceiptSettings, ImDirectoryApi, ImDirectoryFieldMatch, ImDirectoryItem, ImDirectoryKind, ImDirectoryPage, ImDirectorySearchApi, ImDirectorySearchItem, ImDirectorySearchResult, ImDraftsApi, ImEmojiCatalogEntry, ImEndpointProvider, ImEventsApi, ImExpressionAsset, ImExpressionAssetInput, ImExpressionEmojiRecentInput, ImExpressionFavoriteKind, ImExpressionOptions, ImExpressionRecentInput, ImExpressionRecentItem, ImExpressionRecentItemKind, ImExpressionsApi, ImFaceToFaceGroup, ImFailureCatalog, ImFileBody, ImForwardOperationResult, ImFriendshipRequestResult, ImGameBody, ImGameType, ImGifAssetInput, ImGiphyAsset, ImGiphyPage, ImGiphyPageOptions, ImGroupCallAnswerInput, ImGroupCallBusyInput, ImGroupCallCreateInput, ImGroupCallJoinInput, ImGroupCallMeetingSnapshot, ImGroupCallMember, ImGroupCallMemberStatus, ImGroupCallStatusInput, ImGroupCallTargetInput, ImGroupCallsApi, ImGroupConversationState, ImGroupMemberPresentation, ImGroupMentionApi, ImGroupPinnedMessage, ImGroupProfile, ImGroupsApi, ImI18n, ImImageBody, ImLastMessageCatalog, ImLifecycleSnapshot, ImLocalDataApi, ImLocalDataInfo, ImLocale, ImLogoutOptions, ImMediaAlbumBody, ImMediaAlbumItem, ImMediaBatchSendResult, ImMediaCatalog, ImMediaConfig, ImMediaTask, ImMediaTasksApi, ImMembershipJoinResult, ImMentionCatalog, ImMessageActionResult, ImMessageBodyKind, ImMessageMention, ImMessageReactionAggregate, ImMessageReactions, ImMessageRef, ImMessageSearchApi, ImMessageView, ImMessageViewBody, ImMessagesByIdResult, ImMiniProgramBody, ImMiniProgramShowType, ImOutboxApi, ImOutboxItem, ImPageToken, ImPartialCatalog, ImPinnedMessageActionResult, ImPinnedMessageErrorKind, ImPinnedMessageOperation, ImPinnedMessageSnapshot, ImProductApplicationUpdate, ImProductAuthInvalidReason, ImProductClient, ImProductEvent, ImProductEventError, ImProductEventMap, ImProductMessage, ImProfileAccessDestination, ImPushApi, ImPushSnapshot, ImQuotedMessagePresentation, ImReactionChangeAction, ImReactionChangeResult, ImReadReceiptSettingsApi, ImRedPacketBody, ImRedPacketType, ImSdkErrorCategory, ImSdkErrorShape, ImSearchApi, ImServiceCatalog, ImServiceTextKey, ImSessionApi, ImSessionFavoriteAlbumItem, ImSessionFavoriteItem, ImSessionFavoriteKind, ImSessionFavoritesApi, ImSessionLifecycleState, ImSettingsApi, ImStickerAssetInput, ImStickerBody, ImStickerPack, ImSupportedConversationRef, ImSystemCatalog, ImTextResolver, ImTextSearchMatch, ImTextSearchMatchOptions, ImTextSearchMatcher, ImTextSearchRange, ImThreadActiveDateSnapshot, ImThreadDateMarkerMetric, ImThreadDecoration, ImThreadEncryptionItem, ImThreadIntent, ImThreadItem, ImThreadPresentationAdapter, ImThreadReadActions, ImThreadReadTargetResolver, ImThreadViewportMetrics, ImTimeCatalog, ImTransferBody, ImTransferSessionType, ImTransferStatus, ImVideoBody, ImVoiceBody, ImWebPushSubscription, ImWeekdayKey, ImageMessageOptions, ImagePreviewMetadata, IncomingMessageFollowInput, InitialHistoryViewportFillInput, InitialViewportCompletionInput, LinkSegment, LocalConversationHistoryClearResult, LocalMessageDeletionResult, MediaAlbumItemInput, MediaAlbumMessageOptions, MediaBatchBudgetOptions, MediaBatchLimitInfo, MediaLimitItem, MediaObjectUrlLease, MediaPresentationFit, MediaPresentationPolicy, MediaPresentationRule, MediaPresentationSourceCandidate, MediaPresentationSourceQuality, MediaSendBatchResult, MediaTransferErrorCode, MediaUploadCredentials, MediaUploadCredentialsProvider, MediaUploadCredentialsRequest, MemberTargetCapabilityAction, MemberTargetCapabilityInput, MentionCandidate, MentionCandidatePage, MentionInput, MessageCapabilityAction, MessageCapabilityInput, MessageContentType, MessageLocateScrollProtectionInput, MessageNotificationDecision, MessageNotificationInput, MessageWindowInfo, MessageWindowPage, MessagesByIdFailure, MigrateImCachePrefixInput, MiniProgramMessageOptions, NewMessageBadgeController, NewMessageBadgeCountListener, NewMessageBadgeVisibilityInput, NewerHistoryPageTriggerInput, OlderHistoryPrefetchInput, PrependAnchorCandidate, PrependAnchorViewport, PrependMessageAnchorPosition, ProductConversationListType, ProductHandleConversationType, ProductMessageSearchPage, ProductMessageSearchResult, RemoteMessageBadgeTrackingInput, ResolveMediaPresentationInput, ResolveTextOptions, ResolvedConversationBackground, ResolvedMediaPresentation, RichExtraSegment, RuntimeClientOperation, RuntimeOperation, SearchBatchResult, SearchFilesInput, SearchMessagesInput, SearchTextMessagesInput, SegmentMatch, SegmentMatcher, SendCapabilityMode, SendCommandHooks, SendMessageResult, SendVoicePayload, SenderProfileEntry, ServiceNoteHooks, StandaloneEmojiMessage, StickerAssetKind, TextMessageOptions, TextSegment, TransferMessageOptions, UnicodeEmojiEntry, UnknownMessageBody, UserProfile, VideoMessageOptions, VideoPreviewMetadata, VoiceCapabilities, VoiceErrorCode, VoiceMessageMetadata, VoicePlayer, VoicePlayerOptions, VoicePlayerState, VoiceRecordingResult, VoiceRecordingSession, VoiceRecordingSessionOptions, VoiceRecordingState, VoiceToggleOptions };
|