mirror of
https://github.com/rhysd/Mstdn.git
synced 2025-01-21 20:52:11 +01:00
15 lines
445 B
TypeScript
15 lines
445 B
TypeScript
import {ipcRenderer as ipc} from 'electron';
|
|
import log from './log';
|
|
|
|
export function on(channel: IpcChannelFromMain, callback: (...args: any[]) => void) {
|
|
ipc.on(channel, (_, ...args: any[]) => {
|
|
log.info('IPC: Received from:', channel, args);
|
|
callback(...args);
|
|
});
|
|
}
|
|
|
|
export function send(channel: IpcChannelFromRenderer, ...args: any[]) {
|
|
log.info('IPC: Send:', channel, args);
|
|
ipc.send(channel, ...args);
|
|
}
|