import { ipcMain , Notification } from 'electron' ; export const NOTIFICATION = 'notification' ; class NotificationCenter { constructor ( ) { this . init ( ) ; } init ( ) { this . registerHandlers ( ) ; } registerHandlers ( ) { ipcMain . on ( NOTIFICATION , this . constructor . onNotificationReceive ) ; } static onNotificationReceive ( event , notification ) { console . log ( 'NOTIFICATION TRIGGERED' ) ; switch ( notification . type ) { case 'alert' : { const notif = new Notification ( notification ) ; notif . show ( ) ; break ; } default : break ; } } } export default NotificationCenter ;