import getClientSize from './getClientSize';

/**
 * 获取页面宽高
 * @returns {{pageWidth: number, pageHeight: number}}
 */
function getPageSize() {
  var _getClientSize = getClientSize(),
      clientWidth = _getClientSize.clientWidth,
      clientHeight = _getClientSize.clientHeight;

  var doc = document;
  var db = doc.body;
  var de = doc.documentElement;
  return {
    pageWidth: Math.max(db.scrollWidth, de.scrollWidth, clientWidth),
    pageHeight: Math.max(db.scrollHeight, de.scrollHeight, clientHeight)
  };
}

export default getPageSize;
