haitop/src/preload/VencordDesktopNative.ts

22 lines
696 B
TypeScript
Raw Normal View History

import { app, ipcRenderer } from "electron";
import type { Settings } from "../main/settings";
2023-04-09 01:22:31 +02:00
import { IpcEvents } from "../shared/IpcEvents";
2023-04-04 01:35:37 +02:00
export const VencordDesktopNative = {
2023-04-04 01:35:37 +02:00
app: {
2023-04-09 01:22:31 +02:00
relaunch: () => ipcRenderer.invoke(IpcEvents.RELAUNCH),
getVersion: () => app.getVersion()
},
fileManager: {
2023-04-09 01:22:31 +02:00
showItemInFolder: (path: string) => ipcRenderer.invoke(IpcEvents.SHOW_ITEM_IN_FOLDER, path)
},
settings: {
2023-04-09 01:22:31 +02:00
get: () => ipcRenderer.sendSync(IpcEvents.GET_SETTINGS),
set: (settings: typeof Settings) => ipcRenderer.invoke(IpcEvents.SET_SETTINGS, settings)
},
win: {
2023-04-09 01:22:31 +02:00
focus: () => ipcRenderer.invoke(IpcEvents.FOCUS)
2023-04-04 01:35:37 +02:00
}
}