mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-05-03 03:31:18 +08:00
feat: 合并聊天记录优化
This commit is contained in:
1
electron/preload/index.d.ts
vendored
1
electron/preload/index.d.ts
vendored
@@ -77,6 +77,7 @@ interface MergeApi {
|
||||
parseFileInfo: (filePath: string) => Promise<FileParseInfo>
|
||||
checkConflicts: (filePaths: string[]) => Promise<ConflictCheckResult>
|
||||
mergeFiles: (params: MergeParams) => Promise<MergeResult>
|
||||
clearCache: (filePath?: string) => Promise<boolean>
|
||||
onParseProgress: (callback: (data: { filePath: string; progress: ImportProgress }) => void) => () => void
|
||||
}
|
||||
|
||||
|
||||
@@ -290,6 +290,7 @@ const chatApi = {
|
||||
const mergeApi = {
|
||||
/**
|
||||
* 解析文件获取基本信息(用于合并预览)
|
||||
* 解析后结果会被缓存,后续合并时无需再次读取原始文件
|
||||
*/
|
||||
parseFileInfo: (filePath: string): Promise<FileParseInfo> => {
|
||||
return ipcRenderer.invoke('merge:parseFileInfo', filePath)
|
||||
@@ -309,6 +310,14 @@ const mergeApi = {
|
||||
return ipcRenderer.invoke('merge:mergeFiles', params)
|
||||
},
|
||||
|
||||
/**
|
||||
* 清理解析缓存
|
||||
* @param filePath 可选,指定文件路径则清理该文件的缓存,否则清理所有缓存
|
||||
*/
|
||||
clearCache: (filePath?: string): Promise<boolean> => {
|
||||
return ipcRenderer.invoke('merge:clearCache', filePath)
|
||||
},
|
||||
|
||||
/**
|
||||
* 监听解析进度(用于大文件)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user