diff --git a/docs/pages/x/api/data-grid/grid-actions-col-def.json b/docs/pages/x/api/data-grid/grid-actions-col-def.json
index ca909eb5cbaae..26d5acce67f3b 100644
--- a/docs/pages/x/api/data-grid/grid-actions-col-def.json
+++ b/docs/pages/x/api/data-grid/grid-actions-col-def.json
@@ -10,7 +10,7 @@
"field": { "type": { "description": "string" }, "required": true },
"getActions": {
"type": {
- "description": "(params: GridRowParams<R>) => React.ReactElement<GridActionsCellItemProps>[]"
+ "description": "(params: GridRowParams<R>) => readonly React.ReactElement<GridActionsCellItemProps>[]"
},
"required": true
},
@@ -37,7 +37,9 @@
"display": { "type": { "description": "'text' | 'flex'" } },
"editable": { "type": { "description": "boolean" }, "default": "false" },
"filterable": { "type": { "description": "boolean" }, "default": "true" },
- "filterOperators": { "type": { "description": "GridFilterOperator<R, V, F>[]" } },
+ "filterOperators": {
+ "type": { "description": "readonly GridFilterOperator<R, V, F>[]" }
+ },
"flex": { "type": { "description": "number" } },
"getApplyQuickFilterFn": { "type": { "description": "GetApplyQuickFilterFn<R, V>" } },
"getSortComparator": {
@@ -89,7 +91,7 @@
"resizable": { "type": { "description": "boolean" }, "default": "true" },
"sortable": { "type": { "description": "boolean" }, "default": "true" },
"sortComparator": { "type": { "description": "GridComparatorFn<V>" } },
- "sortingOrder": { "type": { "description": "GridSortDirection[]" } },
+ "sortingOrder": { "type": { "description": "readonly GridSortDirection[]" } },
"valueFormatter": { "type": { "description": "GridValueFormatter<R, V, F>" } },
"valueGetter": { "type": { "description": "GridValueGetter<R, V, F>" } },
"valueParser": { "type": { "description": "GridValueParser<R, V, F>" } },
diff --git a/docs/pages/x/api/data-grid/grid-api.json b/docs/pages/x/api/data-grid/grid-api.json
index f37bb1bcf4efe..5f5202edf84f0 100644
--- a/docs/pages/x/api/data-grid/grid-api.json
+++ b/docs/pages/x/api/data-grid/grid-api.json
@@ -395,7 +395,7 @@
},
"setRows": { "type": { "description": "(rows: GridRowModel[]) => void" }, "required": true },
"setRowSelectionModel": {
- "type": { "description": "(rowIds: GridRowId[]) => void" },
+ "type": { "description": "(rowIds: readonly GridRowId[]) => void" },
"required": true
},
"setSortModel": {
diff --git a/docs/pages/x/api/data-grid/grid-col-def.json b/docs/pages/x/api/data-grid/grid-col-def.json
index 6173cc8c314e2..bfe97f8a97043 100644
--- a/docs/pages/x/api/data-grid/grid-col-def.json
+++ b/docs/pages/x/api/data-grid/grid-col-def.json
@@ -30,7 +30,9 @@
"display": { "type": { "description": "'text' | 'flex'" } },
"editable": { "type": { "description": "boolean" }, "default": "false" },
"filterable": { "type": { "description": "boolean" }, "default": "true" },
- "filterOperators": { "type": { "description": "GridFilterOperator<R, V, F>[]" } },
+ "filterOperators": {
+ "type": { "description": "readonly GridFilterOperator<R, V, F>[]" }
+ },
"flex": { "type": { "description": "number" } },
"getApplyQuickFilterFn": { "type": { "description": "GetApplyQuickFilterFn<R, V>" } },
"getSortComparator": {
@@ -82,7 +84,7 @@
"resizable": { "type": { "description": "boolean" }, "default": "true" },
"sortable": { "type": { "description": "boolean" }, "default": "true" },
"sortComparator": { "type": { "description": "GridComparatorFn<V>" } },
- "sortingOrder": { "type": { "description": "GridSortDirection[]" } },
+ "sortingOrder": { "type": { "description": "readonly GridSortDirection[]" } },
"type": { "type": { "description": "GridColType" }, "default": "'singleSelect'" },
"valueFormatter": { "type": { "description": "GridValueFormatter<R, V, F>" } },
"valueGetter": { "type": { "description": "GridValueGetter<R, V, F>" } },
diff --git a/docs/pages/x/api/data-grid/grid-row-selection-api.json b/docs/pages/x/api/data-grid/grid-row-selection-api.json
index 16522e648d1f2..4daa27a95dee1 100644
--- a/docs/pages/x/api/data-grid/grid-row-selection-api.json
+++ b/docs/pages/x/api/data-grid/grid-row-selection-api.json
@@ -25,7 +25,7 @@
{
"name": "setRowSelectionModel",
"description": "Updates the selected rows to be those passed to the rowIds
argument. Any row already selected will be unselected.",
- "type": "(rowIds: GridRowId[]) => void"
+ "type": "(rowIds: readonly GridRowId[]) => void"
}
]
}
diff --git a/docs/pages/x/api/data-grid/grid-single-select-col-def.json b/docs/pages/x/api/data-grid/grid-single-select-col-def.json
index 2e62dcbf36e98..669318bc48489 100644
--- a/docs/pages/x/api/data-grid/grid-single-select-col-def.json
+++ b/docs/pages/x/api/data-grid/grid-single-select-col-def.json
@@ -35,7 +35,9 @@
"display": { "type": { "description": "'text' | 'flex'" } },
"editable": { "type": { "description": "boolean" }, "default": "false" },
"filterable": { "type": { "description": "boolean" }, "default": "true" },
- "filterOperators": { "type": { "description": "GridFilterOperator<R, V, F>[]" } },
+ "filterOperators": {
+ "type": { "description": "readonly GridFilterOperator<R, V, F>[]" }
+ },
"flex": { "type": { "description": "number" } },
"getApplyQuickFilterFn": { "type": { "description": "GetApplyQuickFilterFn<R, V>" } },
"getOptionLabel": { "type": { "description": "(value: ValueOptions) => string" } },
@@ -89,7 +91,7 @@
"resizable": { "type": { "description": "boolean" }, "default": "true" },
"sortable": { "type": { "description": "boolean" }, "default": "true" },
"sortComparator": { "type": { "description": "GridComparatorFn<V>" } },
- "sortingOrder": { "type": { "description": "GridSortDirection[]" } },
+ "sortingOrder": { "type": { "description": "readonly GridSortDirection[]" } },
"valueFormatter": { "type": { "description": "GridValueFormatter<R, V, F>" } },
"valueGetter": { "type": { "description": "GridValueGetter<R, V, F>" } },
"valueOptions": {
diff --git a/packages/x-data-grid/src/models/api/gridRowSelectionApi.ts b/packages/x-data-grid/src/models/api/gridRowSelectionApi.ts
index ccbd3b1aebd2e..ed8f6b228c9f4 100644
--- a/packages/x-data-grid/src/models/api/gridRowSelectionApi.ts
+++ b/packages/x-data-grid/src/models/api/gridRowSelectionApi.ts
@@ -31,9 +31,9 @@ export interface GridRowSelectionApi {
/**
* 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.
+ * @param {readonly GridRowId[]} rowIds The row ids to select.
*/
- setRowSelectionModel: (rowIds: GridRowId[]) => void;
+ setRowSelectionModel: (rowIds: readonly GridRowId[]) => void;
}
export interface GridRowMultiSelectionApi {
diff --git a/packages/x-data-grid/src/models/colDef/gridColDef.ts b/packages/x-data-grid/src/models/colDef/gridColDef.ts
index 36d7619a59418..4030443ff315d 100644
--- a/packages/x-data-grid/src/models/colDef/gridColDef.ts
+++ b/packages/x-data-grid/src/models/colDef/gridColDef.ts
@@ -134,7 +134,7 @@ export interface GridBaseColDef[];
+ filterOperators?: readonly GridFilterOperator[];
/**
* The callback that generates a filtering function for a given quick filter value.
* This function can return `null` to skip filtering for this value and column.
@@ -306,9 +306,9 @@ export interface GridActionsColDef[]} An array of [[GridActionsCell]] elements.
+ * @returns {readonly React.ReactElement[]} An array of [[GridActionsCell]] elements.
*/
- getActions: (params: GridRowParams) => React.ReactElement[];
+ getActions: (params: GridRowParams) => readonly React.ReactElement[];
}
/**
diff --git a/packages/x-data-grid/src/models/gridRowSelectionModel.ts b/packages/x-data-grid/src/models/gridRowSelectionModel.ts
index 19b3bee14dfb1..599d21df8b8f5 100644
--- a/packages/x-data-grid/src/models/gridRowSelectionModel.ts
+++ b/packages/x-data-grid/src/models/gridRowSelectionModel.ts
@@ -1,5 +1,5 @@
import { GridRowId } from './gridRows';
-export type GridInputRowSelectionModel = GridRowId[] | GridRowId;
+export type GridInputRowSelectionModel = readonly GridRowId[] | GridRowId;
-export type GridRowSelectionModel = GridRowId[];
+export type GridRowSelectionModel = readonly GridRowId[];