Working version(some)
This commit is contained in:
@ -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);
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user