Class GlobalConfig<T>

Type Parameters

Hierarchy

  • GlobalConfig

Constructors

Properties

Methods

Constructors

Properties

configuration: Configuration & Record<PropertyKey, any> = {}

The configuration object.

usedAsReference: (string | number | symbol)[] = ...

Keys marked for not be deeply cloned when setting and returning values.

Methods

  • Get a value from the config.

    Type Parameters

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • key: K
    • Optional defaultVal: T[K]

    Returns T[K]

  • Type Parameters

    Type Parameters

    • D

    Parameters

    • key: PropertyKey
    • Optional defaultVal: D

    Returns D

  • Determine whether a key is set in the config or not.

    Type Parameters

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • key: K

    Returns this is GlobalConfig<WithProperty<T, K>>

  • Set a config value.

    Type Parameters

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • key: K
    • value: T[K]

    Returns asserts this is GlobalConfig<WithProperty<T, K>>

  • Type Parameters

    Type Parameters

    • K extends PropertyKey

    • V

    Parameters

    • key: K
    • value: V

    Returns asserts this is GlobalConfig<T & { [ key in PropertyKey]: V }>

Generated using TypeDoc