// ============================================================================
// Private Helper Functions
// ============================================================================
// ============================================================================
// Types and Interfaces
// ============================================================================
/**
 * Options for the which function.
 */
export interface WhichOptions {
    /** If true, return all matches instead of just the first one. */
    all?: boolean | undefined;
    /** If true, return null instead of throwing when no match is found. */
    nothrow?: boolean | undefined;
    /** Path to search in. */
    path?: string | undefined;
    /** Path separator character. */
    pathExt?: string | undefined;
    /** Environment variables to use. */
    env?: Record<string, string | undefined> | undefined;
    /** Current working directory for resolving relative paths. */
    cwd?: string | undefined;
}
// ============================================================================
// Public API (alphabetically sorted)
// ============================================================================
/**
 * Execute a binary with the given arguments.
 */
/*@__NO_SIDE_EFFECTS__*/
export declare function execBin(binPath: string, args?: string[], options?: import('./spawn').SpawnOptions): Promise<{
    cmd: string;
    args: string[] | readonly string[];
    code: number;
    signal: NodeJS.Signals;
    stdout: string | Buffer<ArrayBufferLike>;
    stderr: string | Buffer<ArrayBufferLike>;
}>;
/**
 * Find the real executable for a binary, bypassing shadow bins.
 */
export declare function findRealBin(binName: string, commonPaths?: string[]): string | undefined;
/**
 * Find the real npm executable, bypassing any aliases and shadow bins.
 */
export declare function findRealNpm(): string;
/**
 * Find the real pnpm executable, bypassing any aliases and shadow bins.
 */
export declare function findRealPnpm(): string;
/**
 * Find the real yarn executable, bypassing any aliases and shadow bins.
 */
export declare function findRealYarn(): string;
/**
 * Check if a directory path contains any shadow bin patterns.
 */
export declare function isShadowBinPath(dirPath: string | undefined): boolean;
/*@__NO_SIDE_EFFECTS__*/
/**
 * Resolve a binary path to the real underlying script file.
 * Handles Windows .cmd wrappers and Unix shell scripts, resolving them to the actual .js files they execute.
 */
export declare function resolveRealBinSync(binPath: string): string;
/**
 * Find an executable in the system PATH asynchronously.
 *
 * This function resolves binary names to their full paths by searching the system PATH.
 * It should only be used for binary names (not paths). If the input is already a path
 * (absolute or relative), it will be returned as-is without PATH resolution.
 *
 * Binary name vs. path detection:
 * - Binary names: 'npm', 'git', 'node' - will be resolved via PATH
 * - Absolute paths: '/usr/bin/node', 'C:\\Program Files\\nodejs\\node.exe' - returned as-is
 * - Relative paths: './node', '../bin/npm' - returned as-is
 *
 * @param {string} binName - The binary name to resolve (e.g., 'npm', 'git')
 * @param {WhichOptions | undefined} options - Options for resolution
 * @returns {Promise<string | string[] | null>} Promise resolving to the full path, the original path, or null if not found
 *
 * @example
 * ```typescript
 * // Resolve binary names
 * await which('node')              // '/usr/local/bin/node'
 * await which('npm')               // '/usr/local/bin/npm'
 * await which('nonexistent')       // null
 *
 * // Paths are returned as-is
 * await which('/usr/bin/node')     // '/usr/bin/node'
 * await which('./local-script')    // './local-script'
 * ```
 */
export declare function which(binName: string, options?: WhichOptions): Promise<string | string[] | null>;
/**
 * Find a binary in the system PATH and resolve to the real underlying script asynchronously.
 * Resolves wrapper scripts (.cmd, .ps1, shell scripts) to the actual .js files they execute.
 * @throws {Error} If the binary is not found and nothrow is false.
 */
export declare function whichReal(binName: string, options?: WhichOptions): Promise<string | string[] | undefined>;
/**
 * Find a binary in the system PATH and resolve to the real underlying script synchronously.
 * Resolves wrapper scripts (.cmd, .ps1, shell scripts) to the actual .js files they execute.
 * @throws {Error} If the binary is not found and nothrow is false.
 */
export declare function whichRealSync(binName: string, options?: WhichOptions): string | string[] | undefined;
/**
 * Find an executable in the system PATH synchronously.
 *
 * This function resolves binary names to their full paths by searching the system PATH.
 * It should only be used for binary names (not paths). If the input is already a path
 * (absolute or relative), it will be returned as-is without PATH resolution.
 *
 * Binary name vs. path detection:
 * - Binary names: 'npm', 'git', 'node' - will be resolved via PATH
 * - Absolute paths: '/usr/bin/node', 'C:\\Program Files\\nodejs\\node.exe' - returned as-is
 * - Relative paths: './node', '../bin/npm' - returned as-is
 *
 * @param {string} binName - The binary name to resolve (e.g., 'npm', 'git')
 * @param {WhichOptions | undefined} options - Options for resolution
 * @returns {string | string[] | null} The full path to the binary, the original path if input is a path, or null if not found
 *
 * @example
 * ```typescript
 * // Resolve binary names
 * whichSync('node')              // '/usr/local/bin/node'
 * whichSync('npm')               // '/usr/local/bin/npm'
 * whichSync('nonexistent')       // null
 *
 * // Paths are returned as-is
 * whichSync('/usr/bin/node')     // '/usr/bin/node'
 * whichSync('./local-script')    // './local-script'
 * ```
 */
export declare function whichSync(binName: string, options?: WhichOptions): string | string[] | null;
