mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2024-10-30 02:37:36 +00:00
29 lines
863 B
JavaScript
29 lines
863 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);
|
|
},
|
|
getMoneroVersion: () => {
|
|
ipcRenderer.invoke('get-monero-version');
|
|
},
|
|
onMoneroVersion: (callback) => {
|
|
ipcRenderer.on('monero-version', callback);
|
|
},
|
|
onMoneroVersionError: (callback) => {
|
|
ipcRenderer.on('monero-version-error', callback);
|
|
},
|
|
downloadMonerod: (downloadUrl, destination) => {
|
|
ipcRenderer.invoke('download-monerod', downloadUrl, destination);
|
|
},
|
|
onDownloadProgress: (callback) => {
|
|
ipcRenderer.on('download-progress', callback);
|
|
}
|
|
});
|