/** * Shared environment-variable parsing utilities. * * Every function accepts an optional {@link EnvSource} so tests can inject * values without mutating `process.env`. * * @module */ /** A bag of environment variables — defaults to `process.env`. */ export type EnvSource = Record; /** Read a string env var, returning `fallback` when unset or empty. */ export declare function envString(name: string, fallback: string, env?: EnvSource): string; /** Read an optional string env var; returns `undefined` when unset or empty. */ export declare function envOptionalString(name: string, env?: EnvSource): string | undefined; /** * Parse a port number (integer 1–65535) from an env var. * Returns `fallback` when unset. Throws on invalid values. */ export declare function envPort(name: string, fallback: number, env?: EnvSource): number; /** * Parse an integer env var with optional min/max bounds. * Returns `fallback` when unset, non-finite, or outside bounds. * Truncates toward zero (matching `parseInt` semantics). */ export declare function envInt(name: string, fallback: number, opts?: { min?: number; max?: number; env?: EnvSource; }): number; /** * Parse a non-negative float env var. * Returns `fallback` when unset, non-finite, or negative. */ export declare function envNum(name: string, fallback: number, env?: EnvSource): number; /** * Parse a strict boolean flag: `"1"` → `true`, anything else → `false`. * Matches the `GRACKLE_SKIP_*` / `GRACKLE_ALLOW_*` convention. */ export declare function envFlag(name: string, env?: EnvSource): boolean; /** * Parse a broad boolean: `"1"` / `"true"` → `true`, `"0"` / `"false"` → `false`, * unset/empty/unrecognized → `fallback`. Matches the `GRACKLE_KNOWLEDGE_ENABLED` * convention. Unrecognized values preserve the fallback so a typo doesn't * silently flip a feature flag. */ export declare function envBool(name: string, fallback: boolean, env?: EnvSource): boolean; //# sourceMappingURL=env.d.ts.map