// Type declarations for Electron IPC API exposed via preload // All types imported from shared/types for consistency interface ElectronAPI { // SSH sshConnect: (config: import('../shared/types/ipc.types').SSHConnectRequest) => Promise sshDisconnect: (connectionId: string) => Promise<{ success: boolean; error?: string }> sshExec: (connectionId: string, command: string) => Promise<{ success: boolean; result?: string; error?: string }> sshCreateShell: (connectionId: string, options?: import('../shared/types/ipc.types').SSHCreateShellRequest, shellId?: string) => Promise<{ success: boolean; shellId?: string; error?: string }> sshShellWrite: (shellId: string, data: string | Uint8Array) => Promise<{ success: boolean; error?: string }> sshShellResize: (shellId: string, cols: number, rows: number) => Promise<{ success: boolean; error?: string }> sshForwardLocal: (connectionId: string, localPort: number, remoteHost: string, remotePort: number) => Promise sshForwardRemote: (connectionId: string, remotePort: number, localHost: string, localPort: number) => Promise sshForwardDynamic: (connectionId: string, localPort: number) => Promise // Sessions sessionGetAll: () => Promise<{ success: boolean; sessions?: import('../shared/types/session.types').Session[]; error?: string }> sessionGetById: (id: string) => Promise<{ success: boolean; session?: import('../shared/types/session.types').Session; error?: string }> sessionCreate: (session: Omit) => Promise sessionUpdate: (id: string, updates: Partial) => Promise sessionDelete: (id: string) => Promise<{ success: boolean; error?: string }> // SFTP sftpConnect: (connectionId: string) => Promise<{ success: boolean; sftpId?: string; error?: string }> sftpListDirectory: (sftpId: string, path: string) => Promise<{ success: boolean; files?: unknown[]; error?: string }> sftpUpload: (sftpId: string, localPath: string, remotePath: string) => Promise<{ success: boolean; error?: string }> sftpDownload: (sftpId: string, remotePath: string, localPath: string) => Promise<{ success: boolean; error?: string }> sftpRename: (sftpId: string, oldPath: string, newPath: string) => Promise<{ success: boolean; error?: string }> sftpDelete: (sftpId: string, path: string, isDirectory: boolean) => Promise<{ success: boolean; error?: string }> sftpMkdir: (sftpId: string, path: string) => Promise<{ success: boolean; error?: string }> sftpStat: (sftpId: string, filePath: string) => Promise<{ success: boolean; stats?: unknown; error?: string }> sftpChmod: (sftpId: string, filePath: string, mode: number) => Promise<{ success: boolean; error?: string }> // Settings settingsGet: (key: string) => Promise<{ success: boolean; value?: unknown; error?: string }> settingsSet: (key: string, value: unknown) => Promise<{ success: boolean; error?: string }> // Dialogs showSaveDialog: (options: import('../shared/types/ipc.types').DialogOptions) => Promise showOpenDialog: (options: import('../shared/types/ipc.types').DialogOptions) => Promise // File operations readFile: (filePath: string) => Promise<{ success: boolean; data?: string; error?: string }> writeFile: (filePath: string, data: string) => Promise<{ success: boolean; error?: string }> // Local filesystem getHomePath: () => Promise<{ success: boolean; path?: string; error?: string }> getDownloadsPath: () => Promise localReadDir: (dirPath: string) => Promise localGetStats: (filePath: string) => Promise localDelete: (filePath: string) => Promise localRename: (oldPath: string, newPath: string) => Promise localMkdir: (dirPath: string) => Promise // App getVersion: () => Promise // Window toggleMaximize: () => Promise // Events onMenuNewSession: (callback: () => void) => void onMenuQuickConnect: (callback: () => void) => void onMenuImportSessions: (callback: () => void) => void onMenuExportSessions: (callback: () => void) => void onMenuOpenSettings: (callback: () => void) => void onShellData: (callback: (event: Electron.IpcRendererEvent, connectionId: string, shellId: string, data: Buffer) => void) => void onSFTPProgress: (callback: (event: Electron.IpcRendererEvent, sftpId: string, progress: { transferred: number; total: number; percentage: number }) => void) => void removeListener: (channel: string, callback: (...args: unknown[]) => void) => void removeAllListeners: (channel: string) => void } declare global { interface Window { electronAPI: ElectronAPI } } export {}