"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));

var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));

var _classPrivateFieldGet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldGet"));

var _classPrivateFieldSet2 = _interopRequireDefault(require("@babel/runtime/helpers/classPrivateFieldSet"));

var _lodash = _interopRequireDefault(require("lodash"));

function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }

function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }

var _routeMap = /*#__PURE__*/new WeakMap();

var _callback = /*#__PURE__*/new WeakMap();

var ModulesHttp = /*#__PURE__*/function () {
  function ModulesHttp() {
    (0, _classCallCheck2["default"])(this, ModulesHttp);

    _classPrivateFieldInitSpec(this, _routeMap, {
      writable: true,
      value: void 0
    });

    _classPrivateFieldInitSpec(this, _callback, {
      writable: true,
      value: void 0
    });

    (0, _classPrivateFieldSet2["default"])(this, _routeMap, []);
  }
  /**
   *
   * @param {String} url
   * @param {function(Object, Object)} callback
   * @return {ModulesHttp}
   */


  (0, _createClass2["default"])(ModulesHttp, [{
    key: "get",
    value: function get(url, callback) {
      (0, _classPrivateFieldSet2["default"])(this, _callback, _lodash["default"].extend({
        request: {},
        response: {
          send: function () {
            var _send = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {
              return _regenerator["default"].wrap(function _callee$(_context) {
                while (1) {
                  switch (_context.prev = _context.next) {
                    case 0:
                    case "end":
                      return _context.stop();
                  }
                }
              }, _callee);
            }));

            function send(_x) {
              return _send.apply(this, arguments);
            }

            return send;
          }()
        }
      }, callback));
      return this;
    }
    /**
     *
     * @param {String} url
     * @param {function(Object, Object)} callback
     * @return {ModulesHttp}
     */

  }, {
    key: "post",
    value: function post(url, callback) {
      (0, _classPrivateFieldGet2["default"])(this, _routeMap).push({
        url: url,
        code: 200
      });
      return this;
    }
  }]);
  return ModulesHttp;
}();

var _default = ModulesHttp;
exports["default"] = _default;
//# sourceMappingURL=index.js.map