import { type ByteSource, type IOResult } from '../../io/types.ts';
import { JobConsole } from '../../shell/console/index.ts';
import { type TSNodeLike } from '../../shell/types.ts';
import type { EvaluationContext } from '../evaluation.ts';
import type { ProcessSubLine } from '../frame.ts';
import type { MountRegistry } from '../mount/registry.ts';
import type { ExecutionNode } from '../types.ts';
/** Own the virtual descriptors and auxiliary children of one command node. */
export declare class ProcessSubScope {
    private readonly context;
    private readonly registry;
    private readonly sink?;
    private readonly signal?;
    private readonly held;
    private readonly capture;
    private closing;
    constructor(context: EvaluationContext, registry: MountRegistry, sink?: JobConsole | undefined, signal?: AbortSignal | undefined);
    open: (node: TSNodeLike, executeLine: ProcessSubLine) => Promise<string>;
    close(failed?: boolean): Promise<void>;
    private finish;
    /**
     * This scope's input pipes that a shell descriptor still reads after the
     * command (`exec 3<"$1"`, or a dup), with the line buffers reading each,
     * which load the rest. The descriptors stop naming them, as the paths are
     * free once this command ends. Mirrors Python's _held_inputs.
     */
    private heldInputs;
    /**
     * End the substitutions as a finished command does, for a node `exit`,
     * `return` or `break` leaves, and return what they wrote to the capture,
     * stdout then stderr. Mirrors Python's settle.
     */
    settle(): Promise<[Uint8Array, Uint8Array]>;
    own(stdout: ByteSource | null, io: IOResult, node: ExecutionNode): ByteSource | null;
    private output;
}
//# sourceMappingURL=process_sub.d.ts.map