rcx-virtual-list
Version:
Maximum performance for extremely large lists.<br/> Animation of elements is supported.
47 lines (46 loc) • 1.5 kB
TypeScript
/// <reference types="react" />
import { IVirtualListItemMethods, ScrollDirection } from "../models";
import { Id, ISize } from "../types";
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
*/
private _displayObjectIndexMapById;
set displayObjectIndexMapById(v: {
[id: number]: number;
});
get displayObjectIndexMapById(): {
[id: number]: number;
};
/**
* Dictionary displayItems propertyNameId by items propertyNameId
*/
private _trackMap;
get trackMap(): {
[id: string]: number;
[id: number]: number;
} | null;
private _trackingPropertyName;
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;
}