k2-im 0.1.28 → 0.1.30

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.
@@ -39,8 +39,8 @@ interface ConversationDraft$1 {
39
39
  attachments: readonly [];
40
40
  updatedAt: number;
41
41
  }
42
- /** 消息内容类型。sticker=表情/贴图(BMessage contentType=7);call=单聊通话记录(contentType=10);transfer=转账(contentType=16);miniProgram=小程序分享卡(contentType=22);redPacket=红包卡(contentType=25);game=小游戏(contentType=27);未知 wire 正文统一归一为 unknown。 */
43
- type MessageContentType = 'text' | 'system' | 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'contact' | 'miniProgram' | 'game' | 'transfer' | 'call' | 'redPacket' | 'mediaAlbum' | 'unknown';
42
+ /** 消息内容类型。sticker=表情/贴图(BMessage contentType=7);call=单聊通话记录(contentType=10);transfer=转账(contentType=16);robot=机器人卡片(contentType=18);miniProgram=小程序分享卡(contentType=22);redPacket=红包卡(contentType=25);game=小游戏(contentType=27);未知 wire 正文统一归一为 unknown。 */
43
+ type MessageContentType = 'text' | 'system' | 'image' | 'video' | 'voice' | 'file' | 'sticker' | 'contact' | 'miniProgram' | 'game' | 'transfer' | 'call' | 'redPacket' | 'mediaAlbum' | 'robot' | 'unknown';
44
44
  /**
45
45
  * 发送态(客户端态):消息从本地创建到服务端确认的生命周期。
46
46
  * `uploading` 仅媒体消息使用:文件上传阶段(uploading→pending→sending→sent);
@@ -102,6 +102,8 @@ type LastMessageSummary = {
102
102
  kind: 'contact';
103
103
  } | {
104
104
  kind: 'miniProgram';
105
+ } | {
106
+ kind: 'robot';
105
107
  } | {
106
108
  kind: 'game';
107
109
  gameType: ImGameType;
@@ -136,6 +138,13 @@ type LastMessageSummary = {
136
138
  firstItemKind?: 'image' | 'video';
137
139
  } | {
138
140
  kind: 'encrypted';
141
+ }
142
+ /**
143
+ * 密文解密失败/缺密钥占位。必须独立于 `encrypted`:后者只表示「还是密文」,
144
+ * 前者要对齐 iOS 解密失败长文案,不能再伪装成「[加密消息]」。
145
+ */
146
+ | {
147
+ kind: 'decrypt-failed';
139
148
  } | {
140
149
  kind: 'recalled';
141
150
  by: string;
@@ -190,8 +199,12 @@ interface ImVideoBody {
190
199
  thumbData?: Uint8Array;
191
200
  /** 视频文件 MD5(BMessage.MD5;Android 当前未赋值,保留可选)。 */
192
201
  md5?: string;
193
- /** 文件大小(字节;协议 BMessage.fileLength 单位 KB,mapping 层换算)。 */
202
+ /** 已确认的视频大小(字节),来自本地文件或合集;历史单视频的大小单位不明确时省略,下载总量由 HTTP 响应确定。 */
194
203
  size?: number;
204
+ /** SDK 本地字节值标记,供持久化读取区分旧版本曾按 KB 换算的记录。 */
205
+ sizeUnit?: 'bytes';
206
+ /** 未确认单位的历史大小,十进制无符号整数;SDK 仅用于原样转发,宿主不得将它用于显示大小或规划下载。 */
207
+ unverifiedFileLength?: string;
195
208
  /** 视频描述(BMessage.describe,可选)。 */
196
209
  describe?: string;
197
210
  /** 文件解密 TEA key 原始字节(仅密文视频有;接收端解 BContent 后从 BMessage.teaKey 得,用于解下载到的原视频文件)。 */
@@ -326,6 +339,53 @@ interface ImMiniProgramBody {
326
339
  /** 多语言子游戏名 JSON 字符串,例如 `{"ch":"...","en":"..."}`。 */
327
340
  subGameName?: string;
328
341
  }
342
+ /**
343
+ * 机器人卡片文本模块(wire `section`)。
344
+ *
345
+ * `content` 保留原文,可含 Markdown 链接与裸 URL;宿主负责展示层解析,不在 Core 拆成富文本树。
346
+ */
347
+ interface ImRobotTextModule {
348
+ type: 'section';
349
+ textType: string;
350
+ content: string;
351
+ }
352
+ /** 机器人卡片图片组;`src` 是明文 http(s),不走消息 TEA 文件通道。 */
353
+ interface ImRobotImageGroupModule {
354
+ type: 'image-group';
355
+ images: readonly string[];
356
+ }
357
+ /**
358
+ * 机器人卡片倒计时。
359
+ *
360
+ * `endTimeMs` 已归一为 epoch 毫秒;wire 秒/毫秒混用只在 mapper 转换,宿主不要再猜单位。
361
+ */
362
+ interface ImRobotCountdownModule {
363
+ type: 'countdown';
364
+ endTimeMs: number;
365
+ }
366
+ type ImRobotModule = ImRobotTextModule | ImRobotImageGroupModule | ImRobotCountdownModule;
367
+ /** 机器人卡片底部指令;`miniProgram` 仅打开小程序时存在。 */
368
+ interface ImRobotCommand {
369
+ menuName: string;
370
+ menuId?: string;
371
+ /** wire `msg_type`;`2` 表示打开小程序,其它走固定话术。第一期宿主可只展示。 */
372
+ messageType?: string;
373
+ miniProgram?: {
374
+ path?: string;
375
+ appId?: string;
376
+ domain?: string;
377
+ };
378
+ }
379
+ /**
380
+ * 机器人卡片正文(contentType==='robot',协议 BMessage.contentType=18)。
381
+ *
382
+ * @remarks 排版数据在 `BMessage.content` JSON。解析失败仍保留 robot 类型与空模块,
383
+ * 不能退化成 unknown——iOS 此时仍画出卡片头。divider 与未识别 module 在 mapper 丢弃。
384
+ */
385
+ interface ImRobotBody {
386
+ modules: readonly ImRobotModule[];
387
+ commands: readonly (readonly ImRobotCommand[])[];
388
+ }
329
389
  /** 转账状态。0 待领取 / 1 已收款 / 2 已退还 / 3 已过期(对齐 iOS IMTranferBody,过期 3 以客户端为准)。 */
330
390
  type ImTransferStatus = 0 | 1 | 2 | 3;
331
391
  /** 转账会话类型。1 个人 / 2 群(BMessage.sessionType)。 */
@@ -520,6 +580,8 @@ interface ImMessageBody {
520
580
  redPacket?: ImRedPacketBody;
521
581
  /** contentType==='mediaAlbum' 时的媒体合集正文(配文 + 1~9 个图片/视频项)。 */
522
582
  mediaAlbum?: ImMediaAlbumBody;
583
+ /** contentType==='robot' 时的机器人卡片。 */
584
+ robot?: ImRobotBody;
523
585
  /** contentType==='unknown' 时的稳定未知正文,不含原始 wire type。 */
524
586
  unknown?: UnknownMessageBody;
525
587
  }
@@ -596,7 +658,7 @@ interface ImMessageEncryption {
596
658
  encrypted: boolean;
597
659
  /** 扩展:加密方案标识,默认 'rsa-tea'。 */
598
660
  scheme?: 'rsa-tea';
599
- /** true=密文但解密失败/缺密钥(占位,非真实空正文):供 UI 显式「无法解密」提示,与明文空消息区分。 */
661
+ /** true=密文但解密失败/缺密钥(占位,非真实空正文):供 UI 显式渲染解密失败提示,与明文空消息、普通密文区分。 */
600
662
  decryptFailed?: boolean;
601
663
  }
602
664
  /** 单条消息领域模型(§4.1)。主键为客户端生成的 id(无 serverId)。 */
@@ -1787,6 +1849,41 @@ interface ImSessionFavoritePort {
1787
1849
  delete: (collectIds: readonly string[]) => Promise<void>;
1788
1850
  }
1789
1851
 
1852
+ /**
1853
+ * SDK 已取得的最近一页请求结果;只是可重建缓存,不代表消息已进入 DomainState 或处理过入站副作用。
1854
+ * 消息、Reaction 与分页边界必须整页原子保存,只有前台实际消费时才进入正常消息流程。
1855
+ */
1856
+ interface ImRecentHistoryPage {
1857
+ /** 缓存记录格式版本;不认识的版本不能当作有效页使用。 */
1858
+ version: 1;
1859
+ /** 当前账号内的精确 GROUP/CHANNEL 会话;direct 没有此远端最近页能力。 */
1860
+ conversation: ConversationRef<'group' | 'channel'>;
1861
+ /** 成功获取页面的毫秒时间,用于保留期限和按获取时间淘汰。 */
1862
+ fetchedAt: number;
1863
+ /** SDK 生成的请求与会话状态指纹;存储层不解释其内容。 */
1864
+ fingerprint: string;
1865
+ /** 已净化的消息事实,缓存保存不得发布消息或已读事件。 */
1866
+ messages: readonly ImMessage[];
1867
+ /** 解码时暂存的 Reaction 事实,预取阶段不得提前应用。 */
1868
+ reactions: readonly ImReactionEvent[];
1869
+ /** 服务端是否明确没有更早一页,空页也保留这一结果。 */
1870
+ exhausted: boolean;
1871
+ /** 服务端返回的向旧游标,存储层仅原样保存。 */
1872
+ nextCursor?: string;
1873
+ /** SDK 按净化后的整页计算的字节数,用于存储预算。 */
1874
+ byteLength: number;
1875
+ }
1876
+ /** 账号隔离的最近页缓存;过期、淘汰或清理后重新请求即可,不影响消息真相。 */
1877
+ interface ImRecentHistoryCachePort {
1878
+ /** 读取精确会话的整页;不存在或超过保留期限时返回 null。 */
1879
+ get: (conversation: ConversationRef<'group' | 'channel'>) => Promise<ImRecentHistoryPage | null>;
1880
+ /** 原子保存整页;仅 durable 事务提交后返回 true,预算或保留期限不允许时返回 false。 */
1881
+ put: (page: ImRecentHistoryPage) => Promise<boolean>;
1882
+ /** 删除精确会话的缓存页,不删除正常历史或会话。 */
1883
+ delete: (conversation: ConversationRef<'group' | 'channel'>) => Promise<void>;
1884
+ /** 清空当前账号的最近页缓存。 */
1885
+ clear: () => Promise<void>;
1886
+ }
1790
1887
  /** 迁移期存储会话入参;新代码使用 ref,string 仅兼容唯一命中的旧调用。 */
1791
1888
  type ImStorageConversation = ConversationRef | string;
1792
1889
  /** 打开账号库的选项。namespace = 账号隔离键(登录 userId)。 */
@@ -1935,6 +2032,8 @@ type StoredConversationBackground = {
1935
2032
  * 失败经 `error` 事件(scope:'storage')暴露、不静默吞、不阻塞内存主流程。
1936
2033
  */
1937
2034
  interface ImStoragePort {
2035
+ /** 可选的最近页持久缓存;缺少该能力时 SDK 必须明确跳过持久预取。 */
2036
+ recentHistoryCache?: ImRecentHistoryCachePort;
1938
2037
  /** 打开/创建账号库并跑迁移(幂等)。open 前的读写应视为未就绪并抛错(不静默兜底)。 */
1939
2038
  open: (options: ImStorageOpenOptions) => Promise<void>;
1940
2039
  /** 关闭库句柄(登出/切账号)。 */
@@ -2096,6 +2195,10 @@ interface ImStoragePort {
2096
2195
  type ImEvent = {
2097
2196
  type: 'connection:changed';
2098
2197
  state: ImConnectionState;
2198
+ }
2199
+ /** 同账号已由另一个浏览器页面接管;本页会话不可复用,但宿主登录仍有效。 */
2200
+ | {
2201
+ type: 'session:replaced';
2099
2202
  } | {
2100
2203
  type: 'message:received';
2101
2204
  message: ImMessage;
@@ -2786,24 +2889,32 @@ interface MediaTransferAdapterConfig {
2786
2889
  /** 是否启用 S3 Transfer Acceleration(默认 true;`cn-` 分区没有加速端点,会强制关闭)。 */
2787
2890
  useAccelerateEndpoint?: boolean;
2788
2891
  /**
2789
- * 是否允许超过分片阈值(16MiB)的上传使用 S3 分片上传(默认 true)。
2892
+ * 统一允许 S3 分片上传和 Range 分段下载,默认 false(单次 PUT / 普通 GET)。
2893
+ * 显式 true 后仍按 16MiB 阈值及已确认下载大小选择策略,小资源不分片。
2894
+ * 开启前各桶须支持分片请求方法,并暴露上传 ETag、下载 Content-Range 与强 ETag。
2895
+ * @example { multipartTransfer: true } 同时允许大资源分片上传、下载。
2896
+ */
2897
+ multipartTransfer?: boolean;
2898
+ /**
2899
+ * 总开关开启后,是否允许超过分片阈值(16MiB)的上传使用 S3 分片上传。
2790
2900
  *
2791
2901
  * 分片相比单次 PUT 需要各物理桶的 CORS 额外放行 POST(Create/CompleteMultipartUpload)、
2792
2902
  * DELETE(AbortMultipartUpload)并 `ExposeHeaders: ETag`;未配齐时分片会直接失败。
2793
- * 部署可置 false 立即退回全量单次 PutObject(大文件回到单连接与整包内存的旧行为),无需发版。
2903
+ * @deprecated 优先使用 multipartTransfer 统一控制;本字段 false 仅进一步关闭上传,true 不能单独开启。
2794
2904
  */
2795
2905
  multipartUpload?: boolean;
2796
2906
  /**
2797
- * 大于 16MiB 的明文/simple 文件是否尝试 Range 并发下载(默认 true)。
2907
+ * 总开关开启后,大于 16MiB 的明文/simple 文件是否尝试 Range 并发下载。
2798
2908
  * 需要下载域名支持 Range,并暴露 Content-Range 与强 ETag;返回 200 时消费完整响应并记录诊断。
2799
- * 置 false 使用单次 GET。此开关不改变上传或整文件 TEA 的行为。
2909
+ * @deprecated 优先使用 multipartTransfer 统一控制;本字段 false 仅进一步关闭下载,true 不能单独开启。
2800
2910
  */
2801
2911
  rangeDownload?: boolean;
2802
2912
  /**
2803
- * 媒体发送阶段的并发上限;由 im-core 消费,adapter 本身仍只负责单个上传任务。
2913
+ * 媒体发送阶段的并发上限;由 im-core 消费,限制媒体任务数而非分片请求数。
2804
2914
  *
2805
- * 并发按媒体体积分两档:图片与不超过分片阈值(16 MiB)的小文件走单次 PutObject、不占分片缓冲,
2806
- * 缺省 5;视频与超过阈值(或字节数未知)的文件走分片,每路各带分片缓冲,缺省 3。
2915
+ * 并发按媒体体积分两档:不超过分片阈值(16 MiB)的非视频媒体走小文件档,
2916
+ * 缺省 5;视频与超过阈值(或字节数未知)的内容走大文件档,缺省 3。
2917
+ * 分档只限制媒体任务数;实际 PUT/UploadPart 另受 adapter 的六路数据请求限制。
2807
2918
  * 两档都只接受 1-6 的整数,超出范围由 core 显式报错。
2808
2919
  * - 传一个数字:所有媒体共用这一个并发数,与分档前的语义一致。
2809
2920
  * - 传 `{ total, largeFiles }`:显式分档,`largeFiles` 不得超过 `total`。
@@ -2852,8 +2963,8 @@ interface IndexedDbStorageAdapterOptions {
2852
2963
  maxPendingWriteBytes?: number;
2853
2964
  };
2854
2965
  }
2855
- /** 官方浏览器 adapter 始终提供完整背景持久化能力;可选只存在于通用 `ImStoragePort` 兼容边界。 */
2856
- type IndexedDbStorageAdapter = ImStoragePort & MediaAssetCachePort & Required<Pick<ImStoragePort, 'getConversationBackground' | 'saveConversationBackground' | 'deleteConversationBackground' | 'getDefaultConversationBackground' | 'saveDefaultConversationBackground' | 'deleteDefaultConversationBackground'>>;
2966
+ /** 官方浏览器 adapter 始终提供背景和最近历史缓存;可选只存在于通用 `ImStoragePort` 兼容边界。 */
2967
+ type IndexedDbStorageAdapter = ImStoragePort & MediaAssetCachePort & Required<Pick<ImStoragePort, 'getConversationBackground' | 'recentHistoryCache' | 'saveConversationBackground' | 'deleteConversationBackground' | 'getDefaultConversationBackground' | 'saveDefaultConversationBackground' | 'deleteDefaultConversationBackground'>>;
2857
2968
  /**
2858
2969
  * 创建 IndexedDB 存储 adapter(实现 ImStoragePort)。
2859
2970
  * 生命周期:先 `open({ namespace })`(幂等,跑 schema 迁移),再读写;`close()` 释放句柄。
@@ -3455,6 +3566,21 @@ interface ImContactApi extends ImDirectoryApi<'individual'> {
3455
3566
  deleteFriendship: (userId: string) => Promise<void>;
3456
3567
  }
3457
3568
 
3569
+ /** 后台最近页预取的取消条件;取消不影响正在复用同一请求的前台会话。 */
3570
+ interface ConversationPrefetchOptions {
3571
+ signal?: AbortSignal;
3572
+ }
3573
+ /**
3574
+ * 单个会话的后台预取结果。ready 只在完整页面已写入当前账号缓存后返回。
3575
+ * skipped 表示当前类型、权限、存储或预算不允许预取;失败不改变正常打开会话的行为。
3576
+ */
3577
+ interface ConversationPrefetchResult {
3578
+ ref: ConversationRef<'direct' | 'group' | 'channel'>;
3579
+ status: 'ready' | 'skipped' | 'failed' | 'cancelled';
3580
+ reason?: 'unsupported' | 'unavailable' | 'storage-unavailable' | 'budget' | 'page-too-large' | 'decrypt-failed' | 'invalidated' | 'cancelled';
3581
+ error?: ImSdkErrorShape;
3582
+ }
3583
+
3458
3584
  /**
3459
3585
  * 当前账号草稿的产品 DTO、跨组件 API 与 handle 绑定门面。
3460
3586
  * 草稿按复合会话身份串行持久化,SDK DomainState 是唯一真相;附件尚未闭合时非空输入明确拒绝。
@@ -3544,6 +3670,8 @@ interface ImConversationsApi {
3544
3670
  pullOffline: () => Promise<ImMessage[]>;
3545
3671
  /** 运行 direct/GROUP/CHANNEL sibling 离线同步。 */
3546
3672
  sync: () => Promise<void>;
3673
+ /** 静默准备最近页;结果成功表示当前账号缓存事务已提交。 */
3674
+ prefetchRecent: (refs: readonly ImSupportedConversationRef[], options?: ConversationPrefetchOptions) => Promise<readonly ConversationPrefetchResult[]>;
3547
3675
  /** 聚合总未读;默认排除 muted 会话。 */
3548
3676
  getTotalUnread: (options?: {
3549
3677
  includeMuted?: boolean;
@@ -4134,6 +4262,8 @@ type ConversationLastMessageSummary = {
4134
4262
  kind: 'contact';
4135
4263
  } | {
4136
4264
  kind: 'miniProgram';
4265
+ } | {
4266
+ kind: 'robot';
4137
4267
  } | {
4138
4268
  kind: 'transfer';
4139
4269
  } | {
@@ -4164,6 +4294,10 @@ type ConversationLastMessageSummary = {
4164
4294
  firstItemKind?: 'image' | 'video';
4165
4295
  } | {
4166
4296
  kind: 'encrypted';
4297
+ }
4298
+ /** 密文解密失败占位;与 `encrypted` 分开,列表走独立 iOS 长文案。 */
4299
+ | {
4300
+ kind: 'decrypt-failed';
4167
4301
  } | {
4168
4302
  kind: 'recalled';
4169
4303
  by: string;
@@ -4245,6 +4379,8 @@ interface ImConversationListApi extends ImConversationBackgroundApi {
4245
4379
  subscribe: (listener: (snapshot: ImConversationListSnapshot) => void) => () => void;
4246
4380
  /** 显式运行 direct/GROUP/CHANNEL sibling 同步;失败抛稳定产品错误并进入 error 快照。 */
4247
4381
  refresh: () => Promise<void>;
4382
+ /** 静默预取各会话最近一页;不激活线程,ready 只表示持久缓存已完成。 */
4383
+ prefetchRecent: (refs: readonly ConversationRef<ProductConversationListType>[], options?: ConversationPrefetchOptions) => Promise<readonly ConversationPrefetchResult[]>;
4248
4384
  /** 读取总未读;默认排除 muted 会话。 */
4249
4385
  getTotalUnread: (options?: {
4250
4386
  includeMuted?: boolean;
@@ -4530,6 +4666,8 @@ type ConversationInitialPosition = 'latest' | 'first-unread';
4530
4666
  * @remarks 选项只影响初始连续窗口和 `entryUnread` 快照;发送、历史分页、已读和 close 语义保持不变。
4531
4667
  */
4532
4668
  interface ConversationOpenOptions {
4669
+ /** 取消尚未交付的会话打开及其历史请求;句柄交付后由 close 管理生命周期。 */
4670
+ signal?: AbortSignal;
4533
4671
  /**
4534
4672
  * 初始连续窗口位置。
4535
4673
  *
@@ -5159,6 +5297,8 @@ interface ImProductEventMap {
5159
5297
  'connection:changed': Readonly<{
5160
5298
  snapshot: ImLifecycleSnapshot;
5161
5299
  }>;
5300
+ /** 另一个页面接管聊天;宿主可提示刷新此页重新接管,不应退出业务登录。 */
5301
+ 'session:replaced': Readonly<Record<never, never>>;
5162
5302
  'message:received': Readonly<{
5163
5303
  ref: ConversationRef<ProductConversationListType>;
5164
5304
  message: ImProductMessage;
@@ -5657,15 +5797,16 @@ interface ImEmojiCatalogEntry {
5657
5797
  *
5658
5798
  * 形状 = im-browser `MediaTransferAdapterConfig`:必填 `getUploadCredentials`(按逻辑桶名向宿主自己的 BFF 申请
5659
5799
  * STS 临时凭证)+ 各 `MediaKind`(image/video/voice/file/sticker)的**逻辑桶名** + 可选 `channelBuckets`(社群会话
5660
- * 按类型覆盖)、`avatarBucket`、`useAccelerateEndpoint`、`multipartUpload`、`maxConcurrentUploads`。
5800
+ * 按类型覆盖)、`avatarBucket`、`useAccelerateEndpoint`、`multipartTransfer`、`maxConcurrentUploads`。
5661
5801
  *
5662
5802
  * 上传凭证由业务后端按登录态签发(与 iOS、prod H5 同一个接口),回包同时给出**物理桶**、区域、`key_prefix` 和
5663
5803
  * 公开访问域名;SDK 据此拼 object key 与消息体 URL,宿主 env 里配的只是申请凭证用的逻辑桶名。凭证缓存(本地
5664
5804
  * 1 小时、按服务端过期时间提前 5 分钟失效)、同桶单飞与失败重签由 SDK 负责,宿主只需提供「打一次接口」的纯函数。
5665
5805
  *
5666
- * ⚠ 各 bucket 需在对象存储侧配置 CORS 允许本站 origin 的 PUT + GET;超过 16MiB 的上传走 S3 分片,另需放行
5806
+ * 默认单次 PUT/GET;仅 multipartTransfer=true 才允许大资源分片上传、下载。
5807
+ * 各 bucket 需在对象存储侧配置 CORS 允许本站 origin 的 PUT + GET;开启分片后,超过 16MiB 的上传另需放行
5667
5808
  * POST(Create/CompleteMultipartUpload)、DELETE(AbortMultipartUpload)并 ExposeHeaders: ETag。CORS 未配齐时
5668
- * 可用 `multipartUpload: false` 退回全量单次 PutObject。
5809
+ * 下载还需暴露 Content-Range 与强 ETag;multipartTransfer=false 统一关闭分片上传和下载。
5669
5810
  * ⚠ 并发字段只由 SDK core 的媒体编排消费;adapter 会忽略该字段。高内存设备可设置 5-6,低内存设备建议 2-3。
5670
5811
  */
5671
5812
  type ImMediaConfig = MediaTransferAdapterConfig;
@@ -6305,7 +6446,7 @@ type ImLocale = 'en-US' | 'th-TH' | 'vi-VN' | 'zh-CN' | 'zh-TW';
6305
6446
  * 二期收敛:kit 框架无关层不再直接产中文,改产本联合里的码 + 参数(如 {reason}/{label}/{size}),由宿主经 im-i18n 渲染。
6306
6447
  * 动态原始报错(error.message)作为 `{reason}` 参数拼接,不入 catalog(属诊断,不翻译)。
6307
6448
  */
6308
- 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.imageFormatUnsupported' | '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';
6449
+ 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.imageFormatUnsupported' | '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' | 'lifecycle.connectionOccupied' | 'lifecycle.connectionCoordinationUnavailable' | 'forward.emptyInput' | 'forward.allSkipped' | 'forward.partialSkipped' | 'forward.done' | 'forward.failed';
6309
6450
 
6310
6451
  /** 会话列表摘要的框架无关分段;宿主可自行决定表情使用图片、文本或其它组件呈现。 */
6311
6452
  type ConversationListPreviewSegment = {
@@ -6396,6 +6537,20 @@ interface ConversationListPresentation {
6396
6537
  */
6397
6538
  declare function resolveConversationListPresentation(item: ConversationListItem, options: ConversationListPresentationOptions): ConversationListPresentation;
6398
6539
 
6540
+ /**
6541
+ * PC/H5 会话行与菜单角标共用的显示规则;不修改 SDK 未读消息条数。
6542
+ *
6543
+ * @example `999 → '999'`、`1249 → '1k'`、`10000 → '10k'`、`10001 → '10k+'`。
6544
+ * 会话内的未读提示有独立的 999+ 规则,不使用本函数。
6545
+ */
6546
+ declare function formatConversationUnreadBadge(count: number): string;
6547
+ /**
6548
+ * 从 SDK 完整会话列表计算菜单未读会话数:每个非免打扰且有未读的会话只计一次。
6549
+ *
6550
+ * SDK 已把手动未读提醒投影到 unreadCount;这里不重新解释消息状态,也不使用宿主筛选后的列表。
6551
+ */
6552
+ declare function countUnreadConversations(items: readonly Pick<ConversationListItem, 'unreadCount' | 'muted'>[]): number;
6553
+
6399
6554
  interface DelayedLoadingIndicatorOptions {
6400
6555
  /** loading 持续超过该时间后才显示,缓存快速命中不会闪出提示。 */
6401
6556
  showDelayMs?: number;
@@ -6812,7 +6967,8 @@ interface ChatRuntime {
6812
6967
  /**
6813
6968
  * 在账号或 token 发生变化时,立即停止并清理旧账号运行资源。
6814
6969
  *
6815
- * 它会断开旧连接,关闭本机消息库,丢弃 SDK Client、资料缓存和媒体资源,并递增账号版本号;
6970
+ * 它会立即停止旧连接并丢弃页面资源,异步销毁 SDK Client、关闭消息库和释放浏览器锁;
6971
+ * 新 prepare/connect 等待清理完成,账号版本号同步递增;
6816
6972
  * 已注册的 Store 监听器会保留,以便新账号重新连接后继续接收事件。通常由 `applySession` 自动调用。
6817
6973
  */
6818
6974
  resetForAuthChange: () => void;
@@ -6894,6 +7050,43 @@ interface ChatRuntime {
6894
7050
  */
6895
7051
  declare function createChatRuntime(factories: ChatRuntimeFactories): ChatRuntime;
6896
7052
 
7053
+ type PrefetchClient = Pick<ImProductClient, 'conversations'>;
7054
+ /** 宿主只提供当前投影和调度许可;请求去重、网络预算与持久化仍由 SDK 管理。 */
7055
+ interface ConversationPrefetchControllerOptions {
7056
+ /** 当前账号公开 Client;未准备好时返回 null,不在后台主动创建 Client。 */
7057
+ getClient: () => PrefetchClient | null;
7058
+ /** SDK 会话列表当前顺序;控制器只挑常用会话,不维护消息副本。 */
7059
+ getCandidates: () => readonly ConversationListItem[];
7060
+ /** 前台正在阅读的精确会话;它的历史由正常打开流程负责。 */
7061
+ getActiveRef: () => ConversationRef | null;
7062
+ /** 宿主判断开关、账号、连接、页面可见性和网络策略是否允许预取。 */
7063
+ getRunnable: () => boolean;
7064
+ /** 在首屏绘制后的浏览器空闲期执行,返回取消尚未开始任务的函数。 */
7065
+ scheduleIdle: (task: () => void) => () => void;
7066
+ /** 意外拒绝的结构化诊断出口;预取失败不能转成前台通知。 */
7067
+ onError: (cause: unknown) => void;
7068
+ /** 可选的统一诊断端口;只记录调度状态,不存消息,也不作为运行许可。 */
7069
+ diagnostics?: ImDiagnosticWriter;
7070
+ }
7071
+ /** 应用级常用会话预取控制器;不依赖 Vue、Pinia 或浏览器页面资源。 */
7072
+ interface ConversationPrefetchController {
7073
+ /** 列表、活动会话或运行条件改变时调用;普通刷新复用在途请求。 */
7074
+ refresh: () => void;
7075
+ /** 换账号或退出时取消任务并清除本轮请求记录;后续 refresh 可重新开始。 */
7076
+ reset: () => void;
7077
+ /** 应用卸载时永久释放;后续 refresh 不再调度。 */
7078
+ dispose: () => void;
7079
+ }
7080
+ /**
7081
+ * 创建常用会话预取编排:每次空闲只提交一个候选,完成后重读列表再选下一项。
7082
+ *
7083
+ * 页间重新等待宿主空闲调度,使置顶、未读、删除和活动会话变化及时影响下一页,
7084
+ * SDK 仍负责请求去重、前台优先与本次账号 Runtime 的网络总预算。
7085
+ * 同一 Client 下完成或失败的候选本轮不自动重试;取消项可在运行条件恢复后重新排队。
7086
+ * reset/client 更换会作废旧请求,旧 Promise 完成后不能修改新账号的请求记录。
7087
+ */
7088
+ declare function createConversationPrefetchController(options: ConversationPrefetchControllerOptions): ConversationPrefetchController;
7089
+
6897
7090
  /**
6898
7091
  * 一次异步业务操作发起时捕获的账号生命周期。
6899
7092
  *
@@ -8721,5 +8914,5 @@ declare function resampleWaveform(data: readonly number[], targetCount: number):
8721
8914
  */
8722
8915
  declare function placeholderWaveform(seed: string, count: number): number[];
8723
8916
 
8724
- export { DEFAULT_EMOJI_ASSET_BASE, DEFAULT_LOADING_MINIMUM_VISIBLE_MS, DEFAULT_LOADING_SHOW_DELAY_MS, EMOJI_CATALOG, EMOJI_GAME_DICE_STABLE_KEY, EMOJI_GAME_RPS_STABLE_KEY, EMOJI_TOKEN_RE, MAX_BATCH_FILES, MAX_RECENT_EMOJI_COUNT, MINI_PROGRAM_LANG_NUMBERS, SPIKE_STEP, UNICODE_EMOJI_CATALOG, blockReasonForChannelSession, blockReasonForChannelState, blockReasonForGroupState, blockReasonForSession, calculateMediaBox, canEditMessage, canPinChannelMessage, canPinGroupMessage, canPinMessage, canPromoteMediaPresentationSource, canRecallMessage, canTransmit, canTransmitByType, canTransmitContent, cancelMediaUpload, captureRuntimeClientOperation, captureRuntimeOperation, channelMiniProgramRelKey, classifyGifFile, classifyMediaFile, createChatRuntime, createDelayedLoadingIndicator, createEmojiMatcher, createLinkMatcher, createNewMessageBadgeController, createThreadItems, csvIncludes, decideChannelMiniProgramRelOpen, decideConversationAction, decideMemberTargetAction, decideMessageAction, emojiAssetUrl, emojiUrlByCode, fetchConversationFileBatch, fetchConversationImageBatch, fetchConversationMessageBatch, fetchConversationVideoBatch, fetchConversationVoiceBatch, fetchNextConversationSearchBatch, formatChatDateSeparator, formatConversationDisplayTime, formatFileSize, formatMediaDuration, forward_service as forwardService, getFileExtension, getLocalDayKey, hasEmojiCandidate, hasLinkCandidate, highlightSegments, isGifFile, isMessageLocateScrollProtected, isMessageTailChangeFromOlderWindowTrim, isMessageViewportMeasurable, isMessageVisibleForNewMessageBadge, isPinnedMessageProtected, isVoiceStorageConfigured, loadOlderUntilBoundary, mediaBatchBudgetBytes, media_service as mediaService, message_service as messageService, normalizeLinkHref, parseUnicodeEmojiCode, pinnedMessage_service as pinnedMessageService, placeholderWaveform, prependRecentEmoji, profile_service as profileService, read_service as readService, refreshPrependMessageAnchorPosition, replaceInterruptedMediaFile, requiresConversationEncryption, requiresForwardTypeConfirmation, resampleWaveform, resolveBestMediaPresentationSource, resolveCenteredMessageScrollTop, resolveChannelMemberAvatarUrl, resolveChannelMemberDisplayName, resolveChannelMiniProgramRelIcon, resolveChannelMiniProgramRelName, resolveChannelMiniProgramRelOpenSurface, resolveChannelMiniProgramRelUrl, resolveChannelPinnedGameCopy, resolveConversationListPresentation, resolveDisplayTimestamp, resolveEmojiToken, resolveFriendDisplayName, resolveImProfileAccessDestination, resolveImThreadActiveDate, resolveMediaPresentation, resolveMemberDisplayName, resolveMessageBodyKind, resolveMessageNotificationDecision, resolveMessageTimelineTimestamp, resolveMiniProgramFloatLinkUrl, resolveMiniProgramOpenUrl, resolvePrependMessageAnchor, resolvePrependMessageAnchorAdjustment, resolvePrependMessageAnchorPosition, resolvePublicNickname, resolveQuotedMessagePresentation, resolveSenderAvatarUrl, resolveStandaloneEmojiMessage, resolveSurvivingMessageAnchorAdjustment, resolveUnicodeEmoji, resolveVisibleChannelMiniProgramRels, resolveVisibleMessageAnchorPositions, retryMessage, runMediaSendBatch, sendAsFilesBatch, sendBlockReasonForDecision, sendMediaAlbum, sendMediaFile, sendMediaFilesBatch, sendText, sendVoice, shouldCompleteInitialViewport, shouldFillInitialHistoryViewport, shouldFollowIncomingMessage, shouldLoadNewerHistoryPage, shouldPrefetchOlderHistory, shouldRestoreMessageViewportFocus, shouldShowChatDateSeparator, shouldTrackRemoteMessageForBadge, sortChannelMiniProgramFloatingItems, spikeCountForDuration, supportsConversationMention, unicodeEmojiTextFromCode };
8725
- export type { ApplySessionResult, BrowseMessagesInput, CanPinMessageInput, CenteredMessageScrollInput, ChannelMiniProgramOpenGame, ChannelMiniProgramRelOpenDecision, ChannelMiniProgramRelOpenSurface, ChatMediaMessageRef, ChatProfileAdapter, ChatRuntime, ChatRuntimeCredentials, ChatRuntimeFactories, ChatRuntimeHostDeps, ChatRuntimeOpResult, ConversationCapabilityAction, ConversationListPresentation, ConversationListPresentationLabels, ConversationListPresentationOptions, ConversationListPreviewMediaKind, ConversationListPreviewSegment, ConversationSearchCategory, CreateThreadItemsInput, DelayedLoadingIndicator, DelayedLoadingIndicatorOptions, EmojiEntry, EmojiRecentItem, EmojiSegment, FormatTimeDisplayContext, ForwardCommandHooks, GifFileClassification, HighlightSegment, ImChannelMemberPresentation, ImChannelMentionPresentation, ImChannelProfilePresentation, ImForwardOperationResult, ImGroupMemberPresentation, ImMediaBatchSendResult, ImMessageActionResult, ImMessageBodyKind, ImMessageView, ImPinnedMessageActionResult, ImPinnedMessageSnapshot, ImProfileAccessDestination, ImQuotedMessagePresentation, ImTextResolver, ImThreadActiveDateSnapshot, ImThreadDateMarkerMetric, ImThreadDecoration, ImThreadEncryptionItem, ImThreadIntent, ImThreadItem, ImThreadPresentationAdapter, ImThreadReadActions, ImThreadReadTargetResolver, ImThreadViewportMetrics, IncomingMessageFollowInput, InitialHistoryViewportFillInput, InitialViewportCompletionInput, LinkSegment, MediaBatchBudgetOptions, MediaBatchLimitInfo, MediaFileClassification, MediaLimitItem, MediaObjectUrlLease, MediaPresentationFit, MediaPresentationPolicy, MediaPresentationRule, MediaPresentationSourceCandidate, MediaPresentationSourceQuality, MediaSendBatchResult, MemberTargetCapabilityAction, MemberTargetCapabilityInput, MessageCapabilityAction, MessageCapabilityInput, MessageLocateScrollProtectionInput, MessageNotificationDecision, MessageNotificationInput, MiniProgramHostLocale, MiniProgramOpenUrlInput, NewMessageBadgeController, NewMessageBadgeCountListener, NewMessageBadgeVisibilityInput, NewerHistoryPageTriggerInput, OlderHistoryPrefetchInput, PrependAnchorCandidate, PrependAnchorViewport, PrependMessageAnchorPosition, RemoteMessageBadgeTrackingInput, ResolveMediaPresentationInput, ResolvedMediaPresentation, RichExtraSegment, RuntimeClientOperation, RuntimeOperation, SearchBatchResult, SearchFilesInput, SearchMessagesInput, SearchTextMessagesInput, SendCapabilityMode, SendCommandHooks, SendVoicePayload, SenderProfileEntry, ServiceNoteHooks, StandaloneEmojiMessage, UnicodeEmojiEntry, VisibleChannelMiniProgramRels };
8917
+ export { DEFAULT_EMOJI_ASSET_BASE, DEFAULT_LOADING_MINIMUM_VISIBLE_MS, DEFAULT_LOADING_SHOW_DELAY_MS, EMOJI_CATALOG, EMOJI_GAME_DICE_STABLE_KEY, EMOJI_GAME_RPS_STABLE_KEY, EMOJI_TOKEN_RE, MAX_BATCH_FILES, MAX_RECENT_EMOJI_COUNT, MINI_PROGRAM_LANG_NUMBERS, SPIKE_STEP, UNICODE_EMOJI_CATALOG, blockReasonForChannelSession, blockReasonForChannelState, blockReasonForGroupState, blockReasonForSession, calculateMediaBox, canEditMessage, canPinChannelMessage, canPinGroupMessage, canPinMessage, canPromoteMediaPresentationSource, canRecallMessage, canTransmit, canTransmitByType, canTransmitContent, cancelMediaUpload, captureRuntimeClientOperation, captureRuntimeOperation, channelMiniProgramRelKey, classifyGifFile, classifyMediaFile, countUnreadConversations, createChatRuntime, createConversationPrefetchController, createDelayedLoadingIndicator, createEmojiMatcher, createLinkMatcher, createNewMessageBadgeController, createThreadItems, csvIncludes, decideChannelMiniProgramRelOpen, decideConversationAction, decideMemberTargetAction, decideMessageAction, emojiAssetUrl, emojiUrlByCode, fetchConversationFileBatch, fetchConversationImageBatch, fetchConversationMessageBatch, fetchConversationVideoBatch, fetchConversationVoiceBatch, fetchNextConversationSearchBatch, formatChatDateSeparator, formatConversationDisplayTime, formatConversationUnreadBadge, formatFileSize, formatMediaDuration, forward_service as forwardService, getFileExtension, getLocalDayKey, hasEmojiCandidate, hasLinkCandidate, highlightSegments, isGifFile, isMessageLocateScrollProtected, isMessageTailChangeFromOlderWindowTrim, isMessageViewportMeasurable, isMessageVisibleForNewMessageBadge, isPinnedMessageProtected, isVoiceStorageConfigured, loadOlderUntilBoundary, mediaBatchBudgetBytes, media_service as mediaService, message_service as messageService, normalizeLinkHref, parseUnicodeEmojiCode, pinnedMessage_service as pinnedMessageService, placeholderWaveform, prependRecentEmoji, profile_service as profileService, read_service as readService, refreshPrependMessageAnchorPosition, replaceInterruptedMediaFile, requiresConversationEncryption, requiresForwardTypeConfirmation, resampleWaveform, resolveBestMediaPresentationSource, resolveCenteredMessageScrollTop, resolveChannelMemberAvatarUrl, resolveChannelMemberDisplayName, resolveChannelMiniProgramRelIcon, resolveChannelMiniProgramRelName, resolveChannelMiniProgramRelOpenSurface, resolveChannelMiniProgramRelUrl, resolveChannelPinnedGameCopy, resolveConversationListPresentation, resolveDisplayTimestamp, resolveEmojiToken, resolveFriendDisplayName, resolveImProfileAccessDestination, resolveImThreadActiveDate, resolveMediaPresentation, resolveMemberDisplayName, resolveMessageBodyKind, resolveMessageNotificationDecision, resolveMessageTimelineTimestamp, resolveMiniProgramFloatLinkUrl, resolveMiniProgramOpenUrl, resolvePrependMessageAnchor, resolvePrependMessageAnchorAdjustment, resolvePrependMessageAnchorPosition, resolvePublicNickname, resolveQuotedMessagePresentation, resolveSenderAvatarUrl, resolveStandaloneEmojiMessage, resolveSurvivingMessageAnchorAdjustment, resolveUnicodeEmoji, resolveVisibleChannelMiniProgramRels, resolveVisibleMessageAnchorPositions, retryMessage, runMediaSendBatch, sendAsFilesBatch, sendBlockReasonForDecision, sendMediaAlbum, sendMediaFile, sendMediaFilesBatch, sendText, sendVoice, shouldCompleteInitialViewport, shouldFillInitialHistoryViewport, shouldFollowIncomingMessage, shouldLoadNewerHistoryPage, shouldPrefetchOlderHistory, shouldRestoreMessageViewportFocus, shouldShowChatDateSeparator, shouldTrackRemoteMessageForBadge, sortChannelMiniProgramFloatingItems, spikeCountForDuration, supportsConversationMention, unicodeEmojiTextFromCode };
8918
+ export type { ApplySessionResult, BrowseMessagesInput, CanPinMessageInput, CenteredMessageScrollInput, ChannelMiniProgramOpenGame, ChannelMiniProgramRelOpenDecision, ChannelMiniProgramRelOpenSurface, ChatMediaMessageRef, ChatProfileAdapter, ChatRuntime, ChatRuntimeCredentials, ChatRuntimeFactories, ChatRuntimeHostDeps, ChatRuntimeOpResult, ConversationCapabilityAction, ConversationListPresentation, ConversationListPresentationLabels, ConversationListPresentationOptions, ConversationListPreviewMediaKind, ConversationListPreviewSegment, ConversationPrefetchController, ConversationPrefetchControllerOptions, ConversationSearchCategory, CreateThreadItemsInput, DelayedLoadingIndicator, DelayedLoadingIndicatorOptions, EmojiEntry, EmojiRecentItem, EmojiSegment, FormatTimeDisplayContext, ForwardCommandHooks, GifFileClassification, HighlightSegment, ImChannelMemberPresentation, ImChannelMentionPresentation, ImChannelProfilePresentation, ImForwardOperationResult, ImGroupMemberPresentation, ImMediaBatchSendResult, ImMessageActionResult, ImMessageBodyKind, ImMessageView, ImPinnedMessageActionResult, ImPinnedMessageSnapshot, ImProfileAccessDestination, ImQuotedMessagePresentation, ImTextResolver, ImThreadActiveDateSnapshot, ImThreadDateMarkerMetric, ImThreadDecoration, ImThreadEncryptionItem, ImThreadIntent, ImThreadItem, ImThreadPresentationAdapter, ImThreadReadActions, ImThreadReadTargetResolver, ImThreadViewportMetrics, IncomingMessageFollowInput, InitialHistoryViewportFillInput, InitialViewportCompletionInput, LinkSegment, MediaBatchBudgetOptions, MediaBatchLimitInfo, MediaFileClassification, MediaLimitItem, MediaObjectUrlLease, MediaPresentationFit, MediaPresentationPolicy, MediaPresentationRule, MediaPresentationSourceCandidate, MediaPresentationSourceQuality, MediaSendBatchResult, MemberTargetCapabilityAction, MemberTargetCapabilityInput, MessageCapabilityAction, MessageCapabilityInput, MessageLocateScrollProtectionInput, MessageNotificationDecision, MessageNotificationInput, MiniProgramHostLocale, MiniProgramOpenUrlInput, NewMessageBadgeController, NewMessageBadgeCountListener, NewMessageBadgeVisibilityInput, NewerHistoryPageTriggerInput, OlderHistoryPrefetchInput, PrependAnchorCandidate, PrependAnchorViewport, PrependMessageAnchorPosition, RemoteMessageBadgeTrackingInput, ResolveMediaPresentationInput, ResolvedMediaPresentation, RichExtraSegment, RuntimeClientOperation, RuntimeOperation, SearchBatchResult, SearchFilesInput, SearchMessagesInput, SearchTextMessagesInput, SendCapabilityMode, SendCommandHooks, SendVoicePayload, SenderProfileEntry, ServiceNoteHooks, StandaloneEmojiMessage, UnicodeEmojiEntry, VisibleChannelMiniProgramRels };
package/dist/chat-kit.js CHANGED
@@ -1 +1 @@
1
- export{p as DEFAULT_LOADING_MINIMUM_VISIBLE_MS,o as DEFAULT_LOADING_SHOW_DELAY_MS,d as MINI_PROGRAM_LANG_NUMBERS,H as SPIKE_STEP,D as calculateMediaBox,s as canPromoteMediaPresentationSource,u as captureRuntimeClientOperation,t as captureRuntimeOperation,m as channelMiniProgramRelKey,q as createDelayedLoadingIndicator,B as createLinkMatcher,e as csvIncludes,c as decideChannelMiniProgramRelOpen,F as formatFileSize,E as formatMediaDuration,G as getFileExtension,A as hasLinkCandidate,y as highlightSegments,v as mediaService,z as normalizeLinkHref,K as placeholderWaveform,w as readService,J as resampleWaveform,r as resolveBestMediaPresentationSource,g as resolveChannelMiniProgramRelIcon,f as resolveChannelMiniProgramRelName,i as resolveChannelMiniProgramRelOpenSurface,h as resolveChannelMiniProgramRelUrl,j as resolveChannelPinnedGameCopy,n as resolveConversationListPresentation,C as resolveMediaPresentation,b as resolveMiniProgramFloatLinkUrl,a as resolveMiniProgramOpenUrl,x as resolveQuotedMessagePresentation,l as resolveVisibleChannelMiniProgramRels,k as sortChannelMiniProgramFloatingItems,I as spikeCountForDuration}from'./chunk-D2FFU7J5.js';export{j as DEFAULT_EMOJI_ASSET_BASE,i as EMOJI_CATALOG,c as EMOJI_GAME_DICE_STABLE_KEY,b as EMOJI_GAME_RPS_STABLE_KEY,m as EMOJI_TOKEN_RE,L as MAX_BATCH_FILES,a as MAX_RECENT_EMOJI_COUNT,g as UNICODE_EMOJI_CATALOG,K as blockReasonForChannelSession,J as blockReasonForChannelState,R as blockReasonForGroupState,U as blockReasonForSession,E as canEditMessage,u as canPinChannelMessage,t as canPinGroupMessage,v as canPinMessage,D as canRecallMessage,ba as cancelMediaUpload,P as classifyGifFile,O as classifyMediaFile,s as createChatRuntime,p as createEmojiMatcher,G as decideConversationAction,I as decideMemberTargetAction,H as decideMessageAction,l as emojiAssetUrl,n as emojiUrlByCode,Ba as fetchConversationFileBatch,Ca as fetchConversationImageBatch,za as fetchConversationMessageBatch,Da as fetchConversationVideoBatch,Ea as fetchConversationVoiceBatch,Fa as fetchNextConversationSearchBatch,ea as forwardService,o as hasEmojiCandidate,Q as isGifFile,w as isPinnedMessageProtected,Y as isVoiceStorageConfigured,M as mediaBatchBudgetBytes,ja as messageService,e as parseUnicodeEmojiCode,oa as pinnedMessageService,d as prependRecentEmoji,ya as profileService,X as replaceInterruptedMediaFile,S as requiresConversationEncryption,z as resolveChannelMemberAvatarUrl,y as resolveChannelMemberDisplayName,k as resolveEmojiToken,C as resolveFriendDisplayName,pa as resolveImProfileAccessDestination,x as resolveMemberDisplayName,r as resolveMessageNotificationDecision,B as resolvePublicNickname,A as resolveSenderAvatarUrl,q as resolveStandaloneEmojiMessage,h as resolveUnicodeEmoji,ca as retryMessage,N as runMediaSendBatch,aa as sendAsFilesBatch,F as sendBlockReasonForDecision,_ as sendMediaAlbum,W as sendMediaFile,$ as sendMediaFilesBatch,V as sendText,Z as sendVoice,T as supportsConversationMention,f as unicodeEmojiTextFromCode}from'./chunk-H7AM5DTT.js';export{C as createNewMessageBadgeController,i as createThreadItems,f as formatChatDateSeparator,e as formatConversationDisplayTime,c as getLocalDayKey,l as isMessageLocateScrollProtected,v as isMessageTailChangeFromOlderWindowTrim,k as isMessageViewportMeasurable,B as isMessageVisibleForNewMessageBadge,x as loadOlderUntilBoundary,p as refreshPrependMessageAnchorPosition,j as resolveCenteredMessageScrollTop,a as resolveDisplayTimestamp,g as resolveImThreadActiveDate,h as resolveMessageBodyKind,b as resolveMessageTimelineTimestamp,n as resolvePrependMessageAnchor,q as resolvePrependMessageAnchorAdjustment,o as resolvePrependMessageAnchorPosition,s as resolveSurvivingMessageAnchorAdjustment,r as resolveVisibleMessageAnchorPositions,t as shouldCompleteInitialViewport,y as shouldFillInitialHistoryViewport,u as shouldFollowIncomingMessage,z as shouldLoadNewerHistoryPage,m as shouldPrefetchOlderHistory,w as shouldRestoreMessageViewportFocus,d as shouldShowChatDateSeparator,A as shouldTrackRemoteMessageForBadge}from'./chunk-YUPKU2L7.js';import'./chunk-BIFDS3MH.js';import'./chunk-DVQGXZ6S.js';import'./chunk-FQJBDSXT.js';export{ra as canTransmit,pa as canTransmitByType,qa as canTransmitContent,oa as requiresForwardTypeConfirmation}from'./chunk-O7GQQMEW.js';import'./chunk-WOT6VMZA.js';
1
+ export{p as DEFAULT_LOADING_MINIMUM_VISIBLE_MS,o as DEFAULT_LOADING_SHOW_DELAY_MS,d as MINI_PROGRAM_LANG_NUMBERS,I as SPIKE_STEP,E as calculateMediaBox,s as canPromoteMediaPresentationSource,v as captureRuntimeClientOperation,u as captureRuntimeOperation,m as channelMiniProgramRelKey,t as createConversationPrefetchController,q as createDelayedLoadingIndicator,C as createLinkMatcher,e as csvIncludes,c as decideChannelMiniProgramRelOpen,G as formatFileSize,F as formatMediaDuration,H as getFileExtension,B as hasLinkCandidate,z as highlightSegments,w as mediaService,A as normalizeLinkHref,L as placeholderWaveform,x as readService,K as resampleWaveform,r as resolveBestMediaPresentationSource,g as resolveChannelMiniProgramRelIcon,f as resolveChannelMiniProgramRelName,i as resolveChannelMiniProgramRelOpenSurface,h as resolveChannelMiniProgramRelUrl,j as resolveChannelPinnedGameCopy,n as resolveConversationListPresentation,D as resolveMediaPresentation,b as resolveMiniProgramFloatLinkUrl,a as resolveMiniProgramOpenUrl,y as resolveQuotedMessagePresentation,l as resolveVisibleChannelMiniProgramRels,k as sortChannelMiniProgramFloatingItems,J as spikeCountForDuration}from'./chunk-XA4W5PWT.js';export{j as DEFAULT_EMOJI_ASSET_BASE,i as EMOJI_CATALOG,c as EMOJI_GAME_DICE_STABLE_KEY,b as EMOJI_GAME_RPS_STABLE_KEY,m as EMOJI_TOKEN_RE,N as MAX_BATCH_FILES,a as MAX_RECENT_EMOJI_COUNT,g as UNICODE_EMOJI_CATALOG,M as blockReasonForChannelSession,L as blockReasonForChannelState,T as blockReasonForGroupState,W as blockReasonForSession,G as canEditMessage,w as canPinChannelMessage,v as canPinGroupMessage,x as canPinMessage,F as canRecallMessage,da as cancelMediaUpload,R as classifyGifFile,Q as classifyMediaFile,s as countUnreadConversations,u as createChatRuntime,p as createEmojiMatcher,I as decideConversationAction,K as decideMemberTargetAction,J as decideMessageAction,l as emojiAssetUrl,n as emojiUrlByCode,Da as fetchConversationFileBatch,Ea as fetchConversationImageBatch,Ba as fetchConversationMessageBatch,Fa as fetchConversationVideoBatch,Ga as fetchConversationVoiceBatch,Ha as fetchNextConversationSearchBatch,r as formatConversationUnreadBadge,ga as forwardService,o as hasEmojiCandidate,S as isGifFile,y as isPinnedMessageProtected,_ as isVoiceStorageConfigured,O as mediaBatchBudgetBytes,la as messageService,e as parseUnicodeEmojiCode,qa as pinnedMessageService,d as prependRecentEmoji,Aa as profileService,Z as replaceInterruptedMediaFile,U as requiresConversationEncryption,B as resolveChannelMemberAvatarUrl,A as resolveChannelMemberDisplayName,k as resolveEmojiToken,E as resolveFriendDisplayName,ra as resolveImProfileAccessDestination,z as resolveMemberDisplayName,t as resolveMessageNotificationDecision,D as resolvePublicNickname,C as resolveSenderAvatarUrl,q as resolveStandaloneEmojiMessage,h as resolveUnicodeEmoji,ea as retryMessage,P as runMediaSendBatch,ca as sendAsFilesBatch,H as sendBlockReasonForDecision,aa as sendMediaAlbum,Y as sendMediaFile,ba as sendMediaFilesBatch,X as sendText,$ as sendVoice,V as supportsConversationMention,f as unicodeEmojiTextFromCode}from'./chunk-VRGWQLDM.js';export{C as createNewMessageBadgeController,i as createThreadItems,f as formatChatDateSeparator,e as formatConversationDisplayTime,c as getLocalDayKey,l as isMessageLocateScrollProtected,v as isMessageTailChangeFromOlderWindowTrim,k as isMessageViewportMeasurable,B as isMessageVisibleForNewMessageBadge,x as loadOlderUntilBoundary,p as refreshPrependMessageAnchorPosition,j as resolveCenteredMessageScrollTop,a as resolveDisplayTimestamp,g as resolveImThreadActiveDate,h as resolveMessageBodyKind,b as resolveMessageTimelineTimestamp,n as resolvePrependMessageAnchor,q as resolvePrependMessageAnchorAdjustment,o as resolvePrependMessageAnchorPosition,s as resolveSurvivingMessageAnchorAdjustment,r as resolveVisibleMessageAnchorPositions,t as shouldCompleteInitialViewport,y as shouldFillInitialHistoryViewport,u as shouldFollowIncomingMessage,z as shouldLoadNewerHistoryPage,m as shouldPrefetchOlderHistory,w as shouldRestoreMessageViewportFocus,d as shouldShowChatDateSeparator,A as shouldTrackRemoteMessageForBadge}from'./chunk-SLFKCTEX.js';import'./chunk-37HOEWMF.js';import'./chunk-MNWNUGIV.js';import'./chunk-GHZUH7RB.js';export{ta as canTransmit,ra as canTransmitByType,sa as canTransmitContent,qa as requiresForwardTypeConfirmation}from'./chunk-4KPJTXQN.js';import'./chunk-WOT6VMZA.js';