import { IDevServer } from "./i-dev-server";
import { IDevServerServeOptions } from "./i-dev-server-serve-options";
import { RequestIndexSubscriber } from "./request-index-subscriber";
import { IBuildLogger } from "../build-debugger/i-build-logger";
import { ResponseReadySubscriber } from "./response-ready-subscriber";
/**
 * A class that can generate a HTTP2 development server with support for Gzip and Brotli compression
 */
export declare class DevServer implements IDevServer {
    private readonly logger;
    /**
     * A TLS handshake record starts with byte 22.
     * @type {number}
     */
    private readonly TLS_HANDSHAKE_RECORD_BYTE;
    /**
     * The HTTP status code for redirecting
     * @type {number}
     */
    private readonly HTTP_REDIRECT_STATUS_CODE;
    /**
     * A map between hosts and the underlying HttpServers and HTTP2SecureServers being used to host and listen on them
     * @type {Map<string, IServerSet>}
     */
    private readonly serverMap;
    /**
     * Gets the Set of all currently active serve options
     * @type {Set<IDevServerServeOptions>}
     */
    private readonly activeOptions;
    /**
     * All the subscriber callbacks to invoke when the index is requested.
     * These may optionally return a specific index.html file to resolve
     * @type {Set<RequestIndexSubscriber>}
     */
    private readonly onRequestIndexSubscribers;
    /**
     * All the subscriber callbacks to invoke when the response headers has been set and the response is about to be sent.
     * These may be useful for setting additional headers or manipulating existing ones
     * @type {Set<RequestIndexSubscriber>}
     */
    private readonly onResponseReadySubscribers;
    constructor(logger: IBuildLogger);
    /**
     * Adds a subscriber callback to invoke when the index is requested.
     * This may optionally return a specific index.html file to resolve
     * @param {RequestIndexSubscriber} callback
     */
    onRequestIndex(callback: RequestIndexSubscriber): void;
    /**
     * Adds a subscriber callback to invoke when response headers has been set and
     * a response is about to be sent to the client
     * @param {ResponseReadySubscriber} callback
     */
    onResponseReady(callback: ResponseReadySubscriber): void;
    /**
     * Gets all currently active options
     * @returns {Set<IDevServerServeOptions>}
     */
    getActiveOptions(): Set<IDevServerServeOptions>;
    /**
     * Starts a new HTTP2 server and listens on the given port
     * @param {IDevServerServeOptions} options
     * @returns {Promise<void>}
     */
    serve(options: IDevServerServeOptions): Promise<void>;
    /**
     * Stops all currently running servers
     * @returns {Promise<void>}
     */
    stop(): Promise<void>;
    /**
     * Listens for "stream" events on the given Http2SecureServer
     * @param {Http2SecureServer} server
     * @param {IDevServerServeOptions} serverOptions
     */
    private listenForServerStream(server, serverOptions);
    /**
     * Stops the server that matches the given options
     * @param {IDevServerServeOptions} options
     * @returns {Promise<void>}
     */
    private stopServerSetForOptions(options);
    /**
     * Stops the given server (by closing its' connection)
     * @param {Http2SecureServer|HttpServer|TCPServer} server
     * @returns {Promise<void>}
     */
    private stopServer(server);
    /**
     * Gets a Uid to use for the server map
     * @param {IDevServerServeOptions} options
     * @returns {string}
     */
    private getServerMapUid({host, port});
    /**
     * Gets the server set that matches the given options
     * @param {IDevServerServeOptions} options
     * @returns {IServerSet | undefined}
     */
    private getServerSetForOptions(options);
    /**
     * Sets the server that matches the given options
     * @param {IServerSet} serverSet
     * @param {IDevServerServeOptions} options
     */
    private setServerSetForOptions(serverSet, options);
}
