import { VirtualFS } from "./virtual-fs";
import { Runtime, type RuntimeOptions } from "./runtime";
import { PackageManager } from "./npm";
import type { InstallMode } from "./npm";
import { ServerBridge } from "./server-bridge";
import type { ShellCommandDefinition } from "./shell-commands";
import type { IExecuteResult } from "./runtime-interface";
import type { WorkspaceSearchProvider } from "./shims/child_process";
import type { NetworkController, NetworkIntegration, NetworkOptions } from "./network/types";
export type { WorkspaceSearchProvider, WorkspaceSearchOptions, WorkspaceSearchResult, WorkspaceSearchMatch, WorkspaceSearchFileResult, } from "./shims/child_process";
export interface RunResult {
    stdout: string;
    stderr: string;
    exitCode: number;
}
export interface RunOptions {
    cwd?: string;
    env?: Record<string, string>;
    onStdout?: (data: string) => void;
    onStderr?: (data: string) => void;
    signal?: AbortSignal;
    interactive?: boolean;
}
export interface TerminalSessionOptions {
    cwd?: string;
    env?: Record<string, string>;
}
export interface TerminalSessionRunOptions {
    onStdout?: (data: string) => void;
    onStderr?: (data: string) => void;
    signal?: AbortSignal;
    interactive?: boolean;
}
export interface TerminalSessionState {
    cwd: string;
    env: Record<string, string>;
    running: boolean;
}
export interface TerminalSession {
    run: (command: string, options?: TerminalSessionRunOptions) => Promise<RunResult>;
    sendInput: (data: string) => void;
    resize: (cols: number, rows: number) => void;
    abort: () => void;
    dispose: () => void;
    getState: () => TerminalSessionState;
}
export interface GitAuthOptions {
    token?: string;
    username?: string;
    password?: string;
    corsProxy?: string;
    authorName?: string;
    authorEmail?: string;
}
export interface MutableGitAuth {
    token?: string | null;
    username?: string | null;
    password?: string | null;
    corsProxy?: string | null;
    authorName?: string | null;
    authorEmail?: string | null;
}
export interface ContainerOptions extends RuntimeOptions {
    baseUrl?: string;
    basePath?: string;
    onServerReady?: (port: number, url: string) => void;
    git?: GitAuthOptions;
    installMode?: InstallMode;
    shellCommands?: ShellCommandDefinition[];
    network?: NetworkOptions;
    networkIntegration?: NetworkIntegration;
}
export interface ContainerInstance {
    /** Unique id for this container (used as ServerRegistrationMetadata.ownerId). */
    id: string;
    vfs: VirtualFS;
    runtime: Runtime;
    network: NetworkController;
    npm: PackageManager;
    serverBridge: ServerBridge;
    execute: (code: string, filename?: string) => Promise<IExecuteResult>;
    runFile: (filename: string) => Promise<IExecuteResult>;
    run: (command: string, options?: RunOptions) => Promise<RunResult>;
    createTerminalSession: (options?: TerminalSessionOptions) => TerminalSession;
    registerShellCommand: (definition: ShellCommandDefinition) => void;
    unregisterShellCommand: (name: string) => boolean;
    setGitAuth: (updates: Partial<MutableGitAuth>) => void;
    getGitAuth: () => GitAuthOptions;
    sendInput: (data: string) => void;
    createREPL: () => {
        eval: (code: string) => Promise<unknown>;
    };
    on: (event: string, listener: (...args: unknown[]) => void) => void;
    setKeychain: (kc: {
        persistCurrentState(): Promise<void>;
    }) => void;
    setSearchProvider: (provider: WorkspaceSearchProvider) => void;
    setHMRTargetForPort: (port: number, targetWindow: Window | null) => void;
    /**
     * Tear down this container: abort running commands, stop its framework dev
     * servers, and unregister its servers from the shared bridge.
     */
    dispose: () => void;
}
export declare function createContainer(options?: ContainerOptions): ContainerInstance;
export default createContainer;
//# sourceMappingURL=container.d.ts.map