import LocString from './LocString' ; import LocRef from './LocRef' ; import LocStart from './LocStart' ; import LocEnd from './LocEnd' ; import { NumberColumn as Number } from './Number' ; import { TextColumn as Text } from './Text' ; import { types , IAnyModelType } from 'mobx-state-tree' ; const ColumnTypes = { Number , Text , LocString , LocRef , LocStart , LocEnd , } ; const allColumnTypes = Object . values ( ColumnTypes ) ; const AnyColumnType = types . union ( ... allColumnTypes ) ; const AnyFilterModelType = types . union ( ... allColumnTypes . map ( columnType => { const { FilterModelType } = columnType . create ( { type : columnType . properties . type . value , } ) ; return FilterModelType as unknown as IAnyModelType ; } ) . filter ( t => ! ! t ) ) ; export { ColumnTypes , AnyColumnType , AnyFilterModelType } ;