import { RefObject } from 'react'; export interface UseIntersectionOnceOptions extends Omit { root?: RefObject | Element | null; } /** * useIntersectionOnce Hook - 元素进入视口"一次性"检测 * * 检测 targetRef 引用的元素是否进入了 root(默认 viewport)的可视区域, * 一旦进入则永久返回 true,并断开 observer,常用于懒加载 / 首屏曝光埋点。 * * @remarks * - SSR 安全:服务端 useLayoutEffect 退化为 useEffect,避免 hydration 警告 * - 不支持 IntersectionObserver 的环境(旧浏览器 / SSR)下直接置 true, * 保证业务能拿到内容(如懒加载组件不至于永远不渲染) * - threshold 数组与 rootMargin 字符串通过 JSON.stringify 序列化为稳定 deps key, * 避免父组件每次渲染传新对象时 effect 反复重建 */ export declare const useIntersectionOnce: (targetRef: RefObject, options?: UseIntersectionOnceOptions) => boolean;