import Grid, { GridFunction, GridOptions, GridOutlines, Properties, PROPERTY_TYPE, RenderOptions } from "@egjs/grid"; import { GROUP_TYPE, STATUS_TYPE } from "./consts"; import { InfiniteGridItem, InfiniteGridItemStatus } from "./InfiniteGridItem"; import { InfiniteGridGroup, InfiniteGridItemInfo } from "./types"; export interface InfiniteGridGroupStatus { type: GROUP_TYPE; groupKey: string | number; items: InfiniteGridItemStatus[]; outlines: GridOutlines; } export interface GroupManagerOptions extends GridOptions { gridConstructor: GridFunction | null; gridOptions: Record; } export interface GroupManagerStatus { cursors: [number, number]; orgCursors: [number, number]; itemCursors: [number, number]; startGroupKey: number | string; endGroupKey: number | string; groups: InfiniteGridGroupStatus[]; outlines: GridOutlines; } export declare class GroupManager extends Grid { static defaultOptions: Required; static propertyTypes: { readonly gridConstructor: PROPERTY_TYPE.PROPERTY; readonly gridOptions: PROPERTY_TYPE.PROPERTY; readonly gap: PROPERTY_TYPE; readonly defaultDirection: PROPERTY_TYPE; readonly renderOnPropertyChange: PROPERTY_TYPE; readonly preserveUIOnDestroy: PROPERTY_TYPE; readonly useFit: PROPERTY_TYPE; }; protected items: InfiniteGridItem[]; protected groupItems: InfiniteGridItem[]; protected groups: InfiniteGridGroup[]; protected itemKeys: Record; protected groupKeys: Record; protected startCursor: number; protected endCursor: number; private _placeholder; private _loadingGrid; constructor(container: HTMLElement, options: GroupManagerOptions); set gridOptions(options: Record); getItemByKey(key: string | number): InfiniteGridItem | null; getGroupItems(includePlaceholders?: boolean): InfiniteGridItem[]; getVisibleItems(includePlaceholders?: boolean): InfiniteGridItem[]; getRenderingItems(): InfiniteGridItem[]; getGroups(includePlaceholders?: boolean): InfiniteGridGroup[]; hasVisibleVirtualGroups(): boolean; hasPlaceholder(): boolean; hasLoadingItem(): boolean; setPlaceholder(placeholder: Partial | null): void; getLoadingType(): "" | "end" | "start"; startLoading(type: "start" | "end"): boolean; endLoading(): boolean; setLoading(loading: Partial | null): void; getVisibleGroups(includePlaceholders?: boolean): InfiniteGridGroup[]; applyGrid(items: InfiniteGridItem[], direction: "end" | "start", outline: number[]): GridOutlines; syncItems(nextItemInfos: InfiniteGridItemInfo[]): void; renderItems(options?: RenderOptions): this; setCursors(startCursor: number, endCursor: number): void; getStartCursor(): number; getEndCursor(): number; getGroupStatus(type?: STATUS_TYPE): GroupManagerStatus; setGroupStatus(status: GroupManagerStatus): void; appendPlaceholders(items: number | InfiniteGridItemStatus[], groupKey?: string | number): { group: { type: GROUP_TYPE; groupKey: string | number; grid: Grid; items: InfiniteGridItem[]; renderItems: InfiniteGridItem[]; }; items: InfiniteGridItem[]; }; prependPlaceholders(items: number | InfiniteGridItemStatus[], groupKey?: string | number): { group: { type: GROUP_TYPE; groupKey: string | number; grid: Grid; items: InfiniteGridItem[]; renderItems: InfiniteGridItem[]; }; items: InfiniteGridItem[]; }; removePlaceholders(type: "start" | "end" | { groupKey: string | number; }): void; insertPlaceholders(direction: "start" | "end", items: number | InfiniteGridItemStatus[], groupKey?: string | number): { group: { type: GROUP_TYPE; groupKey: string | number; grid: Grid; items: InfiniteGridItem[]; renderItems: InfiniteGridItem[]; }; items: InfiniteGridItem[]; }; shouldRerenderItems(): boolean; private _getGroupItems; private _getRenderingItems; private _checkShouldRender; private _applyVirtualGrid; private _syncItemInfos; private _registerGroups; private _splitVirtualGroups; private _mergeVirtualGroups; private _updatePlaceholder; private _makeGrid; private _getLoadingGroup; private _getLoadingItem; } export interface GroupManager extends Properties { getItems(): InfiniteGridItem[]; }