Skip to content

Commit

Permalink
Merge pull request #137 from mvaled/visualViewport
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSpyder authored Oct 10, 2024
2 parents bc2065b + 9e8dca8 commit 9504425
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/Webapi/Dom/Webapi__Dom__VisualViewport.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/// Support for https://developer.mozilla.org/en-US/docs/Web/API/VisualViewport

type t

@get external height: t => int = "height"
@get external width: t => int = "width"
@get external scale: t => float = "scale"
@get external offsetLeft: t => int = "offsetLeft"
@get external offsetTop: t => int = "offsetTop"
@get external pageLeft: t => int = "pageLeft"
@get external pageTop: t => int = "pageTop"

include Webapi__Dom__EventTarget.Impl({
type t = t
})
3 changes: 3 additions & 0 deletions src/Webapi/Dom/Webapi__Dom__Window.res
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ module Impl = (
@set
external setOnLoad: (t_window, unit => unit) => unit =
"onload" /* use addEventListener instead? */

/* VisualViewport API */
@get external visualViewport: t_window => Webapi__Dom__VisualViewport.t = "visualViewport"
}

type t = Dom.window
Expand Down
1 change: 1 addition & 0 deletions src/Webapi/Webapi__Dom.res
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ module TransitionEvent = Webapi__Dom__TransitionEvent
module TreeWalker = Webapi__Dom__TreeWalker
module UiEvent = Webapi__Dom__UiEvent
module ValidityState = Webapi__Dom__ValidityState
module VisualViewport = Webapi__Dom__VisualViewport
module WebGlContextEvent = Webapi__Dom__WebGlContextEvent
module WheelEvent = Webapi__Dom__WheelEvent
module Window = Webapi__Dom__Window
Expand Down

0 comments on commit 9504425

Please sign in to comment.