// @ts-check // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL // This file is automatically generated. DO NOT EDIT /** * ResourcesService 是「设置-资源」栏的 Wails 服务。 * @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"; /** * CancelDownload 取消进行中的下载。 * @param {string} name * @returns {$CancellablePromise} */ export function CancelDownload(name) { return $Call.ByID(3403882890, name); } /** * DownloadResource 下载并安装指定资源(同步执行,进度经事件上报,可被 CancelDownload 取消)。 * useMirror=true 强制从资源站镜像下载;默认优先主地址(GitHub),无主地址时自动改用镜像。 * @param {string} name * @param {boolean} useMirror * @returns {$CancellablePromise} */ export function DownloadResource(name, useMirror) { return $Call.ByID(1400169156, name, useMirror); } /** * GetResourceStatus 查询单个资源安装状态。 * @param {string} name * @returns {$CancellablePromise<$models.ResourceStatus>} */ export function GetResourceStatus(name) { return $Call.ByID(2905325282, name).then(/** @type {($result: any) => any} */(($result) => { return $$createType0($result); })); } /** * ListResources 返回资源列表(含本机安装状态)。 * 优先使用用户配置的服务器清单;失败或未配置时回退内置默认清单。 * 服务器拉取失败时通过 resources:listerror 事件告知前端(不再静默回退)。 * @returns {$CancellablePromise<$models.ResourceStatus[]>} */ export function ListResources() { return $Call.ByID(3235964749).then(/** @type {($result: any) => any} */(($result) => { return $$createType1($result); })); } /** * RemoveResource 删除已安装资源:仅移除安装目录/文件,不修改用户 PATH 环境变量。 * @param {string} name * @returns {$CancellablePromise} */ export function RemoveResource(name) { return $Call.ByID(3574422060, name); } // Private type creation functions const $$createType0 = $models.ResourceStatus.createFrom; const $$createType1 = $Create.Array($$createType0);