UNPKG

2.71 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 { NumberSequence } from "../../utils";
5import { RowNode } from "../../entities/rowNode";
6import { Context } from "../../context/context";
7import { BeanStub } from "../../context/beanStub";
8import { RowNodeCacheParams } from "./rowNodeCache";
9import { RowRenderer } from "../../rendering/rowRenderer";
10import { AgEvent } from "../../events";
11export interface RowNodeBlockBeans {
12 context: Context;
13 rowRenderer: RowRenderer;
14}
15export interface LoadCompleteEvent extends AgEvent {
16 success: boolean;
17 page: RowNodeBlock;
18 lastRow: number;
19}
20export declare abstract class RowNodeBlock extends BeanStub {
21 static EVENT_LOAD_COMPLETE: string;
22 static STATE_DIRTY: string;
23 static STATE_LOADING: string;
24 static STATE_LOADED: string;
25 static STATE_FAILED: string;
26 private version;
27 private state;
28 private lastAccessed;
29 private readonly blockNumber;
30 private readonly startRow;
31 private readonly endRow;
32 rowNodes: RowNode[];
33 private beans;
34 private rowNodeCacheParams;
35 protected abstract loadFromDatasource(): void;
36 protected abstract setDataAndId(rowNode: RowNode, data: any, index: number): void;
37 abstract getRow(displayIndex: number): RowNode;
38 abstract getNodeIdPrefix(): string;
39 protected constructor(blockNumber: number, rowNodeCacheParams: RowNodeCacheParams);
40 isAnyNodeOpen(rowCount: number): boolean;
41 private forEachNodeCallback(callback, rowCount);
42 private forEachNode(callback, sequence, rowCount, deep);
43 forEachNodeDeep(callback: (rowNode: RowNode, index: number) => void, sequence: NumberSequence, rowCount: number): void;
44 forEachNodeShallow(callback: (rowNode: RowNode, index: number) => void, sequence: NumberSequence, rowCount: number): void;
45 getVersion(): number;
46 getLastAccessed(): number;
47 getRowUsingLocalIndex(rowIndex: number, dontTouchLastAccessed?: boolean): RowNode;
48 protected init(beans: RowNodeBlockBeans): void;
49 getStartRow(): number;
50 getEndRow(): number;
51 getBlockNumber(): number;
52 setDirty(): void;
53 setDirtyAndPurge(): void;
54 getState(): string;
55 setRowNode(rowIndex: number, rowNode: RowNode): void;
56 setBlankRowNode(rowIndex: number): RowNode;
57 setNewData(rowIndex: number, dataItem: any): RowNode;
58 protected createBlankRowNode(rowIndex: number): RowNode;
59 protected createRowNodes(): void;
60 load(): void;
61 protected pageLoadFailed(): void;
62 private populateWithRowData(rows);
63 destroy(): void;
64 protected pageLoaded(version: number, rows: any[], lastRow: number): void;
65}