UNPKG

react-intersection-observer-ng

Version:

Monitor if a component is inside the viewport, using IntersectionObserver API

20 lines (19 loc) 785 B
/** * Set the `isIntersecting` on all current IntersectionObserver instances * @param isIntersecting {boolean} */ export declare function mockAllIsIntersecting(isIntersecting: boolean): void; /** * Set the `isIntersecting` for the IntersectionObserver of a specific element. * @param element {Element} * @param isIntersecting {boolean} */ export declare function mockIsIntersecting(element: Element, isIntersecting: boolean): void; /** * Call the `intersectionMockInstance` method with an element, to get the (mocked) * `IntersectionObserver` instance. You can use this to spy on the `observe` and * `unobserve` methods. * @param element {Element} * @return IntersectionObserver */ export declare function intersectionMockInstance(element: Element): IntersectionObserver;