Reference home > @af-utils/virtual-core

virtual-core package

Core framework-agnostic model.

Remarks

What it does:

  • stores item sizes and positions;

  • tracks elements resizing;

  • provides performant way to calculate offsets;

  • deals with scrolling to item index or to offset;

  • emits and allows to subscribe to events.

What it doesn’t do:

  • rendering;

  • styling;

  • all other framework-related stuff.

Classes

Class

Description

VirtualScroller

Core framework-agnostic model.

Interfaces

Interface

Description

VirtualScrollerInitialParams

All VirtualScroller parameters (that may / may not change over time).

VirtualScrollerRuntimeParams

VirtualScroller parameters that may change over time. Used as VirtualScroller.set() argument type.

Variables

Variable

Description

VirtualScrollerEvent

Possible events, supported by VirtualScroller.on() method

Type Aliases

Type Alias

Description

VirtualScrollerEvent

VirtualScrollerEvent is exported as constant, so separate type is needed to emulate enum behavior

VirtualScrollerExactPosition

Numeric snapshot of scroll position

VirtualScrollerScrollElement

Scrollable container type