View as Markdown

API reference: @salmonui/core/virtual

RowMetricsinterface

import type { RowMetrics } from '@salmonui/core/virtual';
interface RowMetrics {
    readonly count: number;
    readonly totalHeight: number;
    offsetOf(index: number): number;
    heightOf(index: number): number;
    indexAt(offset: number): number;
}

Vertical metrics of the visible row model. Offsets are in virtual px.

RowMetrics members (5)
NameSignatureDescription
countreadonly count: number;
totalHeightreadonly totalHeight: number;
offsetOfoffsetOf(index: number): number;

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

heightOfheightOf(index: number): number;
indexAtindexAt(offset: number): number;

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