1 | import { Observable, EventData } from '../observable';
|
2 | import { ChangedData } from '../observable-array';
|
3 |
|
4 |
|
5 |
|
6 | export interface ItemsLoading extends EventData {
|
7 | |
8 |
|
9 |
|
10 | index: number;
|
11 | |
12 |
|
13 |
|
14 | count: number;
|
15 | }
|
16 |
|
17 |
|
18 |
|
19 | export declare class VirtualArray<T> extends Observable {
|
20 | |
21 |
|
22 |
|
23 | static changeEvent: string;
|
24 | |
25 |
|
26 |
|
27 | static itemsLoadingEvent: string;
|
28 | private _requestedIndexes;
|
29 | private _loadedIndexes;
|
30 | private _length;
|
31 | private _cache;
|
32 | constructor(length?: number);
|
33 | /**
|
34 | * Gets or sets length for the virtual array.
|
35 | */
|
36 | get length(): number;
|
37 | set length(value: number);
|
38 | /**
|
39 | * Gets or sets load size for the virtual array.
|
40 | */
|
41 | private _loadSize;
|
42 | get loadSize(): number;
|
43 | set loadSize(value: number);
|
44 | getItem(index: number): T;
|
45 | setItem(index: number, value: T): void;
|
46 | /**
|
47 | * Loads items from an array starting at index.
|
48 | */
|
49 | load(index: number, items: T[]): void;
|
50 | private requestItems;
|
51 | }
|
52 | export interface VirtualArray<T> {
|
53 | |
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | on(eventNames: string, callback: (data: EventData) => void, thisArg?: any): void;
|
60 | |
61 |
|
62 |
|
63 | on(event: 'itemsLoading', callback: (args: ItemsLoading) => void, thisArg?: any): void;
|
64 | |
65 |
|
66 |
|
67 | on(event: 'change', callback: (args: ChangedData<T>) => void, thisArg?: any): void;
|
68 | }
|