import mitt from "mitt"; type NotifyEvents = { notification: UpNotification; }; export type NotificationLevel = "info" | "error"; export interface INotification { id: string; content: string; level: NotificationLevel; } export class UpNotification implements INotification { id: string; content: string; level: NotificationLevel; constructor(content: string, level?: NotificationLevel) { this.id = String(Math.random()); this.content = content; this.level = level || "info"; } } export const notify = mitt();