This only applies if you use Typescript. The generics definitions have changed.
You can now define an interface for your settings and it will be recognized via autocompletion.
If you use generics with the CerebroConfig
API, you will need to update your generics to match the new definitions.
This would apply to the following methods:
getRawValue()
isEnabled()
getValue()
getAssertValue()
getRawConfig()
Before:
const value = config.isEnabled<boolean>('enable_database')
After (static config)
import { loadStaticConfig } from 'configurity'
interface Settings {
enable_database: boolean
}
const config = loadStaticConfig<Settings>('example.yaml')
// No need for the generic anymore, it should be inferred
const databaseEnabled = config.isEnabled('enable_database')
After (dynamic config)
import { loadDynamicConfig } from 'configurity'
interface Settings {
enable_database: boolean
}
const config = loadDynamicConfig<Settings>('example.yaml')
// No need for the generic anymore, it should be inferred
const databaseEnabled = config.isEnabled('enable_database')