| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- // @ts-check
- // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
- // This file is automatically generated. DO NOT EDIT
- /**
- * UDPService 是 UDP 键值服务的 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";
- /**
- * SendUDP 手动发送文本到指定远端(addr 形如 ip:port)。
- * @param {string} addr
- * @param {string} text
- * @returns {$CancellablePromise<$models.UDPInfo>}
- */
- export function SendUDP(addr, text) {
- return $Call.ByID(1977683411, addr, text).then(/** @type {($result: any) => any} */(($result) => {
- return $$createType0($result);
- }));
- }
- /**
- * StartUDPServer 启动 UDP 键值服务器,监听 0.0.0.0:port。
- * 若已运行则先停止旧实例,并清空键值存储。端口占用时返回错误。
- * @param {number} port
- * @returns {$CancellablePromise<$models.UDPInfo>}
- */
- export function StartUDPServer(port) {
- return $Call.ByID(1291615814, port).then(/** @type {($result: any) => any} */(($result) => {
- return $$createType0($result);
- }));
- }
- /**
- * StopUDPServer 停止当前 UDP 键值服务(未运行则无副作用),并清空键值存储。
- * @returns {$CancellablePromise<$models.UDPInfo>}
- */
- export function StopUDPServer() {
- return $Call.ByID(2179332070).then(/** @type {($result: any) => any} */(($result) => {
- return $$createType0($result);
- }));
- }
- /**
- * UDPServerJSON 为前端提供一次调用获取完整状态的辅助(避免多次 IPC)。
- * @returns {$CancellablePromise<string>}
- */
- export function UDPServerJSON() {
- return $Call.ByID(839381736);
- }
- /**
- * UDPServerStatus 返回当前 UDP 键值服务状态。
- * @returns {$CancellablePromise<$models.UDPInfo>}
- */
- export function UDPServerStatus() {
- return $Call.ByID(830505824).then(/** @type {($result: any) => any} */(($result) => {
- return $$createType0($result);
- }));
- }
- // Private type creation functions
- const $$createType0 = $models.UDPInfo.createFrom;
|