import { BoxrecRole } from "boxrec-requests/dist/boxrec-requests.constants" ; import { BoxrecEvent } from "../event/boxrec.event" ; /**
 * Used by the BoxRec Date page for event information
 */ export class BoxrecDateEvent extends BoxrecEvent { get id ( ) : number { return parseInt ( this . parseId ( ) , 10 ) ; } protected parseLocation ( ) { return this . $ ( ".flag" ) . parent ( ) . html ( ) as string ; } returns { string } protected parseMatchmakers ( ) { return this . parseEventData ( BoxrecRole . matchmaker ) ; } returns { string } protected parsePromoters ( ) { return this . parseEventData ( BoxrecRole . promoter ) ; } private parseId ( ) { const wikiHref = this . $ ( "h2" ) . next ( ) . find ( ".eventP" ) . parent ( ) . attr ( "href" ) ; if ( wikiHref ) { const wikiLink = wikiHref . match ( /(\d+)$/ ) ; if ( wikiLink && wikiLink [ 1 ] ) { return wikiLink [ 1 ] ; } } throw new Error ( "Could not find Event ID" ) ; } }