import { BoxrecPageEventBoutRow } from "../boxrec-pages/event/boxrec.page.event.bout.row" ; import { BoxrecPageProfileBoxerBoutRow } from "../boxrec-pages/profile/boxrec.page.profile.boxer.bout.row" ; import { BoxrecPageProfileOtherCommonBoutRow } from "../boxrec-pages/profile/boxrec.page.profile.other.common.bout.row" ; import { BoxrecPageTitlesRow } from "../boxrec-pages/titles/boxrec.page.titles.row" ; import { getHeaderColumnText } from "../helpers" ; param tableEl param classType param theadNumber param reverseOrder constructor export function BoutsGetter ( tableEl , classType , theadNumber = 1 , reverseOrder = false ) { return target => { Object . defineProperty ( target . prototype , "bouts" , { get ( ) { const headerColumns = getHeaderColumnText ( this . $ ( tableEl ) , theadNumber ) ; const bouts = this . returnBouts ( ) . map ( ( val ) => new classType ( headerColumns , val [ 0 ] , val [ 1 ] ) ) ; if ( reverseOrder ) { return bouts . reverse ( ) ; } return bouts ; } , } ) ; } ; } export interface BoutsInterface { readonly bouts : Array < BoxrecPageEventBoutRow | BoxrecPageTitlesRow | BoxrecPageProfileBoxerBoutRow | BoxrecPageProfileOtherCommonBoutRow > ; }