"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.hasScrollbar = hasScrollbar;
exports.isScrollableChild = isScrollableChild;
exports.isScrollable = isScrollable;
const MethodNotImplementedError_1 = require("../exception/MethodNotImplementedError");
const SCROLLABLE_OVERFLOW = ['auto', 'scroll'];
function hasScrollbar() {
    throw new MethodNotImplementedError_1.MethodNotImplementedError();
}
function isScrollableChild(element, parentElement) {
    return true;
}
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();
    }
}
//# sourceMappingURL=isScrollable.js.map