import type { SharedBuilderConfig, StartDevServerOptions, StartServerResult, BuilderContext, OnAfterStartDevServerFn, OnBeforeStartDevServerFn, CompilerTapFn } from './types';
import type { ModernDevServerOptions, Server } from '@modern-js/server';
import { createAsyncHook } from './createHook';
import type { Compiler } from 'webpack';
type ServerOptions = Exclude<StartDevServerOptions['serverOptions'], undefined>;
export declare const getDevServerOptions: ({ builderConfig, serverOptions, port, }: {
    builderConfig: SharedBuilderConfig;
    serverOptions: ServerOptions;
    port: number;
}) => Promise<{
    config: ModernDevServerOptions['config'];
    devConfig: ModernDevServerOptions['dev'];
}>;
/** The context used by startDevServer. */
export type Context = BuilderContext & {
    hooks: {
        onBeforeStartDevServerHook: ReturnType<typeof createAsyncHook<OnBeforeStartDevServerFn>>;
        onAfterStartDevServerHook: ReturnType<typeof createAsyncHook<OnAfterStartDevServerFn>>;
    };
    config: Readonly<SharedBuilderConfig>;
};
export declare function startDevServer<Options extends {
    context: Context;
}>(options: Options, createDevServer: (options: Options, port: number, serverOptions: ServerOptions, compiler: StartDevServerOptions['compiler']) => Promise<Server>, { compiler, printURLs, strictPort, serverOptions, }?: StartDevServerOptions & {
    defaultPort?: number;
}): Promise<StartServerResult>;
type ServerCallbacks = {
    onInvalid: () => void;
    onDone: (stats: any) => void;
};
export declare const setupServerHooks: (compiler: {
    name?: Compiler['name'];
    hooks: {
        compile: CompilerTapFn<ServerCallbacks['onInvalid']>;
        invalid: CompilerTapFn<ServerCallbacks['onInvalid']>;
        done: CompilerTapFn<ServerCallbacks['onDone']>;
    };
}, hookCallbacks: ServerCallbacks) => void;
export declare const isClientCompiler: (compiler: {
    options: {
        target?: Compiler['options']['target'];
    };
    name?: Compiler['name'];
}) => boolean;
export {};
