Update events

This commit is contained in:
Daniel Pereira
2016-08-15 16:45:28 -05:00
parent 306ceee471
commit a0d70238a7
2 changed files with 18 additions and 6 deletions

View File

@@ -17,7 +17,10 @@ eNotify.notify({
image: 'path/to/image.png',
url: 'http://google.de',
sound: 'notification.wav',
onClickFunc: function () { console.log('onClick') },
onShowFunc: function () { console.log('onShow') },
onCloseFunc: function () { console.log('onClose') }
onClickFunc: (event) => {
console.log('onClick ' + event.id);
event.closeNotification('onClick');
},
onShowFunc: (event) => { console.log('onShow ' + event.id) },
onCloseFunc: (event) => { console.log('onClose ' + event.id) }
});

View File

@@ -7,15 +7,24 @@
declare namespace ElectronNotify {
interface ICloseNotificationEvent {
event: 'close' | 'show' | 'click',
id: number
}
interface INotificationEvent extends ICloseNotificationEvent {
closeNotification: (reason: any) => void,
}
interface INotification {
title: string,
text?: string,
image?: string,
url?: string,
sound?: string,
onClickFunc?: (event: string, id: number, closeNotification: any) => void,
onShowFunc?: (event: string, id: number, closeNotification: any) => void,
onCloseFunc?: (event: string, id: number) => void
onClickFunc?: (event: INotificationEvent) => void,
onShowFunc?: (event: INotificationEvent) => void,
onCloseFunc?: (event: ICloseNotificationEvent) => void
}
interface IConfiguration {