type MyFlexibleDogInfo = { name : string ; [ key ] : string | number ; } ; const dog = { name : "LG" , breed : "Mutt" , age : 2 } ; interface DogInfo { name : string ; age : number ; } type OptionsFlag < Type > = { [ Property in keyof Type ] : null ; } ; type DogInfoOptions = OptionsFlag < DogInfo > ; type Listeners < Type > = { [ Property in keyof Type as `on${ Capitalize < string & Property > }Change` ] ? : ( newValue : Type [ Property ] ) => void ; } & { [ Property in keyof Type as `on${ Capitalize < string & Property > }Delete` ] ? : ( newValue : Type [ Property ] ) => void ; } ; function listenToObject < T > ( obj , listeners ) { throw "Needs to be implemented" ; } const lg = { name : "LG" , age : 13 } ; type DogInfoListeners = Listeners < DogInfo > ; listenToObject ( lg , { onNameChange : ( v ) => { } , onAgeChange : ( v ) => { } , onAgeDelete : ( ) => { } } ) ;