import { CApiDocParser } from "./c-apidoc-parser";
import { PythonApiDocParser } from "./python-apidoc-parser";

export interface MDOutput {
  filename: string;
  buffer: string;
}

export class ApiDocParser {
  private cApiDocParser: CApiDocParser;
  private pythonApiDocParser: PythonApiDocParser;

  constructor(
    CApiDocEntry: { buffer: string; docPath: string; repoPath: string },
    pythonApiDocEntryFile: { buffer: string; docPath: string; repoPath: string }
  ) {
    this.cApiDocParser = new CApiDocParser(CApiDocEntry);
    this.pythonApiDocParser = new PythonApiDocParser(pythonApiDocEntryFile);
    this.parse();
  }

  private parse() {
    this.cApiDocParser.parse();
    this.pythonApiDocParser.parse();
  }

  toMD() {
    return {
      cApiDocs: this.cApiDocParser.toMD(),
      pythonApiDocs: this.pythonApiDocParser.toMD()
    };
  }
}
