Many new things
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package org.openautonomousconnection.luascript.hosts;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Layout and scrolling related accessors.
|
||||
*
|
||||
* <p>All results are plain maps to keep dependencies minimal.</p>
|
||||
*/
|
||||
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<String, Object> getBoundingClientRect(String elementId);
|
||||
|
||||
/**
|
||||
* Returns viewport metrics.
|
||||
*
|
||||
* @return map: width,height,devicePixelRatio,scrollX,scrollY
|
||||
*/
|
||||
Map<String, Object> 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);
|
||||
}
|
||||
Reference in New Issue
Block a user