import { ipcMain , IpcMainInvokeEvent , BrowserWindow } from "electron" ; import log from "electron-log" ; export function ipcMainHandle < T extends keyof IpcIHData > ( channel , listener ) ; export function ipcMainHandle ( channel , listener ) { const errorHandledListener = ( event , ... args ) => { try { return listener ( event , ... args ) ; } catch ( e ) { log . error ( e ) ; } } ; ipcMain . handle ( channel , errorHandledListener ) ; } export function ipcMainSend < T extends keyof IpcSOData > ( win , channel , ... args ) ; export function ipcMainSend ( win , channel , ... args ) { return win . webContents . send ( channel , ... args ) ; }