export var getScroll = function (node, isVertical) {
    if (isVertical === void 0) { isVertical = true; }
    if (typeof window === 'undefined') {
        return 0;
    }
    var windowProp = isVertical ? 'pageYOffset' : 'pageXOffset';
    var elementProp = isVertical ? 'scrollTop' : 'scrollLeft';
    return node === window ? node[windowProp] : node[elementProp];
};
export var getRect = function (node) {
    if (node === void 0) { node = window; }
    return node !== window
        ? node.getBoundingClientRect()
        : {
            top: 0,
            left: 0,
            bottom: 0,
            right: 0,
            width: window.document.documentElement.clientWidth,
            height: window.document.documentElement.clientHeight,
        };
};
export var getAbsolutePosition = function (node) {
    if (node === void 0) { node = window; }
    if (node === window) {
        return { x: 0, y: 0 };
    }
    var x = node.getBoundingClientRect().left + document.documentElement.scrollLeft;
    var y = node.getBoundingClientRect().top + document.documentElement.scrollTop;
    return { x: x, y: y };
};
export var getNodeHeight = function (node) {
    if (!node) {
        return 0;
    }
    if (node === window) {
        return window.innerHeight;
    }
    return node.clientHeight;
};
export var getNodeScrollHeight = function (node) {
    if (!node) {
        return 0;
    }
    if (node === window) {
        return window.document.documentElement.scrollHeight;
    }
    return node.scrollHeight;
};
//# sourceMappingURL=dom.js.map