///
declare module '*.vue' {
import type { DefineComponent } from 'vue'
const component: DefineComponent<{}, {}, any>
export default component
}
interface UpdaterState {
status: 'idle' | 'checking' | 'available' | 'not-available' | 'downloading' | 'downloaded' | 'error'
version?: string
releaseNotes?: string
progress?: { percent: number; bytesPerSecond: number; transferred: number; total: number }
error?: string
}
interface RemoteServer {
url: string
name?: string
lastUsed?: number
}
interface ConnectionConfigState {
mode: 'local' | 'remote' | null
remoteUrl: string
servers: RemoteServer[]
forceChoose: boolean
buildMode: 'local' | 'remote'
}
interface ConnectionTestResult {
ok: boolean
status?: number
error?: string
}
interface MateClawAPI {
getPlatform: () => Promise
getVersion: () => Promise
getBuildMode: () => Promise<'local' | 'remote'>
getBackendUrl: () => Promise
isBackendReady: () => Promise
getUserDataPath: () => Promise
openExternal: (url: string) => Promise
restartBackend: () => Promise
onBackendStatus: (callback: (status: string) => void) => () => void
onBackendCrashed: (callback: (message: string) => void) => () => void
navigateToApp: () => void
// Connection management
getConnectionConfig: () => Promise
testConnection: (url: string) => Promise
useLocalConnection: () => Promise
useRemoteConnection: (url: string) => Promise
switchServer: () => Promise
// Auto-updater
getUpdaterState: () => Promise
checkForUpdates: () => Promise
downloadUpdate: () => Promise
installUpdate: () => Promise
onUpdaterState: (callback: (state: UpdaterState) => void) => () => void
}
interface Window {
mateClawAPI: MateClawAPI
}