import { Result } from "./result.js"; import { KeysParam } from "./utils/get-params-result.js"; import { WithCement } from "./types.js"; export type EnvTuple = ([string, string] | [string, string][] | Record | Iterator<[string, string]>)[]; export interface EnvMap { get(key: string): string | undefined; set(key: string, value?: string): void; delete(key: string): void; keys(): string[]; } export interface EnvActions extends EnvMap { active(): boolean; register(env: Env): Env; } export interface EnvFactoryOpts { readonly symbol: string; readonly presetEnv: Map; testPatchImportMetaEnv?: Record; readonly id: string; } type OnSetFn = (key: string, value?: string) => void; export interface OnSetItem { readonly filter: Set; readonly fn: OnSetFn; } export interface Env extends EnvMap { onSet(fn: OnSetFn, ...filter: string[]): void; gets(...kparams: KeysParam): Result>; sets(...keys: EnvTuple): void; } export type EnvFactoryFn = (opts: WithCement>) => EnvActions; export declare function registerEnvAction(fn: EnvFactoryFn): () => void; export type EnvFactory = (opts?: Partial) => Env; export declare function envFactory(opts?: Partial): Env; export declare class EnvImpl implements Env { readonly _map: EnvMap; constructor(map: EnvMap, opts: Partial); gets(...kparams: KeysParam): Result>; sets(...keys: EnvTuple): void; _updatePresets(presetEnv?: Map): void; _applyOnSet(onSet: OnSetItem[], key?: string, value?: string): void; readonly _onSet: OnSetItem[]; keys(): string[]; onSet(fn: OnSetFn, ...filter: string[]): void; get(key: string): string | undefined; set(key: string, value?: string): void; delete(key: string): void; } export {}; //# sourceMappingURL=sys-env.d.ts.map