aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/VencordNative.ts2
-rw-r--r--src/globals.d.ts6
-rw-r--r--src/patcher.ts4
3 files changed, 8 insertions, 4 deletions
diff --git a/src/VencordNative.ts b/src/VencordNative.ts
index 1798cbf..0fc5d16 100644
--- a/src/VencordNative.ts
+++ b/src/VencordNative.ts
@@ -7,5 +7,5 @@ export default {
cb(css);
});
},
- getQuickCss: () => ipcRenderer.invoke(IPC_GET_QUICK_CSS)
+ getQuickCss: () => ipcRenderer.invoke(IPC_GET_QUICK_CSS) as Promise<string>
}; \ No newline at end of file
diff --git a/src/globals.d.ts b/src/globals.d.ts
index 610466a..ca43786 100644
--- a/src/globals.d.ts
+++ b/src/globals.d.ts
@@ -1,7 +1,5 @@
-import TVencordNative from "./VencordNative";
-
declare global {
- export var VencordNative: typeof TVencordNative;
+ export var VencordNative: typeof import("./VencordNative").default;
export var appSettings: {
set(setting: string, v: any): void;
};
@@ -12,3 +10,5 @@ declare global {
};
}
}
+
+export { }; \ No newline at end of file
diff --git a/src/patcher.ts b/src/patcher.ts
index 9fe3dd2..e991377 100644
--- a/src/patcher.ts
+++ b/src/patcher.ts
@@ -20,6 +20,10 @@ class BrowserWindow extends electron.BrowserWindow {
}
}
Object.assign(BrowserWindow, electron.BrowserWindow);
+// esbuild may rename our BrowserWindow, which leads to it being excluded
+// from getFocusedWindow(), so this is necessary
+// https://github.com/discord/electron/blob/13-x-y/lib/browser/api/browser-window.ts#L60-L62
+Object.defineProperty(BrowserWindow, "name", { value: "BrowserWindow", configurable: true });
// Replace electrons exports with our custom BrowserWindow
const electronPath = require.resolve("electron");