///
/**
* Electron API 类型声明
* 对应 preload 中暴露的 API
*/
interface FileOperationResult {
success: boolean
message: string
path?: string | null
content?: string | null
canceled?: boolean
}
interface GitOperationResult {
success: boolean
message: string
stdout?: string
}
interface ElectronAPI {
file: {
save: (content: string, filename?: string) => Promise
read: (filename?: string) => Promise
openDirectory: () => Promise
}
git: {
clone: (repoUrl: string, targetDir: string) => Promise
onProgress: (callback: (data: { repoUrl: string; raw: string }) => void) => void
removeListener: () => void
}
settings: {
get: (key?: string) => Promise
save: (key: string, value: unknown) => Promise
}
}
declare global {
interface Window {
electronAPI: ElectronAPI
}
}
export { }