UNPKG

472 BTypeScriptView Raw
1import 'intersection-observer';
2import type { BasicTarget } from '../utils/domTarget';
3type CallbackType = (entry: IntersectionObserverEntry) => void;
4export interface Options {
5 rootMargin?: string;
6 threshold?: number | number[];
7 root?: BasicTarget<Element>;
8 callback?: CallbackType;
9}
10declare function useInViewport(target: BasicTarget | BasicTarget[], options?: Options): readonly [boolean | undefined, number | undefined];
11export default useInViewport;