/**
 * ViteDevServer - Vite-compatible dev server for browser environment
 * Serves files from VirtualFS with JSX/TypeScript transformation
 */
import { DevServer, DevServerOptions, ResponseData } from '../dev-server';
import { VirtualFS } from '../virtual-fs';
import { Buffer } from '../shims/stream';
export interface ViteDevServerOptions extends DevServerOptions {
    /**
     * Enable JSX transformation (default: true)
     */
    jsx?: boolean;
    /**
     * JSX factory function (default: 'React.createElement')
     */
    jsxFactory?: string;
    /**
     * JSX fragment function (default: 'React.Fragment')
     */
    jsxFragment?: string;
    /**
     * Auto-inject React import for JSX files (default: true)
     */
    jsxAutoImport?: boolean;
}
export declare class ViteDevServer extends DevServer {
    private watcherCleanup;
    private options;
    private hmrTargetWindow;
    constructor(vfs: VirtualFS, options: ViteDevServerOptions);
    /**
     * Set the target window for HMR updates (typically iframe.contentWindow)
     * This enables HMR to work with sandboxed iframes via postMessage
     */
    setHMRTarget(targetWindow: Window): void;
    /**
     * Handle an incoming HTTP request
     */
    handleRequest(method: string, url: string, headers: Record<string, string>, body?: Buffer): Promise<ResponseData>;
    /**
     * Start file watching for HMR
     */
    startWatching(): void;
    /**
     * Handle file change event
     */
    private handleFileChange;
    /**
     * Stop the server
     */
    stop(): void;
    /**
     * Check if a file needs transformation
     */
    private needsTransform;
    /**
     * Transform and serve a JSX/TS file
     */
    private transformAndServe;
    /**
     * Transform JSX/TS code to browser-compatible JavaScript
     */
    private transformCode;
    /**
     * Add React Refresh registration to transformed code
     * This enables true HMR (state-preserving) for React components
     */
    private addReactRefresh;
    /**
     * Serve CSS file as a JavaScript module that injects styles
     * This is needed because ES module imports of CSS files need to return JS
     */
    private serveCssAsModule;
    /**
     * Serve HTML file with HMR client script injected
     *
     * IMPORTANT: React Refresh preamble MUST be injected before any module scripts.
     * The preamble uses top-level await to block until React Refresh is loaded
     * and injectIntoGlobalHook is called. This ensures React Refresh hooks into
     * React BEFORE React is imported by any module.
     */
    private serveHtmlWithHMR;
}
export default ViteDevServer;
//# sourceMappingURL=vite-dev-server.d.ts.map