import { makeAutoObservable } from 'mobx' ; export class StringState { value : string = '' ; constructor ( args = { } ) { Object . assign ( this , args ) ; makeAutoObservable ( this ) ; } setValue ( value ) { this . value = value ; } } export class BooleanState { value : boolean = false ; constructor ( args = { } ) { Object . assign ( this , args ) ; makeAutoObservable ( this ) ; } setValue ( value ) { this . value = value ; } } export class NumberState { value : number = 0 ; constructor ( args = { } ) { Object . assign ( this , args ) ; makeAutoObservable ( this ) ; } setValue ( value ) { this . value = value ; } } export class ValueState < T > { _value : T = null ; constructor ( args = { } ) { Object . assign ( this , args ) ; makeAutoObservable ( this ) ; } get value ( ) { return this . getValue ? this . getValue ( this . _value ) : this . _value ; } set value ( value ) { this . _value = value ; } getValue : ( value : T ) => T ; setValue ( value ) { this . _value = value ; } }