hejianhao
2026-04-02 0940d56748a73525790c350c393a5be960aab62c
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
/**
 * Electron API 类型定义
 */
 
interface ElectronAPI {
  // 文件系统操作
  openFileDialog: (filters?: any[]) => Promise<string[]>;
  selectDirectory: (title?: string) => Promise<string>;
  openFolder: (folderPath: string) => Promise<{ success: boolean; error?: string }>;
  readFile: (path: string) => Promise<{ success: boolean; content?: string; error?: string }>;
  
  // 项目操作
  deleteProject: (projectPath: string) => Promise<{ success: boolean; message?: string; error?: string }>;
  removeProjectFromRecent: (projectPath: string) => Promise<{ success: boolean; error?: string }>;
  deleteSplitFiles: (projectPath: string, splitId: string) => Promise<{ success: boolean; deletedFiles?: string[]; error?: string }>;
  
  // 图片操作
  importImagesToProject: (projectPath: string, imagePaths: string[]) => Promise<{ success: boolean; images?: any[]; error?: string }>;
  getImageDimensions: (imagePath: string) => Promise<{ success: boolean; size?: string; error?: string }>;
  
  // 方法配置
  getLocalMethods: () => Promise<{ success: boolean; config?: any; error?: string }>;
  
  // 默认路径
  getDefaultDownloadPath: () => Promise<string>;
}
 
declare global {
  interface Window {
    electronAPI?: ElectronAPI;
  }
}
 
export {};