feishin/src/main/preload/ipc.ts

17 lines
325 B
TypeScript
Raw Normal View History

2022-12-19 15:59:14 -08:00
import { ipcRenderer } from 'electron';
const removeAllListeners = (channel: string) => {
2023-07-01 19:10:05 -07:00
ipcRenderer.removeAllListeners(channel);
2022-12-19 15:59:14 -08:00
};
const send = (channel: string, ...args: any[]) => {
2023-07-01 19:10:05 -07:00
ipcRenderer.send(channel, ...args);
};
2022-12-19 15:59:14 -08:00
export const ipc = {
2023-07-01 19:10:05 -07:00
removeAllListeners,
send,
2022-12-19 15:59:14 -08:00
};
export type Ipc = typeof ipc;