A notification manager used to create Notifications to be shown to the user.
An instance of this class is always available as the atom.notifications
global.
Invoke the given callback after a notification has been added.
Argument | Description |
---|---|
|
Function to be called after the notification is added. |
|
The Notification that was added. |
Return values |
---|
Returns a Disposable on which |
Invoke the given callback after the notifications have been cleared.
Argument | Description |
---|---|
|
Function to be called after the notifications are cleared. |
Return values |
---|
Returns a Disposable on which |
Add a success notification.
Argument | Description |
---|---|
|
A String message |
|
optional
An options Object with the following keys: |
|
optional
An Array of Object where each Object has the following options: |
|
optional
String a class name to add to the button’s default class name ( |
|
optional
Function callback to call when the button has been clicked. The context will be set to the NotificationElement instance. |
|
String inner text for the button |
|
optional
A Markdown String containing a longer description about the notification. By default, this will not preserve newlines and whitespace when it is rendered. |
|
optional
A plain-text String containing additional details about the notification. By default, this will preserve newlines and whitespace when it is rendered. |
|
optional
A Boolean indicating whether this notification can be dismissed by the user. Defaults to |
|
optional
A String name of an icon from Octicons to display in the notification header. Defaults to |
Return values |
---|
Returns the Notification that was added. |
Add an informational notification.
Argument | Description |
---|---|
|
A String message |
|
optional
An options Object with the following keys: |
|
optional
An Array of Object where each Object has the following options: |
|
optional
String a class name to add to the button’s default class name ( |
|
optional
Function callback to call when the button has been clicked. The context will be set to the NotificationElement instance. |
|
String inner text for the button |
|
optional
A Markdown String containing a longer description about the notification. By default, this will not preserve newlines and whitespace when it is rendered. |
|
optional
A plain-text String containing additional details about the notification. By default, this will preserve newlines and whitespace when it is rendered. |
|
optional
A Boolean indicating whether this notification can be dismissed by the user. Defaults to |
|
optional
A String name of an icon from Octicons to display in the notification header. Defaults to |
Return values |
---|
Returns the Notification that was added. |
Add a warning notification.
Argument | Description |
---|---|
|
A String message |
|
optional
An options Object with the following keys: |
|
optional
An Array of Object where each Object has the following options: |
|
optional
String a class name to add to the button’s default class name ( |
|
optional
Function callback to call when the button has been clicked. The context will be set to the NotificationElement instance. |
|
String inner text for the button |
|
optional
A Markdown String containing a longer description about the notification. By default, this will not preserve newlines and whitespace when it is rendered. |
|
optional
A plain-text String containing additional details about the notification. By default, this will preserve newlines and whitespace when it is rendered. |
|
optional
A Boolean indicating whether this notification can be dismissed by the user. Defaults to |
|
optional
A String name of an icon from Octicons to display in the notification header. Defaults to |
Return values |
---|
Returns the Notification that was added. |
Add an error notification.
Argument | Description |
---|---|
|
A String message |
|
optional
An options Object with the following keys: |
|
optional
An Array of Object where each Object has the following options: |
|
optional
String a class name to add to the button’s default class name ( |
|
optional
Function callback to call when the button has been clicked. The context will be set to the NotificationElement instance. |
|
String inner text for the button |
|
optional
A Markdown String containing a longer description about the notification. By default, this will not preserve newlines and whitespace when it is rendered. |
|
optional
A plain-text String containing additional details about the notification. By default, this will preserve newlines and whitespace when it is rendered. |
|
optional
A Boolean indicating whether this notification can be dismissed by the user. Defaults to |
|
optional
A String name of an icon from Octicons to display in the notification header. Defaults to |
|
optional
A preformatted String with stack trace information describing the location of the error. Requires |
Return values |
---|
Returns the Notification that was added. |
Add a fatal error notification.
Argument | Description |
---|---|
|
A String message |
|
optional
An options Object with the following keys: |
|
optional
An Array of Object where each Object has the following options: |
|
optional
String a class name to add to the button’s default class name ( |
|
optional
Function callback to call when the button has been clicked. The context will be set to the NotificationElement instance. |
|
String inner text for the button |
|
optional
A Markdown String containing a longer description about the notification. By default, this will not preserve newlines and whitespace when it is rendered. |
|
optional
A plain-text String containing additional details about the notification. By default, this will preserve newlines and whitespace when it is rendered. |
|
optional
A Boolean indicating whether this notification can be dismissed by the user. Defaults to |
|
optional
A String name of an icon from Octicons to display in the notification header. Defaults to |
|
optional
A preformatted String with stack trace information describing the location of the error. Requires |
Return values |
---|
Returns the Notification that was added. |
Clear all the notifications.