haitop/src/preload/VencordDesktop.ts

21 lines
646 B
TypeScript
Raw Normal View History

2023-04-04 01:35:37 +02:00
import { ipcRenderer } from "electron";
import type { Settings } from "../main/settings";
import { FOCUS, GET_SETTINGS, RELAUNCH, SET_SETTINGS, SHOW_ITEM_IN_FOLDER } from "../shared/IpcEvents";
2023-04-04 01:35:37 +02:00
export const VencordDesktop = {
app: {
relaunch: () => ipcRenderer.invoke(RELAUNCH)
},
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)
2023-04-04 01:35:37 +02:00
}
}