/**
 * 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 { EventEmitter } from 'events';
import type { LaunchOptions } from '../types/types';
export type BrowserInfo = {
    guid: string;
    browserName: 'chromium' | 'firefox' | 'webkit';
    userDataDir?: string;
    launchOptions: LaunchOptions;
};
export type EndpointInfo = {
    title: string;
    endpoint?: string;
    workspaceDir?: string;
    metadata?: Record<string, any>;
};
export type BrowserDescriptor = EndpointInfo & {
    playwrightVersion: string;
    playwrightLib: string;
    browser: BrowserInfo;
};
export type BrowserStatus = BrowserDescriptor & {
    canConnect: boolean;
};
export interface ServerRegistryEvents {
    added: (descriptor: BrowserDescriptor) => void;
    removed: (guid: string) => void;
    changed: (descriptor: BrowserDescriptor) => void;
}
declare class ServerRegistry extends EventEmitter {
    private _descriptors;
    private _watcher;
    private _watcherRefs;
    private _ready;
    on<K extends keyof ServerRegistryEvents>(event: K, listener: ServerRegistryEvents[K]): this;
    off<K extends keyof ServerRegistryEvents>(event: K, listener: ServerRegistryEvents[K]): this;
    watch(): () => void;
    ready(): Promise<void>;
    list(): Promise<Map<string, BrowserDescriptor[]>>;
    create(browser: BrowserInfo, endpoint: EndpointInfo): Promise<void>;
    delete(guid: string): Promise<void>;
    deleteUserData(guid: string): Promise<void>;
    readDescriptor(guid: string): BrowserDescriptor;
    find(name: string): Promise<BrowserDescriptor | null>;
    private _browsersDir;
    private _startWatcher;
    private _onAddOrChange;
    private _stopWatcher;
}
export declare const serverRegistry: ServerRegistry;
export {};
//# sourceMappingURL=serverRegistry.d.ts.map