2022-04-02 00:44:16 +03:00
|
|
|
#import <DOM/Document.idl>
|
2022-02-15 22:40:51 +03:30
|
|
|
#import <DOM/Element.idl>
|
|
|
|
|
#import <DOM/Node.idl>
|
2023-07-06 23:44:07 +01:00
|
|
|
#import <IntersectionObserver/IntersectionObserverEntry.idl>
|
2022-02-15 22:40:51 +03:30
|
|
|
|
2023-10-25 17:27:19 +02:00
|
|
|
// https://w3c.github.io/IntersectionObserver/#intersection-observer-callback
|
2022-03-30 23:45:36 +03:00
|
|
|
callback IntersectionObserverCallback = undefined (sequence<IntersectionObserverEntry> entries, IntersectionObserver observer);
|
|
|
|
|
|
2023-10-25 17:27:19 +02:00
|
|
|
// https://w3c.github.io/IntersectionObserver/#intersection-observer-interface
|
2023-09-03 02:00:01 +12:00
|
|
|
[Exposed=(Window)]
|
2021-10-13 14:20:50 -04:00
|
|
|
interface IntersectionObserver {
|
2022-03-30 23:45:36 +03:00
|
|
|
constructor(IntersectionObserverCallback callback, optional IntersectionObserverInit options = {});
|
2023-07-06 23:44:07 +01:00
|
|
|
readonly attribute (Element or Document)? root;
|
2024-11-22 12:01:42 +01:00
|
|
|
readonly attribute DOMString rootMargin;
|
|
|
|
|
readonly attribute DOMString scrollMargin;
|
2025-04-25 10:07:43 -04:00
|
|
|
readonly attribute FrozenArray<double> thresholds;
|
2024-11-22 12:01:42 +01:00
|
|
|
readonly attribute long delay;
|
|
|
|
|
readonly attribute boolean trackVisibility;
|
2021-10-13 14:20:50 -04:00
|
|
|
undefined observe(Element target);
|
|
|
|
|
undefined unobserve(Element target);
|
|
|
|
|
undefined disconnect();
|
2023-07-06 23:44:07 +01:00
|
|
|
sequence<IntersectionObserverEntry> takeRecords();
|
2021-10-13 14:20:50 -04:00
|
|
|
};
|
|
|
|
|
|
2023-10-25 17:27:19 +02:00
|
|
|
// https://w3c.github.io/IntersectionObserver/#intersection-observer-init
|
2021-10-13 14:20:50 -04:00
|
|
|
dictionary IntersectionObserverInit {
|
2022-04-02 00:44:16 +03:00
|
|
|
(Element or Document)? root = null;
|
2021-10-13 14:20:50 -04:00
|
|
|
DOMString rootMargin = "0px";
|
2024-11-22 12:01:42 +01:00
|
|
|
DOMString scrollMargin = "0px";
|
2022-04-02 00:44:16 +03:00
|
|
|
(double or sequence<double>) threshold = 0;
|
2024-11-22 12:01:42 +01:00
|
|
|
long delay = 0;
|
|
|
|
|
boolean trackVisibility = false;
|
2021-10-13 14:20:50 -04:00
|
|
|
};
|