import type { SurfaceRegistry } from "../surfaces/registry.js";
import { type BrowserRuntimeEvent } from "../surfaces/browser.js";
export type PreviewStatus = "starting" | "ready" | "error" | "stopped";
export type PreviewMode = "local" | "docker" | "url";
export interface PreviewLogEntry {
    id: number;
    stream: "stdout" | "stderr" | "system";
    text: string;
    timestamp: string;
}
export interface PreviewSession {
    id: string;
    sessionId: string;
    workspaceRoot: string | null;
    mode: PreviewMode;
    status: PreviewStatus;
    target: string | null;
    command: string | null;
    port: number | null;
    url: string | null;
    browserId: string | null;
    processId: number | null;
    containerId: string | null;
    logs: PreviewLogEntry[];
    browserEvents: BrowserRuntimeEvent[];
    lastError: string | null;
    createdAt: string;
    updatedAt: string;
}
export interface StartPreviewInput {
    sessionId: string;
    workspaceRoot?: string | null;
    target?: string | null;
    command?: string | null;
    port?: number | null;
    frameworkHint?: string | null;
}
export declare class PreviewService {
    private readonly surfaceRegistry;
    private readonly sessions;
    private nextLogId;
    private readonly runner;
    constructor(surfaceRegistry: SurfaceRegistry);
    start(input: StartPreviewInput): Promise<PreviewSession>;
    restart(sessionId: string): Promise<PreviewSession | null>;
    stop(sessionId: string): Promise<boolean>;
    get(sessionId: string): PreviewSession | null;
    getLogs(sessionId: string, sinceId?: number): PreviewLogEntry[];
    list(): PreviewSession[];
    screenshot(sessionId: string): Promise<string | null>;
    snapshot(sessionId: string): Promise<string | null>;
    inspect(sessionId: string): Promise<{
        status: PreviewStatus;
        url: string | null;
        browserEvents: BrowserRuntimeEvent[];
        logs: PreviewLogEntry[];
        screenshot: string | null;
    } | null>;
    stopAll(): Promise<void>;
    private ensureBrowser;
    private readBrowserEvents;
    private appendLog;
    private toPublicSession;
}
//# sourceMappingURL=preview.d.ts.map