k2-im 0.1.37 → 0.1.39

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.
@@ -710,7 +710,7 @@ interface MediaTaskUpdate {
710
710
  * upload 任务子阶段。
711
711
  *
712
712
  * `waiting-upload-slot` 与 `state: 'queued'` 同时出现,表示还没开始传字节(在生成缩略图或在等上传槽位),
713
- * 此时 percent 恒为 0;`transferring` 正在传字节;`finalizing` 是等待远端 URL 最终确认。
713
+ * 首发 percent 为 0,断点恢复时保留已有进度;`transferring` 正在传字节;`finalizing` 是等待远端 URL 最终确认。
714
714
  */
715
715
  phase?: 'waiting-upload-slot' | 'waiting-retry' | 'transferring' | 'finalizing';
716
716
  /** 当前发送意图的尝试序号与总上限。 */
@@ -719,6 +719,18 @@ interface MediaTaskUpdate {
719
719
  /** 已传与总字节数,供共享展示层估算速度。 */
720
720
  bytesTransferred?: number;
721
721
  bytesTotal?: number;
722
+ /** 上传合集的逐项真实字节快照;整组发送仍由外层任务控制,不为每格创建独立发送。 */
723
+ items?: readonly Readonly<{
724
+ /** 从零开始的合集位置。 */
725
+ itemIndex: number;
726
+ /** 本项实际上传字节与源文件总字节。 */
727
+ bytesTransferred: number;
728
+ bytesTotal: number;
729
+ /** 远端资源确认完成前最多 99%。 */
730
+ percent: number;
731
+ /** 本项状态;已完成项不随兄弟项取消或失败回退。 */
732
+ state: 'queued' | 'running' | 'completed' | 'failed' | 'canceled';
733
+ }>[];
722
734
  /** 跨刷新恢复可用性;缺省尚未建立恢复记录。 */
723
735
  recovery?: 'available' | 'session-only';
724
736
  recoveryReason?: string;
@@ -1857,6 +1869,8 @@ interface MediaAssetCacheStrategy {
1857
1869
  softMaxBytes: number;
1858
1870
  maxEntries: number;
1859
1871
  maxEntryBytes: number;
1872
+ /** 完整媒体副本允许连续未访问的最长毫秒数;省略时不按时间过期,仍执行容量限制。 */
1873
+ maxIdleMs?: number;
1860
1874
  }
1861
1875
  /** 精确按 kind 解析策略;未注册返回 undefined,不提供默认策略。 */
1862
1876
  interface MediaAssetCacheStrategyRegistry {
@@ -1870,8 +1884,12 @@ interface MediaAssetCacheStrategyRegistry {
1870
1884
  */
1871
1885
  interface MediaAssetCachePort {
1872
1886
  get: (key: MediaAssetCacheKey) => Promise<MediaAssetCacheEntry | null>;
1887
+ /** 按输入顺序检查完整资源是否存在且未过期;不读取 Blob、不延长闲置期限,存储故障必须抛出。 */
1888
+ hasMany?: (keys: readonly MediaAssetCacheKey[]) => Promise<readonly boolean[]>;
1873
1889
  put: (entry: MediaAssetCacheEntry) => Promise<'stored' | 'skipped'>;
1874
1890
  clear: () => Promise<void>;
1891
+ /** 删除超过闲置期限的完整持久副本;不撤销已经返回的 Blob 或宿主持有的播放地址。 */
1892
+ prune?: () => Promise<void>;
1875
1893
  }
1876
1894
 
1877
1895
  interface ImProfilePort {
@@ -2416,6 +2434,11 @@ type ImEvent = {
2416
2434
  | {
2417
2435
  type: 'receiving:changed';
2418
2436
  receiving: boolean;
2437
+ }
2438
+ /** 全局会话与离线消息同步;不包含当前会话的打开或历史分页。 */
2439
+ | {
2440
+ type: 'syncing:changed';
2441
+ syncing: boolean;
2419
2442
  } | {
2420
2443
  type: 'auth:invalid';
2421
2444
  issue: ImAuthIssue;
@@ -2550,6 +2573,21 @@ interface ImTextSearchMatch {
2550
2573
  method: 'direct' | 'pinyin';
2551
2574
  ranges: readonly ImTextSearchRange[];
2552
2575
  }
2576
+ /** 单次文本匹配选项。 */
2577
+ interface ImTextSearchMatchOptions {
2578
+ /** 是否允许中文拼音匹配;用户名、业务 ID 等非自然语言字段可显式关闭。 */
2579
+ pinyin?: boolean;
2580
+ }
2581
+ /**
2582
+ * 针对一个关键词预备的可复用文本 matcher。
2583
+ *
2584
+ * @remarks matcher 不持有账号或目录状态,可连续匹配联系人名称、消息正文等任意可见文本。
2585
+ */
2586
+ interface ImTextSearchMatcher {
2587
+ /** 去除首尾空白并统一小写后的搜索关键词。 */
2588
+ readonly keyword: string;
2589
+ match: (text: string, options?: ImTextSearchMatchOptions) => ImTextSearchMatch | null;
2590
+ }
2553
2591
 
2554
2592
  /**
2555
2593
  * 内联富文本展示段(泛型 `Extra` = 宿主注入的应用段类型,默认 `never`):
@@ -3064,8 +3102,8 @@ interface IndexedDbStorageAdapterOptions {
3064
3102
  maxPendingWriteBytes?: number;
3065
3103
  };
3066
3104
  }
3067
- /** 官方浏览器 adapter 始终提供背景和最近历史缓存;可选只存在于通用 `ImStoragePort` 兼容边界。 */
3068
- type IndexedDbStorageAdapter = ImStoragePort & MediaAssetCachePort & Required<Pick<ImStoragePort, 'getConversationBackground' | 'recentHistoryCache' | 'saveConversationBackground' | 'deleteConversationBackground' | 'getDefaultConversationBackground' | 'saveDefaultConversationBackground' | 'deleteDefaultConversationBackground'>>;
3105
+ /** 官方浏览器 adapter 始终提供背景、最近历史和媒体缓存维护;通用端口为其它实现保留可选能力。 */
3106
+ type IndexedDbStorageAdapter = ImStoragePort & MediaAssetCachePort & Required<Pick<MediaAssetCachePort, 'prune' | 'hasMany'>> & Required<Pick<ImStoragePort, 'getConversationBackground' | 'recentHistoryCache' | 'saveConversationBackground' | 'deleteConversationBackground' | 'getDefaultConversationBackground' | 'saveDefaultConversationBackground' | 'deleteDefaultConversationBackground'>>;
3069
3107
  /**
3070
3108
  * 创建 IndexedDB 存储 adapter(实现 ImStoragePort)。
3071
3109
  * 生命周期:先 `open({ namespace })`(幂等,跑 schema 迁移),再读写;`close()` 释放句柄。
@@ -3987,6 +4025,8 @@ interface ImLifecycleSnapshot {
3987
4025
  authenticated: boolean;
3988
4026
  /** 会话同步或前台内容读取仍在进行;不包含后台预取、媒体下载和写操作,也不代表同步成功。 */
3989
4027
  receiving: boolean;
4028
+ /** 全局会话与离线消息同步仍在进行;前台会话读取由 receiving 和窗口 loading 表示。 */
4029
+ syncing: boolean;
3990
4030
  }
3991
4031
  /** logout 的本地数据与在途消息策略。 */
3992
4032
  interface ImLogoutOptions {
@@ -5159,17 +5199,19 @@ interface ConversationHandle<TType extends ProductHandleConversationType = Produ
5159
5199
  resolveMessage: (messageId: string) => Promise<ImMessageView | null>;
5160
5200
  history: {
5161
5201
  loadLatest: () => Promise<void>;
5162
- /** 有限加载进入时冻结边界;成功才替换窗口,不可定位返回 false,网络失败抛错并保留数量。 */
5163
- loadEntryUnread: () => Promise<boolean>;
5202
+ /** 读取进入时冻结边界;signal 取消会停止查询且不替换窗口,可重新发起。不可定位返回 false,失败抛错。 */
5203
+ loadEntryUnread: (options?: {
5204
+ signal?: AbortSignal;
5205
+ }) => Promise<boolean>;
5164
5206
  loadOlder: () => Promise<void>;
5165
5207
  /** 历史定位窗口向更新方向连续翻页;接回最新端后 `hasNewer` 变为 false。 */
5166
5208
  loadNewer: () => Promise<void>;
5167
5209
  /**
5168
5210
  * 按稳定消息 id 打开目标附近的连续历史窗口。
5169
5211
  *
5170
- * @remarks 冷启动时允许使用同一复合会话的完整置顶预览或短期搜索结果作为只读锚点;二者都不会因此写入
5171
- * 普通消息 Store,partial 置顶、过期搜索结果仍因缺少可信排序信息而明确拒绝定位。
5172
- * @throws 目标不在本机历史或不属于当前复合会话时,抛出稳定 `IM_SDK_MESSAGE_NOT_FOUND`
5212
+ * @remarks GROUP 完整置顶预览可按消息时间定位;CHANNEL 置顶未缓存时先按 ID 取回正式历史记录,
5213
+ * 以服务端游标继续双向分页。短期搜索结果只作为只读锚点;partial 置顶和过期搜索结果明确拒绝定位。
5214
+ * @throws 没有可用锚点、远端确认缺失或目标不属于当前复合会话时,抛出稳定 `IM_SDK_MESSAGE_NOT_FOUND`
5173
5215
  * (`category: 'state'`、`retryable: false`、`details.messageId`)。这是常见产品结果而非链路异常,
5174
5216
  * 调用方应据此与真正的存储/协议失败区分反馈,不要解析错误文案。
5175
5217
  */
@@ -5305,6 +5347,8 @@ interface ImMediaTask {
5305
5347
  * 上传任务不带下标:一条合集整体只有一条上传进度(所有项都传完才算这条消息发出去)。
5306
5348
  */
5307
5349
  itemIndex?: number;
5350
+ /** 合集各项的真实上传快照;控制动作仍作用于整条消息,不包含资源或传输凭据。 */
5351
+ items?: MediaTaskUpdate['items'];
5308
5352
  /** upload 来自发送链路,download 来自本产品 API。 */
5309
5353
  direction: 'upload' | 'download';
5310
5354
  /** 终态 completed/failed/canceled 不会被同一尝试的迟到 progress 回退。 */
@@ -5350,6 +5394,20 @@ interface ImMediaTask {
5350
5394
  * ```
5351
5395
  */
5352
5396
  interface ImMediaTasksApi {
5397
+ /** 清除当前账号完整媒体缓存及下载断点;保留消息、草稿、上传源和已交付的播放资源,在途下载仍可完成。 */
5398
+ clearCache: () => Promise<void>;
5399
+ /**
5400
+ * 按输入顺序查询完整本机媒体是否可用;不下载、不读取 Blob、不续缓存期限或创建任务。
5401
+ * 仅支持图片/视频(含媒体合集);未配置持久缓存时只检查内存。
5402
+ * @throws 不支持轻量查询或存储读取失败时明确拒绝,不伪装成未命中。
5403
+ * @example const [available] = await client.media.probeCached([messageRef])
5404
+ */
5405
+ probeCached: (messages: readonly ImMessageRef[]) => Promise<readonly boolean[]>;
5406
+ /**
5407
+ * 缓存写入、清理或过期后通知消费者重新查询;账号销毁后自动退订。
5408
+ * @example const stop = client.media.subscribeCacheChanges(() => refreshVisibleMedia())
5409
+ */
5410
+ subscribeCacheChanges: (listener: () => void) => () => void;
5353
5411
  /**
5354
5412
  * 返回当前账号全部活跃任务与近期终态任务的冻结快照;总量超过 128 时只淘汰终态,极端并发活跃可暂时超过上限。
5355
5413
  * @throws runtime 已 logout/dispose 时抛 `IM_SDK_MEDIA_RUNTIME_INACTIVE`。
@@ -5364,7 +5422,10 @@ interface ImMediaTasksApi {
5364
5422
  * 取消 queued/running 任务;上传委托 core,下载中止当前 AbortController。
5365
5423
  * @throws 未知任务、非法状态或底层未受理时以稳定 `IM_SDK_MEDIA_TASK_*` 错误拒绝。
5366
5424
  */
5367
- cancel: (taskId: string) => Promise<void>;
5425
+ cancel: (taskId: string, options?: {
5426
+ /** 取消发送但保留已确认上传分片与原文件,只有用户显式重试才继续。默认取消仍清理。 */
5427
+ retainCheckpoint?: boolean;
5428
+ }) => Promise<void>;
5368
5429
  /** 暂停上传,等待请求收尾后返回;下载不支持暂停。 */
5369
5430
  pause: (taskId: string) => Promise<void>;
5370
5431
  /** 恢复已暂停上传,复用同一原文件与消息。 */
@@ -5382,19 +5443,28 @@ interface ImMediaTasksApi {
5382
5443
  /**
5383
5444
  * 重试 failed/canceled 任务;上传复用保留原文件,下载重新解析同一精确消息引用。
5384
5445
  * 续传不可用或清理未确认时,必须先征得用户同意重新上传,再传 restartUpload:true。
5385
- * 用户取消后的重发始终重新上传尚未完成的资源;成功的合集项仍可复用。
5446
+ * 保留式取消后的重发复用已确认分片和原密钥;默认清理式取消不保证保有原文件。
5386
5447
  * 下载取消已受理后即可创建新尝试,不复用旧取消 Promise;旧 loader 结束前仍占用并发槽,但不能覆盖新任务。
5387
5448
  * @throws 原文件已淘汰、任务仍在途或消息/下载 capability 不可用时显式拒绝。
5388
5449
  */
5389
5450
  retry: (taskId: string, options?: {
5390
5451
  /** 用户已确认放弃旧进度并重新上传;仅上传任务接受,清理失败时仍停止。 */
5391
5452
  restartUpload?: boolean;
5453
+ /** 下载断点已失效或超出缓存预算时,用户确认从头下载。 */
5454
+ restartDownload?: boolean;
5392
5455
  }) => Promise<void>;
5393
5456
  /**
5394
5457
  * 下载并按消息正文合同解密,同一消息并发调用复用同一 Promise,成功返回 Blob。
5395
5458
  * @throws 消息不存在/非媒体/无远端 URL/未装配 capability、传输失败、取消或 teardown 均以稳定错误拒绝,不返回空 Blob。
5396
5459
  */
5397
5460
  download: (message: ImMessageRef) => Promise<Blob>;
5461
+ /**
5462
+ * 将最近预览的精确媒体项设为最高下载优先级,不新建或取消任务。
5463
+ * 下一空闲任务/分片请求名额优先给该项;已发请求不中断,关闭播放器不撤销优先级。
5464
+ * 后续调用替换上一个目标;账号退出后不可调用。
5465
+ * @example client.media.prioritizeDownload({ conversation, messageId, itemIndex: 1 })
5466
+ */
5467
+ prioritizeDownload: (message: ImMessageRef) => void;
5398
5468
  /**
5399
5469
  * 仅读取当前账号内存或持久媒体资产缓存;命中返回 Blob,未缓存或类型未注册返回 `null`。
5400
5470
  *
@@ -5604,6 +5674,10 @@ interface ImProductEventMap {
5604
5674
  'receiving:changed': Readonly<{
5605
5675
  receiving: boolean;
5606
5676
  }>;
5677
+ /** 全局同步所有支路的汇总状态;不包含打开会话、历史分页或后台预取。 */
5678
+ 'syncing:changed': Readonly<{
5679
+ syncing: boolean;
5680
+ }>;
5607
5681
  /** `lastLoginTime` 为服务端记录的上次登录时间(毫秒),仅被踢且走登录 ACK 的路径才有值。 */
5608
5682
  'auth:invalid': Readonly<{
5609
5683
  code: string;
@@ -5920,7 +5994,18 @@ interface ProductMessageSearchResult<TContent extends MessageContentType = Messa
5920
5994
  createdAt: number;
5921
5995
  contentType: TContent;
5922
5996
  preview: string;
5997
+ /** 展示用片段;正文/配文携带提及信息,文件名等业务字段保持普通文本。拼接后与 preview 相同。 */
5998
+ previewParts: readonly ProductMessageSearchPreviewPart[];
5923
5999
  }
6000
+ /** 搜索摘要的最小内容投影;不携带完整消息、媒体资源或协议字段。 */
6001
+ type ProductMessageSearchPreviewPart = {
6002
+ kind: 'plain';
6003
+ text: string;
6004
+ } | {
6005
+ kind: 'rich-text';
6006
+ text: string;
6007
+ mention?: ImMessageMention;
6008
+ };
5924
6009
  /** 产品消息搜索页;底层 `beforeSortKey` 仅存在于账号 runtime token registry。 */
5925
6010
  interface ProductMessageSearchPage<TContent extends MessageContentType = MessageContentType> {
5926
6011
  items: readonly ProductMessageSearchResult<TContent>[];
@@ -6192,6 +6277,7 @@ interface ImClientOptions {
6192
6277
  /** 显式开启视频/文件跨刷新续传。最多 3 条、24 小时,保存加密密钥但不保存文件副本;注销清除。 */
6193
6278
  uploadRecovery?: {
6194
6279
  enabled: boolean;
6280
+ retainFailedUploads?: boolean;
6195
6281
  };
6196
6282
  }
6197
6283
  /**
@@ -6897,6 +6983,163 @@ type MessageNotificationDecision = {
6897
6983
  /** PC/H5 共用的实时消息提醒规则;离线历史回放不逐条弹通知。 */
6898
6984
  declare function resolveMessageNotificationDecision(input: MessageNotificationInput): MessageNotificationDecision;
6899
6985
 
6986
+ /** Emoji 最近使用列表的固定上限,与 iOS `maxLatelyEmoji` 保持一致。 */
6987
+ declare const MAX_RECENT_EMOJI_COUNT = 14;
6988
+ /** 石头剪刀布入口的稳定身份;游戏结果不参与最近列表去重。 */
6989
+ declare const EMOJI_GAME_RPS_STABLE_KEY = "game:rps";
6990
+ /** 骰子入口的稳定身份;游戏结果不参与最近列表去重。 */
6991
+ declare const EMOJI_GAME_DICE_STABLE_KEY = "game:dice";
6992
+ /** 最近使用规则所需的最小表情合同。 */
6993
+ interface EmojiRecentItem {
6994
+ readonly stableKey: string;
6995
+ }
6996
+ /**
6997
+ * 将一次表情选择置顶,并返回最多 14 项的新列表。
6998
+ *
6999
+ * 相同 `stableKey` 只保留最新传入项,其余历史项按原顺序全量去重。函数不修改输入数组,也不负责
7000
+ * 持久化、账号隔离或网络上报;这些副作用由调用方在正确层级处理。
7001
+ *
7002
+ * @template TItem 具体表情 DTO,必须提供跨表情类型稳定且唯一的 `stableKey`。
7003
+ */
7004
+ declare function prependRecentEmoji<TItem extends EmojiRecentItem>(recent: readonly TItem[], selected: TItem): readonly TItem[];
7005
+
7006
+ /** 面板可直接消费的一枚 Unicode 表情稳定 DTO。 */
7007
+ interface UnicodeEmojiEntry {
7008
+ /** 与其它表情类型不冲突的最近使用去重键。 */
7009
+ readonly stableKey: string;
7010
+ /** 从 iOS 文本预生成的 canonical code;多个 scalar 以单个空格分隔。 */
7011
+ readonly code: string;
7012
+ /** 已验证的 Unicode scalar sequence。 */
7013
+ readonly codePoints: readonly number[];
7014
+ /** 由 `codePoints` 生成的实际输入文本。 */
7015
+ readonly text: string;
7016
+ readonly kind: 'unicode';
7017
+ }
7018
+ /**
7019
+ * 把显式 code sequence 转成 Unicode scalar 数组。
7020
+ *
7021
+ * 本函数只解析由空格分隔的 `0x...` scalar,不用正则或字符外观猜测 grapheme。空段、代理项、
7022
+ * 越界值和非十六进制输入都会 fail-fast,避免坏目录在面板运行后才暴露。
7023
+ */
7024
+ declare function parseUnicodeEmojiCode(code: string): readonly number[];
7025
+ /** 根据一个或多个显式 Unicode scalar 生成输入文本。 */
7026
+ declare function unicodeEmojiTextFromCode(code: string): string;
7027
+ /** iOS `emoji_string.json` 的 301 枚 Unicode 表情,只读且顺序稳定。 */
7028
+ declare const UNICODE_EMOJI_CATALOG: readonly UnicodeEmojiEntry[];
7029
+ /**
7030
+ * 按 canonical code 或实际 Unicode 文本解析目录项。
7031
+ *
7032
+ * 合法但不在目录中的 code/text 返回 `undefined`;以 `0x` 开头但格式非法的 code 会 fail-fast。
7033
+ * 文本仅做精确查表,并显式兼容末尾 U+FE0F,不扫描或推测 grapheme 边界。
7034
+ */
7035
+ declare function resolveUnicodeEmoji(codeOrText: string): UnicodeEmojiEntry | undefined;
7036
+
7037
+ /**
7038
+ * IM 文本表情目录和识别工具。
7039
+ *
7040
+ * 输入框与消息正文使用 `[Anger]`、`[愤怒]`、`[666]` 这类 token 表示自定义表情。本文件读取同目录
7041
+ * `emoji-catalog.json`;该 JSON 是标准纯数据文件,格式不允许注释,每项字段含义统一记录在
7042
+ * `EmojiEntry`。当前目录来自 Android 同一套 110 枚图片,以保证跨端 token 和资源一致。
7043
+ *
7044
+ * 发送时保留原 token 文本,其他端或图片缺失时仍可显示;渲染时 matcher 只把目录中存在的 token
7045
+ * 转成图片段。未知 `[xxx]`、`@` 使用的方括号内容和不完整 token 保持普通文本。本文件不创建组件,
7046
+ * 表情面板与消息渲染器通过 `emojiAssetUrl` / `emojiUrlByCode` 取得图片地址。
7047
+ */
7048
+
7049
+ /**
7050
+ * `emoji-catalog.json` 中的一枚表情。
7051
+ *
7052
+ * `code` 是跨端稳定标识;`tokens` 是正文中可识别的英文名和中文别名,均包含方括号且大小写敏感;
7053
+ * `file` 是静态图片文件名。
7054
+ */
7055
+ type EmojiEntry = ImEmojiCatalogEntry;
7056
+ /** 可发送的完整表情目录,当前共 110 枚。 */
7057
+ declare const EMOJI_CATALOG: readonly ImEmojiCatalogEntry[];
7058
+ /**
7059
+ * PC Web 发送面板使用的当前版表情目录。
7060
+ *
7061
+ * H5 或 CDN 路径不同时,在 `emojiAssetUrl` / `emojiUrlByCode` 传入自己的 base,无需修改目录数据。
7062
+ * PC 消息回显会在当前版资源加载失败时显式尝试 `/images/emoji/v2`,因此旧目录不能复用这个默认值。
7063
+ */
7064
+ declare const DEFAULT_EMOJI_ASSET_BASE = "/images/emoji/v1";
7065
+ /**
7066
+ * 按完整且大小写敏感的 token 查找表情,例如 `[愤怒]`。
7067
+ *
7068
+ * 未命中返回 `undefined`,消息渲染器继续把原 token 当普通文本显示。
7069
+ */
7070
+ declare function resolveEmojiToken(token: string): EmojiEntry | undefined;
7071
+ /** 生成表情图片 URL;未传 base 时使用 PC Web 默认目录。 */
7072
+ declare function emojiAssetUrl(entry: EmojiEntry, base?: string): string;
7073
+ /**
7074
+ * 扫描正文中 1 到 20 个字符的 `[xxx]` 候选。
7075
+ *
7076
+ * 正则命中只表示“可能是表情”,必须再经 `resolveEmojiToken` 查目录;未命中的候选仍是普通文本。
7077
+ */
7078
+ declare const EMOJI_TOKEN_RE: RegExp;
7079
+ /** 按稳定 code 取得图片 URL;未知 code 返回 `undefined`。 */
7080
+ declare function emojiUrlByCode(code: string, base?: string): string | undefined;
7081
+ /** 快速判断正文是否可能包含 `[表情名]` 候选。 */
7082
+ declare function hasEmojiCandidate(text: string): boolean;
7083
+ /** 当前目录中存在图片资源的表情片段。 */
7084
+ interface EmojiAssetSegment {
7085
+ kind: 'emoji';
7086
+ text: string;
7087
+ code: string;
7088
+ }
7089
+ /** 历史目录中存在、但当前版本没有图片映射的 token;宿主用默认表情占位呈现。 */
7090
+ interface LegacyEmojiPlaceholderSegment {
7091
+ kind: 'legacy-emoji-placeholder';
7092
+ text: string;
7093
+ }
7094
+ /**
7095
+ * 消息渲染器使用的表情片段。
7096
+ *
7097
+ * 当前表情保留稳定 `code` 以解析图片;历史表情只保留原 token 和占位语义。图片加载、候选切换与
7098
+ * 最终占位图标仍由宿主管理。
7099
+ */
7100
+ type EmojiSegment = EmojiAssetSegment | LegacyEmojiPlaceholderSegment;
7101
+ /** 仅由已知 `[表情]` token 组成的文本消息展示信息。 */
7102
+ interface StandaloneEmojiMessage {
7103
+ /** 按正文顺序排列的 current/legacy 表情段。 */
7104
+ segments: readonly EmojiSegment[];
7105
+ /** 表情数量;宿主据此选择 1/2/3/4+ 的展示尺寸。 */
7106
+ count: number;
7107
+ }
7108
+ /**
7109
+ * 创建消息文本表情分段器。
7110
+ *
7111
+ * 当前目录优先于历史目录:当前 token 产出带 `code` 的图片片段,old-only token 产出无资源 URL 的
7112
+ * 占位片段。普通 `[123]`、`@` 的用户 ID、不完整 token 和两个目录都未知的内容继续显示为普通文本。
7113
+ */
7114
+ declare function createEmojiMatcher(): SegmentMatcher<EmojiSegment>;
7115
+ /**
7116
+ * 判断一条文本消息是否完全由已知 `[表情]` token 组成。
7117
+ *
7118
+ * token 之间出现空格、换行、普通文本或未知 `[xxx]` 时返回 `null`,让宿主继续使用普通文本气泡。
7119
+ * 携带 mention metadata 的消息也返回 `null`,因为协议 mention 的解释优先于同形 token(例如 `[666]`)。
7120
+ * 本函数只提供无 UI 的分段和数量,不决定气泡颜色、尺寸或 DOM。
7121
+ */
7122
+ declare function resolveStandaloneEmojiMessage(message: Pick<ImMessageView, 'body' | 'contentType' | 'encryption' | 'mention'>): StandaloneEmojiMessage | null;
7123
+
7124
+ /** 搜索摘要段保留表情与提及类型;hit 只控制宿主高亮,不产生点击行为。 */
7125
+ type MessageSearchPreviewSegment = TextSegment<EmojiSegment> & {
7126
+ hit: boolean;
7127
+ };
7128
+ /** 搜索预览与正文共用名称解析和接收端语言;matcher 使用最终显示文本计算命中位置。 */
7129
+ interface MessageSearchPreviewOptions {
7130
+ locale: ImLocale;
7131
+ resolveName: (userId: string, fallbackName?: string) => string;
7132
+ matcher: ImTextSearchMatcher | null;
7133
+ /** 没有可搜索正文时,由宿主提供本地化消息类型标签。 */
7134
+ emptyText: string;
7135
+ }
7136
+ /**
7137
+ * PC/H5 搜索摘要复用正文的提及解析与表情目录。先解析再匹配整个显示文本,保证 @ 名称长度变化、
7138
+ * 跨片段关键词和拼音高亮的坐标正确;表情命中时整枚高亮,不把 token 切碎而丢失图片。
7139
+ * 链接保留可读文字,整行仍只执行定位原消息,避免在结果按钮内嵌套链接和提及按钮。
7140
+ */
7141
+ declare function resolveMessageSearchPreview(result: ProductMessageSearchResult, options: MessageSearchPreviewOptions): readonly MessageSearchPreviewSegment[];
7142
+
6900
7143
  /**
6901
7144
  * 小程序游戏预览卡(消息 22 且 `showType=game-preview`)的呈现判定。
6902
7145
  *
@@ -7080,6 +7323,7 @@ interface ChatRuntimeHostDeps {
7080
7323
  /** 显式启用账号隔离的跨刷新恢复记录;保存密钥、不保存原文件,注销清除。 */
7081
7324
  uploadRecovery?: {
7082
7325
  enabled: boolean;
7326
+ retainFailedUploads?: boolean;
7083
7327
  };
7084
7328
  /** 获取 GIF provider 配置;API key 只留在宿主闭包与 SDK adapter,不进入共享 Store。 */
7085
7329
  getExpressionOptions?: () => ImExpressionOptions | undefined;
@@ -7357,7 +7601,11 @@ interface ChatRuntime {
7357
7601
  resolveMediaPreviewToRemote: (ref: ChatMediaMessageRef, contentType: 'image' | 'video' | 'sticker', byteSize?: number) => void;
7358
7602
  /** 为指定消息取得本地媒体播放租约;没有本地缓存时返回 `undefined`,调用方应改用远端资源。 */
7359
7603
  acquireMediaBlob: (ref: ChatMediaMessageRef) => MediaObjectUrlLease | undefined;
7604
+ /** 只读检查完整本地媒体是否可用,不取得租约、不改变缓存淘汰顺序。 */
7605
+ hasMediaBlob: (ref: ChatMediaMessageRef) => boolean;
7360
7606
  /** 撤销当前账号创建的全部媒体预览地址并释放 Blob 内存,切账号、退出或销毁时调用。 */
7607
+ /** 清理当前账号完整媒体缓存和下载断点;上传源保留,正在使用的播放地址在释放后才撤销。 */
7608
+ clearMediaCache: () => Promise<void>;
7361
7609
  cleanupLocalMediaBlobs: () => void;
7362
7610
  /** 删除会话时释放该会话绑定的本地媒体预览/播放缓存。 */
7363
7611
  cleanupConversationMediaBlobs: (conversation: ConversationRef<'direct' | 'group' | 'channel' | 'robot'>) => void;
@@ -7739,6 +7987,12 @@ type GifFileClassification = 'gif' | 'not-gif' | 'invalid-gif';
7739
7987
  declare function classifyGifFile(file: Blob): Promise<GifFileClassification>;
7740
7988
  declare function isGifFile(file: Blob): Promise<boolean>;
7741
7989
 
7990
+ /**
7991
+ * 将用户最后预览的媒体项交给 SDK 提高下载优先级,不创建任务或持有页面资源。
7992
+ * 在异步查缓存、加载 URL 之前调用,重复打开已有下载也会更新优先级。
7993
+ * @example mediaService.prioritizeMediaDownload(runtime, message, 1)
7994
+ */
7995
+ declare function prioritizeMediaDownload(runtime: ChatRuntime, message: ImMessageView, itemIndex?: number): void;
7742
7996
  /**
7743
7997
  * 为宿主手里的本地图片/视频文件预读展示元信息(尺寸、视频时长、视频首帧封面 JPEG 字节)。
7744
7998
  *
@@ -7802,7 +8056,7 @@ declare function loadCachedVideoObjectUrl(runtime: ChatRuntime, message: ImMessa
7802
8056
  * 同一条门槛),不把无效二进制交给 `<img>`。
7803
8057
  *
7804
8058
  * 返回 `null` 表示下标越界、正文不是合集、内容非法或下载失败,失败原因经 `setNote` 反馈。
7805
- * **唯一不反馈的失败是用户自己取消**(关预览浮层时取消这一项的在途下载):同样返回 `null`,但不提示。
8059
+ * **唯一不反馈的失败是用户自己取消**(点击停止按钮取消这一项的在途下载):同样返回 `null`,但不提示。
7806
8060
  * **调用方在不再使用地址时必须 `URL.revokeObjectURL`。**
7807
8061
  */
7808
8062
  declare function loadMediaAlbumItemObjectUrl(runtime: ChatRuntime, message: ImMessageView, itemIndex: number, hooks: ServiceNoteHooks, onProgress?: (percent: number) => void): Promise<string | null>;
@@ -7847,6 +8101,7 @@ declare const media_service_loadMediaAlbumItemObjectUrl: typeof loadMediaAlbumIt
7847
8101
  declare const media_service_loadVideoObjectUrl: typeof loadVideoObjectUrl;
7848
8102
  declare const media_service_loadVoiceBytes: typeof loadVoiceBytes;
7849
8103
  declare const media_service_prepareLocalMediaPreview: typeof prepareLocalMediaPreview;
8104
+ declare const media_service_prioritizeMediaDownload: typeof prioritizeMediaDownload;
7850
8105
  declare namespace media_service {
7851
8106
  export {
7852
8107
  media_service_acquireMediaBlob as acquireMediaBlob,
@@ -7861,6 +8116,7 @@ declare namespace media_service {
7861
8116
  media_service_loadVideoObjectUrl as loadVideoObjectUrl,
7862
8117
  media_service_loadVoiceBytes as loadVoiceBytes,
7863
8118
  media_service_prepareLocalMediaPreview as prepareLocalMediaPreview,
8119
+ media_service_prioritizeMediaDownload as prioritizeMediaDownload,
7864
8120
  };
7865
8121
  }
7866
8122
 
@@ -8503,7 +8759,7 @@ declare function cancelMediaUpload(runtime: ChatRuntime, messageId: string, hook
8503
8759
  /**
8504
8760
  * 重试当前线程中的一条失败消息。
8505
8761
  *
8506
- * 上传失败时尝试续传,取消后重新上传未完成资源;restartUpload 只接受宿主明确确认后的完整重传。
8762
+ * 上传失败及保留式取消时尝试续传;restartUpload 只接受宿主明确确认后的完整重传。
8507
8763
  * 已经完成媒体上传但消息发送失败,或普通文本失败时,重试
8508
8764
  * SDK 待发送队列。两种路径都复用原消息 ID,不新增气泡。只有账号未变化且 SDK 接受重试时返回 `true`。
8509
8765
  */
@@ -8830,144 +9086,6 @@ type ImQuotedMessagePresentation = 'hidden'
8830
9086
  */
8831
9087
  declare function resolveQuotedMessagePresentation(original: ImMessageView): ImQuotedMessagePresentation;
8832
9088
 
8833
- /** Emoji 最近使用列表的固定上限,与 iOS `maxLatelyEmoji` 保持一致。 */
8834
- declare const MAX_RECENT_EMOJI_COUNT = 14;
8835
- /** 石头剪刀布入口的稳定身份;游戏结果不参与最近列表去重。 */
8836
- declare const EMOJI_GAME_RPS_STABLE_KEY = "game:rps";
8837
- /** 骰子入口的稳定身份;游戏结果不参与最近列表去重。 */
8838
- declare const EMOJI_GAME_DICE_STABLE_KEY = "game:dice";
8839
- /** 最近使用规则所需的最小表情合同。 */
8840
- interface EmojiRecentItem {
8841
- readonly stableKey: string;
8842
- }
8843
- /**
8844
- * 将一次表情选择置顶,并返回最多 14 项的新列表。
8845
- *
8846
- * 相同 `stableKey` 只保留最新传入项,其余历史项按原顺序全量去重。函数不修改输入数组,也不负责
8847
- * 持久化、账号隔离或网络上报;这些副作用由调用方在正确层级处理。
8848
- *
8849
- * @template TItem 具体表情 DTO,必须提供跨表情类型稳定且唯一的 `stableKey`。
8850
- */
8851
- declare function prependRecentEmoji<TItem extends EmojiRecentItem>(recent: readonly TItem[], selected: TItem): readonly TItem[];
8852
-
8853
- /** 面板可直接消费的一枚 Unicode 表情稳定 DTO。 */
8854
- interface UnicodeEmojiEntry {
8855
- /** 与其它表情类型不冲突的最近使用去重键。 */
8856
- readonly stableKey: string;
8857
- /** 从 iOS 文本预生成的 canonical code;多个 scalar 以单个空格分隔。 */
8858
- readonly code: string;
8859
- /** 已验证的 Unicode scalar sequence。 */
8860
- readonly codePoints: readonly number[];
8861
- /** 由 `codePoints` 生成的实际输入文本。 */
8862
- readonly text: string;
8863
- readonly kind: 'unicode';
8864
- }
8865
- /**
8866
- * 把显式 code sequence 转成 Unicode scalar 数组。
8867
- *
8868
- * 本函数只解析由空格分隔的 `0x...` scalar,不用正则或字符外观猜测 grapheme。空段、代理项、
8869
- * 越界值和非十六进制输入都会 fail-fast,避免坏目录在面板运行后才暴露。
8870
- */
8871
- declare function parseUnicodeEmojiCode(code: string): readonly number[];
8872
- /** 根据一个或多个显式 Unicode scalar 生成输入文本。 */
8873
- declare function unicodeEmojiTextFromCode(code: string): string;
8874
- /** iOS `emoji_string.json` 的 301 枚 Unicode 表情,只读且顺序稳定。 */
8875
- declare const UNICODE_EMOJI_CATALOG: readonly UnicodeEmojiEntry[];
8876
- /**
8877
- * 按 canonical code 或实际 Unicode 文本解析目录项。
8878
- *
8879
- * 合法但不在目录中的 code/text 返回 `undefined`;以 `0x` 开头但格式非法的 code 会 fail-fast。
8880
- * 文本仅做精确查表,并显式兼容末尾 U+FE0F,不扫描或推测 grapheme 边界。
8881
- */
8882
- declare function resolveUnicodeEmoji(codeOrText: string): UnicodeEmojiEntry | undefined;
8883
-
8884
- /**
8885
- * IM 文本表情目录和识别工具。
8886
- *
8887
- * 输入框与消息正文使用 `[Anger]`、`[愤怒]`、`[666]` 这类 token 表示自定义表情。本文件读取同目录
8888
- * `emoji-catalog.json`;该 JSON 是标准纯数据文件,格式不允许注释,每项字段含义统一记录在
8889
- * `EmojiEntry`。当前目录来自 Android 同一套 110 枚图片,以保证跨端 token 和资源一致。
8890
- *
8891
- * 发送时保留原 token 文本,其他端或图片缺失时仍可显示;渲染时 matcher 只把目录中存在的 token
8892
- * 转成图片段。未知 `[xxx]`、`@` 使用的方括号内容和不完整 token 保持普通文本。本文件不创建组件,
8893
- * 表情面板与消息渲染器通过 `emojiAssetUrl` / `emojiUrlByCode` 取得图片地址。
8894
- */
8895
-
8896
- /**
8897
- * `emoji-catalog.json` 中的一枚表情。
8898
- *
8899
- * `code` 是跨端稳定标识;`tokens` 是正文中可识别的英文名和中文别名,均包含方括号且大小写敏感;
8900
- * `file` 是静态图片文件名。
8901
- */
8902
- type EmojiEntry = ImEmojiCatalogEntry;
8903
- /** 可发送的完整表情目录,当前共 110 枚。 */
8904
- declare const EMOJI_CATALOG: readonly ImEmojiCatalogEntry[];
8905
- /**
8906
- * PC Web 发送面板使用的当前版表情目录。
8907
- *
8908
- * H5 或 CDN 路径不同时,在 `emojiAssetUrl` / `emojiUrlByCode` 传入自己的 base,无需修改目录数据。
8909
- * PC 消息回显会在当前版资源加载失败时显式尝试 `/images/emoji/v2`,因此旧目录不能复用这个默认值。
8910
- */
8911
- declare const DEFAULT_EMOJI_ASSET_BASE = "/images/emoji/v1";
8912
- /**
8913
- * 按完整且大小写敏感的 token 查找表情,例如 `[愤怒]`。
8914
- *
8915
- * 未命中返回 `undefined`,消息渲染器继续把原 token 当普通文本显示。
8916
- */
8917
- declare function resolveEmojiToken(token: string): EmojiEntry | undefined;
8918
- /** 生成表情图片 URL;未传 base 时使用 PC Web 默认目录。 */
8919
- declare function emojiAssetUrl(entry: EmojiEntry, base?: string): string;
8920
- /**
8921
- * 扫描正文中 1 到 20 个字符的 `[xxx]` 候选。
8922
- *
8923
- * 正则命中只表示“可能是表情”,必须再经 `resolveEmojiToken` 查目录;未命中的候选仍是普通文本。
8924
- */
8925
- declare const EMOJI_TOKEN_RE: RegExp;
8926
- /** 按稳定 code 取得图片 URL;未知 code 返回 `undefined`。 */
8927
- declare function emojiUrlByCode(code: string, base?: string): string | undefined;
8928
- /** 快速判断正文是否可能包含 `[表情名]` 候选。 */
8929
- declare function hasEmojiCandidate(text: string): boolean;
8930
- /** 当前目录中存在图片资源的表情片段。 */
8931
- interface EmojiAssetSegment {
8932
- kind: 'emoji';
8933
- text: string;
8934
- code: string;
8935
- }
8936
- /** 历史目录中存在、但当前版本没有图片映射的 token;宿主用默认表情占位呈现。 */
8937
- interface LegacyEmojiPlaceholderSegment {
8938
- kind: 'legacy-emoji-placeholder';
8939
- text: string;
8940
- }
8941
- /**
8942
- * 消息渲染器使用的表情片段。
8943
- *
8944
- * 当前表情保留稳定 `code` 以解析图片;历史表情只保留原 token 和占位语义。图片加载、候选切换与
8945
- * 最终占位图标仍由宿主管理。
8946
- */
8947
- type EmojiSegment = EmojiAssetSegment | LegacyEmojiPlaceholderSegment;
8948
- /** 仅由已知 `[表情]` token 组成的文本消息展示信息。 */
8949
- interface StandaloneEmojiMessage {
8950
- /** 按正文顺序排列的 current/legacy 表情段。 */
8951
- segments: readonly EmojiSegment[];
8952
- /** 表情数量;宿主据此选择 1/2/3/4+ 的展示尺寸。 */
8953
- count: number;
8954
- }
8955
- /**
8956
- * 创建消息文本表情分段器。
8957
- *
8958
- * 当前目录优先于历史目录:当前 token 产出带 `code` 的图片片段,old-only token 产出无资源 URL 的
8959
- * 占位片段。普通 `[123]`、`@` 的用户 ID、不完整 token 和两个目录都未知的内容继续显示为普通文本。
8960
- */
8961
- declare function createEmojiMatcher(): SegmentMatcher<EmojiSegment>;
8962
- /**
8963
- * 判断一条文本消息是否完全由已知 `[表情]` token 组成。
8964
- *
8965
- * token 之间出现空格、换行、普通文本或未知 `[xxx]` 时返回 `null`,让宿主继续使用普通文本气泡。
8966
- * 携带 mention metadata 的消息也返回 `null`,因为协议 mention 的解释优先于同形 token(例如 `[666]`)。
8967
- * 本函数只提供无 UI 的分段和数量,不决定气泡颜色、尺寸或 DOM。
8968
- */
8969
- declare function resolveStandaloneEmojiMessage(message: Pick<ImMessageView, 'body' | 'contentType' | 'encryption' | 'mention'>): StandaloneEmojiMessage | null;
8970
-
8971
9089
  /**
8972
9090
  * 把一段文本按搜索命中位置切成普通片段和高亮片段。
8973
9091
  *
@@ -9181,6 +9299,32 @@ declare function formatFileSize(bytes: number): string;
9181
9299
  */
9182
9300
  declare function getFileExtension(fileName: string): string;
9183
9301
 
9302
+ /** 列表和预览共用的传输展示;不持有任务、网络请求或页面资源。 */
9303
+ interface MediaTransferPresentation {
9304
+ /** 取消上传作用于整条消息,取消下载只作用于当前项。 */
9305
+ direction: 'upload' | 'download';
9306
+ /** completed 只保留视频时长,其余状态由宿主渲染同一胶囊。 */
9307
+ state: 'waiting' | 'running' | 'paused' | 'failed' | 'completed';
9308
+ /** 真实字节可计算时才提供百分比,缺少大小时不能用等权平均替代。 */
9309
+ percent?: number;
9310
+ /** 当前正在核对完整缓存;宿主暂不把 waiting 显示为确定的下载入口。 */
9311
+ resolving?: boolean;
9312
+ }
9313
+ /** 从 SDK 快照投影某一媒体格,折叠格按固定范围内全部项的字节数加权。 */
9314
+ declare function resolveMediaTransferPresentation(input: {
9315
+ message: ImMessageView;
9316
+ uploadTask?: ImMediaTask;
9317
+ downloadTasks: readonly ImMediaTask[];
9318
+ itemIndex?: number;
9319
+ aggregateFrom?: number;
9320
+ /** 宿主确实持有的完整本地资源;单条媒体以 undefined 表示,缩略图不属于完整资源。 */
9321
+ availableItemIndices?: readonly (number | undefined)[];
9322
+ /** SDK 明确查到完整缓存已不存在;历史 completed 任务不能替代当前资源证据。 */
9323
+ unavailableItemIndices?: readonly (number | undefined)[];
9324
+ /** 当前窗口正在查询的媒体项,不表示未下载。 */
9325
+ pendingItemIndices?: readonly (number | undefined)[];
9326
+ }): MediaTransferPresentation;
9327
+
9184
9328
  /**
9185
9329
  * 消息正文中由 Chat Kit 额外识别的可渲染片段类型。
9186
9330
  *
@@ -9282,5 +9426,5 @@ declare function resampleWaveform(data: readonly number[], targetCount: number):
9282
9426
  */
9283
9427
  declare function placeholderWaveform(seed: string, count: number): number[];
9284
9428
 
9285
- 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_GAME_PREVIEW_FALLBACK_HEIGHT, MINI_PROGRAM_GAME_PREVIEW_FALLBACK_WIDTH, MINI_PROGRAM_LANG_NUMBERS, SPIKE_STEP, UNICODE_EMOJI_CATALOG, blockReasonForChannelSession, blockReasonForChannelState, blockReasonForGroupState, blockReasonForSession, calculateMediaBox, canCopyMessageImage, canEditMessage, canPinChannelMessage, canPinGroupMessage, canPinMessage, canPromoteMediaPresentationSource, canRecallMessage, canTransmit, canTransmitByType, canTransmitContent, cancelMediaUpload, captureRuntimeClientOperation, captureRuntimeOperation, channelMiniProgramRelKey, classifyGifFile, classifyMediaFile, countUnreadConversations, createChatRuntime, createConversationPrefetchController, createDelayedLoadingIndicator, createEmojiMatcher, createLinkMatcher, createMessageImageCopySource, 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, getMessageCopyImageUrl, getMessageCopyText, hasEmojiCandidate, hasLinkCandidate, highlightSegments, isGifFile, isMessageLocateScrollProtected, isMessageTailChangeFromOlderWindowTrim, isMessageViewportMeasurable, isMessageVisibleForNewMessageBadge, isMiniProgramShowTypeOpenable, 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, resolveMiniProgramGamePreviewLayout, 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 };
9286
- 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, MiniProgramGamePreviewInput, MiniProgramGamePreviewLayout, 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 };
9429
+ 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_GAME_PREVIEW_FALLBACK_HEIGHT, MINI_PROGRAM_GAME_PREVIEW_FALLBACK_WIDTH, MINI_PROGRAM_LANG_NUMBERS, SPIKE_STEP, UNICODE_EMOJI_CATALOG, blockReasonForChannelSession, blockReasonForChannelState, blockReasonForGroupState, blockReasonForSession, calculateMediaBox, canCopyMessageImage, canEditMessage, canPinChannelMessage, canPinGroupMessage, canPinMessage, canPromoteMediaPresentationSource, canRecallMessage, canTransmit, canTransmitByType, canTransmitContent, cancelMediaUpload, captureRuntimeClientOperation, captureRuntimeOperation, channelMiniProgramRelKey, classifyGifFile, classifyMediaFile, countUnreadConversations, createChatRuntime, createConversationPrefetchController, createDelayedLoadingIndicator, createEmojiMatcher, createLinkMatcher, createMessageImageCopySource, 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, getMessageCopyImageUrl, getMessageCopyText, hasEmojiCandidate, hasLinkCandidate, highlightSegments, isGifFile, isMessageLocateScrollProtected, isMessageTailChangeFromOlderWindowTrim, isMessageViewportMeasurable, isMessageVisibleForNewMessageBadge, isMiniProgramShowTypeOpenable, 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, resolveMediaTransferPresentation, resolveMemberDisplayName, resolveMessageBodyKind, resolveMessageNotificationDecision, resolveMessageSearchPreview, resolveMessageTimelineTimestamp, resolveMiniProgramFloatLinkUrl, resolveMiniProgramGamePreviewLayout, 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 };
9430
+ 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, MediaTransferPresentation, MemberTargetCapabilityAction, MemberTargetCapabilityInput, MessageCapabilityAction, MessageCapabilityInput, MessageLocateScrollProtectionInput, MessageNotificationDecision, MessageNotificationInput, MessageSearchPreviewOptions, MessageSearchPreviewSegment, MiniProgramGamePreviewInput, MiniProgramGamePreviewLayout, 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 };