Skip to content

core/configurations

Documentation

Overview

Classes

Configurations

get()

Retrieves the configuration value associated with the given key.

ts
static get(key: string, defaultValue: string): string;
ParameterTypeDescription
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.

ts
static set(key: string, value: string): void;
ParameterTypeDescription
keystringThe configuration key.
valuestringThe configuration value to set.

Returns

  • Type: void
  • Description:

remove()

Removes the configuration property associated with the given key.

ts
static remove(key: string): void;
ParameterTypeDescription
keystringThe configuration key to remove.

Returns

  • Type: void
  • Description:

getKeys()

Retrieves a list of all current configuration keys.

ts
static 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.

ts
static load(path: string): void;
ParameterTypeDescription
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).

ts
static update(): void;

Returns

  • Type: void
  • Description:

getOS()

Retrieves the name of the current Operating System.

ts
static 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.

ts
static 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).

ts
static 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).

ts
static 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.

ts
static isOSSolaris(): boolean;

Returns

  • Type: boolean
  • Description: True if the OS is Solaris, false otherwise.