import { IDictionary, IRawModel } from 'datx-utils'; import { IIdentifier } from './interfaces/IIdentifier'; import { IModelConstructor } from './interfaces/IModelConstructor'; import { IRawView } from './interfaces/IRawView'; import { IType } from './interfaces/IType'; import { PureCollection } from './PureCollection'; import { PureModel } from './PureModel'; export declare class View { protected __collection: PureCollection; unique: boolean; readonly modelType: IType; sortMethod?: string | ((item: T) => any); private readonly __models; constructor(modelType: IModelConstructor | IType, __collection: PureCollection, sortMethod?: string | ((item: T) => any), models?: Array, unique?: boolean); readonly length: number; readonly list: Array; toJSON(): IRawView; readonly snapshot: IRawView; /** * Add an existing or a new model to the collection * * @template T * @param {T|IRawModel|IDictionary} data Model to be added * @returns {T} Added model * @memberof Collection */ add(data: T | IRawModel | IDictionary): T; /** * Add an array of existing or new models to the collection * * @template T * @param {Array} data Array of models to be added * @returns {Array} Added models * @memberof Collection */ add(data: Array): Array; /** * Check if a model is in the collection * * @param {T|IIdentifier} model Model to check * @returns {boolean} The given model is in the collection * @memberof Collection */ hasItem(model: T | IIdentifier): boolean; /** * Remove a model from the view * * @param {IIdentifier|T} model Model identifier * @memberof Collection */ remove(model: IIdentifier | T): void; removeAll(): void; private __getModel; private __isIdentifier; private __reMap; private __partialListUpdate; }