@stereograph/teiaviewer - v17.8.0-dev
    Preparing search index...

    Class NotificationCenter

    The Notification Center keeps track of notifications sent to the viewer.

    Index

    Properties

    signals: {
        onNotificationAdded: ViewerSignal<
            (notification: Notification, oldId?: string) => void,
        >;
        onNotificationDeleted: ViewerSignal<(ids: string | string[]) => void>;
        onNotificationDeletedAll: ViewerSignal<() => void>;
        onNotificationReadStatusUpdated: ViewerSignal<
            (unreadCount: number) => void,
        >;
    } = ...

    Type declaration

    • onNotificationAdded: ViewerSignal<(notification: Notification, oldId?: string) => void>
    • onNotificationDeleted: ViewerSignal<(ids: string | string[]) => void>
    • onNotificationDeletedAll: ViewerSignal<() => void>

      Signal emitted when all notifications are deleted

    • onNotificationReadStatusUpdated: ViewerSignal<(unreadCount: number) => void>

    Accessors

    • get count(): number

      Number of notifications in the center

      Returns number

    • get types(): Set<string>

      Returns a set of all unique notification types.

      Returns Set<string>

    • get unreadCount(): number

      Number of unread notification in the center

      Returns number

    Methods

    • Returns void

    • Returns a generator of notifications

      Returns Generator<Notification>

    • Returns a generator of unread notifications

      Returns Generator<Notification>

    • Add a notification and return its index If you push a notification with the same id, it will replace the previous one.

      Parameters

      • notification: NewNotification
      • Optionalid: string

      Returns string

    • Remove notifications with ids

      Parameters

      • ids: string | string[]

        A notification id, or an array of notification ids

      Returns void

    • Switch notifications to read status

      Parameters

      • notifications: Notification | Notification[]
      • value: boolean

      Returns void