localsendservice.js 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. // @ts-check
  2. // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
  3. // This file is automatically generated. DO NOT EDIT
  4. /**
  5. * LocalSendService 是 LocalSend 功能的 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 model$0 from "./localsend/model/models.js";
  14. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  15. // @ts-ignore: Unused imports
  16. import * as $models from "./models.js";
  17. /**
  18. * ConfirmTransfer 手动接收确认:accept=true 接受,false 拒绝。
  19. * @param {string} sessionID
  20. * @param {boolean} accept
  21. * @returns {$CancellablePromise<void>}
  22. */
  23. export function ConfirmTransfer(sessionID, accept) {
  24. return $Call.ByID(2598966323, sessionID, accept);
  25. }
  26. /**
  27. * GetConfig 返回当前配置。
  28. * @returns {$CancellablePromise<$models.LocalSendConfig>}
  29. */
  30. export function GetConfig() {
  31. return $Call.ByID(304061066).then(/** @type {($result: any) => any} */(($result) => {
  32. return $$createType0($result);
  33. }));
  34. }
  35. /**
  36. * GetDevices 返回当前发现的设备列表。
  37. * @returns {$CancellablePromise<(model$0.Device | null)[]>}
  38. */
  39. export function GetDevices() {
  40. return $Call.ByID(2077455679).then(/** @type {($result: any) => any} */(($result) => {
  41. return $$createType3($result);
  42. }));
  43. }
  44. /**
  45. * SendFiles 把本地文件发送给指定的 LocalSend 设备(按 IP 定位)。
  46. * filePaths 为本地文件/目录路径列表;deviceIP 为目标设备 IP(如 192.168.1.5)。
  47. * @param {string[]} filePaths
  48. * @param {string} deviceIP
  49. * @returns {$CancellablePromise<void>}
  50. */
  51. export function SendFiles(filePaths, deviceIP) {
  52. return $Call.ByID(1947247873, filePaths, deviceIP);
  53. }
  54. /**
  55. * SetConfig 更新本机名、接收位置、接收模式。
  56. * 若服务运行中,即时生效(服务器配置与后续公告同步更新)。
  57. * @param {string} alias
  58. * @param {string} receiveDir
  59. * @param {boolean} autoAccept
  60. * @returns {$CancellablePromise<void>}
  61. */
  62. export function SetConfig(alias, receiveDir, autoAccept) {
  63. return $Call.ByID(3005820190, alias, receiveDir, autoAccept);
  64. }
  65. /**
  66. * Start 启动 LocalSend 服务:生成/加载证书、启动接收服务器与发现服务。
  67. * @returns {$CancellablePromise<void>}
  68. */
  69. export function Start() {
  70. return $Call.ByID(4044878204);
  71. }
  72. /**
  73. * Stop 停止 LocalSend 服务。
  74. * @returns {$CancellablePromise<void>}
  75. */
  76. export function Stop() {
  77. return $Call.ByID(926464408);
  78. }
  79. // Private type creation functions
  80. const $$createType0 = $models.LocalSendConfig.createFrom;
  81. const $$createType1 = model$0.Device.createFrom;
  82. const $$createType2 = $Create.Nullable($$createType1);
  83. const $$createType3 = $Create.Array($$createType2);