Preparing search index...

    Interface NotificationsApi

    Plugin interface functions.

    Notifications REST API for further details.

    interface NotificationsApi {
        acknowledge(id: NotificationId): void;
        acknowledgeAll(): void;
        clear(id: NotificationId): void;
        getId(id: NotificationId): AlarmProperties | undefined;
        getPath(path: Path): Record<NotificationId, AlarmProperties>;
        list(): Record<NotificationId, AlarmProperties>;
        mob(message?: string): NotificationId;
        raise(options: AlarmRaiseOptions): NotificationId;
        silence(id: NotificationId): void;
        silenceAll(): void;
        update(id: NotificationId, options: AlarmUpdateOptions): void;
    }
    Index
    • Acknowledge the alarm condition of the notification with the supplied identifier. Sets status.acknowledged = true Removes sound from method Note: Calling this method on a Notifications with a status of canAcknowledge = false will throw an Error

      Parameters

      Returns void

      NotificationManagerDisabledError when core notification management is disabled (notifications.manageNotifications = false).

      app.notifications.acknowledge('9922c05a-2813-4995-ab72-33f8f2246ff7')
      
    • Clears the alarm from the notification with the supplied identifier by setting state = normal Note: Calling this method on a Notifications with a status of canClear = false will throw an Error

      Parameters

      Returns void

      NotificationManagerDisabledError when core notification management is disabled (notifications.manageNotifications = false).

      app.notifications.clear('9922c05a-2813-4995-ab72-33f8f2246ff7')
      
    • Retrieve the notification(s) with the supplied path.

      When core notification management is disabled, entries are read from the data model (self context only): values carry no core-side status, keys are the source-supplied value.id when present (otherwise the notification path), and matching is by subtree (path prefix) rather than exact path.

      Parameters

      • path: Path

        Notification path.

      Returns Record<NotificationId, AlarmProperties>

      app.notifications.getPath('notifications.server.newVersion')
      
    • Raise a Person Overboard (MOB) notification.

      Parameters

      • Optionalmessage: string

        Message to display or speak.

      Returns NotificationId

      Notification Identifier

      app.notifications.mob()

      // path = `notifications.mob.{notificationId}`
      app.notifications.mob('Crew member overboard!')
      
    • Raises a new notification and assigns an identifier.

      Parameters

      Returns NotificationId

      Notification Identifier

      app.notifications.raise({
      state: 'warn',
      message: 'Port engine temperature is higher than normal.'
      })

      // path = `notifications.{notificationId}`
      app.notifications.raise({
      state: 'warn',
      message: 'Port engine temperature is higher than normal.',
      path: 'propulsion.port.temperature'
      })
      app.notifications.raise({
      state: 'warn',
      message: 'Port engine temperature is higher than normal.',
      path: 'propulsion.port.temperature',
      idInPath: true
      })

      // path = `notifications.propulsion.port.temperature.{notificationId}`

      Note: when core notification management is disabled (notifications.manageNotifications = false), path is required — there is no notifications.{notificationId} fallback — and a plain Error is thrown if it is missing. The returned id is embedded in the emitted value but not tracked by the server. context is ignored: the notification is emitted for the self context, matching managed-mode emission.

    • Silence the alarm of the notification with the supplied identifier. Sets status.silenced = true Removes sound from method Note: Calling this method on a Notifications with a status of canSilence = false will throw an Error

      Parameters

      Returns void

      NotificationManagerDisabledError when core notification management is disabled (notifications.manageNotifications = false).

      app.notifications.silence('9922c05a-2813-4995-ab72-33f8f2246ff7')