package org.openautonomousconnection.luascript.hosts; import java.util.Map; /** * Layout and scrolling related accessors. * *

All results are plain maps to keep dependencies minimal.

*/ public interface GeometryHost { /** * Returns bounding client rect of an element. * * @param elementId element id * @return map: x,y,width,height,top,left,right,bottom */ Map getBoundingClientRect(String elementId); /** * Returns viewport metrics. * * @return map: width,height,devicePixelRatio,scrollX,scrollY */ Map getViewport(); /** * Scrolls the document to coordinates. * * @param x scroll x * @param y scroll y */ void scrollTo(double x, double y); /** * Scrolls an element into view. * * @param elementId element id * @param align one of: "start","center","end","nearest" (null => "nearest") */ void scrollIntoView(String elementId, String align); }