GeoLeaf Core API - v3.0.0
    Preparing search index...

    Interface GeoLeafUIFacade

    GeoLeaf.UI — the kernel UI façade (API publique S4.2, lot B).

    kernel/ui/ui-api.ts:304 fait const UI = _g.GeoLeaf.UI; puis le ré-exporte : la valeur exportée EST le membre du namespace. Un typeof import("./api/geoleaf.ui.js").UI est donc structurellement circulaire — mesuré, tsc sort TS7022 puis TS2303. C'est très probablement la raison pour laquelle ce membre était déclaré Record<string, unknown> : la forme facile ne compile pas.

    Ce n'est pas une raison de ne rien typer. La façade est montée par mutation depuis ~10 modules ; les 24 membres ci-dessous sont relevés sur les sites d'affectation réels, et l'interface nommée rompt le cycle en ne dépendant d'aucune valeur.

    ⚠️ Le motif qui la justifiait ici était faux. Il disait « boot-core.ts et init-features.ts posent encore des membres hors de cette liste ». Mesuré : ces deux fichiers ne posent aucun membre sur GeoLeaf.UI — leurs seules occurrences de ui. sont des lectures de config (init-features.ts:227,246). Les 6 membres qui manquaient réellement venaient de globals/globals.ui.ts et du plugin offline-ui ; ils sont déclarés ci-dessous, relevés sur leurs sites d'affectation.

    Ce que la traîne coûtait. Elle rendait unknown — donc indiscernable d'un membre réel non typé — tout membre inventé. GeoLeaf.UI.toggleFilterPanel(true) était enseigné par l'@example de api/geoleaf.ui.ts alors que cet identifiant n'a jamais existé dans le dépôt, et les trois gates de documentation sortaient vertes dessus. B-80 l'avait mesuré le 31/07/2026 (mutation GeoLeaf.UI.cetteApiNExistePas("dark")VERTE) et conclu « le bénéfice réel de B-80 croît avec B-13, et pas autrement ». Traîne ôtée, un membre fantôme rend TS2339, que typecheck-docs-examples.cjs connaît.

    Aucun site d'affectation ne casse : globals.ui.ts:138 écrit à travers _gl.UI as Record<string, unknown>, cache-button.ts:43 par son propre cast, et ui.module.ts:119 lit par le helper dynamique member(obj: unknown, …).

    interface GeoLeafUIFacade {
        VERSION?: string;
        BUILD?: string;
        init?: (
            options?: {
                map?: unknown;
                mapContainer?: HTMLElement;
                filterContainer?: HTMLElement;
                buttonSelector?: string;
                autoInitOnDomReady?: boolean;
                enableEventDelegation?: boolean;
                config?: unknown;
            },
        ) => unknown;
        cleanup?: () => void;
        getModuleStatus?: () => unknown;
        applyTheme?: (...args: unknown[]) => unknown;
        setTheme?: (...args: unknown[]) => unknown;
        getCurrentTheme?: () => string;
        initAutoTheme?: (...args: unknown[]) => unknown;
        initThemeToggle?: (...args: unknown[]) => unknown;
        toggleTheme?: (...args: unknown[]) => unknown;
        Notifications?: Record<string, unknown>;
        showNotification?: (...args: unknown[]) => unknown;
        showSuccess?: (...args: unknown[]) => unknown;
        showError?: (...args: unknown[]) => unknown;
        showWarning?: (...args: unknown[]) => unknown;
        showInfo?: (...args: unknown[]) => unknown;
        clearNotifications?: (...args: unknown[]) => unknown;
        notify?: {
            info?: (
                msg: string,
                opts?: number | Record<string, unknown>,
            ) => unknown;
            warn?: (msg: string, opts?: number | Record<string, unknown>) => unknown;
            error?: (msg: string, opts?: number | Record<string, unknown>) => unknown;
            success?: (
                msg: string,
                opts?: number | Record<string, unknown>,
            ) => unknown;
            dismiss?: (id: HTMLElement) => unknown;
        };
        initMobileToolbar?: (options: MobileToolbarOptions) => void;
        initDesktopPanel?: (options: DesktopPanelOptions) => void;
        activateDesktopPanel?: () => void;
        destroyDesktopPanel?: () => void;
        CacheButton?: {
            init?: (map: unknown, cfg: Record<string, unknown>) => unknown;
            openModal?: () => unknown;
            closeModal?: () => unknown;
            Modules?: Record<string, unknown>;
        };
    }
    Index

    Properties

    VERSION?: string

    Orchestrator version tag, set by ui-api.ts:296.

    BUILD?: string

    Build tag, set by ui-api.ts:297.

    init?: (
        options?: {
            map?: unknown;
            mapContainer?: HTMLElement;
            filterContainer?: HTMLElement;
            buttonSelector?: string;
            autoInitOnDomReady?: boolean;
            enableEventDelegation?: boolean;
            config?: unknown;
        },
    ) => unknown

    Boots the UI kernel (delegation, theme, containers).

    cleanup?: () => void

    Tears listeners down and resets the delegation flag.

    getModuleStatus?: () => unknown

    Availability report for the UI sub-modules.

    applyTheme?: (...args: unknown[]) => unknown

    Applies a theme by name.

    Sets the theme classes on <body> and #geoleaf-map, then dispatches geoleaf:ui-theme-changed. ⚠️ Always prefer this over touching the CSS classes directly — a manual classList.add("gl-theme-dark") skips the event, so anything listening for the change never learns of it.

    GeoLeaf.UI.applyTheme("dark");
    
    setTheme?: (...args: unknown[]) => unknown

    Alias of GeoLeafUIFacade.applyTheme — the SAME reference, by design.

    getCurrentTheme?: () => string

    The theme currently applied.

    const theme = GeoLeaf.UI.getCurrentTheme(); // "dark"
    
    initAutoTheme?: (...args: unknown[]) => unknown

    Applies the theme declared in the profile configuration. Called during boot.

    initThemeToggle?: (...args: unknown[]) => unknown

    Wires a theme-toggle button, located by the configured buttonSelector.

    toggleTheme?: (...args: unknown[]) => unknown

    Switches to the other theme and applies it.

    GeoLeaf.UI.toggleTheme(); // passe à "light"
    
    Notifications?: Record<string, unknown>

    The notification renderer, reachable through the UI façade.

    ⚠️ Typed Record<string, unknown>, so nothing here is arity-checked — the real surface is the one documented on NotificationSystem. Tracked as B-13.

    GeoLeaf.UI.Notifications.success("Données chargées !");
    GeoLeaf.UI.Notifications.error("Erreur réseau", 8000);
    showNotification?: (...args: unknown[]) => unknown

    Shows a toast of an explicit type. Bound form of Notifications.show.

    showSuccess?: (...args: unknown[]) => unknown

    Shows a success toast. Bound form of Notifications.success.

    showError?: (...args: unknown[]) => unknown

    Shows an error toast. Bound form of Notifications.error.

    showWarning?: (...args: unknown[]) => unknown

    Shows a warning toast. Bound form of Notifications.warning.

    showInfo?: (...args: unknown[]) => unknown

    Shows an informational toast. Bound form of Notifications.info.

    clearNotifications?: (...args: unknown[]) => unknown

    Dismisses every visible toast and empties the queue.

    notify?: {
        info?: (msg: string, opts?: number | Record<string, unknown>) => unknown;
        warn?: (msg: string, opts?: number | Record<string, unknown>) => unknown;
        error?: (msg: string, opts?: number | Record<string, unknown>) => unknown;
        success?: (msg: string, opts?: number | Record<string, unknown>) => unknown;
        dismiss?: (id: HTMLElement) => unknown;
    }

    Rich toast surface — the KERNEL one, mounted by globals/globals.ui.ts:151.

    Distinct from GeoLeafUIFacade.Notifications: notify is the anchor-B2 adapter that reads the renderer back lazily, so a build without the toast-renderer capability degrades to a silent no-op instead of throwing.

    ⚠️ Chaîner l'optionnel n'est pas de la coquetterie ici : sans écrivain, le membre est absent, et GeoLeaf.UI.notify.success(…) jette. C'est aussi ce qui évite d'ajouter une entrée de baseline à typecheck-docs-examples (B-202).

    GeoLeaf.UI.notify?.success?.("Couche enregistrée");
    
    initMobileToolbar?: (options: MobileToolbarOptions) => void

    Mounts the mobile toolbar. Set by globals/globals.ui.ts:207.

    Type Declaration

      • (options: MobileToolbarOptions): void
      • Initializes the mobile utility pill toolbar and sheet modal. Must be called after the map and .gl-main DOM are ready.

        Parameters

        Returns void

    initDesktopPanel?: (options: DesktopPanelOptions) => void

    Mounts the desktop side-panel. Set by globals/globals.ui.ts:208.

    Type Declaration

      • (options: DesktopPanelOptions): void
      • Builds the side panel DOM (>= 1440px). Does NOT move any element in — call activateDesktopPanel() afterwards.

        Parameters

        • options: DesktopPanelOptions

        Returns void

    activateDesktopPanel?: () => void

    Reveals the desktop side-panel. Set by globals/globals.ui.ts:209.

    Type Declaration

      • (): void
      • Moves the elements (filters, layers, legend) into the panels. A appeler APRES Legend.init(), LayerManager.init().

        Returns void

    destroyDesktopPanel?: () => void

    Tears the desktop side-panel down. Set by globals/globals.ui.ts:210.

    Type Declaration

      • (): void
      • Destroys the side panel and restores the elements to their original place.

        Returns void

    CacheButton?: {
        init?: (map: unknown, cfg: Record<string, unknown>) => unknown;
        openModal?: () => unknown;
        closeModal?: () => unknown;
        Modules?: Record<string, unknown>;
    }

    Offline cache button — mounted by the offline-ui PLUGIN (ui/cache-button.ts:43), read by app/boot-modules/ui.module.ts:119.

    ⚠️ Typé STRUCTURELLEMENT à dessein. La règle no-plugin-in-core (scripts/verify-core-standalone.cjs) interdit au core de nommer @geoleaf-plugins/* : un typeof import(...) est indisponible ici, et ce n'est pas un raccourci mais la frontière d'architecture. Le membre reste optionnel — un build sans le plugin n'a pas d'écrivain.