import { ElectronAPI } from '@electron-toolkit/preload' import { FileType } from '@renderer/types' import type { OpenDialogOptions } from 'electron' declare global { interface Window { electron: ElectronAPI api: { getAppInfo: () => Promise<{ version: string isPackaged: boolean appPath: string }> checkForUpdate: () => void openWebsite: (url: string) => void setProxy: (proxy: string | undefined) => void setTheme: (theme: 'light' | 'dark') => void minApp: (options: { url: string; windowOptions?: Electron.BrowserWindowConstructorOptions }) => void reload: () => void compress: (text: string) => Promise decompress: (text: Buffer) => Promise file: { select: (options?: OpenDialogOptions) => Promise upload: (file: FileType) => Promise delete: (fileId: string) => Promise read: (fileId: string) => Promise base64Image: (fileId: string) => Promise<{ mime: string; base64: string; data: string }> clear: () => Promise get: (filePath: string) => Promise create: (fileName: string) => Promise write: (filePath: string, data: Uint8Array | string) => Promise open: (options?: OpenDialogOptions) => Promise<{ fileName: string; content: Buffer } | null> save: (path: string, content: string | NodeJS.ArrayBufferView, options?: SaveDialogOptions) => void saveImage: (name: string, data: string) => void } } } }