1 | /**
|
2 | * Setup an [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) on
|
3 | * a DOM Element that returns it's entries as they arrive.
|
4 | *
|
5 | * @param element The DOM element to observe
|
6 | * @param init IntersectionObserver options with a notable change,
|
7 | * unlike a plain IntersectionObserver `root: null` means "not provided YET",
|
8 | * and the hook will wait until it receives a non-null value to set up the observer.
|
9 | * This change allows for easier syncing of element and root values in a React
|
10 | * context.
|
11 | */
|
12 | declare function useIntersectionObserver<TElement extends Element>(element: TElement | null | undefined, options?: IntersectionObserverInit): IntersectionObserverEntry[];
|
13 | /**
|
14 | * Setup an [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) on
|
15 | * a DOM Element. This overload does not trigger component updates when receiving new
|
16 | * entries. This allows for finer grained performance optimizations by the consumer.
|
17 | *
|
18 | * @param element The DOM element to observe
|
19 | * @param callback A listener for intersection updates.
|
20 | * @param init IntersectionObserver options with a notable change,
|
21 | * unlike a plain IntersectionObserver `root: null` means "not provided YET",
|
22 | * and the hook will wait until it receives a non-null value to set up the observer.
|
23 | * This change allows for easier syncing of element and root values in a React
|
24 | * context.
|
25 | *
|
26 | */
|
27 | declare function useIntersectionObserver<TElement extends Element>(element: TElement | null | undefined, callback: IntersectionObserverCallback, options?: IntersectionObserverInit): void;
|
28 | export default useIntersectionObserver;
|