import type { ExpressMain } from '@teambit/express';
import type { GraphqlMain } from '@teambit/graphql';
import type { Logger } from '@teambit/logger';
import { RspackDevServer } from '@rspack/dev-server';
import type { ComponentServer } from '@teambit/bundler';
import type { StartPlugin } from './start-plugin';
import type { UIRoot } from './ui-root';
import type { UiMain } from './ui.main.runtime';
export type UIServerProps = {
    graphql: GraphqlMain;
    express: ExpressMain;
    ui: UiMain;
    uiRoot: UIRoot;
    uiRootExtension: string;
    logger: Logger;
    publicDir: string;
    startPlugins: StartPlugin[];
};
export type StartOptions = {
    /**
     * Absolute path to the ui bundle (generated during the bit build).
     */
    bundleUiRoot?: string;
    /**
     * port range for the UI server to bind. default is a port range of 4000-4200.
     */
    portRange?: number[] | number;
};
export declare class UIServer {
    private graphql;
    private expressExtension;
    private ui;
    private uiRoot;
    private uiRootExtension;
    private logger;
    private publicDir;
    private plugins;
    private _app;
    private _server;
    private _proxyRoutes;
    constructor(graphql: GraphqlMain, expressExtension: ExpressMain, ui: UiMain, uiRoot: UIRoot, uiRootExtension: string, logger: Logger, publicDir: string, plugins: StartPlugin[]);
    getName(): string;
    private _port;
    get port(): number;
    /** the hostname for the server to listen at. Currently statically 'localhost' */
    get host(): string;
    /** the server listens at this url */
    get fullUrl(): string;
    get buildOptions(): {
        ssr?: boolean;
        launchBrowserOnStart?: boolean;
        prebundle?: boolean;
    } | undefined;
    /**
     * get the webpack configuration of the UI server.
     */
    getDevConfig(): Promise<import("./rspack/rspack.dev.config").RspackConfigWithDevServer>;
    private setReady;
    private startPromise;
    get whenReady(): Promise<[void, ...void[]]>;
    addComponentServerProxy(server: ComponentServer): void;
    private configureProxy;
    /**
     * start a UI server.
     */
    start({ bundleUiRoot, portRange }?: StartOptions): Promise<void>;
    private setupServerSideRendering;
    /**
     * start a UI dev server.
     */
    dev({ portRange }?: StartOptions): Promise<RspackDevServer>;
    private selectPort;
    private getProxyFromPlugins;
    private getProxy;
    private getDevServerConfig;
    static create(props: UIServerProps): UIServer;
}
