Optional_Loads the configuration and brings the sub-modules up.
Three paths, in this order of precedence: an inline config is applied synchronously; a
url is fetched; neither yields an empty configuration rather than an error — a map can
boot with defaults. onLoaded fires on all three, and the DOM event only when
autoEvent is left on.
Optionaloptions: ConfigInitOptionsThe complete configuration currently loaded.
⚠️ Through the ambient global, this returns a loose record: GeoLeafGlobal.Config is
hand-typed and declares getAll(): Record<string, unknown>, not GeoLeafConfig.
To read a field with its real type, use ConfigFacade.get — which is generic — or
import Config from @geoleaf/core/kernel. Typing the ambient member from this
interface only ever shrinks — never widened back.
Writes one field by dotted path, creating the intermediate objects.
⚠️ Before boot(), a value set here is not final. The boot then loads the application
configuration, which is merged over it key by key. Then it loads the active profile. A
modular profile (the kind the repository ships) REPLACES, whole, each top-level section
it carries (ui among them). Two exceptions: layers, themes and mapping stay on
the profile, and the modules bag is merged module by module. So a value that the
profile also declares does not survive the boot.
To override a value that the profile declares, call set from the beforeBoot hook.
It runs after both loads, and before any module reads the configuration.
OptionaldefaultValue: unknownFetches a JSON configuration and applies it.
🔻 Failure REJECTS, since 20/08/2026 — and this sentence said the exact opposite.
It read « Failure is contained, not thrown: […] a bad fetch degrades the map rather than
breaking its boot ». That was true until the loader's catch was changed to re-throw, and
the sentence was not updated with it: for a few hours a published .d.ts promised an
integrator the inverse of what the runtime did. No gate can catch that — nothing checks
whether a sentence is still true.
An unreachable URL, invalid JSON, or a response that is not application/json when
strictContentType is set: the cause is logged, then the promise REJECTS. The boot stops
instead of continuing on an empty configuration and rendering a blank map under a
"Configuration loaded successfully" message.
⚠️ Breaking for a caller that relied on the degradation — even without knowing it.
If the configuration is already in memory, GeoLeaf.boot({ config }) removes the request
entirely and the question does not arise.
Optionaloptions: LoadUrlOptionsOptionaloptions: { headers?: Record<string, string>; strictContentType?: boolean }
The COMPLETE
GeoLeaf.Configfaçade — single source of truth for its shape.⚠️ The singleton is assembled in two stages, which is why this type exists.
config-core.tsbuilds an object literal carrying only the lifecycle core; three sibling modules then graft the rest onto it at import time, as side effects (globals.config.tsimports them for that purpose alone):config-accessors.tsgetAllgetgetModuleConfigsetgetSectiongetActiveProfile*isProfilePoiMappingEnabledconfig-loaders.tsloadUrlloadActiveProfileResourcesconfig-validation.ts_validateConfigBefore S5 each grafting module redeclared its own partial interface and reached the singleton through an
as unknown ascast — four declarations that ignored one another, two of them redeclaring_config, and no type anywhere describing a completeConfig. They now all target this one. The single remaining widening cast lives inconfig-core.ts, where the two-stage assembly actually happens.