/**
|
* 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 {};
|