const { contextBridge, ipcRenderer, ipcMain } = require('electron') contextBridge.exposeInMainWorld('functions', { run: (value) => ipcRenderer.invoke('run', value), onTaskCompleted: (callback) => ipcRenderer.on('task-completed', (_event, value) => { callback(value) }) })