Notification

Notification

Neptune Server Notification class Notification acts as an abstraction layer for sending the notification to the computer via node-notifier. You create the notification, push it out, and the Notification class handles the notification from there and emits Events to notify you of changes.

Constructor

new Notification(client, data)

Source:
Parameters:
Name Type Description
client Client Client this notification came from
data NotificationData The notification data provided by the client

Members

clientId :number

Client id that own this notification
Source:
Type:
  • number

data :NotificationData

Might be pulled directly into this class later, for now I am lazy
Source:
Type:

Methods

activate(dataopt)

The notification was activated (clicked). Causes class to emit 'activate'
Source:
Parameters:
Name Type Attributes Description
data UpdateNotificationData <optional>
User input from the notification

delete()

Deletes the notification from this computer.
Source:

dismiss()

Tells the client to dismiss this notification.
Source:

error()

Called when the notification failed to be displayed. Utilizes the TrayIcon we created for MainWindow to send out a balloon tooltip icon.
Source:

push() → {void}

Pushes the notification out to the OS
Source:
Returns:
Type:
void

update(data)

Updates the notification data and the toast notification on the OS side.
Source:
Parameters:
Name Type Description
data NotificationData The notification data provided by the client