core/configurations
Documentation
- source: core/configurations.ts
Overview
Classes
Configurations
get()
Retrieves the configuration value associated with the given key.
tsstatic get(key: string, defaultValue: string): string;
Parameter Type Description keystringThe configuration key. defaultValuestringThe optional default value to return if the key is not found. Returns
- Type:
string- Description: The configuration value as a string, or `undefined` if the key is not found and no default is provided.
set()
Sets the configuration value for the given key. If the key already exists, its value is overwritten.
tsstatic set(key: string, value: string): void;
Parameter Type Description keystringThe configuration key. valuestringThe configuration value to set. Returns
- Type:
void- Description:
remove()
Removes the configuration property associated with the given key.
tsstatic remove(key: string): void;
Parameter Type Description keystringThe configuration key to remove. Returns
- Type:
void- Description:
getKeys()
Retrieves a list of all current configuration keys.
tsstatic getKeys(): void;Returns
- Type:
void- Description: An array of configuration keys (strings).
load()
Loads configuration properties from a file at the specified path, overriding existing ones.
tsstatic load(path: string): void;
Parameter Type Description pathstringThe file path to load configurations from. Returns
- Type:
void- Description:
update()
Reloads or updates the current configuration settings from their source (e.g., persistence layer).
tsstatic update(): void;Returns
- Type:
void- Description:
getOS()
Retrieves the name of the current Operating System.
tsstatic getOS(): string;Returns
- Type:
string- Description: The OS name as a string (e.g., "Windows", "Linux", "Mac OS X").
isOSWindows()
Checks if the current Operating System is Windows.
tsstatic isOSWindows(): boolean;Returns
- Type:
boolean- Description: True if the OS is Windows, false otherwise.
isOSMac()
Checks if the current Operating System is Mac OS (or Mac OS X).
tsstatic isOSMac(): boolean;Returns
- Type:
boolean- Description: True if the OS is Mac, false otherwise.
isOSUNIX()
Checks if the current Operating System is a UNIX-like system (e.g., Linux, macOS, or others).
tsstatic isOSUNIX(): boolean;Returns
- Type:
boolean- Description: True if the OS is a UNIX variant, false otherwise.
isOSSolaris()
Checks if the current Operating System is Solaris.
tsstatic isOSSolaris(): boolean;Returns
- Type:
boolean- Description: True if the OS is Solaris, false otherwise.
