import type { OptionBuilder, StringBuilder, TypeBuilder, t } from './type_builders.ts'; /** Only strings and simple, payload-free enums constrain environment strings. */ export type EnvironmentString = StringBuilder | (TypeBuilder & { readonly variants: Record>; }); export type EnvironmentSchema = Record>; export type EnvironmentValue = T extends OptionBuilder ? EnvironmentValue | undefined : T extends { readonly variants: infer Variants; } ? keyof Variants & string : string; /** Values are read from the host on each access. Undeclared names are errors. */ export type Environment = Declarations extends EnvironmentSchema ? { readonly [Key in keyof Declarations as Key extends 'get' ? never : Key]: EnvironmentValue; } & { get(key: Key & (string extends Key ? unknown : Key extends keyof Declarations ? unknown : never)): Key extends keyof Declarations ? Exclude, undefined> | (undefined extends EnvironmentValue ? null : never) : string | null; } : { get(key: string): string | null; }; export type EnvironmentFor = Schema extends { env: infer Declarations extends EnvironmentSchema; } ? Environment : Environment; //# sourceMappingURL=environment.d.ts.map