import { RefObject } from "react"; //#region src/fluid.d.ts /** What {@link useFluidWidth} returns. */ interface FluidWidth { /** Attach to the element you want measured — usually the chart's container. */ ref: RefObject; /** Integer CSS pixels: `initial` until a non-zero measurement lands. */ width: number; } /** * Track a container's width and feed it to a chart's `width` prop. * * `initial` is the width you render on the server, on the first client paint, * and in any environment without `ResizeObserver`. It defaults to 80 — the * width most charts fall back to when you pass no `width` at all — so the hook * starts where the chart already starts. Pass your own number to reserve the * layout you expect and skip the reflow when the measurement arrives. * * A measured 0 never reaches `width`. A collapsed disclosure, an inactive tab * and a `display: none` ancestor all measure 0, and a chart 0 units wide draws * nothing, so the last real width holds until the box comes back. * * Widths round to whole pixels, matching the integer viewBox coordinates the * charts render in, and commit once per animation frame. * * Attach `ref` to one element and keep it for the life of the component: the * observer binds on mount, so swapping the node out leaves it on the old one. */ declare function useFluidWidth(initial?: number): FluidWidth; //#endregion export { FluidWidth, useFluidWidth };