-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathIntersectionObserverTypes.res
More file actions
69 lines (63 loc) · 2.34 KB
/
Copy pathIntersectionObserverTypes.res
File metadata and controls
69 lines (63 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
@@warning("-30")
open DOMTypes
@editor.completeFrom(IntersectionObserverRoot)
type root
/**
provides a way to asynchronously observe changes in the intersection of a target element with an ancestor element or with a top-level document's viewport.
[See IntersectionObserver on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserver)
*/
@editor.completeFrom(IntersectionObserver)
type intersectionObserver = {
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/root)
*/
root: root,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/rootMargin)
*/
rootMargin: string,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/thresholds)
*/
thresholds: array<float>,
}
/**
This Intersection Observer API interface describes the intersection between the target element and its root container at a specific moment of transition.
[See IntersectionObserverEntry on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry)
*/
type intersectionObserverEntry = {
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/time)
*/
time: float,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/rootBounds)
*/
rootBounds: Null.t<domRectReadOnly>,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/boundingClientRect)
*/
boundingClientRect: domRectReadOnly,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/intersectionRect)
*/
intersectionRect: domRectReadOnly,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/isIntersecting)
*/
isIntersecting: bool,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/intersectionRatio)
*/
intersectionRatio: float,
/**
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/IntersectionObserverEntry/target)
*/
target: element,
}
type intersectionObserverInit = {
mutable root?: root,
mutable rootMargin?: string,
mutable threshold?: array<float>,
}
type intersectionObserverCallback = (array<intersectionObserverEntry>, intersectionObserver) => unit