mirror of
https://github.com/upscayl/upscayl.git
synced 2024-12-18 02:16:01 +01:00
15 lines
572 B
TypeScript
15 lines
572 B
TypeScript
import { ipcRenderer, contextBridge } from "electron";
|
|
import { getPlatform } from "./utils/get-device-specs";
|
|
|
|
// 'ipcRenderer' will be available in index.js with the method 'window.electron'
|
|
contextBridge.exposeInMainWorld("electron", {
|
|
send: (command: string, payload: any) => ipcRenderer.send(command, payload),
|
|
on: (command: string, func: (...args: any) => any) =>
|
|
ipcRenderer.on(command, (event, args) => {
|
|
func(event, args);
|
|
}),
|
|
invoke: (command: string, payload: any) =>
|
|
ipcRenderer.invoke(command, payload),
|
|
platform: getPlatform(),
|
|
});
|