import { Embedded } from '@lcap/nasl-types'; import { TranslatorGenerator } from '@lcap/nasl-translator'; import Module from './Module__'; import DataSource from './DataSource__'; import View from './View__'; import Annotatable from './Annotatable__'; import type EntityProperty from './EntityProperty__'; import type EntityIndex from './EntityIndex__'; import type PermissionForSharedScope from './PermissionForSharedScope__'; /** * 实体 */ export declare class Entity extends Annotatable { /** 类名 */ static readonly ConceptName: string; /** * 是否为抽象类 * 抽象类不能产生 concept: string */ static isAbstract: boolean; /** 继承链 */ static readonly inheritanceChain: string[]; /** * 产品概念 */ readonly concept: 'Entity'; /** * 实体名称 */ name: string; /** * 唯一标识 */ uuid: string; /** * 数据库表名 */ tableName: string; /** * 实体描述 */ description?: string; /** * 实体来源 */ origin: 'ide' | 'sql' | 'table' | 'excel' | 'view'; /** * 实体属性列表 */ properties: Array; /** * 实体索引列表 */ indexes: Array; /** * 实体共享元信息 */ sharedScope?: PermissionForSharedScope; /** * @param source 需要合并的部分参数 */ constructor(source?: Partial); static from(source: any, parentNode?: any, parentKey?: string): Entity; /** * 设置实体描述 */ setDescription(description: string): void; /** * 设置实体共享元信息 */ setSharedScope(sharedScope: PermissionForSharedScope): void; getPropertyExistingNames(excludedList?: Array): string[]; getPropertyUniqueName(name?: string): string; /** * 插入实体属性 * @internal * @param name 实体属性名称,如果不填会自动生成一个唯一名称 */ _insertPropertyAt(name: string, index: number): EntityProperty; /** * 插入实体属性 * @internal * @param propertyOptions 实体属性参数 */ _insertPropertyAt(propertyOptions: Partial, index: number): EntityProperty; /** * 插入实体属性 * @internal * @param property 已有的实体属性实例 */ _insertPropertyAt(property: EntityProperty, index: number): EntityProperty; /** * 插入实体属性 * @param name 实体属性名称,如果不填会自动生成一个唯一名称 */ insertPropertyAt(name: string, index: number): EntityProperty; /** * 插入实体属性 * @param propertyOptions 实体属性参数 */ insertPropertyAt(propertyOptions: Partial, index: number): EntityProperty; /** * 插入实体属性 * @param property 已有的实体属性实例 */ insertPropertyAt(property: EntityProperty, index: number): EntityProperty; /** * 添加实体属性 * @internal * @param name 实体属性名称,如果不填会自动生成一个唯一名称 */ _addProperty(name?: string): EntityProperty; /** * 添加实体属性 * @internal * @param propertyOptions 实体属性参数 */ _addProperty(propertyOptions: Partial): EntityProperty; /** * 添加实体属性 * @internal * @param property 已有的实体属性实例 */ _addProperty(property: EntityProperty): EntityProperty; /** * 添加实体属性 * @internal * @param name 实体属性名称,如果不填会自动生成一个唯一名称 */ addProperty(name?: string): EntityProperty; /** * 添加实体属性 * @param propertyOptions 实体属性参数 */ addProperty(propertyOptions: Partial): EntityProperty; /** * 添加实体属性 * @param property 已有的实体属性实例 */ addProperty(property: EntityProperty): EntityProperty; getEntityIndexExistingNames(excludedList?: Array): string[]; getEntityIndexUniqueName(name?: string): string; /** * 插入实体索引 * @internal * @param name 实体索引名称,如果不填会自动生成一个唯一名称 */ _insertEntityIndexAt(name: string, index: number): EntityIndex; /** * 插入实体索引 * @internal * @param entityIndexOptions 实体索引参数 */ _insertEntityIndexAt(entityIndexOptions: Partial, index: number): EntityIndex; /** * 插入实体索引 * @internal * @param entityIndex 已有的实体索引实例 */ _insertEntityIndexAt(entityIndex: EntityIndex, index: number): EntityIndex; /** * 插入实体索引 * @param name 实体索引名称,如果不填会自动生成一个唯一名称 */ insertEntityIndexAt(name: string, index: number): EntityIndex; /** * 插入实体索引 * @param entityIndexOptions 实体索引参数 */ insertEntityIndexAt(entityIndexOptions: Partial, index: number): EntityIndex; /** * 插入实体索引 * @param entityIndex 已有的实体索引实例 */ insertEntityIndexAt(entityIndex: EntityIndex, index: number): EntityIndex; /** * 添加实体索引 * @internal * @param name 实体索引名称,如果不填会自动生成一个唯一名称 */ _addEntityIndex(name?: string): EntityIndex; /** * 添加实体索引 * @internal * @param entityIndexOptions 实体索引参数 */ _addEntityIndex(entityIndexOptions: Partial): EntityIndex; /** * 添加实体索引 * @internal * @param entityIndex 已有的实体索引实例 */ _addEntityIndex(entityIndex: EntityIndex): EntityIndex; /** * 添加实体索引 * @internal * @param name 实体索引名称,如果不填会自动生成一个唯一名称 */ addEntityIndex(name?: string): EntityIndex; /** * 添加实体索引 * @param entityIndexOptions 实体索引参数 */ addEntityIndex(entityIndexOptions: Partial): EntityIndex; /** * 添加实体索引 * @param entityIndex 已有的实体索引实例 */ addEntityIndex(entityIndex: EntityIndex): EntityIndex; /** * 删除实体属性 * @param name 实体属性名称 */ removeProperty(name: string): void; /** * 删除实体属性 * @param property 已有的实体属性实例 */ removeProperty(property: EntityProperty): void; /** * 删除实体索引 * @param name 实体索引名称 */ removeEntityIndex(name: string): void; /** * 删除实体索引 * @param entityIndex 已有的实体索引实例 */ removeEntityIndex(entityIndex: EntityIndex): void; /** * 祖先 Module */ get module(): Module; /** * 祖先 DataSource */ get dataSource(): DataSource; /** * 绑定的流程表单页面 */ __bindView: Map; getPropertyExistingColumnNames(excludedList?: Array): string[]; getPropertyUniqueColumnName(name?: string, excludedList?: Array): string; getPropertyExistingNameList(excludedList?: Array): string[]; /** * 设置实体表名并修改表名 */ setName(name: string): void; /** * 设置实体表名 */ setTableName(tableName: string): void; isIgnoreFormatTableAndColumnName(): boolean; genFormatTableName(useEntityName?: boolean): any; /** * 根据全局设置中的数据库命名规则,生成 属性列名 */ genFormatPropertyColumnName(property: EntityProperty, forceFormat?: boolean): any; /** * 根据全局设置中的数据库命名规则,将 实体表名 重命名 * 此方法不会 update */ __formatTableName(): void; /** * 根据全局设置中的数据库命名规则,将 实体表名 重命名 */ formatTableName(): void; /** * 根据全局设置中的数据库命名规则,将 属性列名 重命名 */ formatPropertyColumnName(): void; /** * 根据全局设置中的数据库命名规则,将 属性列名 重命名 * 此方法不会 update */ __formatPropertyColumnName(): void; /** * 根据全局设置中的数据库命名规则,将 实体表名 和 属性列名 重命名 */ formatTableAndColumnName(): void; static getDefaultOptions(): { properties: ({ concept: string; name: string; columnName: string; label: string; description: string; primaryKey: boolean; required: boolean; typeAnnotation: { concept: string; typeKind: string; typeNamespace: string; typeName: string; }; display: { inTable: boolean; inFilter: boolean; inForm: boolean; inDetail: boolean; }; } | { concept: string; name: string; columnName: string; label: string; description: string; typeAnnotation: { concept: string; typeKind: string; typeNamespace: string; typeName: string; }; display: { inTable: boolean; inFilter: boolean; inForm: boolean; inDetail: boolean; }; primaryKey?: undefined; required?: undefined; })[]; }; toEmbeddedTS(state?: import("@lcap/nasl-types/out/translator").TranslatorState): TranslatorGenerator; toNaturalTS(state?: import("@lcap/nasl-types/out/translator").TranslatorState, entityName?: string): string; toTextualNASL(state?: import("@lcap/nasl-types/out/translator").TranslatorState): string; getNamespace(): string; /** * 生成宿主语言的文件路径 * @param name 一般不用传,用于 rename */ getEmbeddedFilePath(name?: string): string; get ns(): any; get logics(): any; get contentUniqueKey(): string; get namespace(): string; get completeName(): string; toEmbeddedTSFile(): Embedded.TSFileGenerator; toEmbeddedDeclarationTSFile(): Embedded.DeclarationTSFileResult; get propertyPrimaryKeyNames(): string[]; /** * 获取已有的属性 * 因为这个primaryIndex不允许添加 * @param excludedList 排除的集合 * @returns 有属性 */ getRenderEntityIndexExistingNames(excludedList?: Array): string[]; getEntityRelationList(): Entity[]; syncProcessPermission(propertyNames: string[]): void; get isNoPrimaryKey(): boolean; get isViewEntity(): boolean; get directory(): import("./Directory__").Directory; openSharedScope(): void; closeSharedScope(): void; } export default Entity; //# sourceMappingURL=Entity__.d.ts.map