1
0

resourcesservice.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // @ts-check
  2. // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
  3. // This file is automatically generated. DO NOT EDIT
  4. /**
  5. * ResourcesService 是「设置-资源」栏的 Wails 服务。
  6. * @module
  7. */
  8. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  9. // @ts-ignore: Unused imports
  10. import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
  11. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  12. // @ts-ignore: Unused imports
  13. import * as $models from "./models.js";
  14. /**
  15. * CancelDownload 取消进行中的下载。
  16. * @param {string} name
  17. * @returns {$CancellablePromise<void>}
  18. */
  19. export function CancelDownload(name) {
  20. return $Call.ByID(3403882890, name);
  21. }
  22. /**
  23. * DownloadResource 下载并安装指定资源(同步执行,进度经事件上报,可被 CancelDownload 取消)。
  24. * @param {string} name
  25. * @returns {$CancellablePromise<void>}
  26. */
  27. export function DownloadResource(name) {
  28. return $Call.ByID(1400169156, name);
  29. }
  30. /**
  31. * GetResourceStatus 查询单个资源安装状态。
  32. * @param {string} name
  33. * @returns {$CancellablePromise<$models.ResourceStatus>}
  34. */
  35. export function GetResourceStatus(name) {
  36. return $Call.ByID(2905325282, name).then(/** @type {($result: any) => any} */(($result) => {
  37. return $$createType0($result);
  38. }));
  39. }
  40. /**
  41. * ListResources 返回资源列表(含本机安装状态)。
  42. * 优先使用用户配置的服务器清单;失败或未配置时回退内置默认清单。
  43. * @returns {$CancellablePromise<$models.ResourceStatus[]>}
  44. */
  45. export function ListResources() {
  46. return $Call.ByID(3235964749).then(/** @type {($result: any) => any} */(($result) => {
  47. return $$createType1($result);
  48. }));
  49. }
  50. /**
  51. * RemoveResource 删除已安装资源:移除安装目录/文件,并从用户 PATH 移除对应目录。
  52. * @param {string} name
  53. * @returns {$CancellablePromise<void>}
  54. */
  55. export function RemoveResource(name) {
  56. return $Call.ByID(3574422060, name);
  57. }
  58. // Private type creation functions
  59. const $$createType0 = $models.ResourceStatus.createFrom;
  60. const $$createType1 = $Create.Array($$createType0);