/**
 * Web Server Service
 *
 * Manages the Next.js programmatic server lifecycle.
 * Starts the web UI in the same Node.js process as the CLI,
 * sharing the DI container and application layer.
 *
 * Supports both development (dev: true) and production (dev: false) modes.
 * In production mode, Next.js serves the pre-built .next output.
 */
import next from 'next';
import http from 'node:http';
import type { IWebServerService } from '../../application/ports/output/services/web-server-service.interface.js';
export interface WebServerDeps {
    createNextApp: typeof next;
    createHttpServer: typeof http.createServer;
}
/**
 * Resolve the web UI directory path.
 * Works in both development (src/) and production (dist/) contexts.
 *
 * Development: import.meta.dirname = <root>/src/infrastructure/services/
 *   → ../../presentation/web → <root>/src/presentation/web/
 *
 * Production (npm install): import.meta.dirname = <root>/dist/src/infrastructure/services/
 *   → ../../../../web → <root>/web/
 */
export declare function resolveWebDir(): {
    dir: string;
    dev: boolean;
};
export declare class WebServerService implements IWebServerService {
    private app;
    private server;
    private isShuttingDown;
    private readonly deps;
    constructor(deps?: Partial<WebServerDeps>);
    /**
     * Start the Next.js web server.
     * @param port - Port to listen on
     * @param dir - Path to the Next.js web package directory
     * @param dev - Whether to run in development mode (default: auto-detect)
     */
    start(port: number, dir: string, dev?: boolean): Promise<void>;
    /**
     * Gracefully stop the server.
     */
    stop(): Promise<void>;
}
//# sourceMappingURL=web-server.service.d.ts.map