InterfaceNotificationRepository

interface NotificationRepository {
    requests: {
        merged: {
            fetch(meta?: HttpMetaParams<"none">): Promise<{
                merged: boolean;
            }>;
        };
        $select(id: string): {
            accept(meta?: HttpMetaParams<"none">): Promise<void>;
            dismiss(meta?: HttpMetaParams<"none">): Promise<void>;
            fetch(meta?: HttpMetaParams<"none">): Promise<NotificationRequest>;
        };
        accept(meta?: HttpMetaParams<"none">): Promise<void>;
        dismiss(meta?: HttpMetaParams<"none">): Promise<void>;
        list(params?: DefaultPaginationParams, meta?: HttpMetaParams<"json">): Paginator<NotificationRequest[], DefaultPaginationParams>;
    };
    unreadCount: {
        fetch(params?: mastodon.rest.v1.FetchUnreadCountParams, meta?: HttpMetaParams<"none">): Promise<{
            count: number;
        }>;
    };
    $select(id: string): {
        dismiss(meta?: HttpMetaParams<"none">): Promise<void>;
        fetch(meta?: HttpMetaParams<"none">): Promise<Notification>;
    };
    clear(meta?: HttpMetaParams<"none">): Promise<void>;
    fetch(params?: mastodon.rest.v1.ListNotificationsParams, meta?: HttpMetaParams<"none">): Promise<Notification[]>;
    list(params?: mastodon.rest.v1.ListNotificationsParams, meta?: HttpMetaParams<"json">): Paginator<Notification[], mastodon.rest.v1.ListNotificationsParams>;
}

Properties

requests: {
    merged: {
        fetch(meta?: HttpMetaParams<"none">): Promise<{
            merged: boolean;
        }>;
    };
    $select(id: string): {
        accept(meta?: HttpMetaParams<"none">): Promise<void>;
        dismiss(meta?: HttpMetaParams<"none">): Promise<void>;
        fetch(meta?: HttpMetaParams<"none">): Promise<NotificationRequest>;
    };
    accept(meta?: HttpMetaParams<"none">): Promise<void>;
    dismiss(meta?: HttpMetaParams<"none">): Promise<void>;
    list(params?: DefaultPaginationParams, meta?: HttpMetaParams<"json">): Paginator<NotificationRequest[], DefaultPaginationParams>;
}

Type declaration

  • merged: {
        fetch(meta?: HttpMetaParams<"none">): Promise<{
            merged: boolean;
        }>;
    }
    • fetch:function
      • Check whether accepted notification requests have been merged. Accepting notification requests schedules a background job to merge the filtered notifications back into the normal notification list. When that process has finished, the client should refresh the notifications list at its earliest convenience. This is communicated by the notifications_merged streaming event but can also be polled using this endpoint.

        Parameters

        • Optionalmeta: HttpMetaParams<"none">

        Returns Promise<{
            merged: boolean;
        }>

  • $select:function
    • Parameters

      • id: string

      Returns {
          accept(meta?: HttpMetaParams<"none">): Promise<void>;
          dismiss(meta?: HttpMetaParams<"none">): Promise<void>;
          fetch(meta?: HttpMetaParams<"none">): Promise<NotificationRequest>;
      }

  • accept:function
    • Accepts multiple notification requests, which merges the filtered notifications from those users back into the main notifications and accepts any future notification from them.

      Parameters

      • Optionalmeta: HttpMetaParams<"none">

      Returns Promise<void>

  • dismiss:function
    • Dismiss multiple notification requests, which hides them and prevent them from contributing to the pending notification requests count.

      Parameters

      • Optionalmeta: HttpMetaParams<"none">

      Returns Promise<void>

  • list:function
unreadCount: {
    fetch(params?: mastodon.rest.v1.FetchUnreadCountParams, meta?: HttpMetaParams<"none">): Promise<{
        count: number;
    }>;
}

Type declaration

  • fetch:function
    • Get the (capped) number of unread notification groups for the current user. A notification is considered unread if it is more recent than the notifications read marker. Because the count is dependant on the parameters, it is computed every time and is thus a relatively slow operation (although faster than getting the full corresponding notifications), therefore the number of returned notifications is capped.

      Parameters

      Returns Promise<{
          count: number;
      }>

Methods