import { type RefObject } from 'react'; export interface UseListReflowOptions { /** * Changes to this string trigger a measurement pass — pass the rendered * ids in order (`items.map((i) => i.id).join()`), so the hook runs when * the list is reordered, added to or removed from, and not on every * unrelated re-render. */ key: string; /** * How long a row takes to travel to its new place, in milliseconds. * Matches the CSS the row paints via {@link REFLOW_ROW_CLASS}. */ durationMs?: number; /** * Force the reduced-motion branch. Defaults to reading * `prefers-reduced-motion: reduce`. When reduced, rows jump as before. */ reduceMotion?: boolean; } export interface UseListReflowReturn { /** Attach to the element that contains the tracked rows. */ containerRef: RefObject; } /** * Every tracked row must carry this class and a `data-reflow-id`. It parks * the row at the offset the hook sets and animates it back to zero; the * snap frame that sets the offset is exempted, so the jump itself is never * animated. */ export declare const REFLOW_ROW_CLASS: string; /** * Slides the surviving rows of a list to their new positions instead of * letting them snap. * * When a row is removed the rows below it jump up by its height, and the eye * loses its place — the list looks like it re-rendered rather than like one * row left. This runs the standard invert-and-play: it records where each * row sat, and after the DOM changes it puts each moved row back where it * was and releases it, so the gap closes as a movement. * * Measurement happens before paint, so no intermediate frame is shown. Rows * that are new (no previous position) are left alone — this animates travel, * not arrival. */ export declare function useListReflow({ key, durationMs, reduceMotion, }: UseListReflowOptions): UseListReflowReturn; //# sourceMappingURL=use-list-reflow.d.ts.map