mirror of
https://github.com/antebudimir/feishin.git
synced 2026-01-09 05:44:01 +00:00
* [enhancement]: support clearing query and http cache - Adds the ability to invalidate all queries (useful for forcing refresh, and clearing lyrics which are cached forever) - [Desktop only] adds the ability to clear the Electron HTTP cache (e.g. cached images) * use clearer language * move cache settings to general
41 lines
711 B
TypeScript
41 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;
|