import { contextBridge, ipcRenderer } from "electron"; import { CH, type Api, type CreateResult, type ExplorerInfo, type FocusResult, type KillResult, } from "../shared/ipc"; const api: Api = { list: (): Promise => ipcRenderer.invoke(CH.list), kill: (id: number): Promise => ipcRenderer.invoke(CH.kill, id), focus: (id: number): Promise => ipcRenderer.invoke(CH.focus, id), create: (): Promise => ipcRenderer.invoke(CH.create), }; contextBridge.exposeInMainWorld("api", api);