/**
 * WebSocket utility functions
 *
 * This module provides smartproxy-specific WebSocket utilities
 * and re-exports protocol utilities from the protocols module
 */
// Import and re-export from protocols
import { getMessageSize as protocolGetMessageSize, toBuffer as protocolToBuffer } from '../../protocols/websocket/index.js';
/**
 * Get the length of a WebSocket message regardless of its type
 * (handles all possible WebSocket message data types)
 *
 * @param data - The data message from WebSocket (could be any RawData type)
 * @returns The length of the data in bytes
 */
export function getMessageSize(data) {
    // Delegate to protocol implementation
    return protocolGetMessageSize(data);
}
/**
 * Convert any raw WebSocket data to Buffer for consistent handling
 *
 * @param data - The data message from WebSocket (could be any RawData type)
 * @returns A Buffer containing the data
 */
export function toBuffer(data) {
    // Delegate to protocol implementation
    return protocolToBuffer(data);
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2Vic29ja2V0LXV0aWxzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vdHMvY29yZS91dGlscy93ZWJzb2NrZXQtdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7O0dBS0c7QUFFSCxzQ0FBc0M7QUFDdEMsT0FBTyxFQUFFLGNBQWMsSUFBSSxzQkFBc0IsRUFBRSxRQUFRLElBQUksZ0JBQWdCLEVBQUUsTUFBTSxvQ0FBb0MsQ0FBQztBQUc1SDs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsY0FBYyxDQUFDLElBQTBEO0lBQ3ZGLHNDQUFzQztJQUN0QyxPQUFPLHNCQUFzQixDQUFDLElBQUksQ0FBQyxDQUFDO0FBQ3RDLENBQUM7QUFFRDs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSxRQUFRLENBQUMsSUFBMEQ7SUFDakYsc0NBQXNDO0lBQ3RDLE9BQU8sZ0JBQWdCLENBQUMsSUFBSSxDQUFDLENBQUM7QUFDaEMsQ0FBQyJ9