import Column from "@entity-access/entity-access/dist/decorators/Column.js"; import { IColumn } from "@entity-access/entity-access/dist/decorators/IColumn.js"; interface IColumnDefinition extends Omit,"name"> { computed?: (x: T) => any; default?: () => any; stored?: boolean; }; export function EnumColumn(items: TI, length?: number, cfg: IColumnDefinition = {}) { for (const iterator of items) { length = Math.max(length, iterator.length); } const column = Column({ ... { length, enum: items, dataType: "Char"}, ... cfg }); const labels = items; return { labels, column }; };