models.js 50 KB

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