import { CALIBRE_INPUT_FORMAT, CALIBRE_OUTPUT_FORMAT, FFMPEG_FORMAT, FONT_FORMAT, IMAGE_MAGICK_INPUT_FORMAT, IMAGE_MAGICK_OUTPUT_FORMAT, LIBRE_OFFICE_INPUT_FORMAT, LIBRE_OFFICE_OUTPUT_FORMAT, PANDOC_INPUT_FORMAT, PANDOC_OUTPUT_FORMAT, CONVERT_LATEX_TO_PNG_INPUT_FORMAT, CONVERT_LATEX_TO_PNG_OUTPUT_FORMAT, } from '../../../code/type/index.js';
import { buildRemoteRequest } from '../../../code/tool/shared/request.js';
import { omitNested } from '../../../code/tool/shared/object.js';
export function useConvertLatexToPng(a, b) {
    if (a === b) {
        return false;
    }
    if (!CONVERT_LATEX_TO_PNG_INPUT_FORMAT.includes(a)) {
        return false;
    }
    if (!CONVERT_LATEX_TO_PNG_OUTPUT_FORMAT.includes(b)) {
        return false;
    }
    return true;
}
export function useConvertImageWithImageMagick(a, b) {
    if (a === b) {
        return false;
    }
    if (!IMAGE_MAGICK_INPUT_FORMAT.includes(a)) {
        return false;
    }
    if (!IMAGE_MAGICK_OUTPUT_FORMAT.includes(b)) {
        return false;
    }
    return true;
}
export function useConvertImageWithInkscape(a, b) {
    if (a === b) {
        return false;
    }
    if (a !== 'ai') {
        return false;
    }
    if (b !== 'svg') {
        return false;
    }
    return true;
}
export function useConvertVideoWithFfmpeg(a, b) {
    if (a === b) {
        return false;
    }
    if (!FFMPEG_FORMAT.includes(a)) {
        return false;
    }
    if (!FFMPEG_FORMAT.includes(b)) {
        return false;
    }
    return true;
}
export function useConvertFontWithFontForge(a, b) {
    if (a === b) {
        return false;
    }
    if (!FONT_FORMAT.includes(a)) {
        return false;
    }
    if (!FONT_FORMAT.includes(b)) {
        return false;
    }
    return true;
}
export function useConvertDocumentWithCalibre(a, b) {
    if (a === b) {
        return false;
    }
    if (!CALIBRE_INPUT_FORMAT.includes(a)) {
        return false;
    }
    if (!CALIBRE_OUTPUT_FORMAT.includes(b)) {
        return false;
    }
    return true;
}
export function useConvertDocumentWithPandoc(a, b) {
    if (a === b) {
        return false;
    }
    if (!PANDOC_INPUT_FORMAT.includes(a)) {
        return false;
    }
    if (!PANDOC_OUTPUT_FORMAT.includes(b)) {
        return false;
    }
    return true;
}
export function useConvertDocumentWithLibreOffice(a, b) {
    if (a === b) {
        return false;
    }
    if (!LIBRE_OFFICE_INPUT_FORMAT.includes(a)) {
        return false;
    }
    if (!LIBRE_OFFICE_OUTPUT_FORMAT.includes(b)) {
        return false;
    }
    return true;
}
export async function convertArchive(source) {
    // const input = IOConvertArchive.parse(source)
    // const list = ConvertArchive(input)
    // for (const cmd of list) {
    //   await handleCommand(cmd)
    // }
}
export function buildRequestToConvert(input) {
    return buildRemoteRequest(`/convert/${input.input.format}/${input.output.format}`, omitNested(input, [
        ['remote'],
        ['input', 'format'],
        ['output', 'format'],
    ]));
}
//# sourceMappingURL=shared.js.map