"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isScrollable = exports.isScrollableChild = exports.hasScrollbar = void 0;
const SCROLLABLE_OVERFLOW = ['auto', 'scroll'];
function hasScrollbar() {
    // TODO
    return true;
}
exports.hasScrollbar = hasScrollbar;
function isScrollableChild(element, parentElement) {
    return true;
}
exports.isScrollableChild = isScrollableChild;
function isScrollable(element) {
    if (element === null) {
        return false;
    }
    const { style: { overflowY, overflowX }, } = element;
    const isParentScrollable = () => {
        const { parentElement } = element;
        if (parentElement) {
            return (isScrollableChild(element, parentElement) && isScrollable(parentElement));
        }
        else {
            return false;
        }
    };
    if (SCROLLABLE_OVERFLOW.includes(overflowY)) {
        const { clientHeight, scrollHeight } = element;
        if (scrollHeight > clientHeight) {
            return true;
        }
        else {
            return isParentScrollable();
        }
    }
    else if (SCROLLABLE_OVERFLOW.includes(overflowX)) {
        const { scrollWidth, clientWidth } = element;
        if (scrollWidth > clientWidth) {
            return true;
        }
        else {
            return isParentScrollable();
        }
    }
    else {
        return isParentScrollable();
    }
}
exports.isScrollable = isScrollable;
//# sourceMappingURL=isScrollable.js.map