UNPKG

@jiaozhiye/qm-design-vue

Version:

A Component Library for Vue3.0

17 lines (16 loc) 971 B
export type ObserverInstanceCallback = (inView: boolean, entry: IntersectionObserverEntry) => void; /** * What should be the default behavior if the IntersectionObserver is unsupported? * Ideally the polyfill has been loaded, you can have the following happen: * - `undefined`: Throw an error * - `true` or `false`: Set the `inView` value to this regardless of intersection state * **/ export declare function defaultFallbackInView(inView: boolean | undefined): void; /** * @param element - DOM Element to observe * @param callback - Callback function to trigger when intersection status changes * @param options - Intersection Observer options * @param fallbackInView - Fallback inView value. * @return Function - Cleanup function that should be triggered to unregister the observer */ export declare function observe(element: Element, callback: ObserverInstanceCallback, options?: IntersectionObserverInit, fallbackInView?: boolean | undefined): () => void;