ConfigManager
Defined in: packages/engine/src/constants/Configuration.ts:351
Configuration manager for engine settings
Example
Section titled “Example”const configManager = new ConfigManager();configManager.set('performance.defaultCacheSize', 2000);const cacheSize = configManager.get('performance.defaultCacheSize');Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ConfigManager(config?): ConfigManager;Defined in: packages/engine/src/constants/Configuration.ts:354
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config | Partial<EngineConfig> |
Returns
Section titled “Returns”ConfigManager
Methods
Section titled “Methods”get<T>(path): T;Defined in: packages/engine/src/constants/Configuration.ts:364
Get configuration value by path
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
path | string | Dot-notation path to config value |
Returns
Section titled “Returns”T
Configuration value
getConfig()
Section titled “getConfig()”getConfig(): EngineConfig;Defined in: packages/engine/src/constants/Configuration.ts:430
Get complete configuration.
A detached copy, section objects included. A top-level spread would hand
the caller this manager’s own section objects, so getConfig().vm.x = 1
would be an undeclared back door into set, bypassing its path
validation and reaching every later get.
Returns
Section titled “Returns”reset()
Section titled “reset()”reset(): void;Defined in: packages/engine/src/constants/Configuration.ts:453
Reset to default configuration.
Goes through mergeEngineConfig for the same reason the constructor
does. A top-level { ...DEFAULT_CONFIG } copies the six section
references, not the sections, so after a reset this manager’s
performance object WAS DEFAULT_CONFIG.performance and the next
set('performance.x', ...) wrote into the module constant. That constant
is what every ExpressionEngine is built from, so one manager’s reset
could change the cache size, instruction ceiling or allocation budget of
every engine constructed later in the process.
Returns
Section titled “Returns”void
set<T>(path, value): void;Defined in: packages/engine/src/constants/Configuration.ts:389
Set configuration value by path
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
path | string | Dot-notation path to config value |
value | T | New value |
Returns
Section titled “Returns”void
update()
Section titled “update()”update(config): void;Defined in: packages/engine/src/constants/Configuration.ts:437
Update multiple configuration values
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config | Partial<EngineConfig> |
Returns
Section titled “Returns”void
validate()
Section titled “validate()”validate(): ValidationResult;Defined in: packages/engine/src/constants/Configuration.ts:460
Validate configuration values