Interface ConfigParams<SchemaT, EnvironmentT>

Parameters for creating a configuration instance.

interface ConfigParams<
    SchemaT extends Record<string, unknown>,
    EnvironmentT extends readonly string[],
> {
    config: Readonly<ConfigValueMap<SchemaT, EnvironmentT>>;
    environment: { allowed: EnvironmentT; current: EnvironmentT[number] };
    schema: ZodType<SchemaT, SchemaT>;
}

Type Parameters

  • SchemaT extends Record<string, unknown>
  • EnvironmentT extends readonly string[]

Properties

config: Readonly<ConfigValueMap<SchemaT, EnvironmentT>>

Configuration values resolved in order of precedence.

environment: { allowed: EnvironmentT; current: EnvironmentT[number] }

The current environment and list of allowed environments.

{ current: "development", allowed: ["development", "production"] as const }
schema: ZodType<SchemaT, SchemaT>

Zod schema defining the configuration shape and validation rules.