/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import type { RemoteRequest } from "#behavior/system/remote/api/RemoteRequest.js"; import type { RemoteResponse } from "#behavior/system/remote/api/RemoteResponse.js"; import type { Environment } from "@matter/general"; /** * Client-side WebSocket connection to a remote matter.js node. * * Manages request/response correlation and subscription streaming. */ export declare class WebSocketConnection { #private; constructor(url: string, env: Environment); get url(): string; /** * Open the WebSocket connection and start the read loop. */ open(): Promise; /** * Close the connection. */ close(): Promise; /** * Send a request and wait for a single response. */ request(request: Omit): Promise; /** * Send a subscribe request. Returns the subscription ID and installs a listener for streaming responses. * * The caller receives the "ok" confirmation, then subsequent update/delete responses arrive via the listener. */ subscribe(request: Omit, listener: (response: RemoteResponse) => void): Promise; /** * Remove a subscription listener. */ unsubscribe(id: string): void; } //# sourceMappingURL=WebSocketConnection.d.ts.map