/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The measured client size of an element, tracked through resizes. * * The HEIGHT exists for the R2 height clamp (#591). v2 sizes the * expand-in-place render as `min(renderHeight, canvas − strips − ruler)` — the * render takes what the row's declaration asks for, but never so much that the * context strips it exists to preserve are pushed out of view. That * subtraction needs a real pixel canvas, and the Plan's own `height` / * `maxHeight` cannot supply one: they are CSS strings (`"fill"` → `"100%"`, * `calc(...)`, a token) resolved by layout, not by us. So the viewport is * measured rather than parsed — the scroll element `VirtualRows` hands back * through `scrollElRef`. The links layer reads the same view to clamp its * ribbons (#818). * * The WIDTH is the links layer's (#818): a ribbon's x is a run's window * fraction across the plot, and the plot's px are the layer's width less the * grid's fixed tracks. * * `undefined` until first measure, and while the element is absent (an * unbounded frame has no scroll element — the body grows to content, and * nothing needs clamping). * * @packageDocumentation */ import { type RefObject } from "react"; /** * Track an element's `clientHeight`. * * @param ref - The element to measure (`null` while unmounted / unbounded) * @param active - Skip observing entirely when false (no focus, nothing to clamp) * @returns The measured height in px, or `undefined` when there is nothing to measure */ export declare function useElementHeight(ref: RefObject, active: boolean): number | undefined; /** * Track an element's `clientWidth`. * * @param ref - The element to measure * @param active - Skip observing entirely when false * @param keep - Keep the last reading while inactive, for a caller that reads it only while active; left out, it is dropped * @returns The measured width in px, or `undefined` when there is nothing to measure */ export declare function useElementWidth(ref: RefObject, active: boolean, keep?: boolean): number | undefined; //# sourceMappingURL=use-element-height.d.ts.map