Files
madbase/control-plane-ui/node_modules/@mui/x-data-grid/models/api/gridRowSelectionApi.d.ts
Vlad Durnea cffdf8af86
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped
wip:milestone 0 fixes
2026-03-15 12:35:42 +02:00

79 lines
3.5 KiB
TypeScript

import { GridRowId, GridRowModel } from '../gridRows';
/**
* The selection API interface that is available in the grid [[apiRef]].
*/
export interface GridRowSelectionApi {
/**
* Change the selection state of a row.
* @param {GridRowId} id The id of the row.
* @param {boolean} isSelected Pass `false` to unselect a row. Default is `true`.
* @param {boolean} resetSelection Whether to reset the already selected rows or not. Default is `false`.
*/
selectRow: (id: GridRowId, isSelected?: boolean, resetSelection?: boolean) => void;
/**
* Determines if a row is selected or not.
* @param {GridRowId} id The id of the row.
* @returns {boolean} A boolean indicating if the row is selected.
*/
isRowSelected: (id: GridRowId) => boolean;
/**
* Determines if a row can be selected or not.
* @param {GridRowId} id The id of the row.
* @returns {boolean} A boolean indicating if the row can be selected.
*/
isRowSelectable: (id: GridRowId) => boolean;
/**
* Returns an array of the selected rows.
* @returns {Map<GridRowId, GridRowModel>} A `Map` with the selected rows.
*/
getSelectedRows: () => Map<GridRowId, GridRowModel>;
/**
* Updates the selected rows to be those passed to the `rowIds` argument.
* Any row already selected will be unselected.
* @param {GridRowId[]} rowIds The row ids to select.
*/
setRowSelectionModel: (rowIds: GridRowId[]) => void;
}
export interface GridRowMultiSelectionApi {
/**
* Change the selection state of multiple rows.
* @param {GridRowId[]} ids The row ids.
* @param {boolean} isSelected The new selection state. Default is `true`.
* @param {boolean} resetSelection Whether to reset the already selected rows or not. Default is `false`.
*/
selectRows: (ids: GridRowId[], isSelected?: boolean, resetSelection?: boolean) => void;
/**
* Change the selection state of all the selectable rows in a range.
* @param {Object} range The range of rows to select.
* @param {GridRowId} range.startId The first row id.
* @param {GridRowId} range.endId The last row id.
* @param {boolean} isSelected The new selection state. Default is `true`.
* @param {boolean} resetSelection Whether to reset the selected rows outside of the range or not. Default is `false`.
*/
selectRowRange: (range: {
startId: GridRowId;
endId: GridRowId;
}, isSelected?: boolean, resetSelection?: boolean) => void;
}
export interface GridMultiSelectionApi {
/**
* Change the selection state of multiple rows.
* @param {GridRowId[]} ids The row ids.
* @param {boolean} isSelected The new selection state. Default is `true`.
* @param {boolean} resetSelection Whether to reset the already selected rows or not. Default is `false`.
*/
selectRows: (ids: GridRowId[], isSelected?: boolean, resetSelection?: boolean) => void;
/**
* Change the selection state of all the selectable rows in a range.
* @param {Object} range The range of rows to select.
* @param {GridRowId} range.startId The first row id.
* @param {GridRowId} range.endId The last row id.
* @param {boolean} isSelected The new selection state. Default is `true`.
* @param {boolean} resetSelection Whether to reset the selected rows outside of the range or not. Default is `false`.
*/
selectRowRange: (range: {
startId: GridRowId;
endId: GridRowId;
}, isSelected?: boolean, resetSelection?: boolean) => void;
}