import { addEventListener } from '../component/event-handler';
import isBrowser from '../isBrowser';
function getWidth() {
    return Math.max(document.documentElement.clientWidth, window.innerWidth);
}
function getHeight() {
    return Math.max(document.documentElement.clientHeight, window.innerHeight);
}
var viewportHeight = 0;
var viewportWidth = 0;
if (isBrowser) {
    viewportHeight = getHeight();
    viewportWidth = getWidth();
    addEventListener(window, 'resize', function () {
        viewportHeight = getHeight();
        viewportWidth = getWidth();
    }, { passive: true });
}
export function getViewportHeight() {
    return viewportHeight;
}
export function getViewportWidth() {
    return viewportWidth;
}
export function getViewportSize() {
    return {
        width: viewportWidth,
        height: viewportHeight,
    };
}
export default getViewportSize;
