Skip to content

PURISTA API / Modules / @purista/core / ConfigStoreBaseClass

Class: ConfigStoreBaseClass<ConfigStoreConfigType>

@purista/core.ConfigStoreBaseClass

Base class for config store adapters. The actual store implementation must overwrite the protected methods:

  • getConfigImpl
  • setConfigImpl
  • removeConfigImpl

DO NOT OVERWRITE: the regular methods getConfig, setConfig or removeConfig

Type parameters

NameType
ConfigStoreConfigTypeextends Record<string, unknown> = {}

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ConfigStoreBaseClass<ConfigStoreConfigType>(name, config): ConfigStoreBaseClass<ConfigStoreConfigType>

Type parameters

NameType
ConfigStoreConfigTypeextends Record<string, unknown> = {}

Parameters

NameType
namestring
config{ [K in string | number | symbol]: (Object & ConfigStoreConfigType)[K] }

Returns

ConfigStoreBaseClass<ConfigStoreConfigType>

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:28

Properties

cache

cache: ConfigStoreCacheMap

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:26


config

config: { [K in string | number | symbol]: (Object & ConfigStoreConfigType)[K] }

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:22


logger

logger: Logger

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:21


name

name: string

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:24

Methods

destroy

destroy(): Promise<void>

Returns

Promise<void>

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:126


getConfig

getConfig<ConfigNames>(...configNames): Promise<ObjectWithKeysFromStringArray<ConfigNames>>

Returns the values for given config properties. This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected getConfigImpl

Type parameters

NameType
ConfigNamesextends string[]

Parameters

NameType
...configNamesConfigNames

Returns

Promise<ObjectWithKeysFromStringArray<ConfigNames>>

an object of

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:62


getConfigImpl

getConfigImpl<ConfigNames>(...configNames): Promise<ObjectWithKeysFromStringArray<ConfigNames>>

This method must be overwritten by actual store implementation.

Type parameters

NameType
ConfigNamesextends string[]

Parameters

NameTypeDescription
...configNamesConfigNameslist of config items

Returns

Promise<ObjectWithKeysFromStringArray<ConfigNames>>

an object of

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:49


removeConfig

removeConfig(configName): Promise<void>

Removes the config item given by config name. This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected removeConfigImpl

Parameters

NameType
configNamestring

Returns

Promise<void>

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:89


removeConfigImpl

removeConfigImpl(configName): Promise<void>

This method must be overwritten by actual store implementation.

Parameters

NameType
configNamestring

Returns

Promise<void>

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:79


setConfig

setConfig(configName, configValue): Promise<void>

Sets a config value This function SHOULD NOT be overwritten by store implementation. For implementation overwrite protected setConfigImpl

Parameters

NameType
configNamestring
configValueunknown

Returns

Promise<void>

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:116


setConfigImpl

setConfigImpl(_configName, _configValue): Promise<void>

This method must be overwritten by actual store implementation.

Parameters

NameType
_configNamestring
_configValueunknown

Returns

Promise<void>

Defined in

core/ConfigStore/ConfigStoreBaseClass.impl.ts:105