/**
 * Copyright (c) Microsoft Corporation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
import * as events from './events';
import type { TestServerInterface, TestServerInterfaceEvents } from '@testIsomorphic/testServerInterface';
import type * as reporterTypes from '../../types/testReporter';
export declare class TestServerConnectionClosedError extends Error {
}
export interface TestServerTransport {
    onmessage(listener: (message: string) => void): void;
    onopen(listener: () => void): void;
    onerror(listener: () => void): void;
    onclose(listener: () => void): void;
    send(data: string): void;
    close(): void;
}
export declare class WebSocketTestServerTransport implements TestServerTransport {
    private _ws;
    constructor(url: string | URL);
    onmessage(listener: (message: string) => void): void;
    onopen(listener: () => void): void;
    onerror(listener: () => void): void;
    onclose(listener: () => void): void;
    send(data: string): void;
    close(): void;
}
export declare class TestServerConnection implements TestServerInterface, TestServerInterfaceEvents {
    readonly onClose: events.Event<void>;
    readonly onReport: events.Event<any>;
    readonly onStdio: events.Event<{
        type: 'stderr' | 'stdout';
        text?: string | undefined;
        buffer?: string | undefined;
    }>;
    readonly onTestFilesChanged: events.Event<{
        testFiles: string[];
    }>;
    readonly onLoadTraceRequested: events.Event<{
        traceUrl: string;
    }>;
    readonly onTestPaused: events.Event<{
        errors: reporterTypes.TestError[];
    }>;
    private _onCloseEmitter;
    private _onReportEmitter;
    private _onStdioEmitter;
    private _onTestFilesChangedEmitter;
    private _onLoadTraceRequestedEmitter;
    private _onTestPausedEmitter;
    private _lastId;
    private _transport;
    private _callbacks;
    private _connectedPromise;
    private _isClosed;
    constructor(transport: TestServerTransport);
    isClosed(): boolean;
    private _sendMessage;
    private _sendMessageNoReply;
    private _dispatchEvent;
    initialize(params: Parameters<TestServerInterface['initialize']>[0]): ReturnType<TestServerInterface['initialize']>;
    ping(params: Parameters<TestServerInterface['ping']>[0]): ReturnType<TestServerInterface['ping']>;
    pingNoReply(params: Parameters<TestServerInterface['ping']>[0]): Promise<void>;
    watch(params: Parameters<TestServerInterface['watch']>[0]): ReturnType<TestServerInterface['watch']>;
    watchNoReply(params: Parameters<TestServerInterface['watch']>[0]): void;
    open(params: Parameters<TestServerInterface['open']>[0]): ReturnType<TestServerInterface['open']>;
    openNoReply(params: Parameters<TestServerInterface['open']>[0]): void;
    resizeTerminal(params: Parameters<TestServerInterface['resizeTerminal']>[0]): ReturnType<TestServerInterface['resizeTerminal']>;
    resizeTerminalNoReply(params: Parameters<TestServerInterface['resizeTerminal']>[0]): void;
    checkBrowsers(params: Parameters<TestServerInterface['checkBrowsers']>[0]): ReturnType<TestServerInterface['checkBrowsers']>;
    installBrowsers(params: Parameters<TestServerInterface['installBrowsers']>[0]): ReturnType<TestServerInterface['installBrowsers']>;
    runGlobalSetup(params: Parameters<TestServerInterface['runGlobalSetup']>[0]): ReturnType<TestServerInterface['runGlobalSetup']>;
    runGlobalTeardown(params: Parameters<TestServerInterface['runGlobalTeardown']>[0]): ReturnType<TestServerInterface['runGlobalTeardown']>;
    clearCache(params: Parameters<TestServerInterface['clearCache']>[0]): ReturnType<TestServerInterface['clearCache']>;
    listFiles(params: Parameters<TestServerInterface['listFiles']>[0]): ReturnType<TestServerInterface['listFiles']>;
    listTests(params: Parameters<TestServerInterface['listTests']>[0]): ReturnType<TestServerInterface['listTests']>;
    runTests(params: Parameters<TestServerInterface['runTests']>[0]): ReturnType<TestServerInterface['runTests']>;
    findRelatedTestFiles(params: Parameters<TestServerInterface['findRelatedTestFiles']>[0]): ReturnType<TestServerInterface['findRelatedTestFiles']>;
    stopTests(params: Parameters<TestServerInterface['stopTests']>[0]): ReturnType<TestServerInterface['stopTests']>;
    stopTestsNoReply(params: Parameters<TestServerInterface['stopTests']>[0]): void;
    closeGracefully(params: Parameters<TestServerInterface['closeGracefully']>[0]): ReturnType<TestServerInterface['closeGracefully']>;
    close(): void;
}
//# sourceMappingURL=testServerConnection.d.ts.map