import { EventEmitter } from "./event"; import { IAdapter, IRecordStore } from "./interfaces"; import { ICollectionOptions, Collection } from './collection'; export declare class DataSource extends EventEmitter { private _adapter; private _configPromise; private _loadOncePromise; private _records; private _recordList; private _observers; _dirtyRecordList: boolean; constructor(adapter?: IAdapter | Function, config?: any); loadRecords(): Promise; loadRecordsOnce(): Promise; addRecord(record: T): Promise; getRecord(id: string): Promise; setRecord(id: string, record: T): Promise; updateRecord(record: T): Promise; removeRecord(recordOrId: T | string): Promise; addRecordCollection(recordCollection: T[] | IRecordStore): Promise; getRecordCollection(ids: Array): Promise; removeRecordCollection(recordCollection: T[] | IRecordStore): Promise; updateRecordCollection(recordCollection: T[] | IRecordStore): Promise; getRecordPage(pageSize: number, pageNumber: number, optionalArguments?: any): Promise; getRecordCount(): Promise; query(...args: any[]): Promise; action(...args: any[]): Promise; clearLocalRecordStore(): void; createManagedCollection(options?: ICollectionOptions): Collection; manageCollection(collection: Collection): void; private _getLocalRecordId(record); private _internalAddRecordCollection(recordCollection); private _internalRemoveRecordCollection(recordCollection); observeRecord(id: string, callback: (record: T) => void): () => void; observeRecords(ids: Array, callback: (record: T) => void): () => void; awaitRecord(id: string): Promise; awaitRecords(ids: Array): Promise; reset(): void; private _flushObservers(id, record); _internalAddRecord(addedRecord: T, id: string): T; _internalChangeRecord(newRecord: T, oldRecord: T, id: string): T; _internalRemoveRecord(removedRecord: T, id: string): T; _internalGetRecordList(): T[]; _internalGetLocalRecordIds(): Array; _internalGetLocalRecords(): IRecordStore; private static promisify(value); private static AddNullRecord; private static SetRecordIdRequired; private static SetRecordRecordRequired; private static RemoveRecordRecordRequired; private static RequirePromiseImpl; static SetPromiseImplementation(p: typeof Promise): void; private static Promise; private static beforeResolveCallback; private static methodArray; private static methodNameArray; static SetBeforeResolveCallback(callback: (retnValue: any | any[]) => void): void; static ResetBeforeResolve(): void; } export { Adapter } from './adapter'; export { ICollectionOptions, Collection } from './collection'; export { IAdapter, IRecordStore } from './interfaces';