// @ts-check
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

/**
 * VideoService 视频处理服务
 * @module
 */

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";

/**
 * ConvertVideoToTS 将视频转换为 TS 格式
 * @param {string} videoPath
 * @returns {$CancellablePromise<string>}
 */
export function ConvertVideoToTS(videoPath) {
    return $Call.ByID(2005037305, videoPath);
}

/**
 * GenerateCombinations 生成所有视频组合（笛卡尔积）
 * @param {string[][]} videoLists
 * @param {number} index
 * @param {string[]} currentCombination
 * @param {string[][] | null} result
 * @returns {$CancellablePromise<void>}
 */
export function GenerateCombinations(videoLists, index, currentCombination, result) {
    return $Call.ByID(2802045808, videoLists, index, currentCombination, result);
}

/**
 * GetLargeFileMD5 计算大文件的 MD5
 * @param {string} filePath
 * @returns {$CancellablePromise<string>}
 */
export function GetLargeFileMD5(filePath) {
    return $Call.ByID(229340298, filePath);
}

/**
 * JoinVideos 拼接视频
 * 注意：Wails3 中回调函数需要使用事件系统，这里先简化处理
 * @param {$models.VideoConcatRequest} req
 * @returns {$CancellablePromise<$models.VideoConcatResult[]>}
 */
export function JoinVideos(req) {
    return $Call.ByID(2660164351, req).then(/** @type {($result: any) => any} */(($result) => {
        return $$createType1($result);
    }));
}

/**
 * ListFolders 列出文件夹中的视频文件夹
 * @param {string} folderPath
 * @returns {$CancellablePromise<$models.FolderInfo[]>}
 */
export function ListFolders(folderPath) {
    return $Call.ByID(2209109868, folderPath).then(/** @type {($result: any) => any} */(($result) => {
        return $$createType3($result);
    }));
}

// Private type creation functions
const $$createType0 = $models.VideoConcatResult.createFrom;
const $$createType1 = $Create.Array($$createType0);
const $$createType2 = $models.FolderInfo.createFrom;
const $$createType3 = $Create.Array($$createType2);
