"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const textMessageBuilder = require("./text-protocol/message-builder");
const textMessageParse = require("./text-protocol/message-parser");
const socket_wrapper_1 = require("../../base/socket-wrapper");
class TextWSSocketWrapper extends socket_wrapper_1.WSSocketWrapper {
    constructor() {
        super(...arguments);
        this.socketType = 'wsText';
    }
    getMessage(message) {
        return textMessageBuilder.getMessage(message, false);
    }
    getAckMessage(message) {
        return textMessageBuilder.getMessage(message, true);
    }
    parseMessage(message) {
        if (typeof message !== 'string') {
            this.invalidTypeReceived();
            return [];
        }
        return textMessageParse.parse(message);
    }
    parseData(message) {
        return textMessageParse.parseData(message);
    }
}
exports.TextWSSocketWrapper = TextWSSocketWrapper;
exports.createWSSocketWrapper = function (socket, handshakeData, services, config, connectionEndpoint) { return new TextWSSocketWrapper(socket, handshakeData, services, config, connectionEndpoint, false); };
//# sourceMappingURL=socket-wrapper-factory.js.map