/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * What a body item is known by as the rows move: its key for the virtual rows, the source element it stands for, its * place in the row space and among the grid's rows, the record's rows it stands for under the lens, and its drop row. * * @packageDocumentation */ import { type SheetBodyItem } from "./model.js"; /** * The record's rows a body item stands for under the lens (#1349): a row's * own — a line's or a sub row's, its group's — or the stretch a band reads or * a failed read covers; none for a proposal, which no row stands behind yet. */ export declare function spanOf(it: SheetBodyItem): { from: number; to: number; } | undefined; /** The boxes of the rows the virtualizer has mounted, by body index (its row wrappers carry `data-index`). */ export declare function mountedBoxes(scrollEl: HTMLElement): Map; /** A body item's identity for the virtual rows: it stays with the item when rows open, fold or move around it. */ export declare function keyOfItem(it: SheetBodyItem | undefined, i: number): string; /** The source element a body item belongs to (#857) — a row, or a line's or a sub row's group; `null` where no element stands behind it (a paged band, a blank). */ export declare function elementOf(it: SheetBodyItem): number | null; /** * The source element under a resting view's top (#857): its item's — or, * over an unloaded band, the element the band draws at that depth. A band is * a place in one run, never an item: a remount's bands cover other elements, * so what persists for one is the element. Its rows are drawn at the ledger's * rate, so the depth maps to an element proportionally. */ export declare function elementUnder(it: SheetBodyItem, offset: number): number | null; /** * Where a persisted anchor whose item is gone lands (#857). On a paged sheet, * its element is the place: the first item at or past it — the band of a * failed window that holds it — because an index names a place only in the * run it was taken from. Otherwise its index, clamped to the body. */ export declare function placeOf(body: readonly SheetBodyItem[], index: number, element: number | undefined): number; /** * A row-space place's identity (#854): a row's or a group's id, a group's * blank line's (it names its group) — or, for a padding row, its place among * the padding: padding rows are alike, and their ids name positions that a * row inserted above moves (#877). */ export type RowSlot = { id: string; } | { blank: number; }; /** The identity of a row-space item. */ export declare function slotOf(it: SheetBodyItem): RowSlot | undefined; /** Where each row-space place of `before` sits in `after` (#854) — `null` for a row that left (#877), `undefined` where `before` held nothing. */ export declare function followRows(before: readonly (RowSlot | undefined)[], after: readonly (RowSlot | undefined)[]): (r: number) => number | null | undefined; /** What is open in a body: each group unfolded, each line whose sub rows show. */ export declare function openKeysOf(body: readonly SheetBodyItem[]): Set; /** The source position a row-space item stands at — a row's, a group's band, a blank's the place it would take; `undefined` off the row space. */ export declare function rowPositionOf(it: SheetBodyItem): number | undefined; /** * A body item's place among the grid's rows (#860), counting the header as * the first: on a flat sheet a row's source position (a band or a failed * window where its first element would be; a proposal has no place of its * own), so the count and every index describe the whole source; on a * grouped sheet, the body's order — an unloaded run is one row, the Plan's * rule (#819). */ export declare function ariaRowIndexOf(it: SheetBodyItem, i: number, grouped: boolean): number | undefined; /** The body index of an anchor — a real row (or a group's band) by id, a blank row or blank line by its synthetic id. */ export declare function anchorBodyIndex(body: readonly SheetBodyItem[], anchorId: string): number; /** A row-space item's drop row, printed — what its drop cell's `CellRef` carries. */ export declare function dropText(item: SheetBodyItem): string | undefined; //# sourceMappingURL=items.d.ts.map