/// <reference types="node" />
import { Server as HttpServer } from 'http';
import { Handle } from '@dojo/interfaces/core';
import Executor from './executors/Executor';
import Promise from '@dojo/shim/Promise';
export default class Server implements ServerProperties {
    basePath: string;
    excludeInstrumentation: boolean | RegExp;
    executor: Executor;
    instrument: boolean;
    instrumenterOptions: any;
    port: number;
    runInSync: boolean;
    server: HttpServer;
    socketPort: number;
    private _wsServer;
    private _codeCache;
    private _sessions;
    constructor(options: ServerOptions);
    start(): Promise<{}>;
    stop(): Promise<void>;
    subscribe(sessionId: string, listener: ServerListener): Handle;
    private _getSession(sessionId);
    private _handler(request, response);
    private _handleFile(request, response, shouldInstrument?, omitContent?);
    private _handleMessage(message);
    private _handleWebSocket(client);
    private _publish(message);
    private _send404(response);
}
export interface ServerProperties {
    basePath: string;
    excludeInstrumentation: boolean | RegExp;
    executor: Executor;
    instrument: boolean;
    instrumenterOptions: any;
    port: number;
    runInSync: boolean;
    socketPort: number;
}
export interface ServerListener {
    (name: string, data: any): void;
}
export declare type ServerOptions = Partial<ServerProperties> & {
    executor: Executor;
};
