[Feat] New settings passwd UX & Config enc support

This commit is contained in:
Minoricew
2025-06-05 00:35:50 +08:00
parent fbc5cf1f57
commit 7c8d3d4fbc
33 changed files with 2006 additions and 675 deletions

View File

@@ -21,13 +21,6 @@ type HookedWindowsMap = Map<WindowName, HookedWindow>;
type HookRequire = any;
type HooksMap = Map<WindowName, HookRequire>;
type UIHooksMap = Map<WindowName, HookRequire>;
interface MainProcessGlobal {
hookedWindows: HookedWindowsMap;
hooks: HooksMap;
configInit: boolean;
plsStats: PLSStatus | null;
plsSettings: Record<any, any> | null;
plsRules: Record<any, any> | null;
}
type WindowHooksMap = Map<WindowName, HookRequire>;

View File

@@ -12,3 +12,6 @@ interface DesktopAssistantHugoAuraGlobal extends HugoAuraGlobal {
plsWs: WebSocket | null;
plsStats: PLSStatus;
}
type UIFunctionsObject = Record<string, any>;
type UIReactivesObject = Record<string, any>;

View File

@@ -23,3 +23,5 @@ interface UIHookConfig {
interface UIHookConfigFin extends UIHookConfig {
windowName: WindowName;
}
type UIHooksObject = Record<AuraElementUID, UIHookConfigFin>;

View File

@@ -1,5 +1,6 @@
type AES256EncryptedConfig = string;
type Base64String = string;
type SHA256EncryptedPassword = string;
interface EncryptedConfig {
content: AES256EncryptedConfig;
@@ -7,3 +8,5 @@ interface EncryptedConfig {
salt: Base64String;
iv: Base64String;
}
type AuraConfig = Record<any, any>;

37
src/aura/types/shared/global.d.ts vendored Executable file
View File

@@ -0,0 +1,37 @@
import { IpcRenderer } from "electron";
import type EventBus from "../../utils/eventBus";
import { HookedWindowsMap, UIHooksMap, WindowHooksMap } from "../main/core";
import { UIHooksObject } from "../render/uiHook";
import ConfigManager from "../../init/shared/configManager";
type MainProcessOnlyVal<T> = T;
type RendererProcessOnlyVal<T> = T;
interface GlobalHugoAuraInfo {
central?: MainProcessOnlyVal<(...args: any) => any>;
configInit: boolean;
hookedWindows?: MainProcessOnlyVal<HookedWindowsMap>;
ipcInit?: MainProcessOnlyVal<boolean>;
plsRules?: Record<any, any> | null;
plsSettings?: Record<any, any> | null;
plsStats?: PLSStatus | null;
uiHooks?: MainProcessOnlyVal<UIHooksMap>;
windowHooks?: MainProcessOnlyVal<WindowHooksMap>;
version: RendererProcessOnlyVal<string>;
}
type GlobalHugoAuraConfig = AuraConfig;
declare global {
var ipcRenderer: RendererProcessOnlyVal<IpcRenderer>;
var __HUGO_AURA__: GlobalHugoAuraInfo;
var __HUGO_AURA_CONFIG__: GlobalHugoAuraConfig;
var __HUGO_AURA_CONFIG_MGR__: ConfigManager;
var __HUGO_AURA_EVENT_BUS__: EventBus;
var __HUGO_AURA_DEBUG__: RendererProcessOnlyVal<Record<any, any>>;
var __HUGO_AURA_GLOBAL__: RendererProcessOnlyVal<Record<any, any>>;
var __HUGO_AURA_HOOK__: RendererProcessOnlyVal<Record<any, any>>;
var __HUGO_AURA_LOADER__: RendererProcessOnlyVal<UIHooksObject>;
var __HUGO_AURA_UI_FUNCTIONS__: RendererProcessOnlyVal<UIFunctionsObject>;
var __HUGO_AURA_UI_REACTIVES__: RendererProcessOnlyVal<UIReactivesObject>;
}