models.js 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672
  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 (!("todoPath" in $$source)) {
  166. /**
  167. * 待办(TODO)文件路径
  168. * @member
  169. * @type {string}
  170. */
  171. this["todoPath"] = "";
  172. }
  173. if (!("recordPath" in $$source)) {
  174. /**
  175. * 记录(Record)文件路径:每行「姓名|名称|值」(保留兼容)
  176. * @member
  177. * @type {string}
  178. */
  179. this["recordPath"] = "";
  180. }
  181. if (!("recordDBPath" in $$source)) {
  182. /**
  183. * 记录数据库路径:SQLite3 数据库文件(记录 Tab 实际存储)
  184. * @member
  185. * @type {string}
  186. */
  187. this["recordDBPath"] = "";
  188. }
  189. if (!("backupDir" in $$source)) {
  190. /**
  191. * 文本文件备份目录(文件类自定义 Tab「备份」按钮使用)
  192. * @member
  193. * @type {string}
  194. */
  195. this["backupDir"] = "";
  196. }
  197. if (!("stockTicker" in $$source)) {
  198. /**
  199. * 股票滚动条配置
  200. * @member
  201. * @type {TickerConfig}
  202. */
  203. this["stockTicker"] = (new TickerConfig());
  204. }
  205. if (!("newsTicker" in $$source)) {
  206. /**
  207. * 新闻滚动条配置
  208. * @member
  209. * @type {TickerConfig}
  210. */
  211. this["newsTicker"] = (new TickerConfig());
  212. }
  213. if (!("poem" in $$source)) {
  214. /**
  215. * 随机古诗显示配置
  216. * @member
  217. * @type {PoemConfig}
  218. */
  219. this["poem"] = (new PoemConfig());
  220. }
  221. if (!("stockUpColor" in $$source)) {
  222. /**
  223. * 股票上涨颜色
  224. * @member
  225. * @type {string}
  226. */
  227. this["stockUpColor"] = "";
  228. }
  229. if (!("stockDownColor" in $$source)) {
  230. /**
  231. * 股票下跌颜色
  232. * @member
  233. * @type {string}
  234. */
  235. this["stockDownColor"] = "";
  236. }
  237. if (!("stockRefreshSecs" in $$source)) {
  238. /**
  239. * 股市自动刷新间隔(秒)
  240. * @member
  241. * @type {number}
  242. */
  243. this["stockRefreshSecs"] = 0;
  244. }
  245. if (!("stockClosedRefreshSecs" in $$source)) {
  246. /**
  247. * 股市休市时自动刷新间隔(秒)
  248. * @member
  249. * @type {number}
  250. */
  251. this["stockClosedRefreshSecs"] = 0;
  252. }
  253. if (!("newsRefreshMinutes" in $$source)) {
  254. /**
  255. * 新闻自动刷新间隔(分钟)
  256. * @member
  257. * @type {number}
  258. */
  259. this["newsRefreshMinutes"] = 0;
  260. }
  261. if (!("newsCount" in $$source)) {
  262. /**
  263. * 新闻页显示条数
  264. * @member
  265. * @type {number}
  266. */
  267. this["newsCount"] = 0;
  268. }
  269. if (!("githubRefreshMinutes" in $$source)) {
  270. /**
  271. * Github 自动刷新间隔(分钟)
  272. * @member
  273. * @type {number}
  274. */
  275. this["githubRefreshMinutes"] = 0;
  276. }
  277. if (!("fontDelta" in $$source)) {
  278. /**
  279. * 全局字号偏移(px),+-3 范围内调整
  280. * @member
  281. * @type {number}
  282. */
  283. this["fontDelta"] = 0;
  284. }
  285. Object.assign(this, $$source);
  286. }
  287. /**
  288. * Creates a new AppSettings instance from a string or object.
  289. * @param {any} [$$source = {}]
  290. * @returns {AppSettings}
  291. */
  292. static createFrom($$source = {}) {
  293. const $$createField4_0 = $$createType0;
  294. const $$createField5_0 = $$createType0;
  295. const $$createField6_0 = $$createType2;
  296. const $$createField9_0 = $$createType4;
  297. const $$createField10_0 = $$createType6;
  298. const $$createField16_0 = $$createType7;
  299. const $$createField17_0 = $$createType7;
  300. const $$createField18_0 = $$createType8;
  301. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  302. if ("tabOrder" in $$parsedSource) {
  303. $$parsedSource["tabOrder"] = $$createField4_0($$parsedSource["tabOrder"]);
  304. }
  305. if ("stockCodes" in $$parsedSource) {
  306. $$parsedSource["stockCodes"] = $$createField5_0($$parsedSource["stockCodes"]);
  307. }
  308. if ("links" in $$parsedSource) {
  309. $$parsedSource["links"] = $$createField6_0($$parsedSource["links"]);
  310. }
  311. if ("githubRepos" in $$parsedSource) {
  312. $$parsedSource["githubRepos"] = $$createField9_0($$parsedSource["githubRepos"]);
  313. }
  314. if ("customTabs" in $$parsedSource) {
  315. $$parsedSource["customTabs"] = $$createField10_0($$parsedSource["customTabs"]);
  316. }
  317. if ("stockTicker" in $$parsedSource) {
  318. $$parsedSource["stockTicker"] = $$createField16_0($$parsedSource["stockTicker"]);
  319. }
  320. if ("newsTicker" in $$parsedSource) {
  321. $$parsedSource["newsTicker"] = $$createField17_0($$parsedSource["newsTicker"]);
  322. }
  323. if ("poem" in $$parsedSource) {
  324. $$parsedSource["poem"] = $$createField18_0($$parsedSource["poem"]);
  325. }
  326. return new AppSettings(/** @type {Partial<AppSettings>} */($$parsedSource));
  327. }
  328. }
  329. /**
  330. * BiliDynamicItem 一条 B站动态,供「新闻」页展示
  331. */
  332. export class BiliDynamicItem {
  333. /**
  334. * Creates a new BiliDynamicItem instance.
  335. * @param {Partial<BiliDynamicItem>} [$$source = {}] - The source object to create the BiliDynamicItem.
  336. */
  337. constructor($$source = {}) {
  338. if (!("source" in $$source)) {
  339. /**
  340. * 来源:B站动态
  341. * @member
  342. * @type {string}
  343. */
  344. this["source"] = "";
  345. }
  346. if (!("title" in $$source)) {
  347. /**
  348. * 标题(动态文案或视频标题)
  349. * @member
  350. * @type {string}
  351. */
  352. this["title"] = "";
  353. }
  354. if (!("url" in $$source)) {
  355. /**
  356. * 详情页地址
  357. * @member
  358. * @type {string}
  359. */
  360. this["url"] = "";
  361. }
  362. if (!("matched" in $$source)) {
  363. /**
  364. * 是否命中关注关键词
  365. * @member
  366. * @type {boolean}
  367. */
  368. this["matched"] = false;
  369. }
  370. Object.assign(this, $$source);
  371. }
  372. /**
  373. * Creates a new BiliDynamicItem instance from a string or object.
  374. * @param {any} [$$source = {}]
  375. * @returns {BiliDynamicItem}
  376. */
  377. static createFrom($$source = {}) {
  378. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  379. return new BiliDynamicItem(/** @type {Partial<BiliDynamicItem>} */($$parsedSource));
  380. }
  381. }
  382. /**
  383. * CommitItem 仓库的一条提交记录
  384. */
  385. export class CommitItem {
  386. /**
  387. * Creates a new CommitItem instance.
  388. * @param {Partial<CommitItem>} [$$source = {}] - The source object to create the CommitItem.
  389. */
  390. constructor($$source = {}) {
  391. if (!("title" in $$source)) {
  392. /**
  393. * 提交标题(首行)
  394. * @member
  395. * @type {string}
  396. */
  397. this["title"] = "";
  398. }
  399. if (!("url" in $$source)) {
  400. /**
  401. * 提交详情页地址
  402. * @member
  403. * @type {string}
  404. */
  405. this["url"] = "";
  406. }
  407. if (!("updated" in $$source)) {
  408. /**
  409. * 提交时间(MM-DD HH:MM)
  410. * @member
  411. * @type {string}
  412. */
  413. this["updated"] = "";
  414. }
  415. Object.assign(this, $$source);
  416. }
  417. /**
  418. * Creates a new CommitItem instance from a string or object.
  419. * @param {any} [$$source = {}]
  420. * @returns {CommitItem}
  421. */
  422. static createFrom($$source = {}) {
  423. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  424. return new CommitItem(/** @type {Partial<CommitItem>} */($$parsedSource));
  425. }
  426. }
  427. /**
  428. * CustomTab 用户自定义 Tab 页面
  429. */
  430. export class CustomTab {
  431. /**
  432. * Creates a new CustomTab instance.
  433. * @param {Partial<CustomTab>} [$$source = {}] - The source object to create the CustomTab.
  434. */
  435. constructor($$source = {}) {
  436. if (!("name" in $$source)) {
  437. /**
  438. * 页面名称(Tab 按钮显示文字)
  439. * @member
  440. * @type {string}
  441. */
  442. this["name"] = "";
  443. }
  444. if (!("url" in $$source)) {
  445. /**
  446. * 页面地址(iframe 加载)
  447. * @member
  448. * @type {string}
  449. */
  450. this["url"] = "";
  451. }
  452. if (!("desc" in $$source)) {
  453. /**
  454. * 备注/提示信息(可空),Tab 说明文字优先显示
  455. * @member
  456. * @type {string}
  457. */
  458. this["desc"] = "";
  459. }
  460. Object.assign(this, $$source);
  461. }
  462. /**
  463. * Creates a new CustomTab instance from a string or object.
  464. * @param {any} [$$source = {}]
  465. * @returns {CustomTab}
  466. */
  467. static createFrom($$source = {}) {
  468. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  469. return new CustomTab(/** @type {Partial<CustomTab>} */($$parsedSource));
  470. }
  471. }
  472. /**
  473. * KLineBar 日 K 的一根柱子
  474. */
  475. export class KLineBar {
  476. /**
  477. * Creates a new KLineBar instance.
  478. * @param {Partial<KLineBar>} [$$source = {}] - The source object to create the KLineBar.
  479. */
  480. constructor($$source = {}) {
  481. if (!("date" in $$source)) {
  482. /**
  483. * 交易日
  484. * @member
  485. * @type {string}
  486. */
  487. this["date"] = "";
  488. }
  489. if (!("open" in $$source)) {
  490. /**
  491. * 开盘价
  492. * @member
  493. * @type {number}
  494. */
  495. this["open"] = 0;
  496. }
  497. if (!("close" in $$source)) {
  498. /**
  499. * 收盘价
  500. * @member
  501. * @type {number}
  502. */
  503. this["close"] = 0;
  504. }
  505. if (!("high" in $$source)) {
  506. /**
  507. * 最高价
  508. * @member
  509. * @type {number}
  510. */
  511. this["high"] = 0;
  512. }
  513. if (!("low" in $$source)) {
  514. /**
  515. * 最低价
  516. * @member
  517. * @type {number}
  518. */
  519. this["low"] = 0;
  520. }
  521. if (!("volume" in $$source)) {
  522. /**
  523. * 成交量(手)
  524. * @member
  525. * @type {number}
  526. */
  527. this["volume"] = 0;
  528. }
  529. Object.assign(this, $$source);
  530. }
  531. /**
  532. * Creates a new KLineBar instance from a string or object.
  533. * @param {any} [$$source = {}]
  534. * @returns {KLineBar}
  535. */
  536. static createFrom($$source = {}) {
  537. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  538. return new KLineBar(/** @type {Partial<KLineBar>} */($$parsedSource));
  539. }
  540. }
  541. /**
  542. * LinkItem 常用网址条目
  543. */
  544. export class LinkItem {
  545. /**
  546. * Creates a new LinkItem instance.
  547. * @param {Partial<LinkItem>} [$$source = {}] - The source object to create the LinkItem.
  548. */
  549. constructor($$source = {}) {
  550. if (!("name" in $$source)) {
  551. /**
  552. * 网站名称
  553. * @member
  554. * @type {string}
  555. */
  556. this["name"] = "";
  557. }
  558. if (!("url" in $$source)) {
  559. /**
  560. * 网站地址
  561. * @member
  562. * @type {string}
  563. */
  564. this["url"] = "";
  565. }
  566. Object.assign(this, $$source);
  567. }
  568. /**
  569. * Creates a new LinkItem instance from a string or object.
  570. * @param {any} [$$source = {}]
  571. * @returns {LinkItem}
  572. */
  573. static createFrom($$source = {}) {
  574. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  575. return new LinkItem(/** @type {Partial<LinkItem>} */($$parsedSource));
  576. }
  577. }
  578. /**
  579. * MinuteChart 分时图数据
  580. */
  581. export class MinuteChart {
  582. /**
  583. * Creates a new MinuteChart instance.
  584. * @param {Partial<MinuteChart>} [$$source = {}] - The source object to create the MinuteChart.
  585. */
  586. constructor($$source = {}) {
  587. if (!("code" in $$source)) {
  588. /**
  589. * 股票代码
  590. * @member
  591. * @type {string}
  592. */
  593. this["code"] = "";
  594. }
  595. if (!("prevClose" in $$source)) {
  596. /**
  597. * 昨收,作为分时基准线
  598. * @member
  599. * @type {number}
  600. */
  601. this["prevClose"] = 0;
  602. }
  603. if (!("points" in $$source)) {
  604. /**
  605. * 分时点序列
  606. * @member
  607. * @type {MinutePoint[]}
  608. */
  609. this["points"] = [];
  610. }
  611. Object.assign(this, $$source);
  612. }
  613. /**
  614. * Creates a new MinuteChart instance from a string or object.
  615. * @param {any} [$$source = {}]
  616. * @returns {MinuteChart}
  617. */
  618. static createFrom($$source = {}) {
  619. const $$createField2_0 = $$createType10;
  620. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  621. if ("points" in $$parsedSource) {
  622. $$parsedSource["points"] = $$createField2_0($$parsedSource["points"]);
  623. }
  624. return new MinuteChart(/** @type {Partial<MinuteChart>} */($$parsedSource));
  625. }
  626. }
  627. /**
  628. * MinutePoint 分时图上的一个点
  629. */
  630. export class MinutePoint {
  631. /**
  632. * Creates a new MinutePoint instance.
  633. * @param {Partial<MinutePoint>} [$$source = {}] - The source object to create the MinutePoint.
  634. */
  635. constructor($$source = {}) {
  636. if (!("time" in $$source)) {
  637. /**
  638. * HH:MM
  639. * @member
  640. * @type {string}
  641. */
  642. this["time"] = "";
  643. }
  644. if (!("price" in $$source)) {
  645. /**
  646. * 当前价
  647. * @member
  648. * @type {number}
  649. */
  650. this["price"] = 0;
  651. }
  652. if (!("avg" in $$source)) {
  653. /**
  654. * 均价
  655. * @member
  656. * @type {number}
  657. */
  658. this["avg"] = 0;
  659. }
  660. Object.assign(this, $$source);
  661. }
  662. /**
  663. * Creates a new MinutePoint instance from a string or object.
  664. * @param {any} [$$source = {}]
  665. * @returns {MinutePoint}
  666. */
  667. static createFrom($$source = {}) {
  668. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  669. return new MinutePoint(/** @type {Partial<MinutePoint>} */($$parsedSource));
  670. }
  671. }
  672. /**
  673. * NewsItem 一条新闻标题,供「新闻」页与新闻滚动条使用
  674. */
  675. export class NewsItem {
  676. /**
  677. * Creates a new NewsItem instance.
  678. * @param {Partial<NewsItem>} [$$source = {}] - The source object to create the NewsItem.
  679. */
  680. constructor($$source = {}) {
  681. if (!("source" in $$source)) {
  682. /**
  683. * 来源:煎蛋 / 头条 / 腾讯
  684. * @member
  685. * @type {string}
  686. */
  687. this["source"] = "";
  688. }
  689. if (!("title" in $$source)) {
  690. /**
  691. * 标题
  692. * @member
  693. * @type {string}
  694. */
  695. this["title"] = "";
  696. }
  697. if (!("url" in $$source)) {
  698. /**
  699. * 详情页地址
  700. * @member
  701. * @type {string}
  702. */
  703. this["url"] = "";
  704. }
  705. if (!("matched" in $$source)) {
  706. /**
  707. * 是否命中关注关键词
  708. * @member
  709. * @type {boolean}
  710. */
  711. this["matched"] = false;
  712. }
  713. Object.assign(this, $$source);
  714. }
  715. /**
  716. * Creates a new NewsItem instance from a string or object.
  717. * @param {any} [$$source = {}]
  718. * @returns {NewsItem}
  719. */
  720. static createFrom($$source = {}) {
  721. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  722. return new NewsItem(/** @type {Partial<NewsItem>} */($$parsedSource));
  723. }
  724. }
  725. /**
  726. * PCStatus 电源命令状态快照,供 API 与「主机」页查询
  727. */
  728. export class PCStatus {
  729. /**
  730. * Creates a new PCStatus instance.
  731. * @param {Partial<PCStatus>} [$$source = {}] - The source object to create the PCStatus.
  732. */
  733. constructor($$source = {}) {
  734. if (!("command" in $$source)) {
  735. /**
  736. * 最近一次命令类型
  737. * @member
  738. * @type {string}
  739. */
  740. this["command"] = "";
  741. }
  742. if (!("pending" in $$source)) {
  743. /**
  744. * 是否有待执行命令
  745. * @member
  746. * @type {boolean}
  747. */
  748. this["pending"] = false;
  749. }
  750. if (!("executeAt" in $$source)) {
  751. /**
  752. * 计划执行时间
  753. * @member
  754. * @type {string}
  755. */
  756. this["executeAt"] = "";
  757. }
  758. if (!("remainingSecs" in $$source)) {
  759. /**
  760. * 剩余秒数
  761. * @member
  762. * @type {number}
  763. */
  764. this["remainingSecs"] = 0;
  765. }
  766. if (!("clientIp" in $$source)) {
  767. /**
  768. * 最近一次请求的客户端 IP
  769. * @member
  770. * @type {string}
  771. */
  772. this["clientIp"] = "";
  773. }
  774. if (!("requestTime" in $$source)) {
  775. /**
  776. * 最近一次请求时间
  777. * @member
  778. * @type {string}
  779. */
  780. this["requestTime"] = "";
  781. }
  782. if (!("requested" in $$source)) {
  783. /**
  784. * 是否收到过请求
  785. * @member
  786. * @type {boolean}
  787. */
  788. this["requested"] = false;
  789. }
  790. Object.assign(this, $$source);
  791. }
  792. /**
  793. * Creates a new PCStatus instance from a string or object.
  794. * @param {any} [$$source = {}]
  795. * @returns {PCStatus}
  796. */
  797. static createFrom($$source = {}) {
  798. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  799. return new PCStatus(/** @type {Partial<PCStatus>} */($$parsedSource));
  800. }
  801. }
  802. /**
  803. * PoemConfig 古诗显示的配置
  804. */
  805. export class PoemConfig {
  806. /**
  807. * Creates a new PoemConfig instance.
  808. * @param {Partial<PoemConfig>} [$$source = {}] - The source object to create the PoemConfig.
  809. */
  810. constructor($$source = {}) {
  811. if (!("enabled" in $$source)) {
  812. /**
  813. * 是否启用古诗显示
  814. * @member
  815. * @type {boolean}
  816. */
  817. this["enabled"] = false;
  818. }
  819. if (!("color" in $$source)) {
  820. /**
  821. * 文字颜色
  822. * @member
  823. * @type {string}
  824. */
  825. this["color"] = "";
  826. }
  827. if (!("fontSize" in $$source)) {
  828. /**
  829. * 字号(px)
  830. * @member
  831. * @type {number}
  832. */
  833. this["fontSize"] = 0;
  834. }
  835. if (!("tts" in $$source)) {
  836. /**
  837. * 允许 TTS 阅读(显示朗读按钮)
  838. * @member
  839. * @type {boolean}
  840. */
  841. this["tts"] = false;
  842. }
  843. if (!("interval" in $$source)) {
  844. /**
  845. * 自动换诗间隔(秒),0 表示不自动换
  846. * @member
  847. * @type {number}
  848. */
  849. this["interval"] = 0;
  850. }
  851. if (!("speed" in $$source)) {
  852. /**
  853. * 滚动速度(秒/轮),即滚动一个文本周期所需秒数,越小越快
  854. * @member
  855. * @type {number}
  856. */
  857. this["speed"] = 0;
  858. }
  859. Object.assign(this, $$source);
  860. }
  861. /**
  862. * Creates a new PoemConfig instance from a string or object.
  863. * @param {any} [$$source = {}]
  864. * @returns {PoemConfig}
  865. */
  866. static createFrom($$source = {}) {
  867. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  868. return new PoemConfig(/** @type {Partial<PoemConfig>} */($$parsedSource));
  869. }
  870. }
  871. /**
  872. * PoemData 一首古诗的完整数据(从接口解析)
  873. */
  874. export class PoemData {
  875. /**
  876. * Creates a new PoemData instance.
  877. * @param {Partial<PoemData>} [$$source = {}] - The source object to create the PoemData.
  878. */
  879. constructor($$source = {}) {
  880. if (!("title" in $$source)) {
  881. /**
  882. * 题目
  883. * @member
  884. * @type {string}
  885. */
  886. this["title"] = "";
  887. }
  888. if (!("author" in $$source)) {
  889. /**
  890. * 作者
  891. * @member
  892. * @type {string}
  893. */
  894. this["author"] = "";
  895. }
  896. if (!("dynasty" in $$source)) {
  897. /**
  898. * 朝代
  899. * @member
  900. * @type {string}
  901. */
  902. this["dynasty"] = "";
  903. }
  904. if (!("content" in $$source)) {
  905. /**
  906. * 每句诗(数组,按行显示)
  907. * @member
  908. * @type {string[]}
  909. */
  910. this["content"] = [];
  911. }
  912. if (!("type" in $$source)) {
  913. /**
  914. * 体裁,如 五言律诗
  915. * @member
  916. * @type {string}
  917. */
  918. this["type"] = "";
  919. }
  920. Object.assign(this, $$source);
  921. }
  922. /**
  923. * Creates a new PoemData instance from a string or object.
  924. * @param {any} [$$source = {}]
  925. * @returns {PoemData}
  926. */
  927. static createFrom($$source = {}) {
  928. const $$createField3_0 = $$createType0;
  929. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  930. if ("content" in $$parsedSource) {
  931. $$parsedSource["content"] = $$createField3_0($$parsedSource["content"]);
  932. }
  933. return new PoemData(/** @type {Partial<PoemData>} */($$parsedSource));
  934. }
  935. }
  936. /**
  937. * RecordItem 一条记录:姓名 + 名称 + 值 + 录入时间,供记录 Tab 列表与柱状图使用
  938. */
  939. export class RecordItem {
  940. /**
  941. * Creates a new RecordItem instance.
  942. * @param {Partial<RecordItem>} [$$source = {}] - The source object to create the RecordItem.
  943. */
  944. constructor($$source = {}) {
  945. if (!("name" in $$source)) {
  946. /**
  947. * 姓名
  948. * @member
  949. * @type {string}
  950. */
  951. this["name"] = "";
  952. }
  953. if (!("item" in $$source)) {
  954. /**
  955. * 名称
  956. * @member
  957. * @type {string}
  958. */
  959. this["item"] = "";
  960. }
  961. if (!("value" in $$source)) {
  962. /**
  963. * 值
  964. * @member
  965. * @type {number}
  966. */
  967. this["value"] = 0;
  968. }
  969. if (!("createdAt" in $$source)) {
  970. /**
  971. * 录入时间 YYYY-MM-DD HH:MM:SS(前端新增时生成;为空时后端用当前时间)
  972. * @member
  973. * @type {string}
  974. */
  975. this["createdAt"] = "";
  976. }
  977. Object.assign(this, $$source);
  978. }
  979. /**
  980. * Creates a new RecordItem instance from a string or object.
  981. * @param {any} [$$source = {}]
  982. * @returns {RecordItem}
  983. */
  984. static createFrom($$source = {}) {
  985. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  986. return new RecordItem(/** @type {Partial<RecordItem>} */($$parsedSource));
  987. }
  988. }
  989. /**
  990. * ReleaseItem 一个 GitHub release 的简略信息,用于列出 Latest 之后的版本(Pre-release 等)
  991. */
  992. export class ReleaseItem {
  993. /**
  994. * Creates a new ReleaseItem instance.
  995. * @param {Partial<ReleaseItem>} [$$source = {}] - The source object to create the ReleaseItem.
  996. */
  997. constructor($$source = {}) {
  998. if (!("tagName" in $$source)) {
  999. /**
  1000. * 版本标签,如 v1.3.0-beta.1
  1001. * @member
  1002. * @type {string}
  1003. */
  1004. this["tagName"] = "";
  1005. }
  1006. if (!("name" in $$source)) {
  1007. /**
  1008. * release 显示名称(标题),可能比 tag 更完整,如 "Rolling: v2.1.0-..."
  1009. * @member
  1010. * @type {string}
  1011. */
  1012. this["name"] = "";
  1013. }
  1014. if (!("url" in $$source)) {
  1015. /**
  1016. * release 详情页地址
  1017. * @member
  1018. * @type {string}
  1019. */
  1020. this["url"] = "";
  1021. }
  1022. if (!("isPrerelease" in $$source)) {
  1023. /**
  1024. * 是否预发布版本
  1025. * @member
  1026. * @type {boolean}
  1027. */
  1028. this["isPrerelease"] = false;
  1029. }
  1030. if (!("isDraft" in $$source)) {
  1031. /**
  1032. * 是否草稿版本
  1033. * @member
  1034. * @type {boolean}
  1035. */
  1036. this["isDraft"] = false;
  1037. }
  1038. if (!("publishedAt" in $$source)) {
  1039. /**
  1040. * 发布时间(MM-DD HH:MM)
  1041. * @member
  1042. * @type {string}
  1043. */
  1044. this["publishedAt"] = "";
  1045. }
  1046. Object.assign(this, $$source);
  1047. }
  1048. /**
  1049. * Creates a new ReleaseItem instance from a string or object.
  1050. * @param {any} [$$source = {}]
  1051. * @returns {ReleaseItem}
  1052. */
  1053. static createFrom($$source = {}) {
  1054. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1055. return new ReleaseItem(/** @type {Partial<ReleaseItem>} */($$parsedSource));
  1056. }
  1057. }
  1058. /**
  1059. * RepoFeed 一个 GitHub 仓库的最新提交摘要
  1060. */
  1061. export class RepoFeed {
  1062. /**
  1063. * Creates a new RepoFeed instance.
  1064. * @param {Partial<RepoFeed>} [$$source = {}] - The source object to create the RepoFeed.
  1065. */
  1066. constructor($$source = {}) {
  1067. if (!("url" in $$source)) {
  1068. /**
  1069. * 仓库地址(设置中配置)
  1070. * @member
  1071. * @type {string}
  1072. */
  1073. this["url"] = "";
  1074. }
  1075. if (!("desc" in $$source)) {
  1076. /**
  1077. * 项目说明
  1078. * @member
  1079. * @type {string}
  1080. */
  1081. this["desc"] = "";
  1082. }
  1083. if (!("repo" in $$source)) {
  1084. /**
  1085. * owner/repo 短名
  1086. * @member
  1087. * @type {string}
  1088. */
  1089. this["repo"] = "";
  1090. }
  1091. if (!("version" in $$source)) {
  1092. /**
  1093. * 本地已安装版本(设置中配置)
  1094. * @member
  1095. * @type {string}
  1096. */
  1097. this["version"] = "";
  1098. }
  1099. if (!("latest" in $$source)) {
  1100. /**
  1101. * 最新正式 release 版本号,无正式 release 时为空
  1102. * @member
  1103. * @type {string}
  1104. */
  1105. this["latest"] = "";
  1106. }
  1107. if (!("hasUpdate" in $$source)) {
  1108. /**
  1109. * 是否存在可用更新(本地版本低于最新正式 release)
  1110. * @member
  1111. * @type {boolean}
  1112. */
  1113. this["hasUpdate"] = false;
  1114. }
  1115. if (!("releaseURL" in $$source)) {
  1116. /**
  1117. * 最新正式 release 的下载 / 详情页地址
  1118. * @member
  1119. * @type {string}
  1120. */
  1121. this["releaseURL"] = "";
  1122. }
  1123. if (!("newer" in $$source)) {
  1124. /**
  1125. * Latest 之后的版本(Pre-release 等,仅列出不参与更新比较)
  1126. * @member
  1127. * @type {ReleaseItem[]}
  1128. */
  1129. this["newer"] = [];
  1130. }
  1131. if (!("commits" in $$source)) {
  1132. /**
  1133. * 最近提交(最多 5 条)
  1134. * @member
  1135. * @type {CommitItem[]}
  1136. */
  1137. this["commits"] = [];
  1138. }
  1139. if (!("error" in $$source)) {
  1140. /**
  1141. * 抓取失败原因,为空表示正常
  1142. * @member
  1143. * @type {string}
  1144. */
  1145. this["error"] = "";
  1146. }
  1147. Object.assign(this, $$source);
  1148. }
  1149. /**
  1150. * Creates a new RepoFeed instance from a string or object.
  1151. * @param {any} [$$source = {}]
  1152. * @returns {RepoFeed}
  1153. */
  1154. static createFrom($$source = {}) {
  1155. const $$createField7_0 = $$createType12;
  1156. const $$createField8_0 = $$createType14;
  1157. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1158. if ("newer" in $$parsedSource) {
  1159. $$parsedSource["newer"] = $$createField7_0($$parsedSource["newer"]);
  1160. }
  1161. if ("commits" in $$parsedSource) {
  1162. $$parsedSource["commits"] = $$createField8_0($$parsedSource["commits"]);
  1163. }
  1164. return new RepoFeed(/** @type {Partial<RepoFeed>} */($$parsedSource));
  1165. }
  1166. }
  1167. /**
  1168. * RepoItem 关注的 GitHub 仓库条目
  1169. */
  1170. export class RepoItem {
  1171. /**
  1172. * Creates a new RepoItem instance.
  1173. * @param {Partial<RepoItem>} [$$source = {}] - The source object to create the RepoItem.
  1174. */
  1175. constructor($$source = {}) {
  1176. if (!("url" in $$source)) {
  1177. /**
  1178. * 仓库地址,如 https://github.com/wailsapp/wails
  1179. * @member
  1180. * @type {string}
  1181. */
  1182. this["url"] = "";
  1183. }
  1184. if (!("desc" in $$source)) {
  1185. /**
  1186. * 项目说明
  1187. * @member
  1188. * @type {string}
  1189. */
  1190. this["desc"] = "";
  1191. }
  1192. if (!("version" in $$source)) {
  1193. /**
  1194. * 本地已安装版本(用于与最新 release 比较),可为空
  1195. * @member
  1196. * @type {string}
  1197. */
  1198. this["version"] = "";
  1199. }
  1200. Object.assign(this, $$source);
  1201. }
  1202. /**
  1203. * Creates a new RepoItem instance from a string or object.
  1204. * @param {any} [$$source = {}]
  1205. * @returns {RepoItem}
  1206. */
  1207. static createFrom($$source = {}) {
  1208. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1209. return new RepoItem(/** @type {Partial<RepoItem>} */($$parsedSource));
  1210. }
  1211. }
  1212. /**
  1213. * StockQuote 单只股票的行情快照,供前端「股市」页展示
  1214. */
  1215. export class StockQuote {
  1216. /**
  1217. * Creates a new StockQuote instance.
  1218. * @param {Partial<StockQuote>} [$$source = {}] - The source object to create the StockQuote.
  1219. */
  1220. constructor($$source = {}) {
  1221. if (!("code" in $$source)) {
  1222. /**
  1223. * 带市场前缀的代码,如 sh600519
  1224. * @member
  1225. * @type {string}
  1226. */
  1227. this["code"] = "";
  1228. }
  1229. if (!("name" in $$source)) {
  1230. /**
  1231. * 股票名称
  1232. * @member
  1233. * @type {string}
  1234. */
  1235. this["name"] = "";
  1236. }
  1237. if (!("price" in $$source)) {
  1238. /**
  1239. * 当前价
  1240. * @member
  1241. * @type {number}
  1242. */
  1243. this["price"] = 0;
  1244. }
  1245. if (!("change" in $$source)) {
  1246. /**
  1247. * 涨跌额
  1248. * @member
  1249. * @type {number}
  1250. */
  1251. this["change"] = 0;
  1252. }
  1253. if (!("changePercent" in $$source)) {
  1254. /**
  1255. * 涨跌幅(%)
  1256. * @member
  1257. * @type {number}
  1258. */
  1259. this["changePercent"] = 0;
  1260. }
  1261. if (!("amount" in $$source)) {
  1262. /**
  1263. * 成交额(万元)
  1264. * @member
  1265. * @type {number}
  1266. */
  1267. this["amount"] = 0;
  1268. }
  1269. if (!("time" in $$source)) {
  1270. /**
  1271. * 行情时间 HH:MM:SS
  1272. * @member
  1273. * @type {string}
  1274. */
  1275. this["time"] = "";
  1276. }
  1277. Object.assign(this, $$source);
  1278. }
  1279. /**
  1280. * Creates a new StockQuote instance from a string or object.
  1281. * @param {any} [$$source = {}]
  1282. * @returns {StockQuote}
  1283. */
  1284. static createFrom($$source = {}) {
  1285. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1286. return new StockQuote(/** @type {Partial<StockQuote>} */($$parsedSource));
  1287. }
  1288. }
  1289. /**
  1290. * TickerConfig 置顶滚动条(股票 / 新闻)的显示配置
  1291. */
  1292. export class TickerConfig {
  1293. /**
  1294. * Creates a new TickerConfig instance.
  1295. * @param {Partial<TickerConfig>} [$$source = {}] - The source object to create the TickerConfig.
  1296. */
  1297. constructor($$source = {}) {
  1298. if (!("enabled" in $$source)) {
  1299. /**
  1300. * 是否显示滚动条窗口
  1301. * @member
  1302. * @type {boolean}
  1303. */
  1304. this["enabled"] = false;
  1305. }
  1306. if (!("width" in $$source)) {
  1307. /**
  1308. * 窗口宽度(px),0 表示默认 1400
  1309. * @member
  1310. * @type {number}
  1311. */
  1312. this["width"] = 0;
  1313. }
  1314. if (!("fontSize" in $$source)) {
  1315. /**
  1316. * 字号(px)
  1317. * @member
  1318. * @type {number}
  1319. */
  1320. this["fontSize"] = 0;
  1321. }
  1322. if (!("color" in $$source)) {
  1323. /**
  1324. * 文字颜色
  1325. * @member
  1326. * @type {string}
  1327. */
  1328. this["color"] = "";
  1329. }
  1330. if (!("speed" in $$source)) {
  1331. /**
  1332. * 滚动速度(px/s)
  1333. * @member
  1334. * @type {number}
  1335. */
  1336. this["speed"] = 0;
  1337. }
  1338. if (!("transparent" in $$source)) {
  1339. /**
  1340. * 背景透明,不遮挡下方内容
  1341. * @member
  1342. * @type {boolean}
  1343. */
  1344. this["transparent"] = false;
  1345. }
  1346. if (!("x" in $$source)) {
  1347. /**
  1348. * 窗口位置,-1 表示未设置(系统默认位置)
  1349. * @member
  1350. * @type {number}
  1351. */
  1352. this["x"] = 0;
  1353. }
  1354. if (!("y" in $$source)) {
  1355. /**
  1356. * 窗口位置,-1 表示未设置
  1357. * @member
  1358. * @type {number}
  1359. */
  1360. this["y"] = 0;
  1361. }
  1362. Object.assign(this, $$source);
  1363. }
  1364. /**
  1365. * Creates a new TickerConfig instance from a string or object.
  1366. * @param {any} [$$source = {}]
  1367. * @returns {TickerConfig}
  1368. */
  1369. static createFrom($$source = {}) {
  1370. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1371. return new TickerConfig(/** @type {Partial<TickerConfig>} */($$parsedSource));
  1372. }
  1373. }
  1374. /**
  1375. * TranslateResult 一次翻译的结果,供前端展示。
  1376. */
  1377. export class TranslateResult {
  1378. /**
  1379. * Creates a new TranslateResult instance.
  1380. * @param {Partial<TranslateResult>} [$$source = {}] - The source object to create the TranslateResult.
  1381. */
  1382. constructor($$source = {}) {
  1383. if (!("text" in $$source)) {
  1384. /**
  1385. * 翻译结果文本
  1386. * @member
  1387. * @type {string}
  1388. */
  1389. this["text"] = "";
  1390. }
  1391. if (!("detected" in $$source)) {
  1392. /**
  1393. * 检测到的源语言(zh / en)
  1394. * @member
  1395. * @type {string}
  1396. */
  1397. this["detected"] = "";
  1398. }
  1399. if (!("target" in $$source)) {
  1400. /**
  1401. * 目标语言(zh / en)
  1402. * @member
  1403. * @type {string}
  1404. */
  1405. this["target"] = "";
  1406. }
  1407. Object.assign(this, $$source);
  1408. }
  1409. /**
  1410. * Creates a new TranslateResult instance from a string or object.
  1411. * @param {any} [$$source = {}]
  1412. * @returns {TranslateResult}
  1413. */
  1414. static createFrom($$source = {}) {
  1415. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1416. return new TranslateResult(/** @type {Partial<TranslateResult>} */($$parsedSource));
  1417. }
  1418. }
  1419. /**
  1420. * TrendingRepo 一个热门仓库条目(来源可为 GitHub Trending 或 HelloGitHub)
  1421. */
  1422. export class TrendingRepo {
  1423. /**
  1424. * Creates a new TrendingRepo instance.
  1425. * @param {Partial<TrendingRepo>} [$$source = {}] - The source object to create the TrendingRepo.
  1426. */
  1427. constructor($$source = {}) {
  1428. if (!("name" in $$source)) {
  1429. /**
  1430. * owner/repo 短名
  1431. * @member
  1432. * @type {string}
  1433. */
  1434. this["name"] = "";
  1435. }
  1436. if (!("url" in $$source)) {
  1437. /**
  1438. * 仓库主页地址(GitHub 直链)
  1439. * @member
  1440. * @type {string}
  1441. */
  1442. this["url"] = "";
  1443. }
  1444. if (!("desc" in $$source)) {
  1445. /**
  1446. * 简介(英文已自动翻译为中文,翻译失败保留原文)
  1447. * @member
  1448. * @type {string}
  1449. */
  1450. this["desc"] = "";
  1451. }
  1452. if (!("lang" in $$source)) {
  1453. /**
  1454. * 主要语言,无则空
  1455. * @member
  1456. * @type {string}
  1457. */
  1458. this["lang"] = "";
  1459. }
  1460. if (!("stars" in $$source)) {
  1461. /**
  1462. * 总星数(如 "106,375")
  1463. * @member
  1464. * @type {string}
  1465. */
  1466. this["stars"] = "";
  1467. }
  1468. if (!("todayStars" in $$source)) {
  1469. /**
  1470. * 今日新增星数(如 "1,140",无则空)
  1471. * @member
  1472. * @type {string}
  1473. */
  1474. this["todayStars"] = "";
  1475. }
  1476. if (!("forks" in $$source)) {
  1477. /**
  1478. * fork 数(如 "9,365",无则空)
  1479. * @member
  1480. * @type {string}
  1481. */
  1482. this["forks"] = "";
  1483. }
  1484. if (!("source" in $$source)) {
  1485. /**
  1486. * 来源:"github"(GitHub Trending)/ "hellogithub"
  1487. * @member
  1488. * @type {string}
  1489. */
  1490. this["source"] = "";
  1491. }
  1492. if (!("heat" in $$source)) {
  1493. /**
  1494. * 热度(HelloGitHub 点击量,其它来源为空)
  1495. * @member
  1496. * @type {string}
  1497. */
  1498. this["heat"] = "";
  1499. }
  1500. Object.assign(this, $$source);
  1501. }
  1502. /**
  1503. * Creates a new TrendingRepo instance from a string or object.
  1504. * @param {any} [$$source = {}]
  1505. * @returns {TrendingRepo}
  1506. */
  1507. static createFrom($$source = {}) {
  1508. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1509. return new TrendingRepo(/** @type {Partial<TrendingRepo>} */($$parsedSource));
  1510. }
  1511. }
  1512. /**
  1513. * WebServiceInfo 描述一次 Web 服务运行实例的状态,供前端展示。
  1514. */
  1515. export class WebServiceInfo {
  1516. /**
  1517. * Creates a new WebServiceInfo instance.
  1518. * @param {Partial<WebServiceInfo>} [$$source = {}] - The source object to create the WebServiceInfo.
  1519. */
  1520. constructor($$source = {}) {
  1521. if (!("running" in $$source)) {
  1522. /**
  1523. * 是否运行中
  1524. * @member
  1525. * @type {boolean}
  1526. */
  1527. this["running"] = false;
  1528. }
  1529. if (!("dir" in $$source)) {
  1530. /**
  1531. * 服务目录
  1532. * @member
  1533. * @type {string}
  1534. */
  1535. this["dir"] = "";
  1536. }
  1537. if (!("url" in $$source)) {
  1538. /**
  1539. * 访问地址 http://127.0.0.1:port/
  1540. * @member
  1541. * @type {string}
  1542. */
  1543. this["url"] = "";
  1544. }
  1545. if (!("indexName" in $$source)) {
  1546. /**
  1547. * 实际用作默认页的文件(index.html / readme.md / 空)
  1548. * @member
  1549. * @type {string}
  1550. */
  1551. this["indexName"] = "";
  1552. }
  1553. if (!("startedAt" in $$source)) {
  1554. /**
  1555. * 启动时间
  1556. * @member
  1557. * @type {string}
  1558. */
  1559. this["startedAt"] = "";
  1560. }
  1561. if (!("error" in $$source)) {
  1562. /**
  1563. * 最近一次错误
  1564. * @member
  1565. * @type {string}
  1566. */
  1567. this["error"] = "";
  1568. }
  1569. if (!("connections" in $$source)) {
  1570. /**
  1571. * 累计请求次数
  1572. * @member
  1573. * @type {number}
  1574. */
  1575. this["connections"] = 0;
  1576. }
  1577. Object.assign(this, $$source);
  1578. }
  1579. /**
  1580. * Creates a new WebServiceInfo instance from a string or object.
  1581. * @param {any} [$$source = {}]
  1582. * @returns {WebServiceInfo}
  1583. */
  1584. static createFrom($$source = {}) {
  1585. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1586. return new WebServiceInfo(/** @type {Partial<WebServiceInfo>} */($$parsedSource));
  1587. }
  1588. }
  1589. // Private type creation functions
  1590. const $$createType0 = $Create.Array($Create.Any);
  1591. const $$createType1 = LinkItem.createFrom;
  1592. const $$createType2 = $Create.Array($$createType1);
  1593. const $$createType3 = RepoItem.createFrom;
  1594. const $$createType4 = $Create.Array($$createType3);
  1595. const $$createType5 = CustomTab.createFrom;
  1596. const $$createType6 = $Create.Array($$createType5);
  1597. const $$createType7 = TickerConfig.createFrom;
  1598. const $$createType8 = PoemConfig.createFrom;
  1599. const $$createType9 = MinutePoint.createFrom;
  1600. const $$createType10 = $Create.Array($$createType9);
  1601. const $$createType11 = ReleaseItem.createFrom;
  1602. const $$createType12 = $Create.Array($$createType11);
  1603. const $$createType13 = CommitItem.createFrom;
  1604. const $$createType14 = $Create.Array($$createType13);