UNPKG

wotsui-intersection-observer

Version:
21 lines (20 loc) 813 B
export interface IntersectionHandlerOptions { threshold?: number; observeOnce?: boolean; toggleOpacity?: boolean; intersectionClass?: string; noIntersectionClass?: string; intersectionHandler?: (entry: IntersectionObserverEntry) => any; noIntersectionHandler?: (entry: IntersectionObserverEntry) => any; } export default class IntersectionHandler { _observer: IntersectionObserver; options: IntersectionHandlerOptions; constructor(options: IntersectionHandlerOptions); parseOptions(obj: { [prop: string]: any; }): IntersectionHandlerOptions; observe(el: Element): void; observerCallback(entries: IntersectionObserverEntry[], observer: IntersectionObserver): void; applySettings(el: Element, isIntersecting: boolean): void; }