/**
 * ws (WebSocket) shim for browser environment
 * Used by Vite for HMR (Hot Module Replacement)
 */
import { EventEmitter } from './events';
export declare class WebSocket extends EventEmitter {
    static readonly CONNECTING = 0;
    static readonly OPEN = 1;
    static readonly CLOSING = 2;
    static readonly CLOSED = 3;
    readonly CONNECTING = 0;
    readonly OPEN = 1;
    readonly CLOSING = 2;
    readonly CLOSED = 3;
    readyState: number;
    url: string;
    protocol: string;
    extensions: string;
    bufferedAmount: number;
    binaryType: 'blob' | 'arraybuffer';
    private _id;
    private _server;
    onopen: ((event: Event) => void) | null;
    onclose: ((event: CloseEvent) => void) | null;
    onerror: ((event: Event) => void) | null;
    onmessage: ((event: MessageEvent) => void) | null;
    constructor(url: string, protocols?: string | string[]);
    private _connect;
    send(data: string | ArrayBuffer | Uint8Array): void;
    close(code?: number, reason?: string): void;
    ping(): void;
    pong(): void;
    terminate(): void;
    _setServer(server: WebSocketServer): void;
    _receiveMessage(data: unknown): void;
}
export interface ServerOptions {
    host?: string;
    port?: number;
    server?: unknown;
    noServer?: boolean;
    path?: string;
    clientTracking?: boolean;
    perMessageDeflate?: boolean | object;
    maxPayload?: number;
}
export declare class WebSocketServer extends EventEmitter {
    clients: Set<WebSocket>;
    options: ServerOptions;
    private _path;
    private _channelHandler;
    constructor(options?: ServerOptions);
    private _setupListener;
    _handleClientMessage(client: WebSocket, data: unknown): void;
    handleUpgrade(request: unknown, socket: unknown, head: unknown, callback: (ws: WebSocket, request: unknown) => void): void;
    close(callback?: () => void): void;
    address(): {
        port: number;
        family: string;
        address: string;
    } | null;
}
export default WebSocket;
export declare const Server: typeof WebSocketServer;
export declare const createWebSocketStream: () => never;
//# sourceMappingURL=ws.d.ts.map