k2-im 0.1.21 → 0.1.22
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 +1 -1
- package/dist/chat-kit-pinia.d.ts +177 -86
- package/dist/chat-kit-pinia.js +1 -1
- package/dist/chat-kit-vue.js +1 -1
- package/dist/chat-kit.d.ts +6 -0
- package/dist/chat-kit.js +1 -1
- package/dist/{chunk-P4HOR4XO.js → chunk-75HBZ5NK.js} +1 -1
- package/dist/chunk-GW6QR4SJ.js +2 -0
- package/dist/{chunk-YAM4YHKF.js → chunk-GZEX4V3P.js} +1 -1
- package/dist/{chunk-2GZMQCIP.js → chunk-NA7DHED6.js} +1 -1
- package/dist/{chunk-5I7S6LWE.js → chunk-OQ5FNJVI.js} +1 -1
- package/dist/{chunk-4X7RCGEV.js → chunk-TP32EJAN.js} +1 -1
- package/dist/chunk-VKNZ76EP.js +2 -0
- package/dist/i18n.js +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1 -1
- package/dist/sdk.d.ts +6 -0
- package/dist/sdk.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-A2BLOVZ5.js +0 -2
- package/dist/chunk-DN4H5C7G.js +0 -2
package/dist/browser.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as createLazyBrowserApiProtocolClient}from'./chunk-
|
|
1
|
+
export{A as createLazyBrowserApiProtocolClient}from'./chunk-GZEX4V3P.js';import'./chunk-VKNZ76EP.js';import'./chunk-WOT6VMZA.js';
|
package/dist/chat-kit-pinia.d.ts
CHANGED
|
@@ -4426,6 +4426,12 @@ interface ConversationOpenOptions {
|
|
|
4426
4426
|
* 后续 read 事件或新消息不会移动分隔线。
|
|
4427
4427
|
*/
|
|
4428
4428
|
initialPosition?: ConversationInitialPosition;
|
|
4429
|
+
/**
|
|
4430
|
+
* 默认 blocking 等待整个初始窗口;local-first 在本地窗口可读后返回,远端补齐和未读定位后台继续。
|
|
4431
|
+
* local-first 调用方必须订阅 loading/error:加载失败保留本地窗口并写入 error,允许通过 history 重试;
|
|
4432
|
+
* loading 结束前不要提交可见已读或最终首屏定位。本地存储打开失败仍会拒绝 openConversation。
|
|
4433
|
+
*/
|
|
4434
|
+
initialLoad?: 'blocking' | 'local-first';
|
|
4429
4435
|
}
|
|
4430
4436
|
/**
|
|
4431
4437
|
* 产品会话的连续窗口快照;协议 cursor、窗口 id 与 generation 始终保持在 SDK 内部。
|
|
@@ -6740,22 +6746,23 @@ declare function getImChatKitContext(pinia: Pinia): ImChatKitContext;
|
|
|
6740
6746
|
/** 释放指定 Pinia 下全部 IM Store 和 Runtime;未安装时不执行任何操作。 */
|
|
6741
6747
|
declare function disposeImChatKit(pinia: Pinia): void;
|
|
6742
6748
|
|
|
6743
|
-
type ProductConversationRef$
|
|
6749
|
+
type ProductConversationRef$6 = ConversationRef<ProductHandleConversationType>;
|
|
6744
6750
|
/** 宿主可据此决定反馈的安全错误;底层 cause/details 只允许进入统一诊断。 */
|
|
6745
6751
|
type ImConversationActivationError = Readonly<Omit<ImSdkErrorShape, 'cause' | 'details'>>;
|
|
6746
6752
|
/**
|
|
6747
6753
|
* 共享会话激活的稳定结果。
|
|
6748
6754
|
*
|
|
6749
|
-
*
|
|
6755
|
+
* 成功表示已绑定目标句柄,后台历史加载状态仍从 Thread Store 读取;宿主可提前展示路由外壳与骨架。
|
|
6756
|
+
* `stale` 表示该意图已被更新点击、切账号或 Context dispose 取代。
|
|
6750
6757
|
*/
|
|
6751
6758
|
type ImConversationActivationResult = Readonly<{
|
|
6752
6759
|
ok: true;
|
|
6753
6760
|
status: 'opened';
|
|
6754
|
-
conversation: ProductConversationRef$
|
|
6761
|
+
conversation: ProductConversationRef$6;
|
|
6755
6762
|
} | {
|
|
6756
6763
|
ok: false;
|
|
6757
6764
|
reason: 'draft-save-failed' | 'open-failed';
|
|
6758
|
-
conversation: ProductConversationRef$
|
|
6765
|
+
conversation: ProductConversationRef$6;
|
|
6759
6766
|
error: ImConversationActivationError;
|
|
6760
6767
|
} | {
|
|
6761
6768
|
ok: false;
|
|
@@ -6764,29 +6771,32 @@ type ImConversationActivationResult = Readonly<{
|
|
|
6764
6771
|
}>;
|
|
6765
6772
|
/** 按单个 Pinia 串联 Composer 与 Thread Store 的无 UI coordinator。 */
|
|
6766
6773
|
interface ImConversationActivationCoordinator {
|
|
6767
|
-
|
|
6774
|
+
/** signal 取消本次在途激活;保留已显示线程,不影响之后开始的激活。 */
|
|
6775
|
+
activate: (conversation: ConversationRef, options?: {
|
|
6776
|
+
signal?: AbortSignal;
|
|
6777
|
+
}) => Promise<ImConversationActivationResult>;
|
|
6768
6778
|
}
|
|
6769
6779
|
/**
|
|
6770
6780
|
* 取得当前 Vue setup 或显式 Pinia 的会话激活 coordinator。
|
|
6771
6781
|
*
|
|
6772
6782
|
* coordinator 没有响应式产品状态;每个 Pinia 只持有 operation epoch,用于在草稿 flush 和 Thread open
|
|
6773
|
-
* 之间判定新点击、账号 generation 变化与 dispose
|
|
6783
|
+
* 之间判定新点击、账号 generation 变化与 dispose。宿主可先展示目标页,但只有 exact handle 成功后才能展示线程内容。
|
|
6774
6784
|
*/
|
|
6775
6785
|
declare function useImConversationActivationCoordinator(pinia?: Pinia): ImConversationActivationCoordinator;
|
|
6776
6786
|
|
|
6777
|
-
type ProductConversationRef$
|
|
6787
|
+
type ProductConversationRef$5 = ConversationRef<ProductConversationListType>;
|
|
6778
6788
|
/** 删除失败时提供给宿主映射反馈的安全错误,不暴露底层 cause/details。 */
|
|
6779
6789
|
type ImConversationDeletionError = Readonly<Omit<ImSdkErrorShape, 'cause' | 'details'>>;
|
|
6780
6790
|
/** local-only 删除的稳定结果;成功只代表 SDK 已同步提交当前内存删除,不代表 durable 存储已完成。 */
|
|
6781
6791
|
type ImConversationDeletionResult = Readonly<{
|
|
6782
6792
|
ok: true;
|
|
6783
6793
|
status: 'deleted';
|
|
6784
|
-
conversation: ProductConversationRef$
|
|
6794
|
+
conversation: ProductConversationRef$5;
|
|
6785
6795
|
activeConversationCleared: boolean;
|
|
6786
6796
|
} | {
|
|
6787
6797
|
ok: false;
|
|
6788
6798
|
reason: 'delete-failed';
|
|
6789
|
-
conversation: ProductConversationRef$
|
|
6799
|
+
conversation: ProductConversationRef$5;
|
|
6790
6800
|
error: ImConversationDeletionError;
|
|
6791
6801
|
} | {
|
|
6792
6802
|
ok: false;
|
|
@@ -6805,7 +6815,7 @@ interface ImConversationDeletionCoordinator {
|
|
|
6805
6815
|
*/
|
|
6806
6816
|
declare function useImConversationDeletionCoordinator(pinia?: Pinia): ImConversationDeletionCoordinator;
|
|
6807
6817
|
|
|
6808
|
-
type ProductConversationRef$
|
|
6818
|
+
type ProductConversationRef$4 = ConversationRef<ProductConversationListType>;
|
|
6809
6819
|
type ImConversationListMutationOperation = 'set-pinned' | 'set-muted' | 'mark-read' | 'mark-unread' | 'delete-local';
|
|
6810
6820
|
/** 会话列表动作失败时返回给宿主的安全错误;底层 cause/details 不跨出共享 Store。 */
|
|
6811
6821
|
type ImConversationListActionError = Readonly<Omit<ImSdkErrorShape, 'cause' | 'details'>>;
|
|
@@ -6832,11 +6842,11 @@ interface ImConversationListStore {
|
|
|
6832
6842
|
start: () => void;
|
|
6833
6843
|
reset: () => void;
|
|
6834
6844
|
refresh: () => Promise<ImConversationListRefreshResult>;
|
|
6835
|
-
setPinned: (ref: ProductConversationRef$
|
|
6836
|
-
setMuted: (ref: ProductConversationRef$
|
|
6837
|
-
markRead: (ref: ProductConversationRef$
|
|
6838
|
-
markUnread: (ref: ProductConversationRef$
|
|
6839
|
-
deleteLocal: (ref: ProductConversationRef$
|
|
6845
|
+
setPinned: (ref: ProductConversationRef$4, pinned: boolean) => ImConversationListMutationResult;
|
|
6846
|
+
setMuted: (ref: ProductConversationRef$4, muted: boolean) => Promise<ImConversationListMutationResult>;
|
|
6847
|
+
markRead: (ref: ProductConversationRef$4) => Promise<ImConversationListMutationResult>;
|
|
6848
|
+
markUnread: (ref: ProductConversationRef$4) => ImConversationListMutationResult;
|
|
6849
|
+
deleteLocal: (ref: ProductConversationRef$4) => ImConversationListMutationResult;
|
|
6840
6850
|
dispose: () => void;
|
|
6841
6851
|
}
|
|
6842
6852
|
/**
|
|
@@ -6848,17 +6858,17 @@ interface ImConversationListStore {
|
|
|
6848
6858
|
type ImConversationListMutationResult = Readonly<{
|
|
6849
6859
|
ok: true;
|
|
6850
6860
|
operation: ImConversationListMutationOperation;
|
|
6851
|
-
conversation: ProductConversationRef$
|
|
6861
|
+
conversation: ProductConversationRef$4;
|
|
6852
6862
|
} | {
|
|
6853
6863
|
ok: false;
|
|
6854
6864
|
operation: ImConversationListMutationOperation;
|
|
6855
6865
|
reason: 'stale';
|
|
6856
|
-
conversation: ProductConversationRef$
|
|
6866
|
+
conversation: ProductConversationRef$4;
|
|
6857
6867
|
} | {
|
|
6858
6868
|
ok: false;
|
|
6859
6869
|
operation: ImConversationListMutationOperation;
|
|
6860
6870
|
reason: 'failed';
|
|
6861
|
-
conversation: ProductConversationRef$
|
|
6871
|
+
conversation: ProductConversationRef$4;
|
|
6862
6872
|
error: ImConversationListActionError;
|
|
6863
6873
|
}>;
|
|
6864
6874
|
declare function defineImConversationListStore(pinia: Pinia): pinia.StoreDefinition<"k2-im-conversation-list", Pick<{
|
|
@@ -6869,11 +6879,11 @@ declare function defineImConversationListStore(pinia: Pinia): pinia.StoreDefinit
|
|
|
6869
6879
|
start: () => void;
|
|
6870
6880
|
reset: () => void;
|
|
6871
6881
|
refresh: () => Promise<ImConversationListRefreshResult>;
|
|
6872
|
-
setPinned: (ref: ProductConversationRef$
|
|
6873
|
-
setMuted: (ref: ProductConversationRef$
|
|
6874
|
-
markRead: (ref: ProductConversationRef$
|
|
6875
|
-
markUnread: (ref: ProductConversationRef$
|
|
6876
|
-
deleteLocal: (ref: ProductConversationRef$
|
|
6882
|
+
setPinned: (ref: ProductConversationRef$4, pinned: boolean) => ImConversationListMutationResult;
|
|
6883
|
+
setMuted: (ref: ProductConversationRef$4, muted: boolean) => Promise<ImConversationListMutationResult>;
|
|
6884
|
+
markRead: (ref: ProductConversationRef$4) => Promise<ImConversationListMutationResult>;
|
|
6885
|
+
markUnread: (ref: ProductConversationRef$4) => ImConversationListMutationResult;
|
|
6886
|
+
deleteLocal: (ref: ProductConversationRef$4) => ImConversationListMutationResult;
|
|
6877
6887
|
dispose: () => void;
|
|
6878
6888
|
}, any>, Pick<{
|
|
6879
6889
|
items: any;
|
|
@@ -6883,11 +6893,11 @@ declare function defineImConversationListStore(pinia: Pinia): pinia.StoreDefinit
|
|
|
6883
6893
|
start: () => void;
|
|
6884
6894
|
reset: () => void;
|
|
6885
6895
|
refresh: () => Promise<ImConversationListRefreshResult>;
|
|
6886
|
-
setPinned: (ref: ProductConversationRef$
|
|
6887
|
-
setMuted: (ref: ProductConversationRef$
|
|
6888
|
-
markRead: (ref: ProductConversationRef$
|
|
6889
|
-
markUnread: (ref: ProductConversationRef$
|
|
6890
|
-
deleteLocal: (ref: ProductConversationRef$
|
|
6896
|
+
setPinned: (ref: ProductConversationRef$4, pinned: boolean) => ImConversationListMutationResult;
|
|
6897
|
+
setMuted: (ref: ProductConversationRef$4, muted: boolean) => Promise<ImConversationListMutationResult>;
|
|
6898
|
+
markRead: (ref: ProductConversationRef$4) => Promise<ImConversationListMutationResult>;
|
|
6899
|
+
markUnread: (ref: ProductConversationRef$4) => ImConversationListMutationResult;
|
|
6900
|
+
deleteLocal: (ref: ProductConversationRef$4) => ImConversationListMutationResult;
|
|
6891
6901
|
dispose: () => void;
|
|
6892
6902
|
}, any>, Pick<{
|
|
6893
6903
|
items: any;
|
|
@@ -6897,11 +6907,11 @@ declare function defineImConversationListStore(pinia: Pinia): pinia.StoreDefinit
|
|
|
6897
6907
|
start: () => void;
|
|
6898
6908
|
reset: () => void;
|
|
6899
6909
|
refresh: () => Promise<ImConversationListRefreshResult>;
|
|
6900
|
-
setPinned: (ref: ProductConversationRef$
|
|
6901
|
-
setMuted: (ref: ProductConversationRef$
|
|
6902
|
-
markRead: (ref: ProductConversationRef$
|
|
6903
|
-
markUnread: (ref: ProductConversationRef$
|
|
6904
|
-
deleteLocal: (ref: ProductConversationRef$
|
|
6910
|
+
setPinned: (ref: ProductConversationRef$4, pinned: boolean) => ImConversationListMutationResult;
|
|
6911
|
+
setMuted: (ref: ProductConversationRef$4, muted: boolean) => Promise<ImConversationListMutationResult>;
|
|
6912
|
+
markRead: (ref: ProductConversationRef$4) => Promise<ImConversationListMutationResult>;
|
|
6913
|
+
markUnread: (ref: ProductConversationRef$4) => ImConversationListMutationResult;
|
|
6914
|
+
deleteLocal: (ref: ProductConversationRef$4) => ImConversationListMutationResult;
|
|
6905
6915
|
dispose: () => void;
|
|
6906
6916
|
}, any>>;
|
|
6907
6917
|
type InternalImConversationListStore = ReturnType<ReturnType<typeof defineImConversationListStore>>;
|
|
@@ -7061,7 +7071,7 @@ type ImExpressionStore = Store<'k2-im-expression', ImExpressionStoreState, ImExp
|
|
|
7061
7071
|
*/
|
|
7062
7072
|
declare function useImExpressionStore(pinia?: Pinia): ImExpressionStore;
|
|
7063
7073
|
|
|
7064
|
-
type ProductConversationRef$
|
|
7074
|
+
type ProductConversationRef$3 = ConversationRef<ProductHandleConversationType>;
|
|
7065
7075
|
/** 返回最新页失败时给宿主的安全错误;底层 cause/details 只进入统一诊断。 */
|
|
7066
7076
|
type ImHistoryReturnError = Readonly<Omit<ImSdkErrorShape, 'cause' | 'details'>>;
|
|
7067
7077
|
/** 历史窗口发送后的稳定结算;宿主只在 `applied` 时执行自己的 DOM 滚动。 */
|
|
@@ -7069,10 +7079,10 @@ type ImHistoryReturnResult = Readonly<{
|
|
|
7069
7079
|
status: 'not-needed';
|
|
7070
7080
|
} | {
|
|
7071
7081
|
status: 'applied' | 'stale';
|
|
7072
|
-
conversation: ProductConversationRef$
|
|
7082
|
+
conversation: ProductConversationRef$3;
|
|
7073
7083
|
} | {
|
|
7074
7084
|
status: 'failed';
|
|
7075
|
-
conversation: ProductConversationRef$
|
|
7085
|
+
conversation: ProductConversationRef$3;
|
|
7076
7086
|
error: ImHistoryReturnError;
|
|
7077
7087
|
}>;
|
|
7078
7088
|
/** 保留原发送动作的返回值,并把独立的历史窗口结算交给宿主消费。 */
|
|
@@ -7092,33 +7102,6 @@ interface ImHistoryReturnAfterSendCoordinator {
|
|
|
7092
7102
|
*/
|
|
7093
7103
|
declare function useImHistoryReturnAfterSendCoordinator(pinia?: Pinia): ImHistoryReturnAfterSendCoordinator;
|
|
7094
7104
|
|
|
7095
|
-
/**
|
|
7096
|
-
* 为页面展示当前账号的媒体上传/下载进度,并提供取消、重试和重新选择原文件入口。
|
|
7097
|
-
*
|
|
7098
|
-
* 【状态从哪里来】
|
|
7099
|
-
* Store 订阅 SDK 的完整媒体任务列表,向页面提供任务、当前线程每条消息的上传百分比、是否还在排队等
|
|
7100
|
-
* 上传槽位、是否正在完成最后处理以及稳定错误。传输、任务状态、消息状态、取消和重试都由 SDK 维护;Store 不模拟进度,也不
|
|
7101
|
-
* 创建第二套上传队列。
|
|
7102
|
-
*
|
|
7103
|
-
* 【提供的能力】
|
|
7104
|
-
* - `start` / `reset`:开始监听当前 SDK Client,或切账号时退订并清空旧任务。
|
|
7105
|
-
* - `cancel` / `retry`:按 SDK 给出的任务 ID 取消或重试。
|
|
7106
|
-
* - `cancelUpload`:根据当前会话类型、会话 ID 和消息 ID 找到唯一上传任务后取消。
|
|
7107
|
-
* - `cancelDownload`:按消息身份取消在途下载;合集要带项下标,因为一条合集的每一项是独立任务。
|
|
7108
|
-
* 与 `cancelUpload` 不同,它定位任务时不看当前会话——切会话正是关闭预览的路径之一。
|
|
7109
|
-
* 取消是任务级的,同一下载的所有等待方都会一起收到取消,只有唯一消费者才该调它。
|
|
7110
|
-
* - `requestReplacement` / `takeReplacementRequest`:视频或文件刷新后失去本地源时,生成一次重新选择请求;
|
|
7111
|
-
* 宿主取走意图后自行打开平台文件选择器,File 本身不会写入 Store。
|
|
7112
|
-
*
|
|
7113
|
-
* 【安全、并发与资源边界】
|
|
7114
|
-
* 页面任务会删除 SDK 错误中的底层原因和详情,只保留错误码、分类和是否可重试。File、Blob、本地地址、
|
|
7115
|
-
* 播放器、中止控制器、传输能力、Client 和订阅函数都不能进入 `$state`。Store 同时核对当前 Client、
|
|
7116
|
-
* 账号版本号和绑定序号;旧账号任务或旧操作晚返回时只得到 `stale`,不会更新新页面。
|
|
7117
|
-
*
|
|
7118
|
-
* 【明确不负责】
|
|
7119
|
-
* 文件选择、预览、录音权限、播放器、Blob URL 生命周期、toast 和页面布局属于浏览器或宿主平台能力。
|
|
7120
|
-
*/
|
|
7121
|
-
|
|
7122
7105
|
/** 页面可保存和判断的媒体错误;底层响应、异常对象和详情只进入统一诊断,不进入 Pinia。 */
|
|
7123
7106
|
type ImMediaStoreError = Readonly<Omit<ImSdkErrorShape, 'cause' | 'details'>>;
|
|
7124
7107
|
/** 页面可展示的只读媒体任务;不含文件字节、本地地址、密钥、中止控制器或传输对象。 */
|
|
@@ -7150,8 +7133,67 @@ type ImMediaOperationResult = Readonly<{
|
|
|
7150
7133
|
* 宿主既有的 `downloadProgress[message.id]` 读法不受影响。
|
|
7151
7134
|
*/
|
|
7152
7135
|
declare function imMediaDownloadKey(messageId: string, itemIndex?: number): string;
|
|
7136
|
+
declare function defineImMediaStore(pinia: Pinia): pinia.StoreDefinition<"k2-im-media", Pick<{
|
|
7137
|
+
tasks: any;
|
|
7138
|
+
error: any;
|
|
7139
|
+
uploadProgress: any;
|
|
7140
|
+
downloadTasks: any;
|
|
7141
|
+
downloadProgress: any;
|
|
7142
|
+
uploadWaiting: any;
|
|
7143
|
+
uploadFinalizing: any;
|
|
7144
|
+
replacementRequest: any;
|
|
7145
|
+
start: () => void;
|
|
7146
|
+
reset: () => void;
|
|
7147
|
+
cancel: (taskId: string) => Promise<ImMediaOperationResult>;
|
|
7148
|
+
retry: (taskId: string) => Promise<ImMediaOperationResult>;
|
|
7149
|
+
cancelUpload: (messageId: string) => Promise<ImMediaOperationResult>;
|
|
7150
|
+
cancelDownload: (messageId: string, itemIndex?: number) => Promise<ImMediaOperationResult>;
|
|
7151
|
+
requestReplacement: (message: ImMessageView) => boolean;
|
|
7152
|
+
takeReplacementRequest: () => ImMediaReplacementRequest | null;
|
|
7153
|
+
clearReplacementRequest: () => void;
|
|
7154
|
+
dispose: () => void;
|
|
7155
|
+
}, any>, Pick<{
|
|
7156
|
+
tasks: any;
|
|
7157
|
+
error: any;
|
|
7158
|
+
uploadProgress: any;
|
|
7159
|
+
downloadTasks: any;
|
|
7160
|
+
downloadProgress: any;
|
|
7161
|
+
uploadWaiting: any;
|
|
7162
|
+
uploadFinalizing: any;
|
|
7163
|
+
replacementRequest: any;
|
|
7164
|
+
start: () => void;
|
|
7165
|
+
reset: () => void;
|
|
7166
|
+
cancel: (taskId: string) => Promise<ImMediaOperationResult>;
|
|
7167
|
+
retry: (taskId: string) => Promise<ImMediaOperationResult>;
|
|
7168
|
+
cancelUpload: (messageId: string) => Promise<ImMediaOperationResult>;
|
|
7169
|
+
cancelDownload: (messageId: string, itemIndex?: number) => Promise<ImMediaOperationResult>;
|
|
7170
|
+
requestReplacement: (message: ImMessageView) => boolean;
|
|
7171
|
+
takeReplacementRequest: () => ImMediaReplacementRequest | null;
|
|
7172
|
+
clearReplacementRequest: () => void;
|
|
7173
|
+
dispose: () => void;
|
|
7174
|
+
}, any>, Pick<{
|
|
7175
|
+
tasks: any;
|
|
7176
|
+
error: any;
|
|
7177
|
+
uploadProgress: any;
|
|
7178
|
+
downloadTasks: any;
|
|
7179
|
+
downloadProgress: any;
|
|
7180
|
+
uploadWaiting: any;
|
|
7181
|
+
uploadFinalizing: any;
|
|
7182
|
+
replacementRequest: any;
|
|
7183
|
+
start: () => void;
|
|
7184
|
+
reset: () => void;
|
|
7185
|
+
cancel: (taskId: string) => Promise<ImMediaOperationResult>;
|
|
7186
|
+
retry: (taskId: string) => Promise<ImMediaOperationResult>;
|
|
7187
|
+
cancelUpload: (messageId: string) => Promise<ImMediaOperationResult>;
|
|
7188
|
+
cancelDownload: (messageId: string, itemIndex?: number) => Promise<ImMediaOperationResult>;
|
|
7189
|
+
requestReplacement: (message: ImMessageView) => boolean;
|
|
7190
|
+
takeReplacementRequest: () => ImMediaReplacementRequest | null;
|
|
7191
|
+
clearReplacementRequest: () => void;
|
|
7192
|
+
dispose: () => void;
|
|
7193
|
+
}, any>>;
|
|
7194
|
+
type ImMediaStore = ReturnType<ReturnType<typeof defineImMediaStore>>;
|
|
7153
7195
|
/** 取得当前 Vue setup 或显式 Pinia 的媒体任务 Store;不会隐式创建 Runtime。 */
|
|
7154
|
-
declare function useImMediaStore(pinia?: Pinia):
|
|
7196
|
+
declare function useImMediaStore(pinia?: Pinia): ImMediaStore;
|
|
7155
7197
|
|
|
7156
7198
|
/**
|
|
7157
7199
|
* 执行“把当前会话中的一条或多条消息转发到若干目标会话”。
|
|
@@ -8351,30 +8393,20 @@ type ImReactionStore = Store<'k2-im-reaction', ImReactionStoreState, Record<stri
|
|
|
8351
8393
|
declare function useImReactionStore(pinia?: Pinia): ImReactionStore;
|
|
8352
8394
|
|
|
8353
8395
|
/**
|
|
8354
|
-
*
|
|
8355
|
-
*
|
|
8356
|
-
* 【对外状态】
|
|
8357
|
-
* Store 暴露关键词、全部/文件/图片/视频/语音分类、结果列表、搜索状态、是否还有下一页、正在定位的
|
|
8358
|
-
* 消息 ID、短暂高亮 ID 与稳定错误。SDK 仍维护搜索索引、消息历史窗口和真实分页位置,Pinia 只保存
|
|
8359
|
-
* 当前搜索面板需要展示的状态。
|
|
8360
|
-
*
|
|
8361
|
-
* 【提供的能力】
|
|
8362
|
-
* - `search`:更新关键词,用户停止输入 250ms 后执行,避免每个按键都发请求。
|
|
8363
|
-
* - `setCategory`:切换消息、文件、图片、视频或语音产品入口。
|
|
8364
|
-
* - `loadMore`:使用闭包中不可解析的分页凭证继续同一次查询。
|
|
8365
|
-
* - `locate`:让当前线程加载目标消息附近的历史并发布定位 ID;宿主完成实际滚动后,高亮 ID 再保留 2 秒。
|
|
8366
|
-
* - `clearLocation` / `reset`:结束定位或作废当前查询生命周期;`reset({ preserveLocation: true })` 可在关闭搜索面板时保留刚写入的高亮。
|
|
8396
|
+
* 读取当前会话的消息搜索结果和分类媒体列表。
|
|
8367
8397
|
*
|
|
8368
|
-
*
|
|
8369
|
-
*
|
|
8370
|
-
*
|
|
8371
|
-
* 不能关闭新任务的 loading,也不能覆盖新结果、错误或高亮。
|
|
8398
|
+
* 全部消息按关键词搜索;文件既可按名称搜索也可浏览;图片、视频和语音按分类浏览。单聊、普通群和
|
|
8399
|
+
* 社群会调用各自的 SDK 搜索能力。分页位置由 SDK 封装成 `ImPageToken`,调用方只能原样传回续页,
|
|
8400
|
+
* 不能解析或修改其中的账号、会话和查询条件。
|
|
8372
8401
|
*
|
|
8373
|
-
*
|
|
8374
|
-
*
|
|
8375
|
-
* DOM 居中/高亮;分页凭证、协议续页位置与底层响应不会暴露给宿主。
|
|
8402
|
+
* 防抖、当前查询状态、切账号/切会话后的旧结果丢弃由 Search Store 负责。本 Service 只取一批结果,
|
|
8403
|
+
* 并在底层出现稀疏空页时有限地向后查找,避免页面误显示“没有结果”。
|
|
8376
8404
|
*/
|
|
8377
8405
|
|
|
8406
|
+
/** 搜索面板可选择的业务分类:全部/文本走关键词;文件可空词浏览;图/音/视频按类型浏览。 */
|
|
8407
|
+
type ConversationSearchCategory = 'all' | 'text' | 'image' | 'video' | 'file' | 'voice';
|
|
8408
|
+
|
|
8409
|
+
type ProductConversationRef$2 = ConversationRef<ProductHandleConversationType>;
|
|
8378
8410
|
type SearchOperation = 'search' | 'load-more' | 'locate';
|
|
8379
8411
|
/** 搜索、续页或定位结果;宿主只按操作和原因决定反馈,不解析 SDK 底层异常。 */
|
|
8380
8412
|
type ImSearchOperationResult = Readonly<{
|
|
@@ -8386,8 +8418,67 @@ type ImSearchOperationResult = Readonly<{
|
|
|
8386
8418
|
reason: 'not-ready' | 'no-condition' | 'busy' | 'exhausted' | 'stale' | 'failed';
|
|
8387
8419
|
error?: ImSdkErrorShape;
|
|
8388
8420
|
}>;
|
|
8421
|
+
declare function defineImSearchStore(pinia: Pinia): pinia.StoreDefinition<"k2-im-search", Pick<{
|
|
8422
|
+
keyword: any;
|
|
8423
|
+
results: any;
|
|
8424
|
+
searching: any;
|
|
8425
|
+
hasMore: any;
|
|
8426
|
+
category: any;
|
|
8427
|
+
locatingMessageId: any;
|
|
8428
|
+
highlightMessageId: any;
|
|
8429
|
+
error: any;
|
|
8430
|
+
search: (nextKeyword: string) => Promise<ImSearchOperationResult>;
|
|
8431
|
+
setCategory: (nextCategory: ConversationSearchCategory) => Promise<ImSearchOperationResult>;
|
|
8432
|
+
loadMore: () => Promise<ImSearchOperationResult>;
|
|
8433
|
+
locate: (ref: ProductConversationRef$2, messageId: string) => Promise<ImSearchOperationResult>;
|
|
8434
|
+
completeLocation: (messageId: string) => boolean;
|
|
8435
|
+
clearLocation: () => void;
|
|
8436
|
+
reset: (options?: {
|
|
8437
|
+
preserveLocation?: boolean;
|
|
8438
|
+
}) => void;
|
|
8439
|
+
dispose: () => void;
|
|
8440
|
+
}, any>, Pick<{
|
|
8441
|
+
keyword: any;
|
|
8442
|
+
results: any;
|
|
8443
|
+
searching: any;
|
|
8444
|
+
hasMore: any;
|
|
8445
|
+
category: any;
|
|
8446
|
+
locatingMessageId: any;
|
|
8447
|
+
highlightMessageId: any;
|
|
8448
|
+
error: any;
|
|
8449
|
+
search: (nextKeyword: string) => Promise<ImSearchOperationResult>;
|
|
8450
|
+
setCategory: (nextCategory: ConversationSearchCategory) => Promise<ImSearchOperationResult>;
|
|
8451
|
+
loadMore: () => Promise<ImSearchOperationResult>;
|
|
8452
|
+
locate: (ref: ProductConversationRef$2, messageId: string) => Promise<ImSearchOperationResult>;
|
|
8453
|
+
completeLocation: (messageId: string) => boolean;
|
|
8454
|
+
clearLocation: () => void;
|
|
8455
|
+
reset: (options?: {
|
|
8456
|
+
preserveLocation?: boolean;
|
|
8457
|
+
}) => void;
|
|
8458
|
+
dispose: () => void;
|
|
8459
|
+
}, any>, Pick<{
|
|
8460
|
+
keyword: any;
|
|
8461
|
+
results: any;
|
|
8462
|
+
searching: any;
|
|
8463
|
+
hasMore: any;
|
|
8464
|
+
category: any;
|
|
8465
|
+
locatingMessageId: any;
|
|
8466
|
+
highlightMessageId: any;
|
|
8467
|
+
error: any;
|
|
8468
|
+
search: (nextKeyword: string) => Promise<ImSearchOperationResult>;
|
|
8469
|
+
setCategory: (nextCategory: ConversationSearchCategory) => Promise<ImSearchOperationResult>;
|
|
8470
|
+
loadMore: () => Promise<ImSearchOperationResult>;
|
|
8471
|
+
locate: (ref: ProductConversationRef$2, messageId: string) => Promise<ImSearchOperationResult>;
|
|
8472
|
+
completeLocation: (messageId: string) => boolean;
|
|
8473
|
+
clearLocation: () => void;
|
|
8474
|
+
reset: (options?: {
|
|
8475
|
+
preserveLocation?: boolean;
|
|
8476
|
+
}) => void;
|
|
8477
|
+
dispose: () => void;
|
|
8478
|
+
}, any>>;
|
|
8479
|
+
type ImSearchStore = ReturnType<ReturnType<typeof defineImSearchStore>>;
|
|
8389
8480
|
/** 取得当前 Vue setup 或显式 Pinia 的搜索 Store;不同宿主实例不会共享查询或定位状态。 */
|
|
8390
|
-
declare function useImSearchStore(pinia?: Pinia):
|
|
8481
|
+
declare function useImSearchStore(pinia?: Pinia): ImSearchStore;
|
|
8391
8482
|
|
|
8392
8483
|
/**
|
|
8393
8484
|
* 为 PC/H5 提供同一套会话收藏列表和已收藏标记。
|
|
@@ -8652,4 +8743,4 @@ type MessageNotificationDecision = {
|
|
|
8652
8743
|
declare function resolveMessageNotificationDecision(input: MessageNotificationInput): MessageNotificationDecision;
|
|
8653
8744
|
|
|
8654
8745
|
export { applicationKey, createAndInstallImChatKit, createImChatKitContext, disposeImChatKit, ensureImChatKitSelfProfile, getImChatKitContext, imMediaDownloadKey, installImChatKit, resolveMessageNotificationDecision, useImApplicationsStore, useImCapabilitiesStore, useImComposerStore, useImConversationActivationCoordinator, useImConversationDeletionCoordinator, useImConversationListStore, useImExpressionStore, useImHistoryReturnAfterSendCoordinator, useImMediaStore, useImMessageOperationsStore, useImProfileDirectoryStore, useImQuotedMessageStore, useImReactionStore, useImSearchStore, useImSessionFavoritesStore, useImSessionStore, useImThreadPagingStore, useImThreadReturnToLatestCoordinator, useImThreadStore };
|
|
8655
|
-
export type { ApplyImSessionInput, ChatRuntimeFactories, ChatRuntimeHostDeps, ImApplicationDomainCounts, ImApplicationReviewOperation, ImApplicationReviewResult, ImApplicationsReloadResult, ImApplicationsStoreError, ImCapabilitiesStore, ImChannelManagementMemberTarget, ImChannelMemberManagementOperation, ImChannelMemberManagementResult, ImChannelMemberManagementResultFor, ImChannelProfileActionResult, ImChannelProfileActionResultFor, ImChannelProfileOperation, ImChatKitContext, ImChatKitInstallation, ImComposerStore, ImComposerStoreActions, ImComposerStoreState, ImComposerSubmitResult, ImConversationActivationCoordinator, ImConversationActivationError, ImConversationActivationResult, ImConversationDeletionCoordinator, ImConversationDeletionError, ImConversationDeletionResult, ImConversationListActionError, ImConversationListMutationOperation, ImConversationListMutationResult, ImConversationListRefreshResult, ImConversationListStore, ImDirectContactActionResult, ImDirectContactActionResultFor, ImDirectContactOperation, ImDirectoryState, ImEmojiPanelRecentEntry, ImEmojiRecentEntry, ImExpressionLoadStatus, ImExpressionOperation, ImExpressionOperationResult, ImExpressionRecentPersistencePort, ImExpressionRecentPersistenceSnapshot, ImExpressionRecentViewItem, ImExpressionResetOptions, ImExpressionSendResult, ImExpressionStore, ImExpressionStoreActions, ImExpressionStoreError, ImExpressionStoreGetters, ImExpressionStoreState, ImForwardPreparationResult, ImGameRecentEntry, ImGroupMemberManagementOperation, ImGroupMemberManagementResult, ImGroupMemberManagementResultFor, ImGroupProfileActionResult, ImGroupProfileActionResultFor, ImGroupProfileOperation, ImHistoryReturnAfterSendCoordinator, ImHistoryReturnError, ImHistoryReturnExecution, ImHistoryReturnResult, ImMediaOperationResult, ImMediaReplacementRequest, ImMediaStoreError, ImMediaTaskPresentation, ImMembershipJoinActionResult, ImMembershipJoinOperation, ImMessageOperationsStore, ImMessageOperationsStoreActions, ImMessageOperationsStoreState, ImMessageSelectionResult, ImPersistedEmojiPanelRecentEntry, ImPersistedEmojiRecentEntry, ImPersistedExpressionAssetRecentEntry, ImPersistedGameRecentEntry, ImProfileAccessDestination, ImProfileAccessResult, ImProfileDirectoryResult, ImQuotedMessageState, ImQuotedMessageStore, ImQuotedMessageStoreActions, ImQuotedMessageStoreState, ImReactionOperationResult, ImReactionStore, ImReactionStoreActions, ImReactionStoreError, ImReactionStoreState, ImSearchOperationResult, ImSessionFavoritesReloadResult, ImSessionFavoritesStoreError, ImSessionFavoritesWriteResult, ImSessionPhase, ImSessionStore, ImThreadPagingActions, ImThreadPagingState, ImThreadPagingStore, ImThreadReturnToLatestCoordinator, ImThreadStore, ImThreadStoreActions, ImThreadStoreState };
|
|
8746
|
+
export type { ApplyImSessionInput, ChatRuntimeFactories, ChatRuntimeHostDeps, ImApplicationDomainCounts, ImApplicationReviewOperation, ImApplicationReviewResult, ImApplicationsReloadResult, ImApplicationsStoreError, ImCapabilitiesStore, ImChannelManagementMemberTarget, ImChannelMemberManagementOperation, ImChannelMemberManagementResult, ImChannelMemberManagementResultFor, ImChannelProfileActionResult, ImChannelProfileActionResultFor, ImChannelProfileOperation, ImChatKitContext, ImChatKitInstallation, ImComposerStore, ImComposerStoreActions, ImComposerStoreState, ImComposerSubmitResult, ImConversationActivationCoordinator, ImConversationActivationError, ImConversationActivationResult, ImConversationDeletionCoordinator, ImConversationDeletionError, ImConversationDeletionResult, ImConversationListActionError, ImConversationListMutationOperation, ImConversationListMutationResult, ImConversationListRefreshResult, ImConversationListStore, ImDirectContactActionResult, ImDirectContactActionResultFor, ImDirectContactOperation, ImDirectoryState, ImEmojiPanelRecentEntry, ImEmojiRecentEntry, ImExpressionLoadStatus, ImExpressionOperation, ImExpressionOperationResult, ImExpressionRecentPersistencePort, ImExpressionRecentPersistenceSnapshot, ImExpressionRecentViewItem, ImExpressionResetOptions, ImExpressionSendResult, ImExpressionStore, ImExpressionStoreActions, ImExpressionStoreError, ImExpressionStoreGetters, ImExpressionStoreState, ImForwardPreparationResult, ImGameRecentEntry, ImGroupMemberManagementOperation, ImGroupMemberManagementResult, ImGroupMemberManagementResultFor, ImGroupProfileActionResult, ImGroupProfileActionResultFor, ImGroupProfileOperation, ImHistoryReturnAfterSendCoordinator, ImHistoryReturnError, ImHistoryReturnExecution, ImHistoryReturnResult, ImMediaOperationResult, ImMediaReplacementRequest, ImMediaStore, ImMediaStoreError, ImMediaTaskPresentation, ImMembershipJoinActionResult, ImMembershipJoinOperation, ImMessageOperationsStore, ImMessageOperationsStoreActions, ImMessageOperationsStoreState, ImMessageSelectionResult, ImPersistedEmojiPanelRecentEntry, ImPersistedEmojiRecentEntry, ImPersistedExpressionAssetRecentEntry, ImPersistedGameRecentEntry, ImProfileAccessDestination, ImProfileAccessResult, ImProfileDirectoryResult, ImQuotedMessageState, ImQuotedMessageStore, ImQuotedMessageStoreActions, ImQuotedMessageStoreState, ImReactionOperationResult, ImReactionStore, ImReactionStoreActions, ImReactionStoreError, ImReactionStoreState, ImSearchOperationResult, ImSearchStore, ImSessionFavoritesReloadResult, ImSessionFavoritesStoreError, ImSessionFavoritesWriteResult, ImSessionPhase, ImSessionStore, ImThreadPagingActions, ImThreadPagingState, ImThreadPagingStore, ImThreadReturnToLatestCoordinator, ImThreadStore, ImThreadStoreActions, ImThreadStoreState };
|