import { Map } from 'immutable' ; export class TodoItem { _data : Map < string , any > ; get uuid ( ) { return < string > this . _data . get ( 'uuid' ) ; } get text ( ) { return < string > this . _data . get ( 'text' ) ; } setText ( value ) { return new TodoItem ( this . _data . set ( 'text' , value ) ) ; } get completed ( ) { return < boolean > this . _data . get ( 'completed' ) ; } setCompleted ( value ) { return new TodoItem ( this . _data . set ( 'completed' , value ) ) ; } constructor ( data = undefined ) { data = data || { text : '' , completed : false , uuid : uuid . v4 ( ) } ; this . _data = Map < string , any > ( data ) ; } }