/// <reference types="vite/client" />

interface ElectronDesktopMessageOptions {
  message: string;
  title?: string;
  kind?: 'info' | 'warning' | 'error';
}

interface ElectronDesktopExportPayload {
  fileName: string;
  title: string;
  html: string;
  previewFont: string;
  previewFontSize: number;
  documentHtml: string;
}

interface ElectronDesktopExportResult {
  canceled: boolean;
  filePath?: string;
}

interface ElectronDesktopHttpRequest {
  url: string;
  method?: string;
  headers?: Record<string, string>;
  bodyText?: string;
  bodyBase64?: string;
}

interface ElectronDesktopHttpResponse {
  ok: boolean;
  status: number;
  statusText: string;
  headers: Record<string, string>;
  bodyBase64: string;
}

interface Window {
  electronDesktop?: {
    showMessage: (options: ElectronDesktopMessageOptions) => Promise<void>;
    exportPdf: (payload: ElectronDesktopExportPayload) => Promise<ElectronDesktopExportResult>;
    httpRequest: (payload: ElectronDesktopHttpRequest) => Promise<ElectronDesktopHttpResponse>;
    getRuntime: () => 'electron';
  };
}
