import { ParserError } from './errors'; import type { ParserResult } from './ParserResult'; import type { MeterInterpretationCode } from './ReadStrategy'; export abstract class Parser { interpretationCode: MeterInterpretationCode; constructor(interpretationCode?: MeterInterpretationCode) { this.interpretationCode = interpretationCode || 1; } abstract parse(aBase64String: string, recoverMeterNumber?: Function): ParserResult; assert(condition: boolean, errorMessage?: string) { if (!condition) { throw new ParserError(errorMessage); } } }