import React$1 from "react"; import { AutoFitOptions, AutoFitOptions as AutoFitOptions$1, AxisBounds, CellBounds, CellDataType, CellPosition, CellRange, CellRendererParams, CellRendererParams as CellRendererParams$1, CellValue, CellValue as CellValue$1, CellValueChangedEvent, CellValueChangedEvent as CellValueChangedEvent$1, CellWriteRejectedEvent, CellWriteRejectedEvent as CellWriteRejectedEvent$1, ColumnDefinition, ColumnDefinition as ColumnDefinition$1, ColumnFilterInput, ColumnFilterModel, ColumnFitEntry, ColumnFitResult, ColumnFitSkip, ColumnGroupChild, ColumnGroupChild as ColumnGroupChild$1, ColumnGroupDefinition, ColumnGroupHeaderParams, ColumnGroupHeaderParams as ColumnGroupHeaderParams$1, ColumnGroupLimits, ColumnGroupLimits as ColumnGroupLimits$1, ColumnLayoutMode, ColumnLayoutMode as ColumnLayoutMode$1, ColumnLayoutSnapshot, ColumnLayoutSnapshot as ColumnLayoutSnapshot$1, ColumnMovedEvent, ColumnMovedEvent as ColumnMovedEvent$1, ColumnPin, ColumnPinnedEvent, ColumnPinnedEvent as ColumnPinnedEvent$1, ColumnRegion, ColumnResizedEvent, ColumnResizedEvent as ColumnResizedEvent$1, ColumnSchemaError, ColumnSchemaError as ColumnSchemaError$1, ColumnSchemaErrorCode, ColumnSchemaErrorSource, ColumnSchemaResult, ColumnState, ColumnStateSnapshot, ColumnStateUpdate, ColumnStateUpdate as ColumnStateUpdate$1, ColumnWindowSnapshot, ColumnarAccess, ColumnarDataSource, ColumnarDataSourceOptions, ColumnarField, ContentSize, DataSource, DataSource as DataSource$1, DataSourceLoadMode, DataSourceRange, DataSourceRequest, DataSourceResponse, DisplayedColumn, EditRendererParams, EditRendererParams as EditRendererParams$1, FillHandlePosition, FilterClearParams, FilterClearParams as FilterClearParams$1, FilterCombination, FilterCondition, FilterConditionGroup, FilterModel, FilterRendererDefinition, FilterRendererDefinition as FilterRendererDefinition$1, FilterRendererParams, FilterRendererParams as FilterRendererParams$1, FitClamp, FitStatus, FreezeRowsOptions, FreezeRowsOptions as FreezeRowsOptions$1, FrozenRowsState, FrozenRowsState as FrozenRowsState$1, GeometrySpace, GridAnnouncement, GridCellsApi, GridColumnsApi, GridCore, GridCore as GridCore$1, GridEditApi, GridFilterOperatorLabels, GridFrozenRowsApi, GridGeometry, GridHeaderApi, GridHit, GridIcon, GridIcon as GridIcon$1, GridInstruction, GridLabelOverrides, GridLabelOverrides as GridLabelOverrides$1, GridLabels, GridLabels as GridLabels$1, GridRowDragApi, GridRowGroupsApi, GridRowHeightsApi, GridRowsApi, GridViewportApi, GroupCellInput, GroupLabelRendererParams, GroupLabelRendererParams as GroupLabelRendererParams$1, GroupPathStep, HeaderBandLayout, HeaderFragment, HeaderFragments, HeaderRendererParams, HeaderRendererParams as HeaderRendererParams$1, HeaderRun, HierarchicalRowAccess, HierarchyChange, HierarchyGroupRow, HierarchyRecordChange, HierarchyRecordRow, HierarchyRow, HierarchyRowKind, HierarchyTotalRow, HighlightingOptions, HistoryOptions, HistoryOptions as HistoryOptions$1, LegacyColumnFilterModel, LegacyFilterCondition, MutableDataSource, MutableDataSource as MutableDataSource$1, PIVOT_LABEL_COLUMN_ID, ParallelSortOptions, PivotConfig, PivotMeasure, PivotSchema, PivotSchemaOptions, PivotSource, ResolvedColumn, RowAccess, RowCacheEviction, RowCacheOptions, RowDragEndEvent, RowDragEndEvent as RowDragEndEvent$1, RowFitEntry, RowFitResult, RowFitSkip, RowGroupAggregator, RowGroupBuiltInAggregate, RowGroupDimension, RowGroupMeasure, RowGroupResult, RowGroupToggledEvent, RowGroupToggledEvent as RowGroupToggledEvent$1, RowGrouping, RowGrouping as RowGrouping$1, RowGroupingConfig, RowGroupingRejection, RowGroupingRejection as RowGroupingRejection$1, RowGroupingResult, RowGroupingState, RowHeightUpdate, RowId, RowId as RowId$1, RowLoadingMode, RowLoadingOptions, RowLoadingOptions as RowLoadingOptions$1, RowRegion, RowRegionLayout, RowResizedEvent, RowResizedEvent as RowResizedEvent$1, ScrollTarget, ServerGroupChildrenRequest, ServerGroupChildrenResponse, ServerGroupNode, ServerGroupingConfig, ServerGroupingService, ServerGroupingSource, ServerGroupingSpec, ServerLeavesRequest, ServerLeavesResponse, SortDirection, SortModel, TextFilterCondition, ViewRow, ViewportPoint, WriteChange, WriteCommittedEvent, WriteCommittedEvent as WriteCommittedEvent$1, WriteOperation, WriteRejectionOperation, buildPivotSchema, createClientDataSource, createColumnarDataSource, createDataSourceFromArray, createMutableClientDataSource, createPivotSource, createRowGrouping, createServerDataSource, createServerGroupingSource, decodeGroupId, decodePivotColumnId, encodeGroupId, encodePivotColumnId, encodePivotGroupId, gridStyles, isColumnarDataSource, isHierarchicalRowAccess, isLegacyColumnFilterModel, normalizeColumnFilterModel } from "@gp-grid/core"; //#region src/types.d.ts /** Ref handle exposed by the Grid component */ interface GridRef { /** Access to the underlying GridCore instance */ core: GridCore$1 | null; } /** React cell renderer: A function that renders a cell */ type ReactCellRenderer = (params: CellRendererParams$1) => React.ReactNode; /** React edit renderer: A function that renders the cell while in edit mode */ type ReactEditRenderer = (params: EditRendererParams$1) => React.ReactNode; /** React header renderer: A function that renders a header cell */ type ReactHeaderRenderer = (params: HeaderRendererParams$1) => React.ReactNode; /** Renders the content of a column's filter popup */ type ReactFilterContentRenderer = (params: FilterRendererParams$1) => React.ReactNode; /** Renders a custom filter popup's clear control */ type ReactFilterClearRenderer = (params: FilterClearParams$1) => React.ReactNode; /** React filter renderer: the popup content plus its required clear control */ type ReactFilterRenderer = FilterRendererDefinition$1; /** React group label renderer: the label of a group or total row, beside its expander */ type ReactGroupLabelRenderer = (params: GroupLabelRendererParams$1) => React.ReactNode; /** React group header renderer: renders one fragment of a column group */ type ReactGroupHeaderRenderer = (params: ColumnGroupHeaderParams$1) => React.ReactNode; /** * Header renderer registry, shared by columns and groups: a key receives the * params of whichever definition names it. */ type ReactHeaderRendererRegistry = Record; /** Grid component props */ interface GridProps { /** Column definitions */ columns: ColumnDefinition$1[]; /** * Controlled per-column state applied through the core whenever it changes. * Explicit commands win over retained user state and definition defaults. */ columnState?: ColumnStateUpdate$1[]; /** * How displayed column widths are resolved. `"fit"` (default) expands * columns to reach the viewport; `"fixed"` keeps declared/overridden pixel * widths and scrolls horizontally. Changeable at runtime. */ columnLayout?: ColumnLayoutMode$1; /** Data source for the grid */ dataSource?: DataSource$1; /** Legacy: Raw row data (will be wrapped in a client data source) */ rowData?: TData[]; /** Row height in pixels */ rowHeight: number; /** Header height in pixels, the default height of every band: Default to row height */ headerHeight?: number; /** Height of each header band, indexed by band; a band without one is `headerHeight`. Changeable at runtime. */ headerBandHeights?: readonly number[]; /** * Nested header groups over the column ids; every column is referenced * once, ungrouped ones at the root. Applied together with `columns`. */ columnGroups?: readonly ColumnGroupChild$1[]; /** Budgets of `columnGroups`. Creation-only. */ columnGroupLimits?: ColumnGroupLimits$1; /** Called when a column change is rejected; the previous schema stays. */ onColumnSchemaRejected?: (error: ColumnSchemaError$1) => void; /** Overscan: How many rows to render outside the viewport */ overscan?: number; /** CSS px of center columns kept mounted past each clip edge. Default: 240 */ columnOverscan?: number; /** Row loading and cache behavior. Server data sources use paginated loading by default. */ rowLoading?: RowLoadingOptions$1; /** * Number of leading displayed rows kept visible below the header. Applied * at runtime; a new identity never rebuilds the core. */ freezeRows?: FreezeRowsOptions$1; /** Called when the effective frozen count or its limiting reason changes. */ onFrozenRowsChanged?: (state: FrozenRowsState$1) => void; /** Enable/disable sorting globally. Default: true */ sortingEnabled?: boolean; /** Enable dark mode styling: Default to false */ darkMode?: boolean; /** Wheel scroll dampening factor when virtual scrolling is active (0-1): Default 0.1 */ wheelDampening?: number; /** Max accumulated touch-fling velocity (logical px/ms) when scroll virtualization is active. Pair higher values with overscan 10-12. Default: 20 × rowHeight (~20,000 rows/s) */ maxFlingVelocity?: number; /** Renderer registries */ cellRenderers?: Record; /** Edit renderer registries */ editRenderers?: Record; /** Header renderer registries, keyed by a column's or a group's `headerRenderer` */ headerRenderers?: ReactHeaderRendererRegistry; /** Filter renderer registry, keyed by a column's `filterRenderer` */ filterRenderers?: Record; /** Global cell renderer */ cellRenderer?: ReactCellRenderer; /** Global edit renderer */ editRenderer?: ReactEditRenderer; /** Global header renderer */ headerRenderer?: ReactHeaderRenderer; /** Global filter renderer, replacing the built-in filter popup content */ filterRenderer?: ReactFilterRenderer; /** SVG used by the default header's pin toggle. */ pinIcon?: GridIcon$1; /** Initial viewport width for SSR (pixels). ResizeObserver takes over on client. */ initialWidth?: number; /** Initial viewport height for SSR (pixels). ResizeObserver takes over on client. */ initialHeight?: number; /** Optional ref to access GridCore API */ gridRef?: React.MutableRefObject | null>; /** Row/column/cell highlighting configuration */ highlighting?: HighlightingOptions; /** Function to extract unique ID from row. Required when onCellValueChanged is provided. */ getRowId?: (row: TData) => RowId$1; /** Called when a cell value is changed via editing, fill drag, or paste. Requires getRowId. */ onCellValueChanged?: (event: CellValueChangedEvent$1) => void; /** Called when a write is refused because the bound source is read-only. */ onWriteRejected?: (event: CellWriteRejectedEvent$1) => void; /** Called once per write command with its changes and skips. Requires getRowId. */ onWriteCommitted?: (event: WriteCommittedEvent$1) => void; /** Custom loading component to render instead of default spinner */ loadingComponent?: React.ComponentType<{ isLoading: boolean; }>; /** Whether clicking and dragging any cell in a row drags the entire row. Default: false */ rowDragEntireRow?: boolean; /** Called when a row is dropped after dragging. Consumer handles data reordering. */ onRowDragEnd?: (event: RowDragEndEvent$1) => void; /** Called per column a resize, a fit or a resize key changed. */ onColumnResized?: (event: ColumnResizedEvent$1) => void; /** * Whether the user can resize rows: every cell renders the row edge handle, * and Alt+ArrowUp/Down and Alt+Shift+Enter act. Changeable at runtime. * Default: false */ rowResize?: boolean; /** Called per row a row resize, a fit or a resize key changed. */ onRowResized?: (event: RowResizedEvent$1) => void; /** Bounds of the fit commands and the row resize gestures. Creation-only. */ autoFit?: AutoFitOptions$1; /** Undo and redo of the write commands, `maxEntries` deep. Creation-only; requires getRowId. */ history?: HistoryOptions$1; /** Called when a column is moved/reordered. */ onColumnMoved?: (event: ColumnMovedEvent$1) => void; /** Called when a column is pinned or unpinned. */ onColumnPinned?: (event: ColumnPinnedEvent$1) => void; /** Groups the resident rows; a new value regroups without recreating the core. */ rowGrouping?: RowGrouping$1 | null; /** Column showing a group's expander and label; the first displayed column when absent or hidden. */ groupLabelColumn?: string; /** Renders the label of a group or total row. */ groupLabelRenderer?: ReactGroupLabelRenderer; /** Called per group a pointer or key gesture toggled; commands stay silent. */ onRowGroupToggled?: (event: RowGroupToggledEvent$1) => void; /** Called when `rowGrouping` cannot apply to the bound source; the grid keeps the source's rows. */ onRowGroupingRejected?: (rejection: RowGroupingRejection$1) => void; /** Override any user-visible grid label. Unspecified labels fall back to English defaults. */ labels?: GridLabelOverrides$1; } //#endregion //#region src/Grid.d.ts /** * Grid component * @param props - Grid component props * @returns Grid React component */ declare function Grid(props: GridProps): React$1.ReactNode; //#endregion //#region src/useGridData.d.ts interface UseGridDataOptions { /** Function to extract a unique ID from each row. Required. */ getRowId: (row: TData) => RowId$1; /** Debounce time for batching transactions in ms. Default 50. */ debounceMs?: number; /** Use Web Worker for sorting large datasets (default: true) */ useWorker?: boolean; /** Options for parallel sorting (only used when useWorker is true) */ parallelSort?: ParallelSortOptions | false; } interface UseGridDataResult { /** The data source to pass to . */ dataSource: MutableDataSource$1; /** Update a single row by ID with partial data. */ updateRow: (id: RowId$1, data: Partial) => void; /** Add rows to the data source. */ addRows: (rows: TData[]) => void; /** Remove rows by ID. */ removeRows: (ids: RowId$1[]) => void; /** Update a single cell value. */ updateCell: (id: RowId$1, field: string, value: CellValue$1) => void; /** Clear all data from the data source. */ clear: () => void; /** Get a row by its ID. */ getRowById: (id: RowId$1) => TData | undefined; /** Get the current total row count. */ getTotalRowCount: () => number; /** Force immediate processing of queued transactions. */ flushTransactions: () => Promise; } /** * React hook for efficient grid data mutations. * * Wraps `createMutableClientDataSource` to provide a simple API for * updating grid data without triggering full pipeline rebuilds. * * @example * ```tsx * const { dataSource, updateRow, addRows } = useGridData(initialData, { * getRowId: (row) => row.id, * }); * * return ; * ``` */ declare const useGridData: (initialData: TData[], options: UseGridDataOptions) => UseGridDataResult; //#endregion //#region src/hooks/useRowGroups.d.ts type CoreRef = React$1.RefObject | null>; /** Shared by every cell while a hierarchy is bound; `null` while flat. */ type RowGroupCellContext = GroupCellInput & { renderer?: ReactGroupLabelRenderer; onTogglePointerDown: (rowIndex: number, e: React$1.PointerEvent) => void; onToggle: (rowIndex: number) => void; }; /** A later `rowGrouping` reaches the current core through `setGrouping`, never a new core. */ declare const useRowGroupingSync: (coreRef: CoreRef, rowGrouping: RowGrouping$1 | null | undefined) => void; interface RowGroupCellOptions { hierarchical: boolean; layout: ColumnLayoutSnapshot$1 | null; columns: readonly ColumnDefinition$1[]; labels: GridLabels$1; groupLabelColumn?: string; groupLabelRenderer?: ReactGroupLabelRenderer; } /** What the cells of a hierarchy share; `null` while the grid is flat. */ declare const useRowGroupCellContext: (coreRef: CoreRef, options: RowGroupCellOptions) => RowGroupCellContext | null; //#endregion export { type AutoFitOptions, type AxisBounds, type CellBounds, type CellDataType, type CellPosition, type CellRange, type CellRendererParams, type CellValue, type CellValueChangedEvent, type CellWriteRejectedEvent, type ColumnDefinition, type ColumnFilterInput, type ColumnFilterModel, type ColumnFitEntry, type ColumnFitResult, type ColumnFitSkip, type ColumnGroupChild, type ColumnGroupDefinition, type ColumnGroupHeaderParams, type ColumnGroupLimits, type ColumnLayoutMode, type ColumnLayoutSnapshot, type ColumnMovedEvent, type ColumnPin, type ColumnPinnedEvent, type ColumnRegion, type ColumnResizedEvent, type ColumnSchemaError, type ColumnSchemaErrorCode, type ColumnSchemaErrorSource, type ColumnSchemaResult, type ColumnState, type ColumnStateSnapshot, type ColumnStateUpdate, type ColumnWindowSnapshot, type ColumnarAccess, type ColumnarDataSource, type ColumnarDataSourceOptions, type ColumnarField, type ContentSize, type DataSource, type DataSourceLoadMode, type DataSourceRange, type DataSourceRequest, type DataSourceResponse, type DisplayedColumn, type EditRendererParams, type FillHandlePosition, type FilterClearParams, type FilterCombination, type FilterCondition, type FilterConditionGroup, type FilterModel, type FilterRendererDefinition, type FilterRendererParams, type FitClamp, type FitStatus, type FreezeRowsOptions, type FrozenRowsState, type GeometrySpace, Grid as GpGrid, Grid, type GridAnnouncement, type GridCellsApi, type GridColumnsApi, GridCore, type GridEditApi, type GridFilterOperatorLabels, type GridFrozenRowsApi, type GridGeometry, type GridHeaderApi, type GridHit, type GridIcon, type GridInstruction, type GridLabelOverrides, type GridLabels, type GridProps, type GridRef, type GridRowDragApi, type GridRowGroupsApi, type GridRowHeightsApi, type GridRowsApi, type GridViewportApi, type GroupLabelRendererParams, type GroupPathStep, type HeaderBandLayout, type HeaderFragment, type HeaderFragments, type HeaderRendererParams, type HeaderRun, type HierarchicalRowAccess, type HierarchyChange, type HierarchyGroupRow, type HierarchyRecordChange, type HierarchyRecordRow, type HierarchyRow, type HierarchyRowKind, type HierarchyTotalRow, type HistoryOptions, type LegacyColumnFilterModel, type LegacyFilterCondition, type MutableDataSource, PIVOT_LABEL_COLUMN_ID, type PivotConfig, type PivotMeasure, type PivotSchema, type PivotSchemaOptions, type PivotSource, type ReactCellRenderer, type ReactEditRenderer, type ReactFilterClearRenderer, type ReactFilterContentRenderer, type ReactFilterRenderer, type ReactGroupHeaderRenderer, type ReactGroupLabelRenderer, type ReactHeaderRenderer, type ReactHeaderRendererRegistry, type ResolvedColumn, type RowAccess, type RowCacheEviction, type RowCacheOptions, type RowDragEndEvent, type RowFitEntry, type RowFitResult, type RowFitSkip, type RowGroupAggregator, type RowGroupBuiltInAggregate, type RowGroupCellContext, type RowGroupCellOptions, type RowGroupDimension, type RowGroupMeasure, type RowGroupResult, type RowGroupToggledEvent, type RowGrouping, type RowGroupingConfig, type RowGroupingRejection, type RowGroupingResult, type RowGroupingState, type RowHeightUpdate, type RowId, type RowLoadingMode, type RowLoadingOptions, type RowRegion, type RowRegionLayout, type RowResizedEvent, type ScrollTarget, type ServerGroupChildrenRequest, type ServerGroupChildrenResponse, type ServerGroupNode, type ServerGroupingConfig, type ServerGroupingService, type ServerGroupingSource, type ServerGroupingSpec, type ServerLeavesRequest, type ServerLeavesResponse, type SortDirection, type SortModel, type TextFilterCondition, type UseGridDataOptions, type UseGridDataResult, type ViewRow, type ViewportPoint, type WriteChange, type WriteCommittedEvent, type WriteOperation, type WriteRejectionOperation, buildPivotSchema, createClientDataSource, createColumnarDataSource, createDataSourceFromArray, createMutableClientDataSource, createPivotSource, createRowGrouping, createServerDataSource, createServerGroupingSource, decodeGroupId, decodePivotColumnId, encodeGroupId, encodePivotColumnId, encodePivotGroupId, gridStyles, isColumnarDataSource, isHierarchicalRowAccess, isLegacyColumnFilterModel, normalizeColumnFilterModel, useGridData, useRowGroupCellContext, useRowGroupingSync };