import { Base } from "../class/Base.js"; import { Field, Name } from "./Field.js"; import { Schema } from "./Schema.js"; /** * This class describes an entity. Entity is simply a collection of [[Field]]s. Entity also may have a parent entity, * from which it inherit the fields. */ export declare class EntityMeta extends Base { /** * The name of the entity */ name: Name; ownFields: Map; ownCalculationMappings: Map; ownWriteMappings: Map; ownCalculationEtalonMappings: Map; schema: Schema; /** * The parent entity */ parentEntity: EntityMeta; proto: object; /** * Checks whether the entity has a field with given name (possibly inherited from parent entity). * * @param name */ hasField(name: Name): boolean; /** * Returns a field with given name (possibly inherited) or `undefined` if there's none. * * @param name */ getField(name: Name): Field; /** * Adds a field to this entity. * * @param field */ addField(field: T): T; addCalculationMapping(fieldName: Name, calculationMethodName: Name): void; addWriteMapping(fieldName: Name, writeMethodName: Name): void; addCalculationEtalonMapping(fieldName: Name, calculationMethodName: Name): void; forEachParent(func: (entity: EntityMeta) => any): void; $fields: Map; get fields(): Map; $calculationMappings: Map; get calculationMappings(): Map; $writeMappings: Map; get writeMappings(): Map; $calculationEtalonMappings: Map; get calculationEtalonMappings(): Map; /** * Iterator for all fields of this entity (including inherited). * * @param func */ forEachField(func: (field: Field, name: Name) => any): void; }