summary refs log tree commit diff stats
path: root/lib/js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/js')
-rw-r--r--lib/js/dom.nim8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/js/dom.nim b/lib/js/dom.nim
index ceb0375b7..ba9b4159d 100644
--- a/lib/js/dom.nim
+++ b/lib/js/dom.nim
@@ -1832,3 +1832,11 @@ since (1, 7):
 
   proc matches*(self: Node; cssSelector: cstring): bool {.importjs: "(#.$1(#) || false)".}
     ## https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
+
+
+since (2, 1):
+  type VisualViewport* {.importc.} = ref object of EventTarget
+    offsetLeft*, offsetTop*, pageLeft*, pageTop*, width*, height*, scale*: float
+    onResize*, onScroll*: proc (event: Event) {.closure.}
+
+  func visualViewport*(self: Window): VisualViewport {.importjs: "#.$1", nodecl.}