import { type MaybeElementRef } from '@vueuse/core'; import { type Ref } from 'vue'; /** * Options for an element that is being observed. */ export type UseSharedIntersectionObserverTargetOptions = { /** * A callback method that will fire each time the element's * intersecting state changes. */ onChange?: (isIntersecting: boolean) => void; /** * If true, the element will only be observed until the first * time that its intersection state becomes true, at which * point it will be detached. This is particularly useful for * situations where rendering/events can be deferred until they * come into the viewport. */ once?: boolean; }; /** * Config for the {@link useSharedIntersectionObserver} composable. */ export type UseSharedIntersectionObserverOptions = UseSharedIntersectionObserverTargetOptions & IntersectionObserverInit; /** * The return type of {@link useSharedIntersectionObserver}. */ export type UseSharedIntersectionObjectReturn = { isIntersecting: Ref; stop: () => void; }; /** * A composable utility for interacting with an IntersectionObserver. * * The benefits of using this over utilizing observers directly is that this * method will reuse existing observers when possible - particularly useful * in heavy-use situations like custom image deferral, where a large * quantity of images would lead to a large quantity of IntersectionObserver * and possible performance degradation. */ export declare function useSharedIntersectionObserver(target: MaybeElementRef, options?: UseSharedIntersectionObserverOptions): UseSharedIntersectionObjectReturn;