Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/x/api/data-grid/grid-cell-params.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"import { GridCellParams } from '@mui/x-data-grid'"
],
"properties": {
"api": { "type": { "description": "GridApiCommunity" }, "required": true },
"api": { "type": { "description": "Api" }, "required": true },
"cellMode": { "type": { "description": "GridCellMode" }, "required": true },
"colDef": { "type": { "description": "GridStateColDef" }, "required": true },
"field": { "type": { "description": "string" }, "required": true },
Expand Down
21 changes: 8 additions & 13 deletions packages/x-data-grid/src/models/params/gridCellParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import type { GridStateColDef } from '../colDef/gridColDef';
import { GridEditCellProps } from '../gridEditRowModel';
import { GridApiCommunity } from '../api/gridApiCommunity';
import { GridApiCommon } from '../api/gridApiCommon';

/**
* Object passed as parameter in the column [[GridColDef]] cell renderer.
Expand All @@ -19,6 +20,7 @@ export interface GridCellParams<
V = unknown,
F = V,
N extends GridTreeNode = GridTreeNode,
Api extends GridApiCommon = GridApiCommunity,
> {
/**
* The grid row id.
Expand Down Expand Up @@ -68,7 +70,7 @@ export interface GridCellParams<
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommunity;
api: Api;
}

export interface FocusElement {
Expand All @@ -83,11 +85,8 @@ export interface GridRenderCellParams<
V = any,
F = V,
N extends GridTreeNodeWithRender = GridTreeNodeWithRender,
> extends GridCellParams<R, V, F, N> {
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommunity;
Api extends GridApiCommon = GridApiCommunity,
> extends GridCellParams<R, V, F, N, Api> {
/**
* A ref allowing to set imperative focus.
* It can be passed to the element that should receive focus.
Expand All @@ -104,13 +103,9 @@ export interface GridRenderEditCellParams<
V = any,
F = V,
N extends GridTreeNodeWithRender = GridTreeNodeWithRender,
> extends GridCellParams<R, V, F, N>,
GridEditCellProps<V> {
/**
* GridApi that let you manipulate the grid.
*/
api: GridApiCommunity;
}
Api extends GridApiCommon = GridApiCommunity,
> extends GridCellParams<R, V, F, N, Api>,
GridEditCellProps<V> {}

/**
* Object passed as parameter in the column [[GridColDef]] edit cell props change callback.
Expand Down
Loading