UNPKG

12 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 { ColumnApi } from "./columnController/columnApi";
5import { GridPanel } from "./gridPanel/gridPanel";
6import { ColDef, ColGroupDef, IAggFunc } from "./entities/colDef";
7import { RowNode } from "./entities/rowNode";
8import { Column } from "./entities/column";
9import { IRowModel } from "./interfaces/iRowModel";
10import { AddRangeSelectionParams, RangeSelection } from "./interfaces/iRangeController";
11import { GridCell, GridCellDef } from "./entities/gridCell";
12import { IViewportDatasource } from "./interfaces/iViewportDatasource";
13import { IFilterComp } from "./interfaces/iFilter";
14import { CsvExportParams } from "./exportParams";
15import { ExcelExportParams } from "./interfaces/iExcelCreator";
16import { IDatasource } from "./rowModels/iDatasource";
17import { IServerSideDatasource } from "./interfaces/iServerSideDatasource";
18import { RowDataTransaction, RowNodeTransaction } from "./rowModels/clientSide/clientSideRowModel";
19import { AlignedGridsService } from "./alignedGridsService";
20import { AgEvent, ColumnEventType } from "./events";
21import { ICellRendererComp } from "./rendering/cellRenderers/iCellRenderer";
22import { ICellEditorComp } from "./rendering/cellEditors/iCellEditor";
23import { HeaderRootComp } from "./headerRendering/headerRootComp";
24export interface StartEditingCellParams {
25 rowIndex: number;
26 colKey: string | Column;
27 rowPinned?: string;
28 keyPress?: number;
29 charPress?: string;
30}
31export interface GetCellsParams {
32 rowNodes?: RowNode[];
33 columns?: (string | Column)[];
34}
35export interface RefreshCellsParams extends GetCellsParams {
36 force?: boolean;
37}
38export interface FlashCellsParams extends GetCellsParams {
39}
40export interface GetCellRendererInstancesParams extends GetCellsParams {
41}
42export interface GetCellEditorInstancesParams extends GetCellsParams {
43}
44export interface RedrawRowsParams {
45 rowNodes?: RowNode[];
46}
47export interface DetailGridInfo {
48 id: string;
49 api: GridApi;
50 columnApi: ColumnApi;
51}
52export declare class GridApi {
53 private immutableService;
54 private csvCreator;
55 private excelCreator;
56 private gridCore;
57 private rowRenderer;
58 private filterManager;
59 private columnController;
60 private selectionController;
61 private gridOptionsWrapper;
62 private valueService;
63 private alignedGridsService;
64 private eventService;
65 private pinnedRowModel;
66 private context;
67 private rowModel;
68 private sortController;
69 private paginationProxy;
70 private focusedCellController;
71 private rangeController;
72 private clipboardService;
73 private aggFuncService;
74 private menuFactory;
75 private contextMenuFactory;
76 private cellRendererFactory;
77 private cellEditorFactory;
78 private valueCache;
79 private toolPanelComp;
80 private animationFrameService;
81 private gridPanel;
82 private headerRootComp;
83 private clientSideRowModel;
84 private infinitePageRowModel;
85 private serverSideRowModel;
86 private detailGridInfoMap;
87 registerGridComp(gridPanel: GridPanel): void;
88 registerHeaderRootComp(headerRootComp: HeaderRootComp): void;
89 private init();
90 /** Used internally by grid. Not intended to be used by the client. Interface may change between releases. */
91 __getAlignedGridService(): AlignedGridsService;
92 addDetailGridInfo(id: string, gridInfo: DetailGridInfo): void;
93 removeDetailGridInfo(id: string): void;
94 getDetailGridInfo(id: string): DetailGridInfo;
95 forEachDetailGridInfo(callback: (gridInfo: DetailGridInfo, index: number) => void): void;
96 getDataAsCsv(params?: CsvExportParams): string;
97 exportDataAsCsv(params?: CsvExportParams): void;
98 getDataAsExcel(params?: ExcelExportParams): string;
99 exportDataAsExcel(params?: ExcelExportParams): void;
100 setEnterpriseDatasource(datasource: IServerSideDatasource): void;
101 setServerSideDatasource(datasource: IServerSideDatasource): void;
102 setDatasource(datasource: IDatasource): void;
103 setViewportDatasource(viewportDatasource: IViewportDatasource): void;
104 setRowData(rowData: any[]): void;
105 setFloatingTopRowData(rows: any[]): void;
106 setFloatingBottomRowData(rows: any[]): void;
107 getFloatingTopRowCount(): number;
108 getFloatingBottomRowCount(): number;
109 getFloatingTopRow(index: number): RowNode;
110 getFloatingBottomRow(index: number): RowNode;
111 setPinnedTopRowData(rows: any[]): void;
112 setPinnedBottomRowData(rows: any[]): void;
113 getPinnedTopRowCount(): number;
114 getPinnedBottomRowCount(): number;
115 getPinnedTopRow(index: number): RowNode;
116 getPinnedBottomRow(index: number): RowNode;
117 setColumnDefs(colDefs: (ColDef | ColGroupDef)[], source?: ColumnEventType): void;
118 expireValueCache(): void;
119 getVerticalPixelRange(): any;
120 refreshToolPanel(): void;
121 refreshCells(params?: RefreshCellsParams): void;
122 flashCells(params?: FlashCellsParams): void;
123 redrawRows(params?: RedrawRowsParams): void;
124 timeFullRedraw(count?: number): void;
125 refreshView(): void;
126 refreshRows(rowNodes: RowNode[]): void;
127 rowDataChanged(rows: any): void;
128 softRefreshView(): void;
129 refreshGroupRows(): void;
130 setFunctionsReadOnly(readOnly: boolean): void;
131 refreshHeader(): void;
132 isAnyFilterPresent(): boolean;
133 isAdvancedFilterPresent(): boolean;
134 isQuickFilterPresent(): boolean;
135 getModel(): IRowModel;
136 onGroupExpandedOrCollapsed(deprecated_refreshFromIndex?: any): void;
137 refreshInMemoryRowModel(step?: string): any;
138 refreshClientSideRowModel(step?: string): any;
139 isAnimationFrameQueueEmpty(): boolean;
140 getRowNode(id: string): RowNode;
141 expandAll(): void;
142 collapseAll(): void;
143 addVirtualRowListener(eventName: string, rowIndex: number, callback: Function): void;
144 addRenderedRowListener(eventName: string, rowIndex: number, callback: Function): void;
145 setQuickFilter(newFilter: any): void;
146 selectIndex(index: any, tryMulti: any, suppressEvents: any): void;
147 deselectIndex(index: number, suppressEvents?: boolean): void;
148 selectNode(node: RowNode, tryMulti?: boolean, suppressEvents?: boolean): void;
149 deselectNode(node: RowNode, suppressEvents?: boolean): void;
150 selectAll(): void;
151 deselectAll(): void;
152 selectAllFiltered(): void;
153 deselectAllFiltered(): void;
154 recomputeAggregates(): void;
155 sizeColumnsToFit(): void;
156 showLoadingOverlay(): void;
157 showNoRowsOverlay(): void;
158 hideOverlay(): void;
159 isNodeSelected(node: any): any;
160 getSelectedNodesById(): {
161 [nodeId: number]: RowNode;
162 };
163 getSelectedNodes(): RowNode[];
164 getSelectedRows(): any[];
165 getBestCostNodeSelection(): any;
166 getRenderedNodes(): RowNode[];
167 ensureColIndexVisible(index: any): void;
168 ensureColumnVisible(key: string | Column): void;
169 ensureIndexVisible(index: any, position?: string): void;
170 ensureNodeVisible(comparator: any, position?: string): void;
171 forEachLeafNode(callback: (rowNode: RowNode) => void): void;
172 forEachNode(callback: (rowNode: RowNode) => void): void;
173 forEachNodeAfterFilter(callback: (rowNode: RowNode) => void): void;
174 forEachNodeAfterFilterAndSort(callback: (rowNode: RowNode) => void): void;
175 getFilterApiForColDef(colDef: any): any;
176 getFilterInstance(key: string | Column): IFilterComp;
177 getFilterApi(key: string | Column): IFilterComp;
178 destroyFilter(key: string | Column): void;
179 getColumnDef(key: string | Column): ColDef;
180 onFilterChanged(): void;
181 onSortChanged(): void;
182 setSortModel(sortModel: any, source?: ColumnEventType): void;
183 getSortModel(): {
184 colId: string;
185 sort: string;
186 }[];
187 setFilterModel(model: any): void;
188 getFilterModel(): any;
189 getFocusedCell(): GridCell;
190 clearFocusedCell(): void;
191 setFocusedCell(rowIndex: number, colKey: string | Column, floating?: string): void;
192 setSuppressRowDrag(value: boolean): void;
193 setHeaderHeight(headerHeight: number): void;
194 setGridAutoHeight(gridAutoHeight: boolean): void;
195 getPreferredWidth(): number;
196 setGroupHeaderHeight(headerHeight: number): void;
197 setFloatingFiltersHeight(headerHeight: number): void;
198 setPivotGroupHeaderHeight(headerHeight: number): void;
199 setPivotHeaderHeight(headerHeight: number): void;
200 showToolPanel(show: any): void;
201 setSuppressClipboardPaste(value: boolean): void;
202 isToolPanelShowing(): boolean;
203 doLayout(): void;
204 resetRowHeights(): void;
205 setGroupRemoveSingleChildren(value: boolean): void;
206 setGroupRemoveLowestSingleChildren(value: boolean): void;
207 onRowHeightChanged(): void;
208 getValue(colKey: string | Column, rowNode: RowNode): any;
209 addEventListener(eventType: string, listener: Function): void;
210 addGlobalListener(listener: Function): void;
211 removeEventListener(eventType: string, listener: Function): void;
212 removeGlobalListener(listener: Function): void;
213 dispatchEvent(event: AgEvent): void;
214 destroy(): void;
215 resetQuickFilter(): void;
216 getRangeSelections(): RangeSelection[];
217 camelCaseToHumanReadable(camelCase: string): string;
218 addRangeSelection(rangeSelection: AddRangeSelectionParams): void;
219 clearRangeSelection(): void;
220 copySelectedRowsToClipboard(includeHeader: boolean, columnKeys?: (string | Column)[]): void;
221 copySelectedRangeToClipboard(includeHeader: boolean): void;
222 copySelectedRangeDown(): void;
223 showColumnMenuAfterButtonClick(colKey: string | Column, buttonElement: HTMLElement): void;
224 showColumnMenuAfterMouseClick(colKey: string | Column, mouseEvent: MouseEvent | Touch): void;
225 hidePopupMenu(): void;
226 setPopupParent(ePopupParent: HTMLElement): void;
227 tabToNextCell(): boolean;
228 tabToPreviousCell(): boolean;
229 getCellRendererInstances(params?: GetCellRendererInstancesParams): ICellRendererComp[];
230 getCellEditorInstances(params?: GetCellEditorInstancesParams): ICellEditorComp[];
231 getEditingCells(): GridCellDef[];
232 stopEditing(cancel?: boolean): void;
233 startEditingCell(params: StartEditingCellParams): void;
234 addAggFunc(key: string, aggFunc: IAggFunc): void;
235 addAggFuncs(aggFuncs: {
236 [key: string]: IAggFunc;
237 }): void;
238 clearAggFuncs(): void;
239 updateRowData(rowDataTransaction: RowDataTransaction): RowNodeTransaction;
240 batchUpdateRowData(rowDataTransaction: RowDataTransaction, callback?: (res: RowNodeTransaction) => void): void;
241 insertItemsAtIndex(index: number, items: any[], skipRefresh?: boolean): void;
242 removeItems(rowNodes: RowNode[], skipRefresh?: boolean): void;
243 addItems(items: any[], skipRefresh?: boolean): void;
244 refreshVirtualPageCache(): void;
245 refreshInfinitePageCache(): void;
246 refreshInfiniteCache(): void;
247 purgeVirtualPageCache(): void;
248 purgeInfinitePageCache(): void;
249 purgeInfiniteCache(): void;
250 purgeEnterpriseCache(route?: string[]): void;
251 purgeServerSideCache(route?: string[]): void;
252 getVirtualRowCount(): number;
253 getInfiniteRowCount(): number;
254 isMaxRowFound(): boolean;
255 setVirtualRowCount(rowCount: number, maxRowFound?: boolean): void;
256 setInfiniteRowCount(rowCount: number, maxRowFound?: boolean): void;
257 getVirtualPageState(): any;
258 getInfinitePageState(): any;
259 getCacheBlockState(): any;
260 checkGridSize(): void;
261 getFirstRenderedRow(): number;
262 getFirstDisplayedRow(): number;
263 getLastRenderedRow(): number;
264 getLastDisplayedRow(): number;
265 getDisplayedRowAtIndex(index: number): RowNode;
266 getDisplayedRowCount(): number;
267 paginationIsLastPageFound(): boolean;
268 paginationGetPageSize(): number;
269 paginationSetPageSize(size: number): void;
270 paginationGetCurrentPage(): number;
271 paginationGetTotalPages(): number;
272 paginationGetRowCount(): number;
273 paginationGoToNextPage(): void;
274 paginationGoToPreviousPage(): void;
275 paginationGoToFirstPage(): void;
276 paginationGoToLastPage(): void;
277 paginationGoToPage(page: number): void;
278}