Working version(some)

This commit is contained in:
2025-07-06 22:13:09 +05:00
parent 12f7ea8d1c
commit 4717132b05
8 changed files with 1164 additions and 94 deletions

View File

@ -1,8 +1,10 @@
// Disable no-unused-vars, broken for spread args
/* eslint no-unused-vars: off */
import { contextBridge, ipcRenderer, IpcRendererEvent } from 'electron';
export type Channels = 'ipc-example';
export type Channels =
| 'ipc-example'
| 'download-progress'
| 'launch-minecraft'
| 'installation-status';
const electronHandler = {
ipcRenderer: {
@ -21,6 +23,9 @@ const electronHandler = {
once(channel: Channels, func: (...args: unknown[]) => void) {
ipcRenderer.once(channel, (_event, ...args) => func(...args));
},
invoke(channel: string, ...args: unknown[]) {
return ipcRenderer.invoke(channel, ...args);
},
},
};