-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
gridColumnsInterfaces.ts
36 lines (28 loc) · 1.07 KB
/
gridColumnsInterfaces.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
import type { GridRowId } from '../../../models';
import { GridColDef, GridStateColDef } from '../../../models/colDef/gridColDef';
import type { GridColumnDimensionProperties } from './gridColumnsUtils';
export type GridColumnLookup = {
[field: string]: GridStateColDef;
};
export type GridColumnRawLookup = {
[field: string]: GridColDef | GridStateColDef;
};
export interface GridColumnsState {
/**
* TODO v6: Rename `all` to `orderedFields`
*/
all: string[];
lookup: GridColumnLookup;
columnVisibilityModel: GridColumnVisibilityModel;
}
export type GridColumnDimensions = { [key in GridColumnDimensionProperties]?: number };
export interface GridColumnsInitialState {
columnVisibilityModel?: GridColumnVisibilityModel;
orderedFields?: string[];
dimensions?: Record<string, GridColumnDimensions>;
}
export type GridColumnsRawState = Omit<GridColumnsState, 'lookup'> & {
lookup: GridColumnRawLookup;
};
export type GridHydrateColumnsValue = Omit<GridColumnsRawState, 'columnVisibilityModel'>;
export type GridColumnVisibilityModel = Record<GridRowId, boolean>;