mirror of
https://wget.la/https://github.com/Wxw-Gu/WechatExplorer
synced 2026-08-17 19:47:08 +08:00
feat: 导出功能
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
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
|
||||
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 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
|
||||
Reference in New Issue
Block a user