/**
 * Mock `RuntimeDeps` for testing.
 *
 * Provides a fully controllable runtime implementation for unit tests.
 * Consumer projects can extend `MockRuntime` with project-specific helpers
 * (e.g. `setup_mock_zap_config`) that stay local.
 *
 * @module
 */
import type { RuntimeDeps, CommandResult, RunCommandOptions } from './deps.js';
/**
 * Mock `RuntimeDeps` with observable state for assertions.
 */
export interface MockRuntime extends RuntimeDeps {
    /** Mock environment variables. */
    mock_env: Map<string, string>;
    /** Mock file system (path -> content). */
    mock_fs: Map<string, string>;
    /** Mock binary file system (path -> bytes). */
    mock_fs_bytes: Map<string, Uint8Array>;
    /** Mock directories that exist. */
    mock_dirs: Set<string>;
    /** Exit calls recorded (exit codes). */
    exit_calls: Array<number>;
    /** Commands executed. Captures `options` when passed so tests can assert cwd/timeout/signal. */
    command_calls: Array<{
        cmd: string;
        args: Array<string>;
        options?: RunCommandOptions;
    }>;
    /** Commands executed with inherit. */
    command_inherit_calls: Array<{
        cmd: string;
        args: Array<string>;
    }>;
    /** Stdout writes recorded. */
    stdout_writes: Array<string>;
    /** Mock command results (cmd -> result). */
    mock_command_results: Map<string, CommandResult>;
    /** Stdin buffer for input simulation. */
    stdin_buffer: Uint8Array | null;
    /** Fetch calls recorded. */
    fetch_calls: Array<{
        input: string | URL | Request;
        init?: RequestInit;
    }>;
    /** Mock fetch responses (URL substring -> Response). */
    mock_fetch_responses: Map<string, Response>;
}
/**
 * Create a mock `RuntimeDeps` for testing.
 *
 * The mock `exit` records the code on `exit_calls` and throws `MockExitError`
 * (so the never-returning contract holds in tests). `fetch` throws `TypeError`
 * when no `mock_fetch_responses` pattern matches the request URL.
 *
 * @returns `MockRuntime` with controllable state
 *
 * @example
 * ```ts
 * const runtime = create_mock_runtime(['apply', 'zap.ts']);
 * runtime.mock_env.set('HOME', '/home/test');
 * runtime.mock_fs.set('/home/test/.app/config.json', '{}');
 *
 * await some_function(runtime);
 *
 * assert.strictEqual(runtime.command_calls.length, 1);
 * assert.deepStrictEqual(runtime.exit_calls, [0]);
 * ```
 */
export declare const create_mock_runtime: (args?: Array<string>) => MockRuntime;
/**
 * Reset a mock runtime to initial state.
 *
 * @mutates runtime - clears all mock state (env, fs, dirs, exit/command/stdout/fetch call records, mock results, stdin buffer)
 */
export declare const reset_mock_runtime: (runtime: MockRuntime) => void;
/**
 * Set stdin buffer for simulating user input.
 *
 * @param input - string to provide as stdin input
 * @mutates `runtime.stdin_buffer`
 */
export declare const set_mock_stdin: (runtime: MockRuntime, input: string) => void;
/**
 * Error thrown when mock `runtime.exit()` is called.
 *
 * Tests can catch this to verify exit behavior.
 */
export declare class MockExitError extends Error {
    readonly code: number;
    constructor(code: number);
}
//# sourceMappingURL=mock.d.ts.map