|
| 1 | +(** The Intersection Observer API provides a way to asynchronously observe |
| 2 | + changes in the intersection of a target element with an ancestor element or |
| 3 | + with a top-level document's viewport. |
| 4 | +
|
| 5 | + https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API *) |
| 6 | + |
| 7 | +class type intersectionObserverEntry = |
| 8 | + object |
| 9 | + method target : Dom.node Js.t Js.readonly_prop |
| 10 | + |
| 11 | + method boundingClientRect : Dom_html.clientRect Js.t Js.readonly_prop |
| 12 | + |
| 13 | + method rootBounds : Dom_html.clientRect Js.t Js.readonly_prop |
| 14 | + |
| 15 | + method intersectionRect : Dom_html.clientRect Js.t Js.readonly_prop |
| 16 | + |
| 17 | + method intersectionRatio : float Js.t Js.readonly_prop |
| 18 | + |
| 19 | + method isIntersecting : bool Js.t Js.readonly_prop |
| 20 | + (* Missing Dom.highResTimeStamp |
| 21 | + method time : Dom.highResTimeStamp Js.t Js.readonly_prop *) |
| 22 | + end |
| 23 | + |
| 24 | +class type intersectionObserverOptions = |
| 25 | + object |
| 26 | + method root : Dom.node Js.t Js.writeonly_prop |
| 27 | + |
| 28 | + method rootMargin : Js.js_string Js.t Js.writeonly_prop |
| 29 | + |
| 30 | + method threshold : float Js.js_array Js.t Js.writeonly_prop |
| 31 | + end |
| 32 | + |
| 33 | +class type intersectionObserver = |
| 34 | + object |
| 35 | + method root : Dom.node Js.t Js.readonly_prop |
| 36 | + |
| 37 | + method rootMargin : Js.js_string Js.t Js.readonly_prop |
| 38 | + |
| 39 | + method threshold : float Js.t Js.readonly_prop |
| 40 | + |
| 41 | + method observe : #Dom.node Js.t -> unit Js.meth |
| 42 | + |
| 43 | + method unobserve : #Dom.node Js.t -> unit Js.meth |
| 44 | + |
| 45 | + method disconnect : unit Js.meth |
| 46 | + |
| 47 | + method takeRecords : intersectionObserverEntry Js.t Js.js_array Js.meth |
| 48 | + end |
| 49 | + |
| 50 | +val empty_intersection_observer_options : unit -> intersectionObserverOptions Js.t |
| 51 | + |
| 52 | +val is_supported : unit -> bool |
| 53 | + |
| 54 | +val intersectionObserver : |
| 55 | + ( ( intersectionObserverEntry Js.t Js.js_array Js.t |
| 56 | + -> intersectionObserver Js.t |
| 57 | + -> unit) |
| 58 | + Js.callback |
| 59 | + -> intersectionObserverOptions Js.t |
| 60 | + -> intersectionObserver Js.t) |
| 61 | + Js.constr |
0 commit comments