import * as React from 'react'; import { integer } from '@mui/x-internals/types'; import { Store } from '@mui/x-internals/store'; import { Colspan } from "./features/colspan.js"; import { Dimensions } from "./features/dimensions.js"; import { Rowspan } from "./features/rowspan.js"; import { Virtualization } from "./features/virtualization/index.js"; import type { Layout } from "./features/virtualization/layout.js"; import type { HeightEntry, RowSpacing } from "./models/dimensions.js"; import type { ColspanParams } from "./features/colspan.js"; import type { DimensionsParams } from "./features/dimensions.js"; import type { VirtualizationParams } from "./features/virtualization/index.js"; import { ColumnWithWidth, FocusedCell, Size, PinnedRows, PinnedColumns, RenderContext, Row, RowEntry } from "./models/index.js"; export type Virtualizer = ReturnType; export type VirtualScrollerCompat = Virtualization.State['getters']; export type BaseState = Virtualization.State & Dimensions.State; export type VirtualizerParams = { layout: L; dimensions: DimensionsParams; virtualization: VirtualizationParams; colspan?: ColspanParams; initialState?: { scroll?: { top: number; left: number; }; rowSpanning?: Rowspan.State['rowSpanning']; virtualization?: Partial['virtualization']>; }; /** current page rows */ rows: RowEntry[]; /** current page range */ range: { firstRowIndex: integer; lastRowIndex: integer; } | null; rowCount: integer; columns?: ColumnWithWidth[]; pinnedRows?: PinnedRows; pinnedColumns?: PinnedColumns; disableHorizontalScroll?: boolean; disableVerticalScroll?: boolean; getRowHeight?: (row: RowEntry) => number | null | undefined | 'auto'; /** * Function that returns the estimated height for a row. * Only works if dynamic row height is used. * Once the row height is measured this value is discarded. * @param rowEntry * @returns The estimated row height value. If `null` or `undefined` then the default row height, based on the density, is applied. */ getEstimatedRowHeight?: (rowEntry: RowEntry) => number | null; /** * Function that allows to specify the spacing between rows. * @param rowEntry * @returns The row spacing values. */ getRowSpacing?: (rowEntry: RowEntry) => RowSpacing; /** Update the row height values before they're used. * Used to add detail panel heights. * @param entry * @param rowEntry */ applyRowHeight?: (entry: HeightEntry, rowEntry: RowEntry) => void; virtualizeColumnsWithAutoRowHeight?: boolean; resizeThrottleMs?: number; onResize?: (lastSize: Size) => void; onWheel?: (event: React.WheelEvent) => void; onTouchMove?: (event: React.TouchEvent) => void; onRenderContextChange?: (c: RenderContext) => void; onScrollChange?: (scrollPosition: { top: number; left: number; }, nextRenderContext: RenderContext) => void; focusedVirtualCell?: () => FocusedCell | null; scrollReset?: any; renderRow: (params: { id: any; model: Row; rowIndex: number; offsetLeft: number; columnsTotalWidth: number; baseRowHeight: number | 'auto'; firstColumnIndex: number; lastColumnIndex: number; focusedColumnIndex: number | undefined; isFirstVisible: boolean; isLastVisible: boolean; isVirtualFocusRow: boolean; showBottomBorder: boolean; }) => React.ReactElement; renderInfiniteLoadingTrigger?: (id: any) => React.ReactElement; }; type RequiredFields = T & Required>; export type ParamsWithDefaults = RequiredFields & { dimensions: RequiredFields; virtualization: RequiredFields; }; export declare const useVirtualizer: ; container: React.RefObject; } & Record>>>(params: VirtualizerParams) => { store: Store & Colspan.State & Rowspan.State>; api: { updateDimensions: (firstUpdate?: boolean) => void; debouncedUpdateDimensions: (((firstUpdate?: boolean) => void) & import("@mui/x-internals/throttle").Cancelable) | undefined; rowsMeta: { getRowHeight: (rowId: import("./models/index.js").RowId) => any; setLastMeasuredRowIndex: (index: number) => void; storeRowHeightMeasurement: (id: import("./models/index.js").RowId, height: number) => void; hydrateRowsMeta: () => void; observeRowHeight: (element: Element, rowId: import("./models/index.js").RowId) => () => void | undefined; rowHasAutoHeight: (id: import("./models/index.js").RowId) => any; getRowHeightEntry: (rowId: import("./models/index.js").RowId) => any; getLastMeasuredRowIndex: () => number; resetRowHeights: () => void; }; } & { getCellColSpanInfo: (rowId: import("./models/index.js").RowId, columnIndex: integer) => import("./models/index.js").CellColSpanInfo; calculateColSpan: (rowId: import("./models/index.js").RowId, minFirstColumn: integer, maxLastColumn: integer, columns: ColumnWithWidth[]) => void; getHiddenCellsOrigin: () => Record>; getters: any; setPanels: React.Dispatch>>>; forceUpdateRenderContext: () => void; scheduleUpdateRenderContext: () => void; } & { resetColSpan: () => void; getCellColSpanInfo: (rowId: import("./models/index.js").RowId, columnIndex: integer) => import("./models/index.js").CellColSpanInfo | undefined; calculateColSpan: (rowId: import("./models/index.js").RowId, minFirstColumn: integer, maxLastColumn: integer, columns: ColumnWithWidth[]) => void; } & { getHiddenCellsOrigin: () => Record>; } & { getViewportPageSize: () => number; }; }; export {};