models.js 55 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942
  1. // @ts-check
  2. // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
  3. // This file is automatically generated. DO NOT EDIT
  4. // eslint-disable-next-line @typescript-eslint/ban-ts-comment
  5. // @ts-ignore: Unused imports
  6. import { Create as $Create } from "@wailsio/runtime";
  7. /**
  8. * APIStatus API 服务运行状态,供「主机」页展示
  9. */
  10. export class APIStatus {
  11. /**
  12. * Creates a new APIStatus instance.
  13. * @param {Partial<APIStatus>} [$$source = {}] - The source object to create the APIStatus.
  14. */
  15. constructor($$source = {}) {
  16. if (!("addr" in $$source)) {
  17. /**
  18. * 当前监听地址
  19. * @member
  20. * @type {string}
  21. */
  22. this["addr"] = "";
  23. }
  24. if (!("running" in $$source)) {
  25. /**
  26. * 是否正在监听
  27. * @member
  28. * @type {boolean}
  29. */
  30. this["running"] = false;
  31. }
  32. if (!("startedAt" in $$source)) {
  33. /**
  34. * 启动时间
  35. * @member
  36. * @type {string}
  37. */
  38. this["startedAt"] = "";
  39. }
  40. if (!("error" in $$source)) {
  41. /**
  42. * 最近错误信息
  43. * @member
  44. * @type {string}
  45. */
  46. this["error"] = "";
  47. }
  48. Object.assign(this, $$source);
  49. }
  50. /**
  51. * Creates a new APIStatus instance from a string or object.
  52. * @param {any} [$$source = {}]
  53. * @returns {APIStatus}
  54. */
  55. static createFrom($$source = {}) {
  56. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  57. return new APIStatus(/** @type {Partial<APIStatus>} */($$parsedSource));
  58. }
  59. }
  60. /**
  61. * AppSettings 保存全部可自定义配置,序列化为 JSON 存于用户配置目录
  62. */
  63. export class AppSettings {
  64. /**
  65. * Creates a new AppSettings instance.
  66. * @param {Partial<AppSettings>} [$$source = {}] - The source object to create the AppSettings.
  67. */
  68. constructor($$source = {}) {
  69. if (!("theme" in $$source)) {
  70. /**
  71. * 界面主题:dark / light
  72. * @member
  73. * @type {string}
  74. */
  75. this["theme"] = "";
  76. }
  77. if (!("autostart" in $$source)) {
  78. /**
  79. * 系统启动时运行
  80. * @member
  81. * @type {boolean}
  82. */
  83. this["autostart"] = false;
  84. }
  85. if (!("alwaysOnTop" in $$source)) {
  86. /**
  87. * 窗口置顶
  88. * @member
  89. * @type {boolean}
  90. */
  91. this["alwaysOnTop"] = false;
  92. }
  93. if (!("hotkey" in $$source)) {
  94. /**
  95. * 呼出(显示)窗口的全局热键
  96. * @member
  97. * @type {string}
  98. */
  99. this["hotkey"] = "";
  100. }
  101. if (!("tabOrder" in $$source)) {
  102. /**
  103. * Tab 显示顺序(tabId 列表,未列出的追加到末尾)
  104. * @member
  105. * @type {string[]}
  106. */
  107. this["tabOrder"] = [];
  108. }
  109. if (!("stockCodes" in $$source)) {
  110. /**
  111. * 股市页展示的股票代码列表
  112. * @member
  113. * @type {string[]}
  114. */
  115. this["stockCodes"] = [];
  116. }
  117. if (!("links" in $$source)) {
  118. /**
  119. * 常用网址列表
  120. * @member
  121. * @type {LinkItem[]}
  122. */
  123. this["links"] = [];
  124. }
  125. if (!("newsKeywords" in $$source)) {
  126. /**
  127. * 新闻关注关键词,逗号分隔
  128. * @member
  129. * @type {string}
  130. */
  131. this["newsKeywords"] = "";
  132. }
  133. if (!("biliCookie" in $$source)) {
  134. /**
  135. * B站登录 cookie(含 SESSDATA),用于抓取「关注的人最新动态」
  136. * @member
  137. * @type {string}
  138. */
  139. this["biliCookie"] = "";
  140. }
  141. if (!("githubRepos" in $$source)) {
  142. /**
  143. * 关注的 GitHub 仓库列表
  144. * @member
  145. * @type {RepoItem[]}
  146. */
  147. this["githubRepos"] = [];
  148. }
  149. if (!("customTabs" in $$source)) {
  150. /**
  151. * 用户自定义 Tab 页面(名字 + 网址)
  152. * @member
  153. * @type {CustomTab[]}
  154. */
  155. this["customTabs"] = [];
  156. }
  157. if (!("apiAddr" in $$source)) {
  158. /**
  159. * 内置 API 服务监听地址
  160. * @member
  161. * @type {string}
  162. */
  163. this["apiAddr"] = "";
  164. }
  165. if (!("apiAutoStart" in $$source)) {
  166. /**
  167. * 应用启动时自动启动内置 API 服务(默认开启)
  168. * @member
  169. * @type {boolean}
  170. */
  171. this["apiAutoStart"] = false;
  172. }
  173. if (!("uploadPassword" in $$source)) {
  174. /**
  175. * 文件上传密码(空=不启用上传/下载接口)
  176. * @member
  177. * @type {string}
  178. */
  179. this["uploadPassword"] = "";
  180. }
  181. if (!("uploadDir" in $$source)) {
  182. /**
  183. * 文件上传保存目录(空=用户配置目录/uploads)
  184. * @member
  185. * @type {string}
  186. */
  187. this["uploadDir"] = "";
  188. }
  189. if (!("uploadMaxSize" in $$source)) {
  190. /**
  191. * 单个上传文件大小上限(MB),<=0 用默认 512
  192. * @member
  193. * @type {number}
  194. */
  195. this["uploadMaxSize"] = 0;
  196. }
  197. if (!("todoPath" in $$source)) {
  198. /**
  199. * 待办(TODO)文件路径
  200. * @member
  201. * @type {string}
  202. */
  203. this["todoPath"] = "";
  204. }
  205. if (!("recordPath" in $$source)) {
  206. /**
  207. * 记录(Record)文件路径:每行「姓名|名称|值」(保留兼容)
  208. * @member
  209. * @type {string}
  210. */
  211. this["recordPath"] = "";
  212. }
  213. if (!("recordDBPath" in $$source)) {
  214. /**
  215. * 记录数据库路径:SQLite3 数据库文件(记录 Tab 实际存储)
  216. * @member
  217. * @type {string}
  218. */
  219. this["recordDBPath"] = "";
  220. }
  221. if (!("backupDir" in $$source)) {
  222. /**
  223. * 文本文件备份目录(文件类自定义 Tab「备份」按钮使用)
  224. * @member
  225. * @type {string}
  226. */
  227. this["backupDir"] = "";
  228. }
  229. if (!("stockTicker" in $$source)) {
  230. /**
  231. * 股票滚动条配置
  232. * @member
  233. * @type {TickerConfig}
  234. */
  235. this["stockTicker"] = (new TickerConfig());
  236. }
  237. if (!("newsTicker" in $$source)) {
  238. /**
  239. * 新闻滚动条配置
  240. * @member
  241. * @type {TickerConfig}
  242. */
  243. this["newsTicker"] = (new TickerConfig());
  244. }
  245. if (!("poem" in $$source)) {
  246. /**
  247. * 随机古诗显示配置
  248. * @member
  249. * @type {PoemConfig}
  250. */
  251. this["poem"] = (new PoemConfig());
  252. }
  253. if (!("mouseAlert" in $$source)) {
  254. /**
  255. * 系统级鼠标提醒气泡配置
  256. * @member
  257. * @type {MouseAlertConfig}
  258. */
  259. this["mouseAlert"] = (new MouseAlertConfig());
  260. }
  261. if (!("browserPath" in $$source)) {
  262. /**
  263. * 指定浏览器 exe 路径(空=系统默认浏览器)
  264. * @member
  265. * @type {string}
  266. */
  267. this["browserPath"] = "";
  268. }
  269. if (!("ledColor" in $$source)) {
  270. /**
  271. * LED 滚动文字点阵颜色(如 #ff4d4d)
  272. * @member
  273. * @type {string}
  274. */
  275. this["ledColor"] = "";
  276. }
  277. if (!("stockUpColor" in $$source)) {
  278. /**
  279. * 股票上涨颜色
  280. * @member
  281. * @type {string}
  282. */
  283. this["stockUpColor"] = "";
  284. }
  285. if (!("stockDownColor" in $$source)) {
  286. /**
  287. * 股票下跌颜色
  288. * @member
  289. * @type {string}
  290. */
  291. this["stockDownColor"] = "";
  292. }
  293. if (!("stockRefreshSecs" in $$source)) {
  294. /**
  295. * 股市自动刷新间隔(秒)
  296. * @member
  297. * @type {number}
  298. */
  299. this["stockRefreshSecs"] = 0;
  300. }
  301. if (!("stockClosedRefreshSecs" in $$source)) {
  302. /**
  303. * 股市休市时自动刷新间隔(秒)
  304. * @member
  305. * @type {number}
  306. */
  307. this["stockClosedRefreshSecs"] = 0;
  308. }
  309. if (!("newsRefreshMinutes" in $$source)) {
  310. /**
  311. * 新闻自动刷新间隔(分钟)
  312. * @member
  313. * @type {number}
  314. */
  315. this["newsRefreshMinutes"] = 0;
  316. }
  317. if (!("newsCount" in $$source)) {
  318. /**
  319. * 新闻页显示条数
  320. * @member
  321. * @type {number}
  322. */
  323. this["newsCount"] = 0;
  324. }
  325. if (!("githubRefreshMinutes" in $$source)) {
  326. /**
  327. * Github 自动刷新间隔(分钟)
  328. * @member
  329. * @type {number}
  330. */
  331. this["githubRefreshMinutes"] = 0;
  332. }
  333. if (!("fontDelta" in $$source)) {
  334. /**
  335. * 全局字号偏移(px),+-3 范围内调整
  336. * @member
  337. * @type {number}
  338. */
  339. this["fontDelta"] = 0;
  340. }
  341. if (!("localSend" in $$source)) {
  342. /**
  343. * LocalSend 文件互传配置(本机名/接收目录/接收模式等)
  344. * @member
  345. * @type {LocalSendConfig}
  346. */
  347. this["localSend"] = (new LocalSendConfig());
  348. }
  349. if (!("toolOrder" in $$source)) {
  350. /**
  351. * 工具页卡片显示顺序(工具 id 列表,未列出的追加到末尾)
  352. * @member
  353. * @type {string[]}
  354. */
  355. this["toolOrder"] = [];
  356. }
  357. Object.assign(this, $$source);
  358. }
  359. /**
  360. * Creates a new AppSettings instance from a string or object.
  361. * @param {any} [$$source = {}]
  362. * @returns {AppSettings}
  363. */
  364. static createFrom($$source = {}) {
  365. const $$createField4_0 = $$createType0;
  366. const $$createField5_0 = $$createType0;
  367. const $$createField6_0 = $$createType2;
  368. const $$createField9_0 = $$createType4;
  369. const $$createField10_0 = $$createType6;
  370. const $$createField20_0 = $$createType7;
  371. const $$createField21_0 = $$createType7;
  372. const $$createField22_0 = $$createType8;
  373. const $$createField23_0 = $$createType9;
  374. const $$createField34_0 = $$createType10;
  375. const $$createField35_0 = $$createType0;
  376. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  377. if ("tabOrder" in $$parsedSource) {
  378. $$parsedSource["tabOrder"] = $$createField4_0($$parsedSource["tabOrder"]);
  379. }
  380. if ("stockCodes" in $$parsedSource) {
  381. $$parsedSource["stockCodes"] = $$createField5_0($$parsedSource["stockCodes"]);
  382. }
  383. if ("links" in $$parsedSource) {
  384. $$parsedSource["links"] = $$createField6_0($$parsedSource["links"]);
  385. }
  386. if ("githubRepos" in $$parsedSource) {
  387. $$parsedSource["githubRepos"] = $$createField9_0($$parsedSource["githubRepos"]);
  388. }
  389. if ("customTabs" in $$parsedSource) {
  390. $$parsedSource["customTabs"] = $$createField10_0($$parsedSource["customTabs"]);
  391. }
  392. if ("stockTicker" in $$parsedSource) {
  393. $$parsedSource["stockTicker"] = $$createField20_0($$parsedSource["stockTicker"]);
  394. }
  395. if ("newsTicker" in $$parsedSource) {
  396. $$parsedSource["newsTicker"] = $$createField21_0($$parsedSource["newsTicker"]);
  397. }
  398. if ("poem" in $$parsedSource) {
  399. $$parsedSource["poem"] = $$createField22_0($$parsedSource["poem"]);
  400. }
  401. if ("mouseAlert" in $$parsedSource) {
  402. $$parsedSource["mouseAlert"] = $$createField23_0($$parsedSource["mouseAlert"]);
  403. }
  404. if ("localSend" in $$parsedSource) {
  405. $$parsedSource["localSend"] = $$createField34_0($$parsedSource["localSend"]);
  406. }
  407. if ("toolOrder" in $$parsedSource) {
  408. $$parsedSource["toolOrder"] = $$createField35_0($$parsedSource["toolOrder"]);
  409. }
  410. return new AppSettings(/** @type {Partial<AppSettings>} */($$parsedSource));
  411. }
  412. }
  413. /**
  414. * BiliDynamicItem 一条 B站动态,供「新闻」页展示
  415. */
  416. export class BiliDynamicItem {
  417. /**
  418. * Creates a new BiliDynamicItem instance.
  419. * @param {Partial<BiliDynamicItem>} [$$source = {}] - The source object to create the BiliDynamicItem.
  420. */
  421. constructor($$source = {}) {
  422. if (!("source" in $$source)) {
  423. /**
  424. * 来源:B站动态
  425. * @member
  426. * @type {string}
  427. */
  428. this["source"] = "";
  429. }
  430. if (!("title" in $$source)) {
  431. /**
  432. * 标题(动态文案或视频标题)
  433. * @member
  434. * @type {string}
  435. */
  436. this["title"] = "";
  437. }
  438. if (!("url" in $$source)) {
  439. /**
  440. * 详情页地址
  441. * @member
  442. * @type {string}
  443. */
  444. this["url"] = "";
  445. }
  446. if (!("matched" in $$source)) {
  447. /**
  448. * 是否命中关注关键词
  449. * @member
  450. * @type {boolean}
  451. */
  452. this["matched"] = false;
  453. }
  454. Object.assign(this, $$source);
  455. }
  456. /**
  457. * Creates a new BiliDynamicItem instance from a string or object.
  458. * @param {any} [$$source = {}]
  459. * @returns {BiliDynamicItem}
  460. */
  461. static createFrom($$source = {}) {
  462. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  463. return new BiliDynamicItem(/** @type {Partial<BiliDynamicItem>} */($$parsedSource));
  464. }
  465. }
  466. /**
  467. * CommitItem 仓库的一条提交记录
  468. */
  469. export class CommitItem {
  470. /**
  471. * Creates a new CommitItem instance.
  472. * @param {Partial<CommitItem>} [$$source = {}] - The source object to create the CommitItem.
  473. */
  474. constructor($$source = {}) {
  475. if (!("title" in $$source)) {
  476. /**
  477. * 提交标题(首行)
  478. * @member
  479. * @type {string}
  480. */
  481. this["title"] = "";
  482. }
  483. if (!("url" in $$source)) {
  484. /**
  485. * 提交详情页地址
  486. * @member
  487. * @type {string}
  488. */
  489. this["url"] = "";
  490. }
  491. if (!("updated" in $$source)) {
  492. /**
  493. * 提交时间(MM-DD HH:MM)
  494. * @member
  495. * @type {string}
  496. */
  497. this["updated"] = "";
  498. }
  499. Object.assign(this, $$source);
  500. }
  501. /**
  502. * Creates a new CommitItem instance from a string or object.
  503. * @param {any} [$$source = {}]
  504. * @returns {CommitItem}
  505. */
  506. static createFrom($$source = {}) {
  507. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  508. return new CommitItem(/** @type {Partial<CommitItem>} */($$parsedSource));
  509. }
  510. }
  511. /**
  512. * CustomTab 用户自定义 Tab 页面
  513. */
  514. export class CustomTab {
  515. /**
  516. * Creates a new CustomTab instance.
  517. * @param {Partial<CustomTab>} [$$source = {}] - The source object to create the CustomTab.
  518. */
  519. constructor($$source = {}) {
  520. if (!("name" in $$source)) {
  521. /**
  522. * 页面名称(Tab 按钮显示文字)
  523. * @member
  524. * @type {string}
  525. */
  526. this["name"] = "";
  527. }
  528. if (!("url" in $$source)) {
  529. /**
  530. * 页面地址(iframe 加载)
  531. * @member
  532. * @type {string}
  533. */
  534. this["url"] = "";
  535. }
  536. if (!("desc" in $$source)) {
  537. /**
  538. * 备注/提示信息(可空),Tab 说明文字优先显示
  539. * @member
  540. * @type {string}
  541. */
  542. this["desc"] = "";
  543. }
  544. Object.assign(this, $$source);
  545. }
  546. /**
  547. * Creates a new CustomTab instance from a string or object.
  548. * @param {any} [$$source = {}]
  549. * @returns {CustomTab}
  550. */
  551. static createFrom($$source = {}) {
  552. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  553. return new CustomTab(/** @type {Partial<CustomTab>} */($$parsedSource));
  554. }
  555. }
  556. /**
  557. * KLineBar 日 K 的一根柱子
  558. */
  559. export class KLineBar {
  560. /**
  561. * Creates a new KLineBar instance.
  562. * @param {Partial<KLineBar>} [$$source = {}] - The source object to create the KLineBar.
  563. */
  564. constructor($$source = {}) {
  565. if (!("date" in $$source)) {
  566. /**
  567. * 交易日
  568. * @member
  569. * @type {string}
  570. */
  571. this["date"] = "";
  572. }
  573. if (!("open" in $$source)) {
  574. /**
  575. * 开盘价
  576. * @member
  577. * @type {number}
  578. */
  579. this["open"] = 0;
  580. }
  581. if (!("close" in $$source)) {
  582. /**
  583. * 收盘价
  584. * @member
  585. * @type {number}
  586. */
  587. this["close"] = 0;
  588. }
  589. if (!("high" in $$source)) {
  590. /**
  591. * 最高价
  592. * @member
  593. * @type {number}
  594. */
  595. this["high"] = 0;
  596. }
  597. if (!("low" in $$source)) {
  598. /**
  599. * 最低价
  600. * @member
  601. * @type {number}
  602. */
  603. this["low"] = 0;
  604. }
  605. if (!("volume" in $$source)) {
  606. /**
  607. * 成交量(手)
  608. * @member
  609. * @type {number}
  610. */
  611. this["volume"] = 0;
  612. }
  613. Object.assign(this, $$source);
  614. }
  615. /**
  616. * Creates a new KLineBar instance from a string or object.
  617. * @param {any} [$$source = {}]
  618. * @returns {KLineBar}
  619. */
  620. static createFrom($$source = {}) {
  621. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  622. return new KLineBar(/** @type {Partial<KLineBar>} */($$parsedSource));
  623. }
  624. }
  625. /**
  626. * LinkItem 常用网址条目
  627. */
  628. export class LinkItem {
  629. /**
  630. * Creates a new LinkItem instance.
  631. * @param {Partial<LinkItem>} [$$source = {}] - The source object to create the LinkItem.
  632. */
  633. constructor($$source = {}) {
  634. if (!("name" in $$source)) {
  635. /**
  636. * 网站名称
  637. * @member
  638. * @type {string}
  639. */
  640. this["name"] = "";
  641. }
  642. if (!("url" in $$source)) {
  643. /**
  644. * 网站地址
  645. * @member
  646. * @type {string}
  647. */
  648. this["url"] = "";
  649. }
  650. Object.assign(this, $$source);
  651. }
  652. /**
  653. * Creates a new LinkItem instance from a string or object.
  654. * @param {any} [$$source = {}]
  655. * @returns {LinkItem}
  656. */
  657. static createFrom($$source = {}) {
  658. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  659. return new LinkItem(/** @type {Partial<LinkItem>} */($$parsedSource));
  660. }
  661. }
  662. /**
  663. * LocalSendConfig 是 LocalSend 的运行时配置。
  664. */
  665. export class LocalSendConfig {
  666. /**
  667. * Creates a new LocalSendConfig instance.
  668. * @param {Partial<LocalSendConfig>} [$$source = {}] - The source object to create the LocalSendConfig.
  669. */
  670. constructor($$source = {}) {
  671. if (!("enabled" in $$source)) {
  672. /**
  673. * 是否已启动服务
  674. * @member
  675. * @type {boolean}
  676. */
  677. this["enabled"] = false;
  678. }
  679. if (!("alias" in $$source)) {
  680. /**
  681. * 本机名称(广播给其他设备)
  682. * @member
  683. * @type {string}
  684. */
  685. this["alias"] = "";
  686. }
  687. if (!("receiveDir" in $$source)) {
  688. /**
  689. * 接收文件保存目录
  690. * @member
  691. * @type {string}
  692. */
  693. this["receiveDir"] = "";
  694. }
  695. if (!("autoAccept" in $$source)) {
  696. /**
  697. * true=自动接收;false=手动确认
  698. * @member
  699. * @type {boolean}
  700. */
  701. this["autoAccept"] = false;
  702. }
  703. if (!("port" in $$source)) {
  704. /**
  705. * 监听端口
  706. * @member
  707. * @type {number}
  708. */
  709. this["port"] = 0;
  710. }
  711. if (!("fingerprint" in $$source)) {
  712. /**
  713. * 本机证书指纹
  714. * @member
  715. * @type {string}
  716. */
  717. this["fingerprint"] = "";
  718. }
  719. Object.assign(this, $$source);
  720. }
  721. /**
  722. * Creates a new LocalSendConfig instance from a string or object.
  723. * @param {any} [$$source = {}]
  724. * @returns {LocalSendConfig}
  725. */
  726. static createFrom($$source = {}) {
  727. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  728. return new LocalSendConfig(/** @type {Partial<LocalSendConfig>} */($$parsedSource));
  729. }
  730. }
  731. /**
  732. * MinuteChart 分时图数据
  733. */
  734. export class MinuteChart {
  735. /**
  736. * Creates a new MinuteChart instance.
  737. * @param {Partial<MinuteChart>} [$$source = {}] - The source object to create the MinuteChart.
  738. */
  739. constructor($$source = {}) {
  740. if (!("code" in $$source)) {
  741. /**
  742. * 股票代码
  743. * @member
  744. * @type {string}
  745. */
  746. this["code"] = "";
  747. }
  748. if (!("prevClose" in $$source)) {
  749. /**
  750. * 昨收,作为分时基准线
  751. * @member
  752. * @type {number}
  753. */
  754. this["prevClose"] = 0;
  755. }
  756. if (!("points" in $$source)) {
  757. /**
  758. * 分时点序列
  759. * @member
  760. * @type {MinutePoint[]}
  761. */
  762. this["points"] = [];
  763. }
  764. Object.assign(this, $$source);
  765. }
  766. /**
  767. * Creates a new MinuteChart instance from a string or object.
  768. * @param {any} [$$source = {}]
  769. * @returns {MinuteChart}
  770. */
  771. static createFrom($$source = {}) {
  772. const $$createField2_0 = $$createType12;
  773. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  774. if ("points" in $$parsedSource) {
  775. $$parsedSource["points"] = $$createField2_0($$parsedSource["points"]);
  776. }
  777. return new MinuteChart(/** @type {Partial<MinuteChart>} */($$parsedSource));
  778. }
  779. }
  780. /**
  781. * MinutePoint 分时图上的一个点
  782. */
  783. export class MinutePoint {
  784. /**
  785. * Creates a new MinutePoint instance.
  786. * @param {Partial<MinutePoint>} [$$source = {}] - The source object to create the MinutePoint.
  787. */
  788. constructor($$source = {}) {
  789. if (!("time" in $$source)) {
  790. /**
  791. * HH:MM
  792. * @member
  793. * @type {string}
  794. */
  795. this["time"] = "";
  796. }
  797. if (!("price" in $$source)) {
  798. /**
  799. * 当前价
  800. * @member
  801. * @type {number}
  802. */
  803. this["price"] = 0;
  804. }
  805. if (!("avg" in $$source)) {
  806. /**
  807. * 均价
  808. * @member
  809. * @type {number}
  810. */
  811. this["avg"] = 0;
  812. }
  813. Object.assign(this, $$source);
  814. }
  815. /**
  816. * Creates a new MinutePoint instance from a string or object.
  817. * @param {any} [$$source = {}]
  818. * @returns {MinutePoint}
  819. */
  820. static createFrom($$source = {}) {
  821. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  822. return new MinutePoint(/** @type {Partial<MinutePoint>} */($$parsedSource));
  823. }
  824. }
  825. /**
  826. * MouseAlertConfig 系统级鼠标提醒气泡的显示配置
  827. */
  828. export class MouseAlertConfig {
  829. /**
  830. * Creates a new MouseAlertConfig instance.
  831. * @param {Partial<MouseAlertConfig>} [$$source = {}] - The source object to create the MouseAlertConfig.
  832. */
  833. constructor($$source = {}) {
  834. if (!("fontSize" in $$source)) {
  835. /**
  836. * 字号(px)
  837. * @member
  838. * @type {number}
  839. */
  840. this["fontSize"] = 0;
  841. }
  842. if (!("width" in $$source)) {
  843. /**
  844. * 气泡窗口宽度(px)
  845. * @member
  846. * @type {number}
  847. */
  848. this["width"] = 0;
  849. }
  850. if (!("speed" in $$source)) {
  851. /**
  852. * 超长文字滚动速度(px/s)
  853. * @member
  854. * @type {number}
  855. */
  856. this["speed"] = 0;
  857. }
  858. if (!("color" in $$source)) {
  859. /**
  860. * 文字颜色
  861. * @member
  862. * @type {string}
  863. */
  864. this["color"] = "";
  865. }
  866. if (!("background" in $$source)) {
  867. /**
  868. * 气泡背景色(COLORKEY 抠成透明,仅作底色参考)
  869. * @member
  870. * @type {string}
  871. */
  872. this["background"] = "";
  873. }
  874. if (!("duration" in $$source)) {
  875. /**
  876. * 显示时长(秒)
  877. * @member
  878. * @type {number}
  879. */
  880. this["duration"] = 0;
  881. }
  882. if (!("outlineColor" in $$source)) {
  883. /**
  884. * 文字描边颜色(白边/黑边,与文字形成反差)
  885. * @member
  886. * @type {string}
  887. */
  888. this["outlineColor"] = "";
  889. }
  890. if (!("outlineWidth" in $$source)) {
  891. /**
  892. * 文字描边宽度(px),0 表示关闭描边
  893. * @member
  894. * @type {number}
  895. */
  896. this["outlineWidth"] = 0;
  897. }
  898. Object.assign(this, $$source);
  899. }
  900. /**
  901. * Creates a new MouseAlertConfig instance from a string or object.
  902. * @param {any} [$$source = {}]
  903. * @returns {MouseAlertConfig}
  904. */
  905. static createFrom($$source = {}) {
  906. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  907. return new MouseAlertConfig(/** @type {Partial<MouseAlertConfig>} */($$parsedSource));
  908. }
  909. }
  910. /**
  911. * NewsItem 一条新闻标题,供「新闻」页与新闻滚动条使用
  912. */
  913. export class NewsItem {
  914. /**
  915. * Creates a new NewsItem instance.
  916. * @param {Partial<NewsItem>} [$$source = {}] - The source object to create the NewsItem.
  917. */
  918. constructor($$source = {}) {
  919. if (!("source" in $$source)) {
  920. /**
  921. * 来源:煎蛋 / 头条 / 腾讯
  922. * @member
  923. * @type {string}
  924. */
  925. this["source"] = "";
  926. }
  927. if (!("title" in $$source)) {
  928. /**
  929. * 标题
  930. * @member
  931. * @type {string}
  932. */
  933. this["title"] = "";
  934. }
  935. if (!("url" in $$source)) {
  936. /**
  937. * 详情页地址
  938. * @member
  939. * @type {string}
  940. */
  941. this["url"] = "";
  942. }
  943. if (!("matched" in $$source)) {
  944. /**
  945. * 是否命中关注关键词
  946. * @member
  947. * @type {boolean}
  948. */
  949. this["matched"] = false;
  950. }
  951. Object.assign(this, $$source);
  952. }
  953. /**
  954. * Creates a new NewsItem instance from a string or object.
  955. * @param {any} [$$source = {}]
  956. * @returns {NewsItem}
  957. */
  958. static createFrom($$source = {}) {
  959. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  960. return new NewsItem(/** @type {Partial<NewsItem>} */($$parsedSource));
  961. }
  962. }
  963. /**
  964. * PCStatus 电源命令状态快照,供 API 与「主机」页查询
  965. */
  966. export class PCStatus {
  967. /**
  968. * Creates a new PCStatus instance.
  969. * @param {Partial<PCStatus>} [$$source = {}] - The source object to create the PCStatus.
  970. */
  971. constructor($$source = {}) {
  972. if (!("command" in $$source)) {
  973. /**
  974. * 最近一次命令类型
  975. * @member
  976. * @type {string}
  977. */
  978. this["command"] = "";
  979. }
  980. if (!("pending" in $$source)) {
  981. /**
  982. * 是否有待执行命令
  983. * @member
  984. * @type {boolean}
  985. */
  986. this["pending"] = false;
  987. }
  988. if (!("executeAt" in $$source)) {
  989. /**
  990. * 计划执行时间
  991. * @member
  992. * @type {string}
  993. */
  994. this["executeAt"] = "";
  995. }
  996. if (!("remainingSecs" in $$source)) {
  997. /**
  998. * 剩余秒数
  999. * @member
  1000. * @type {number}
  1001. */
  1002. this["remainingSecs"] = 0;
  1003. }
  1004. if (!("clientIp" in $$source)) {
  1005. /**
  1006. * 最近一次请求的客户端 IP
  1007. * @member
  1008. * @type {string}
  1009. */
  1010. this["clientIp"] = "";
  1011. }
  1012. if (!("requestTime" in $$source)) {
  1013. /**
  1014. * 最近一次请求时间
  1015. * @member
  1016. * @type {string}
  1017. */
  1018. this["requestTime"] = "";
  1019. }
  1020. if (!("requested" in $$source)) {
  1021. /**
  1022. * 是否收到过请求
  1023. * @member
  1024. * @type {boolean}
  1025. */
  1026. this["requested"] = false;
  1027. }
  1028. Object.assign(this, $$source);
  1029. }
  1030. /**
  1031. * Creates a new PCStatus instance from a string or object.
  1032. * @param {any} [$$source = {}]
  1033. * @returns {PCStatus}
  1034. */
  1035. static createFrom($$source = {}) {
  1036. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1037. return new PCStatus(/** @type {Partial<PCStatus>} */($$parsedSource));
  1038. }
  1039. }
  1040. /**
  1041. * PoemConfig 古诗显示的配置
  1042. */
  1043. export class PoemConfig {
  1044. /**
  1045. * Creates a new PoemConfig instance.
  1046. * @param {Partial<PoemConfig>} [$$source = {}] - The source object to create the PoemConfig.
  1047. */
  1048. constructor($$source = {}) {
  1049. if (!("enabled" in $$source)) {
  1050. /**
  1051. * 是否启用古诗显示
  1052. * @member
  1053. * @type {boolean}
  1054. */
  1055. this["enabled"] = false;
  1056. }
  1057. if (!("color" in $$source)) {
  1058. /**
  1059. * 文字颜色
  1060. * @member
  1061. * @type {string}
  1062. */
  1063. this["color"] = "";
  1064. }
  1065. if (!("fontSize" in $$source)) {
  1066. /**
  1067. * 字号(px)
  1068. * @member
  1069. * @type {number}
  1070. */
  1071. this["fontSize"] = 0;
  1072. }
  1073. if (!("tts" in $$source)) {
  1074. /**
  1075. * 允许 TTS 阅读(显示朗读按钮)
  1076. * @member
  1077. * @type {boolean}
  1078. */
  1079. this["tts"] = false;
  1080. }
  1081. if (!("interval" in $$source)) {
  1082. /**
  1083. * 自动换诗间隔(秒),0 表示不自动换
  1084. * @member
  1085. * @type {number}
  1086. */
  1087. this["interval"] = 0;
  1088. }
  1089. if (!("speed" in $$source)) {
  1090. /**
  1091. * 滚动速度(秒/轮),即滚动一个文本周期所需秒数,越小越快
  1092. * @member
  1093. * @type {number}
  1094. */
  1095. this["speed"] = 0;
  1096. }
  1097. Object.assign(this, $$source);
  1098. }
  1099. /**
  1100. * Creates a new PoemConfig instance from a string or object.
  1101. * @param {any} [$$source = {}]
  1102. * @returns {PoemConfig}
  1103. */
  1104. static createFrom($$source = {}) {
  1105. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1106. return new PoemConfig(/** @type {Partial<PoemConfig>} */($$parsedSource));
  1107. }
  1108. }
  1109. /**
  1110. * PoemData 一首古诗的完整数据(从接口解析)
  1111. */
  1112. export class PoemData {
  1113. /**
  1114. * Creates a new PoemData instance.
  1115. * @param {Partial<PoemData>} [$$source = {}] - The source object to create the PoemData.
  1116. */
  1117. constructor($$source = {}) {
  1118. if (!("title" in $$source)) {
  1119. /**
  1120. * 题目
  1121. * @member
  1122. * @type {string}
  1123. */
  1124. this["title"] = "";
  1125. }
  1126. if (!("author" in $$source)) {
  1127. /**
  1128. * 作者
  1129. * @member
  1130. * @type {string}
  1131. */
  1132. this["author"] = "";
  1133. }
  1134. if (!("dynasty" in $$source)) {
  1135. /**
  1136. * 朝代
  1137. * @member
  1138. * @type {string}
  1139. */
  1140. this["dynasty"] = "";
  1141. }
  1142. if (!("content" in $$source)) {
  1143. /**
  1144. * 每句诗(数组,按行显示)
  1145. * @member
  1146. * @type {string[]}
  1147. */
  1148. this["content"] = [];
  1149. }
  1150. if (!("type" in $$source)) {
  1151. /**
  1152. * 体裁,如 五言律诗
  1153. * @member
  1154. * @type {string}
  1155. */
  1156. this["type"] = "";
  1157. }
  1158. Object.assign(this, $$source);
  1159. }
  1160. /**
  1161. * Creates a new PoemData instance from a string or object.
  1162. * @param {any} [$$source = {}]
  1163. * @returns {PoemData}
  1164. */
  1165. static createFrom($$source = {}) {
  1166. const $$createField3_0 = $$createType0;
  1167. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1168. if ("content" in $$parsedSource) {
  1169. $$parsedSource["content"] = $$createField3_0($$parsedSource["content"]);
  1170. }
  1171. return new PoemData(/** @type {Partial<PoemData>} */($$parsedSource));
  1172. }
  1173. }
  1174. /**
  1175. * RecordItem 一条记录:姓名 + 名称 + 值 + 备注 + 录入时间,供记录 Tab 列表与柱状图使用
  1176. */
  1177. export class RecordItem {
  1178. /**
  1179. * Creates a new RecordItem instance.
  1180. * @param {Partial<RecordItem>} [$$source = {}] - The source object to create the RecordItem.
  1181. */
  1182. constructor($$source = {}) {
  1183. if (!("name" in $$source)) {
  1184. /**
  1185. * 姓名
  1186. * @member
  1187. * @type {string}
  1188. */
  1189. this["name"] = "";
  1190. }
  1191. if (!("item" in $$source)) {
  1192. /**
  1193. * 名称
  1194. * @member
  1195. * @type {string}
  1196. */
  1197. this["item"] = "";
  1198. }
  1199. if (!("value" in $$source)) {
  1200. /**
  1201. * 值
  1202. * @member
  1203. * @type {number}
  1204. */
  1205. this["value"] = 0;
  1206. }
  1207. if (!("remark" in $$source)) {
  1208. /**
  1209. * 备注(可选)
  1210. * @member
  1211. * @type {string}
  1212. */
  1213. this["remark"] = "";
  1214. }
  1215. if (!("createdAt" in $$source)) {
  1216. /**
  1217. * 录入时间 YYYY-MM-DD HH:MM:SS(前端新增时生成;为空时后端用当前时间)
  1218. * @member
  1219. * @type {string}
  1220. */
  1221. this["createdAt"] = "";
  1222. }
  1223. Object.assign(this, $$source);
  1224. }
  1225. /**
  1226. * Creates a new RecordItem instance from a string or object.
  1227. * @param {any} [$$source = {}]
  1228. * @returns {RecordItem}
  1229. */
  1230. static createFrom($$source = {}) {
  1231. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1232. return new RecordItem(/** @type {Partial<RecordItem>} */($$parsedSource));
  1233. }
  1234. }
  1235. /**
  1236. * ReleaseItem 一个 GitHub release 的简略信息,用于列出 Latest 之后的版本(Pre-release 等)
  1237. */
  1238. export class ReleaseItem {
  1239. /**
  1240. * Creates a new ReleaseItem instance.
  1241. * @param {Partial<ReleaseItem>} [$$source = {}] - The source object to create the ReleaseItem.
  1242. */
  1243. constructor($$source = {}) {
  1244. if (!("tagName" in $$source)) {
  1245. /**
  1246. * 版本标签,如 v1.3.0-beta.1
  1247. * @member
  1248. * @type {string}
  1249. */
  1250. this["tagName"] = "";
  1251. }
  1252. if (!("name" in $$source)) {
  1253. /**
  1254. * release 显示名称(标题),可能比 tag 更完整,如 "Rolling: v2.1.0-..."
  1255. * @member
  1256. * @type {string}
  1257. */
  1258. this["name"] = "";
  1259. }
  1260. if (!("url" in $$source)) {
  1261. /**
  1262. * release 详情页地址
  1263. * @member
  1264. * @type {string}
  1265. */
  1266. this["url"] = "";
  1267. }
  1268. if (!("isPrerelease" in $$source)) {
  1269. /**
  1270. * 是否预发布版本
  1271. * @member
  1272. * @type {boolean}
  1273. */
  1274. this["isPrerelease"] = false;
  1275. }
  1276. if (!("isDraft" in $$source)) {
  1277. /**
  1278. * 是否草稿版本
  1279. * @member
  1280. * @type {boolean}
  1281. */
  1282. this["isDraft"] = false;
  1283. }
  1284. if (!("publishedAt" in $$source)) {
  1285. /**
  1286. * 发布时间(MM-DD HH:MM)
  1287. * @member
  1288. * @type {string}
  1289. */
  1290. this["publishedAt"] = "";
  1291. }
  1292. Object.assign(this, $$source);
  1293. }
  1294. /**
  1295. * Creates a new ReleaseItem instance from a string or object.
  1296. * @param {any} [$$source = {}]
  1297. * @returns {ReleaseItem}
  1298. */
  1299. static createFrom($$source = {}) {
  1300. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1301. return new ReleaseItem(/** @type {Partial<ReleaseItem>} */($$parsedSource));
  1302. }
  1303. }
  1304. /**
  1305. * RepoFeed 一个 GitHub 仓库的最新提交摘要
  1306. */
  1307. export class RepoFeed {
  1308. /**
  1309. * Creates a new RepoFeed instance.
  1310. * @param {Partial<RepoFeed>} [$$source = {}] - The source object to create the RepoFeed.
  1311. */
  1312. constructor($$source = {}) {
  1313. if (!("url" in $$source)) {
  1314. /**
  1315. * 仓库地址(设置中配置)
  1316. * @member
  1317. * @type {string}
  1318. */
  1319. this["url"] = "";
  1320. }
  1321. if (!("desc" in $$source)) {
  1322. /**
  1323. * 项目说明
  1324. * @member
  1325. * @type {string}
  1326. */
  1327. this["desc"] = "";
  1328. }
  1329. if (!("repo" in $$source)) {
  1330. /**
  1331. * owner/repo 短名
  1332. * @member
  1333. * @type {string}
  1334. */
  1335. this["repo"] = "";
  1336. }
  1337. if (!("version" in $$source)) {
  1338. /**
  1339. * 本地已安装版本(设置中配置)
  1340. * @member
  1341. * @type {string}
  1342. */
  1343. this["version"] = "";
  1344. }
  1345. if (!("versionTime" in $$source)) {
  1346. /**
  1347. * 本地版本对应 release 的发布时间(MM-DD HH:MM),用于鼠标提示
  1348. * @member
  1349. * @type {string}
  1350. */
  1351. this["versionTime"] = "";
  1352. }
  1353. if (!("latest" in $$source)) {
  1354. /**
  1355. * 最新正式 release 版本号,无正式 release 时为空
  1356. * @member
  1357. * @type {string}
  1358. */
  1359. this["latest"] = "";
  1360. }
  1361. if (!("latestTime" in $$source)) {
  1362. /**
  1363. * 最新正式 release 发布时间(MM-DD HH:MM),用于鼠标提示
  1364. * @member
  1365. * @type {string}
  1366. */
  1367. this["latestTime"] = "";
  1368. }
  1369. if (!("hasUpdate" in $$source)) {
  1370. /**
  1371. * 是否存在可用更新(本地版本低于最新正式 release)
  1372. * @member
  1373. * @type {boolean}
  1374. */
  1375. this["hasUpdate"] = false;
  1376. }
  1377. if (!("releaseURL" in $$source)) {
  1378. /**
  1379. * 最新正式 release 的下载 / 详情页地址
  1380. * @member
  1381. * @type {string}
  1382. */
  1383. this["releaseURL"] = "";
  1384. }
  1385. if (!("newer" in $$source)) {
  1386. /**
  1387. * Latest 之后的版本(Pre-release 等,仅列出不参与更新比较)
  1388. * @member
  1389. * @type {ReleaseItem[]}
  1390. */
  1391. this["newer"] = [];
  1392. }
  1393. if (!("commits" in $$source)) {
  1394. /**
  1395. * 最近提交(最多 5 条)
  1396. * @member
  1397. * @type {CommitItem[]}
  1398. */
  1399. this["commits"] = [];
  1400. }
  1401. if (!("error" in $$source)) {
  1402. /**
  1403. * 抓取失败原因,为空表示正常
  1404. * @member
  1405. * @type {string}
  1406. */
  1407. this["error"] = "";
  1408. }
  1409. Object.assign(this, $$source);
  1410. }
  1411. /**
  1412. * Creates a new RepoFeed instance from a string or object.
  1413. * @param {any} [$$source = {}]
  1414. * @returns {RepoFeed}
  1415. */
  1416. static createFrom($$source = {}) {
  1417. const $$createField9_0 = $$createType14;
  1418. const $$createField10_0 = $$createType16;
  1419. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1420. if ("newer" in $$parsedSource) {
  1421. $$parsedSource["newer"] = $$createField9_0($$parsedSource["newer"]);
  1422. }
  1423. if ("commits" in $$parsedSource) {
  1424. $$parsedSource["commits"] = $$createField10_0($$parsedSource["commits"]);
  1425. }
  1426. return new RepoFeed(/** @type {Partial<RepoFeed>} */($$parsedSource));
  1427. }
  1428. }
  1429. /**
  1430. * RepoItem 关注的 GitHub 仓库条目
  1431. */
  1432. export class RepoItem {
  1433. /**
  1434. * Creates a new RepoItem instance.
  1435. * @param {Partial<RepoItem>} [$$source = {}] - The source object to create the RepoItem.
  1436. */
  1437. constructor($$source = {}) {
  1438. if (!("url" in $$source)) {
  1439. /**
  1440. * 仓库地址,如 https://github.com/wailsapp/wails
  1441. * @member
  1442. * @type {string}
  1443. */
  1444. this["url"] = "";
  1445. }
  1446. if (!("desc" in $$source)) {
  1447. /**
  1448. * 项目说明
  1449. * @member
  1450. * @type {string}
  1451. */
  1452. this["desc"] = "";
  1453. }
  1454. if (!("version" in $$source)) {
  1455. /**
  1456. * 本地已安装版本(用于与最新 release 比较),可为空
  1457. * @member
  1458. * @type {string}
  1459. */
  1460. this["version"] = "";
  1461. }
  1462. Object.assign(this, $$source);
  1463. }
  1464. /**
  1465. * Creates a new RepoItem instance from a string or object.
  1466. * @param {any} [$$source = {}]
  1467. * @returns {RepoItem}
  1468. */
  1469. static createFrom($$source = {}) {
  1470. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1471. return new RepoItem(/** @type {Partial<RepoItem>} */($$parsedSource));
  1472. }
  1473. }
  1474. /**
  1475. * StockQuote 单只股票的行情快照,供前端「股市」页展示
  1476. */
  1477. export class StockQuote {
  1478. /**
  1479. * Creates a new StockQuote instance.
  1480. * @param {Partial<StockQuote>} [$$source = {}] - The source object to create the StockQuote.
  1481. */
  1482. constructor($$source = {}) {
  1483. if (!("code" in $$source)) {
  1484. /**
  1485. * 带市场前缀的代码,如 sh600519
  1486. * @member
  1487. * @type {string}
  1488. */
  1489. this["code"] = "";
  1490. }
  1491. if (!("name" in $$source)) {
  1492. /**
  1493. * 股票名称
  1494. * @member
  1495. * @type {string}
  1496. */
  1497. this["name"] = "";
  1498. }
  1499. if (!("price" in $$source)) {
  1500. /**
  1501. * 当前价
  1502. * @member
  1503. * @type {number}
  1504. */
  1505. this["price"] = 0;
  1506. }
  1507. if (!("change" in $$source)) {
  1508. /**
  1509. * 涨跌额
  1510. * @member
  1511. * @type {number}
  1512. */
  1513. this["change"] = 0;
  1514. }
  1515. if (!("changePercent" in $$source)) {
  1516. /**
  1517. * 涨跌幅(%)
  1518. * @member
  1519. * @type {number}
  1520. */
  1521. this["changePercent"] = 0;
  1522. }
  1523. if (!("amount" in $$source)) {
  1524. /**
  1525. * 成交额(万元)
  1526. * @member
  1527. * @type {number}
  1528. */
  1529. this["amount"] = 0;
  1530. }
  1531. if (!("time" in $$source)) {
  1532. /**
  1533. * 行情时间 HH:MM:SS
  1534. * @member
  1535. * @type {string}
  1536. */
  1537. this["time"] = "";
  1538. }
  1539. Object.assign(this, $$source);
  1540. }
  1541. /**
  1542. * Creates a new StockQuote instance from a string or object.
  1543. * @param {any} [$$source = {}]
  1544. * @returns {StockQuote}
  1545. */
  1546. static createFrom($$source = {}) {
  1547. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1548. return new StockQuote(/** @type {Partial<StockQuote>} */($$parsedSource));
  1549. }
  1550. }
  1551. /**
  1552. * TickerConfig 置顶滚动条(股票 / 新闻)的显示配置
  1553. */
  1554. export class TickerConfig {
  1555. /**
  1556. * Creates a new TickerConfig instance.
  1557. * @param {Partial<TickerConfig>} [$$source = {}] - The source object to create the TickerConfig.
  1558. */
  1559. constructor($$source = {}) {
  1560. if (!("enabled" in $$source)) {
  1561. /**
  1562. * 是否显示滚动条窗口
  1563. * @member
  1564. * @type {boolean}
  1565. */
  1566. this["enabled"] = false;
  1567. }
  1568. if (!("width" in $$source)) {
  1569. /**
  1570. * 窗口宽度(px),0 表示默认 1400
  1571. * @member
  1572. * @type {number}
  1573. */
  1574. this["width"] = 0;
  1575. }
  1576. if (!("fontSize" in $$source)) {
  1577. /**
  1578. * 字号(px)
  1579. * @member
  1580. * @type {number}
  1581. */
  1582. this["fontSize"] = 0;
  1583. }
  1584. if (!("color" in $$source)) {
  1585. /**
  1586. * 文字颜色
  1587. * @member
  1588. * @type {string}
  1589. */
  1590. this["color"] = "";
  1591. }
  1592. if (!("speed" in $$source)) {
  1593. /**
  1594. * 滚动速度(px/s)
  1595. * @member
  1596. * @type {number}
  1597. */
  1598. this["speed"] = 0;
  1599. }
  1600. if (!("transparent" in $$source)) {
  1601. /**
  1602. * 背景透明,不遮挡下方内容
  1603. * @member
  1604. * @type {boolean}
  1605. */
  1606. this["transparent"] = false;
  1607. }
  1608. if (!("x" in $$source)) {
  1609. /**
  1610. * 窗口位置,-1 表示未设置(系统默认位置)
  1611. * @member
  1612. * @type {number}
  1613. */
  1614. this["x"] = 0;
  1615. }
  1616. if (!("y" in $$source)) {
  1617. /**
  1618. * 窗口位置,-1 表示未设置
  1619. * @member
  1620. * @type {number}
  1621. */
  1622. this["y"] = 0;
  1623. }
  1624. Object.assign(this, $$source);
  1625. }
  1626. /**
  1627. * Creates a new TickerConfig instance from a string or object.
  1628. * @param {any} [$$source = {}]
  1629. * @returns {TickerConfig}
  1630. */
  1631. static createFrom($$source = {}) {
  1632. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1633. return new TickerConfig(/** @type {Partial<TickerConfig>} */($$parsedSource));
  1634. }
  1635. }
  1636. /**
  1637. * TranslateResult 一次翻译的结果,供前端展示。
  1638. */
  1639. export class TranslateResult {
  1640. /**
  1641. * Creates a new TranslateResult instance.
  1642. * @param {Partial<TranslateResult>} [$$source = {}] - The source object to create the TranslateResult.
  1643. */
  1644. constructor($$source = {}) {
  1645. if (!("text" in $$source)) {
  1646. /**
  1647. * 翻译结果文本
  1648. * @member
  1649. * @type {string}
  1650. */
  1651. this["text"] = "";
  1652. }
  1653. if (!("detected" in $$source)) {
  1654. /**
  1655. * 检测到的源语言(zh / en)
  1656. * @member
  1657. * @type {string}
  1658. */
  1659. this["detected"] = "";
  1660. }
  1661. if (!("target" in $$source)) {
  1662. /**
  1663. * 目标语言(zh / en)
  1664. * @member
  1665. * @type {string}
  1666. */
  1667. this["target"] = "";
  1668. }
  1669. Object.assign(this, $$source);
  1670. }
  1671. /**
  1672. * Creates a new TranslateResult instance from a string or object.
  1673. * @param {any} [$$source = {}]
  1674. * @returns {TranslateResult}
  1675. */
  1676. static createFrom($$source = {}) {
  1677. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1678. return new TranslateResult(/** @type {Partial<TranslateResult>} */($$parsedSource));
  1679. }
  1680. }
  1681. /**
  1682. * TrendingRepo 一个热门仓库条目(来源可为 GitHub Trending 或 HelloGitHub)
  1683. */
  1684. export class TrendingRepo {
  1685. /**
  1686. * Creates a new TrendingRepo instance.
  1687. * @param {Partial<TrendingRepo>} [$$source = {}] - The source object to create the TrendingRepo.
  1688. */
  1689. constructor($$source = {}) {
  1690. if (!("name" in $$source)) {
  1691. /**
  1692. * owner/repo 短名
  1693. * @member
  1694. * @type {string}
  1695. */
  1696. this["name"] = "";
  1697. }
  1698. if (!("url" in $$source)) {
  1699. /**
  1700. * 仓库主页地址(GitHub 直链)
  1701. * @member
  1702. * @type {string}
  1703. */
  1704. this["url"] = "";
  1705. }
  1706. if (!("desc" in $$source)) {
  1707. /**
  1708. * 简介(英文已自动翻译为中文,翻译失败保留原文)
  1709. * @member
  1710. * @type {string}
  1711. */
  1712. this["desc"] = "";
  1713. }
  1714. if (!("lang" in $$source)) {
  1715. /**
  1716. * 主要语言,无则空
  1717. * @member
  1718. * @type {string}
  1719. */
  1720. this["lang"] = "";
  1721. }
  1722. if (!("stars" in $$source)) {
  1723. /**
  1724. * 总星数(如 "106,375")
  1725. * @member
  1726. * @type {string}
  1727. */
  1728. this["stars"] = "";
  1729. }
  1730. if (!("todayStars" in $$source)) {
  1731. /**
  1732. * 今日新增星数(如 "1,140",无则空)
  1733. * @member
  1734. * @type {string}
  1735. */
  1736. this["todayStars"] = "";
  1737. }
  1738. if (!("forks" in $$source)) {
  1739. /**
  1740. * fork 数(如 "9,365",无则空)
  1741. * @member
  1742. * @type {string}
  1743. */
  1744. this["forks"] = "";
  1745. }
  1746. if (!("source" in $$source)) {
  1747. /**
  1748. * 来源:"github"(GitHub Trending)/ "hellogithub"
  1749. * @member
  1750. * @type {string}
  1751. */
  1752. this["source"] = "";
  1753. }
  1754. if (!("heat" in $$source)) {
  1755. /**
  1756. * 热度(HelloGitHub 点击量,其它来源为空)
  1757. * @member
  1758. * @type {string}
  1759. */
  1760. this["heat"] = "";
  1761. }
  1762. Object.assign(this, $$source);
  1763. }
  1764. /**
  1765. * Creates a new TrendingRepo instance from a string or object.
  1766. * @param {any} [$$source = {}]
  1767. * @returns {TrendingRepo}
  1768. */
  1769. static createFrom($$source = {}) {
  1770. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1771. return new TrendingRepo(/** @type {Partial<TrendingRepo>} */($$parsedSource));
  1772. }
  1773. }
  1774. /**
  1775. * WebServiceInfo 描述一次 Web 服务运行实例的状态,供前端展示。
  1776. */
  1777. export class WebServiceInfo {
  1778. /**
  1779. * Creates a new WebServiceInfo instance.
  1780. * @param {Partial<WebServiceInfo>} [$$source = {}] - The source object to create the WebServiceInfo.
  1781. */
  1782. constructor($$source = {}) {
  1783. if (!("running" in $$source)) {
  1784. /**
  1785. * 是否运行中
  1786. * @member
  1787. * @type {boolean}
  1788. */
  1789. this["running"] = false;
  1790. }
  1791. if (!("dir" in $$source)) {
  1792. /**
  1793. * 服务目录
  1794. * @member
  1795. * @type {string}
  1796. */
  1797. this["dir"] = "";
  1798. }
  1799. if (!("url" in $$source)) {
  1800. /**
  1801. * 访问地址 http://127.0.0.1:port/
  1802. * @member
  1803. * @type {string}
  1804. */
  1805. this["url"] = "";
  1806. }
  1807. if (!("indexName" in $$source)) {
  1808. /**
  1809. * 实际用作默认页的文件(index.html / readme.md / 空)
  1810. * @member
  1811. * @type {string}
  1812. */
  1813. this["indexName"] = "";
  1814. }
  1815. if (!("startedAt" in $$source)) {
  1816. /**
  1817. * 启动时间
  1818. * @member
  1819. * @type {string}
  1820. */
  1821. this["startedAt"] = "";
  1822. }
  1823. if (!("error" in $$source)) {
  1824. /**
  1825. * 最近一次错误
  1826. * @member
  1827. * @type {string}
  1828. */
  1829. this["error"] = "";
  1830. }
  1831. if (!("connections" in $$source)) {
  1832. /**
  1833. * 累计请求次数
  1834. * @member
  1835. * @type {number}
  1836. */
  1837. this["connections"] = 0;
  1838. }
  1839. Object.assign(this, $$source);
  1840. }
  1841. /**
  1842. * Creates a new WebServiceInfo instance from a string or object.
  1843. * @param {any} [$$source = {}]
  1844. * @returns {WebServiceInfo}
  1845. */
  1846. static createFrom($$source = {}) {
  1847. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1848. return new WebServiceInfo(/** @type {Partial<WebServiceInfo>} */($$parsedSource));
  1849. }
  1850. }
  1851. // Private type creation functions
  1852. const $$createType0 = $Create.Array($Create.Any);
  1853. const $$createType1 = LinkItem.createFrom;
  1854. const $$createType2 = $Create.Array($$createType1);
  1855. const $$createType3 = RepoItem.createFrom;
  1856. const $$createType4 = $Create.Array($$createType3);
  1857. const $$createType5 = CustomTab.createFrom;
  1858. const $$createType6 = $Create.Array($$createType5);
  1859. const $$createType7 = TickerConfig.createFrom;
  1860. const $$createType8 = PoemConfig.createFrom;
  1861. const $$createType9 = MouseAlertConfig.createFrom;
  1862. const $$createType10 = LocalSendConfig.createFrom;
  1863. const $$createType11 = MinutePoint.createFrom;
  1864. const $$createType12 = $Create.Array($$createType11);
  1865. const $$createType13 = ReleaseItem.createFrom;
  1866. const $$createType14 = $Create.Array($$createType13);
  1867. const $$createType15 = CommitItem.createFrom;
  1868. const $$createType16 = $Create.Array($$createType15);