interface IWatchDetails<T> {
    cfg: T;
    rdOnly: (<C, V>(target: C, name: string) => V);
    ref: (<C, V>(target: C, name: string) => V);
    set: (<C, V>(theConfig: C, name: string, value: V) => V);
    setDf: (<C>(theConfig: C, defaultValues: IConfigDefaults<C, IConfiguration>) => C);
}

Type Parameters

Properties

Properties

cfg: T

The current config object

rdOnly: (<C, V>(target: C, name: string) => V)

Set this named property of the target as read-only, which will block this single named property from ever being changed for the target instance. This does NOT freeze or seal the instance, it just stops the direct re-assignment of the named property, if the value is a non-primitive (ie. an object or array) it's properties will still be mutable.

Type declaration

    • <C, V>(target, name): V
    • Type Parameters

      • C
      • V = any

      Parameters

      • target: C
      • name: string

      Returns V

      The referenced properties current value

ref: (<C, V>(target: C, name: string) => V)

Set this named property of the target as referenced, which will cause any object or array instance to be updated in-place rather than being entirely replaced. All other values will continue to be replaced.

Type declaration

    • <C, V>(target, name): V
    • Type Parameters

      • C
      • V = any

      Parameters

      • target: C
      • name: string

      Returns V

      The referenced properties current value

set: (<C, V>(theConfig: C, name: string, value: V) => V)

Set the value against the provided config/name with the value, the property will be converted to be dynamic (if not already) as long as the provided config is already a tracked dynamic object.

TypeError if the provided config is not a monitored dynamic config

setDf: (<C>(theConfig: C, defaultValues: IConfigDefaults<C, IConfiguration>) => C)

Set default values for the config if not present.

Type declaration

    • <C>(theConfig, defaultValues): C
    • Type Parameters

      • C

      Parameters

      • theConfig: C

        The configuration object to set default on (if missing)

      • defaultValues: IConfigDefaults<C, IConfiguration>

        The default values to apply to the config

      Returns C