/** * Type declarations for Electron API exposed via preload script */ /** Configuration preset interface */ interface ConfigPreset { id: string name: string createdAt: number updatedAt: number config: { AI_PROVIDER?: string AI_MODEL?: string AI_API_KEY?: string AI_BASE_URL?: string TEMPERATURE?: string [key: string]: string | undefined } } /** Result of applying a preset */ interface ApplyPresetResult { success: boolean error?: string env?: Record } declare global { interface Window { /** Main window Electron API */ electronAPI?: { /** Current platform (darwin, win32, linux) */ platform: NodeJS.Platform /** Whether running in Electron environment */ isElectron: boolean /** Get application version */ getVersion: () => Promise /** Minimize the window */ minimize: () => void /** Maximize/restore the window */ maximize: () => void /** Close the window */ close: () => void /** Open file dialog and return file path */ openFile: () => Promise /** Save data to file via save dialog */ saveFile: (data: string) => Promise } /** Settings window Electron API */ settingsAPI?: { /** Get all configuration presets */ getPresets: () => Promise /** Get current preset ID */ getCurrentPresetId: () => Promise /** Get current preset */ getCurrentPreset: () => Promise /** Save (create or update) a preset */ savePreset: (preset: { id?: string name: string config: Record }) => Promise /** Delete a preset */ deletePreset: (id: string) => Promise /** Apply a preset (sets environment variables and restarts server) */ applyPreset: (id: string) => Promise /** Close settings window */ close: () => void } } } export { ConfigPreset, ApplyPresetResult }