import { LEVEL_ENUM, Vertex, DataNode, Service, Structure, MicroService, Interface, ObjectSchema, EntityProperty, ActionOptions, EntityIndex } from '..'; export interface Resolver { level: 'resolver'; name: string; interface: Interface; entity: Entity; isLeaf: boolean; } export declare const systemProperty: { [name: string]: any; }; /** * 实体类 */ export declare class Entity extends Vertex implements ObjectSchema { /** * 概念类型 */ readonly level: LEVEL_ENUM; /** * 实体 Id */ readonly id: string; /** * dataTypes 中的唯一标识 */ readonly schemaRef: string; /** * 实体名称 */ readonly name: string; /** * 实体描述 */ readonly description: string; /** * 实体类型(如enum) */ readonly type: 'object'; /** * 实体属性列表 */ readonly propertyList: Array; /** * 实体索引列表 */ readonly indexList: Array; readonly resolvers: Array; /** * 所属服务 Id */ readonly serviceId: string; /** * 所属服务类型 */ readonly serviceType: string; /** * 所属服务 */ readonly service: MicroService; /** * 上个版本数据 */ readonly lastVersionDef: any; /** * 父节点 */ readonly dataNode: DataNode; /** * 周边存在的名称 */ existingNames: Array; static properties2PropertyList: any; /** * @param source 需要合并的部分参数 */ constructor(source?: Partial); /** * 按当前 id 加载实体数据 * @requires this.id */ load(): Promise; /** * 添加实体 */ create(none?: void, actionOptions?: ActionOptions): Promise; /** * 修改实体 */ update(none?: void, actionOptions?: ActionOptions, then?: () => Promise): Promise; /** * 删除实体 */ delete(none?: void, actionOptions?: ActionOptions): Promise; /** * 设置实体名称 * @param name 名称 */ setName(name: string): Promise; /** * 设置实体描述 * @param description 描述 */ setDescription(description: string): Promise; /** * 同步interfaces * interface、logic、params、returns、variabes采用plainAssign * 创建、删除实体,修改实体名称、增删改实体property需要同步 */ syncInterfaces(isDelete?: boolean): Promise; /** * 同步structures * 创建、删除实体,修改实体名称需要同步 */ syncStructures(isDelete?: boolean): Promise; /** * 从后端 JSON 生成规范的 Entity 对象 */ static from(source: any, service: Service): Entity; } export default Entity;