export { IndexedPeer }; export type { PeerSender }; import type { AckResultStatus } from '../shared-ws.js'; import { ReplayBuffer } from '../replay-buffer.js'; interface PeerSender { send(frame: Uint8Array, onCommit?: () => void): void; } /** Wraps a crossws peer, encodes frames with a fixed channel index. * Assigns sequence numbers. Frames are added to the replay buffer only once * they are committed to a transport send path. */ declare class IndexedPeer { private sender; private index; private replay; constructor(sender: PeerSender, index: number, replay: ReplayBuffer); /** Returns the frame's payload byte count (the caller's flow-control unit). */ sendText(data: string): number; /** Send a text frame that requests an ack response from the receiver. Returns seq. */ sendTextAckReq(data: string, onQueued?: (seq: number) => void): number; sendBinary(data: Uint8Array): void; /** Send a binary frame that requests an ack response from the receiver. Returns seq. */ sendBinaryAckReq(data: Uint8Array, onQueued?: (seq: number) => void): number; /** Send an acknowledgement response for a message the client sent. * ACK_RES frames use the normal sequenced send path and are replayable on reconnect. */ sendAckRes(ackedSeq: number, result: string, status?: AckResultStatus): void; sendCloseRequest(timeoutMs: number): void; sendCloseAck(): void; sendAbort(abortValue: string): void; sendError(): void; sendByteWindowUpdate(bytes: number): void; sendMsgWindowUpdate(count: number): void; sendBdpPing(): void; sendBdpPingAck(): void; sendPublish(data: string): void; sendPublishBinary(data: Uint8Array): void; }