models.js 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671
  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 (!("startCompact" in $$source)) {
  94. /**
  95. * 启动时自动收拢为圆点(窗口缩小)
  96. * @member
  97. * @type {boolean}
  98. */
  99. this["startCompact"] = false;
  100. }
  101. if (!("windowWidth" in $$source)) {
  102. /**
  103. * 主窗口宽度(px),随窗口调整自动保存
  104. * @member
  105. * @type {number}
  106. */
  107. this["windowWidth"] = 0;
  108. }
  109. if (!("windowHeight" in $$source)) {
  110. /**
  111. * 主窗口高度(px),随窗口调整自动保存
  112. * @member
  113. * @type {number}
  114. */
  115. this["windowHeight"] = 0;
  116. }
  117. if (!("hotkey" in $$source)) {
  118. /**
  119. * 呼出(显示)窗口的全局热键
  120. * @member
  121. * @type {string}
  122. */
  123. this["hotkey"] = "";
  124. }
  125. if (!("tabOrder" in $$source)) {
  126. /**
  127. * Tab 显示顺序(tabId 列表,未列出的追加到末尾)
  128. * @member
  129. * @type {string[]}
  130. */
  131. this["tabOrder"] = [];
  132. }
  133. if (!("stockCodes" in $$source)) {
  134. /**
  135. * 股市页展示的股票代码列表
  136. * @member
  137. * @type {string[]}
  138. */
  139. this["stockCodes"] = [];
  140. }
  141. if (!("links" in $$source)) {
  142. /**
  143. * 常用网址列表
  144. * @member
  145. * @type {LinkItem[]}
  146. */
  147. this["links"] = [];
  148. }
  149. if (!("newsKeywords" in $$source)) {
  150. /**
  151. * 新闻关注关键词,逗号分隔
  152. * @member
  153. * @type {string}
  154. */
  155. this["newsKeywords"] = "";
  156. }
  157. if (!("biliCookie" in $$source)) {
  158. /**
  159. * B站登录 cookie(含 SESSDATA),用于抓取「关注的人最新动态」
  160. * @member
  161. * @type {string}
  162. */
  163. this["biliCookie"] = "";
  164. }
  165. if (!("githubRepos" in $$source)) {
  166. /**
  167. * 关注的 GitHub 仓库列表
  168. * @member
  169. * @type {RepoItem[]}
  170. */
  171. this["githubRepos"] = [];
  172. }
  173. if (!("customTabs" in $$source)) {
  174. /**
  175. * 用户自定义 Tab 页面(名字 + 网址)
  176. * @member
  177. * @type {CustomTab[]}
  178. */
  179. this["customTabs"] = [];
  180. }
  181. if (!("localTools" in $$source)) {
  182. /**
  183. * 「本地」页资源(标题|启动命令|说明,在设置中维护)
  184. * @member
  185. * @type {LocalTool[]}
  186. */
  187. this["localTools"] = [];
  188. }
  189. if (!("controlKeys" in $$source)) {
  190. /**
  191. * 控制页按键配置(前 5 键固定 上/下/左/右/休眠,第 6 键起为额外按键)
  192. * @member
  193. * @type {ControlKeyConfig[]}
  194. */
  195. this["controlKeys"] = [];
  196. }
  197. if (!("controlRepeatSecs" in $$source)) {
  198. /**
  199. * 控制页长按连发频率(秒,0.0-10.0,默认 1.0)
  200. * @member
  201. * @type {number}
  202. */
  203. this["controlRepeatSecs"] = 0;
  204. }
  205. if (!("apiAddr" in $$source)) {
  206. /**
  207. * 内置 API 服务监听地址
  208. * @member
  209. * @type {string}
  210. */
  211. this["apiAddr"] = "";
  212. }
  213. if (!("serviceAddr" in $$source)) {
  214. /**
  215. * Windows 服务模式(--service)监听地址,仅电源类接口
  216. * @member
  217. * @type {string}
  218. */
  219. this["serviceAddr"] = "";
  220. }
  221. if (!("apiAutoStart" in $$source)) {
  222. /**
  223. * 应用启动时自动启动内置 API 服务(默认开启)
  224. * @member
  225. * @type {boolean}
  226. */
  227. this["apiAutoStart"] = false;
  228. }
  229. if (!("uploadPassword" in $$source)) {
  230. /**
  231. * 文件上传密码(空=不启用上传/下载接口)
  232. * @member
  233. * @type {string}
  234. */
  235. this["uploadPassword"] = "";
  236. }
  237. if (!("uploadDir" in $$source)) {
  238. /**
  239. * 文件上传保存目录(空=用户配置目录/uploads)
  240. * @member
  241. * @type {string}
  242. */
  243. this["uploadDir"] = "";
  244. }
  245. if (!("uploadMaxSize" in $$source)) {
  246. /**
  247. * 单个上传文件大小上限(MB),<=0 用默认 512
  248. * @member
  249. * @type {number}
  250. */
  251. this["uploadMaxSize"] = 0;
  252. }
  253. if (!("todoPath" in $$source)) {
  254. /**
  255. * 待办(TODO)文件路径
  256. * @member
  257. * @type {string}
  258. */
  259. this["todoPath"] = "";
  260. }
  261. if (!("recordPath" in $$source)) {
  262. /**
  263. * 记录(Record)文件路径:每行「姓名|名称|值」(保留兼容)
  264. * @member
  265. * @type {string}
  266. */
  267. this["recordPath"] = "";
  268. }
  269. if (!("recordDBPath" in $$source)) {
  270. /**
  271. * 记录数据库路径:SQLite3 数据库文件(记录 Tab 实际存储)
  272. * @member
  273. * @type {string}
  274. */
  275. this["recordDBPath"] = "";
  276. }
  277. if (!("backupDir" in $$source)) {
  278. /**
  279. * 文本文件备份目录(文件类自定义 Tab「备份」按钮使用)
  280. * @member
  281. * @type {string}
  282. */
  283. this["backupDir"] = "";
  284. }
  285. if (!("stockTicker" in $$source)) {
  286. /**
  287. * 股票滚动条配置
  288. * @member
  289. * @type {TickerConfig}
  290. */
  291. this["stockTicker"] = (new TickerConfig());
  292. }
  293. if (!("newsTicker" in $$source)) {
  294. /**
  295. * 新闻滚动条配置
  296. * @member
  297. * @type {TickerConfig}
  298. */
  299. this["newsTicker"] = (new TickerConfig());
  300. }
  301. if (!("poem" in $$source)) {
  302. /**
  303. * 随机古诗显示配置
  304. * @member
  305. * @type {PoemConfig}
  306. */
  307. this["poem"] = (new PoemConfig());
  308. }
  309. if (!("mouseAlert" in $$source)) {
  310. /**
  311. * 系统级鼠标提醒气泡配置
  312. * @member
  313. * @type {MouseAlertConfig}
  314. */
  315. this["mouseAlert"] = (new MouseAlertConfig());
  316. }
  317. if (!("browserPath" in $$source)) {
  318. /**
  319. * 指定浏览器 exe 路径(空=系统默认浏览器)
  320. * @member
  321. * @type {string}
  322. */
  323. this["browserPath"] = "";
  324. }
  325. if (!("ledColor" in $$source)) {
  326. /**
  327. * LED 滚动文字点阵颜色(如 #ff4d4d)
  328. * @member
  329. * @type {string}
  330. */
  331. this["ledColor"] = "";
  332. }
  333. if (!("stockUpColor" in $$source)) {
  334. /**
  335. * 股票上涨颜色
  336. * @member
  337. * @type {string}
  338. */
  339. this["stockUpColor"] = "";
  340. }
  341. if (!("stockDownColor" in $$source)) {
  342. /**
  343. * 股票下跌颜色
  344. * @member
  345. * @type {string}
  346. */
  347. this["stockDownColor"] = "";
  348. }
  349. if (!("stockRefreshSecs" in $$source)) {
  350. /**
  351. * 股市自动刷新间隔(秒)
  352. * @member
  353. * @type {number}
  354. */
  355. this["stockRefreshSecs"] = 0;
  356. }
  357. if (!("stockClosedRefreshSecs" in $$source)) {
  358. /**
  359. * 股市休市时自动刷新间隔(秒)
  360. * @member
  361. * @type {number}
  362. */
  363. this["stockClosedRefreshSecs"] = 0;
  364. }
  365. if (!("newsRefreshMinutes" in $$source)) {
  366. /**
  367. * 新闻自动刷新间隔(分钟)
  368. * @member
  369. * @type {number}
  370. */
  371. this["newsRefreshMinutes"] = 0;
  372. }
  373. if (!("newsCount" in $$source)) {
  374. /**
  375. * 新闻页显示条数
  376. * @member
  377. * @type {number}
  378. */
  379. this["newsCount"] = 0;
  380. }
  381. if (!("githubRefreshMinutes" in $$source)) {
  382. /**
  383. * Github 自动刷新间隔(分钟)
  384. * @member
  385. * @type {number}
  386. */
  387. this["githubRefreshMinutes"] = 0;
  388. }
  389. if (!("fontDelta" in $$source)) {
  390. /**
  391. * 全局字号偏移(px),+-3 范围内调整
  392. * @member
  393. * @type {number}
  394. */
  395. this["fontDelta"] = 0;
  396. }
  397. if (!("localSend" in $$source)) {
  398. /**
  399. * LocalSend 文件互传配置(本机名/接收目录/接收模式等)
  400. * @member
  401. * @type {LocalSendConfig}
  402. */
  403. this["localSend"] = (new LocalSendConfig());
  404. }
  405. if (!("croc" in $$source)) {
  406. /**
  407. * Croc 传送配置(发送/接收共用密码)
  408. * @member
  409. * @type {CrocConfig}
  410. */
  411. this["croc"] = (new CrocConfig());
  412. }
  413. if (!("ytdlp" in $$source)) {
  414. /**
  415. * 视频下载配置(yt-dlp 保存目录)
  416. * @member
  417. * @type {YTDLPConfig}
  418. */
  419. this["ytdlp"] = (new YTDLPConfig());
  420. }
  421. if (!("memos" in $$source)) {
  422. /**
  423. * Memos 速记配置(地址/访问令牌)
  424. * @member
  425. * @type {MemosConfig}
  426. */
  427. this["memos"] = (new MemosConfig());
  428. }
  429. if (!("brightness" in $$source)) {
  430. /**
  431. * 显示器亮度配置(记住亮度、启动恢复)
  432. * @member
  433. * @type {BrightnessConfig}
  434. */
  435. this["brightness"] = (new BrightnessConfig());
  436. }
  437. if (!("toolOrder" in $$source)) {
  438. /**
  439. * 工具页卡片显示顺序(工具 id 列表,未列出的追加到末尾)
  440. * @member
  441. * @type {string[]}
  442. */
  443. this["toolOrder"] = [];
  444. }
  445. Object.assign(this, $$source);
  446. }
  447. /**
  448. * Creates a new AppSettings instance from a string or object.
  449. * @param {any} [$$source = {}]
  450. * @returns {AppSettings}
  451. */
  452. static createFrom($$source = {}) {
  453. const $$createField7_0 = $$createType0;
  454. const $$createField8_0 = $$createType0;
  455. const $$createField9_0 = $$createType2;
  456. const $$createField12_0 = $$createType4;
  457. const $$createField13_0 = $$createType6;
  458. const $$createField14_0 = $$createType8;
  459. const $$createField15_0 = $$createType10;
  460. const $$createField27_0 = $$createType11;
  461. const $$createField28_0 = $$createType11;
  462. const $$createField29_0 = $$createType12;
  463. const $$createField30_0 = $$createType13;
  464. const $$createField41_0 = $$createType14;
  465. const $$createField42_0 = $$createType15;
  466. const $$createField43_0 = $$createType16;
  467. const $$createField44_0 = $$createType17;
  468. const $$createField45_0 = $$createType18;
  469. const $$createField46_0 = $$createType0;
  470. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  471. if ("tabOrder" in $$parsedSource) {
  472. $$parsedSource["tabOrder"] = $$createField7_0($$parsedSource["tabOrder"]);
  473. }
  474. if ("stockCodes" in $$parsedSource) {
  475. $$parsedSource["stockCodes"] = $$createField8_0($$parsedSource["stockCodes"]);
  476. }
  477. if ("links" in $$parsedSource) {
  478. $$parsedSource["links"] = $$createField9_0($$parsedSource["links"]);
  479. }
  480. if ("githubRepos" in $$parsedSource) {
  481. $$parsedSource["githubRepos"] = $$createField12_0($$parsedSource["githubRepos"]);
  482. }
  483. if ("customTabs" in $$parsedSource) {
  484. $$parsedSource["customTabs"] = $$createField13_0($$parsedSource["customTabs"]);
  485. }
  486. if ("localTools" in $$parsedSource) {
  487. $$parsedSource["localTools"] = $$createField14_0($$parsedSource["localTools"]);
  488. }
  489. if ("controlKeys" in $$parsedSource) {
  490. $$parsedSource["controlKeys"] = $$createField15_0($$parsedSource["controlKeys"]);
  491. }
  492. if ("stockTicker" in $$parsedSource) {
  493. $$parsedSource["stockTicker"] = $$createField27_0($$parsedSource["stockTicker"]);
  494. }
  495. if ("newsTicker" in $$parsedSource) {
  496. $$parsedSource["newsTicker"] = $$createField28_0($$parsedSource["newsTicker"]);
  497. }
  498. if ("poem" in $$parsedSource) {
  499. $$parsedSource["poem"] = $$createField29_0($$parsedSource["poem"]);
  500. }
  501. if ("mouseAlert" in $$parsedSource) {
  502. $$parsedSource["mouseAlert"] = $$createField30_0($$parsedSource["mouseAlert"]);
  503. }
  504. if ("localSend" in $$parsedSource) {
  505. $$parsedSource["localSend"] = $$createField41_0($$parsedSource["localSend"]);
  506. }
  507. if ("croc" in $$parsedSource) {
  508. $$parsedSource["croc"] = $$createField42_0($$parsedSource["croc"]);
  509. }
  510. if ("ytdlp" in $$parsedSource) {
  511. $$parsedSource["ytdlp"] = $$createField43_0($$parsedSource["ytdlp"]);
  512. }
  513. if ("memos" in $$parsedSource) {
  514. $$parsedSource["memos"] = $$createField44_0($$parsedSource["memos"]);
  515. }
  516. if ("brightness" in $$parsedSource) {
  517. $$parsedSource["brightness"] = $$createField45_0($$parsedSource["brightness"]);
  518. }
  519. if ("toolOrder" in $$parsedSource) {
  520. $$parsedSource["toolOrder"] = $$createField46_0($$parsedSource["toolOrder"]);
  521. }
  522. return new AppSettings(/** @type {Partial<AppSettings>} */($$parsedSource));
  523. }
  524. }
  525. /**
  526. * BiliDynamicItem 一条 B站动态,供「新闻」页展示
  527. */
  528. export class BiliDynamicItem {
  529. /**
  530. * Creates a new BiliDynamicItem instance.
  531. * @param {Partial<BiliDynamicItem>} [$$source = {}] - The source object to create the BiliDynamicItem.
  532. */
  533. constructor($$source = {}) {
  534. if (!("source" in $$source)) {
  535. /**
  536. * 来源:B站动态
  537. * @member
  538. * @type {string}
  539. */
  540. this["source"] = "";
  541. }
  542. if (!("title" in $$source)) {
  543. /**
  544. * 标题(动态文案或视频标题)
  545. * @member
  546. * @type {string}
  547. */
  548. this["title"] = "";
  549. }
  550. if (!("url" in $$source)) {
  551. /**
  552. * 详情页地址
  553. * @member
  554. * @type {string}
  555. */
  556. this["url"] = "";
  557. }
  558. if (!("matched" in $$source)) {
  559. /**
  560. * 是否命中关注关键词
  561. * @member
  562. * @type {boolean}
  563. */
  564. this["matched"] = false;
  565. }
  566. Object.assign(this, $$source);
  567. }
  568. /**
  569. * Creates a new BiliDynamicItem instance from a string or object.
  570. * @param {any} [$$source = {}]
  571. * @returns {BiliDynamicItem}
  572. */
  573. static createFrom($$source = {}) {
  574. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  575. return new BiliDynamicItem(/** @type {Partial<BiliDynamicItem>} */($$parsedSource));
  576. }
  577. }
  578. /**
  579. * BiliFeedResult B站动态抓取结果:列表 + 需要提示用户的说明(如 cookie 过期后回退热门)
  580. */
  581. export class BiliFeedResult {
  582. /**
  583. * Creates a new BiliFeedResult instance.
  584. * @param {Partial<BiliFeedResult>} [$$source = {}] - The source object to create the BiliFeedResult.
  585. */
  586. constructor($$source = {}) {
  587. if (!("items" in $$source)) {
  588. /**
  589. * @member
  590. * @type {BiliDynamicItem[]}
  591. */
  592. this["items"] = [];
  593. }
  594. if (!("notice" in $$source)) {
  595. /**
  596. * @member
  597. * @type {string}
  598. */
  599. this["notice"] = "";
  600. }
  601. Object.assign(this, $$source);
  602. }
  603. /**
  604. * Creates a new BiliFeedResult instance from a string or object.
  605. * @param {any} [$$source = {}]
  606. * @returns {BiliFeedResult}
  607. */
  608. static createFrom($$source = {}) {
  609. const $$createField0_0 = $$createType20;
  610. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  611. if ("items" in $$parsedSource) {
  612. $$parsedSource["items"] = $$createField0_0($$parsedSource["items"]);
  613. }
  614. return new BiliFeedResult(/** @type {Partial<BiliFeedResult>} */($$parsedSource));
  615. }
  616. }
  617. /**
  618. * BrightnessConfig 显示器亮度配置:记住各显示器亮度(按显示器名称),供启动时恢复
  619. */
  620. export class BrightnessConfig {
  621. /**
  622. * Creates a new BrightnessConfig instance.
  623. * @param {Partial<BrightnessConfig>} [$$source = {}] - The source object to create the BrightnessConfig.
  624. */
  625. constructor($$source = {}) {
  626. if (!("restoreOnStart" in $$source)) {
  627. /**
  628. * 启动应用时恢复上次亮度
  629. * @member
  630. * @type {boolean}
  631. */
  632. this["restoreOnStart"] = false;
  633. }
  634. if (!("levels" in $$source)) {
  635. /**
  636. * 显示器名称 -> 亮度百分比(0-100)
  637. * @member
  638. * @type {{ [_ in string]?: number }}
  639. */
  640. this["levels"] = {};
  641. }
  642. Object.assign(this, $$source);
  643. }
  644. /**
  645. * Creates a new BrightnessConfig instance from a string or object.
  646. * @param {any} [$$source = {}]
  647. * @returns {BrightnessConfig}
  648. */
  649. static createFrom($$source = {}) {
  650. const $$createField1_0 = $$createType21;
  651. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  652. if ("levels" in $$parsedSource) {
  653. $$parsedSource["levels"] = $$createField1_0($$parsedSource["levels"]);
  654. }
  655. return new BrightnessConfig(/** @type {Partial<BrightnessConfig>} */($$parsedSource));
  656. }
  657. }
  658. /**
  659. * CommitItem 仓库的一条提交记录
  660. */
  661. export class CommitItem {
  662. /**
  663. * Creates a new CommitItem instance.
  664. * @param {Partial<CommitItem>} [$$source = {}] - The source object to create the CommitItem.
  665. */
  666. constructor($$source = {}) {
  667. if (!("title" in $$source)) {
  668. /**
  669. * 提交标题(首行)
  670. * @member
  671. * @type {string}
  672. */
  673. this["title"] = "";
  674. }
  675. if (!("url" in $$source)) {
  676. /**
  677. * 提交详情页地址
  678. * @member
  679. * @type {string}
  680. */
  681. this["url"] = "";
  682. }
  683. if (!("updated" in $$source)) {
  684. /**
  685. * 提交时间(MM-DD HH:MM)
  686. * @member
  687. * @type {string}
  688. */
  689. this["updated"] = "";
  690. }
  691. Object.assign(this, $$source);
  692. }
  693. /**
  694. * Creates a new CommitItem instance from a string or object.
  695. * @param {any} [$$source = {}]
  696. * @returns {CommitItem}
  697. */
  698. static createFrom($$source = {}) {
  699. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  700. return new CommitItem(/** @type {Partial<CommitItem>} */($$parsedSource));
  701. }
  702. }
  703. /**
  704. * ControlKeyConfig 控制页方向盘单个按键配置(图标 + 命令 URL)
  705. */
  706. export class ControlKeyConfig {
  707. /**
  708. * Creates a new ControlKeyConfig instance.
  709. * @param {Partial<ControlKeyConfig>} [$$source = {}] - The source object to create the ControlKeyConfig.
  710. */
  711. constructor($$source = {}) {
  712. if (!("icon" in $$source)) {
  713. /**
  714. * 按钮显示字符,如 ↑、↓、←、→、休眠
  715. * @member
  716. * @type {string}
  717. */
  718. this["icon"] = "";
  719. }
  720. if (!("cmd" in $$source)) {
  721. /**
  722. * 点击时 GET 请求的完整 URL;空则回退旧指令信箱模式
  723. * @member
  724. * @type {string}
  725. */
  726. this["cmd"] = "";
  727. }
  728. Object.assign(this, $$source);
  729. }
  730. /**
  731. * Creates a new ControlKeyConfig instance from a string or object.
  732. * @param {any} [$$source = {}]
  733. * @returns {ControlKeyConfig}
  734. */
  735. static createFrom($$source = {}) {
  736. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  737. return new ControlKeyConfig(/** @type {Partial<ControlKeyConfig>} */($$parsedSource));
  738. }
  739. }
  740. /**
  741. * CrocConfig 是 Croc 传送的配置(发送/接收共用密码)。
  742. */
  743. export class CrocConfig {
  744. /**
  745. * Creates a new CrocConfig instance.
  746. * @param {Partial<CrocConfig>} [$$source = {}] - The source object to create the CrocConfig.
  747. */
  748. constructor($$source = {}) {
  749. if (!("password" in $$source)) {
  750. /**
  751. * 发送/接收共用密码:作为 croc 传输码(--code),空=使用随机传输码
  752. * @member
  753. * @type {string}
  754. */
  755. this["password"] = "";
  756. }
  757. if (!("dir" in $$source)) {
  758. /**
  759. * 接收保存目录,空=当前工作目录
  760. * @member
  761. * @type {string}
  762. */
  763. this["dir"] = "";
  764. }
  765. Object.assign(this, $$source);
  766. }
  767. /**
  768. * Creates a new CrocConfig instance from a string or object.
  769. * @param {any} [$$source = {}]
  770. * @returns {CrocConfig}
  771. */
  772. static createFrom($$source = {}) {
  773. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  774. return new CrocConfig(/** @type {Partial<CrocConfig>} */($$parsedSource));
  775. }
  776. }
  777. /**
  778. * CrocInfo 描述本机 croc 的可用性,用于前端决定是否展示工具卡片。
  779. */
  780. export class CrocInfo {
  781. /**
  782. * Creates a new CrocInfo instance.
  783. * @param {Partial<CrocInfo>} [$$source = {}] - The source object to create the CrocInfo.
  784. */
  785. constructor($$source = {}) {
  786. if (!("available" in $$source)) {
  787. /**
  788. * PATH 中是否找到 croc
  789. * @member
  790. * @type {boolean}
  791. */
  792. this["available"] = false;
  793. }
  794. if (!("path" in $$source)) {
  795. /**
  796. * croc 可执行文件路径
  797. * @member
  798. * @type {string}
  799. */
  800. this["path"] = "";
  801. }
  802. if (!("version" in $$source)) {
  803. /**
  804. * 版本信息(croc --version 输出)
  805. * @member
  806. * @type {string}
  807. */
  808. this["version"] = "";
  809. }
  810. Object.assign(this, $$source);
  811. }
  812. /**
  813. * Creates a new CrocInfo instance from a string or object.
  814. * @param {any} [$$source = {}]
  815. * @returns {CrocInfo}
  816. */
  817. static createFrom($$source = {}) {
  818. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  819. return new CrocInfo(/** @type {Partial<CrocInfo>} */($$parsedSource));
  820. }
  821. }
  822. /**
  823. * CustomTab 用户自定义 Tab 页面
  824. */
  825. export class CustomTab {
  826. /**
  827. * Creates a new CustomTab instance.
  828. * @param {Partial<CustomTab>} [$$source = {}] - The source object to create the CustomTab.
  829. */
  830. constructor($$source = {}) {
  831. if (!("name" in $$source)) {
  832. /**
  833. * 页面名称(Tab 按钮显示文字)
  834. * @member
  835. * @type {string}
  836. */
  837. this["name"] = "";
  838. }
  839. if (!("url" in $$source)) {
  840. /**
  841. * 页面地址(iframe 加载)
  842. * @member
  843. * @type {string}
  844. */
  845. this["url"] = "";
  846. }
  847. if (!("desc" in $$source)) {
  848. /**
  849. * 备注/提示信息(可空),Tab 说明文字优先显示
  850. * @member
  851. * @type {string}
  852. */
  853. this["desc"] = "";
  854. }
  855. Object.assign(this, $$source);
  856. }
  857. /**
  858. * Creates a new CustomTab instance from a string or object.
  859. * @param {any} [$$source = {}]
  860. * @returns {CustomTab}
  861. */
  862. static createFrom($$source = {}) {
  863. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  864. return new CustomTab(/** @type {Partial<CustomTab>} */($$parsedSource));
  865. }
  866. }
  867. /**
  868. * KLineBar 日 K 的一根柱子
  869. */
  870. export class KLineBar {
  871. /**
  872. * Creates a new KLineBar instance.
  873. * @param {Partial<KLineBar>} [$$source = {}] - The source object to create the KLineBar.
  874. */
  875. constructor($$source = {}) {
  876. if (!("date" in $$source)) {
  877. /**
  878. * 交易日
  879. * @member
  880. * @type {string}
  881. */
  882. this["date"] = "";
  883. }
  884. if (!("open" in $$source)) {
  885. /**
  886. * 开盘价
  887. * @member
  888. * @type {number}
  889. */
  890. this["open"] = 0;
  891. }
  892. if (!("close" in $$source)) {
  893. /**
  894. * 收盘价
  895. * @member
  896. * @type {number}
  897. */
  898. this["close"] = 0;
  899. }
  900. if (!("high" in $$source)) {
  901. /**
  902. * 最高价
  903. * @member
  904. * @type {number}
  905. */
  906. this["high"] = 0;
  907. }
  908. if (!("low" in $$source)) {
  909. /**
  910. * 最低价
  911. * @member
  912. * @type {number}
  913. */
  914. this["low"] = 0;
  915. }
  916. if (!("volume" in $$source)) {
  917. /**
  918. * 成交量(手)
  919. * @member
  920. * @type {number}
  921. */
  922. this["volume"] = 0;
  923. }
  924. Object.assign(this, $$source);
  925. }
  926. /**
  927. * Creates a new KLineBar instance from a string or object.
  928. * @param {any} [$$source = {}]
  929. * @returns {KLineBar}
  930. */
  931. static createFrom($$source = {}) {
  932. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  933. return new KLineBar(/** @type {Partial<KLineBar>} */($$parsedSource));
  934. }
  935. }
  936. /**
  937. * LinkItem 常用网址条目
  938. */
  939. export class LinkItem {
  940. /**
  941. * Creates a new LinkItem instance.
  942. * @param {Partial<LinkItem>} [$$source = {}] - The source object to create the LinkItem.
  943. */
  944. constructor($$source = {}) {
  945. if (!("name" in $$source)) {
  946. /**
  947. * 网站名称
  948. * @member
  949. * @type {string}
  950. */
  951. this["name"] = "";
  952. }
  953. if (!("url" in $$source)) {
  954. /**
  955. * 网站地址
  956. * @member
  957. * @type {string}
  958. */
  959. this["url"] = "";
  960. }
  961. Object.assign(this, $$source);
  962. }
  963. /**
  964. * Creates a new LinkItem instance from a string or object.
  965. * @param {any} [$$source = {}]
  966. * @returns {LinkItem}
  967. */
  968. static createFrom($$source = {}) {
  969. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  970. return new LinkItem(/** @type {Partial<LinkItem>} */($$parsedSource));
  971. }
  972. }
  973. /**
  974. * LocalSendConfig 是 LocalSend 的运行时配置。
  975. */
  976. export class LocalSendConfig {
  977. /**
  978. * Creates a new LocalSendConfig instance.
  979. * @param {Partial<LocalSendConfig>} [$$source = {}] - The source object to create the LocalSendConfig.
  980. */
  981. constructor($$source = {}) {
  982. if (!("enabled" in $$source)) {
  983. /**
  984. * 是否已启动服务
  985. * @member
  986. * @type {boolean}
  987. */
  988. this["enabled"] = false;
  989. }
  990. if (!("alias" in $$source)) {
  991. /**
  992. * 本机名称(广播给其他设备)
  993. * @member
  994. * @type {string}
  995. */
  996. this["alias"] = "";
  997. }
  998. if (!("receiveDir" in $$source)) {
  999. /**
  1000. * 接收文件保存目录
  1001. * @member
  1002. * @type {string}
  1003. */
  1004. this["receiveDir"] = "";
  1005. }
  1006. if (!("autoAccept" in $$source)) {
  1007. /**
  1008. * true=自动接收;false=手动确认
  1009. * @member
  1010. * @type {boolean}
  1011. */
  1012. this["autoAccept"] = false;
  1013. }
  1014. if (!("port" in $$source)) {
  1015. /**
  1016. * 监听端口
  1017. * @member
  1018. * @type {number}
  1019. */
  1020. this["port"] = 0;
  1021. }
  1022. if (!("fingerprint" in $$source)) {
  1023. /**
  1024. * 本机证书指纹
  1025. * @member
  1026. * @type {string}
  1027. */
  1028. this["fingerprint"] = "";
  1029. }
  1030. Object.assign(this, $$source);
  1031. }
  1032. /**
  1033. * Creates a new LocalSendConfig instance from a string or object.
  1034. * @param {any} [$$source = {}]
  1035. * @returns {LocalSendConfig}
  1036. */
  1037. static createFrom($$source = {}) {
  1038. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1039. return new LocalSendConfig(/** @type {Partial<LocalSendConfig>} */($$parsedSource));
  1040. }
  1041. }
  1042. /**
  1043. * LocalTool 本地资源/工具配置项(「本地」页,在设置中维护)
  1044. */
  1045. export class LocalTool {
  1046. /**
  1047. * Creates a new LocalTool instance.
  1048. * @param {Partial<LocalTool>} [$$source = {}] - The source object to create the LocalTool.
  1049. */
  1050. constructor($$source = {}) {
  1051. if (!("title" in $$source)) {
  1052. /**
  1053. * 显示标题
  1054. * @member
  1055. * @type {string}
  1056. */
  1057. this["title"] = "";
  1058. }
  1059. if (!("cmd" in $$source)) {
  1060. /**
  1061. * 启动命令(程序/脚本,可带参数与环境变量)
  1062. * @member
  1063. * @type {string}
  1064. */
  1065. this["cmd"] = "";
  1066. }
  1067. if (!("desc" in $$source)) {
  1068. /**
  1069. * 说明文字(可空)
  1070. * @member
  1071. * @type {string}
  1072. */
  1073. this["desc"] = "";
  1074. }
  1075. Object.assign(this, $$source);
  1076. }
  1077. /**
  1078. * Creates a new LocalTool instance from a string or object.
  1079. * @param {any} [$$source = {}]
  1080. * @returns {LocalTool}
  1081. */
  1082. static createFrom($$source = {}) {
  1083. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1084. return new LocalTool(/** @type {Partial<LocalTool>} */($$parsedSource));
  1085. }
  1086. }
  1087. /**
  1088. * MemosConfig 保存 Memos 速记所需的配置。
  1089. */
  1090. export class MemosConfig {
  1091. /**
  1092. * Creates a new MemosConfig instance.
  1093. * @param {Partial<MemosConfig>} [$$source = {}] - The source object to create the MemosConfig.
  1094. */
  1095. constructor($$source = {}) {
  1096. if (!("url" in $$source)) {
  1097. /**
  1098. * 实例地址,如 https://m.scwy.net
  1099. * @member
  1100. * @type {string}
  1101. */
  1102. this["url"] = "";
  1103. }
  1104. if (!("token" in $$source)) {
  1105. /**
  1106. * 个人访问令牌(PAT),只存本地
  1107. * @member
  1108. * @type {string}
  1109. */
  1110. this["token"] = "";
  1111. }
  1112. Object.assign(this, $$source);
  1113. }
  1114. /**
  1115. * Creates a new MemosConfig instance from a string or object.
  1116. * @param {any} [$$source = {}]
  1117. * @returns {MemosConfig}
  1118. */
  1119. static createFrom($$source = {}) {
  1120. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1121. return new MemosConfig(/** @type {Partial<MemosConfig>} */($$parsedSource));
  1122. }
  1123. }
  1124. /**
  1125. * MinuteChart 分时图数据
  1126. */
  1127. export class MinuteChart {
  1128. /**
  1129. * Creates a new MinuteChart instance.
  1130. * @param {Partial<MinuteChart>} [$$source = {}] - The source object to create the MinuteChart.
  1131. */
  1132. constructor($$source = {}) {
  1133. if (!("code" in $$source)) {
  1134. /**
  1135. * 股票代码
  1136. * @member
  1137. * @type {string}
  1138. */
  1139. this["code"] = "";
  1140. }
  1141. if (!("prevClose" in $$source)) {
  1142. /**
  1143. * 昨收,作为分时基准线
  1144. * @member
  1145. * @type {number}
  1146. */
  1147. this["prevClose"] = 0;
  1148. }
  1149. if (!("points" in $$source)) {
  1150. /**
  1151. * 分时点序列
  1152. * @member
  1153. * @type {MinutePoint[]}
  1154. */
  1155. this["points"] = [];
  1156. }
  1157. Object.assign(this, $$source);
  1158. }
  1159. /**
  1160. * Creates a new MinuteChart instance from a string or object.
  1161. * @param {any} [$$source = {}]
  1162. * @returns {MinuteChart}
  1163. */
  1164. static createFrom($$source = {}) {
  1165. const $$createField2_0 = $$createType23;
  1166. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1167. if ("points" in $$parsedSource) {
  1168. $$parsedSource["points"] = $$createField2_0($$parsedSource["points"]);
  1169. }
  1170. return new MinuteChart(/** @type {Partial<MinuteChart>} */($$parsedSource));
  1171. }
  1172. }
  1173. /**
  1174. * MinutePoint 分时图上的一个点
  1175. */
  1176. export class MinutePoint {
  1177. /**
  1178. * Creates a new MinutePoint instance.
  1179. * @param {Partial<MinutePoint>} [$$source = {}] - The source object to create the MinutePoint.
  1180. */
  1181. constructor($$source = {}) {
  1182. if (!("time" in $$source)) {
  1183. /**
  1184. * HH:MM
  1185. * @member
  1186. * @type {string}
  1187. */
  1188. this["time"] = "";
  1189. }
  1190. if (!("price" in $$source)) {
  1191. /**
  1192. * 当前价
  1193. * @member
  1194. * @type {number}
  1195. */
  1196. this["price"] = 0;
  1197. }
  1198. if (!("avg" in $$source)) {
  1199. /**
  1200. * 均价
  1201. * @member
  1202. * @type {number}
  1203. */
  1204. this["avg"] = 0;
  1205. }
  1206. Object.assign(this, $$source);
  1207. }
  1208. /**
  1209. * Creates a new MinutePoint instance from a string or object.
  1210. * @param {any} [$$source = {}]
  1211. * @returns {MinutePoint}
  1212. */
  1213. static createFrom($$source = {}) {
  1214. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1215. return new MinutePoint(/** @type {Partial<MinutePoint>} */($$parsedSource));
  1216. }
  1217. }
  1218. /**
  1219. * MonitorBrightnessInfo 单个显示器的亮度状态(返回给前端渲染滑块)
  1220. */
  1221. export class MonitorBrightnessInfo {
  1222. /**
  1223. * Creates a new MonitorBrightnessInfo instance.
  1224. * @param {Partial<MonitorBrightnessInfo>} [$$source = {}] - The source object to create the MonitorBrightnessInfo.
  1225. */
  1226. constructor($$source = {}) {
  1227. if (!("index" in $$source)) {
  1228. /**
  1229. * 显示器序号(与 SetBrightness 的 index 一致)
  1230. * @member
  1231. * @type {number}
  1232. */
  1233. this["index"] = 0;
  1234. }
  1235. if (!("name" in $$source)) {
  1236. /**
  1237. * 显示器名称(物理监视器描述,取不到时用设备名)
  1238. * @member
  1239. * @type {string}
  1240. */
  1241. this["name"] = "";
  1242. }
  1243. if (!("percent" in $$source)) {
  1244. /**
  1245. * 当前亮度百分比 0-100
  1246. * @member
  1247. * @type {number}
  1248. */
  1249. this["percent"] = 0;
  1250. }
  1251. if (!("hardware" in $$source)) {
  1252. /**
  1253. * true=DDC/CI 硬件调光;false=Gamma 软件调光
  1254. * @member
  1255. * @type {boolean}
  1256. */
  1257. this["hardware"] = false;
  1258. }
  1259. Object.assign(this, $$source);
  1260. }
  1261. /**
  1262. * Creates a new MonitorBrightnessInfo instance from a string or object.
  1263. * @param {any} [$$source = {}]
  1264. * @returns {MonitorBrightnessInfo}
  1265. */
  1266. static createFrom($$source = {}) {
  1267. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1268. return new MonitorBrightnessInfo(/** @type {Partial<MonitorBrightnessInfo>} */($$parsedSource));
  1269. }
  1270. }
  1271. /**
  1272. * MouseAlertConfig 系统级鼠标提醒气泡的显示配置
  1273. */
  1274. export class MouseAlertConfig {
  1275. /**
  1276. * Creates a new MouseAlertConfig instance.
  1277. * @param {Partial<MouseAlertConfig>} [$$source = {}] - The source object to create the MouseAlertConfig.
  1278. */
  1279. constructor($$source = {}) {
  1280. if (!("fontSize" in $$source)) {
  1281. /**
  1282. * 字号(px)
  1283. * @member
  1284. * @type {number}
  1285. */
  1286. this["fontSize"] = 0;
  1287. }
  1288. if (!("width" in $$source)) {
  1289. /**
  1290. * 气泡窗口宽度(px)
  1291. * @member
  1292. * @type {number}
  1293. */
  1294. this["width"] = 0;
  1295. }
  1296. if (!("speed" in $$source)) {
  1297. /**
  1298. * 超长文字滚动速度(px/s)
  1299. * @member
  1300. * @type {number}
  1301. */
  1302. this["speed"] = 0;
  1303. }
  1304. if (!("color" in $$source)) {
  1305. /**
  1306. * 文字颜色
  1307. * @member
  1308. * @type {string}
  1309. */
  1310. this["color"] = "";
  1311. }
  1312. if (!("background" in $$source)) {
  1313. /**
  1314. * 气泡背景色(COLORKEY 抠成透明,仅作底色参考)
  1315. * @member
  1316. * @type {string}
  1317. */
  1318. this["background"] = "";
  1319. }
  1320. if (!("duration" in $$source)) {
  1321. /**
  1322. * 显示时长(秒)
  1323. * @member
  1324. * @type {number}
  1325. */
  1326. this["duration"] = 0;
  1327. }
  1328. if (!("outlineColor" in $$source)) {
  1329. /**
  1330. * 文字描边颜色(白边/黑边,与文字形成反差)
  1331. * @member
  1332. * @type {string}
  1333. */
  1334. this["outlineColor"] = "";
  1335. }
  1336. if (!("outlineWidth" in $$source)) {
  1337. /**
  1338. * 文字描边宽度(px),0 表示关闭描边
  1339. * @member
  1340. * @type {number}
  1341. */
  1342. this["outlineWidth"] = 0;
  1343. }
  1344. Object.assign(this, $$source);
  1345. }
  1346. /**
  1347. * Creates a new MouseAlertConfig instance from a string or object.
  1348. * @param {any} [$$source = {}]
  1349. * @returns {MouseAlertConfig}
  1350. */
  1351. static createFrom($$source = {}) {
  1352. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1353. return new MouseAlertConfig(/** @type {Partial<MouseAlertConfig>} */($$parsedSource));
  1354. }
  1355. }
  1356. /**
  1357. * NewsItem 一条新闻标题,供「新闻」页与新闻滚动条使用
  1358. */
  1359. export class NewsItem {
  1360. /**
  1361. * Creates a new NewsItem instance.
  1362. * @param {Partial<NewsItem>} [$$source = {}] - The source object to create the NewsItem.
  1363. */
  1364. constructor($$source = {}) {
  1365. if (!("source" in $$source)) {
  1366. /**
  1367. * 来源:煎蛋 / 腾讯 / Solidot / 财联社 / 热榜
  1368. * @member
  1369. * @type {string}
  1370. */
  1371. this["source"] = "";
  1372. }
  1373. if (!("title" in $$source)) {
  1374. /**
  1375. * 标题
  1376. * @member
  1377. * @type {string}
  1378. */
  1379. this["title"] = "";
  1380. }
  1381. if (!("url" in $$source)) {
  1382. /**
  1383. * 详情页地址
  1384. * @member
  1385. * @type {string}
  1386. */
  1387. this["url"] = "";
  1388. }
  1389. if (!("matched" in $$source)) {
  1390. /**
  1391. * 是否命中关注关键词
  1392. * @member
  1393. * @type {boolean}
  1394. */
  1395. this["matched"] = false;
  1396. }
  1397. if (!("hits" in $$source)) {
  1398. /**
  1399. * 命中的关键词个数(越多排越前,前端按档位配色)
  1400. * @member
  1401. * @type {number}
  1402. */
  1403. this["hits"] = 0;
  1404. }
  1405. Object.assign(this, $$source);
  1406. }
  1407. /**
  1408. * Creates a new NewsItem instance from a string or object.
  1409. * @param {any} [$$source = {}]
  1410. * @returns {NewsItem}
  1411. */
  1412. static createFrom($$source = {}) {
  1413. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1414. return new NewsItem(/** @type {Partial<NewsItem>} */($$parsedSource));
  1415. }
  1416. }
  1417. /**
  1418. * PCStatus 电源命令状态快照,供 API 与「主机」页查询
  1419. */
  1420. export class PCStatus {
  1421. /**
  1422. * Creates a new PCStatus instance.
  1423. * @param {Partial<PCStatus>} [$$source = {}] - The source object to create the PCStatus.
  1424. */
  1425. constructor($$source = {}) {
  1426. if (!("command" in $$source)) {
  1427. /**
  1428. * 最近一次命令类型
  1429. * @member
  1430. * @type {string}
  1431. */
  1432. this["command"] = "";
  1433. }
  1434. if (!("pending" in $$source)) {
  1435. /**
  1436. * 是否有待执行命令
  1437. * @member
  1438. * @type {boolean}
  1439. */
  1440. this["pending"] = false;
  1441. }
  1442. if (!("executeAt" in $$source)) {
  1443. /**
  1444. * 计划执行时间
  1445. * @member
  1446. * @type {string}
  1447. */
  1448. this["executeAt"] = "";
  1449. }
  1450. if (!("remainingSecs" in $$source)) {
  1451. /**
  1452. * 剩余秒数
  1453. * @member
  1454. * @type {number}
  1455. */
  1456. this["remainingSecs"] = 0;
  1457. }
  1458. if (!("clientIp" in $$source)) {
  1459. /**
  1460. * 最近一次请求的客户端 IP
  1461. * @member
  1462. * @type {string}
  1463. */
  1464. this["clientIp"] = "";
  1465. }
  1466. if (!("requestTime" in $$source)) {
  1467. /**
  1468. * 最近一次请求时间
  1469. * @member
  1470. * @type {string}
  1471. */
  1472. this["requestTime"] = "";
  1473. }
  1474. if (!("requested" in $$source)) {
  1475. /**
  1476. * 是否收到过请求
  1477. * @member
  1478. * @type {boolean}
  1479. */
  1480. this["requested"] = false;
  1481. }
  1482. Object.assign(this, $$source);
  1483. }
  1484. /**
  1485. * Creates a new PCStatus instance from a string or object.
  1486. * @param {any} [$$source = {}]
  1487. * @returns {PCStatus}
  1488. */
  1489. static createFrom($$source = {}) {
  1490. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1491. return new PCStatus(/** @type {Partial<PCStatus>} */($$parsedSource));
  1492. }
  1493. }
  1494. /**
  1495. * PoemConfig 古诗显示的配置
  1496. */
  1497. export class PoemConfig {
  1498. /**
  1499. * Creates a new PoemConfig instance.
  1500. * @param {Partial<PoemConfig>} [$$source = {}] - The source object to create the PoemConfig.
  1501. */
  1502. constructor($$source = {}) {
  1503. if (!("enabled" in $$source)) {
  1504. /**
  1505. * 是否启用古诗显示
  1506. * @member
  1507. * @type {boolean}
  1508. */
  1509. this["enabled"] = false;
  1510. }
  1511. if (!("color" in $$source)) {
  1512. /**
  1513. * 文字颜色
  1514. * @member
  1515. * @type {string}
  1516. */
  1517. this["color"] = "";
  1518. }
  1519. if (!("fontSize" in $$source)) {
  1520. /**
  1521. * 字号(px)
  1522. * @member
  1523. * @type {number}
  1524. */
  1525. this["fontSize"] = 0;
  1526. }
  1527. if (!("tts" in $$source)) {
  1528. /**
  1529. * 允许 TTS 阅读(显示朗读按钮)
  1530. * @member
  1531. * @type {boolean}
  1532. */
  1533. this["tts"] = false;
  1534. }
  1535. if (!("interval" in $$source)) {
  1536. /**
  1537. * 自动换诗间隔(秒),0 表示不自动换
  1538. * @member
  1539. * @type {number}
  1540. */
  1541. this["interval"] = 0;
  1542. }
  1543. if (!("speed" in $$source)) {
  1544. /**
  1545. * 滚动速度(秒/轮),即滚动一个文本周期所需秒数,越小越快
  1546. * @member
  1547. * @type {number}
  1548. */
  1549. this["speed"] = 0;
  1550. }
  1551. Object.assign(this, $$source);
  1552. }
  1553. /**
  1554. * Creates a new PoemConfig instance from a string or object.
  1555. * @param {any} [$$source = {}]
  1556. * @returns {PoemConfig}
  1557. */
  1558. static createFrom($$source = {}) {
  1559. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1560. return new PoemConfig(/** @type {Partial<PoemConfig>} */($$parsedSource));
  1561. }
  1562. }
  1563. /**
  1564. * PoemData 一首古诗的完整数据(从接口解析)
  1565. */
  1566. export class PoemData {
  1567. /**
  1568. * Creates a new PoemData instance.
  1569. * @param {Partial<PoemData>} [$$source = {}] - The source object to create the PoemData.
  1570. */
  1571. constructor($$source = {}) {
  1572. if (!("title" in $$source)) {
  1573. /**
  1574. * 题目
  1575. * @member
  1576. * @type {string}
  1577. */
  1578. this["title"] = "";
  1579. }
  1580. if (!("author" in $$source)) {
  1581. /**
  1582. * 作者
  1583. * @member
  1584. * @type {string}
  1585. */
  1586. this["author"] = "";
  1587. }
  1588. if (!("dynasty" in $$source)) {
  1589. /**
  1590. * 朝代
  1591. * @member
  1592. * @type {string}
  1593. */
  1594. this["dynasty"] = "";
  1595. }
  1596. if (!("content" in $$source)) {
  1597. /**
  1598. * 每句诗(数组,按行显示)
  1599. * @member
  1600. * @type {string[]}
  1601. */
  1602. this["content"] = [];
  1603. }
  1604. if (!("type" in $$source)) {
  1605. /**
  1606. * 体裁,如 五言律诗
  1607. * @member
  1608. * @type {string}
  1609. */
  1610. this["type"] = "";
  1611. }
  1612. Object.assign(this, $$source);
  1613. }
  1614. /**
  1615. * Creates a new PoemData instance from a string or object.
  1616. * @param {any} [$$source = {}]
  1617. * @returns {PoemData}
  1618. */
  1619. static createFrom($$source = {}) {
  1620. const $$createField3_0 = $$createType0;
  1621. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1622. if ("content" in $$parsedSource) {
  1623. $$parsedSource["content"] = $$createField3_0($$parsedSource["content"]);
  1624. }
  1625. return new PoemData(/** @type {Partial<PoemData>} */($$parsedSource));
  1626. }
  1627. }
  1628. /**
  1629. * RecordItem 一条记录:姓名 + 名称 + 值 + 备注 + 录入时间,供记录 Tab 列表与柱状图使用
  1630. */
  1631. export class RecordItem {
  1632. /**
  1633. * Creates a new RecordItem instance.
  1634. * @param {Partial<RecordItem>} [$$source = {}] - The source object to create the RecordItem.
  1635. */
  1636. constructor($$source = {}) {
  1637. if (!("name" in $$source)) {
  1638. /**
  1639. * 姓名
  1640. * @member
  1641. * @type {string}
  1642. */
  1643. this["name"] = "";
  1644. }
  1645. if (!("item" in $$source)) {
  1646. /**
  1647. * 名称
  1648. * @member
  1649. * @type {string}
  1650. */
  1651. this["item"] = "";
  1652. }
  1653. if (!("value" in $$source)) {
  1654. /**
  1655. * 值
  1656. * @member
  1657. * @type {number}
  1658. */
  1659. this["value"] = 0;
  1660. }
  1661. if (!("remark" in $$source)) {
  1662. /**
  1663. * 备注(可选)
  1664. * @member
  1665. * @type {string}
  1666. */
  1667. this["remark"] = "";
  1668. }
  1669. if (!("createdAt" in $$source)) {
  1670. /**
  1671. * 录入时间 YYYY-MM-DD HH:MM:SS(前端新增时生成;为空时后端用当前时间)
  1672. * @member
  1673. * @type {string}
  1674. */
  1675. this["createdAt"] = "";
  1676. }
  1677. Object.assign(this, $$source);
  1678. }
  1679. /**
  1680. * Creates a new RecordItem instance from a string or object.
  1681. * @param {any} [$$source = {}]
  1682. * @returns {RecordItem}
  1683. */
  1684. static createFrom($$source = {}) {
  1685. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1686. return new RecordItem(/** @type {Partial<RecordItem>} */($$parsedSource));
  1687. }
  1688. }
  1689. /**
  1690. * ReleaseItem 一个 GitHub release 的简略信息,用于列出 Latest 之后的版本(Pre-release 等)
  1691. */
  1692. export class ReleaseItem {
  1693. /**
  1694. * Creates a new ReleaseItem instance.
  1695. * @param {Partial<ReleaseItem>} [$$source = {}] - The source object to create the ReleaseItem.
  1696. */
  1697. constructor($$source = {}) {
  1698. if (!("tagName" in $$source)) {
  1699. /**
  1700. * 版本标签,如 v1.3.0-beta.1
  1701. * @member
  1702. * @type {string}
  1703. */
  1704. this["tagName"] = "";
  1705. }
  1706. if (!("name" in $$source)) {
  1707. /**
  1708. * release 显示名称(标题),可能比 tag 更完整,如 "Rolling: v2.1.0-..."
  1709. * @member
  1710. * @type {string}
  1711. */
  1712. this["name"] = "";
  1713. }
  1714. if (!("url" in $$source)) {
  1715. /**
  1716. * release 详情页地址
  1717. * @member
  1718. * @type {string}
  1719. */
  1720. this["url"] = "";
  1721. }
  1722. if (!("isPrerelease" in $$source)) {
  1723. /**
  1724. * 是否预发布版本
  1725. * @member
  1726. * @type {boolean}
  1727. */
  1728. this["isPrerelease"] = false;
  1729. }
  1730. if (!("isDraft" in $$source)) {
  1731. /**
  1732. * 是否草稿版本
  1733. * @member
  1734. * @type {boolean}
  1735. */
  1736. this["isDraft"] = false;
  1737. }
  1738. if (!("publishedAt" in $$source)) {
  1739. /**
  1740. * 发布时间(MM-DD HH:MM)
  1741. * @member
  1742. * @type {string}
  1743. */
  1744. this["publishedAt"] = "";
  1745. }
  1746. Object.assign(this, $$source);
  1747. }
  1748. /**
  1749. * Creates a new ReleaseItem instance from a string or object.
  1750. * @param {any} [$$source = {}]
  1751. * @returns {ReleaseItem}
  1752. */
  1753. static createFrom($$source = {}) {
  1754. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1755. return new ReleaseItem(/** @type {Partial<ReleaseItem>} */($$parsedSource));
  1756. }
  1757. }
  1758. /**
  1759. * RepoFeed 一个 GitHub 仓库的最新提交摘要
  1760. */
  1761. export class RepoFeed {
  1762. /**
  1763. * Creates a new RepoFeed instance.
  1764. * @param {Partial<RepoFeed>} [$$source = {}] - The source object to create the RepoFeed.
  1765. */
  1766. constructor($$source = {}) {
  1767. if (!("url" in $$source)) {
  1768. /**
  1769. * 仓库地址(设置中配置)
  1770. * @member
  1771. * @type {string}
  1772. */
  1773. this["url"] = "";
  1774. }
  1775. if (!("desc" in $$source)) {
  1776. /**
  1777. * 项目说明
  1778. * @member
  1779. * @type {string}
  1780. */
  1781. this["desc"] = "";
  1782. }
  1783. if (!("repo" in $$source)) {
  1784. /**
  1785. * owner/repo 短名
  1786. * @member
  1787. * @type {string}
  1788. */
  1789. this["repo"] = "";
  1790. }
  1791. if (!("version" in $$source)) {
  1792. /**
  1793. * 本地已安装版本(设置中配置)
  1794. * @member
  1795. * @type {string}
  1796. */
  1797. this["version"] = "";
  1798. }
  1799. if (!("versionTime" in $$source)) {
  1800. /**
  1801. * 本地版本对应 release 的发布时间(MM-DD HH:MM),用于鼠标提示
  1802. * @member
  1803. * @type {string}
  1804. */
  1805. this["versionTime"] = "";
  1806. }
  1807. if (!("latest" in $$source)) {
  1808. /**
  1809. * 最新正式 release 版本号,无正式 release 时为空
  1810. * @member
  1811. * @type {string}
  1812. */
  1813. this["latest"] = "";
  1814. }
  1815. if (!("latestTime" in $$source)) {
  1816. /**
  1817. * 最新正式 release 发布时间(MM-DD HH:MM),用于鼠标提示
  1818. * @member
  1819. * @type {string}
  1820. */
  1821. this["latestTime"] = "";
  1822. }
  1823. if (!("hasUpdate" in $$source)) {
  1824. /**
  1825. * 是否存在可用更新(本地版本低于最新正式 release)
  1826. * @member
  1827. * @type {boolean}
  1828. */
  1829. this["hasUpdate"] = false;
  1830. }
  1831. if (!("releaseURL" in $$source)) {
  1832. /**
  1833. * 最新正式 release 的下载 / 详情页地址
  1834. * @member
  1835. * @type {string}
  1836. */
  1837. this["releaseURL"] = "";
  1838. }
  1839. if (!("newer" in $$source)) {
  1840. /**
  1841. * Latest 之后的版本(Pre-release 等,仅列出不参与更新比较)
  1842. * @member
  1843. * @type {ReleaseItem[]}
  1844. */
  1845. this["newer"] = [];
  1846. }
  1847. if (!("commits" in $$source)) {
  1848. /**
  1849. * 最近提交(最多 5 条)
  1850. * @member
  1851. * @type {CommitItem[]}
  1852. */
  1853. this["commits"] = [];
  1854. }
  1855. if (!("error" in $$source)) {
  1856. /**
  1857. * 抓取失败原因,为空表示正常
  1858. * @member
  1859. * @type {string}
  1860. */
  1861. this["error"] = "";
  1862. }
  1863. Object.assign(this, $$source);
  1864. }
  1865. /**
  1866. * Creates a new RepoFeed instance from a string or object.
  1867. * @param {any} [$$source = {}]
  1868. * @returns {RepoFeed}
  1869. */
  1870. static createFrom($$source = {}) {
  1871. const $$createField9_0 = $$createType25;
  1872. const $$createField10_0 = $$createType27;
  1873. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1874. if ("newer" in $$parsedSource) {
  1875. $$parsedSource["newer"] = $$createField9_0($$parsedSource["newer"]);
  1876. }
  1877. if ("commits" in $$parsedSource) {
  1878. $$parsedSource["commits"] = $$createField10_0($$parsedSource["commits"]);
  1879. }
  1880. return new RepoFeed(/** @type {Partial<RepoFeed>} */($$parsedSource));
  1881. }
  1882. }
  1883. /**
  1884. * RepoItem 关注的 GitHub 仓库条目
  1885. */
  1886. export class RepoItem {
  1887. /**
  1888. * Creates a new RepoItem instance.
  1889. * @param {Partial<RepoItem>} [$$source = {}] - The source object to create the RepoItem.
  1890. */
  1891. constructor($$source = {}) {
  1892. if (!("url" in $$source)) {
  1893. /**
  1894. * 仓库地址,如 https://github.com/wailsapp/wails
  1895. * @member
  1896. * @type {string}
  1897. */
  1898. this["url"] = "";
  1899. }
  1900. if (!("desc" in $$source)) {
  1901. /**
  1902. * 项目说明
  1903. * @member
  1904. * @type {string}
  1905. */
  1906. this["desc"] = "";
  1907. }
  1908. if (!("version" in $$source)) {
  1909. /**
  1910. * 本地已安装版本(用于与最新 release 比较),可为空
  1911. * @member
  1912. * @type {string}
  1913. */
  1914. this["version"] = "";
  1915. }
  1916. Object.assign(this, $$source);
  1917. }
  1918. /**
  1919. * Creates a new RepoItem instance from a string or object.
  1920. * @param {any} [$$source = {}]
  1921. * @returns {RepoItem}
  1922. */
  1923. static createFrom($$source = {}) {
  1924. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1925. return new RepoItem(/** @type {Partial<RepoItem>} */($$parsedSource));
  1926. }
  1927. }
  1928. /**
  1929. * ServiceModeStatus 服务模式运行状态(服务页展示)
  1930. */
  1931. export class ServiceModeStatus {
  1932. /**
  1933. * Creates a new ServiceModeStatus instance.
  1934. * @param {Partial<ServiceModeStatus>} [$$source = {}] - The source object to create the ServiceModeStatus.
  1935. */
  1936. constructor($$source = {}) {
  1937. if (!("addr" in $$source)) {
  1938. /**
  1939. * 服务模式监听地址
  1940. * @member
  1941. * @type {string}
  1942. */
  1943. this["addr"] = "";
  1944. }
  1945. if (!("running" in $$source)) {
  1946. /**
  1947. * 该地址上的电源 API 是否可用
  1948. * @member
  1949. * @type {boolean}
  1950. */
  1951. this["running"] = false;
  1952. }
  1953. if (!("managed" in $$source)) {
  1954. /**
  1955. * true=由真正的 Windows 服务提供;false=界面进程兜底
  1956. * @member
  1957. * @type {boolean}
  1958. */
  1959. this["managed"] = false;
  1960. }
  1961. if (!("occupied" in $$source)) {
  1962. /**
  1963. * 端口被其他程序占用(既非服务模式也非本程序)
  1964. * @member
  1965. * @type {boolean}
  1966. */
  1967. this["occupied"] = false;
  1968. }
  1969. if (!("version" in $$source)) {
  1970. /**
  1971. * 服务端版本(可用时)
  1972. * @member
  1973. * @type {string}
  1974. */
  1975. this["version"] = "";
  1976. }
  1977. Object.assign(this, $$source);
  1978. }
  1979. /**
  1980. * Creates a new ServiceModeStatus instance from a string or object.
  1981. * @param {any} [$$source = {}]
  1982. * @returns {ServiceModeStatus}
  1983. */
  1984. static createFrom($$source = {}) {
  1985. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  1986. return new ServiceModeStatus(/** @type {Partial<ServiceModeStatus>} */($$parsedSource));
  1987. }
  1988. }
  1989. /**
  1990. * StockQuote 单只股票的行情快照,供前端「股市」页展示
  1991. */
  1992. export class StockQuote {
  1993. /**
  1994. * Creates a new StockQuote instance.
  1995. * @param {Partial<StockQuote>} [$$source = {}] - The source object to create the StockQuote.
  1996. */
  1997. constructor($$source = {}) {
  1998. if (!("code" in $$source)) {
  1999. /**
  2000. * 带市场前缀的代码,如 sh600519
  2001. * @member
  2002. * @type {string}
  2003. */
  2004. this["code"] = "";
  2005. }
  2006. if (!("name" in $$source)) {
  2007. /**
  2008. * 股票名称
  2009. * @member
  2010. * @type {string}
  2011. */
  2012. this["name"] = "";
  2013. }
  2014. if (!("price" in $$source)) {
  2015. /**
  2016. * 当前价
  2017. * @member
  2018. * @type {number}
  2019. */
  2020. this["price"] = 0;
  2021. }
  2022. if (!("change" in $$source)) {
  2023. /**
  2024. * 涨跌额
  2025. * @member
  2026. * @type {number}
  2027. */
  2028. this["change"] = 0;
  2029. }
  2030. if (!("changePercent" in $$source)) {
  2031. /**
  2032. * 涨跌幅(%)
  2033. * @member
  2034. * @type {number}
  2035. */
  2036. this["changePercent"] = 0;
  2037. }
  2038. if (!("amount" in $$source)) {
  2039. /**
  2040. * 成交额(万元)
  2041. * @member
  2042. * @type {number}
  2043. */
  2044. this["amount"] = 0;
  2045. }
  2046. if (!("time" in $$source)) {
  2047. /**
  2048. * 行情时间 HH:MM:SS
  2049. * @member
  2050. * @type {string}
  2051. */
  2052. this["time"] = "";
  2053. }
  2054. Object.assign(this, $$source);
  2055. }
  2056. /**
  2057. * Creates a new StockQuote instance from a string or object.
  2058. * @param {any} [$$source = {}]
  2059. * @returns {StockQuote}
  2060. */
  2061. static createFrom($$source = {}) {
  2062. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  2063. return new StockQuote(/** @type {Partial<StockQuote>} */($$parsedSource));
  2064. }
  2065. }
  2066. /**
  2067. * TickerConfig 置顶滚动条(股票 / 新闻)的显示配置
  2068. */
  2069. export class TickerConfig {
  2070. /**
  2071. * Creates a new TickerConfig instance.
  2072. * @param {Partial<TickerConfig>} [$$source = {}] - The source object to create the TickerConfig.
  2073. */
  2074. constructor($$source = {}) {
  2075. if (!("enabled" in $$source)) {
  2076. /**
  2077. * 是否显示滚动条窗口
  2078. * @member
  2079. * @type {boolean}
  2080. */
  2081. this["enabled"] = false;
  2082. }
  2083. if (!("width" in $$source)) {
  2084. /**
  2085. * 窗口宽度(px),0 表示默认 1400
  2086. * @member
  2087. * @type {number}
  2088. */
  2089. this["width"] = 0;
  2090. }
  2091. if (!("fontSize" in $$source)) {
  2092. /**
  2093. * 字号(px)
  2094. * @member
  2095. * @type {number}
  2096. */
  2097. this["fontSize"] = 0;
  2098. }
  2099. if (!("color" in $$source)) {
  2100. /**
  2101. * 文字颜色
  2102. * @member
  2103. * @type {string}
  2104. */
  2105. this["color"] = "";
  2106. }
  2107. if (!("speed" in $$source)) {
  2108. /**
  2109. * 滚动速度(px/s)
  2110. * @member
  2111. * @type {number}
  2112. */
  2113. this["speed"] = 0;
  2114. }
  2115. if (!("transparent" in $$source)) {
  2116. /**
  2117. * 背景透明,不遮挡下方内容
  2118. * @member
  2119. * @type {boolean}
  2120. */
  2121. this["transparent"] = false;
  2122. }
  2123. if (!("x" in $$source)) {
  2124. /**
  2125. * 窗口位置,-1 表示未设置(系统默认位置)
  2126. * @member
  2127. * @type {number}
  2128. */
  2129. this["x"] = 0;
  2130. }
  2131. if (!("y" in $$source)) {
  2132. /**
  2133. * 窗口位置,-1 表示未设置
  2134. * @member
  2135. * @type {number}
  2136. */
  2137. this["y"] = 0;
  2138. }
  2139. Object.assign(this, $$source);
  2140. }
  2141. /**
  2142. * Creates a new TickerConfig instance from a string or object.
  2143. * @param {any} [$$source = {}]
  2144. * @returns {TickerConfig}
  2145. */
  2146. static createFrom($$source = {}) {
  2147. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  2148. return new TickerConfig(/** @type {Partial<TickerConfig>} */($$parsedSource));
  2149. }
  2150. }
  2151. /**
  2152. * TranslateResult 一次翻译的结果,供前端展示。
  2153. */
  2154. export class TranslateResult {
  2155. /**
  2156. * Creates a new TranslateResult instance.
  2157. * @param {Partial<TranslateResult>} [$$source = {}] - The source object to create the TranslateResult.
  2158. */
  2159. constructor($$source = {}) {
  2160. if (!("text" in $$source)) {
  2161. /**
  2162. * 翻译结果文本
  2163. * @member
  2164. * @type {string}
  2165. */
  2166. this["text"] = "";
  2167. }
  2168. if (!("detected" in $$source)) {
  2169. /**
  2170. * 检测到的源语言(zh / en)
  2171. * @member
  2172. * @type {string}
  2173. */
  2174. this["detected"] = "";
  2175. }
  2176. if (!("target" in $$source)) {
  2177. /**
  2178. * 目标语言(zh / en)
  2179. * @member
  2180. * @type {string}
  2181. */
  2182. this["target"] = "";
  2183. }
  2184. Object.assign(this, $$source);
  2185. }
  2186. /**
  2187. * Creates a new TranslateResult instance from a string or object.
  2188. * @param {any} [$$source = {}]
  2189. * @returns {TranslateResult}
  2190. */
  2191. static createFrom($$source = {}) {
  2192. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  2193. return new TranslateResult(/** @type {Partial<TranslateResult>} */($$parsedSource));
  2194. }
  2195. }
  2196. /**
  2197. * TrendingRepo 一个热门仓库条目(来源可为 GitHub Trending 或 HelloGitHub)
  2198. */
  2199. export class TrendingRepo {
  2200. /**
  2201. * Creates a new TrendingRepo instance.
  2202. * @param {Partial<TrendingRepo>} [$$source = {}] - The source object to create the TrendingRepo.
  2203. */
  2204. constructor($$source = {}) {
  2205. if (!("name" in $$source)) {
  2206. /**
  2207. * owner/repo 短名
  2208. * @member
  2209. * @type {string}
  2210. */
  2211. this["name"] = "";
  2212. }
  2213. if (!("url" in $$source)) {
  2214. /**
  2215. * 仓库主页地址(GitHub 直链)
  2216. * @member
  2217. * @type {string}
  2218. */
  2219. this["url"] = "";
  2220. }
  2221. if (!("desc" in $$source)) {
  2222. /**
  2223. * 简介(英文已自动翻译为中文,翻译失败保留原文)
  2224. * @member
  2225. * @type {string}
  2226. */
  2227. this["desc"] = "";
  2228. }
  2229. if (!("lang" in $$source)) {
  2230. /**
  2231. * 主要语言,无则空
  2232. * @member
  2233. * @type {string}
  2234. */
  2235. this["lang"] = "";
  2236. }
  2237. if (!("stars" in $$source)) {
  2238. /**
  2239. * 总星数(如 "106,375")
  2240. * @member
  2241. * @type {string}
  2242. */
  2243. this["stars"] = "";
  2244. }
  2245. if (!("todayStars" in $$source)) {
  2246. /**
  2247. * 今日新增星数(如 "1,140",无则空)
  2248. * @member
  2249. * @type {string}
  2250. */
  2251. this["todayStars"] = "";
  2252. }
  2253. if (!("forks" in $$source)) {
  2254. /**
  2255. * fork 数(如 "9,365",无则空)
  2256. * @member
  2257. * @type {string}
  2258. */
  2259. this["forks"] = "";
  2260. }
  2261. if (!("source" in $$source)) {
  2262. /**
  2263. * 来源:"github"(GitHub Trending)/ "hellogithub"
  2264. * @member
  2265. * @type {string}
  2266. */
  2267. this["source"] = "";
  2268. }
  2269. if (!("heat" in $$source)) {
  2270. /**
  2271. * 热度(HelloGitHub 点击量,其它来源为空)
  2272. * @member
  2273. * @type {string}
  2274. */
  2275. this["heat"] = "";
  2276. }
  2277. Object.assign(this, $$source);
  2278. }
  2279. /**
  2280. * Creates a new TrendingRepo instance from a string or object.
  2281. * @param {any} [$$source = {}]
  2282. * @returns {TrendingRepo}
  2283. */
  2284. static createFrom($$source = {}) {
  2285. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  2286. return new TrendingRepo(/** @type {Partial<TrendingRepo>} */($$parsedSource));
  2287. }
  2288. }
  2289. /**
  2290. * UDPInfo 描述一次 UDP 键值服务的运行状态,供前端展示。
  2291. */
  2292. export class UDPInfo {
  2293. /**
  2294. * Creates a new UDPInfo instance.
  2295. * @param {Partial<UDPInfo>} [$$source = {}] - The source object to create the UDPInfo.
  2296. */
  2297. constructor($$source = {}) {
  2298. if (!("running" in $$source)) {
  2299. /**
  2300. * 是否运行中
  2301. * @member
  2302. * @type {boolean}
  2303. */
  2304. this["running"] = false;
  2305. }
  2306. if (!("port" in $$source)) {
  2307. /**
  2308. * 监听端口
  2309. * @member
  2310. * @type {number}
  2311. */
  2312. this["port"] = 0;
  2313. }
  2314. if (!("addr" in $$source)) {
  2315. /**
  2316. * 监听地址 udp://0.0.0.0:port
  2317. * @member
  2318. * @type {string}
  2319. */
  2320. this["addr"] = "";
  2321. }
  2322. if (!("startedAt" in $$source)) {
  2323. /**
  2324. * 启动时间
  2325. * @member
  2326. * @type {string}
  2327. */
  2328. this["startedAt"] = "";
  2329. }
  2330. if (!("error" in $$source)) {
  2331. /**
  2332. * 最近一次错误
  2333. * @member
  2334. * @type {string}
  2335. */
  2336. this["error"] = "";
  2337. }
  2338. if (!("rxCount" in $$source)) {
  2339. /**
  2340. * 累计接收数据包数
  2341. * @member
  2342. * @type {number}
  2343. */
  2344. this["rxCount"] = 0;
  2345. }
  2346. if (!("txCount" in $$source)) {
  2347. /**
  2348. * 累计发送(回发/手动)数据包数
  2349. * @member
  2350. * @type {number}
  2351. */
  2352. this["txCount"] = 0;
  2353. }
  2354. Object.assign(this, $$source);
  2355. }
  2356. /**
  2357. * Creates a new UDPInfo instance from a string or object.
  2358. * @param {any} [$$source = {}]
  2359. * @returns {UDPInfo}
  2360. */
  2361. static createFrom($$source = {}) {
  2362. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  2363. return new UDPInfo(/** @type {Partial<UDPInfo>} */($$parsedSource));
  2364. }
  2365. }
  2366. /**
  2367. * WebServiceInfo 描述一次 Web 服务运行实例的状态,供前端展示。
  2368. */
  2369. export class WebServiceInfo {
  2370. /**
  2371. * Creates a new WebServiceInfo instance.
  2372. * @param {Partial<WebServiceInfo>} [$$source = {}] - The source object to create the WebServiceInfo.
  2373. */
  2374. constructor($$source = {}) {
  2375. if (!("running" in $$source)) {
  2376. /**
  2377. * 是否运行中
  2378. * @member
  2379. * @type {boolean}
  2380. */
  2381. this["running"] = false;
  2382. }
  2383. if (!("dir" in $$source)) {
  2384. /**
  2385. * 服务目录
  2386. * @member
  2387. * @type {string}
  2388. */
  2389. this["dir"] = "";
  2390. }
  2391. if (!("url" in $$source)) {
  2392. /**
  2393. * 访问地址 http://127.0.0.1:port/
  2394. * @member
  2395. * @type {string}
  2396. */
  2397. this["url"] = "";
  2398. }
  2399. if (!("indexName" in $$source)) {
  2400. /**
  2401. * 实际用作默认页的文件(index.html / readme.md / 空)
  2402. * @member
  2403. * @type {string}
  2404. */
  2405. this["indexName"] = "";
  2406. }
  2407. if (!("startedAt" in $$source)) {
  2408. /**
  2409. * 启动时间
  2410. * @member
  2411. * @type {string}
  2412. */
  2413. this["startedAt"] = "";
  2414. }
  2415. if (!("error" in $$source)) {
  2416. /**
  2417. * 最近一次错误
  2418. * @member
  2419. * @type {string}
  2420. */
  2421. this["error"] = "";
  2422. }
  2423. if (!("connections" in $$source)) {
  2424. /**
  2425. * 累计请求次数
  2426. * @member
  2427. * @type {number}
  2428. */
  2429. this["connections"] = 0;
  2430. }
  2431. Object.assign(this, $$source);
  2432. }
  2433. /**
  2434. * Creates a new WebServiceInfo instance from a string or object.
  2435. * @param {any} [$$source = {}]
  2436. * @returns {WebServiceInfo}
  2437. */
  2438. static createFrom($$source = {}) {
  2439. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  2440. return new WebServiceInfo(/** @type {Partial<WebServiceInfo>} */($$parsedSource));
  2441. }
  2442. }
  2443. /**
  2444. * YTDLPConfig 是「视频下载」的配置。
  2445. */
  2446. export class YTDLPConfig {
  2447. /**
  2448. * Creates a new YTDLPConfig instance.
  2449. * @param {Partial<YTDLPConfig>} [$$source = {}] - The source object to create the YTDLPConfig.
  2450. */
  2451. constructor($$source = {}) {
  2452. if (!("dir" in $$source)) {
  2453. /**
  2454. * 下载保存目录,空=程序当前工作目录
  2455. * @member
  2456. * @type {string}
  2457. */
  2458. this["dir"] = "";
  2459. }
  2460. if (!("mp3Quality" in $$source)) {
  2461. /**
  2462. * mp3 转换质量:0-9(VBR,0 最好)或 128K/192K/320K,默认 0
  2463. * @member
  2464. * @type {string}
  2465. */
  2466. this["mp3Quality"] = "";
  2467. }
  2468. Object.assign(this, $$source);
  2469. }
  2470. /**
  2471. * Creates a new YTDLPConfig instance from a string or object.
  2472. * @param {any} [$$source = {}]
  2473. * @returns {YTDLPConfig}
  2474. */
  2475. static createFrom($$source = {}) {
  2476. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  2477. return new YTDLPConfig(/** @type {Partial<YTDLPConfig>} */($$parsedSource));
  2478. }
  2479. }
  2480. /**
  2481. * YTDLPInfo 描述本机 yt-dlp 的可用性,用于前端决定是否展示工具卡片。
  2482. */
  2483. export class YTDLPInfo {
  2484. /**
  2485. * Creates a new YTDLPInfo instance.
  2486. * @param {Partial<YTDLPInfo>} [$$source = {}] - The source object to create the YTDLPInfo.
  2487. */
  2488. constructor($$source = {}) {
  2489. if (!("available" in $$source)) {
  2490. /**
  2491. * PATH 中是否找到 yt-dlp
  2492. * @member
  2493. * @type {boolean}
  2494. */
  2495. this["available"] = false;
  2496. }
  2497. if (!("path" in $$source)) {
  2498. /**
  2499. * yt-dlp 可执行文件路径
  2500. * @member
  2501. * @type {string}
  2502. */
  2503. this["path"] = "";
  2504. }
  2505. if (!("version" in $$source)) {
  2506. /**
  2507. * 版本信息(yt-dlp --version 输出)
  2508. * @member
  2509. * @type {string}
  2510. */
  2511. this["version"] = "";
  2512. }
  2513. if (!("ffmpeg" in $$source)) {
  2514. /**
  2515. * PATH 中是否找到 ffmpeg(用于「下载转 mp3」)
  2516. * @member
  2517. * @type {boolean}
  2518. */
  2519. this["ffmpeg"] = false;
  2520. }
  2521. Object.assign(this, $$source);
  2522. }
  2523. /**
  2524. * Creates a new YTDLPInfo instance from a string or object.
  2525. * @param {any} [$$source = {}]
  2526. * @returns {YTDLPInfo}
  2527. */
  2528. static createFrom($$source = {}) {
  2529. let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
  2530. return new YTDLPInfo(/** @type {Partial<YTDLPInfo>} */($$parsedSource));
  2531. }
  2532. }
  2533. // Private type creation functions
  2534. const $$createType0 = $Create.Array($Create.Any);
  2535. const $$createType1 = LinkItem.createFrom;
  2536. const $$createType2 = $Create.Array($$createType1);
  2537. const $$createType3 = RepoItem.createFrom;
  2538. const $$createType4 = $Create.Array($$createType3);
  2539. const $$createType5 = CustomTab.createFrom;
  2540. const $$createType6 = $Create.Array($$createType5);
  2541. const $$createType7 = LocalTool.createFrom;
  2542. const $$createType8 = $Create.Array($$createType7);
  2543. const $$createType9 = ControlKeyConfig.createFrom;
  2544. const $$createType10 = $Create.Array($$createType9);
  2545. const $$createType11 = TickerConfig.createFrom;
  2546. const $$createType12 = PoemConfig.createFrom;
  2547. const $$createType13 = MouseAlertConfig.createFrom;
  2548. const $$createType14 = LocalSendConfig.createFrom;
  2549. const $$createType15 = CrocConfig.createFrom;
  2550. const $$createType16 = YTDLPConfig.createFrom;
  2551. const $$createType17 = MemosConfig.createFrom;
  2552. const $$createType18 = BrightnessConfig.createFrom;
  2553. const $$createType19 = BiliDynamicItem.createFrom;
  2554. const $$createType20 = $Create.Array($$createType19);
  2555. const $$createType21 = $Create.Map($Create.Any, $Create.Any);
  2556. const $$createType22 = MinutePoint.createFrom;
  2557. const $$createType23 = $Create.Array($$createType22);
  2558. const $$createType24 = ReleaseItem.createFrom;
  2559. const $$createType25 = $Create.Array($$createType24);
  2560. const $$createType26 = CommitItem.createFrom;
  2561. const $$createType27 = $Create.Array($$createType26);