@stackoverfloweth/vue-compositions
Version:
A collection of reusable vue compositions.
15 lines (14 loc) • 800 B
TypeScript
import { Ref, MaybeRef, MaybeRefOrGetter } from 'vue';
export type UseIntersectionObserverResponse = {
observe: (element: MaybeRefOrGetter<HTMLElement | undefined>) => void;
unobserve: (element: MaybeRefOrGetter<HTMLElement | undefined>) => void;
disconnect: () => void;
check: (element: MaybeRefOrGetter<HTMLElement | undefined>) => void;
};
export type UseIntersectionObserverOptions = {
root?: Element | Document | null | Ref<Element | null>;
rootMargin?: string;
threshold?: number | number[];
};
export type UseIntersectionObserverCallback = (entries: IntersectionObserverEntry[]) => void;
export declare function useIntersectionObserver(callback: UseIntersectionObserverCallback, options?: MaybeRef<UseIntersectionObserverOptions>): UseIntersectionObserverResponse;