constructor interface OutputObj { method : string ; function : ( str : any ) => any ; } type OutputValues = "age" | "boxingOrganizations" | "byWeightDivision" | "career" | "champions" | "commission" | "date" | "division" | "doctors" | "firstBoxerRating" | "firstBoxerWeight" | "hasBoutScheduled" | "id" | "inspector" | "judges" | "last6" | "links" | "localBoxers" | "localManagers" | "location" | "matchmakers" | "media" | "metadata" | "name" | "numberOfBouts" | "numberOfPages" | "numberOfPeople" | "numberOfRounds" | "outcome" | "people" | "points" | "promoters" | "rating" | "record" | "referee" | "residence" | "result" | "secondBoxer" | "secondBoxerLast6" | "secondBoxerRating" | "secondBoxerRecord" | "secondBoxerWeight" | "stance" | "television" | "titles" ; export function OutputGetter ( collection ) { return ( target ) => { Object . defineProperty ( target . prototype , "output" , { get ( ) { const obj = { } ; for ( const item of collection ) { if ( typeof item === "string" ) { obj [ item ] = this [ item ] ; } else { const col = item as OutputObj ; obj [ col . method ] = col . function ( this [ col . method ] ) ; } } return obj ; } , } ) ; } ; } export interface OutputInterface { readonly output : any ; }