View as Markdown

API reference: @salmonui/core/virtual

VariableRowMetricsinterface

import type { VariableRowMetrics } from '@salmonui/core/virtual';
interface VariableRowMetrics extends RowMetrics {
    setHeight(index: number, height: number): number;
}

Row metrics with measured or per-row heights, kept in a Fenwick tree (O(log n) updates and lookups).

VariableRowMetrics members (6, 5 inherited)
NameSignatureDescription
setHeightsetHeight(index: number, height: number): number;

Sets a row height; returns the height delta (0 when unchanged).

countinheritedcount: number;
totalHeightinheritedtotalHeight: number;
offsetOfinheritedoffsetOf: (index: number) => number;

Top offset of the row at index (index === count returns totalHeight).

heightOfinheritedheightOf: (index: number) => number;
indexAtinheritedindexAt: (offset: number) => number;

Index of the row that contains offset, clamped to [0, count - 1]; 0 when empty.