import type { ClusterMethodParams, ClusterMethodResults, SubscriptionMethod, UnaryClusterMethod } from './generated/protocol.js'; import { ClusterProtocolError } from './errors.js'; import type { WebSocketLike } from './socket.js'; import { type ConnectionCloseSnapshot, type ConnectionState } from './connection-state.js'; export { CONNECTION_TRANSITIONS, PROTOCOL_DIAGNOSTIC_CAPACITY, type ConnectionCloseSnapshot, type ConnectionState, } from './connection-state.js'; import type { CallOptions, EstablishedSubscription, SubscriptionRegistration } from './connection-types.js'; export type { CallOptions, EstablishedSubscription, SubscriptionKind, SubscriptionRegistration, } from './connection-types.js'; export declare class Connection { #private; readonly closed: Promise; readonly closeDiagnostics: unknown[]; readonly protocolDiagnostics: ClusterProtocolError[]; constructor(socket: WebSocketLike); get state(): ConnectionState; get pendingSize(): number; get subscriptionCount(): number; get closeCode(): number | undefined; get closeReason(): undefined; get closeSnapshot(): ConnectionCloseSnapshot | undefined; call(method: M, params: ClusterMethodParams[M], options?: CallOptions): Promise; cancelSubscription(registration: SubscriptionRegistration): Promise; openSubscription(method: M, params: ClusterMethodParams[M], options?: CallOptions): Promise>; unregisterSubscription(id: string, registration: SubscriptionRegistration): void; recordDiagnostic(error: unknown): void; close(): Promise; }