import { type ColumnsOption } from './columns'; /** Resolved position of a single item within the grid. */ export interface ItemPosition { x: number; y: number; width: number; } /** Full result of a layout pass. */ export interface LayoutResult { positions: ItemPosition[]; /** Content height of the tallest column, excluding the trailing gutter. */ containerHeight: number; columnCount: number; columnWidth: number; } export interface ComputeLayoutParams { /** Number of items to place. */ count: number; /** Measured height per index. Holes are filled with `fallbackHeight`. */ heights: ArrayLike; containerWidth: number; gutter: number; minColWidth: number; /** Fixed count or breakpoint map; overrides `minColWidth` when set. */ columns?: ColumnsOption; /** Height assumed for not-yet-measured items. Default: 0 */ fallbackHeight?: number; } /** * Compute masonry positions using shortest-column-first placement. * * This is the single source of truth for the layout algorithm — the vanilla * engine and every framework adapter call it, so a fix here fixes all of them. * It is pure: no DOM reads, no DOM writes, fully unit-testable. * * Ties are broken toward the leftmost column, which keeps placement stable and * visually top-left weighted. */ export declare function computeLayout(params: ComputeLayoutParams): LayoutResult;