ConfigProvider
Combinators
constantCase
Signature
declare const constantCase: (self: ConfigProvider) => ConfigProvider;Returns a new config provider that will automatically convert all property names to kebab case. This can be utilized to adapt the names of configuration properties from the default naming convention of camel case to the naming convention of a config provider.
Signature
declare const kebabCase: (self: ConfigProvider) => ConfigProvider;Returns a new config provider that will automatically convert all property names to lower case. This can be utilized to adapt the names of configuration properties from the default naming convention of camel case to the naming convention of a config provider.
Signature
declare const lowerCase: (self: ConfigProvider) => ConfigProvider;Returns a new config provider that will automatically convert all property names to upper case. This can be utilized to adapt the names of configuration properties from the default naming convention of camel case to the naming convention of a config provider.
Signature
declare const snakeCase: (self: ConfigProvider) => ConfigProvider;Returns a new config provider that will automatically convert all property names to upper case. This can be utilized to adapt the names of configuration properties from the default naming convention of camel case to the naming convention of a config provider.
Signature
declare const upperCase: (self: ConfigProvider) => ConfigProvider;Returns a new config provider that transforms the config provider with the specified function within the specified path.
Signature
declare const within: {
(path: readonly Array<string>, f: (self: ConfigProvider) => ConfigProvider): (self: ConfigProvider) => ConfigProvider;
(self: ConfigProvider, path: readonly Array<string>, f: (self: ConfigProvider) => ConfigProvider): ConfigProvider;
}Constructors
A config provider that loads configuration from context variables
Options:
- pathDelim: The delimiter for the path segments (default: "_"). - seqDelim: The delimiter for the sequence of values (default: ",").
Signature
declare const fromEnv: (options?: Partial<ConfigProvider.FromEnvConfig>) => ConfigProvider;Constructs a new ConfigProvider from a key/value (flat) provider, where nesting is embedded into the string keys.
Signature
declare const fromFlat: (flat: ConfigProvider.Flat) => ConfigProvider;Constructs a new ConfigProvider from a JSON object.
Signature
declare const fromJson: (json: unknown) => ConfigProvider;Constructs a ConfigProvider using a map and the specified delimiter string, which determines how to split the keys in the map into path segments.
Signature
declare const fromMap: (
map: Map<string, string>,
config?: Partial<ConfigProvider.FromMapConfig>,
) => ConfigProvider;Creates a new config provider.
Signature
declare const make: (options: {
readonly flattened: ConfigProvider.Flat;
readonly load: <A>(config: Config.Config<A>) => Effect.Effect<A, ConfigError.ConfigError>;
}) => ConfigProvider;Creates a new flat config provider.
Signature
declare const makeFlat: (options: {
readonly enumerateChildren: (
path: ReadonlyArray<string>,
) => Effect.Effect<HashSet.HashSet<string>, ConfigError.ConfigError>;
readonly load: <A>(
path: ReadonlyArray<string>,
config: Config.Config.Primitive<A>,
split: boolean,
) => Effect.Effect<Array<A>, ConfigError.ConfigError>;
readonly patch: PathPatch.PathPatch;
}) => ConfigProvider.Flat;Context
ConfigProvider
The service tag for ConfigProvider.
Signature
declare const ConfigProvider: Tag<ConfigProvider, ConfigProvider>;Models
ConfigProvider interface
A ConfigProvider is a service that provides configuration given a description of the structure of that configuration.
Signature
interface ConfigProvider extends Proto, Pipeable {
readonly flattened: Flat;
load<A>(config: Config<A>): Effect<A, ConfigError>;
}Other
ConfigProvider
Symbols
ConfigProviderTypeId
Signature
declare const ConfigProviderTypeId: unique symbol;ConfigProviderTypeId type
Signature
type ConfigProviderTypeId = typeof ConfigProviderTypeId;FlatConfigProviderTypeId
Signature
declare const FlatConfigProviderTypeId: unique symbol;FlatConfigProviderTypeId type
Signature
type FlatConfigProviderTypeId = typeof FlatConfigProviderTypeId;Utils
mapInputPath
Returns a new config provider that will automatically tranform all path configuration names with the specified function. This can be utilized to adapt the names of configuration properties from one naming convention to another.
Signature
declare const mapInputPath: {
(f: (path: string) => string): (self: ConfigProvider) => ConfigProvider;
(self: ConfigProvider, f: (path: string) => string): ConfigProvider;
};Returns a new config provider that will automatically nest all configuration under the specified property name. This can be utilized to aggregate separate configuration sources that are all required to load a single configuration value.
Signature
declare const nested: {
(name: string): (self: ConfigProvider) => ConfigProvider;
(self: ConfigProvider, name: string): ConfigProvider;
};Returns a new config provider that preferentially loads configuration data from this one, but which will fall back to the specified alternate provider if there are any issues loading the configuration from this provider.
Signature
declare const orElse: {
(that: LazyArg<ConfigProvider>): (self: ConfigProvider) => ConfigProvider;
(self: ConfigProvider, that: LazyArg<ConfigProvider>): ConfigProvider;
};Returns a new config provider that will automatically un-nest all configuration under the specified property name. This can be utilized to de-aggregate separate configuration sources that are all required to load a single configuration value.
Signature
declare const unnested: {
(name: string): (self: ConfigProvider) => ConfigProvider;
(self: ConfigProvider, name: string): ConfigProvider;
};
Returns a new config provider that will automatically convert all property names to constant case. This can be utilized to adapt the names of configuration properties from the default naming convention of camel case to the naming convention of a config provider.