import type { SpawnSyncOptionsWithBufferEncoding } from 'node:child_process';
export interface Workspace {
    location: string;
    name: string;
}
export type ScriptStep = [/* command */ string, /* arg */ /* arg */ string | string[]] | [/* command */ string, /* arg */ /* arg */ string | string[], /* config */ SpawnSyncOptionsWithBufferEncoding];
export interface WorkspaceForeachOptions {
    /**
     * Include the workspace root in the recursive run. pnpm's `-r` skips the
     * root by default; some operations (notably `clean`, which needs to
     * remove the root's own `dist/` and `build/` artifacts) want it included.
     * Defaults to `false`.
     */
    includeWorkspaceRoot?: boolean;
    incremental?: boolean;
    jobs: number;
    topological?: boolean;
    verbose?: boolean;
}
export interface PublishOptions {
    /**
     * Max workspaces per pnpm publish invocation. Each chunk spawns a fresh
     * pnpm process, which tears down and rebuilds Node's heap — a hard upper
     * bound on long-sequence OOM. `0` or `undefined` disables chunking (single
     * `pnpm publish -r` call) — this is the default.
     *
     * IMPORTANT: if the npm account requires interactive 2FA / web-login per
     * publish (the default npmjs behavior outside of GitHub Actions Trusted
     * Publishing), each chunk triggers a fresh auth ceremony. Chunking at
     * `chunkSize=1` means one auth prompt per package — do not use unless
     * you've accepted that cost. Prefer bumping `NODE_OPTIONS=--max-old-space-size`
     * first; reach for chunking only when heap alone can't contain the run.
     *
     * Other package managers ignore this option today.
     */
    chunkSize?: number;
    /**
     * When true, pnpm runs with `--loglevel=debug` and without the quiet
     * append-only reporter so every pre-publish step (graph build, registry
     * lookups, lifecycle scripts) is visible.
     */
    verbose?: boolean;
}
export interface PackageManager {
    /** The shell command to invoke this package manager (e.g., 'yarn', 'pnpm') */
    command: string;
    /** The lockfile name (e.g., 'yarn.lock', 'pnpm-lock.yaml') */
    lockfile: string;
    /** Package manager identifier */
    name: 'bun' | 'npm' | 'pnpm' | 'yarn';
    /** Remove duplicate dependencies */
    dedupe(): ScriptStep;
    /** Find a single workspace by name */
    findWorkspace(name: string): Workspace | undefined;
    /** Run a foreach command across all workspaces */
    foreachWorkspace(script: string, args: string[], options: WorkspaceForeachOptions): ScriptStep;
    /** Install dependencies */
    install(): ScriptStep;
    /** Returns a map of package name -> installed version for all dependencies across all workspaces */
    listInstalledVersions(): Map<string, string>;
    /** List all workspaces */
    listWorkspaces(): Workspace[];
    /** Show outdated dependencies */
    outdated(): ScriptStep;
    /**
     * Publish all packages to the registry.
     *
     * Returns an array of ScriptSteps so implementations can split the
     * publish into chunks (see {@link PublishOptions.chunkSize}) or emit a
     * single step. Callers pass the whole array to `runSteps` which executes
     * them sequentially and aggregates status.
     */
    publish(options?: PublishOptions): ScriptStep[];
    /** Run a script in a specific workspace */
    runInWorkspace(pkg: string, script: string, args?: string[]): ScriptStep;
    /** Run a script in a specific workspace when the exact package name is already known */
    runInWorkspaceByName(pkg: string, script: string, args?: string[]): ScriptStep;
    /** Run the xy CLI command */
    runXy(args: string[]): ScriptStep;
    /** Apply version changes */
    versionApply(): ScriptStep;
    /** Bump versions across workspaces */
    versionBump(type: 'major' | 'minor' | 'patch' | 'prerelease'): ScriptStep[];
}
//# sourceMappingURL=PackageManager.d.ts.map