-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
57 lines (51 loc) · 1.75 KB
/
Copy pathtypes.ts
File metadata and controls
57 lines (51 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
export interface AIData {
description: string;
tags: string[];
}
export type ProcessMode = 'compress' | 'enhance';
export type EnhanceMethod = 'algorithm' | 'ai';
export interface ProcessedImage {
id: string;
originalFile: File;
originalPreview: string; // Data URL
compressedBlob: Blob; // Also serves as "processed blob" for enhancement
compressedPreview: string; // Data URL
originalSize: number;
compressedSize: number;
compressionRatio: number;
timestamp: number;
qualityUsed: number; // Represents 'quality' for compression or 'intensity' for enhancement
mode: ProcessMode;
enhanceMethod?: EnhanceMethod; // Track if AI or Algorithm was used
aiData?: AIData;
aiModelUsed?: string; // Track which AI model was used for generation
aiGeneratedText?: string; // Text returned from AI generation
aiOriginalBlob?: Blob; // Store original AI output for re-formatting
outputFormat?: 'original' | 'webp' | 'png' | 'jpeg'; // Track actual output format
}
export interface CompressionStats {
originalSize: number;
compressedSize: number;
savedBytes: number;
}
export type Language = 'zh' | 'en';
export interface WebDAVConfig {
url: string;
username: string;
password: string;
}
export interface AppSettings {
customApiKey: string;
customBaseUrl: string;
defaultQuality: number;
smartCompression: boolean;
compressionMode: 'canvas' | 'algorithm'; // 压缩引擎: Canvas (WebP only) 或 Algorithm (Advanced)
outputFormat: 'original' | 'webp' | 'png' | 'jpeg'; // 默认输出格式
defaultProcessMode: ProcessMode;
enhanceMethod: EnhanceMethod;
analysisModel: string; // Custom model for analysis
aiModel: string; // Custom model name for generation
aiPrompt: string;
language: Language;
webdav: WebDAVConfig;
}