/**
 * Pure-JS RFC 6455 WebSocket protocol implementation.
 *
 * Provides frame encoding/decoding and handshake utilities for running
 * a WebSocket server on react-native-tcp-socket without native crypto deps.
 */
export declare const OPCODE_CONTINUATION = 0;
export declare const OPCODE_TEXT = 1;
export declare const OPCODE_BINARY = 2;
export declare const OPCODE_CLOSE = 8;
export declare const OPCODE_PING = 9;
export declare const OPCODE_PONG = 10;
export interface DecodedFrame {
    opcode: number;
    fin: boolean;
    payload: Uint8Array;
    masked: boolean;
}
export interface DecodeResult {
    frames: DecodedFrame[];
    remainder: Uint8Array<any>;
}
/**
 * Compute the Sec-WebSocket-Accept value from the client's Sec-WebSocket-Key.
 */
export declare function computeAcceptKey(clientKey: string): string;
/**
 * Build the HTTP 101 Switching Protocols response for a WebSocket upgrade.
 */
export declare function buildUpgradeResponse(clientKey: string): string;
/** Encode a text message as a WebSocket frame. */
export declare function encodeTextFrame(text: string): Uint8Array;
/** Encode a PING frame with optional payload. */
export declare function encodePingFrame(payload?: Uint8Array): Uint8Array;
/** Encode a PONG frame with the payload from the PING. */
export declare function encodePongFrame(payload: Uint8Array): Uint8Array;
/** Encode a CLOSE frame with optional status code and reason. */
export declare function encodeCloseFrame(code?: number, reason?: string): Uint8Array;
/**
 * Decode one or more WebSocket frames from a byte buffer.
 * Returns decoded frames and any unconsumed bytes (for partial frames).
 */
export declare function decodeFrames(buffer: Uint8Array): DecodeResult;
/**
 * Decode a text payload from a Uint8Array.
 */
export declare function decodeTextPayload(payload: Uint8Array): string;
//# sourceMappingURL=ws-protocol.d.ts.map