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 is tracked as B-13.
OptionaldefaultValue: unknownFetches a JSON configuration and applies it.
Failure is contained, not thrown: an unreachable URL or invalid JSON is logged and the
configuration already in place is returned, so a bad fetch degrades the map rather than
breaking its boot. strictContentType rejects a response that is not application/json.
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.