'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

var getClientSize = _interopDefault(require('./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)
  };
}

module.exports = getPageSize;
