UNPKG

@stimulus-library/mixins

Version:

A library of useful controllers for Stimulus

14 lines (13 loc) 773 B
import { Controller } from "@hotwired/stimulus"; export declare function useIntersectionObserver(controller: Controller, handler: IntersectionObserverCallback, options?: IntersectionObserverInit): { observer: IntersectionObserver; teardown: () => void; observe: (element: HTMLElement) => void | undefined; unobserve: (element: HTMLElement) => void | undefined; }; export declare function useIntersection(controller: Controller, element: HTMLElement, appear?: null | ((entry: IntersectionObserverEntry) => void), disappear?: null | ((entry: IntersectionObserverEntry) => void), options?: IntersectionObserverInit): { observer: IntersectionObserver; observe: () => void | undefined; unobserve: () => void | undefined; teardown: () => void; };