/** * Имитация IntersectionObserver. */ export declare class IntersectionObserverMock implements IntersectionObserver { /** * Создает новый реестр экземпляров IntersectionObserverMock. * @return Реестр. */ static createRegistry(): IntersectionObserverRegistry; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/root). */ readonly root: Element | Document | null; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/rootMargin). */ readonly rootMargin: string; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/scrollMargin). */ readonly scrollMargin: string; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/thresholds). */ readonly thresholds: ReadonlyArray; protected readonly callback: IntersectionObserverCallback; protected readonly options: IntersectionObserverInit | undefined; /** * @inheritdoc */ constructor(callback: IntersectionObserverCallback, options?: IntersectionObserverInit); /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/disconnect). * @inheritdoc */ disconnect(): void; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/observe). * @inheritdoc */ observe(target: Element): void; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/takeRecords). * @inheritdoc */ takeRecords(): IntersectionObserverEntry[]; /** * [MDN Reference](https://developer.mozilla.org/docs/Web/API/IntersectionObserver/unobserve). * @inheritdoc */ unobserve(target: Element): void; /** * Имитирует изменение состояния наблюдаемого элемента. * @param entry Данные состояния. */ simulateEntryChange({ target, isIntersecting, intersectionRatio, }: Pick): void; } /** * Реестр экземпляров IntersectionObserverMock. */ export declare class IntersectionObserverRegistry { protected readonly items: Set; /** * @inheritdoc */ constructor(); /** * Создает, регистрирует и возвращает новый экземпляр IntersectionObserverMock. * @param params Аргументы IntersectionObserverMock. * @return Экземпляр IntersectionObserverMock. */ getObserver(...params: ConstructorParameters): IntersectionObserverMock; /** * Имитирует изменение состояния наблюдаемого элемента на всех экземплярах в реестре. * @param entry Данные состояния. */ simulateEntryChange(entry: Pick): void; }