UNPKG

1.18 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/>
4/** Datasource used by both PaginationController and InfiniteRowModel */
5export interface IDatasource {
6 /** If you know up front how many rows are in the dataset, set it here. Otherwise leave blank.*/
7 rowCount?: number;
8 /** Callback the grid calls that you implement to fetch rows from the server. See below for params.*/
9 getRows(params: IGetRowsParams): void;
10 destroy?(): void;
11}
12/** Params for the above IDatasource.getRows() */
13export interface IGetRowsParams {
14 /** The first row index to get. */
15 startRow: number;
16 /** The first row index to NOT get. */
17 endRow: number;
18 /** Callback to call for the result when successful. */
19 successCallback(rowsThisBlock: any[], lastRow?: number): void;
20 /** Callback to call when the request fails. */
21 failCallback(): void;
22 /** If doing server side sorting, contains the sort model */
23 sortModel: any;
24 /** If doing server side filtering, contains the filter model */
25 filterModel: any;
26 /** The grid context object */
27 context: any;
28}