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);