import { DBase } from "./d-base"; export interface DItemUpdaterItem extends DBase { readonly value?: VALUE; readonly index?: number; set(value: VALUE, index: number, forcibly?: boolean): void; unset(): void; } export type DItemUpdaterNewItem = (data: DATA) => ITEM; export type DItemUpdaterInitItem = (item: ITEM, index: number, data: DATA) => ITEM; /** * Item updater options. */ export interface DItemUpdaterOptions { /** * Called to create items. */ newItem?: DItemUpdaterNewItem; /** * Called to initialize items. */ initItem?: DItemUpdaterInitItem; /** * True to make stripe-colored items. Defaults to true. */ stripe?: boolean; } export interface DItemUpdaterDataSelection { contains(value: VALUE): boolean; } export interface DItemUpdaterDataMapped { size(): number; each(iteratee: (value: VALUE, index: number) => void | boolean, from: number, to: number): void; } export interface DItemUpdaterData { readonly selection: DItemUpdaterDataSelection; } /** * The primary purpose of this class is to minimize the number of rendered items (e.g., {@link DListItem}) * as low as possible and to update their positions and states. For this sake, the updater calculates the * required number of items whenever their container size changes and creates items if needed. */ export declare abstract class DItemUpdater = DItemUpdaterData, DATA_MAPPED extends DItemUpdaterDataMapped = DItemUpdaterDataMapped, ITEM extends DItemUpdaterItem = DItemUpdaterItem, OPTIONS extends DItemUpdaterOptions = DItemUpdaterOptions> { protected _updateItemsCount: number; protected _isUpdateItemsCalled: boolean; protected _isUpdateItemsCalledForcibly: boolean; protected _itemHeight: number; protected _itemWidth: number; protected _multiplicity: number; protected _itemIndexStart: number; protected _itemIndexEnd: number; protected _workItems: ITEM[]; protected _data: DATA; protected _content: DBase; protected _container: DBase; protected _newItem: DItemUpdaterNewItem; protected _initItem: DItemUpdaterInitItem; constructor(data: DATA, content: DBase, container: DBase, options?: OPTIONS); protected toNewItem(options?: DItemUpdaterOptions): DItemUpdaterNewItem; protected abstract newItem(this: undefined, data: DATA): ITEM; protected toInitItem(options?: DItemUpdaterOptions): DItemUpdaterInitItem; protected initItem(this: undefined, item: ITEM, index: number, data: DATA): ITEM; protected initItemNoStriping(this: undefined, item: ITEM, index: number, data: DATA): ITEM; get multiplicity(): number; lock(): void; unlock(callIfNeeded: boolean): void; update(forcibly?: boolean): void; protected abstract toMapped(data: DATA): DATA_MAPPED; protected set(item: ITEM, value: VALUE, index: number, forcibly?: boolean): void; protected unset(item: ITEM): void; protected reset(item: ITEM): ITEM; moveFocus(e: KeyboardEvent, target: DBase, moveVertically: boolean, moveHorizontally: boolean): boolean; }