mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-02-28 06:22:45 -08:00
feat(core): add module scaffolding and provider registries
This commit is contained in:
19
src/ipc/main-api.ts
Normal file
19
src/ipc/main-api.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { ipcMain, IpcMainEvent } from "electron";
|
||||
import {
|
||||
RendererToMainInvokeChannel,
|
||||
RendererToMainSendChannel,
|
||||
} from "./contract";
|
||||
|
||||
export function onRendererSend(
|
||||
channel: RendererToMainSendChannel,
|
||||
listener: (event: IpcMainEvent, ...args: any[]) => void,
|
||||
): void {
|
||||
ipcMain.on(channel, listener);
|
||||
}
|
||||
|
||||
export function handleRendererInvoke(
|
||||
channel: RendererToMainInvokeChannel,
|
||||
handler: (event: Electron.IpcMainInvokeEvent, ...args: any[]) => unknown,
|
||||
): void {
|
||||
ipcMain.handle(channel, handler);
|
||||
}
|
||||
Reference in New Issue
Block a user