interface ProcessAPI {
  versions: {
    electron: string;
    chrome: string;
    node: string;
    [key: string]: any;
  };
}

interface ElectronAPI {
  process: ProcessAPI;
  ipcRenderer: {
    invoke: (channel: string, ...args: any[]) => Promise<any>;
    on: (channel: string, listener: (...args: any[]) => void) => void;
    off: (channel: string, listener: (...args: any[]) => void) => void;
    send: (channel: string, ...args: any[]) => void;
    removeAllListeners: (channel: string) => void;
  };
}

interface API {
  installOllama: () => Promise<any>;
  onInstallProgress: (callback: (value: any) => void) => void;
  removeInstallProgressListeners: () => void;
}

declare global {
  interface Window {
    electron: ElectronAPI
    api: API
  }
}
