| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843 |
- // @ts-check
- // Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
- // This file is automatically generated. DO NOT EDIT
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
- // @ts-ignore: Unused imports
- import { Create as $Create } from "@wailsio/runtime";
- /**
- * APIStatus API 服务运行状态,供「主机」页展示
- */
- export class APIStatus {
- /**
- * Creates a new APIStatus instance.
- * @param {Partial<APIStatus>} [$$source = {}] - The source object to create the APIStatus.
- */
- constructor($$source = {}) {
- if (!("addr" in $$source)) {
- /**
- * 当前监听地址
- * @member
- * @type {string}
- */
- this["addr"] = "";
- }
- if (!("running" in $$source)) {
- /**
- * 是否正在监听
- * @member
- * @type {boolean}
- */
- this["running"] = false;
- }
- if (!("startedAt" in $$source)) {
- /**
- * 启动时间
- * @member
- * @type {string}
- */
- this["startedAt"] = "";
- }
- if (!("error" in $$source)) {
- /**
- * 最近错误信息
- * @member
- * @type {string}
- */
- this["error"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new APIStatus instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {APIStatus}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new APIStatus(/** @type {Partial<APIStatus>} */($$parsedSource));
- }
- }
- /**
- * AppSettings 保存全部可自定义配置,序列化为 JSON 存于用户配置目录
- */
- export class AppSettings {
- /**
- * Creates a new AppSettings instance.
- * @param {Partial<AppSettings>} [$$source = {}] - The source object to create the AppSettings.
- */
- constructor($$source = {}) {
- if (!("theme" in $$source)) {
- /**
- * 界面主题:dark / light
- * @member
- * @type {string}
- */
- this["theme"] = "";
- }
- if (!("autostart" in $$source)) {
- /**
- * 系统启动时运行
- * @member
- * @type {boolean}
- */
- this["autostart"] = false;
- }
- if (!("alwaysOnTop" in $$source)) {
- /**
- * 窗口置顶
- * @member
- * @type {boolean}
- */
- this["alwaysOnTop"] = false;
- }
- if (!("startCompact" in $$source)) {
- /**
- * 启动时自动收拢为圆点(窗口缩小)
- * @member
- * @type {boolean}
- */
- this["startCompact"] = false;
- }
- if (!("windowWidth" in $$source)) {
- /**
- * 主窗口宽度(px),随窗口调整自动保存
- * @member
- * @type {number}
- */
- this["windowWidth"] = 0;
- }
- if (!("windowHeight" in $$source)) {
- /**
- * 主窗口高度(px),随窗口调整自动保存
- * @member
- * @type {number}
- */
- this["windowHeight"] = 0;
- }
- if (!("hotkey" in $$source)) {
- /**
- * 呼出(显示)窗口的全局热键
- * @member
- * @type {string}
- */
- this["hotkey"] = "";
- }
- if (!("tabOrder" in $$source)) {
- /**
- * Tab 显示顺序(tabId 列表,未列出的追加到末尾)
- * @member
- * @type {string[]}
- */
- this["tabOrder"] = [];
- }
- if (!("stockCodes" in $$source)) {
- /**
- * 股市页展示的股票代码列表
- * @member
- * @type {string[]}
- */
- this["stockCodes"] = [];
- }
- if (!("links" in $$source)) {
- /**
- * 常用网址列表
- * @member
- * @type {LinkItem[]}
- */
- this["links"] = [];
- }
- if (!("newsKeywords" in $$source)) {
- /**
- * 新闻关注关键词,逗号分隔
- * @member
- * @type {string}
- */
- this["newsKeywords"] = "";
- }
- if (!("biliCookie" in $$source)) {
- /**
- * B站登录 cookie(含 SESSDATA),用于抓取「关注的人最新动态」
- * @member
- * @type {string}
- */
- this["biliCookie"] = "";
- }
- if (!("githubRepos" in $$source)) {
- /**
- * 关注的 GitHub 仓库列表
- * @member
- * @type {RepoItem[]}
- */
- this["githubRepos"] = [];
- }
- if (!("customTabs" in $$source)) {
- /**
- * 用户自定义 Tab 页面(名字 + 网址)
- * @member
- * @type {CustomTab[]}
- */
- this["customTabs"] = [];
- }
- if (!("localTools" in $$source)) {
- /**
- * 「本地」页资源(标题|启动命令|说明,在设置中维护)
- * @member
- * @type {LocalTool[]}
- */
- this["localTools"] = [];
- }
- if (!("controlKeys" in $$source)) {
- /**
- * 控制页按键配置(前 5 键固定 上/下/左/右/休眠,第 6 键起为额外按键)
- * @member
- * @type {ControlKeyConfig[]}
- */
- this["controlKeys"] = [];
- }
- if (!("controlRepeatSecs" in $$source)) {
- /**
- * 控制页长按连发频率(秒,0.0-10.0,默认 1.0)
- * @member
- * @type {number}
- */
- this["controlRepeatSecs"] = 0;
- }
- if (!("apiAddr" in $$source)) {
- /**
- * 内置 API 服务监听地址
- * @member
- * @type {string}
- */
- this["apiAddr"] = "";
- }
- if (!("serviceAddr" in $$source)) {
- /**
- * Windows 服务模式(--service)监听地址,仅电源类接口
- * @member
- * @type {string}
- */
- this["serviceAddr"] = "";
- }
- if (!("apiAutoStart" in $$source)) {
- /**
- * 应用启动时自动启动内置 API 服务(默认开启)
- * @member
- * @type {boolean}
- */
- this["apiAutoStart"] = false;
- }
- if (!("uploadPassword" in $$source)) {
- /**
- * 文件上传密码(空=不启用上传/下载接口)
- * @member
- * @type {string}
- */
- this["uploadPassword"] = "";
- }
- if (!("uploadDir" in $$source)) {
- /**
- * 文件上传保存目录(空=用户配置目录/uploads)
- * @member
- * @type {string}
- */
- this["uploadDir"] = "";
- }
- if (!("uploadMaxSize" in $$source)) {
- /**
- * 单个上传文件大小上限(MB),<=0 用默认 512
- * @member
- * @type {number}
- */
- this["uploadMaxSize"] = 0;
- }
- if (!("todoPath" in $$source)) {
- /**
- * 待办(TODO)文件路径
- * @member
- * @type {string}
- */
- this["todoPath"] = "";
- }
- if (!("recordPath" in $$source)) {
- /**
- * 记录(Record)文件路径:每行「姓名|名称|值」(保留兼容)
- * @member
- * @type {string}
- */
- this["recordPath"] = "";
- }
- if (!("recordDBPath" in $$source)) {
- /**
- * 记录数据库路径:SQLite3 数据库文件(记录 Tab 实际存储)
- * @member
- * @type {string}
- */
- this["recordDBPath"] = "";
- }
- if (!("backupDir" in $$source)) {
- /**
- * 文本文件备份目录(文件类自定义 Tab「备份」按钮使用)
- * @member
- * @type {string}
- */
- this["backupDir"] = "";
- }
- if (!("stockTicker" in $$source)) {
- /**
- * 股票滚动条配置
- * @member
- * @type {TickerConfig}
- */
- this["stockTicker"] = (new TickerConfig());
- }
- if (!("newsTicker" in $$source)) {
- /**
- * 新闻滚动条配置
- * @member
- * @type {TickerConfig}
- */
- this["newsTicker"] = (new TickerConfig());
- }
- if (!("poem" in $$source)) {
- /**
- * 随机古诗显示配置
- * @member
- * @type {PoemConfig}
- */
- this["poem"] = (new PoemConfig());
- }
- if (!("mouseAlert" in $$source)) {
- /**
- * 系统级鼠标提醒气泡配置
- * @member
- * @type {MouseAlertConfig}
- */
- this["mouseAlert"] = (new MouseAlertConfig());
- }
- if (!("browserPath" in $$source)) {
- /**
- * 指定浏览器 exe 路径(空=系统默认浏览器)
- * @member
- * @type {string}
- */
- this["browserPath"] = "";
- }
- if (!("ledColor" in $$source)) {
- /**
- * LED 滚动文字点阵颜色(如 #ff4d4d)
- * @member
- * @type {string}
- */
- this["ledColor"] = "";
- }
- if (!("stockUpColor" in $$source)) {
- /**
- * 股票上涨颜色
- * @member
- * @type {string}
- */
- this["stockUpColor"] = "";
- }
- if (!("stockDownColor" in $$source)) {
- /**
- * 股票下跌颜色
- * @member
- * @type {string}
- */
- this["stockDownColor"] = "";
- }
- if (!("stockRefreshSecs" in $$source)) {
- /**
- * 股市自动刷新间隔(秒)
- * @member
- * @type {number}
- */
- this["stockRefreshSecs"] = 0;
- }
- if (!("stockClosedRefreshSecs" in $$source)) {
- /**
- * 股市休市时自动刷新间隔(秒)
- * @member
- * @type {number}
- */
- this["stockClosedRefreshSecs"] = 0;
- }
- if (!("newsRefreshMinutes" in $$source)) {
- /**
- * 新闻自动刷新间隔(分钟)
- * @member
- * @type {number}
- */
- this["newsRefreshMinutes"] = 0;
- }
- if (!("newsCount" in $$source)) {
- /**
- * 新闻页显示条数
- * @member
- * @type {number}
- */
- this["newsCount"] = 0;
- }
- if (!("githubRefreshMinutes" in $$source)) {
- /**
- * Github 自动刷新间隔(分钟)
- * @member
- * @type {number}
- */
- this["githubRefreshMinutes"] = 0;
- }
- if (!("fontDelta" in $$source)) {
- /**
- * 全局字号偏移(px),+-3 范围内调整
- * @member
- * @type {number}
- */
- this["fontDelta"] = 0;
- }
- if (!("localSend" in $$source)) {
- /**
- * LocalSend 文件互传配置(本机名/接收目录/接收模式等)
- * @member
- * @type {LocalSendConfig}
- */
- this["localSend"] = (new LocalSendConfig());
- }
- if (!("croc" in $$source)) {
- /**
- * Croc 传送配置(发送/接收共用密码)
- * @member
- * @type {CrocConfig}
- */
- this["croc"] = (new CrocConfig());
- }
- if (!("ytdlp" in $$source)) {
- /**
- * 视频下载配置(yt-dlp 保存目录)
- * @member
- * @type {YTDLPConfig}
- */
- this["ytdlp"] = (new YTDLPConfig());
- }
- if (!("memos" in $$source)) {
- /**
- * Memos 速记配置(地址/访问令牌)
- * @member
- * @type {MemosConfig}
- */
- this["memos"] = (new MemosConfig());
- }
- if (!("brightness" in $$source)) {
- /**
- * 显示器亮度配置(记住亮度、启动恢复)
- * @member
- * @type {BrightnessConfig}
- */
- this["brightness"] = (new BrightnessConfig());
- }
- if (!("toolOrder" in $$source)) {
- /**
- * 工具页卡片显示顺序(工具 id 列表,未列出的追加到末尾)
- * @member
- * @type {string[]}
- */
- this["toolOrder"] = [];
- }
- if (!("gitLab" in $$source)) {
- /**
- * 私有 GitLab 自动升级配置
- * @member
- * @type {GitLabConfig}
- */
- this["gitLab"] = (new GitLabConfig());
- }
- if (!("skippedUpdateVersion" in $$source)) {
- /**
- * 已跳过的版本(启动检查时视为无更新)
- * @member
- * @type {string}
- */
- this["skippedUpdateVersion"] = "";
- }
- if (!("proxy" in $$source)) {
- /**
- * 网络代理配置(工具页「网络代理」卡片)
- * @member
- * @type {ProxyConfig}
- */
- this["proxy"] = (new ProxyConfig());
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new AppSettings instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {AppSettings}
- */
- static createFrom($$source = {}) {
- const $$createField7_0 = $$createType0;
- const $$createField8_0 = $$createType0;
- const $$createField9_0 = $$createType2;
- const $$createField12_0 = $$createType4;
- const $$createField13_0 = $$createType6;
- const $$createField14_0 = $$createType8;
- const $$createField15_0 = $$createType10;
- const $$createField27_0 = $$createType11;
- const $$createField28_0 = $$createType11;
- const $$createField29_0 = $$createType12;
- const $$createField30_0 = $$createType13;
- const $$createField41_0 = $$createType14;
- const $$createField42_0 = $$createType15;
- const $$createField43_0 = $$createType16;
- const $$createField44_0 = $$createType17;
- const $$createField45_0 = $$createType18;
- const $$createField46_0 = $$createType0;
- const $$createField47_0 = $$createType19;
- const $$createField49_0 = $$createType20;
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- if ("tabOrder" in $$parsedSource) {
- $$parsedSource["tabOrder"] = $$createField7_0($$parsedSource["tabOrder"]);
- }
- if ("stockCodes" in $$parsedSource) {
- $$parsedSource["stockCodes"] = $$createField8_0($$parsedSource["stockCodes"]);
- }
- if ("links" in $$parsedSource) {
- $$parsedSource["links"] = $$createField9_0($$parsedSource["links"]);
- }
- if ("githubRepos" in $$parsedSource) {
- $$parsedSource["githubRepos"] = $$createField12_0($$parsedSource["githubRepos"]);
- }
- if ("customTabs" in $$parsedSource) {
- $$parsedSource["customTabs"] = $$createField13_0($$parsedSource["customTabs"]);
- }
- if ("localTools" in $$parsedSource) {
- $$parsedSource["localTools"] = $$createField14_0($$parsedSource["localTools"]);
- }
- if ("controlKeys" in $$parsedSource) {
- $$parsedSource["controlKeys"] = $$createField15_0($$parsedSource["controlKeys"]);
- }
- if ("stockTicker" in $$parsedSource) {
- $$parsedSource["stockTicker"] = $$createField27_0($$parsedSource["stockTicker"]);
- }
- if ("newsTicker" in $$parsedSource) {
- $$parsedSource["newsTicker"] = $$createField28_0($$parsedSource["newsTicker"]);
- }
- if ("poem" in $$parsedSource) {
- $$parsedSource["poem"] = $$createField29_0($$parsedSource["poem"]);
- }
- if ("mouseAlert" in $$parsedSource) {
- $$parsedSource["mouseAlert"] = $$createField30_0($$parsedSource["mouseAlert"]);
- }
- if ("localSend" in $$parsedSource) {
- $$parsedSource["localSend"] = $$createField41_0($$parsedSource["localSend"]);
- }
- if ("croc" in $$parsedSource) {
- $$parsedSource["croc"] = $$createField42_0($$parsedSource["croc"]);
- }
- if ("ytdlp" in $$parsedSource) {
- $$parsedSource["ytdlp"] = $$createField43_0($$parsedSource["ytdlp"]);
- }
- if ("memos" in $$parsedSource) {
- $$parsedSource["memos"] = $$createField44_0($$parsedSource["memos"]);
- }
- if ("brightness" in $$parsedSource) {
- $$parsedSource["brightness"] = $$createField45_0($$parsedSource["brightness"]);
- }
- if ("toolOrder" in $$parsedSource) {
- $$parsedSource["toolOrder"] = $$createField46_0($$parsedSource["toolOrder"]);
- }
- if ("gitLab" in $$parsedSource) {
- $$parsedSource["gitLab"] = $$createField47_0($$parsedSource["gitLab"]);
- }
- if ("proxy" in $$parsedSource) {
- $$parsedSource["proxy"] = $$createField49_0($$parsedSource["proxy"]);
- }
- return new AppSettings(/** @type {Partial<AppSettings>} */($$parsedSource));
- }
- }
- /**
- * BiliDynamicItem 一条 B站动态,供「新闻」页展示
- */
- export class BiliDynamicItem {
- /**
- * Creates a new BiliDynamicItem instance.
- * @param {Partial<BiliDynamicItem>} [$$source = {}] - The source object to create the BiliDynamicItem.
- */
- constructor($$source = {}) {
- if (!("source" in $$source)) {
- /**
- * 来源:B站动态
- * @member
- * @type {string}
- */
- this["source"] = "";
- }
- if (!("title" in $$source)) {
- /**
- * 标题(动态文案或视频标题)
- * @member
- * @type {string}
- */
- this["title"] = "";
- }
- if (!("url" in $$source)) {
- /**
- * 详情页地址
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("matched" in $$source)) {
- /**
- * 是否命中关注关键词
- * @member
- * @type {boolean}
- */
- this["matched"] = false;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new BiliDynamicItem instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {BiliDynamicItem}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new BiliDynamicItem(/** @type {Partial<BiliDynamicItem>} */($$parsedSource));
- }
- }
- /**
- * BiliFeedResult B站动态抓取结果:列表 + 需要提示用户的说明(如 cookie 过期后回退热门)
- */
- export class BiliFeedResult {
- /**
- * Creates a new BiliFeedResult instance.
- * @param {Partial<BiliFeedResult>} [$$source = {}] - The source object to create the BiliFeedResult.
- */
- constructor($$source = {}) {
- if (!("items" in $$source)) {
- /**
- * @member
- * @type {BiliDynamicItem[]}
- */
- this["items"] = [];
- }
- if (!("notice" in $$source)) {
- /**
- * @member
- * @type {string}
- */
- this["notice"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new BiliFeedResult instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {BiliFeedResult}
- */
- static createFrom($$source = {}) {
- const $$createField0_0 = $$createType22;
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- if ("items" in $$parsedSource) {
- $$parsedSource["items"] = $$createField0_0($$parsedSource["items"]);
- }
- return new BiliFeedResult(/** @type {Partial<BiliFeedResult>} */($$parsedSource));
- }
- }
- /**
- * BrightnessConfig 显示器亮度配置:记住各显示器亮度(按显示器名称),供启动时恢复
- */
- export class BrightnessConfig {
- /**
- * Creates a new BrightnessConfig instance.
- * @param {Partial<BrightnessConfig>} [$$source = {}] - The source object to create the BrightnessConfig.
- */
- constructor($$source = {}) {
- if (!("restoreOnStart" in $$source)) {
- /**
- * 启动应用时恢复上次亮度
- * @member
- * @type {boolean}
- */
- this["restoreOnStart"] = false;
- }
- if (!("levels" in $$source)) {
- /**
- * 显示器名称 -> 亮度百分比(0-100)
- * @member
- * @type {{ [_ in string]?: number }}
- */
- this["levels"] = {};
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new BrightnessConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {BrightnessConfig}
- */
- static createFrom($$source = {}) {
- const $$createField1_0 = $$createType23;
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- if ("levels" in $$parsedSource) {
- $$parsedSource["levels"] = $$createField1_0($$parsedSource["levels"]);
- }
- return new BrightnessConfig(/** @type {Partial<BrightnessConfig>} */($$parsedSource));
- }
- }
- /**
- * CommitItem 仓库的一条提交记录
- */
- export class CommitItem {
- /**
- * Creates a new CommitItem instance.
- * @param {Partial<CommitItem>} [$$source = {}] - The source object to create the CommitItem.
- */
- constructor($$source = {}) {
- if (!("title" in $$source)) {
- /**
- * 提交标题(首行)
- * @member
- * @type {string}
- */
- this["title"] = "";
- }
- if (!("url" in $$source)) {
- /**
- * 提交详情页地址
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("updated" in $$source)) {
- /**
- * 提交时间(MM-DD HH:MM)
- * @member
- * @type {string}
- */
- this["updated"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new CommitItem instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {CommitItem}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new CommitItem(/** @type {Partial<CommitItem>} */($$parsedSource));
- }
- }
- /**
- * ControlKeyConfig 控制页方向盘单个按键配置(图标 + 命令 URL)
- */
- export class ControlKeyConfig {
- /**
- * Creates a new ControlKeyConfig instance.
- * @param {Partial<ControlKeyConfig>} [$$source = {}] - The source object to create the ControlKeyConfig.
- */
- constructor($$source = {}) {
- if (!("icon" in $$source)) {
- /**
- * 按钮显示字符,如 ↑、↓、←、→、休眠
- * @member
- * @type {string}
- */
- this["icon"] = "";
- }
- if (!("cmd" in $$source)) {
- /**
- * 点击时 GET 请求的完整 URL;空则回退旧指令信箱模式
- * @member
- * @type {string}
- */
- this["cmd"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new ControlKeyConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {ControlKeyConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new ControlKeyConfig(/** @type {Partial<ControlKeyConfig>} */($$parsedSource));
- }
- }
- /**
- * CrocConfig 是 Croc 传送的配置(发送/接收共用密码)。
- */
- export class CrocConfig {
- /**
- * Creates a new CrocConfig instance.
- * @param {Partial<CrocConfig>} [$$source = {}] - The source object to create the CrocConfig.
- */
- constructor($$source = {}) {
- if (!("password" in $$source)) {
- /**
- * 发送/接收共用密码:作为 croc 传输码(--code),空=使用随机传输码
- * @member
- * @type {string}
- */
- this["password"] = "";
- }
- if (!("dir" in $$source)) {
- /**
- * 接收保存目录,空=当前工作目录
- * @member
- * @type {string}
- */
- this["dir"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new CrocConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {CrocConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new CrocConfig(/** @type {Partial<CrocConfig>} */($$parsedSource));
- }
- }
- /**
- * CrocInfo 描述本机 croc 的可用性,用于前端决定是否展示工具卡片。
- */
- export class CrocInfo {
- /**
- * Creates a new CrocInfo instance.
- * @param {Partial<CrocInfo>} [$$source = {}] - The source object to create the CrocInfo.
- */
- constructor($$source = {}) {
- if (!("available" in $$source)) {
- /**
- * PATH 中是否找到 croc
- * @member
- * @type {boolean}
- */
- this["available"] = false;
- }
- if (!("path" in $$source)) {
- /**
- * croc 可执行文件路径
- * @member
- * @type {string}
- */
- this["path"] = "";
- }
- if (!("version" in $$source)) {
- /**
- * 版本信息(croc --version 输出)
- * @member
- * @type {string}
- */
- this["version"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new CrocInfo instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {CrocInfo}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new CrocInfo(/** @type {Partial<CrocInfo>} */($$parsedSource));
- }
- }
- /**
- * CustomTab 用户自定义 Tab 页面
- */
- export class CustomTab {
- /**
- * Creates a new CustomTab instance.
- * @param {Partial<CustomTab>} [$$source = {}] - The source object to create the CustomTab.
- */
- constructor($$source = {}) {
- if (!("name" in $$source)) {
- /**
- * 页面名称(Tab 按钮显示文字)
- * @member
- * @type {string}
- */
- this["name"] = "";
- }
- if (!("url" in $$source)) {
- /**
- * 页面地址(iframe 加载)
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("desc" in $$source)) {
- /**
- * 备注/提示信息(可空),Tab 说明文字优先显示
- * @member
- * @type {string}
- */
- this["desc"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new CustomTab instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {CustomTab}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new CustomTab(/** @type {Partial<CustomTab>} */($$parsedSource));
- }
- }
- /**
- * GitLabConfig 私有 GitLab(git.scwy.net)自动升级配置。
- * PrivateToken 为空时也可从 gitlab-cred.json 读取,避免令牌明文进设置文件。
- */
- export class GitLabConfig {
- /**
- * Creates a new GitLabConfig instance.
- * @param {Partial<GitLabConfig>} [$$source = {}] - The source object to create the GitLabConfig.
- */
- constructor($$source = {}) {
- if (!("baseUrl" in $$source)) {
- /**
- * GitLab 根地址,如 https://git.scwy.net
- * @member
- * @type {string}
- */
- this["baseUrl"] = "";
- }
- if (!("projectPath" in $$source)) {
- /**
- * 项目路径,如 ease/toolbox
- * @member
- * @type {string}
- */
- this["projectPath"] = "";
- }
- if (!("privateToken" in $$source)) {
- /**
- * 私有访问令牌(PRIVATE_TOKEN)
- * @member
- * @type {string}
- */
- this["privateToken"] = "";
- }
- if (!("branch" in $$source)) {
- /**
- * 版本清单所在分支或 Tag,默认 main
- * @member
- * @type {string}
- */
- this["branch"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new GitLabConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {GitLabConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new GitLabConfig(/** @type {Partial<GitLabConfig>} */($$parsedSource));
- }
- }
- /**
- * KLineBar 日 K 的一根柱子
- */
- export class KLineBar {
- /**
- * Creates a new KLineBar instance.
- * @param {Partial<KLineBar>} [$$source = {}] - The source object to create the KLineBar.
- */
- constructor($$source = {}) {
- if (!("date" in $$source)) {
- /**
- * 交易日
- * @member
- * @type {string}
- */
- this["date"] = "";
- }
- if (!("open" in $$source)) {
- /**
- * 开盘价
- * @member
- * @type {number}
- */
- this["open"] = 0;
- }
- if (!("close" in $$source)) {
- /**
- * 收盘价
- * @member
- * @type {number}
- */
- this["close"] = 0;
- }
- if (!("high" in $$source)) {
- /**
- * 最高价
- * @member
- * @type {number}
- */
- this["high"] = 0;
- }
- if (!("low" in $$source)) {
- /**
- * 最低价
- * @member
- * @type {number}
- */
- this["low"] = 0;
- }
- if (!("volume" in $$source)) {
- /**
- * 成交量(手)
- * @member
- * @type {number}
- */
- this["volume"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new KLineBar instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {KLineBar}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new KLineBar(/** @type {Partial<KLineBar>} */($$parsedSource));
- }
- }
- /**
- * LinkItem 常用网址条目
- */
- export class LinkItem {
- /**
- * Creates a new LinkItem instance.
- * @param {Partial<LinkItem>} [$$source = {}] - The source object to create the LinkItem.
- */
- constructor($$source = {}) {
- if (!("name" in $$source)) {
- /**
- * 网站名称
- * @member
- * @type {string}
- */
- this["name"] = "";
- }
- if (!("url" in $$source)) {
- /**
- * 网站地址
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new LinkItem instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {LinkItem}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new LinkItem(/** @type {Partial<LinkItem>} */($$parsedSource));
- }
- }
- /**
- * LocalSendConfig 是 LocalSend 的运行时配置。
- */
- export class LocalSendConfig {
- /**
- * Creates a new LocalSendConfig instance.
- * @param {Partial<LocalSendConfig>} [$$source = {}] - The source object to create the LocalSendConfig.
- */
- constructor($$source = {}) {
- if (!("enabled" in $$source)) {
- /**
- * 是否已启动服务
- * @member
- * @type {boolean}
- */
- this["enabled"] = false;
- }
- if (!("alias" in $$source)) {
- /**
- * 本机名称(广播给其他设备)
- * @member
- * @type {string}
- */
- this["alias"] = "";
- }
- if (!("receiveDir" in $$source)) {
- /**
- * 接收文件保存目录
- * @member
- * @type {string}
- */
- this["receiveDir"] = "";
- }
- if (!("autoAccept" in $$source)) {
- /**
- * true=自动接收;false=手动确认
- * @member
- * @type {boolean}
- */
- this["autoAccept"] = false;
- }
- if (!("port" in $$source)) {
- /**
- * 监听端口
- * @member
- * @type {number}
- */
- this["port"] = 0;
- }
- if (!("fingerprint" in $$source)) {
- /**
- * 本机证书指纹
- * @member
- * @type {string}
- */
- this["fingerprint"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new LocalSendConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {LocalSendConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new LocalSendConfig(/** @type {Partial<LocalSendConfig>} */($$parsedSource));
- }
- }
- /**
- * LocalTool 本地资源/工具配置项(「本地」页,在设置中维护)
- */
- export class LocalTool {
- /**
- * Creates a new LocalTool instance.
- * @param {Partial<LocalTool>} [$$source = {}] - The source object to create the LocalTool.
- */
- constructor($$source = {}) {
- if (!("title" in $$source)) {
- /**
- * 显示标题
- * @member
- * @type {string}
- */
- this["title"] = "";
- }
- if (!("cmd" in $$source)) {
- /**
- * 启动命令(程序/脚本,可带参数与环境变量)
- * @member
- * @type {string}
- */
- this["cmd"] = "";
- }
- if (!("desc" in $$source)) {
- /**
- * 说明文字(可空)
- * @member
- * @type {string}
- */
- this["desc"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new LocalTool instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {LocalTool}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new LocalTool(/** @type {Partial<LocalTool>} */($$parsedSource));
- }
- }
- /**
- * MemosConfig 保存 Memos 速记所需的配置。
- */
- export class MemosConfig {
- /**
- * Creates a new MemosConfig instance.
- * @param {Partial<MemosConfig>} [$$source = {}] - The source object to create the MemosConfig.
- */
- constructor($$source = {}) {
- if (!("url" in $$source)) {
- /**
- * 实例地址,如 https://m.scwy.net
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("token" in $$source)) {
- /**
- * 个人访问令牌(PAT),只存本地
- * @member
- * @type {string}
- */
- this["token"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new MemosConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {MemosConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new MemosConfig(/** @type {Partial<MemosConfig>} */($$parsedSource));
- }
- }
- /**
- * MinuteChart 分时图数据
- */
- export class MinuteChart {
- /**
- * Creates a new MinuteChart instance.
- * @param {Partial<MinuteChart>} [$$source = {}] - The source object to create the MinuteChart.
- */
- constructor($$source = {}) {
- if (!("code" in $$source)) {
- /**
- * 股票代码
- * @member
- * @type {string}
- */
- this["code"] = "";
- }
- if (!("prevClose" in $$source)) {
- /**
- * 昨收,作为分时基准线
- * @member
- * @type {number}
- */
- this["prevClose"] = 0;
- }
- if (!("points" in $$source)) {
- /**
- * 分时点序列
- * @member
- * @type {MinutePoint[]}
- */
- this["points"] = [];
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new MinuteChart instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {MinuteChart}
- */
- static createFrom($$source = {}) {
- const $$createField2_0 = $$createType25;
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- if ("points" in $$parsedSource) {
- $$parsedSource["points"] = $$createField2_0($$parsedSource["points"]);
- }
- return new MinuteChart(/** @type {Partial<MinuteChart>} */($$parsedSource));
- }
- }
- /**
- * MinutePoint 分时图上的一个点
- */
- export class MinutePoint {
- /**
- * Creates a new MinutePoint instance.
- * @param {Partial<MinutePoint>} [$$source = {}] - The source object to create the MinutePoint.
- */
- constructor($$source = {}) {
- if (!("time" in $$source)) {
- /**
- * HH:MM
- * @member
- * @type {string}
- */
- this["time"] = "";
- }
- if (!("price" in $$source)) {
- /**
- * 当前价
- * @member
- * @type {number}
- */
- this["price"] = 0;
- }
- if (!("avg" in $$source)) {
- /**
- * 均价
- * @member
- * @type {number}
- */
- this["avg"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new MinutePoint instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {MinutePoint}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new MinutePoint(/** @type {Partial<MinutePoint>} */($$parsedSource));
- }
- }
- /**
- * MonitorBrightnessInfo 单个显示器的亮度状态(返回给前端渲染滑块)
- */
- export class MonitorBrightnessInfo {
- /**
- * Creates a new MonitorBrightnessInfo instance.
- * @param {Partial<MonitorBrightnessInfo>} [$$source = {}] - The source object to create the MonitorBrightnessInfo.
- */
- constructor($$source = {}) {
- if (!("index" in $$source)) {
- /**
- * 显示器序号(与 SetBrightness 的 index 一致)
- * @member
- * @type {number}
- */
- this["index"] = 0;
- }
- if (!("name" in $$source)) {
- /**
- * 显示器名称(物理监视器描述,取不到时用设备名)
- * @member
- * @type {string}
- */
- this["name"] = "";
- }
- if (!("percent" in $$source)) {
- /**
- * 当前亮度百分比 0-100
- * @member
- * @type {number}
- */
- this["percent"] = 0;
- }
- if (!("hardware" in $$source)) {
- /**
- * true=DDC/CI 硬件调光;false=Gamma 软件调光
- * @member
- * @type {boolean}
- */
- this["hardware"] = false;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new MonitorBrightnessInfo instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {MonitorBrightnessInfo}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new MonitorBrightnessInfo(/** @type {Partial<MonitorBrightnessInfo>} */($$parsedSource));
- }
- }
- /**
- * MouseAlertConfig 系统级鼠标提醒气泡的显示配置
- */
- export class MouseAlertConfig {
- /**
- * Creates a new MouseAlertConfig instance.
- * @param {Partial<MouseAlertConfig>} [$$source = {}] - The source object to create the MouseAlertConfig.
- */
- constructor($$source = {}) {
- if (!("fontSize" in $$source)) {
- /**
- * 字号(px)
- * @member
- * @type {number}
- */
- this["fontSize"] = 0;
- }
- if (!("width" in $$source)) {
- /**
- * 气泡窗口宽度(px)
- * @member
- * @type {number}
- */
- this["width"] = 0;
- }
- if (!("speed" in $$source)) {
- /**
- * 超长文字滚动速度(px/s)
- * @member
- * @type {number}
- */
- this["speed"] = 0;
- }
- if (!("color" in $$source)) {
- /**
- * 文字颜色
- * @member
- * @type {string}
- */
- this["color"] = "";
- }
- if (!("background" in $$source)) {
- /**
- * 气泡背景色(COLORKEY 抠成透明,仅作底色参考)
- * @member
- * @type {string}
- */
- this["background"] = "";
- }
- if (!("duration" in $$source)) {
- /**
- * 显示时长(秒)
- * @member
- * @type {number}
- */
- this["duration"] = 0;
- }
- if (!("outlineColor" in $$source)) {
- /**
- * 文字描边颜色(白边/黑边,与文字形成反差)
- * @member
- * @type {string}
- */
- this["outlineColor"] = "";
- }
- if (!("outlineWidth" in $$source)) {
- /**
- * 文字描边宽度(px),0 表示关闭描边
- * @member
- * @type {number}
- */
- this["outlineWidth"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new MouseAlertConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {MouseAlertConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new MouseAlertConfig(/** @type {Partial<MouseAlertConfig>} */($$parsedSource));
- }
- }
- /**
- * NewsItem 一条新闻标题,供「新闻」页与新闻滚动条使用
- */
- export class NewsItem {
- /**
- * Creates a new NewsItem instance.
- * @param {Partial<NewsItem>} [$$source = {}] - The source object to create the NewsItem.
- */
- constructor($$source = {}) {
- if (!("source" in $$source)) {
- /**
- * 来源:煎蛋 / 腾讯 / Solidot / 财联社 / 热榜
- * @member
- * @type {string}
- */
- this["source"] = "";
- }
- if (!("title" in $$source)) {
- /**
- * 标题
- * @member
- * @type {string}
- */
- this["title"] = "";
- }
- if (!("url" in $$source)) {
- /**
- * 详情页地址
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("matched" in $$source)) {
- /**
- * 是否命中关注关键词
- * @member
- * @type {boolean}
- */
- this["matched"] = false;
- }
- if (!("hits" in $$source)) {
- /**
- * 命中的关键词个数(越多排越前,前端按档位配色)
- * @member
- * @type {number}
- */
- this["hits"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new NewsItem instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {NewsItem}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new NewsItem(/** @type {Partial<NewsItem>} */($$parsedSource));
- }
- }
- /**
- * PCStatus 电源命令状态快照,供 API 与「主机」页查询
- */
- export class PCStatus {
- /**
- * Creates a new PCStatus instance.
- * @param {Partial<PCStatus>} [$$source = {}] - The source object to create the PCStatus.
- */
- constructor($$source = {}) {
- if (!("command" in $$source)) {
- /**
- * 最近一次命令类型
- * @member
- * @type {string}
- */
- this["command"] = "";
- }
- if (!("pending" in $$source)) {
- /**
- * 是否有待执行命令
- * @member
- * @type {boolean}
- */
- this["pending"] = false;
- }
- if (!("executeAt" in $$source)) {
- /**
- * 计划执行时间
- * @member
- * @type {string}
- */
- this["executeAt"] = "";
- }
- if (!("remainingSecs" in $$source)) {
- /**
- * 剩余秒数
- * @member
- * @type {number}
- */
- this["remainingSecs"] = 0;
- }
- if (!("clientIp" in $$source)) {
- /**
- * 最近一次请求的客户端 IP
- * @member
- * @type {string}
- */
- this["clientIp"] = "";
- }
- if (!("requestTime" in $$source)) {
- /**
- * 最近一次请求时间
- * @member
- * @type {string}
- */
- this["requestTime"] = "";
- }
- if (!("requested" in $$source)) {
- /**
- * 是否收到过请求
- * @member
- * @type {boolean}
- */
- this["requested"] = false;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new PCStatus instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {PCStatus}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new PCStatus(/** @type {Partial<PCStatus>} */($$parsedSource));
- }
- }
- /**
- * PoemConfig 古诗显示的配置
- */
- export class PoemConfig {
- /**
- * Creates a new PoemConfig instance.
- * @param {Partial<PoemConfig>} [$$source = {}] - The source object to create the PoemConfig.
- */
- constructor($$source = {}) {
- if (!("enabled" in $$source)) {
- /**
- * 是否启用古诗显示
- * @member
- * @type {boolean}
- */
- this["enabled"] = false;
- }
- if (!("color" in $$source)) {
- /**
- * 文字颜色
- * @member
- * @type {string}
- */
- this["color"] = "";
- }
- if (!("fontSize" in $$source)) {
- /**
- * 字号(px)
- * @member
- * @type {number}
- */
- this["fontSize"] = 0;
- }
- if (!("tts" in $$source)) {
- /**
- * 允许 TTS 阅读(显示朗读按钮)
- * @member
- * @type {boolean}
- */
- this["tts"] = false;
- }
- if (!("interval" in $$source)) {
- /**
- * 自动换诗间隔(秒),0 表示不自动换
- * @member
- * @type {number}
- */
- this["interval"] = 0;
- }
- if (!("speed" in $$source)) {
- /**
- * 滚动速度(秒/轮),即滚动一个文本周期所需秒数,越小越快
- * @member
- * @type {number}
- */
- this["speed"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new PoemConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {PoemConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new PoemConfig(/** @type {Partial<PoemConfig>} */($$parsedSource));
- }
- }
- /**
- * PoemData 一首古诗的完整数据(从接口解析)
- */
- export class PoemData {
- /**
- * Creates a new PoemData instance.
- * @param {Partial<PoemData>} [$$source = {}] - The source object to create the PoemData.
- */
- constructor($$source = {}) {
- if (!("title" in $$source)) {
- /**
- * 题目
- * @member
- * @type {string}
- */
- this["title"] = "";
- }
- if (!("author" in $$source)) {
- /**
- * 作者
- * @member
- * @type {string}
- */
- this["author"] = "";
- }
- if (!("dynasty" in $$source)) {
- /**
- * 朝代
- * @member
- * @type {string}
- */
- this["dynasty"] = "";
- }
- if (!("content" in $$source)) {
- /**
- * 每句诗(数组,按行显示)
- * @member
- * @type {string[]}
- */
- this["content"] = [];
- }
- if (!("type" in $$source)) {
- /**
- * 体裁,如 五言律诗
- * @member
- * @type {string}
- */
- this["type"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new PoemData instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {PoemData}
- */
- static createFrom($$source = {}) {
- const $$createField3_0 = $$createType0;
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- if ("content" in $$parsedSource) {
- $$parsedSource["content"] = $$createField3_0($$parsedSource["content"]);
- }
- return new PoemData(/** @type {Partial<PoemData>} */($$parsedSource));
- }
- }
- /**
- * ProxyConfig 网络代理配置(工具页「网络代理」卡片)。
- * 仅保存地址,开关状态由系统代理注册表(ProxyEnable)实时决定,不在配置里持久化。
- */
- export class ProxyConfig {
- /**
- * Creates a new ProxyConfig instance.
- * @param {Partial<ProxyConfig>} [$$source = {}] - The source object to create the ProxyConfig.
- */
- constructor($$source = {}) {
- if (!("server" in $$source)) {
- /**
- * 代理服务器地址,如 127.0.0.1:7890
- * @member
- * @type {string}
- */
- this["server"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new ProxyConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {ProxyConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new ProxyConfig(/** @type {Partial<ProxyConfig>} */($$parsedSource));
- }
- }
- /**
- * ProxyStatus 网络代理当前状态
- */
- export class ProxyStatus {
- /**
- * Creates a new ProxyStatus instance.
- * @param {Partial<ProxyStatus>} [$$source = {}] - The source object to create the ProxyStatus.
- */
- constructor($$source = {}) {
- if (!("enabled" in $$source)) {
- /**
- * 系统代理是否开启
- * @member
- * @type {boolean}
- */
- this["enabled"] = false;
- }
- if (!("server" in $$source)) {
- /**
- * 代理服务器地址(如 127.0.0.1:7890)
- * @member
- * @type {string}
- */
- this["server"] = "";
- }
- if (!("configured" in $$source)) {
- /**
- * 配置里是否保存了代理地址(用于前端区分「未设置」)
- * @member
- * @type {boolean}
- */
- this["configured"] = false;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new ProxyStatus instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {ProxyStatus}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new ProxyStatus(/** @type {Partial<ProxyStatus>} */($$parsedSource));
- }
- }
- /**
- * RecordItem 一条记录:姓名 + 名称 + 值 + 备注 + 录入时间,供记录 Tab 列表与柱状图使用
- */
- export class RecordItem {
- /**
- * Creates a new RecordItem instance.
- * @param {Partial<RecordItem>} [$$source = {}] - The source object to create the RecordItem.
- */
- constructor($$source = {}) {
- if (!("name" in $$source)) {
- /**
- * 姓名
- * @member
- * @type {string}
- */
- this["name"] = "";
- }
- if (!("item" in $$source)) {
- /**
- * 名称
- * @member
- * @type {string}
- */
- this["item"] = "";
- }
- if (!("value" in $$source)) {
- /**
- * 值
- * @member
- * @type {number}
- */
- this["value"] = 0;
- }
- if (!("remark" in $$source)) {
- /**
- * 备注(可选)
- * @member
- * @type {string}
- */
- this["remark"] = "";
- }
- if (!("createdAt" in $$source)) {
- /**
- * 录入时间 YYYY-MM-DD HH:MM:SS(前端新增时生成;为空时后端用当前时间)
- * @member
- * @type {string}
- */
- this["createdAt"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new RecordItem instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {RecordItem}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new RecordItem(/** @type {Partial<RecordItem>} */($$parsedSource));
- }
- }
- /**
- * ReleaseItem 一个 GitHub release 的简略信息,用于列出 Latest 之后的版本(Pre-release 等)
- */
- export class ReleaseItem {
- /**
- * Creates a new ReleaseItem instance.
- * @param {Partial<ReleaseItem>} [$$source = {}] - The source object to create the ReleaseItem.
- */
- constructor($$source = {}) {
- if (!("tagName" in $$source)) {
- /**
- * 版本标签,如 v1.3.0-beta.1
- * @member
- * @type {string}
- */
- this["tagName"] = "";
- }
- if (!("name" in $$source)) {
- /**
- * release 显示名称(标题),可能比 tag 更完整,如 "Rolling: v2.1.0-..."
- * @member
- * @type {string}
- */
- this["name"] = "";
- }
- if (!("url" in $$source)) {
- /**
- * release 详情页地址
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("isPrerelease" in $$source)) {
- /**
- * 是否预发布版本
- * @member
- * @type {boolean}
- */
- this["isPrerelease"] = false;
- }
- if (!("isDraft" in $$source)) {
- /**
- * 是否草稿版本
- * @member
- * @type {boolean}
- */
- this["isDraft"] = false;
- }
- if (!("publishedAt" in $$source)) {
- /**
- * 发布时间(MM-DD HH:MM)
- * @member
- * @type {string}
- */
- this["publishedAt"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new ReleaseItem instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {ReleaseItem}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new ReleaseItem(/** @type {Partial<ReleaseItem>} */($$parsedSource));
- }
- }
- /**
- * RepoFeed 一个 GitHub 仓库的最新提交摘要
- */
- export class RepoFeed {
- /**
- * Creates a new RepoFeed instance.
- * @param {Partial<RepoFeed>} [$$source = {}] - The source object to create the RepoFeed.
- */
- constructor($$source = {}) {
- if (!("url" in $$source)) {
- /**
- * 仓库地址(设置中配置)
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("desc" in $$source)) {
- /**
- * 项目说明
- * @member
- * @type {string}
- */
- this["desc"] = "";
- }
- if (!("repo" in $$source)) {
- /**
- * owner/repo 短名
- * @member
- * @type {string}
- */
- this["repo"] = "";
- }
- if (!("version" in $$source)) {
- /**
- * 本地已安装版本(设置中配置)
- * @member
- * @type {string}
- */
- this["version"] = "";
- }
- if (!("versionTime" in $$source)) {
- /**
- * 本地版本对应 release 的发布时间(MM-DD HH:MM),用于鼠标提示
- * @member
- * @type {string}
- */
- this["versionTime"] = "";
- }
- if (!("latest" in $$source)) {
- /**
- * 最新正式 release 版本号,无正式 release 时为空
- * @member
- * @type {string}
- */
- this["latest"] = "";
- }
- if (!("latestTime" in $$source)) {
- /**
- * 最新正式 release 发布时间(MM-DD HH:MM),用于鼠标提示
- * @member
- * @type {string}
- */
- this["latestTime"] = "";
- }
- if (!("hasUpdate" in $$source)) {
- /**
- * 是否存在可用更新(本地版本低于最新正式 release)
- * @member
- * @type {boolean}
- */
- this["hasUpdate"] = false;
- }
- if (!("releaseURL" in $$source)) {
- /**
- * 最新正式 release 的下载 / 详情页地址
- * @member
- * @type {string}
- */
- this["releaseURL"] = "";
- }
- if (!("newer" in $$source)) {
- /**
- * Latest 之后的版本(Pre-release 等,仅列出不参与更新比较)
- * @member
- * @type {ReleaseItem[]}
- */
- this["newer"] = [];
- }
- if (!("commits" in $$source)) {
- /**
- * 最近提交(最多 5 条)
- * @member
- * @type {CommitItem[]}
- */
- this["commits"] = [];
- }
- if (!("error" in $$source)) {
- /**
- * 抓取失败原因,为空表示正常
- * @member
- * @type {string}
- */
- this["error"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new RepoFeed instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {RepoFeed}
- */
- static createFrom($$source = {}) {
- const $$createField9_0 = $$createType27;
- const $$createField10_0 = $$createType29;
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- if ("newer" in $$parsedSource) {
- $$parsedSource["newer"] = $$createField9_0($$parsedSource["newer"]);
- }
- if ("commits" in $$parsedSource) {
- $$parsedSource["commits"] = $$createField10_0($$parsedSource["commits"]);
- }
- return new RepoFeed(/** @type {Partial<RepoFeed>} */($$parsedSource));
- }
- }
- /**
- * RepoItem 关注的 GitHub 仓库条目
- */
- export class RepoItem {
- /**
- * Creates a new RepoItem instance.
- * @param {Partial<RepoItem>} [$$source = {}] - The source object to create the RepoItem.
- */
- constructor($$source = {}) {
- if (!("url" in $$source)) {
- /**
- * 仓库地址,如 https://github.com/wailsapp/wails
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("desc" in $$source)) {
- /**
- * 项目说明
- * @member
- * @type {string}
- */
- this["desc"] = "";
- }
- if (!("version" in $$source)) {
- /**
- * 本地已安装版本(用于与最新 release 比较),可为空
- * @member
- * @type {string}
- */
- this["version"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new RepoItem instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {RepoItem}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new RepoItem(/** @type {Partial<RepoItem>} */($$parsedSource));
- }
- }
- /**
- * ServiceModeStatus 服务模式运行状态(服务页展示)
- */
- export class ServiceModeStatus {
- /**
- * Creates a new ServiceModeStatus instance.
- * @param {Partial<ServiceModeStatus>} [$$source = {}] - The source object to create the ServiceModeStatus.
- */
- constructor($$source = {}) {
- if (!("addr" in $$source)) {
- /**
- * 服务模式监听地址
- * @member
- * @type {string}
- */
- this["addr"] = "";
- }
- if (!("running" in $$source)) {
- /**
- * 该地址上的电源 API 是否可用
- * @member
- * @type {boolean}
- */
- this["running"] = false;
- }
- if (!("managed" in $$source)) {
- /**
- * true=由真正的 Windows 服务提供;false=界面进程兜底
- * @member
- * @type {boolean}
- */
- this["managed"] = false;
- }
- if (!("occupied" in $$source)) {
- /**
- * 端口被其他程序占用(既非服务模式也非本程序)
- * @member
- * @type {boolean}
- */
- this["occupied"] = false;
- }
- if (!("version" in $$source)) {
- /**
- * 服务端版本(可用时)
- * @member
- * @type {string}
- */
- this["version"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new ServiceModeStatus instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {ServiceModeStatus}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new ServiceModeStatus(/** @type {Partial<ServiceModeStatus>} */($$parsedSource));
- }
- }
- /**
- * StockQuote 单只股票的行情快照,供前端「股市」页展示
- */
- export class StockQuote {
- /**
- * Creates a new StockQuote instance.
- * @param {Partial<StockQuote>} [$$source = {}] - The source object to create the StockQuote.
- */
- constructor($$source = {}) {
- if (!("code" in $$source)) {
- /**
- * 带市场前缀的代码,如 sh600519
- * @member
- * @type {string}
- */
- this["code"] = "";
- }
- if (!("name" in $$source)) {
- /**
- * 股票名称
- * @member
- * @type {string}
- */
- this["name"] = "";
- }
- if (!("price" in $$source)) {
- /**
- * 当前价
- * @member
- * @type {number}
- */
- this["price"] = 0;
- }
- if (!("change" in $$source)) {
- /**
- * 涨跌额
- * @member
- * @type {number}
- */
- this["change"] = 0;
- }
- if (!("changePercent" in $$source)) {
- /**
- * 涨跌幅(%)
- * @member
- * @type {number}
- */
- this["changePercent"] = 0;
- }
- if (!("amount" in $$source)) {
- /**
- * 成交额(万元)
- * @member
- * @type {number}
- */
- this["amount"] = 0;
- }
- if (!("time" in $$source)) {
- /**
- * 行情时间 HH:MM:SS
- * @member
- * @type {string}
- */
- this["time"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new StockQuote instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {StockQuote}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new StockQuote(/** @type {Partial<StockQuote>} */($$parsedSource));
- }
- }
- /**
- * TickerConfig 置顶滚动条(股票 / 新闻)的显示配置
- */
- export class TickerConfig {
- /**
- * Creates a new TickerConfig instance.
- * @param {Partial<TickerConfig>} [$$source = {}] - The source object to create the TickerConfig.
- */
- constructor($$source = {}) {
- if (!("enabled" in $$source)) {
- /**
- * 是否显示滚动条窗口
- * @member
- * @type {boolean}
- */
- this["enabled"] = false;
- }
- if (!("width" in $$source)) {
- /**
- * 窗口宽度(px),0 表示默认 1400
- * @member
- * @type {number}
- */
- this["width"] = 0;
- }
- if (!("fontSize" in $$source)) {
- /**
- * 字号(px)
- * @member
- * @type {number}
- */
- this["fontSize"] = 0;
- }
- if (!("color" in $$source)) {
- /**
- * 文字颜色
- * @member
- * @type {string}
- */
- this["color"] = "";
- }
- if (!("speed" in $$source)) {
- /**
- * 滚动速度(px/s)
- * @member
- * @type {number}
- */
- this["speed"] = 0;
- }
- if (!("transparent" in $$source)) {
- /**
- * 背景透明,不遮挡下方内容
- * @member
- * @type {boolean}
- */
- this["transparent"] = false;
- }
- if (!("x" in $$source)) {
- /**
- * 窗口位置,-1 表示未设置(系统默认位置)
- * @member
- * @type {number}
- */
- this["x"] = 0;
- }
- if (!("y" in $$source)) {
- /**
- * 窗口位置,-1 表示未设置
- * @member
- * @type {number}
- */
- this["y"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new TickerConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {TickerConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new TickerConfig(/** @type {Partial<TickerConfig>} */($$parsedSource));
- }
- }
- /**
- * TranslateResult 一次翻译的结果,供前端展示。
- */
- export class TranslateResult {
- /**
- * Creates a new TranslateResult instance.
- * @param {Partial<TranslateResult>} [$$source = {}] - The source object to create the TranslateResult.
- */
- constructor($$source = {}) {
- if (!("text" in $$source)) {
- /**
- * 翻译结果文本
- * @member
- * @type {string}
- */
- this["text"] = "";
- }
- if (!("detected" in $$source)) {
- /**
- * 检测到的源语言(zh / en)
- * @member
- * @type {string}
- */
- this["detected"] = "";
- }
- if (!("target" in $$source)) {
- /**
- * 目标语言(zh / en)
- * @member
- * @type {string}
- */
- this["target"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new TranslateResult instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {TranslateResult}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new TranslateResult(/** @type {Partial<TranslateResult>} */($$parsedSource));
- }
- }
- /**
- * TrendingRepo 一个热门仓库条目(来源可为 GitHub Trending 或 HelloGitHub)
- */
- export class TrendingRepo {
- /**
- * Creates a new TrendingRepo instance.
- * @param {Partial<TrendingRepo>} [$$source = {}] - The source object to create the TrendingRepo.
- */
- constructor($$source = {}) {
- if (!("name" in $$source)) {
- /**
- * owner/repo 短名
- * @member
- * @type {string}
- */
- this["name"] = "";
- }
- if (!("url" in $$source)) {
- /**
- * 仓库主页地址(GitHub 直链)
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("desc" in $$source)) {
- /**
- * 简介(英文已自动翻译为中文,翻译失败保留原文)
- * @member
- * @type {string}
- */
- this["desc"] = "";
- }
- if (!("lang" in $$source)) {
- /**
- * 主要语言,无则空
- * @member
- * @type {string}
- */
- this["lang"] = "";
- }
- if (!("stars" in $$source)) {
- /**
- * 总星数(如 "106,375")
- * @member
- * @type {string}
- */
- this["stars"] = "";
- }
- if (!("todayStars" in $$source)) {
- /**
- * 今日新增星数(如 "1,140",无则空)
- * @member
- * @type {string}
- */
- this["todayStars"] = "";
- }
- if (!("forks" in $$source)) {
- /**
- * fork 数(如 "9,365",无则空)
- * @member
- * @type {string}
- */
- this["forks"] = "";
- }
- if (!("source" in $$source)) {
- /**
- * 来源:"github"(GitHub Trending)/ "hellogithub"
- * @member
- * @type {string}
- */
- this["source"] = "";
- }
- if (!("heat" in $$source)) {
- /**
- * 热度(HelloGitHub 点击量,其它来源为空)
- * @member
- * @type {string}
- */
- this["heat"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new TrendingRepo instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {TrendingRepo}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new TrendingRepo(/** @type {Partial<TrendingRepo>} */($$parsedSource));
- }
- }
- /**
- * UDPInfo 描述一次 UDP 键值服务的运行状态,供前端展示。
- */
- export class UDPInfo {
- /**
- * Creates a new UDPInfo instance.
- * @param {Partial<UDPInfo>} [$$source = {}] - The source object to create the UDPInfo.
- */
- constructor($$source = {}) {
- if (!("running" in $$source)) {
- /**
- * 是否运行中
- * @member
- * @type {boolean}
- */
- this["running"] = false;
- }
- if (!("port" in $$source)) {
- /**
- * 监听端口
- * @member
- * @type {number}
- */
- this["port"] = 0;
- }
- if (!("addr" in $$source)) {
- /**
- * 监听地址 udp://0.0.0.0:port
- * @member
- * @type {string}
- */
- this["addr"] = "";
- }
- if (!("startedAt" in $$source)) {
- /**
- * 启动时间
- * @member
- * @type {string}
- */
- this["startedAt"] = "";
- }
- if (!("error" in $$source)) {
- /**
- * 最近一次错误
- * @member
- * @type {string}
- */
- this["error"] = "";
- }
- if (!("rxCount" in $$source)) {
- /**
- * 累计接收数据包数
- * @member
- * @type {number}
- */
- this["rxCount"] = 0;
- }
- if (!("txCount" in $$source)) {
- /**
- * 累计发送(回发/手动)数据包数
- * @member
- * @type {number}
- */
- this["txCount"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new UDPInfo instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {UDPInfo}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new UDPInfo(/** @type {Partial<UDPInfo>} */($$parsedSource));
- }
- }
- /**
- * WebServiceInfo 描述一次 Web 服务运行实例的状态,供前端展示。
- */
- export class WebServiceInfo {
- /**
- * Creates a new WebServiceInfo instance.
- * @param {Partial<WebServiceInfo>} [$$source = {}] - The source object to create the WebServiceInfo.
- */
- constructor($$source = {}) {
- if (!("running" in $$source)) {
- /**
- * 是否运行中
- * @member
- * @type {boolean}
- */
- this["running"] = false;
- }
- if (!("dir" in $$source)) {
- /**
- * 服务目录
- * @member
- * @type {string}
- */
- this["dir"] = "";
- }
- if (!("url" in $$source)) {
- /**
- * 访问地址 http://127.0.0.1:port/
- * @member
- * @type {string}
- */
- this["url"] = "";
- }
- if (!("indexName" in $$source)) {
- /**
- * 实际用作默认页的文件(index.html / readme.md / 空)
- * @member
- * @type {string}
- */
- this["indexName"] = "";
- }
- if (!("startedAt" in $$source)) {
- /**
- * 启动时间
- * @member
- * @type {string}
- */
- this["startedAt"] = "";
- }
- if (!("error" in $$source)) {
- /**
- * 最近一次错误
- * @member
- * @type {string}
- */
- this["error"] = "";
- }
- if (!("connections" in $$source)) {
- /**
- * 累计请求次数
- * @member
- * @type {number}
- */
- this["connections"] = 0;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new WebServiceInfo instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {WebServiceInfo}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new WebServiceInfo(/** @type {Partial<WebServiceInfo>} */($$parsedSource));
- }
- }
- /**
- * YTDLPConfig 是「视频下载」的配置。
- */
- export class YTDLPConfig {
- /**
- * Creates a new YTDLPConfig instance.
- * @param {Partial<YTDLPConfig>} [$$source = {}] - The source object to create the YTDLPConfig.
- */
- constructor($$source = {}) {
- if (!("dir" in $$source)) {
- /**
- * 下载保存目录,空=程序当前工作目录
- * @member
- * @type {string}
- */
- this["dir"] = "";
- }
- if (!("mp3Quality" in $$source)) {
- /**
- * mp3 转换质量:0-9(VBR,0 最好)或 128K/192K/320K,默认 0
- * @member
- * @type {string}
- */
- this["mp3Quality"] = "";
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new YTDLPConfig instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {YTDLPConfig}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new YTDLPConfig(/** @type {Partial<YTDLPConfig>} */($$parsedSource));
- }
- }
- /**
- * YTDLPInfo 描述本机 yt-dlp 的可用性,用于前端决定是否展示工具卡片。
- */
- export class YTDLPInfo {
- /**
- * Creates a new YTDLPInfo instance.
- * @param {Partial<YTDLPInfo>} [$$source = {}] - The source object to create the YTDLPInfo.
- */
- constructor($$source = {}) {
- if (!("available" in $$source)) {
- /**
- * PATH 中是否找到 yt-dlp
- * @member
- * @type {boolean}
- */
- this["available"] = false;
- }
- if (!("path" in $$source)) {
- /**
- * yt-dlp 可执行文件路径
- * @member
- * @type {string}
- */
- this["path"] = "";
- }
- if (!("version" in $$source)) {
- /**
- * 版本信息(yt-dlp --version 输出)
- * @member
- * @type {string}
- */
- this["version"] = "";
- }
- if (!("ffmpeg" in $$source)) {
- /**
- * PATH 中是否找到 ffmpeg(用于「下载转 mp3」)
- * @member
- * @type {boolean}
- */
- this["ffmpeg"] = false;
- }
- Object.assign(this, $$source);
- }
- /**
- * Creates a new YTDLPInfo instance from a string or object.
- * @param {any} [$$source = {}]
- * @returns {YTDLPInfo}
- */
- static createFrom($$source = {}) {
- let $$parsedSource = typeof $$source === 'string' ? JSON.parse($$source) : $$source;
- return new YTDLPInfo(/** @type {Partial<YTDLPInfo>} */($$parsedSource));
- }
- }
- // Private type creation functions
- const $$createType0 = $Create.Array($Create.Any);
- const $$createType1 = LinkItem.createFrom;
- const $$createType2 = $Create.Array($$createType1);
- const $$createType3 = RepoItem.createFrom;
- const $$createType4 = $Create.Array($$createType3);
- const $$createType5 = CustomTab.createFrom;
- const $$createType6 = $Create.Array($$createType5);
- const $$createType7 = LocalTool.createFrom;
- const $$createType8 = $Create.Array($$createType7);
- const $$createType9 = ControlKeyConfig.createFrom;
- const $$createType10 = $Create.Array($$createType9);
- const $$createType11 = TickerConfig.createFrom;
- const $$createType12 = PoemConfig.createFrom;
- const $$createType13 = MouseAlertConfig.createFrom;
- const $$createType14 = LocalSendConfig.createFrom;
- const $$createType15 = CrocConfig.createFrom;
- const $$createType16 = YTDLPConfig.createFrom;
- const $$createType17 = MemosConfig.createFrom;
- const $$createType18 = BrightnessConfig.createFrom;
- const $$createType19 = GitLabConfig.createFrom;
- const $$createType20 = ProxyConfig.createFrom;
- const $$createType21 = BiliDynamicItem.createFrom;
- const $$createType22 = $Create.Array($$createType21);
- const $$createType23 = $Create.Map($Create.Any, $Create.Any);
- const $$createType24 = MinutePoint.createFrom;
- const $$createType25 = $Create.Array($$createType24);
- const $$createType26 = ReleaseItem.createFrom;
- const $$createType27 = $Create.Array($$createType26);
- const $$createType28 = CommitItem.createFrom;
- const $$createType29 = $Create.Array($$createType28);
|