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

    Variable ProfileLoaderConst

    ProfileLoader: {
        loadModularProfile(
            profile: ProfileWithFiles,
            baseUrl: string,
            profileId: string,
            timestamp?: string | number,
            fetchOptions?: LoadUrlOptions,
            skipBundle?: boolean,
        ): Promise<Record<string, unknown>>;
        _loadThemes(
            profile: ProfileWithFiles,
            baseUrl: string,
            timestamp: string | number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown> | null>;
        _loadLayersFile(
            profile: ProfileWithFiles,
            baseUrl: string,
            timestamp: string | number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown> | null>;
        _loadSectionFile(
            profile: ProfileWithFiles,
            fileKey:
                | "modules"
                | "themesFile"
                | "layersFile"
                | "basemapsFile"
                | "uiFile"
                | "featuresFile"
                | "mappingFile",
            baseUrl: string,
            timestamp: string | number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown> | null>;
        _loadModuleFiles(
            profile: ProfileWithFiles,
            baseUrl: string,
            timestamp: string | number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown> | null>;
        _loadLayerConfigs(
            layersSource: LayerRef[],
            baseUrl: string,
            timestamp: string | number,
            fetchOptions: LoadUrlOptions,
        ): Promise<LayerConfigResult[]>;
        _loadBundledProfile(
            profile: ProfileWithFiles,
            baseUrl: string,
            profileId: string,
            bundleFile: string,
            timestamp: string | number,
            fetchOptions: LoadUrlOptions,
        ): Promise<Record<string, unknown>>;
        _recordBundleGaps(
            profile: ProfileWithFiles,
            bundle: Record<string, unknown>,
            expandedLayers: LayerRef[],
            layerConfigsMap: Record<string, Record<string, unknown>>,
            baseUrl: string,
        ): void;
        _processBundle(
            bundle: Record<string, unknown>,
            profile: ProfileWithFiles,
            baseUrl: string,
            profileId: string,
        ): Record<string, unknown>;
        _mergeAndExpand(
            profile: ProfileWithFiles,
            profileId: string,
            parts: {
                basemaps?: Record<string, unknown> | null;
                ui?: Record<string, unknown> | null;
                features?: Record<string, unknown> | null;
                modulesBag?: Record<string, unknown> | null;
                layersFileData: Record<string, unknown> | null;
            },
        ): { mergedProfile: ProfileWithFiles; expandedLayers: LayerRef[] };
        _buildEnrichedProfile(
            params: EnrichedProfileParams,
        ): Record<string, unknown>;
        _validateProfile(profile: Record<string, unknown>, profileId: string): void;
        isModularProfile(profile: unknown): boolean;
    } = ...

    Type Declaration

    • loadModularProfile: function
      • Loads and hydrates a modular GeoLeaf profile by fetching the themes, layers, basemaps, ui, features and mapping files, the per-module files, and the individual layer configs.

        ⚠️ Taxonomy is NOT one of them: it is a module since the removal of 11/07/2026 and travels through Files.modules.taxonomy like any other plugin block. The manifest has no dedicated taxonomy path entry any more, and never had an icons one; icons live under the taxonomy module's own icons.spriteUrl. The retired manifest key is a banned token in extracted-features.guard.test.js — deliberately not spelled out here.

        Parameters

        • profile: ProfileWithFiles

          The base profile object (Files manifest, or inline themes/layers properties).

        • baseUrl: string

          Base URL for resolving relative file paths.

        • profileId: string

          Identifier used for logging and the enriched profile metadata.

        • timestamp: string | number = ...

          Opaque cache token appended to every fetched URL, percent-encoded by the caller. NOT necessarily a date: nominally a content fingerprint, so that the token changes when the profile changes and only then. Defaults to Date.now().

        • fetchOptions: LoadUrlOptions = {}

          Optional fetch configuration (headers, strictContentType).

        • skipBundle: boolean = false

          When true (debug mode), ignores profile.bundleFile and loads the modular cascade — section edits in a deployed profile are picked up without a rebuild.

        Returns Promise<Record<string, unknown>>

        The enriched profile record with resolved themes, mapping, and layer configs.

    • _loadThemes: function
      • Fetches the themes file or returns the inline themes from the profile.

        Parameters

        • profile: ProfileWithFiles

          The profile object.

        • baseUrl: string

          Base URL for resolving the themes file path.

        • timestamp: string | number

          Opaque cache token appended to fetch URLs. Not necessarily a date.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown> | null>

        The themes record, or null if unavailable.

    • _loadLayersFile: function
      • Fetches the layers index file defined in profile.Files.layersFile.

        Parameters

        • profile: ProfileWithFiles

          The profile object.

        • baseUrl: string

          Base URL for resolving the layers file path.

        • timestamp: string | number

          Opaque cache token appended to fetch URLs. Not necessarily a date.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown> | null>

        The layers file record, or null if no layersFile is defined.

    • _loadSectionFile: function
      • Fetches an optional section file referenced in profile.Files (e.g. basemapsFile, uiFile). Returns null when the file is not declared, or when it fails to load — a failure that is then recorded in the profile load report (profile-load-report.ts).

        Parameters

        • profile: ProfileWithFiles

          The profile object.

        • fileKey:
              | "modules"
              | "themesFile"
              | "layersFile"
              | "basemapsFile"
              | "uiFile"
              | "featuresFile"
              | "mappingFile"

          Key in profile.Files pointing to the section file name.

        • baseUrl: string

          Base URL for resolving the file path.

        • timestamp: string | number

          Opaque cache token appended to fetch URLs. Not necessarily a date.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown> | null>

        The section record, or null if unavailable.

    • _loadModuleFiles: function
      • Fetches every plugin config file declared in Files.modules (profile layout v2) and returns the resulting bag { moduleId: config }. Files are fetched in parallel; a missing or invalid file logs a warning, is recorded in the profile load report, and is skipped (the module simply has no file-based config).

        Parameters

        • profile: ProfileWithFiles

          The profile object.

        • baseUrl: string

          Base URL for resolving plugin config file paths.

        • timestamp: string | number

          Opaque cache token appended to fetch URLs. Not necessarily a date.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown> | null>

        The module config bag, or null when Files.modules is absent/empty.

    • _loadLayerConfigs: function
      • Fetches individual layer configuration files for each layer reference. Supports inline configs generated from template expansion (no HTTP fetch).

        Parameters

        • layersSource: LayerRef[]

          Array of layer references with optional configFile or inlineConfig.

        • baseUrl: string

          Base URL for resolving layer config file paths.

        • timestamp: string | number

          Opaque cache token appended to fetch URLs. Not necessarily a date.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<LayerConfigResult[]>

        Array of layer config results with resolved config objects and layer directories.

    • _loadBundledProfile: function
      • Loads and hydrates a profile from a pre-built bundle file, replacing the ~19-request cascade with a single HTTP fetch.

        Called automatically by loadModularProfile() when profile.bundleFile is set. The bundle must have been generated at build time by scripts/lib/bundle-profiles.cjs.

        Parameters

        • profile: ProfileWithFiles

          The base profile object (already loaded from profile.json).

        • baseUrl: string

          Base URL for resolving the bundle file path.

        • profileId: string

          Identifier used for logging and metadata.

        • bundleFile: string

          Filename of the bundle (e.g. "profile-bundle.json").

        • timestamp: string | number

          Opaque cache token appended to the bundle URL, and handed to the cascade if the bundle fails to load.

        • fetchOptions: LoadUrlOptions

          Optional fetch configuration.

        Returns Promise<Record<string, unknown>>

        The enriched profile record, equivalent to the result of loadModularProfile().

    • _recordBundleGaps: function
      • Records every resource the profile DECLARES that the bundle does not carry.

        The bundle compiler skips a declared file it cannot read, without a word (scripts/lib/bundle-profiles.cjs), and _processBundle merges whatever is there — so on the production path a missing section was not even an error. The cascade records its failures where they happen; this is the bundle path's equivalent.

        Parameters

        • profile: ProfileWithFiles

          The base profile (profile.json), which declares the files.

        • bundle: Record<string, unknown>

          The bundle payload.

        • expandedLayers: LayerRef[]

          The layers after template expansion.

        • layerConfigsMap: Record<string, Record<string, unknown>>

          The bundle's layer configurations, by layer id.

        • baseUrl: string

          The profile's base URL, for the reported URLs.

        Returns void

    • _processBundle: function
      • Assembles the enriched profile from an already-fetched bundle payload.

        Parameters

        • bundle: Record<string, unknown>
        • profile: ProfileWithFiles
        • baseUrl: string
        • profileId: string

        Returns Record<string, unknown>

    • _mergeAndExpand: function
      • Shared assembly tail for both load paths: spreads section-file data into the profile, merges the plugin-config bag, validates, then expands layer templates.

        Parameters

        • profile: ProfileWithFiles
        • profileId: string
        • parts: {
              basemaps?: Record<string, unknown> | null;
              ui?: Record<string, unknown> | null;
              features?: Record<string, unknown> | null;
              modulesBag?: Record<string, unknown> | null;
              layersFileData: Record<string, unknown> | null;
          }

        Returns { mergedProfile: ProfileWithFiles; expandedLayers: LayerRef[] }

    • _buildEnrichedProfile: function
      • Assembles the final enriched profile from all fetched sub-resources.

        ⚠️ The keys it sets are exactly: basePath, _profileId, themes, mapping, layers (plus the spread of the base profile). Notably NOT taxonomy and NOT icons — readers expecting either on the active profile get undefined, silently. That was bug C-8 (AddPOI category lists, fixed 16/07): consume the capability (GeoLeaf.Taxonomy.getLayerCategories) or the offline seam (CacheStorage.loadProfileConfig, which hydrates icons from Files.modules.taxonomy). Adding a key here means feeding it too — declaring one the loader never populates is precisely how the sprite went uncached for months (C-7).

        Each layer is its config file plus two keys of its layers.json entry: layerManagerId and, when the entry sets one, label, which overrides the config's. An entry whose config could not be obtained (none declared, or a failed fetch) is returned as the layer itself.

        Parameters

        • params: EnrichedProfileParams

          Object containing the base profile, themes, mapping, layersSource, and layersConfigs.

        Returns Record<string, unknown>

        The enriched profile record with resolved layers, themes, mapping, and metadata.

    • _validateProfile: function
      • Validates a loaded profile object against minimum structural requirements. Logs warnings for each violation — non-blocking, does not throw.

        Checks: required id, map.bounds recommended, Files keys are strings, layers is an array if present.

        Parameters

        • profile: Record<string, unknown>

          The raw profile object to validate.

        • profileId: string

          Identifier used in warning messages.

        Returns void

    • isModularProfile: function
      • Determines whether a profile uses the modular format (has Files object or version ≥ 1.2).

        Parameters

        • profile: unknown

          The profile object to inspect.

        Returns boolean

        true if the profile is modular, false otherwise.