import EventEmitter from 'events';
import uWebSockets from 'uWebSockets.js';
import { type Client, type ClientPrivate, ClientState, type ISendOptions } from '@colyseus/core';
export declare class uWebSocketWrapper extends EventEmitter {
    ws: uWebSockets.WebSocket<any>;
    constructor(ws: uWebSockets.WebSocket<any>);
}
export declare const ReadyState: {
    readonly CONNECTING: 0;
    readonly OPEN: 1;
    readonly CLOSING: 2;
    readonly CLOSED: 3;
};
export type ReadyState = (typeof ReadyState)[keyof typeof ReadyState];
export declare class uWebSocketClient implements Client, ClientPrivate {
    '~messages': any;
    id: string;
    _ref: uWebSocketWrapper;
    sessionId: string;
    state: ClientState;
    readyState: number;
    reconnectionToken: string;
    _enqueuedMessages: any[];
    _afterNextPatchQueue: any;
    _reconnectionToken: string;
    _joinedAt: number;
    constructor(id: string, _ref: uWebSocketWrapper);
    get ref(): uWebSocketWrapper;
    set ref(_ref: uWebSocketWrapper);
    sendBytes(type: string | number, bytes: Buffer | Uint8Array, options?: ISendOptions): void;
    send(messageOrType: any, messageOrOptions?: any | ISendOptions, options?: ISendOptions): void;
    enqueueRaw(data: Uint8Array | Buffer, options?: ISendOptions): void;
    raw(data: Uint8Array | Buffer, options?: ISendOptions, cb?: (err?: Error) => void): void;
    error(code: number, message?: string, cb?: (err?: Error) => void): void;
    leave(code?: number, data?: string): void;
    close(code?: number, data?: string): void;
    toJSON(): {
        sessionId: string;
        readyState: number;
    };
}
