mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-10-06 22:00:49 +08:00
- 新增微信账号发现、环境诊断和分步数据库连接引导 - 支持按账号安全保存数据库密钥及快速切换账号 - 完善 WCDB 历史消息分片读取和分页状态提示 - 支持导出图片、视频和语音,提供原图优先及缩略图回退 - 更新安装指引、兼容版本说明和相关自动化测试
70 lines
1.7 KiB
TypeScript
70 lines
1.7 KiB
TypeScript
import type { Message } from './types'
|
|
|
|
export type ExportFormat = 'html' | 'csv' | 'json' | 'markdown'
|
|
export type ExportMessageKind =
|
|
| 'text'
|
|
| 'image'
|
|
| 'video'
|
|
| 'voice'
|
|
| 'sticker'
|
|
| 'share'
|
|
| 'location'
|
|
| 'system'
|
|
|
|
export type ExportNameMode = 'groupNickname' | 'remark' | 'wechatNickname'
|
|
|
|
export interface ExportRequest {
|
|
jobId: string
|
|
userMd5: string
|
|
name: string
|
|
format: ExportFormat
|
|
outputName: string
|
|
startTime?: number
|
|
endTime?: number
|
|
kinds: ExportMessageKind[]
|
|
includeMedia: boolean
|
|
preferOriginal?: boolean
|
|
fallbackThumbnail?: boolean
|
|
keepMissing?: boolean
|
|
includeAvatars?: boolean
|
|
avatarUrls?: Record<string, string>
|
|
nameMode?: ExportNameMode
|
|
nameMap?: Record<string, string>
|
|
zip?: boolean
|
|
}
|
|
|
|
export interface ExportJobProgress {
|
|
jobId: string
|
|
phase: 'reading' | 'writing' | 'completed' | 'cancelled' | 'failed'
|
|
processed: number
|
|
total?: number
|
|
percent?: number
|
|
outputPath?: string
|
|
error?: string
|
|
}
|
|
|
|
export interface ExportTaskRecord {
|
|
jobId: string
|
|
contactId: string
|
|
contactName: string
|
|
format: ExportFormat
|
|
status: 'running' | 'completed' | 'cancelled' | 'failed'
|
|
progress: ExportJobProgress
|
|
createdAt: number
|
|
}
|
|
|
|
export interface ExportResult {
|
|
success: boolean
|
|
outputPath?: string
|
|
messageCount?: number
|
|
error?: string
|
|
}
|
|
export type ExportRendererApi = {
|
|
startExport: (request: ExportRequest) => Promise<ExportResult>
|
|
cancelExport: (jobId: string) => Promise<{ success: boolean }>
|
|
revealExport: (path: string) => Promise<{ success: boolean; error?: string }>
|
|
onExportProgress: (callback: (progress: ExportJobProgress) => void) => () => void
|
|
}
|
|
|
|
export type ExportMessage = Message
|