Determine the panel width or any elements actual width

Is there any solid way to determine the panel width or any DOM element’s actual width without window.getComputedStyle, element.clientHeight or element.getBoundingClientRect?

None of the following is returning something useful:

    console.log(document.documentElement.clientHeight);
    console.log(document.documentElement.offsetWidth);
    console.log(document.documentElement.scrollWidth);
    console.log(window.innerHeight);
    console.log(document.body.clientWidth);
    console.log(document.body.offsetWidth);
    console.log(el.offsetWidth);
    console.log(el.clientWidth);
    console.log(el.width);
    console.log(el.style.width);
    console.log(el.scrollWidth);
    console.log(el.getBoundingClientRect()); // always returns { _x: 0, _y: 0, _width: 0, _height: 0 }
    console.log(el.getClientRects);
    console.log(window.matchMedia);
    console.log(window.getComputedStyle);
    console.log(document.getComputedStyle);
    console.log(global.getComputedStyle);

@kerrishotts can answer UXP related questions