models.js 45 KB

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