import type { DataTableRowId } from './DataTableController.js'; /** * Fixed-height virtualization configuration for the DataTable body. * * Header groups and summary rows remain normal table sections and are not * included in the virtual row count. Body rows must have a fixed height. */ export interface DataTableVirtualizationOptions { /** The measured, fixed height of each data row in CSS pixels. */ rowHeight: number; /** * The visible height of the scrolling data viewport in CSS pixels. The * component adds measured caption and header height around this body region. */ viewportHeight: number; /** Extra rows rendered before and after the visible range. Defaults to 3. */ overscan?: number; /** Controlled scroll position, used to restore a table after remounting. */ scrollTop?: number; /** * Receives the current virtual scroll position. When a footer is present, * its measured height extends the range so it remains reachable. */ onScrollTopChange?: (scrollTop: number) => void; /** * A stable row id that must remain visible. Use this with * `onFocusedRowIdChange` to restore keyboard focus after a data refresh. */ focusedRowId?: DataTableRowId | null; /** Receives the stable id of a row when focus enters that row. */ onFocusedRowIdChange?: (rowId: DataTableRowId) => void; } export type DataTableVirtualizationReason = 'disabled' | 'variable-row-height'; export interface DataTableVirtualizationContext { options?: DataTableVirtualizationOptions; rowCount: number; scrollTop: number; /** Expansion and body group rows produce variable heights and disable the window. */ hasVariableRowHeight?: boolean; /** Structural header rows, including grouped headers. Excluded from the window. */ headerRowCount?: number; /** Structural summary rows. Excluded from the window. */ summaryRowCount?: number; } export interface DataTableVirtualWindow { enabled: boolean; reason?: DataTableVirtualizationReason; startIndex: number; endIndex: number; topSpacerHeight: number; bottomSpacerHeight: number; totalBodyHeight: number; headerRowCount: number; summaryRowCount: number; } /** * Returns the maximum scroll position for a virtual body and an optional * measured summary footer. Header and caption height are outside this range. */ export declare function maximumDataTableVirtualScrollTop(rowCount: number, options: Pick, footerHeight?: number): number; /** * Resolves the renderable data-row window without using source order as an * identity. The caller retains the rows and slices by the returned indexes. */ export declare function resolveDataTableVirtualWindow(context: DataTableVirtualizationContext): DataTableVirtualWindow; /** * Returns the smallest fixed-height scroll position that reveals a stable row * index, clamped to the body extent. Callers resolve the index from `rowKey`. */ export declare function scrollTopForDataTableRow(rowIndex: number, rowCount: number, options: Pick, currentScrollTop?: number): number; //# sourceMappingURL=DataTableVirtualization.d.ts.map