import { IDisposable } from "@tandem/common/object"; import { IActiveRecord } from "./base"; import { ObservableCollection } from "@tandem/common/observable"; import { Kernel, IInjectable } from "@tandem/common/ioc"; export declare class ActiveRecordCollection, U> extends ObservableCollection implements IInjectable { private _sync; collectionName: string; query: Object; createActiveRecord: (source: U) => T; private _bus; private _globalMessageObserver; static create, U>(collectionName: string, kernel: Kernel, createActiveRecord: (source: U) => T, query?: any): ActiveRecordCollection; setup(collectionName: string, kernel: Kernel, createActiveRecord: (source: U) => T, query?: Object): this; reload(): Promise; load(): Promise; sync(): IDisposable; /** * loads an item with the given query from the DS */ loadItem(query: any): Promise; /** * Loads an item into this collection if it exists, otherwise creates an item */ loadOrInsertItem(query: any, source?: U): Promise; /** * Synchronously creates a new active record (without persisting) with the given data * source. * * @param {U} source The source data represented by the new active record. * @returns */ create(source: U): T; private onPostDSMessage(message); private _updateActiveRecord(source); }