models.js 73 KB

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