Notifications: {
    notify(message: string, typeOrOptions?: NotifyType | NotifyOptions, duration?: number): void;
    success(message: string, options?: number | NotifyOptions): void;
    error(message: string, options?: number | NotifyOptions): void;
    warning(message: string, options?: number | NotifyOptions): void;
    info(message: string, options?: number | NotifyOptions): void;
    dismiss(toastEl: HTMLElement): void;
    clearAll(): void;
    getStatus(): NotifyStatus;
} = ...

Public Notifications namespace.

Delegates all calls to the internal _UINotifications singleton (initialized during the GeoLeaf boot sequence).

Available as GeoLeaf.Notifications after the core is initialized, and as a named ESM export { Notifications } from @geoleaf/core.

Type declaration

  • notify:function
    • Displays a notification toast.

      Supports two call signatures:

      • notify(message, type, duration) — positional, e.g. notify("OK", "success", 3000)
      • notify(message, options) — options object, e.g. notify("OK", { type: "success", duration: 3000 })

      Parameters

      • message: string

        Text to display.

      • OptionaltypeOrOptions: NotifyType | NotifyOptions

        Notification type ("info" | "success" | "warning" | "error") or options object.

      • Optionalduration: number

        Auto-dismiss duration in ms (only when typeOrOptions is a string).

      Returns void

  • success:function
    • Displays a success toast.

      Parameters

      • message: string

        Text to display.

      • Optionaloptions: number | NotifyOptions

        Optional duration (ms) or options object.

      Returns void

      Notifications.success("Sauvegarde réussie");
      Notifications.success("Sauvegarde réussie", { duration: 2000 });
  • error:function
    • Displays an error toast (highest priority, longest default duration: 5 s).

      Parameters

      • message: string

        Text to display.

      • Optionaloptions: number | NotifyOptions

        Optional duration (ms) or options object.

      Returns void

      Notifications.error("Erreur réseau", { persistent: true, dismissible: true });
      
  • warning:function
    • Displays a warning toast.

      Parameters

      • message: string

        Text to display.

      • Optionaloptions: number | NotifyOptions

        Optional duration (ms) or options object.

      Returns void

      Notifications.warning("Connexion instable", { duration: 6000 });
      
  • info:function
    • Displays an informational toast.

      Parameters

      • message: string

        Text to display.

      • Optionaloptions: number | NotifyOptions

        Optional duration (ms) or options object.

      Returns void

      Notifications.info("3 nouvelles alertes disponibles");
      
  • dismiss:function
    • Dismisses a specific toast by its DOM element reference.

      Parameters

      • toastEl: HTMLElement

        The toast HTMLElement returned by a previous call.

      Returns void

      const toast = Notifications.notify("Chargement…", "info", { persistent: true });
      // later:
      Notifications.dismiss(toast);
  • clearAll:function
  • getStatus:function
    • Returns a snapshot of the current notification system state. Useful for debugging or building custom status indicators.

      Returns NotifyStatus

      Current system status.

      const status = Notifications.getStatus();
      console.log(status.activeToasts, status.queued);