Lime Web Components API Documentation - v7.2.0
    Preparing search index...

    Interface NotificationRepositoryBeta

    Service for handling notifications

    The repository methods are generic in T so callers can supply the expected shape of Notification.data on a per-call basis. The default is unknown — narrow it at the call site when you know what payload to expect, e.g. repo.get<MentionData>(id).

    interface NotificationRepository {
        delete<T = unknown>(notification: Notification<T>): Promise<void>;
        get<T = unknown>(notificationId: number): Notification<T> | undefined;
        loadAll<T = unknown>(
            options?: NotificationLoadOptions,
        ): Promise<NotificationResponse<T>>;
        markAsRead<T = unknown>(
            notification: Notification<T>,
            read?: boolean,
        ): Promise<Notification<T>>;
    }
    Index

    Methods

    • Beta

      Delete a notification

      Type Parameters

      • T = unknown

      Parameters

      Returns Promise<void>

    • Beta

      Get a loaded notification by its id

      Type Parameters

      • T = unknown

      Parameters

      • notificationId: number

        the id of the notification to get

      Returns Notification<T> | undefined

      the fetched notification

    • Beta

      Mark a notification as read or unread

      Type Parameters

      • T = unknown

      Parameters

      • notification: Notification<T>

        the notification to update

      • Optionalread: boolean

        optional - whether the notification should be marked as read or unread. Defaults to true

      Returns Promise<Notification<T>>

      the updated notification