import { IDictionary, IRawModel } from 'datx-utils'; import { IIdentifier } from '../../interfaces/IIdentifier'; import { IReferenceOptions } from '../../interfaces/IReferenceOptions'; import { IType } from '../../interfaces/IType'; import { PureCollection } from '../../PureCollection'; import { PureModel } from '../../PureModel'; /** * Get the type of the given model * * @export * @param {(IType|typeof PureModel|PureModel)} model Model to be checked * @returns {IType} Model type */ export declare function getModelType(model: IType | typeof PureModel | PureModel): IType; /** * Get the model identifier * * @export * @param {(PureModel|IIdentifier)} model Model to be checked * @returns {IIdentifier} Model identifier */ export declare function getModelId(model: PureModel | IIdentifier): IIdentifier; /** * Get a collection the given model belongs to * * @export * @param {PureModel} model Model to be checked * @returns {PureCollection} A collection the given model belongs to */ export declare function getModelCollection(model: PureModel): PureCollection | undefined; /** * Clone the given model * * @export * @template T * @param {T} model Model to be clones * @returns {T} Cloned model object */ export declare function cloneModel(model: T): T; /** * Get the original model for the cloned model * * @export * @param {PureModel} model Cloned model * @returns {PureModel} Original model */ export declare function getOriginalModel(model: T): T; /** * Bulk update the model data * * @export * @template T * @param {T} model Model to be updated * @param {IDictionary} data Data that should be assigned to the model * @returns {T} */ export declare function updateModel(model: T, data: IDictionary): T; /** * Assign a property to a model * * @export * @template T * @param {T} model A model to modify * @param {string} key Property name * @param {*} value Property value */ export declare function assignModel(model: T, key: string, value: any): void; export declare function getMetaKeyFromRaw(data: IRawModel, key: string, model?: typeof PureModel): any; /** * Get a serializable value of the model * * @export * @param {PureModel} model Model to serialize * @returns {IRawModel} Pure JS value of the model */ export declare function modelToJSON(model: PureModel): IRawModel; export declare function getModelMetaKey(model: PureModel, key: string): any; export declare function setModelMetaKey(model: PureModel, key: string, value: any): void; export declare function getModelClassRefs(type: typeof PureModel): IDictionary>;