var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

export var SettingTypes = function () {
  function SettingTypes() {
    _classCallCheck(this, SettingTypes);
  }

  _createClass(SettingTypes, null, [{
    key: 'typeOf',
    value: function typeOf(obj) {
      var type = obj.type;

      var knownTypes = [SettingTypes.TYPE_TEXT, SettingTypes.TYPE_TEXTAREA, SettingTypes.TYPE_CHOICE, SettingTypes.TYPE_BOOLEAN];

      return -1 === knownTypes.indexOf(type) ? null : type;
    }
  }, {
    key: 'TYPE_TEXT',
    get: function get() {
      return 'text';
    }
  }, {
    key: 'TYPE_TEXTAREA',
    get: function get() {
      return 'textarea';
    }
  }, {
    key: 'TYPE_CHOICE',
    get: function get() {
      return 'choice';
    }
  }, {
    key: 'TYPE_BOOLEAN',
    get: function get() {
      return 'boolean';
    }
  }]);

  return SettingTypes;
}();