[Feat] Download PLS from API

This commit is contained in:
Minoricew
2025-06-09 18:02:11 +08:00
parent 8ab55bc93c
commit ed29f1b86f
13 changed files with 662 additions and 55 deletions

21
src/aura/types/main/ipc/fs.d.ts vendored Normal file
View File

@@ -0,0 +1,21 @@
type DownloadTaskID = string;
type DownloadTaskStatus = "waiting" | "progressing" | "done" | "failed" | "cancelled";
interface DownloadTask {
id: DownloadTaskID;
progress: float;
curBytes?: number;
totalBytes?: number;
status: DownloadTaskStatus;
dlUrl: string | null;
savePath: string | null;
message?: string;
errorObj?: Error;
}
interface FSTasks {
downloadTasks: Map<
DownloadTaskID,
{ status: DownloadTaskStatus; cancelReq: any }
>;
}

View File

@@ -11,6 +11,7 @@ type RendererProcessOnlyVal<T> = T;
interface GlobalHugoAuraInfo {
central?: MainProcessOnlyVal<(...args: any) => any>;
configInit: boolean;
fsTasks?: MainProcessOnlyVal<FSTasks>;
hookedWindows?: MainProcessOnlyVal<HookedWindowsMap>;
ipcInit?: MainProcessOnlyVal<boolean>;
plsRules?: Record<any, any> | null;
@@ -22,12 +23,19 @@ interface GlobalHugoAuraInfo {
version: RendererProcessOnlyVal<string>;
}
interface GlobalHugoAuraApiInfo {
baseUrl: string;
plsUpdate: string;
auraUpdate: string;
}
type GlobalHugoAuraConfig = AuraConfig;
declare global {
var ipcRenderer: RendererProcessOnlyVal<IpcRenderer>;
var _ACCEPT_DATA: any;
var __HUGO_AURA__: GlobalHugoAuraInfo;
var __HUGO_AURA_API__: GlobalHugoAuraApiInfo;
var __HUGO_AURA_CONFIG__: GlobalHugoAuraConfig;
var __HUGO_AURA_CONFIG_MGR__: ConfigManager;
var __HUGO_AURA_EVENT_BUS__: EventBus;

View File

@@ -12,4 +12,4 @@ interface PLSStatus {
type PLSLifecycleType = "isDetached" | "isSvcInstalled" | "isSvcStart";
type PLSLifecycleControlType = "instSvc" | "rmSvc" | "startSvc" | "stopSvc";
type PLSLifecycleControlType = "instSvc" | "rmSvc" | "startSvc" | "stopSvc" | "rmBin" | "dlBin";