function getItemPosition({ itemSize, positions, gridSize, total, threshold, buffer }) {
  const span = getColumnSpan(itemSize.width, gridSize, total, threshold);
  const setY = getAvailablePositions(positions, span, total);
  const shortColumnIndex = getShortColumn(setY, buffer);

  // Position the item
  const point = new Point(gridSize * shortColumnIndex, setY[shortColumnIndex]);

  // Update the columns array with the new values for each column.
  // e.g. before the update the columns could be [250, 0, 0, 0] for an item
  // which spans 2 columns. After it would be [250, itemHeight, itemHeight, 0].
  const setHeight = setY[shortColumnIndex] + itemSize.height;
  for (let i = 0; i < span; i++) {
    positions[shortColumnIndex + i] = setHeight;
  }

  return point;
}
Determine the location of the next item, based on its size.
@param {Object} itemSize Object with width and height.
@param {Array.<number>} positions Positions of the other current items.
@param {number} gridSize The column width or row height.
@param {number} total The total number of columns or rows.
@param {number} threshold Buffer value for the column to fit.
@param {number} buffer Vertical buffer for the height of items.
@return {Point}