/** * @file Resolve a binary path to the underlying script file. * Wrapper-script unwrapping: a binary like `npm` is rarely an executable — on * Windows it is `npm.cmd` / `npm.ps1` / an extensionless shell script. Each * wrapper variant has a fixed format generated by either the npm CLI build * (npm/npx specific) or by `cmd-shim` for arbitrary package binaries. The * parsers in `resolve-shims.mts` extract the relative path to the underlying * `.js` so callers can spawn Node with that path directly, which is cheaper * than re-launching a shell wrapper. * Volta managed installs are handled in `resolve-volta.mts`, which walks * `~/.volta/tools/{image,user}/...` to the real CLI script and memoizes the * result. That cache lives in `../shared.mjs` so `which.mts` can flush it * when its own cache eviction fires. * Cycles with `which.mts`: `normalizedBinPath` calls `whichRealSync` to * handle relative input paths. ESM tolerates the cycle since both sides * expose only functions, so no eager top-level evaluation needs the other * module's bindings. */ /** * One bin path with the facts every resolution step branches on. */ export type BinPathFacts = { basename: string; binPath: string; extLowered: string; }; /** * An absolute, normalized form of a bin path. A relative input is looked up on * PATH first, since every later step pattern-matches an absolute layout. */ export declare function normalizedBinPath(binPath: string): string; /** * The npm/npx CLI script reachable directly from a bin directory, as installed * by the official Node.js Windows installer: `C:\Program Files\nodejs\npm.cmd` * sits beside `node_modules/npm/bin/npm-cli.js`. Returns `''` when that layout * does not apply, in which case the wrapper's body has to be parsed. */ export declare function npmWindowsQuickCliPath(config: BinPathFacts): string; /** * A path with symlinks followed, falling back to the normalized input when the * target does not exist. */ export declare function realOrNormalizedPath(binPath: string): string; /** * The setup-pnpm GitHub Action can leave a bin path with extra segments, like * `