import NodeWebSocket from "ws"; import type { ITransport, ITransportEventMap } from "./ITransport.ts"; export declare class WebSocketTransport implements ITransport { ws: WebSocket | NodeWebSocket; protocols?: string | string[]; events: ITransportEventMap; constructor(events: ITransportEventMap); send(data: Buffer | Uint8Array): void; /** * WebSocket has no unreliable channel, so this falls back to the reliable * one — which is what every caller is written against (see `sendRequest`, * and the input handle's redundancy ring). Dropping instead loses every * `mode:"unreliable"` input and request silently: the server never sees * them, and the client's pending set grows without bound because nothing * is ever acked. * * The cost of falling back is bandwidth, not correctness — an input ring * carries `historySize` redundant slots the ordered channel doesn't need, * and the server dedupes them by wire seq exactly as it would over * datagrams. Use `@colyseus/h3-transport` for real unreliable delivery. */ sendUnreliable(data: Buffer | Uint8Array): void; /** * @param url URL to connect to * @param headers custom headers to send with the connection (only supported in Node.js. Web Browsers do not allow setting custom headers) */ connect(url: string, headers?: any): void; close(code?: number, reason?: string): void; get isOpen(): boolean; }