Added context menu

This commit is contained in:
2025-07-04 14:37:03 +08:00
parent ebee33ea7c
commit a2a332e735
21 changed files with 2696 additions and 300 deletions

View File

@@ -11,6 +11,7 @@ import * as MigrationService from "./migrationservice.js";
import * as SelfUpdateService from "./selfupdateservice.js";
import * as StartupService from "./startupservice.js";
import * as SystemService from "./systemservice.js";
import * as TranslationService from "./translationservice.js";
import * as TrayService from "./trayservice.js";
export {
ConfigService,
@@ -23,6 +24,7 @@ export {
SelfUpdateService,
StartupService,
SystemService,
TranslationService,
TrayService
};

View File

@@ -0,0 +1,87 @@
// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT
/**
* TranslationService 翻译服务
* @module
*/
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import {Call as $Call, Create as $Create} from "@wailsio/runtime";
/**
* GetAvailableTranslators 获取所有可用翻译器类型
* @returns {[]string} 翻译器类型列表
*/
export function GetAvailableTranslators(): Promise<string[]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1186597995) as any;
let $typingPromise = $resultPromise.then(($result: any) => {
return $$createType0($result);
}) as any;
$typingPromise.cancel = $resultPromise.cancel.bind($resultPromise);
return $typingPromise;
}
/**
* SetActiveTranslator 设置活跃翻译器
* @param {string} translatorType - 翻译器类型 ("google", "bing", "youdao", "deepl")
* @returns {error} 可能的错误
*/
export function SetActiveTranslator(translatorType: string): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(620567821, translatorType) as any;
return $resultPromise;
}
/**
* SetTimeout 设置翻译超时时间
* @param {int} seconds - 超时秒数
*/
export function SetTimeout(seconds: number): Promise<void> & { cancel(): void } {
let $resultPromise = $Call.ByID(3787687384, seconds) as any;
return $resultPromise;
}
/**
* Translate 使用当前活跃翻译器进行翻译
* @param {string} text - 待翻译文本
* @param {string} from - 源语言代码 (如 "en", "zh", "auto")
* @param {string} to - 目标语言代码 (如 "en", "zh")
* @returns {string} 翻译后的文本
* @returns {error} 可能的错误
*/
export function Translate(text: string, $from: string, to: string): Promise<string> & { cancel(): void } {
let $resultPromise = $Call.ByID(2536995103, text, $from, to) as any;
return $resultPromise;
}
/**
* TranslateWith 使用指定翻译器进行翻译
* @param {string} text - 待翻译文本
* @param {string} from - 源语言代码 (如 "en", "zh", "auto")
* @param {string} to - 目标语言代码 (如 "en", "zh")
* @param {string} translatorType - 翻译器类型 ("google", "bing", "youdao", "deepl")
* @returns {string} 翻译后的文本
* @returns {error} 可能的错误
*/
export function TranslateWith(text: string, $from: string, to: string, translatorType: string): Promise<string> & { cancel(): void } {
let $resultPromise = $Call.ByID(3577923623, text, $from, to, translatorType) as any;
return $resultPromise;
}
/**
* TranslateWithFallback 尝试使用当前活跃翻译器翻译,如果失败则尝试备用翻译器
* @param {string} text - 待翻译文本
* @param {string} from - 源语言代码 (如 "en", "zh", "auto")
* @param {string} to - 目标语言代码 (如 "en", "zh")
* @returns {string} 翻译后的文本
* @returns {string} 使用的翻译器类型
* @returns {error} 可能的错误
*/
export function TranslateWithFallback(text: string, $from: string, to: string): Promise<[string, string]> & { cancel(): void } {
let $resultPromise = $Call.ByID(1705788405, text, $from, to) as any;
return $resultPromise;
}
// Private type creation functions
const $$createType0 = $Create.Array($Create.Any);