GeoLeaf Core API - v3.0.0
    Preparing search index...
    Notifications: {
        notify(
            message: string,
            typeOrOptions?: NotifyType | NotifyOptions,
            duration?: number,
        ): HTMLElement | null | undefined;
        show(
            message: string,
            typeOrOptions?: NotifyType | NotifyOptions,
            duration?: number,
        ): HTMLElement | null | undefined;
        success(
            message: string,
            options?: number | NotifyOptions,
        ): HTMLElement | null | undefined;
        error(
            message: string,
            options?: number | NotifyOptions,
        ): HTMLElement | null | undefined;
        warning(
            message: string,
            options?: number | NotifyOptions,
        ): HTMLElement | null | undefined;
        info(
            message: string,
            options?: number | NotifyOptions,
        ): HTMLElement | null | undefined;
        dismiss(toastEl: HTMLElement): void;
        clearAll(): void;
        getStatus(): NotifyStatus;
    } = ...

    Public Notifications namespace.

    Delegates all calls to the internal _UINotifications singleton (initialized during the toast-renderer capability lifecycle).

    Available 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 HTMLElement | null | undefined

        The toast element (null if rejected, undefined if uninitialised).

    • show: function
      • Displays a notification toast. Alias of Notifications.notify, kept because the renderer, the legacy GeoLeaf.UI.showNotification surface and the plugin documentation all name this method — calling it used to hit undefined and fail silently.

        Parameters

        • message: string

          Text to display.

        • OptionaltypeOrOptions: NotifyType | NotifyOptions

          Notification type or options object.

        • Optionalduration: number

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

        Returns HTMLElement | null | undefined

        The toast element (null if rejected, undefined if uninitialised).

        GeoLeaf.Notifications.show("Feature is stale", { type: "warning" });
        
    • success: function
      • Displays a success toast.

        Parameters

        • message: string

          Text to display.

        • Optionaloptions: number | NotifyOptions

          Optional duration (ms) or options object.

        Returns HTMLElement | null | undefined

        The toast element (null if rejected, undefined if uninitialised).

        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 HTMLElement | null | undefined

        The toast element (null if rejected, undefined if uninitialised).

        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 HTMLElement | null | undefined

        The toast element (null if rejected, undefined if uninitialised).

        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 HTMLElement | null | undefined

        The toast element (null if rejected, undefined if uninitialised).

        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.info("Chargement…", { persistent: true });
        // later:
        if (toast) Notifications.dismiss(toast);
    • clearAll: function
    • getStatus: function