import { type ChildProcessWithoutNullStreams } from "node:child_process";
export interface PreviewRunnerResult {
    process: ChildProcessWithoutNullStreams | null;
    port: number;
    command: string;
    url: string;
    mode: "local" | "docker";
    containerId?: string;
    processId?: number;
}
export interface PreviewRunnerInput {
    workspaceRoot: string;
    command?: string | null;
    port?: number | null;
    target?: string | null;
    frameworkHint?: string | null;
}
export type PreviewLogCallback = (stream: "stdout" | "stderr" | "system", text: string) => void;
export interface PreviewRunner {
    readonly mode: "local" | "docker";
    start(input: PreviewRunnerInput, onLog: PreviewLogCallback): Promise<PreviewRunnerResult>;
    stop(result: PreviewRunnerResult): Promise<void>;
}
export declare function detectPackageManager(workspaceRoot: string): "bun" | "pnpm" | "npm";
export declare function loadPackageJson(workspaceRoot: string): Record<string, any> | null;
export interface DetectedFramework {
    name: string;
    devCommand: string;
    likelyPort: number;
}
export declare function detectFramework(workspaceRoot: string, hint?: string | null): DetectedFramework | null;
export declare function detectPreviewCommand(workspaceRoot: string, requestedCommand: string | null, port: number, frameworkHint?: string | null): string;
export declare function allocatePort(preferred?: number | null): Promise<number>;
export declare function waitForHttp(url: string, timeoutMs?: number): Promise<void>;
export declare class LocalPreviewRunner implements PreviewRunner {
    readonly mode: "local";
    start(input: PreviewRunnerInput, onLog: PreviewLogCallback): Promise<PreviewRunnerResult>;
    stop(result: PreviewRunnerResult): Promise<void>;
}
export declare class DockerPreviewRunner implements PreviewRunner {
    readonly mode: "docker";
    start(_input: PreviewRunnerInput, onLog: PreviewLogCallback): Promise<PreviewRunnerResult>;
    stop(_result: PreviewRunnerResult): Promise<void>;
}
export declare function createPreviewRunner(preferDocker?: boolean): PreviewRunner;
//# sourceMappingURL=preview-runner.d.ts.map