UNPKG

envase

Version:

Type-safe environment variable validation with Standard Schema compliance

14 lines (13 loc) 946 B
import type { StandardSchemaV1 } from './standard-schema.ts'; import type { ComputedSchema, EnvSchema, EnvvarEntry, InferConfig, InferEnv, NodeEnvInfo } from './types.ts'; export declare const detectNodeEnv: (env: Record<string, string | undefined>) => NodeEnvInfo; export declare const envvar: <T extends StandardSchemaV1>(name: string, schema: T) => EnvvarEntry<T>; export declare const parseEnv: <T extends EnvSchema>(env: Record<string, string | undefined>, envSchema: T) => InferEnv<T>; export declare function createConfig<TSchema extends EnvSchema>(env: Record<string, string | undefined>, options: { schema: TSchema; computed?: undefined; }): InferEnv<TSchema>; export declare function createConfig<TSchema extends EnvSchema, const TComputed extends ComputedSchema<InferEnv<TSchema>>>(env: Record<string, string | undefined>, options: { schema: TSchema; computed: TComputed; }): InferConfig<InferEnv<TSchema>, TComputed>;