"use strict";

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

var _propTypes = _interopRequireDefault(require("prop-types"));

var _integer = require("./integer");

var _filter = require("./filter");

var _productSearchResult = require("./product-search-result");

var _sortOption = require("./sort-option");

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

/* Copyright (c) 2018 Mobify Research & Development Inc. All rights reserved. */

/* * *  *  * *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  *  * */

/**
 * @memberOf module:types
 * @typedef {Object} ProductSearch
 * @property {module:types.Integer} count The number of products returned.
 * @property {Array.<module:types.Filter>} filters The available search filters.
 * @property {Array.<module:types.ProductSearchResult>} results The product search results.
 * @property {String} query The search query.
 * @property {Object} selectedFilters The selected filters applied to the results as a propertyId and value map.
 * @property {String} selectedSortingOption The selected sorting option. NOTE: Only single sorting is supported.
 * @property {Array.<module:types.SortOption>} sortingOptions The available sorting options.
 * @property {module:types.Integer} start The search start index.
 * @property {module:types.Integer} total The search hit count.
 */
var ProductSearch = {
  count: _integer.Integer.isRequired,
  filters: _propTypes["default"].arrayOf(_propTypes["default"].shape(_filter.Filter)),
  results: _propTypes["default"].arrayOf(_propTypes["default"].shape(_productSearchResult.ProductSearchResult)),
  query: _propTypes["default"].string,
  selectedFilters: _propTypes["default"].object,
  selectedSortingOption: _propTypes["default"].string,
  sortingOptions: _propTypes["default"].arrayOf(_propTypes["default"].shape(_sortOption.SortOption)),
  start: _integer.Integer.isRequired,
  total: _integer.Integer.isRequired
};
exports.ProductSearch = ProductSearch;