models.js 51 KB

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