export {} declare global { interface Window { hermesDesktop: { getConnection: () => Promise api: (request: HermesApiRequest) => Promise notify: (payload: HermesNotification) => Promise requestMicrophoneAccess: () => Promise readFileDataUrl: (filePath: string) => Promise selectPaths: (options?: HermesSelectPathsOptions) => Promise writeClipboard: (text: string) => Promise saveImageFromUrl: (url: string) => Promise saveImageBuffer: (data: ArrayBuffer | Uint8Array, ext: string) => Promise saveClipboardImage: () => Promise getPathForFile: (file: File) => string normalizePreviewTarget: (target: string, baseDir?: string) => Promise watchPreviewFile: (url: string) => Promise stopPreviewFileWatch: (id: string) => Promise openExternal: (url: string) => Promise onPreviewFileChanged: (callback: (payload: HermesPreviewFileChanged) => void) => () => void onBackendExit: (callback: (payload: BackendExit) => void) => () => void } } } export interface HermesConnection { baseUrl: string token: string wsUrl: string logs: string[] windowButtonPosition: { x: number; y: number } | null } export interface HermesApiRequest { path: string method?: string body?: unknown } export interface HermesNotification { title?: string body?: string silent?: boolean } export interface HermesPreviewTarget { kind: 'file' | 'url' label: string source: string url: string } export interface HermesPreviewWatch { id: string path: string } export interface HermesPreviewFileChanged { id: string path: string url: string } export interface HermesSelectPathsOptions { title?: string defaultPath?: string directories?: boolean multiple?: boolean filters?: Array<{ name: string; extensions: string[] }> } export interface BackendExit { code: number | null signal: string | null }