import { Height, SugarLocation, Width, WindowVisualViewport } from '@ephox/sugar';
import * as OuterPosition from '../frame/OuterPosition';
const pointed = (point, width, height) => ({
    point,
    width,
    height
});
const rect = (x, y, width, height) => ({
    x,
    y,
    width,
    height
});
const bounds = (x, y, width, height) => ({
    x,
    y,
    width,
    height,
    right: x + width,
    bottom: y + height
});
const box = (element) => {
    const xy = SugarLocation.absolute(element);
    const w = Width.getOuter(element);
    const h = Height.getOuter(element);
    return bounds(xy.left, xy.top, w, h);
};
// NOTE: We used to use AriaFocus.preserve here, but there is no reason to do that now that
// we are not changing the visibility of the element. Hopefully (2015-09-29).
const absolute = (element) => {
    const position = OuterPosition.find(element);
    const width = Width.getOuter(element);
    const height = Height.getOuter(element);
    return bounds(position.left, position.top, width, height);
};
const win = () => WindowVisualViewport.getBounds(window);
export { pointed, rect, bounds, box, absolute, win };
//# sourceMappingURL=Boxes.js.map