UNPKG

@farris/devkit-vue

Version:
49 lines (48 loc) 1.08 kB
import { EntityPath } from '../entity-path/index'; import { FieldType, FieldSchema } from './entity-field-schema'; /** * 实体字段信息 */ declare class EntitySchema { /** * 字段描述集合 */ private fieldSchemaMap; /** * 主键值 */ private idKey; /** * 构造函数 */ constructor(); /** * 获取全部字段描述 */ getFieldSchemas(): FieldSchema[]; /** * 根据字段Type获取字段描述 */ getFieldSchemasByType<T extends FieldSchema>(type: FieldType): T[]; /** * 根据字段Name获取字段描述 */ getFieldSchemaByName(name: string): FieldSchema | undefined; /** * 根据字段Path获取字段描述 */ getFieldSchemaByPath(entityPath: EntityPath): FieldSchema; /** * 添加字段信息 */ addFieldSchema(fieldSchema: FieldSchema): void; /** * 设置主键字段 */ setIdKey(primaryKey: string): void; /** * 获取主键字段 */ getIdKey(): string; } export { EntitySchema };