useIntersectionObserver.d.ts 431 Bytes
Newer Older
Sangjune Bae's avatar
Sangjune Bae committed
1
2
3
4
5
6
7
8
/**
 * Setup an [`IntersectionObserver`](https://developer.mozilla.org/en-US/docs/Web/API/IntersectionObserver) on
 * a DOM Element.
 *
 * @param element The DOM element to observe
 * @param init IntersectionObserver options
 */
export default function useIntersectionObserver<TElement extends Element>(element: TElement | null | undefined, { threshold, root, rootMargin }?: IntersectionObserverInit): IntersectionObserverEntry[];