2022-01-15 18:31:51 +00:00
|
|
|
import { contextBridge, ipcRenderer } from "electron";
|
|
|
|
import { getDisplayMediaSelector } from "./capturer";
|
2021-12-24 21:56:49 +00:00
|
|
|
|
2021-12-26 21:41:09 +00:00
|
|
|
|
2021-12-24 21:56:49 +00:00
|
|
|
contextBridge.exposeInMainWorld("armcord", {
|
|
|
|
window: {
|
2022-01-15 18:31:51 +00:00
|
|
|
show: () => ipcRenderer.send("win-show"),
|
|
|
|
hide: () => ipcRenderer.send("win-hide"),
|
|
|
|
minimize: () => ipcRenderer.send("win-minimize"),
|
|
|
|
maximize: () => ipcRenderer.send("win-maximize"),
|
2021-12-24 21:56:49 +00:00
|
|
|
},
|
|
|
|
electron: process.versions.electron,
|
2022-01-15 18:31:51 +00:00
|
|
|
channel: ipcRenderer.sendSync('channel'),
|
|
|
|
version: ipcRenderer.sendSync("get-app-version", "app-version"),
|
2021-12-24 21:56:49 +00:00
|
|
|
getDisplayMediaSelector: getDisplayMediaSelector,
|
2022-01-15 18:31:51 +00:00
|
|
|
saveSettings: (...args: any) => ipcRenderer.send("saveSettings", ...args),
|
|
|
|
splashEnd: () => ipcRenderer.send("splashEnd"),
|
|
|
|
loadDiscord: () => ipcRenderer.send("loadDiscord"),
|
2021-12-26 21:41:09 +00:00
|
|
|
});
|
2022-01-15 18:31:51 +00:00
|
|
|
contextBridge.exposeInMainWorld("electron", {
|
|
|
|
//deprecated, used for legacy purposes, will be removed in future versions
|
|
|
|
window: {
|
|
|
|
show: () => ipcRenderer.send("win-show"),
|
|
|
|
hide: () => ipcRenderer.send("win-hide"),
|
|
|
|
minimize: () => ipcRenderer.send("win-minimize"),
|
|
|
|
maximize: () => ipcRenderer.send("win-maximize"),
|
|
|
|
},
|
|
|
|
electron: process.versions.electron,
|
|
|
|
warning: 'This is a deprecated API and will be removed in future versions (3.0.0 --> 3.1.0).',
|
|
|
|
version: ipcRenderer.sendSync("get-app-version", "app-version"),
|
|
|
|
});
|