mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-07 20:40:15 +02:00
42 lines
711 B
TypeScript
42 lines
711 B
TypeScript
import { ipcRenderer } from 'electron';
|
|
|
|
const exit = () => {
|
|
ipcRenderer.send('window-close');
|
|
};
|
|
|
|
const maximize = () => {
|
|
ipcRenderer.send('window-maximize');
|
|
};
|
|
|
|
const minimize = () => {
|
|
ipcRenderer.send('window-minimize');
|
|
};
|
|
|
|
const unmaximize = () => {
|
|
ipcRenderer.send('window-unmaximize');
|
|
};
|
|
|
|
const quit = () => {
|
|
ipcRenderer.send('window-quit');
|
|
};
|
|
|
|
const devtools = () => {
|
|
ipcRenderer.send('window-dev-tools');
|
|
};
|
|
|
|
const clearCache = (): Promise<void> => {
|
|
return ipcRenderer.invoke('window-clear-cache');
|
|
};
|
|
|
|
export const browser = {
|
|
clearCache,
|
|
devtools,
|
|
exit,
|
|
maximize,
|
|
minimize,
|
|
quit,
|
|
unmaximize,
|
|
};
|
|
|
|
export type Browser = typeof browser;
|