import { LayoutRectangle, NativeScrollEvent } from 'react-native'; export interface Root { /** * 대상 컴포넌트의 NodeHandle */ node: any; /** * 가로 스크롤 활성화 여부 */ horizontal: boolean; /** * 대상 컴포넌트의 스크롤 이벤트 */ current: NativeScrollEvent; onLayout?: () => void; onScroll?: (event: NativeScrollEvent) => void; } export interface Element { inView: boolean; intersectionRatio: number; layout: LayoutRectangle; measureLayout: (node: any, callback: (x: number, y: number, width: number, height: number) => void) => void; onLayout?: () => void; } export interface IntersectionObserverEntry { target: Element; isIntersecting: boolean; intersectionRatio: number; } export interface RootMargin { left?: number; right?: number; top?: number; bottom?: number; } export interface IntersectionObserverOptions { /** * 요소를 감싸고 있는 컴포넌트 정보 */ root: Root; rootMargin?: RootMargin; threshold?: number | number[]; } export type IntersectionObserverCallback = (entries: IntersectionObserverEntry[]) => void; export declare const defaultRootMargin: RootMargin; export declare const defaultThreshold = 0; /** * @kind class * @name IntersectionObserver * @description * React Native 환경을 위해 구현된 IntersectionObserver 에요. * * @param {IntersectionObserverCallback} callback - 대상 요소의 노출 상태가 변경될 때 호출되는 콜백이에요. * @param {IntersectionObserverOptions} options - IntersectionObserver 동작을 제어하는 옵션 객체에요. */ declare class IntersectionObserver { protected callback: IntersectionObserverCallback; protected options: IntersectionObserverOptions; protected targets: Element[]; constructor(callback: IntersectionObserverCallback, options: IntersectionObserverOptions); protected measureTarget: (target: Element) => void; protected handleLayout: () => void; protected handleScroll: () => void; observe(target: Element): void; unobserve(target: Element): void; } export default IntersectionObserver;