import { contextBridge, ipcRenderer } from "electron"; import { CH, type Counts, type LabInfo } from "../shared/ipc"; const api = { reset: (): Promise => ipcRenderer.invoke(CH.reset) as Promise, bump: (key: string): Promise => ipcRenderer.invoke(CH.bump, key) as Promise, idem: (opId: string): Promise => ipcRenderer.invoke(CH.idem, opId) as Promise, counts: (): Promise => ipcRenderer.invoke(CH.counts) as Promise, info: (): Promise => ipcRenderer.invoke(CH.info) as Promise, }; contextBridge.exposeInMainWorld("api", api);