1
0

models.js 86 KB

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