1
0
mirror of https://github.com/upscayl/upscayl.git synced 2024-09-24 03:18:28 +02:00
upscayl/electron/preload.ts
2022-11-12 02:09:28 +05:30

12 lines
428 B
TypeScript

import { ipcRenderer, contextBridge } from "electron";
// 'ipcRenderer' will be available in index.js with the method 'window.electron'
contextBridge.exposeInMainWorld("electron", {
send: (command, payload) => ipcRenderer.send(command, payload),
on: (command, func) =>
ipcRenderer.on(command, (event, args) => {
func(event, args);
}),
invoke: (command, payload) => ipcRenderer.invoke(command, payload),
});