import { EventEmitter } from "node:events";
import type { Notification } from "./notifications-db";

export type { Notification } from "./notifications-db";
export { createNotification, getNotifications, markRead, markDismissed, markAllRead } from "./notifications-db";

class NotificationEventEmitter extends EventEmitter {
  emitNew(notification: Notification): void {
    this.emit("notification", notification);
  }
}

export const notificationEmitter = new NotificationEventEmitter();
