import { IDevServerService } from "./i-dev-server-service";
import { IRequestHandler } from "./request-handler/i-request-handler";
import { IDevServerServiceServeOptions } from "./i-dev-server-service-serve-options";
import { RequestIndexSubscriber } from "./request-index-subscriber";
import { ILoggerService } from "../logger/i-logger-service";
import { ResponseReadySubscriber } from "./response-ready-subscriber";
import { IDevServerServeResult } from "./i-dev-server-serve-result";
/**
 * A class that can generate a HTTP2 development server with support for Gzip and Brotli compression
 */
export declare class DevServerService implements IDevServerService {
    private readonly logger;
    private readonly requestHandler;
    /**
     * 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<IDevServerServiceServeOptions>}
     */
    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: ILoggerService, requestHandler: IRequestHandler);
    /**
     * 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<IDevServerServiceServeOptions>}
     */
    getActiveOptions(): Set<IDevServerServiceServeOptions>;
    /**
     * Starts a new HTTP2 server and listens on the given port
     * @param {IDevServerServiceServeOptions} options
     * @returns {Promise<IDevServerServeResult>}
     */
    serve(options: IDevServerServiceServeOptions): Promise<IDevServerServeResult>;
    /**
     * Stops all currently running servers
     * @returns {Promise<void>}
     */
    stop(): Promise<void>;
    /**
     * Removes the leading slash from a path
     * @param {string} path
     * @returns {string}
     */
    private ensureLeadingSlash(path);
    /**
     * Listens for "stream" events on the given Http2SecureServer
     * @param {Http2SecureServer} server
     * @param {IDevServerServiceServeOptions} serverOptions
     * @param {number} websocketPort
     */
    private listenForServerStream(server, serverOptions, websocketPort);
    /**
     * Stops the server that matches the given options
     * @param {IDevServerServiceServeOptions} options
     * @returns {Promise<void>}
     */
    private stopServerSetForOptions(options);
    /**
     * Stops the given server (by closing its' connection)
     * @param {Http2SecureServer|HttpServer|TCPServer|WebSocket.Server} server
     * @returns {Promise<void>}
     */
    private stopServer(server);
    /**
     * Gets a Uid to use for the server map
     * @param {IDevServerServiceServeOptions} options
     * @returns {string}
     */
    private getServerMapUid({host, port});
    /**
     * Gets the server set that matches the given options
     * @param {IDevServerServiceServeOptions} options
     * @returns {IServerSet | undefined}
     */
    private getServerSetForOptions(options);
    /**
     * Sets the server that matches the given options
     * @param {IServerSet} serverSet
     * @param {IDevServerServiceServeOptions} options
     */
    private setServerSetForOptions(serverSet, options);
}
