import type { ObjectWithKeysFromStringArray } from '../../helper/types/ObjectWithKeysFromStringArray.js'; import type { EmptyObject } from '../types/EmptyObject.js'; import type { Logger } from '../types/Logger.js'; import type { StoreBaseConfig } from '../types/StoreBaseConfig.js'; import type { ConfigStoreCacheMap } from './types/ConfigStoreCacheMap.js'; /** * Base class for config store adapters. * * The base class enforces operation toggles before delegating to adapter * implementations. Adapter authors should implement only the protected `*Impl` * methods so capability checks, safe logging, and common error behavior stay * consistent. * * The actual store implementation must overwrite the protected methods: * * - `getConfigImpl` * - `setConfigImpl` * - `removeConfigImpl` * * __DO NOT OVERWRITE__: the regular methods getConfig, setConfig or removeConfig * * @group Store */ export declare abstract class ConfigStoreBaseClass = EmptyObject> { /** Child logger scoped to the store name. */ logger: Logger; /** Store configuration including operation toggles and cache settings. */ config: StoreBaseConfig; /** Store name used in logs and diagnostics. */ name: string; /** Optional local cache used by store implementations that opt in. */ cache: ConfigStoreCacheMap; constructor(name: string, config: StoreBaseConfig); /** * This method must be overwritten by actual store implementation. * * @param configNames list of config items * @returns an object of { [configName]: value | undefined } */ protected abstract getConfigImpl(...configNames: ConfigNames): Promise>; /** * Returns the values for given config properties. * * Values may contain sensitive configuration. Avoid logging returned values * unless an application policy explicitly allows the exact fields. * * This function **SHOULD NOT** be overwritten by store implementation. * For implementation overwrite protected `getConfigImpl` * * @param configNames * @returns an object of { [configName]: value | undefined } */ getConfig(...configNames: ConfigNames): Promise>; /** * This method must be overwritten by actual store implementation. * * @param configName */ protected abstract removeConfigImpl(configName: string): Promise; /** * Removes the config item given by config name. * * This function **SHOULD NOT** be overwritten by store implementation. * For implementation overwrite protected `removeConfigImpl` * * @param configName * @returns */ removeConfig(configName: string): Promise; /** * This method must be overwritten by actual store implementation. * * @param _configName * @param _configValue */ protected abstract setConfigImpl(_configName: string, _configValue: unknown): Promise; /** * Sets a config value. * * Values are passed directly to the adapter. Do not emit raw values in * adapter logs, metrics, or traces. * * This function **SHOULD NOT** be overwritten by store implementation. * For implementation overwrite protected `setConfigImpl` * * @param configName * @param configValue * @returns */ setConfig(configName: string, configValue: unknown): Promise; /** Shutdown hook for store adapters. */ destroy(): Promise; } //# sourceMappingURL=ConfigStoreBaseClass.impl.d.ts.map