Many new things

This commit is contained in:
UnlegitDqrk
2026-02-28 17:39:42 +01:00
parent a84c626416
commit a9b0ccb8a7
30 changed files with 2490 additions and 150 deletions

View File

@@ -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);
}