-
Notifications
You must be signed in to change notification settings - Fork 0
/
gridParamsApi.ts
83 lines (82 loc) · 3.21 KB
/
gridParamsApi.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
import { GridColDef } from '../colDef';
import { GridValidRowModel, GridRowId, GridTreeNode, GridRowModel } from '../gridRows';
import { GridCellParams } from '../params/gridCellParams';
import { GridColumnHeaderParams } from '../params/gridColumnHeaderParams';
import { GridRowParams } from '../params/gridRowParams';
export interface GridParamsApi {
/**
* Gets the value of a cell at the given `id` and `field`.
* @template V
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @returns {v} The cell value.
*/
getCellValue: <V extends any = any>(id: GridRowId, field: string) => V;
/**
* Gets the cell value.
* Use it instead of `getCellValue` for better performance if you have `row` and `colDef`.
* @template V
* @param {GridRowModel} row The row model.
* @param {GridColDef} colDef The column definition.
* @returns {v} The cell value.
* @ignore - do not document
*/
getRowValue: <V extends any = any>(row: GridRowModel, colDef: GridColDef) => V;
/**
* Gets the cell formatted value
* Use it instead of `getCellParams` for better performance if you only need the formatted value.
* @template V
* @param {GridRowModel} row The row model.
* @param {GridColDef} colDef The column definition.
* @returns {v} The cell value.
* @ignore - do not document
*/
getRowFormattedValue: <V extends any = any>(row: GridRowModel, colDef: GridColDef) => V;
/**
* Gets the underlying DOM element for a cell at the given `id` and `field`.
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @returns {HTMLDivElement | null} The DOM element or `null`.
*/
getCellElement: (id: GridRowId, field: string) => HTMLDivElement | null;
/**
* Gets the [[GridCellParams]] object that is passed as argument in events.
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @returns {GridCellParams} The cell params.
*/
getCellParams: <
R extends GridValidRowModel = any,
V = unknown,
F = V,
N extends GridTreeNode = GridTreeNode,
>(
id: GridRowId,
field: string,
) => GridCellParams<R, V, F, N>;
/**
* Gets the [[GridRowParams]] object that is passed as argument in events.
* @param {GridRowId} id The id of the row.
* @param {string} field The column field.
* @returns {GridRowParams} The row params.
*/
getRowParams: (id: GridRowId) => GridRowParams;
/**
* Gets the underlying DOM element for a row at the given `id`.
* @param {GridRowId} id The id of the row.
* @returns {HTMLDivElement | null} The DOM element or `null`.
*/
getRowElement: (id: GridRowId) => HTMLDivElement | null;
/**
* Gets the underlying DOM element for the column header with the given `field`.
* @param {string} field The column field.
* @returns {HTMLDivElement | null} The DOM element or `null`.
*/
getColumnHeaderElement: (field: string) => HTMLDivElement | null;
/**
* Gets the [[GridColumnHeaderParams]] object that is passed as argument in events.
* @param {string} field The column field.
* @returns {GridColumnHeaderParams} The cell params.
*/
getColumnHeaderParams: (field: string) => GridColumnHeaderParams;
}