monerod-gui/app/preload.js

14 lines
377 B
JavaScript

// preload.js
const { contextBridge, ipcRenderer } = require('electron');
contextBridge.exposeInMainWorld('electronAPI', {
startMonerod: (args) => {
ipcRenderer.invoke('start-monerod', args);
},
onMoneroStdout: (callback) => {
ipcRenderer.on('monero-stdout', callback);
},
onMoneroClose: (callback) => {
ipcRenderer.on('monero-close', callback);
}
});