export interface UseElementHeightOptions { /** 是否立即计算高度 */ immediate?: boolean; /** 监听窗口大小变化 */ resizeObserver?: boolean; } /** * 用于计算元素高度的 hook * @param targetRef 目标元素的 ref * @param options 配置选项 * @returns 返回高度和重新计算的方法 */ export default function useElementHeight(targetRef: React.RefObject, options?: UseElementHeightOptions): { height: number; calculateHeight: () => void; };