export var foo = 123 ; module first { function logName ( something ) { console . log ( something . name ) ; } var person = { name : 'matt' , job : 'being awesome' } ; var animal = { name : 'cow' , diet : 'vegan, but has milk of own species' } ; var random = { note : `I don't have a name property` } ; logName ( person ) ; logName ( animal ) ; logName ( random ) ; } module second { function logName ( something ) { console . log ( something . name ) ; } logName ( { name : 'matt' } ) ; logName ( { name : 'matt' , job : 'being awesome' } ) ; } module third { function logIfHasName ( something ) { if ( something . name ) { console . log ( something . name ) ; } } var person = { name : 'matt' , job : 'being awesome' } ; var animal = { name : 'cow' , diet : 'vegan, but has milk of own species' } ; logIfHasName ( person ) ; logIfHasName ( animal ) ; logIfHasName ( { neme : 'I just misspelled name to neme' } ) ; } module fourth { var x ; x = { foo : 1 , baz : 2 } ; } module fifth { interface State { foo : string ; bar : string ; } class MyComponent { state : any ; setState ( state ) { } doSomething ( ) { this . setState ( { foo : 'Hello' } ) ; this . setState ( { foo : 'Hello' , bar : this . state . bar } ) ; } } } module sixth { interface State { foo ? : string ; bar ? : string ; } class MyComponent { state : any ; setState ( state ) { } doSomething ( ) { this . setState ( { foo : 'Hello' } ) ; this . setState ( { foos : 'Hello' } ) ; this . setState ( { foo : 123 } ) ; } } }