import type { DataPipelineConfiguration, FilterExpression, SortExpression } from 'apex-grid'; export declare const ROWS_LOADED_EVENT = "apex-rows-loaded"; /** The block of rows the grid is asking the datasource to fetch. */ export interface InfiniteGetRowsParams { /** First row index to fetch (inclusive). */ readonly startRow: number; /** One past the last row index to fetch (exclusive). */ readonly endRow: number; /** Current sort model (server should order by this). */ readonly sortModel: SortExpression[]; /** Current filter model (server should filter by this). */ readonly filterModel: FilterExpression[]; /** Current quick-filter (global search) term. */ readonly quickFilter: string; } /** What the datasource returns for a block request. */ export interface InfiniteGetRowsResult { /** The rows for the requested block. */ readonly rows: T[]; /** * Total row count for the current query, if known. Omit for "infinite" mode: * the model keeps a trailing placeholder block and finalizes the count when a * block returns fewer rows than {@link InfiniteRowModelConfig.blockSize}. */ readonly rowCount?: number; } /** A lazy block-loading datasource. */ export interface InfiniteDataSource { getRows(params: InfiniteGetRowsParams): Promise> | InfiniteGetRowsResult; } /** Configuration for the infinite (server-side, lazy-scroll) row model. */ export interface InfiniteRowModelConfig { /** The block-loading datasource. */ datasource: InfiniteDataSource; /** Rows per fetched block. Default `100`. */ blockSize?: number; /** Initial row-count estimate before the first block resolves. Default `blockSize`. */ initialRowCount?: number; } /** Detail of the {@link ROWS_LOADED_EVENT} fired on the grid. */ export interface RowsLoadedDetail { /** Current total (known or estimated). */ readonly rowCount: number; /** Whether `rowCount` is the exact total (vs a scroll-ahead estimate). */ readonly exact: boolean; /** Number of blocks currently cached. */ readonly loadedBlocks: number; /** Rows per block. */ readonly blockSize: number; } /** The minimal grid surface the manager drives (avoids a circular import). */ export interface InfiniteHost { data: T[]; quickFilter?: string; readonly sortExpressions: SortExpression[]; readonly filterExpressions: FilterExpression[]; dataPipelineConfiguration: DataPipelineConfiguration; readonly shadowRoot: ShadowRoot | null; addEventListener: HTMLElement['addEventListener']; removeEventListener: HTMLElement['removeEventListener']; dispatchEvent: HTMLElement['dispatchEvent']; } /** * Enterprise feature: **infinite (server-side) row model**. Instead of holding * all rows in `data`, the grid lazily fetches fixed-size blocks from a * {@link InfiniteDataSource} as the user scrolls, and pushes sort / filter / * quick-filter changes to the server. * * Implementation: the manager keeps a block cache and rebuilds `grid.data` as a * placeholder array of the (known or estimated) total length, patching in * loaded blocks. Client-side sort/filter are disabled via passthrough * {@link DataPipelineConfiguration} hooks (the server owns ordering), and the * body virtualizer's `rangeChanged` event drives which blocks to fetch — so the * feature needs no core change. */ export declare class InfiniteRowModelManager { #private; private config; private host; constructor(config: InfiniteRowModelConfig, host: InfiniteHost); /** Begin server-side mode: install passthrough pipeline + initial fetch. */ start(): void; /** Tear down: remove listeners and restore the prior pipeline config. */ stop(): void; /** Attach the virtualizer range listener (idempotent; call after render). */ attach(): void; /** Whether a row is an unloaded placeholder (e.g. to render a skeleton). */ isPlaceholder(row: unknown): boolean; /** Discard the cache and refetch from the top (e.g. after a server-side mutation). */ refresh(): void; /** Reset cache + counts and reload the first block and the visible range. */ reset(): void; }