VencordDesktop -> VencordDesktopNative; add VencordDesktop global

This commit is contained in:
Vendicated
2023-04-09 01:20:00 +02:00
parent 7e0532444d
commit b4a2c41e74
10 changed files with 17 additions and 25 deletions

View File

@@ -0,0 +1,21 @@
import { app, ipcRenderer } from "electron";
import type { Settings } from "../main/settings";
import { FOCUS, GET_SETTINGS, RELAUNCH, SET_SETTINGS, SHOW_ITEM_IN_FOLDER } from "../shared/IpcEvents";
export const VencordDesktopNative = {
app: {
relaunch: () => ipcRenderer.invoke(RELAUNCH),
getVersion: () => app.getVersion()
},
fileManager: {
showItemInFolder: (path: string) => ipcRenderer.invoke(SHOW_ITEM_IN_FOLDER, path)
},
settings: {
get: () => ipcRenderer.sendSync(GET_SETTINGS),
set: (settings: typeof Settings) => ipcRenderer.invoke(SET_SETTINGS, settings)
},
win: {
focus: () => ipcRenderer.invoke(FOCUS)
}
}