From 11ecc45b71f7319a6934aae4eb9c9bf95b64011e Mon Sep 17 00:00:00 2001 From: Vendicated Date: Wed, 19 Apr 2023 23:12:39 +0200 Subject: [PATCH] more fixes --- packages/vencord-types/.gitignore | 1 + packages/vencord-types/globals.d.ts | 24 ++++++++++++++++++++++++ packages/vencord-types/prepare.ts | 3 +++ 3 files changed, 28 insertions(+) create mode 100644 packages/vencord-types/globals.d.ts diff --git a/packages/vencord-types/.gitignore b/packages/vencord-types/.gitignore index fa36cd79..794d3122 100644 --- a/packages/vencord-types/.gitignore +++ b/packages/vencord-types/.gitignore @@ -4,3 +4,4 @@ !README.md !prepare.ts !index.d.ts +!globals.d.ts diff --git a/packages/vencord-types/globals.d.ts b/packages/vencord-types/globals.d.ts new file mode 100644 index 00000000..a5916e54 --- /dev/null +++ b/packages/vencord-types/globals.d.ts @@ -0,0 +1,24 @@ +/* + * Vencord, a modification for Discord's desktop app + * Copyright (c) 2022 Vendicated and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . +*/ + +declare global { + export var VencordNative: typeof import("./VencordNative").default; + export var Vencord: typeof import("./Vencord"); +} + +export { }; diff --git a/packages/vencord-types/prepare.ts b/packages/vencord-types/prepare.ts index 1f2e08d6..4c14c6da 100644 --- a/packages/vencord-types/prepare.ts +++ b/packages/vencord-types/prepare.ts @@ -27,6 +27,9 @@ for (const file of ["preload.d.ts", "userplugins", "main", "debug"]) { function copyDtsFiles(from: string, to: string) { for (const file of readdirSync(from, { withFileTypes: true })) { + // bad + if (from === SRC && file.name === "globals.d.ts") continue; + const fullFrom = join(from, file.name); const fullTo = join(to, file.name);