k2-im 0.1.48 → 0.1.50

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/dist/browser.js CHANGED
@@ -1 +1 @@
1
- export{Ua as canCopyImageToClipboard,Va as copyImageToClipboard,B as createLazyBrowserApiProtocolClient}from'./chunk-ELGE657I.js';import'./chunk-FMEZINTJ.js';import'./chunk-WOT6VMZA.js';
1
+ export{Ua as canCopyImageToClipboard,Va as copyImageToClipboard,B as createLazyBrowserApiProtocolClient}from'./chunk-ZFYM6YHK.js';import'./chunk-JHGB6KYI.js';import'./chunk-WOT6VMZA.js';
@@ -114,8 +114,11 @@ type LastMessageSummary = {
114
114
  kind: 'transfer';
115
115
  } | {
116
116
  kind: 'gift';
117
- } | {
117
+ }
118
+ /** 直播间分享。`title` 与卡片主标题一致:先主播昵称,没有再用房间标题。 */
119
+ | {
118
120
  kind: 'liveRoom';
121
+ title?: string;
119
122
  } | {
120
123
  kind: 'call';
121
124
  callKind: ImCallKind;
@@ -614,20 +617,21 @@ interface ImMediaAlbumBody {
614
617
  /** 媒体项,顺序即用户选择顺序(决定宫格 index 与首项朝向)。 */
615
618
  items: readonly ImMediaAlbumItem[];
616
619
  }
617
- /** 直播间分享的直播类型。wire `liveType`:1 视频、2 语音、3 双手机、4 单手机录屏、5 语聊房。 */
620
+ /** 直播间分享的直播类型。wire `liveType`:1 视频、2 语音、3 双手机、4 单手机录屏、5 语聊房。空字符串对应 wire 0,表示调用方没有类型,不猜成某一种直播。 */
618
621
  type ImLiveRoomType = 'video' | 'voice' | 'dual-phone' | 'screen-record' | 'voice-chat';
619
622
  /** 直播间分享的房间状态。wire `liveRoomStatus`:1 预告、2 直播中、3 已结束。 */
620
623
  type ImLiveRoomStatus = 'preview' | 'live' | 'ended';
621
624
  /**
622
- * 直播间分享卡片正文(contentType==='liveRoom',协议 BMessage.contentType=30,fields 98-112)。
625
+ * 直播间分享卡片正文(contentType==='liveRoom',协议 BMessage.contentType=30,fields 98-113)。
623
626
  *
624
627
  * @remarks 调用方先拿到直播间快照再写入本结构。Core 不请求直播接口,也不把缺省枚举猜成某一种直播。
625
628
  * `uid` 是声网 SDK 初始化用的 UID,不是 IM 用户 id。
626
629
  */
627
630
  interface ImLiveRoomBody {
628
- /** 直播间 ID(BMessage.liveRoomId)。 */
631
+ /** 直播间 ID(BMessage.liveRoomId)。没有房间号时为空字符串。 */
629
632
  liveRoomId: string;
630
- liveType: ImLiveRoomType;
633
+ /** 没有直播类型时为空字符串。 */
634
+ liveType: ImLiveRoomType | '';
631
635
  liveRoomStatus: ImLiveRoomStatus;
632
636
  /** 当前账号是否已关注主播。协议 bool 无法区分未设置,false 也是有效状态。 */
633
637
  isFocus: boolean;
@@ -647,6 +651,8 @@ interface ImLiveRoomBody {
647
651
  livePreviewId?: string;
648
652
  /** 直播间人数字符串,保持协议原文,不在 Core 换算。 */
649
653
  liveRoomViewers?: string;
654
+ /** 点赞数十进制字符串,保持协议原文,不在 Core 换算。 */
655
+ liveRoomLikes?: string;
650
656
  }
651
657
  interface ImMessageBody {
652
658
  /** P0 文本内容(明文,解密后的结果)。 */
@@ -1949,10 +1955,10 @@ interface ImProfilePort {
1949
1955
  * 会话收藏可展示的内容类型;与 iOS `isSupportCollectionMsgType` 对齐。
1950
1956
  *
1951
1957
  * @remarks 这些值与收藏接口的 `content_type` 数值一一对应,而那个数值就是消息自己的 contentType
1952
- * (1=文本 2=图片 3=视频 4=语音 5=位置 11=文件 28=媒体合集 29=文件合集),不是另一套收藏专用枚举。
1958
+ * (1=文本 2=图片 3=视频 4=语音 5=位置 11=文件 28=媒体合集 29=文件合集 30=直播间分享),不是另一套收藏专用枚举。
1953
1959
  * Android `MessageCollectExecute` 直接写 `message.getContentType()`,iOS 写 `msg.msgType`,两端一致。
1954
1960
  */
1955
- type ImSessionFavoriteKind = 'text' | 'image' | 'video' | 'voice' | 'location' | 'file' | 'mediaAlbum' | 'filesAlbum';
1961
+ type ImSessionFavoriteKind = 'text' | 'image' | 'video' | 'voice' | 'location' | 'file' | 'mediaAlbum' | 'filesAlbum' | 'liveRoom';
1956
1962
  /** 服务端一条会话收藏快照;列表以 HTTP 为准,不回写原消息。 */
1957
1963
  interface ImSessionFavoriteItem$1 {
1958
1964
  readonly collectId: string;
@@ -5175,14 +5181,16 @@ interface ConversationHandle<TType extends ProductHandleConversationType = Produ
5175
5181
  /**
5176
5182
  * 按稳定消息 id 打开目标附近的连续历史窗口。
5177
5183
  *
5178
- * @remarks GROUP 完整置顶预览可按消息时间定位;CHANNEL 置顶未缓存时先按 ID 取回正式历史记录,
5179
- * 以服务端游标准备前后相邻页后一次替换窗口;准备失败保留原窗口。只含控制行的页每侧最多继续四页,
5180
- * 预算用完仍保留分页能力。短期搜索结果只作为只读锚点;partial 置顶和过期搜索结果明确拒绝定位。
5181
- * @throws 没有可用锚点、远端确认缺失或目标不属于当前复合会话时,抛出稳定 `IM_SDK_MESSAGE_NOT_FOUND`
5182
- * (`category: 'state'`、`retryable: false`、`details.messageId`)。这是常见产品结果而非链路异常,
5183
- * 调用方应据此与真正的存储/协议失败区分反馈,不要解析错误文案。
5184
+ * @remarks 冷启动置顶和搜索结果只提供目标 id;目标不在当前窗口或本地原文时,须经精确会话
5185
+ * `by_id` 确认真实原文及排序位置。预览或搜索位置不能充当历史游标。
5186
+ * GROUP/CHANNEL 使用远端相邻页准备两侧上下文后一次替换窗口;失败保留原窗口。
5187
+ * `signal` 取消本次定位,阻止提交准备中的窗口;不会撤销共享按 ID 查询已取得的合法缓存。
5188
+ * @throws 仅 `by_id` 明确确认缺失时抛 `IM_SDK_MESSAGE_NOT_FOUND`;没有可信原文时抛
5189
+ * `IM_SDK_MESSAGE_ANCHOR_UNAVAILABLE`。存储、权限与协议异常保留原错误身份。
5184
5190
  */
5185
- loadAround: (messageId: string) => Promise<void>;
5191
+ loadAround: (messageId: string, options?: {
5192
+ signal?: AbortSignal;
5193
+ }) => Promise<void>;
5186
5194
  /**
5187
5195
  * 清空当前账号下此精确会话的本机历史。
5188
5196
  *
@@ -9221,6 +9229,7 @@ interface ImThreadStoreActions {
9221
9229
  /** 默认重新定位;skipIfLoaded 仅在目标已显示且没有在途窗口操作时复用当前窗口。 */
9222
9230
  loadAround: (messageId: string, options?: {
9223
9231
  skipIfLoaded?: boolean;
9232
+ signal?: AbortSignal;
9224
9233
  }) => Promise<boolean>;
9225
9234
  resolveMessage: (messageId: string) => Promise<ImMessageView | null>;
9226
9235
  retainHandle: (handle?: ProductConversationHandle) => () => void;
@@ -9271,7 +9280,7 @@ type ImSearchOperationResult = Readonly<{
9271
9280
  } | {
9272
9281
  ok: false;
9273
9282
  operation: SearchOperation;
9274
- reason: 'not-ready' | 'no-condition' | 'busy' | 'exhausted' | 'stale' | 'failed';
9283
+ reason: 'not-ready' | 'no-condition' | 'busy' | 'exhausted' | 'stale' | 'failed' | 'not-found' | 'anchor-unavailable' | 'cancelled';
9275
9284
  error?: ImSdkErrorShape;
9276
9285
  }>;
9277
9286
  declare function defineImSearchStore(pinia: Pinia): pinia.StoreDefinition<"k2-im-search", Pick<{