mirror of
https://github.com/HugoAura/Seewo-HugoAura.git
synced 2026-06-30 05:54:26 +08:00
[Feat] New settings passwd UX & Config enc support
This commit is contained in:
11
src/aura/types/main/core.d.ts
vendored
11
src/aura/types/main/core.d.ts
vendored
@@ -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>;
|
||||
|
||||
3
src/aura/types/render/global.d.ts
vendored
3
src/aura/types/render/global.d.ts
vendored
@@ -12,3 +12,6 @@ interface DesktopAssistantHugoAuraGlobal extends HugoAuraGlobal {
|
||||
plsWs: WebSocket | null;
|
||||
plsStats: PLSStatus;
|
||||
}
|
||||
|
||||
type UIFunctionsObject = Record<string, any>;
|
||||
type UIReactivesObject = Record<string, any>;
|
||||
|
||||
2
src/aura/types/render/uiHook.d.ts
vendored
2
src/aura/types/render/uiHook.d.ts
vendored
@@ -23,3 +23,5 @@ interface UIHookConfig {
|
||||
interface UIHookConfigFin extends UIHookConfig {
|
||||
windowName: WindowName;
|
||||
}
|
||||
|
||||
type UIHooksObject = Record<AuraElementUID, UIHookConfigFin>;
|
||||
|
||||
3
src/aura/types/shared/config.d.ts
vendored
3
src/aura/types/shared/config.d.ts
vendored
@@ -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
37
src/aura/types/shared/global.d.ts
vendored
Executable 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>;
|
||||
}
|
||||
Reference in New Issue
Block a user