vue-hooks-plus
Version:
Vue hooks library
18 lines (17 loc) • 857 B
TypeScript
import { BasicTarget } from '../utils/domTarget';
export interface UseInViewportOptions {
/**
* Margin around the root
*/
rootMargin?: string;
/**
* Either a single number or an array of numbers which indicate at what percentage of the target's visibility the ratio should be executed
*/
threshold?: number | number[];
/**
* The element that is used as the viewport for checking visibility of the target. Must be the ancestor of the target. Defaults to the browser viewport if not specified or if null.
*/
root?: BasicTarget<Element>;
}
declare function useInViewport(target: BasicTarget, options?: UseInViewportOptions): readonly [Readonly<import("vue").Ref<boolean | undefined, boolean | undefined>>, Readonly<import("vue").Ref<number | undefined, number | undefined>>];
export default useInViewport;