1
0

models.js 70 KB

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