1
0

settingsservice.js 25 KB

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