"use strict";

exports.__esModule = true;
exports.default = void 0;
var _constants = require("./constants");
var selector = element => hook => element.querySelectorAll("[data-hook=\"".concat(hook, "\"]"));
var _default = _ref => {
  var {
    element
  } = _ref;
  var byHook = selector(element);
  return {
    exists: () => !!element,
    /** return number of lines rendered */
    getNumLines: () => byHook(_constants.dataHooks.line).length,
    /** return boolean representing whether given spacing is rendered */
    hasSpacing: spacing => element.getAttribute('data-spacing') === spacing,
    /** return boolean representing whether given list of sizes is rendered */
    hasSizes: sizes => {
      var [assertions] = Array.from(byHook(_constants.dataHooks.chunk)).reduce((_ref2, chunkElement) => {
        var [result, [expectedSize, ...restSizes]] = _ref2;
        return [result.concat(chunkElement.getAttribute('data-size') === expectedSize), restSizes];
      }, [[], sizes]);
      return assertions.every(Boolean);
    },
    /** return boolean representing whether given alignment is rendered */
    hasAlignment: alignment => element.getAttribute('data-alignment') === alignment
  };
};
exports.default = _default;
//# sourceMappingURL=Skeleton.driver.js.map