This repository has been archived on 2025-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
project-client/src/preload/VencordDesktopNative.ts

22 lines
701 B
TypeScript
Raw Normal View History

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";
2023-04-04 08:35:37 +09:00
export const VencordDesktopNative = {
2023-04-04 08:35:37 +09:00
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)
2023-04-04 08:35:37 +09:00
}
}