/**
 * Notification type definitions.
 * Defines the contract for error, success, warning, and info messages
 * rendered through the centralized notification service.
 */

/** Severity level of a notification. */
export type NotificationIntent = "error" | "success" | "warning" | "info";

/** Unique notification message. */
export interface Notification {
  /** Unique identifier for this notification (auto-generated). */
  id: string;
  /** Severity level. */
  intent: NotificationIntent;
  /** User-facing message text. */
  message: string;
  /** Auto-dismiss after this many milliseconds. Null means manual dismiss only. */
  autoCloseMsec?: number | null;
}

/** Notification service public API. */
export interface NotificationService {
  /**
   * Show a success notification.
   * @param message User-facing message text.
   * @param autoCloseMsec Auto-dismiss after this many ms. Defaults to 5000.
   */
  success(message: string, autoCloseMsec?: number): void;
  /**
   * Show an error notification.
   * @param message User-facing message text.
   * @param autoCloseMsec Auto-dismiss after this many ms. Defaults to 8000.
   */
  error(message: string, autoCloseMsec?: number): void;
  /**
   * Show a warning notification.
   * @param message User-facing message text.
   * @param autoCloseMsec Auto-dismiss after this many ms. Defaults to 6000.
   */
  warning(message: string, autoCloseMsec?: number): void;
  /**
   * Show an info notification.
   * @param message User-facing message text.
   * @param autoCloseMsec Auto-dismiss after this many ms. Defaults to 5000.
   */
  info(message: string, autoCloseMsec?: number): void;
  /**
   * Remove a notification by ID.
   * Called automatically on auto-dismiss; can also be called manually.
   */
  dismiss(id: string): void;
}
