export interface ResolveExecutableOptions { platform?: NodeJS.Platform; env?: NodeJS.ProcessEnv; cwd?: string; isExecutable?: (filePath: string) => boolean; } export interface ExecutableInvocation { command: string; args: string[]; windowsVerbatimArguments?: boolean; } export declare function resolveNpmExecutableForNode(nodePath: string, platform?: NodeJS.Platform, exists?: (filePath: string) => boolean): string | undefined; /** * Build a child environment where lifecycle scripts resolve `node` to the * runtime that owns the selected npm executable. Windows environment keys are * case-insensitive, so remove duplicate Path/PATH entries before setting it. */ export declare function withNodeRuntimeOnPath(nodePath: string, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): NodeJS.ProcessEnv; export declare function deriveNpmPrefixFromPackageRoot(packageRoot: string, platform?: NodeJS.Platform): string | undefined; export declare function isPackageRootInsideNpmRoot(packageRoot: string, npmRoot: string, platform?: NodeJS.Platform): boolean; export declare function commandLookupHint(command: string, platform?: NodeJS.Platform): string; export declare function resolveExecutable(command: string, options?: ResolveExecutableOptions): string | undefined; export interface ExecutableInvocationOptions { platform?: NodeJS.Platform; env?: NodeJS.ProcessEnv; /** shim 内容读取(测试可注入;默认 fs.readFileSync utf8) */ readFile?: (filePath: string) => string; /** 入口存在性检查(测试可注入;默认 statSync isFile) */ fileExists?: (filePath: string) => boolean; } export declare function buildExecutableInvocation(executable: string, args: string[], options?: ExecutableInvocationOptions): ExecutableInvocation;