interface CompositeConfigProviderOptions<T = unknown> {
    schema?: ConfigSchema<T>;
    cache?: boolean;
    cacheTTL?: number;
    prefix?: string;
    watch?: boolean;
    transformers?: Record<string, (value: string) => unknown>;
    providers: ConfigProvider[];
    strategy?: MergeStrategy;
}

Type Parameters

  • T = unknown

Hierarchy

  • ConfigProviderOptions<T>
    • CompositeConfigProviderOptions

Properties

schema?: ConfigSchema<T>

Validation schema (optional)

cache?: boolean

Cache configuration values

true
cacheTTL?: number

Cache TTL in milliseconds

undefined (no expiration)
prefix?: string

Prefix for all keys

watch?: boolean

Enable hot reload (if supported)

false
transformers?: Record<string, (value: string) => unknown>

Transformation functions for specific keys

{
transformers: {
'port': (value) => parseInt(value, 10),
'timeout': (value) => parseInt(value, 10),
}
}
providers: ConfigProvider[]

Array of config providers (in priority order) For 'first-wins': earlier providers have higher priority For 'last-wins': later providers have higher priority For 'merge': all providers are merged

strategy?: MergeStrategy

Merge strategy for combining values from multiple providers

  • 'first-wins': First provider with the value wins (default)
  • 'last-wins': Last provider with the value wins
  • 'merge': Deep merge objects from all providers
'first-wins'