models.js 44 KB

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