/** * Available configuration sources */ export declare const ConfigSource: { readonly env: "env"; readonly db: "db"; }; export type ConfigSource = (typeof ConfigSource)[keyof typeof ConfigSource]; /** * Metadata for a configuration value */ export interface ConfigDefinition { defaultValue: T; envVarName?: string; isSecret?: boolean; } /** * Helper function for defining configurations with type safety */ export declare const defineConfig: (config: ConfigDefinition) => ConfigDefinition; /** * Interface for loading configuration values */ export interface IConfigLoader> { /** * Load configurations from environment variables */ loadFromEnv(): Promise>; /** * Load configurations from database */ loadFromDB(): Promise>; } export type RawConfigData> = Record; }>; export type UpdateConfigOptions = { skipPubsub?: boolean; removeIfUndefined?: boolean; }; /** * Interface for managing configuration values */ export interface IConfigManager> { /** * Load configurations * @param options.source - Specify which source to load from */ loadConfigs(options?: { source?: ConfigSource; }): Promise; /** * Get a configuration value */ getConfig(key: T, source?: ConfigSource): V[T]; /** * Update a configuration value */ updateConfig(key: T, value: V[T], options?: UpdateConfigOptions): Promise; /** * Update multiple configuration values */ updateConfigs(updates: Partial<{ [T in K]: V[T]; }>, options?: UpdateConfigOptions): Promise; /** * Remove multiple configuration values */ removeConfigs(keys: K[], options?: UpdateConfigOptions): Promise; /** * Get environment variables managed with ConfigDefinitions */ getManagedEnvVars(showSecretValues: boolean): Record; }