UNPKG

@creditkarma/dynamic-config

Version:

Dynamic Config for Node.js backed by Consul and Vault

14 lines (13 loc) 1.38 kB
import { BaseConfigValue, ConfigValue, IConfigPlaceholder, IConfigTranslator, INamedResolvers, IResolvedPlaceholder, IRootConfigValue, ITranslator, KeyPath, ObjectType } from '../types'; import { DynamicConfigError, IConfigErrorMap } from '../errors'; export declare const emptyRootConfig: () => IRootConfigValue; export declare function getErrorForKey(key: string | undefined, errorMap: IConfigErrorMap): Error | undefined; export declare function setErrorForKey(key: string, error: DynamicConfigError, errorMap: IConfigErrorMap): IConfigErrorMap; export declare function makeTranslator(translators: Array<IConfigTranslator>): ITranslator; export declare function readValueForType(key: string, raw: string, type: ObjectType): Promise<any>; export declare function normalizeConfigPlaceholder(path: KeyPath, placeholder: IConfigPlaceholder, resolvers: INamedResolvers): IResolvedPlaceholder; export declare function isValidRemote(name: string, resolvers: Set<string>): boolean; export declare function isConfigPlaceholder(obj: any): obj is IConfigPlaceholder; export declare function setValueForKey<T extends ConfigValue>(key: string, newValue: BaseConfigValue, oldConfig: T, alertWatchers?: boolean): T; export declare function readConfigValue(obj: ConfigValue | null): any; export declare function getConfigForKey(key: string, obj: IRootConfigValue): BaseConfigValue | null;