<gh_stars>1-10
{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport { equals } from '../math-utils';\nimport assert from '../assert';\n\nvar TransitionInterpolator =\n/*#__PURE__*/\nfunction () {\n  function TransitionInterpolator() {\n    _classCallCheck(this, TransitionInterpolator);\n\n    _defineProperty(this, \"propNames\", []);\n  }\n\n  _createClass(TransitionInterpolator, [{\n    key: \"arePropsEqual\",\n\n    /**\n     * Checks if two sets of props need transition in between\n     * @param currentProps {object} - a list of viewport props\n     * @param nextProps {object} - a list of viewport props\n     * @returns {bool} - true if two props are equivalent\n     */\n    value: function arePropsEqual(currentProps, nextProps) {\n      var _iteratorNormalCompletion = true;\n      var _didIteratorError = false;\n      var _iteratorError = undefined;\n\n      try {\n        for (var _iterator = (this.propNames || [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n          var key = _step.value;\n\n          if (!equals(currentProps[key], nextProps[key])) {\n            return false;\n          }\n        }\n      } catch (err) {\n        _didIteratorError = true;\n        _iteratorError = err;\n      } finally {\n        try {\n          if (!_iteratorNormalCompletion && _iterator.return != null) {\n            _iterator.return();\n          }\n        } finally {\n          if (_didIteratorError) {\n            throw _iteratorError;\n          }\n        }\n      }\n\n      return true;\n    }\n    /**\n     * Called before transition starts to validate/pre-process start and end props\n     * @param startProps {object} - a list of starting viewport props\n     * @param endProps {object} - a list of target viewport props\n     * @returns {Object} {start, end} - start and end props to be passed\n     *   to `interpolateProps`\n     */\n\n  }, {\n    key: \"initializeProps\",\n    value: function initializeProps(startProps, endProps) {\n      return {\n        start: startProps,\n        end: endProps\n      };\n    }\n    /**\n     * Returns viewport props in transition\n     * @param startProps {object} - a list of starting viewport props\n     * @param endProps {object} - a list of target viewport props\n     * @param t {number} - a time factor between [0, 1]\n     * @returns {object} - a list of interpolated viewport props\n     */\n\n  }, {\n    key: \"interpolateProps\",\n    value: function interpolateProps(startProps, endProps, t) {\n      assert(false, 'interpolateProps is not implemented');\n    }\n  }]);\n\n  return TransitionInterpolator;\n}();\n\nexport { TransitionInterpolator as default };","map":null,"metadata":{},"sourceType":"module"}