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
Name | Type |
---|---|
ConfigStoreConfigType | extends Record <string , unknown > = {} |
Hierarchy
ConfigStoreBaseClass
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new ConfigStoreBaseClass<ConfigStoreConfigType
>(name
, config
): ConfigStoreBaseClass
<ConfigStoreConfigType
>
Type parameters
Name | Type |
---|---|
ConfigStoreConfigType | extends Record <string , unknown > = {} |
Parameters
Name | Type |
---|---|
name | string |
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
Name | Type |
---|---|
ConfigNames | extends string [] |
Parameters
Name | Type |
---|---|
...configNames | ConfigNames |
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
Name | Type |
---|---|
ConfigNames | extends string [] |
Parameters
Name | Type | Description |
---|---|---|
...configNames | ConfigNames | list 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
Name | Type |
---|---|
configName | string |
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
Name | Type |
---|---|
configName | string |
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
Name | Type |
---|---|
configName | string |
configValue | unknown |
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
Name | Type |
---|---|
_configName | string |
_configValue | unknown |
Returns
Promise
<void
>