import { ListAttributeValue } from "mendix" ; import { Big } from "big.js" ; export class ListAttributeValueBuilder < T extends string | boolean | Date | Big > { private readonly listAttribute : Partial < ListAttributeValue < T > > = { id : "" as any , get : jest . fn ( ) , sortable : true , filterable : true , type : "String" , formatter : { format : jest . fn ( ( value ) => value . toString ( ) ) , parse : jest . fn ( ) } , universe : undefined } ; withId ( id ) { this . listAttribute . id = id ; return this ; } withSortable ( sortable ) { this . listAttribute . sortable = sortable ; return this ; } withFilterable ( filterable ) { this . listAttribute . filterable = filterable ; return this ; } withType ( type ) { this . listAttribute . type = type ; return this ; } withFormatter ( format , parse ) { this . listAttribute . formatter = { format , parse } ; return this ; } withUniverse ( universe ) { this . listAttribute . universe = universe ; return this ; } build ( ) { return this . listAttribute as ListAttributeValue < T > ; } }