settingsservice.js 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931
  1. // @ts-check
  2. // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
  3. // This file is automatically generated. DO NOT EDIT
  4. /**
  5. * SettingsService 暴露「设置」页需要的后端能力给前端调用。
  6. * 前端通过 bindings 调用 GetSettings / SaveSettings / GetStocks 等方法。
  7. * @module
  8. */
  9. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  10. // @ts-ignore: Unused imports
  11. import { Call as $Call, CancellablePromise as $CancellablePromise, Create as $Create } from "@wailsio/runtime";
  12. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  13. // @ts-ignore: Unused imports
  14. import * as $models from "./models.js";
  15. /**
  16. * AppVersion 返回应用版本号,供 footer 展示。
  17. * 版本常量在 settings.go 的 AppVersion(与 build/windows/info.json 的 ProductVersion 一致)。
  18. * @returns {$CancellablePromise<string>}
  19. */
  20. export function AppVersion() {
  21. return $Call.ByID(609040257);
  22. }
  23. /**
  24. * BackgroundDownload 后台下载最新更新,不重启;下载完成后由前端提示用户
  25. * 选择「马上重启」(RestartPendingUpdate)或「下次运行时更新」(下次启动自动完成)。
  26. * @returns {$CancellablePromise<void>}
  27. */
  28. export function BackgroundDownload() {
  29. return $Call.ByID(1558380312);
  30. }
  31. /**
  32. * BackupFile 把指定文本文件按当前时间备份到配置的备份目录。
  33. * 备份文件名带时间戳:<原名>_YYYYMMDD_HHMMSS<扩展名>;目录不存在时自动创建。
  34. * 返回备份后的完整路径,供前端提示。
  35. * @param {string} path
  36. * @returns {$CancellablePromise<string>}
  37. */
  38. export function BackupFile(path) {
  39. return $Call.ByID(122452644, path);
  40. }
  41. /**
  42. * BiliQRGenerate 生成 B站登录二维码,供前端展示(用户用 B站 App 扫码)。
  43. * @returns {$CancellablePromise<$models.BiliQRResult | null>}
  44. */
  45. export function BiliQRGenerate() {
  46. return $Call.ByID(3877535006).then(/** @type {($result: any) => any} */(($result) => {
  47. return $$createType1($result);
  48. }));
  49. }
  50. /**
  51. * BiliQRPoll 轮询二维码登录状态;登录成功时自动保存 cookie 与 refresh_token。
  52. * @param {string} qrcodeKey
  53. * @returns {$CancellablePromise<$models.BiliQRPollResult | null>}
  54. */
  55. export function BiliQRPoll(qrcodeKey) {
  56. return $Call.ByID(3999005596, qrcodeKey).then(/** @type {($result: any) => any} */(($result) => {
  57. return $$createType3($result);
  58. }));
  59. }
  60. /**
  61. * CancelShutdown 取消延时关机(工具页「取消」按钮调用)。
  62. * @returns {$CancellablePromise<void>}
  63. */
  64. export function CancelShutdown() {
  65. return $Call.ByID(1266387008);
  66. }
  67. /**
  68. * CaptureScreen 截取屏幕并返回 PNG 数据 URI,供「主机」页预览。
  69. * display 为显示器索引,-1 表示全部屏幕。
  70. * @param {number} display
  71. * @returns {$CancellablePromise<string>}
  72. */
  73. export function CaptureScreen(display) {
  74. return $Call.ByID(2784207426, display);
  75. }
  76. /**
  77. * CheckUpdateDialog 设置页「检查更新」按钮:手动检查一次,发现新版本直接弹原生对话框
  78. * (立即升级 / 暂时跳过 / 此版不再提示)。已最新时返回 upToDate=true 供前端提示;
  79. * 检查失败返回 message 供前端显示错误。
  80. * @returns {$CancellablePromise<{ [_ in string]?: any }>}
  81. */
  82. export function CheckUpdateDialog() {
  83. return $Call.ByID(3461986409).then(/** @type {($result: any) => any} */(($result) => {
  84. return $$createType4($result);
  85. }));
  86. }
  87. /**
  88. * CheckUpdateManual 手动检查新版本(「更新」Tab 的「检查更新」按钮调用)。
  89. * 检查结果经 wails:updater:* 事件推送给前端,这里返回检查后的状态快照。
  90. * @returns {$CancellablePromise<{ [_ in string]?: any }>}
  91. */
  92. export function CheckUpdateManual() {
  93. return $Call.ByID(700690547).then(/** @type {($result: any) => any} */(($result) => {
  94. return $$createType4($result);
  95. }));
  96. }
  97. /**
  98. * ClearAPILogs 清空 Gin 日志缓冲
  99. * @returns {$CancellablePromise<void>}
  100. */
  101. export function ClearAPILogs() {
  102. return $Call.ByID(1756290968);
  103. }
  104. /**
  105. * CloseLEDWindow 关闭 LED 滚动窗口(窗口已关则忽略)。
  106. * @returns {$CancellablePromise<void>}
  107. */
  108. export function CloseLEDWindow() {
  109. return $Call.ByID(3709239437);
  110. }
  111. /**
  112. * DecodeQRCode 从二维码图片的 data URI 解码出内容,供识别功能使用。
  113. * @param {string} dataURI
  114. * @returns {$CancellablePromise<string>}
  115. */
  116. export function DecodeQRCode(dataURI) {
  117. return $Call.ByID(3482304228, dataURI);
  118. }
  119. /**
  120. * DeleteServiceMode 删除(注销)Windows 服务(需 UAC 提权):先停止再注销,
  121. * 服务程序文件保留,可随时重新「启动服务模式」
  122. * @returns {$CancellablePromise<string>}
  123. */
  124. export function DeleteServiceMode() {
  125. return $Call.ByID(4179760289);
  126. }
  127. /**
  128. * ExportConfig 将当前配置导出为备份 JSON 文件(另存为对话框)。
  129. * 备份内容带应用版本与导出时间;返回保存的完整路径;用户取消返回空串。
  130. * @returns {$CancellablePromise<string>}
  131. */
  132. export function ExportConfig() {
  133. return $Call.ByID(2159213604);
  134. }
  135. /**
  136. * GenerateQRCode 把输入字符串生成 PNG 二维码,返回 data URI 供前端展示。
  137. * size 为图片边长(像素),<=0 时用默认值 300。
  138. * @param {string} text
  139. * @param {number} size
  140. * @returns {$CancellablePromise<string>}
  141. */
  142. export function GenerateQRCode(text, size) {
  143. return $Call.ByID(3713602369, text, size);
  144. }
  145. /**
  146. * GetAPILogs 返回 Gin 日志环形缓冲的全部内容
  147. * @returns {$CancellablePromise<string[]>}
  148. */
  149. export function GetAPILogs() {
  150. return $Call.ByID(524575579).then(/** @type {($result: any) => any} */(($result) => {
  151. return $$createType5($result);
  152. }));
  153. }
  154. /**
  155. * GetAPIStatus 返回内置 API 服务运行状态
  156. * @returns {$CancellablePromise<$models.APIStatus>}
  157. */
  158. export function GetAPIStatus() {
  159. return $Call.ByID(3299247002).then(/** @type {($result: any) => any} */(($result) => {
  160. return $$createType6($result);
  161. }));
  162. }
  163. /**
  164. * GetBiliDynamic 抓取 B站「关注的人最新动态」。
  165. * 需要设置里配置 B站登录 cookie(含 SESSDATA);cookie 未配置或过期时回退热门视频,
  166. * 并在 Notice 中说明原因,供前端提示用户更新 cookie。
  167. * @returns {$CancellablePromise<$models.BiliFeedResult>}
  168. */
  169. export function GetBiliDynamic() {
  170. return $Call.ByID(258599011).then(/** @type {($result: any) => any} */(($result) => {
  171. return $$createType7($result);
  172. }));
  173. }
  174. /**
  175. * GetGithubFeeds 抓取设置中所有 GitHub 仓库的最新提交
  176. * @returns {$CancellablePromise<$models.RepoFeed[]>}
  177. */
  178. export function GetGithubFeeds() {
  179. return $Call.ByID(2441556896).then(/** @type {($result: any) => any} */(($result) => {
  180. return $$createType9($result);
  181. }));
  182. }
  183. /**
  184. * GetHotkeyStatus 返回三个热键的注册状态(空字符串=已生效;非空=占用/失败原因),
  185. * 供设置页在热键输入框旁显示冲突提示,例如默认组合键被其他程序占用时。
  186. * @returns {$CancellablePromise<{ [_ in string]?: string }>}
  187. */
  188. export function GetHotkeyStatus() {
  189. return $Call.ByID(2857242844).then(/** @type {($result: any) => any} */(($result) => {
  190. return $$createType10($result);
  191. }));
  192. }
  193. /**
  194. * GetKLine 拉取指定股票的日 K 数据,count 为交易日数量
  195. * @param {string} code
  196. * @param {number} count
  197. * @returns {$CancellablePromise<$models.KLineBar[]>}
  198. */
  199. export function GetKLine(code, count) {
  200. return $Call.ByID(1009336803, code, count).then(/** @type {($result: any) => any} */(($result) => {
  201. return $$createType12($result);
  202. }));
  203. }
  204. /**
  205. * GetLEDColor 返回当前 LED 点阵颜色字符串(默认 #ff4d4d)。
  206. * @returns {$CancellablePromise<string>}
  207. */
  208. export function GetLEDColor() {
  209. return $Call.ByID(3663445744);
  210. }
  211. /**
  212. * GetLEDSpeed 返回当前 LED 滚动速度(px/s),<=0 用默认 60。
  213. * @returns {$CancellablePromise<number>}
  214. */
  215. export function GetLEDSpeed() {
  216. return $Call.ByID(3083387432);
  217. }
  218. /**
  219. * GetLEDText 返回当前要显示的 LED 文字。
  220. * @returns {$CancellablePromise<string>}
  221. */
  222. export function GetLEDText() {
  223. return $Call.ByID(2840292550);
  224. }
  225. /**
  226. * GetMinuteChart 拉取指定股票的分时数据(点击股市行打开分时图时调用)
  227. * @param {string} code
  228. * @returns {$CancellablePromise<$models.MinuteChart>}
  229. */
  230. export function GetMinuteChart(code) {
  231. return $Call.ByID(1171130824, code).then(/** @type {($result: any) => any} */(($result) => {
  232. return $$createType13($result);
  233. }));
  234. }
  235. /**
  236. * GetNews 抓取新闻标题,按设置的关键词标记命中项并优先排序
  237. * @returns {$CancellablePromise<$models.NewsItem[]>}
  238. */
  239. export function GetNews() {
  240. return $Call.ByID(1306230863).then(/** @type {($result: any) => any} */(($result) => {
  241. return $$createType15($result);
  242. }));
  243. }
  244. /**
  245. * GetNtfyChatTopic 返回当前监听的聊天室主题(空表示未监听)
  246. * @returns {$CancellablePromise<string>}
  247. */
  248. export function GetNtfyChatTopic() {
  249. return $Call.ByID(3733537608);
  250. }
  251. /**
  252. * GetNtfyNicknames 返回已记忆的昵称列表(用于前端下拉建议)
  253. * @returns {$CancellablePromise<string[]>}
  254. */
  255. export function GetNtfyNicknames() {
  256. return $Call.ByID(3922015524).then(/** @type {($result: any) => any} */(($result) => {
  257. return $$createType5($result);
  258. }));
  259. }
  260. /**
  261. * GetNtfyTopics 返回已记忆的主题列表(用于前端下拉建议)
  262. * @returns {$CancellablePromise<string[]>}
  263. */
  264. export function GetNtfyTopics() {
  265. return $Call.ByID(1599033699).then(/** @type {($result: any) => any} */(($result) => {
  266. return $$createType5($result);
  267. }));
  268. }
  269. /**
  270. * GetPCStatus 返回电源控制命令状态
  271. * @returns {$CancellablePromise<$models.PCStatus>}
  272. */
  273. export function GetPCStatus() {
  274. return $Call.ByID(4166939475).then(/** @type {($result: any) => any} */(($result) => {
  275. return $$createType16($result);
  276. }));
  277. }
  278. /**
  279. * GetRandomPoem 返回一首随机古诗(供主窗口前端加载 / 手动刷新调用)
  280. * @returns {$CancellablePromise<$models.PoemData>}
  281. */
  282. export function GetRandomPoem() {
  283. return $Call.ByID(3860766604).then(/** @type {($result: any) => any} */(($result) => {
  284. return $$createType17($result);
  285. }));
  286. }
  287. /**
  288. * GetRecordItems 返回所有历史名称(去重排序),供名称输入框自动补全。
  289. * @returns {$CancellablePromise<string[]>}
  290. */
  291. export function GetRecordItems() {
  292. return $Call.ByID(1250968375).then(/** @type {($result: any) => any} */(($result) => {
  293. return $$createType5($result);
  294. }));
  295. }
  296. /**
  297. * GetRecordNames 返回所有历史姓名(去重排序),供姓名输入框自动补全。
  298. * @returns {$CancellablePromise<string[]>}
  299. */
  300. export function GetRecordNames() {
  301. return $Call.ByID(2424781591).then(/** @type {($result: any) => any} */(($result) => {
  302. return $$createType5($result);
  303. }));
  304. }
  305. /**
  306. * GetServiceModeStatus 返回服务模式(--service)是否已启动及来源(Windows 服务 / 界面兜底)
  307. * @returns {$CancellablePromise<$models.ServiceModeStatus>}
  308. */
  309. export function GetServiceModeStatus() {
  310. return $Call.ByID(3531437326).then(/** @type {($result: any) => any} */(($result) => {
  311. return $$createType18($result);
  312. }));
  313. }
  314. /**
  315. * GetSettings 返回当前配置(读取配置文件,不存在则返回默认值)
  316. * @returns {$CancellablePromise<$models.AppSettings>}
  317. */
  318. export function GetSettings() {
  319. return $Call.ByID(3034808949).then(/** @type {($result: any) => any} */(($result) => {
  320. return $$createType19($result);
  321. }));
  322. }
  323. /**
  324. * GetStocks 按已保存的股票代码拉取最新行情
  325. * @returns {$CancellablePromise<$models.StockQuote[]>}
  326. */
  327. export function GetStocks() {
  328. return $Call.ByID(3187718815).then(/** @type {($result: any) => any} */(($result) => {
  329. return $$createType21($result);
  330. }));
  331. }
  332. /**
  333. * GetTrendingRepos 抓取 GitHub Trending 页的热门仓库列表(英文简介已自动翻译为中文)
  334. * @returns {$CancellablePromise<$models.TrendingRepo[]>}
  335. */
  336. export function GetTrendingRepos() {
  337. return $Call.ByID(4191072422).then(/** @type {($result: any) => any} */(($result) => {
  338. return $$createType23($result);
  339. }));
  340. }
  341. /**
  342. * GetUpdateState 返回升级状态:是否有备份可回滚、跳过版本等,供「更新」Tab 展示
  343. * @returns {$CancellablePromise<{ [_ in string]?: any }>}
  344. */
  345. export function GetUpdateState() {
  346. return $Call.ByID(696299146).then(/** @type {($result: any) => any} */(($result) => {
  347. return $$createType4($result);
  348. }));
  349. }
  350. /**
  351. * HandleFlash 触发拖动手柄圆点闪烁:向所有前端窗口广播 handleFlash 事件。
  352. * count 为闪烁次数(<=0 默认 3 次)。前端订阅后播放颜色 + 大小变化动画。
  353. * @param {number} count
  354. * @returns {$CancellablePromise<void>}
  355. */
  356. export function HandleFlash(count) {
  357. return $Call.ByID(863239368, count);
  358. }
  359. /**
  360. * ImportConfig 从备份 JSON 文件恢复配置(打开对话框),成功后立即应用并返回新配置与来源文件路径。
  361. * 仅接受本应用导出的备份(含 settings 字段);用户取消返回 (path="", settings=零值, nil)。
  362. * @returns {$CancellablePromise<[string, $models.AppSettings]>}
  363. */
  364. export function ImportConfig() {
  365. return $Call.ByID(2424491827).then(/** @type {($result: any) => any} */(($result) => {
  366. $result[1] = $$createType19($result[1]);
  367. return $result;
  368. }));
  369. }
  370. /**
  371. * MD5Hash 计算输入字符串的 MD5 摘要(32 位小写十六进制)。
  372. * 空输入返回空串(前端用于校验)。
  373. * @param {string} text
  374. * @returns {$CancellablePromise<string>}
  375. */
  376. export function MD5Hash(text) {
  377. return $Call.ByID(2582579328, text);
  378. }
  379. /**
  380. * MarkGithubRepoChecked 标记某仓库已检视:把本地版本更新为最新 release 版本,消除「发现新版本」提示
  381. * @param {string} url
  382. * @param {string} latest
  383. * @returns {$CancellablePromise<void>}
  384. */
  385. export function MarkGithubRepoChecked(url, latest) {
  386. return $Call.ByID(1378316359, url, latest);
  387. }
  388. /**
  389. * MarkUpdateOK 新版本确认正常后调用,清除待确认标记与失败计数
  390. * @returns {$CancellablePromise<void>}
  391. */
  392. export function MarkUpdateOK() {
  393. return $Call.ByID(98333038);
  394. }
  395. /**
  396. * OpenInBrowser 用配置的浏览器打开网址。
  397. * 若设置页指定了浏览器路径(BrowserPath)且文件存在,则用该浏览器打开;
  398. * 否则回退到系统默认浏览器(通过 Wails OpenURL 能力)。
  399. * @param {string} url
  400. * @returns {$CancellablePromise<void>}
  401. */
  402. export function OpenInBrowser(url) {
  403. return $Call.ByID(1476290681, url);
  404. }
  405. /**
  406. * OpenLEDWindow 打开(或更新)LED 点阵滚动窗口并显示指定文字。
  407. * text 为空时不更新内容(保留上次文字),但窗口未开则忽略。
  408. * color 非空时保存为点阵颜色并持久化到设置。
  409. * speed > 0 时更新滚动速度(px/s)。
  410. * 返回是否成功打开(供前端提示)。
  411. * @param {string} text
  412. * @param {string} color
  413. * @param {number} speed
  414. * @returns {$CancellablePromise<boolean>}
  415. */
  416. export function OpenLEDWindow(text, color, speed) {
  417. return $Call.ByID(3302455249, text, color, speed);
  418. }
  419. /**
  420. * PickBrowserPath 弹出文件选择对话框,让用户指定浏览器可执行文件(如 chrome.exe / msedge.exe / firefox.exe)。
  421. * 返回选中的 exe 路径(取消返回空串)。
  422. * @returns {$CancellablePromise<string>}
  423. */
  424. export function PickBrowserPath() {
  425. return $Call.ByID(165230808);
  426. }
  427. /**
  428. * PickSendFiles 弹出多选文件对话框,用于 LocalSend 发送文件。
  429. * 返回选中的文件路径列表(取消返回空列表)。
  430. * @returns {$CancellablePromise<string[]>}
  431. */
  432. export function PickSendFiles() {
  433. return $Call.ByID(1674315782).then(/** @type {($result: any) => any} */(($result) => {
  434. return $$createType5($result);
  435. }));
  436. }
  437. /**
  438. * PickUploadFile 弹出文件选择对话框,返回用户选中的本地文件路径(取消返回空串)。
  439. * @returns {$CancellablePromise<string>}
  440. */
  441. export function PickUploadFile() {
  442. return $Call.ByID(2719376250);
  443. }
  444. /**
  445. * PickWebDir 弹出目录选择对话框,返回选中的目录(取消返回空串)。
  446. * @returns {$CancellablePromise<string>}
  447. */
  448. export function PickWebDir() {
  449. return $Call.ByID(1493546416);
  450. }
  451. /**
  452. * PoweroffNow 立即关闭计算机(托盘菜单「关机」确认后调用)。
  453. * 与工具页延时关机共用 pccontrol 的 pending 状态,避免与倒计时冲突。
  454. * @returns {$CancellablePromise<void>}
  455. */
  456. export function PoweroffNow() {
  457. return $Call.ByID(275951946);
  458. }
  459. /**
  460. * PrepareUpdate 下载并安装可用升级(需先 Check 出待升级版本),随后程序自动重启。
  461. * version 参数仅作记录用途,实际安装的版本由内置升级框架决定。
  462. * @param {string} version
  463. * @returns {$CancellablePromise<void>}
  464. */
  465. export function PrepareUpdate(version) {
  466. return $Call.ByID(1418007430, version);
  467. }
  468. /**
  469. * ReadRecords 读取全部记录(按 id 升序,保持录入顺序)。
  470. * 前端 loadRecords 渲染列表;柱状图按返回顺序绘制。
  471. * @returns {$CancellablePromise<$models.RecordItem[]>}
  472. */
  473. export function ReadRecords() {
  474. return $Call.ByID(2989114738).then(/** @type {($result: any) => any} */(($result) => {
  475. return $$createType25($result);
  476. }));
  477. }
  478. /**
  479. * ReadTextFile 读取任意文本文件内容(供「自定义 Tab」文件类型页面使用)。
  480. * 文件不存在时返回空内容;其他错误原样返回。
  481. * @param {string} path
  482. * @returns {$CancellablePromise<string>}
  483. */
  484. export function ReadTextFile(path) {
  485. return $Call.ByID(3179291801, path);
  486. }
  487. /**
  488. * ReadTodo 读取待办文件内容(每行一个任务);文件不存在时返回空
  489. * @returns {$CancellablePromise<string>}
  490. */
  491. export function ReadTodo() {
  492. return $Call.ByID(1630526072);
  493. }
  494. /**
  495. * ReminderStatus 查询当前定时提醒状态(运行中 / 间隔 / 下次时刻)。
  496. * @returns {$CancellablePromise<string>}
  497. */
  498. export function ReminderStatus() {
  499. return $Call.ByID(1750819476);
  500. }
  501. /**
  502. * RenderMarkdown 把 Markdown 文本渲染为安全 HTML 片段(供文件类自定义 Tab 展示)。
  503. * 使用 gomarkdown 渲染,并启用 CommonMark 扩展(表格、任务列表、围栏代码等)。
  504. * @param {string} md
  505. * @returns {$CancellablePromise<string>}
  506. */
  507. export function RenderMarkdown(md) {
  508. return $Call.ByID(3516797141, md);
  509. }
  510. /**
  511. * RestartPendingUpdate 用户选择「马上重启」时,安装已下载完成的更新并重启。
  512. * @returns {$CancellablePromise<void>}
  513. */
  514. export function RestartPendingUpdate() {
  515. return $Call.ByID(1761129071);
  516. }
  517. /**
  518. * RollbackUpdate 手动回滚到上一版本备份(有 .bak 即可用),调用后程序退出并重启
  519. * @returns {$CancellablePromise<void>}
  520. */
  521. export function RollbackUpdate() {
  522. return $Call.ByID(772163865);
  523. }
  524. /**
  525. * SHA256Hash 计算输入字符串的 SHA256 摘要(64 位小写十六进制)。
  526. * 空输入返回空串(前端用于校验)。
  527. * @param {string} text
  528. * @returns {$CancellablePromise<string>}
  529. */
  530. export function SHA256Hash(text) {
  531. return $Call.ByID(3463776099, text);
  532. }
  533. /**
  534. * SaveSettings 保存配置并立即生效:热键、窗口置顶、开机启动、页面地址、股票代码等
  535. * @param {$models.AppSettings} settings
  536. * @returns {$CancellablePromise<$models.AppSettings>}
  537. */
  538. export function SaveSettings(settings) {
  539. return $Call.ByID(2662658340, settings).then(/** @type {($result: any) => any} */(($result) => {
  540. return $$createType19($result);
  541. }));
  542. }
  543. /**
  544. * SaveTickerEnabled 保存滚动条开关状态(新闻条 / 股票条右侧「关闭」按钮调用)
  545. * @param {string} kind
  546. * @param {boolean} enabled
  547. * @returns {$CancellablePromise<void>}
  548. */
  549. export function SaveTickerEnabled(kind, enabled) {
  550. return $Call.ByID(3033168348, kind, enabled);
  551. }
  552. /**
  553. * SaveTickerPos 保存滚动条窗口拖动后的位置(只更新配置,不重建窗口)
  554. * @param {string} kind
  555. * @param {number} x
  556. * @param {number} y
  557. * @returns {$CancellablePromise<void>}
  558. */
  559. export function SaveTickerPos(kind, x, y) {
  560. return $Call.ByID(371275047, kind, x, y);
  561. }
  562. /**
  563. * SendNtfyChat 向聊天室(主题)发送一条消息,nickname 作为标题发送。
  564. * 与 SendNtfyMessage 的区别:昵称固定作为标题,便于聊天室按昵称区分发言者。
  565. * @param {string} topic
  566. * @param {string} nickname
  567. * @param {string} message
  568. * @returns {$CancellablePromise<void>}
  569. */
  570. export function SendNtfyChat(topic, nickname, message) {
  571. return $Call.ByID(2994892543, topic, nickname, message);
  572. }
  573. /**
  574. * SendNtfyMessage 向指定主题推送一条 ntfy 消息。
  575. * topic 为推送主题(频道名),title 可为空(使用主题名),message 为消息内容。
  576. * @param {string} topic
  577. * @param {string} title
  578. * @param {string} message
  579. * @returns {$CancellablePromise<void>}
  580. */
  581. export function SendNtfyMessage(topic, title, message) {
  582. return $Call.ByID(1563997112, topic, title, message);
  583. }
  584. /**
  585. * SetLEDTransparent 保留空实现:原生分层窗口透明由 SetLayeredWindowAttributes
  586. * 在建窗时设置,无需前端补设。兼容前端 bindings 调用(不再报错)。
  587. * @returns {$CancellablePromise<void>}
  588. */
  589. export function SetLEDTransparent() {
  590. return $Call.ByID(1774887829);
  591. }
  592. /**
  593. * SetMobileMode 前端在窗口尺寸变化时调用:移动端(窄屏)隐藏主机 Tab 并禁止滚动条
  594. * @param {boolean} mobile
  595. * @returns {$CancellablePromise<void>}
  596. */
  597. export function SetMobileMode(mobile) {
  598. return $Call.ByID(2881494037, mobile);
  599. }
  600. /**
  601. * SetNtfyChatTopic 设置聊天室要监听的主题。
  602. * 传入空字符串则停止监听(无主题不监听)。
  603. * 若与当前监听主题相同则不做任何事;不同则先停止旧监听再启动新监听。
  604. * @param {string} topic
  605. * @returns {$CancellablePromise<void>}
  606. */
  607. export function SetNtfyChatTopic(topic) {
  608. return $Call.ByID(1718497116, topic);
  609. }
  610. /**
  611. * ShowWindow 供前端主动呼出窗口(例如通知点击后回到主界面)
  612. * @returns {$CancellablePromise<void>}
  613. */
  614. export function ShowWindow() {
  615. return $Call.ByID(3712560909);
  616. }
  617. /**
  618. * ShutdownDelay 在指定分钟后执行关机。
  619. * minutes 必须 > 0;返回计划执行时间(HH:MM:SS)与提示信息。
  620. * @param {number} minutes
  621. * @returns {$CancellablePromise<string>}
  622. */
  623. export function ShutdownDelay(minutes) {
  624. return $Call.ByID(3801676825, minutes);
  625. }
  626. /**
  627. * SkipVersion 跳过当前版本(启动检查时不再提示)
  628. * @param {string} version
  629. * @returns {$CancellablePromise<void>}
  630. */
  631. export function SkipVersion(version) {
  632. return $Call.ByID(2105208461, version);
  633. }
  634. /**
  635. * SleepNow 立即休眠(一键功能按钮调用)。
  636. * 复用 pccontrol 的立即执行路径(rundll32 SetSuspendState),异步执行避免阻塞绑定调用。
  637. * @returns {$CancellablePromise<string>}
  638. */
  639. export function SleepNow() {
  640. return $Call.ByID(2693266377);
  641. }
  642. /**
  643. * StartAPIService 启动 / 重启内置 API 服务(服务页手动启动)
  644. * @returns {$CancellablePromise<void>}
  645. */
  646. export function StartAPIService() {
  647. return $Call.ByID(3942830483);
  648. }
  649. /**
  650. * StartReminder 启动(或更新)定时提醒:每 every 分钟提醒一次,直到取消。
  651. * message 为提醒信息,minutes 为间隔分钟数(必须 >=1)。
  652. * 返回启动状态描述(含下次提醒时刻),供前端提示。
  653. * @param {string} message
  654. * @param {number} minutes
  655. * @returns {$CancellablePromise<string>}
  656. */
  657. export function StartReminder(message, minutes) {
  658. return $Call.ByID(2273071398, message, minutes);
  659. }
  660. /**
  661. * StartServiceMode 一键创建并启动 Windows 服务(需 UAC 提权),返回结果提示
  662. * @returns {$CancellablePromise<string>}
  663. */
  664. export function StartServiceMode() {
  665. return $Call.ByID(657335660);
  666. }
  667. /**
  668. * StartWebService 启动静态文件服务(默认页 index.html 或 readme.md),监听指定端口。
  669. * @param {string} dir
  670. * @param {number} port
  671. * @returns {$CancellablePromise<$models.WebServiceInfo>}
  672. */
  673. export function StartWebService(dir, port) {
  674. return $Call.ByID(3007036157, dir, port).then(/** @type {($result: any) => any} */(($result) => {
  675. return $$createType26($result);
  676. }));
  677. }
  678. /**
  679. * StopAPIService 停止内置 API 服务(服务页手动停止)
  680. * @returns {$CancellablePromise<void>}
  681. */
  682. export function StopAPIService() {
  683. return $Call.ByID(1470228927);
  684. }
  685. /**
  686. * StopReminder 取消定时提醒。返回是否在运行过。
  687. * @returns {$CancellablePromise<string>}
  688. */
  689. export function StopReminder() {
  690. return $Call.ByID(1962022930);
  691. }
  692. /**
  693. * StopServiceMode 停止 Windows 服务(需 UAC 提权),停止后界面进程恢复兜底
  694. * @returns {$CancellablePromise<string>}
  695. */
  696. export function StopServiceMode() {
  697. return $Call.ByID(1190743168);
  698. }
  699. /**
  700. * StopWebService 停止静态文件服务。
  701. * @returns {$CancellablePromise<void>}
  702. */
  703. export function StopWebService() {
  704. return $Call.ByID(1864477289);
  705. }
  706. /**
  707. * TTS 用微软 Edge 神经网络语音合成文本,返回 data URI(audio/mp3)。
  708. * 前端直接赋给 <audio src> 播放。voice 可选:xiaoxiao/yunxi/yunjian/xiaoyi/yunyang。
  709. * 古诗词朗读用云希(yunxi,沉稳男声)效果最佳。
  710. * @param {string} text
  711. * @param {string} voice
  712. * @returns {$CancellablePromise<string>}
  713. */
  714. export function TTS(text, voice) {
  715. return $Call.ByID(734529301, text, voice);
  716. }
  717. /**
  718. * ToggleDesktopIconOnly 只隐藏/显示桌面图标(壁纸保留;一键功能「隐藏图标」按钮调用)。
  719. * hide=true 只隐藏图标(壁纸不动),hide=false 恢复显示;返回操作结果描述。
  720. * @param {boolean} hide
  721. * @returns {$CancellablePromise<string>}
  722. */
  723. export function ToggleDesktopIconOnly(hide) {
  724. return $Call.ByID(3667534363, hide);
  725. }
  726. /**
  727. * ToggleDesktopIcons 隐藏/显示桌面图标(一键功能按钮调用)。
  728. * hide=true 隐藏,hide=false 显示;返回操作结果描述。
  729. * @param {boolean} hide
  730. * @returns {$CancellablePromise<string>}
  731. */
  732. export function ToggleDesktopIcons(hide) {
  733. return $Call.ByID(2143882774, hide);
  734. }
  735. /**
  736. * ToggleWindowCompact 双击拖动手柄:在「全尺寸」与「仅手柄大小」之间切换。
  737. * 返回切换后是否处于紧凑(仅手柄)状态;前端据此切换 UI(隐藏内容、显示居中还原圆点)。
  738. * @returns {$CancellablePromise<boolean>}
  739. */
  740. export function ToggleWindowCompact() {
  741. return $Call.ByID(1749284713);
  742. }
  743. /**
  744. * Translate 翻译文本:输入中文翻译为英文,输入英文翻译为中文(自动检测方向)。
  745. * 使用 MyMemory 免费 API,有每日配额限制。
  746. * @param {string} text
  747. * @returns {$CancellablePromise<$models.TranslateResult>}
  748. */
  749. export function Translate(text) {
  750. return $Call.ByID(3284480866, text).then(/** @type {($result: any) => any} */(($result) => {
  751. return $$createType27($result);
  752. }));
  753. }
  754. /**
  755. * UnskipUpdate 清除「已跳过的版本」记录,恢复新版本提示
  756. * @returns {$CancellablePromise<void>}
  757. */
  758. export function UnskipUpdate() {
  759. return $Call.ByID(1726277061);
  760. }
  761. /**
  762. * UploadFile 供桌面端「服务」页直接上传本地文件(不走 HTTP、无需密码)。
  763. * 把本地文件压缩为 zip 存入上传目录(zip 内保留原文件名),返回下载信息。
  764. * 仅本机桌面调用,不暴露给外部网络。
  765. * @param {string} diskPath
  766. * @returns {$CancellablePromise<{ [_ in string]?: any }>}
  767. */
  768. export function UploadFile(diskPath) {
  769. return $Call.ByID(417387035, diskPath).then(/** @type {($result: any) => any} */(($result) => {
  770. return $$createType4($result);
  771. }));
  772. }
  773. /**
  774. * WebServiceStatus 返回静态文件服务当前状态。
  775. * @returns {$CancellablePromise<$models.WebServiceInfo>}
  776. */
  777. export function WebServiceStatus() {
  778. return $Call.ByID(1311352355).then(/** @type {($result: any) => any} */(($result) => {
  779. return $$createType26($result);
  780. }));
  781. }
  782. /**
  783. * WriteRecords 全量替换记录:开启事务,先清空再批量插入。
  784. * 前端 saveRecords 提交当前列表全部行,保证与数据库完全一致。
  785. * @param {$models.RecordItem[]} items
  786. * @returns {$CancellablePromise<void>}
  787. */
  788. export function WriteRecords(items) {
  789. return $Call.ByID(1978718139, items);
  790. }
  791. /**
  792. * WriteTextFile 把文本内容写回指定文件(目录不存在时自动创建)。
  793. * 供文件类自定义 Tab 的「保存」使用。
  794. * @param {string} path
  795. * @param {string} content
  796. * @returns {$CancellablePromise<void>}
  797. */
  798. export function WriteTextFile(path, content) {
  799. return $Call.ByID(1781087370, path, content);
  800. }
  801. /**
  802. * WriteTodo 把待办内容写回待办文件(目录不存在时自动创建)
  803. * @param {string} content
  804. * @returns {$CancellablePromise<void>}
  805. */
  806. export function WriteTodo(content) {
  807. return $Call.ByID(3129393963, content);
  808. }
  809. // Private type creation functions
  810. const $$createType0 = $models.BiliQRResult.createFrom;
  811. const $$createType1 = $Create.Nullable($$createType0);
  812. const $$createType2 = $models.BiliQRPollResult.createFrom;
  813. const $$createType3 = $Create.Nullable($$createType2);
  814. const $$createType4 = $Create.Map($Create.Any, $Create.Any);
  815. const $$createType5 = $Create.Array($Create.Any);
  816. const $$createType6 = $models.APIStatus.createFrom;
  817. const $$createType7 = $models.BiliFeedResult.createFrom;
  818. const $$createType8 = $models.RepoFeed.createFrom;
  819. const $$createType9 = $Create.Array($$createType8);
  820. const $$createType10 = $Create.Map($Create.Any, $Create.Any);
  821. const $$createType11 = $models.KLineBar.createFrom;
  822. const $$createType12 = $Create.Array($$createType11);
  823. const $$createType13 = $models.MinuteChart.createFrom;
  824. const $$createType14 = $models.NewsItem.createFrom;
  825. const $$createType15 = $Create.Array($$createType14);
  826. const $$createType16 = $models.PCStatus.createFrom;
  827. const $$createType17 = $models.PoemData.createFrom;
  828. const $$createType18 = $models.ServiceModeStatus.createFrom;
  829. const $$createType19 = $models.AppSettings.createFrom;
  830. const $$createType20 = $models.StockQuote.createFrom;
  831. const $$createType21 = $Create.Array($$createType20);
  832. const $$createType22 = $models.TrendingRepo.createFrom;
  833. const $$createType23 = $Create.Array($$createType22);
  834. const $$createType24 = $models.RecordItem.createFrom;
  835. const $$createType25 = $Create.Array($$createType24);
  836. const $$createType26 = $models.WebServiceInfo.createFrom;
  837. const $$createType27 = $models.TranslateResult.createFrom;