import { ElectronAPI } from "@electron-toolkit/preload"; interface DesktopAPI { /** Listen for auth token delivered via deep link. Returns an unsubscribe function. */ onAuthToken: (callback: (token: string) => void) => () => void; /** Listen for invitation IDs delivered via deep link. Returns an unsubscribe function. */ onInviteOpen: (callback: (invitationId: string) => void) => () => void; /** Open a URL in the default browser. */ openExternal: (url: string) => Promise; /** Hide macOS traffic lights for full-screen modals; restore when false. */ setImmersiveMode: (immersive: boolean) => Promise; } interface DaemonStatus { state: "running" | "stopped" | "starting" | "stopping" | "installing_cli" | "cli_not_found"; pid?: number; uptime?: string; daemonId?: string; deviceName?: string; agents?: string[]; workspaceCount?: number; profile?: string; serverUrl?: string; } interface DaemonPrefs { autoStart: boolean; autoStop: boolean; } interface DaemonAPI { start: () => Promise<{ success: boolean; error?: string }>; stop: () => Promise<{ success: boolean; error?: string }>; restart: () => Promise<{ success: boolean; error?: string }>; getStatus: () => Promise; onStatusChange: (callback: (status: DaemonStatus) => void) => () => void; setTargetApiUrl: (url: string) => Promise; syncToken: (token: string, userId: string) => Promise; clearToken: () => Promise; isCliInstalled: () => Promise; getPrefs: () => Promise; setPrefs: (prefs: Partial) => Promise; autoStart: () => Promise; retryInstall: () => Promise; startLogStream: () => void; stopLogStream: () => void; onLogLine: (callback: (line: string) => void) => () => void; } interface UpdaterAPI { onUpdateAvailable: (callback: (info: { version: string; releaseNotes?: string }) => void) => () => void; onDownloadProgress: (callback: (progress: { percent: number }) => void) => () => void; onUpdateDownloaded: (callback: () => void) => () => void; downloadUpdate: () => Promise; installUpdate: () => Promise; } declare global { interface Window { electron: ElectronAPI; desktopAPI: DesktopAPI; daemonAPI: DaemonAPI; updater: UpdaterAPI; } } export {};