electron: add ipc layer

This commit is contained in:
Tienson Qin
2021-01-20 23:22:29 +08:00
parent abdad5634a
commit 8e5a589885
9 changed files with 456 additions and 36 deletions

7
resources/js/preload.js Normal file
View File

@@ -0,0 +1,7 @@
const {ipcRenderer, contextBridge} = require('electron');
contextBridge.exposeInMainWorld('api', {
doAction: async (arg) => {
return await ipcRenderer.invoke('main', arg);
}
});