2024-06-14 01:49:25 +02:00
|
|
|
// Copyright 2024, Command Line Inc.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
let { contextBridge, ipcRenderer } = require("electron");
|
|
|
|
|
|
|
|
contextBridge.exposeInMainWorld("api", {
|
|
|
|
isDev: () => ipcRenderer.sendSync("isDev"),
|
|
|
|
isDevServer: () => ipcRenderer.sendSync("isDevServer"),
|
2024-06-21 21:32:38 +02:00
|
|
|
getPlatform: () => ipcRenderer.sendSync("getPlatform"),
|
2024-06-19 20:15:14 +02:00
|
|
|
getCursorPoint: () => ipcRenderer.sendSync("getCursorPoint"),
|
2024-06-20 00:42:19 +02:00
|
|
|
openNewWindow: () => ipcRenderer.send("openNewWindow"),
|
|
|
|
showContextMenu: (menu, position) => ipcRenderer.send("contextmenu-show", menu, position),
|
|
|
|
onContextMenuClick: (callback) => ipcRenderer.on("contextmenu-click", callback),
|
2024-06-26 21:14:59 +02:00
|
|
|
downloadFile: (filePath) => ipcRenderer.send("download", { filePath }),
|
2024-06-14 01:49:25 +02:00
|
|
|
});
|