mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
[@types/react-data-grid] Adding missing types to support Tree Views (#40279)
* Adding missing types to support trees for react-data-grid * Applying minor changes as suggested by SupernaviX
This commit is contained in:
parent
5eeff62e2c
commit
d759d9ef04
57
types/react-data-grid/index.d.ts
vendored
57
types/react-data-grid/index.d.ts
vendored
@ -62,6 +62,14 @@ declare namespace AdazzleReactDataGrid {
|
||||
* @param e Information about the event
|
||||
*/
|
||||
onCellsDragged?: (e: CellDragEvent) => void
|
||||
/**
|
||||
* Invoked when the user clicks on one cell to expand it.
|
||||
* @param e Information about the event
|
||||
*/
|
||||
onCellExpand?: (e:CellExpandEvent<T>) => void
|
||||
|
||||
getSubRowDetails?: (row: T) => SubRowDetails
|
||||
|
||||
/**
|
||||
* Invoked when the user double clicks on the drag handle of an editable cell.
|
||||
* Should update the values of the cells beneath the selected cell.
|
||||
@ -456,6 +464,54 @@ declare namespace AdazzleReactDataGrid {
|
||||
value: any
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about a cell expanded.
|
||||
*/
|
||||
interface CellExpandEvent<T = any> {
|
||||
/**
|
||||
* The row index where the cell is being expanded.
|
||||
*/
|
||||
rowIdx: number
|
||||
/**
|
||||
* The column index where the cell is being expanded.
|
||||
*/
|
||||
idx: number
|
||||
/**
|
||||
* The values of the row.
|
||||
*/
|
||||
rowData: T
|
||||
/**
|
||||
* Expand data.
|
||||
*/
|
||||
expandArgs: any
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about subrows.
|
||||
*/
|
||||
interface SubRowDetails<T = any> {
|
||||
/**
|
||||
* Determines if the cell can expand.
|
||||
*/
|
||||
canExpand?: boolean;
|
||||
/**
|
||||
* Sets the field/column that will be use to expand the subrows.
|
||||
*/
|
||||
field: string;
|
||||
/**
|
||||
* Determines if the row has already expanded.
|
||||
*/
|
||||
expanded: boolean;
|
||||
/**
|
||||
* Children data.
|
||||
*/
|
||||
children?: T[];
|
||||
treeDepth?: number;
|
||||
siblingIndex?: number;
|
||||
numberSiblings?: number;
|
||||
group?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about a drag handle double click. Generic event type returns untyped row, use parameterized type with the row type as the parameter
|
||||
* @default T = any
|
||||
@ -584,6 +640,7 @@ declare namespace AdazzleReactDataGrid {
|
||||
export import RowUpdateEvent = AdazzleReactDataGrid.RowUpdateEvent;
|
||||
export import SelectionParams = AdazzleReactDataGrid.SelectionParams;
|
||||
export import CellDragEvent = AdazzleReactDataGrid.CellDragEvent;
|
||||
export import CellExpandEvent = AdazzleReactDataGrid.CellExpandEvent;
|
||||
export import DragHandleDoubleClickEvent = AdazzleReactDataGrid.DragHandleDoubleClickEvent;
|
||||
export import CellCopyPasteEvent = AdazzleReactDataGrid.CellCopyPasteEvent;
|
||||
export import GridRowsUpdatedEvent = AdazzleReactDataGrid.GridRowsUpdatedEvent;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user