import { Accessor } from 'solid-js'; import { MaybeElementAccessor, Pausable, MaybeAccessor } from '@solidjs-use/shared'; import { ConfigurableWindow } from '../_configurable.js'; interface UseIntersectionObserverOptions extends ConfigurableWindow { /** * Start the IntersectionObserver immediately on creation * * @default true */ immediate?: boolean; /** * The Element or Document whose bounds are used as the bounding box when testing for intersection. */ root?: MaybeElementAccessor; /** * A string which specifies a set of offsets to add to the root's bounding_box when calculating intersections. */ rootMargin?: string; /** * Either a single number or an array of numbers between 0.0 and 1. */ threshold?: number | number[]; } interface UseIntersectionObserverReturn extends Pausable { isSupported: Accessor; stop: () => void; } /** * Detects that a target element's visibility. * * @see https://solidjs-use.github.io/solidjs-use/core/useIntersectionObserver */ declare function useIntersectionObserver(target: MaybeElementAccessor | MaybeAccessor | MaybeElementAccessor[], callback: IntersectionObserverCallback, options?: UseIntersectionObserverOptions): UseIntersectionObserverReturn; export { UseIntersectionObserverOptions, UseIntersectionObserverReturn, useIntersectionObserver };