From 277401c75211396261ad601fa47e8f681f03a1ca Mon Sep 17 00:00:00 2001 From: V Date: Tue, 30 May 2023 20:03:49 +0200 Subject: [PATCH] [TS] Properly type __vendettaVersion (#78) --- src/def.d.ts | 4 +++- src/entry.ts | 1 - src/lib/debug.ts | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/def.d.ts b/src/def.d.ts index 842fa78..f0bfbab 100644 --- a/src/def.d.ts +++ b/src/def.d.ts @@ -134,7 +134,7 @@ interface ThemeData { blur?: number; /** * The alpha value of the background. - * `CHAT_BACKGROUND` of semanticColors alpha value will be ignored when this is specified + * `CHAT_BACKGROUND` of semanticColors alpha value will be ignored when this is specified */ alpha?: number; } @@ -505,6 +505,8 @@ interface VendettaPluginObject { declare global { type React = typeof _React; + const __vendettaVersion: string; + interface Window { [key: PropertyKey]: any; modules: MetroModules; diff --git a/src/entry.ts b/src/entry.ts index 1725164..9dfbcf2 100644 --- a/src/entry.ts +++ b/src/entry.ts @@ -8,7 +8,6 @@ import(".").then((m) => m.default()).catch((e) => { alert([ "Failed to load Vendetta!\n", `Build Number: ${ClientInfoManager.Build}`, - // @ts-expect-error, replaced in build script `Vendetta: ${__vendettaVersion}`, e?.stack || e.toString(), ].join("\n")); diff --git a/src/lib/debug.ts b/src/lib/debug.ts index c473185..1bb6521 100644 --- a/src/lib/debug.ts +++ b/src/lib/debug.ts @@ -59,7 +59,6 @@ export function patchLogHook() { } } -// @ts-expect-error export const versionHash: string = __vendettaVersion; export function getDebugInfo() {