UNPKG

1.38 kBTypeScriptView Raw
1// Type definitions for ag-grid v18.1.2
2// Project: http://www.ag-grid.com/
3// Definitions by: Niall Crosby <https://github.com/ag-grid/>
4import { IComponent } from "../../interfaces/iComponent";
5import { RowNode } from "../../entities/rowNode";
6import { ColDef } from "../../entities/colDef";
7import { Column } from "../../entities/column";
8import { GridApi } from "../../gridApi";
9import { ColumnApi } from "../../columnController/columnApi";
10export interface ICellRendererParams {
11 value: any;
12 valueFormatted: any;
13 getValue: () => any;
14 setValue: (value: any) => void;
15 formatValue: (value: any) => any;
16 data: any;
17 node: RowNode;
18 colDef: ColDef;
19 column: Column;
20 $scope: any;
21 rowIndex: number;
22 api: GridApi;
23 columnApi: ColumnApi;
24 context: any;
25 refreshCell: () => void;
26 eGridCell: HTMLElement;
27 eParentOfValue: HTMLElement;
28 addRenderedRowListener: (eventType: string, listener: Function) => void;
29}
30export interface ICellRenderer {
31 /** Get the cell to refresh. Return true if successful. Return false if not (or you don't have refresh logic),
32 * then the grid will refresh the cell for you. */
33 refresh(params: any): boolean;
34}
35export interface ICellRendererComp extends ICellRenderer, IComponent<ICellRendererParams> {
36}
37export interface ICellRendererFunc {
38 (params: any): HTMLElement | string;
39}