import type { DevServerOptions } from './types/common.ts';
/**
 * Exposes the API to start the development server in HMR, watch or static mode
 *
 * In HMR mode, the DevServer will exec the "bin/server.ts" file and let hot-hook
 * manage the changes using hot module reloading.
 *
 * In watch mode, the DevServer will start an internal watcher and restarts the server
 * after every file change. The files must be part of the TypeScript project (via tsconfig.json),
 * or registered as metaFiles.
 *
 * In static mode, the server runs without file watching or hot reloading.
 *
 * @example
 * const devServer = new DevServer(cwd, { hmr: true, hooks: [] })
 * await devServer.start(ts)
 */
export declare class DevServer {
    #private;
    /**
     * CLI UI instance for displaying colorful messages and progress information
     */
    ui: {
        colors: import("@poppinss/colors/types").Colors;
        logger: import("@poppinss/cliui").Logger;
        table: (tableOptions?: Partial<import("@poppinss/cliui/types").TableOptions>) => import("@poppinss/cliui").Table;
        tasks: (tasksOptions?: Partial<import("@poppinss/cliui/types").TaskManagerOptions>) => import("@poppinss/cliui").TaskManager;
        steps: () => import("@poppinss/cliui").Steps;
        icons: {
            tick: string;
            cross: string;
            bullet: string;
            nodejs: string;
            pointer: string;
            info: string;
            warning: string;
            squareSmallFilled: string;
            borderVertical: string;
        };
        sticker: () => import("@poppinss/cliui").Instructions;
        instructions: () => import("@poppinss/cliui").Instructions;
        switchMode(modeToUse: "raw" | "silent" | "normal"): void;
        useRenderer(rendererToUse: import("@poppinss/cliui/types").RendererContract): void;
        useColors(colorsToUse: import("@poppinss/colors/types").Colors): void;
    };
    /**
     * The mode in which the DevServer is running
     *
     * Returns the current operating mode of the development server:
     * - 'hmr': Hot Module Reloading enabled
     * - 'watch': File system watching with full restarts
     * - 'static': No file watching or hot reloading
     */
    get mode(): "hmr" | "watch" | "static";
    /**
     * Script file to start the development server
     */
    scriptFile: string;
    /**
     * The current working directory URL
     */
    cwd: URL;
    /**
     * File path computed from the cwd
     */
    cwdPath: string;
    /**
     * Development server configuration options including hooks and environment variables
     */
    options: DevServerOptions;
    /**
     * Create a new DevServer instance
     *
     * @param cwd - The current working directory URL
     * @param options - Development server configuration options
     */
    constructor(cwd: URL, options: DevServerOptions);
    /**
     * Adds listener to get notified when dev server is closed
     *
     * Registers a callback function that will be invoked when the development
     * server's child process exits. The callback receives the exit code.
     *
     * @param callback - Function to call when dev server closes
     * @returns This DevServer instance for method chaining
     *
     * @example
     * devServer.onClose((exitCode) => {
     *   console.log(`Server closed with exit code: ${exitCode}`)
     * })
     */
    onClose(callback: (exitCode: number) => any): this;
    /**
     * Adds listener to get notified when dev server encounters an error
     *
     * Registers a callback function that will be invoked when the development
     * server's child process encounters an error or fails to start.
     *
     * @param callback - Function to call when dev server encounters an error
     * @returns This DevServer instance for method chaining
     *
     * @example
     * devServer.onError((error) => {
     *   console.error('Dev server error:', error.message)
     * })
     */
    onError(callback: (error: any) => any): this;
    /**
     * Closes watchers and terminates the running child process
     *
     * Cleans up keyboard shortcuts, stops file system watchers, and kills
     * the HTTP server child process. This should be called when shutting down
     * the development server.
     *
     * @example
     * await devServer.close()
     */
    close(): Promise<void>;
    /**
     * Starts the development server in static or HMR mode
     *
     * Initializes the server and starts the HTTP server. The mode is determined
     * by the `hmr` option in DevServerOptions. In HMR mode, hot-hook is configured
     * to enable hot module reloading.
     *
     * @param ts - TypeScript module reference
     *
     * @example
     * const devServer = new DevServer(cwd, { hmr: true, hooks: [] })
     * await devServer.start(ts)
     */
    start(): Promise<void>;
    /**
     * Starts the development server in watch mode and restarts on file changes
     *
     * Initializes the server, starts the HTTP server, and sets up a file system
     * watcher that monitors for changes. When files are added, modified, or deleted,
     * the server automatically restarts. The watcher respects TypeScript project
     * configuration and metaFiles settings.
     *
     * @param ts - TypeScript module reference
     * @param options - Watch options including polling mode
     *
     * @example
     * const devServer = new DevServer(cwd, { hooks: [] })
     * await devServer.startAndWatch(ts, { poll: false })
     */
    startAndWatch(options?: {
        poll: boolean;
    }): Promise<void>;
}
