models.js 51 KB

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