(
sourceId: string,
chatId: string,
onProgress?: (p: ImportProgress) => void
)
| 89 | } |
| 90 | |
| 91 | async importPreparedChat( |
| 92 | sourceId: string, |
| 93 | chatId: string, |
| 94 | onProgress?: (p: ImportProgress) => void |
| 95 | ): Promise<ImportResult> { |
| 96 | const unlisten = window.chatApi.onImportProgress((progress: any) => { |
| 97 | onProgress?.({ |
| 98 | stage: progress.stage || 'parsing', |
| 99 | progress: progress.percentage || progress.progress || 0, |
| 100 | message: progress.message || '', |
| 101 | bytesRead: progress.bytesRead, |
| 102 | totalBytes: progress.totalBytes, |
| 103 | messagesProcessed: progress.messagesProcessed, |
| 104 | }) |
| 105 | }) |
| 106 | try { |
| 107 | return await window.chatApi.importPreparedChat(sourceId, chatId) |
| 108 | } finally { |
| 109 | unlisten() |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | async releaseImportSource(sourceId: string): Promise<void> { |
| 114 | await window.chatApi.releaseImportSource(sourceId) |
nothing calls this directly
no test coverage detected