workflow_launcher/preload.js

14 lines
512 B
JavaScript
Raw Normal View History

2024-03-11 11:01:07 -04:00
const { contextBridge, ipcRenderer, ipcMain } = require('electron')
const { app, BrowserWindow} = require('electron')
contextBridge.exposeInMainWorld('functions', {
node: () => process.versions.node,
chrome: () => process.versions.chrome,
electron: () => process.versions.electron,
run: (value) => ipcRenderer.invoke('run', value),
setContent: (id, value) => ipcMain.invoke(id, value),
onTaskCompleted: (callback) => ipcRenderer.on('task-completed', (_event, value) => {
callback(value)
})
})