/**
 * @license
 * Copyright 2025-2026 Open Home Foundation
 * SPDX-License-Identifier: Apache-2.0
 */
import { Observable } from "@matter/main";
import { WebSocket } from "ws";
import { type BinaryFrame, type BleProxyCommandMap, type BleProxyCommandName, type BleProxyEventName } from "./BleProxyProtocol.js";
/**
 * One BLE proxy client socket. Owns that client's handshake state, pending
 * command map, and command/event/binary-frame plumbing. The hub
 * (`BleProxyHandler`) creates one per accepted WebSocket connection.
 */
export declare class BleProxyConnection {
    #private;
    readonly binaryFrameReceived: Observable<[frame: BinaryFrame], void>;
    readonly eventReceived: Observable<[event: BleProxyEventName, data: Record<string, unknown>], void>;
    /** Emitted once when this connection completes the protocol handshake. */
    readonly handshakeCompleted: Observable<[], void>;
    /** Emitted once when this connection is torn down (close, error, or handshake failure). */
    readonly closed: Observable<[], void>;
    constructor(ws: WebSocket);
    get id(): string;
    get connected(): boolean;
    /**
     * Send a typed command to this client and wait for the response.
     * Rejects if the connection is not ready or the client disconnects first.
     */
    sendCommand<C extends BleProxyCommandName>(command: C, ...rest: BleProxyCommandMap[C]["args"] extends undefined ? [] : [args: BleProxyCommandMap[C]["args"]]): Promise<BleProxyCommandMap[C]["result"]>;
    sendBinaryFrame(opcode: number, connectionHandle: number, payload: Uint8Array): void;
    /** Close the socket if open, reject all pending commands, emit `closed` once. */
    close(): void;
}
//# sourceMappingURL=BleProxyConnection.d.ts.map