UNPKG

@magicbell/core

Version:

Official MagicBell API wrapper

30 lines (29 loc) 920 B
import RemoteRepository from '../../repository/RemoteRepository.js'; import IRemoteNotification from './IRemoteNotification.js'; import { NewNotification } from './NewNotification.js'; /** * Class to interact with the notification API endpoints. * * @example * const repo = new NotificationRepository(); * const notifications = repo.findBy({ unseen: true }); */ export default class NotificationRepository extends RemoteRepository<IRemoteNotification, NewNotification> { constructor(remotePathOrUrl?: string); /** * Mark a notification as read in the API server. */ markAsRead(id: string): Promise<boolean>; /** * Mark a notification as unread in the API server. */ markAsUnread(id: string): Promise<boolean>; /** * Mark all notifications as seen. */ markAllAsSeen(): any; /** * Mark all notifications as read. */ markAllAsRead(): any; }