1
0

models.js 89 KB

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