/** * @file PATH environment variable helpers. Exports `getPath()`, returning the * raw value of the `PATH` environment variable that lists executable search * directories, plus `findPathEnvKey()` and `replacePathInEnv()` for reading * and rewriting that variable on an arbitrary environment object — Windows * exposes it under a case-variant key, so a plain `env['PATH']` read or * write is not enough. */ /** * Find the PATH key in an environment. Windows exposes it as `Path`, and a * merged environment object can carry any casing at all. * * @example * ;```typescript * findPathEnvKey({ Path: 'C:\\Windows' }) // 'Path' * findPathEnvKey({}) // undefined * ``` */ export declare function findPathEnvKey(env: NodeJS.ProcessEnv): string | undefined; /** * Returns the value of the PATH environment variable. * * @example * ;```typescript * import { getPath } from '@socketsecurity/lib/env/path' * * const path = getPath() * // e.g. '/usr/local/bin:/usr/bin:/bin' or undefined * ``` * * @returns The system executable search paths, or `undefined` if not set */ export declare function getPath(): string | undefined; /** * Copy an environment with its PATH replaced. Every case variant of the key is * rewritten so Windows cannot fall back to a stale `Path`. * * @example * ;```typescript * replacePathInEnv({ Path: 'C:\\a;C:\\b' }, 'C:\\a', 'Path') * // { Path: 'C:\\a' } * ``` */ export declare function replacePathInEnv(env: NodeJS.ProcessEnv, searchPath: string, pathKey: string | undefined): NodeJS.ProcessEnv;