settingsservice.js 22 KB

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