/**
 * Bun Dev Server
 *
 * Spawns Bun with --hot as a subprocess. Bun's --hot mode re-evaluates changed
 * modules and hot-swaps the default export's `fetch` handler on the running
 * server — no process restart, no port rebind, no dropped connections.
 *
 * The user's app.ts exports the result of createApp() which includes `fetch`
 * and `port` properties that Bun uses to manage the server lifecycle.
 *
 * Key requirements for bun --hot:
 * - app.ts MUST have `export default` with { fetch, port } properties
 * - Without export default, Bun runs the code but never starts an HTTP server
 */
import type { Logger } from '../../../types';
export interface BunDevServerOptions {
    rootDir: string;
    port?: number;
    logger: Logger;
    vitePort: number;
    inspect?: boolean;
    inspectWait?: boolean;
    inspectBrk?: boolean;
}
export interface BunDevServerResult {
    bunServerPort: number;
}
/**
 * Validation result for app.ts entry point.
 */
interface AppValidationResult {
    /** Whether app.ts has a default export */
    hasDefaultExport: boolean;
    /** Whether app.ts calls createApp() */
    hasCreateApp: boolean;
    /** Whether it's the v1 pattern (destructuring without export) */
    isV1Pattern: boolean;
    /** Any validation hints to show */
    hints: string[];
}
/**
 * Validate app.ts for common issues that prevent Bun --hot from starting.
 *
 * Bun --hot requires `export default { fetch, port }` to start a server.
 * Common mistakes:
 * - No `export default` (v1 pattern: destructuring result without exporting)
 * - Calling createApp() but not exporting it
 *
 * @internal Exported for testing only
 */
export declare function validateAppTs(appPath: string): Promise<AppValidationResult>;
/**
 * Build a detailed error message with validation hints and captured output.
 *
 * @internal Exported for testing only
 */
export declare function buildStartupErrorMessage(port: number, timeoutMs: number, stderr: string, validation: AppValidationResult): string;
/**
 * Start Bun dev server with --hot (Vite asset server must already be running).
 *
 * Uses `bun --hot` so Bun watches all imported files and hot-swaps the fetch
 * handler on the running server. The server stays up — only the changed modules
 * are re-evaluated.
 */
export declare function startBunDevServer(options: BunDevServerOptions): Promise<BunDevServerResult>;
export {};
//# sourceMappingURL=bun-dev-server.d.ts.map