UNPKG

rcx-virtual-list

Version:

Maximum performance for extremely large lists.<br/> Flexible, and actively maintained React library that excels with high-performance, feature-rich virtualized lists—including grouping, sticky headers, snapping, animations, and both scroll directions. Wh

49 lines (48 loc) • 1.63 kB
/// <reference types="react" /> import { IVirtualListItemMethods, ScrollDirection } from "../models"; import { Id, ISize } from "../types"; import { CMap } from "./cacheMap"; type TrackingPropertyId = string | number; export interface IVirtualListItemComponent<I = any> { getBounds(): ISize; itemId: Id; id: number; item: I | null; show: () => void; hide: () => void; } /** * Tracks display items by property * @link https://github.com/DjonnyX/rcx-virtual-list/tree/main/src/lib/src/utils/tracker.ts * @author Evgenii Grebennikov * @email djonnyx@gmail.com */ export declare class Tracker<C extends IVirtualListItemMethods = any> { /** * display objects dictionary of indexes by id */ protected _displayObjectIndexMapById: { [id: number]: number; }; set displayObjectIndexMapById(v: { [id: number]: number; }); get displayObjectIndexMapById(): { [id: number]: number; }; /** * Dictionary displayItems propertyNameId by items propertyNameId */ protected _trackMap: CMap<TrackingPropertyId, number>; get trackMap(): CMap<TrackingPropertyId, number>; protected _trackingPropertyName: string; set trackingPropertyName(v: string); constructor(trackingPropertyName: string); /** * tracking by propName */ track(items: Array<any>, components: Array<React.RefObject<C>>, snapedComponent: React.RefObject<C> | null | undefined, direction: ScrollDirection): void; untrackComponentByIdProperty(component?: C): void; dispose(): void; } export {};