import { injectable } from 'inversify' ; import { CombinedReportParameters } from 'accessibility-insights-report' ; import { marked } from 'marked' ; import TerminalRenderer from 'marked-terminal' ; import { BaselineEvaluation } from 'accessibility-insights-scan' ; @ injectable ( ) export abstract class ProgressReporter { constructor ( ) { if ( process . env . ACT === 'true' ) { marked . setOptions ( { renderer : new TerminalRenderer ( ) , } ) ; } } public abstract start ( ) ; public abstract completeRun ( combinedReportResult , baselineEvaluation ? ) ; public abstract failRun ( message ) ; protected async invoke < T > ( fn ) { return process . env . ACT !== 'true' ? fn ( ) : Promise . resolve ( undefined as T ) ; } protected traceMarkdown ( markdown ) { if ( process . env . ACT === 'true' ) { console . log ( '[ProgressReporter] ===' ) ; console . log ( marked ( markdown ) ) ; } } }