import { Base } from "../class/Base.js"; import { EntityMeta } from "./EntityMeta.js"; import { Name } from "./Field.js"; /** * This class describes a schema. Schemas are not used yet in ChronoGraph. * * Schema is just a collection of entities ([[EntityMeta]]) */ export declare class Schema extends Base { /** * The name of the schema */ name: Name; entities: Map; /** * Checks whether the schema has an entity with the given name. * * @param name */ hasEntity(name: Name): boolean; /** * Returns an entity with the given name or `undefined` if there's no such in this schema * * @param name */ getEntity(name: Name): EntityMeta; /** * Adds an entity to the schema. * @param entity */ addEntity(entity: EntityMeta): EntityMeta; /** * Returns a class decorator which can be used to decorate classes as entities. */ getEntityDecorator(): ClassDecorator; } export declare const entityDecoratorBody: (target: T) => EntityMeta; /** * Entity decorator. It is required to be applied only if entity declares no field. * If record declares any field, there no strict need to apply this decorator. * Its better to do this anyway, for consistency. * * ```ts * @entity() * class Author extends Entity.mix(Base) { * } * * @entity() * class SpecialAuthor extends Author { * } * ``` */ export declare const entity: () => ClassDecorator;