import { runCalibreCommand, runDocx2pdfCommand, runExiftoolCommand, runJupyterCommand, runLibreOfficeCommand, runPandocCommand, runPdfLatexCommand, runUnoconvCommand, } from '../../../code/action/convert/document/handler.js';
import { runFontforgeCommand } from '../../../code/action/convert/font/runner.js';
import { runConvertCommand, runInkscapeCommand, runMogrifyCommand, } from '../../../code/action/convert/image/runner.js';
export const COMMAND_HANDLER = {
    convert: runConvertCommand,
    mogrify: runMogrifyCommand,
    inkscape: runInkscapeCommand,
    calibre: runCalibreCommand, // runEbookConvertCommand
    soffice: runLibreOfficeCommand,
    pdflatex: runPdfLatexCommand,
    exiftool: runExiftoolCommand,
    jupyter: runJupyterCommand,
    docx2pdf: runDocx2pdfCommand,
    unoconv: runUnoconvCommand,
    pandoc: runPandocCommand,
    fontforge: runFontforgeCommand,
};
export async function runCommandSequence(sequence) {
    let output;
    for (const command of sequence.call) {
        output = await runCommand(command);
    }
    return output;
}
export async function runCommand(command) {
    const handler = COMMAND_HANDLER[command.key];
    if (!handler) {
        throw new Error('No command handler for ' + command.key);
    }
    return await handler(command);
}
//# sourceMappingURL=command.js.map