Files
nova-deploy-automatizer/src/preload.js
T
Josias Castro 8480111728 Initial commit
2026-06-18 17:20:35 -03:00

14 lines
573 B
JavaScript

const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("deployMaster", {
listTargets: () => ipcRenderer.invoke("targets:list"),
chooseZip: options => ipcRenderer.invoke("dialog:zip", options),
startDeploy: payload => ipcRenderer.invoke("deploy:start", payload),
stopDeploy: () => ipcRenderer.invoke("deploy:stop"),
onDeployEvent: callback => {
const listener = (_, payload) => callback(payload);
ipcRenderer.on("deploy:event", listener);
return () => ipcRenderer.removeListener("deploy:event", listener);
}
});