var ConnectionState;
(function (ConnectionState) {
    ConnectionState[ConnectionState["DISCONNECTED"] = 0] = "DISCONNECTED";
    ConnectionState[ConnectionState["CONNECTING"] = 1] = "CONNECTING";
    ConnectionState[ConnectionState["CONNECTED"] = 2] = "CONNECTED";
    ConnectionState[ConnectionState["DISCONNECTING"] = 3] = "DISCONNECTING";
})(ConnectionState || (ConnectionState = {}));

var ComProtocol;
(function (ComProtocol) {
    class Errors extends Error {
        // private static fromErrorCode(code: ErrorCode) {
        //     return new ComProtocolError(code, ComProtocolError.errorCodeToMessage(code));
        // }
        // public static errorCodeToMessage(code: ErrorCode): string {
        //     switch (code) {
        //         case ErrorCode.ProtocolNotConnected:
        //             return
        //         case ErrorCode.TimeoutError:
        //             return "request timeout";
        //         default:
        //             return "unknown error"
        //     }
        // }
        constructor(code, msg) {
            super(msg);
            this.code = code;
        }
        static operationCanceled() {
            return new Errors(ErrorCode.OperationCancelled, 'Communication protocol operation cancelled');
        }
        static notConnected(info) {
            return new Errors(ErrorCode.ProtocolNotConnected, 'Communication protocol is not connected');
        }
        static timeoutError(info) {
            return new Errors(ErrorCode.TimeoutError, info.msg || 'Communication protocol timeout');
        }
        static unknownError() {
            return new Errors(ErrorCode.UnknownError, 'Unnown communication protocol error');
        }
    }
    ComProtocol.Errors = Errors;
    let ErrorCode;
    (function (ErrorCode) {
        ErrorCode["ProtocolNotConnected"] = "ProtocolNotConnected";
        ErrorCode["TimeoutError"] = "TimeoutError";
        ErrorCode["UnknownError"] = "UnknownError";
        ErrorCode["OperationCancelled"] = "OperationCancelled";
    })(ErrorCode = ComProtocol.ErrorCode || (ComProtocol.ErrorCode = {}));
})(ComProtocol || (ComProtocol = {}));

/**
 * Generated bundle index. Do not edit.
 */

export { ComProtocol, ConnectionState };
//# sourceMappingURL=iotize-tap-protocol-api.js.map
