diff options
author | Vendicated <vendicated@riseup.net> | 2022-10-16 17:15:15 +0200 |
---|---|---|
committer | Vendicated <vendicated@riseup.net> | 2022-10-16 17:15:15 +0200 |
commit | 01ae0983b378ca478e7b6891e183718e8c45ed02 (patch) | |
tree | aac88bfa3bf4308fa067377c814fdd45a5601971 /src/globals.d.ts | |
parent | 845088ec024d56af4d7fdd4cd861c2aa89dbceb6 (diff) | |
download | Vencord-01ae0983b378ca478e7b6891e183718e8c45ed02.tar.gz Vencord-01ae0983b378ca478e7b6891e183718e8c45ed02.tar.bz2 Vencord-01ae0983b378ca478e7b6891e183718e8c45ed02.zip |
Optimise Web via treeshaking, cleanup build scripts
Diffstat (limited to 'src/globals.d.ts')
-rw-r--r-- | src/globals.d.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/globals.d.ts b/src/globals.d.ts index 4320e1c..72b0b28 100644 --- a/src/globals.d.ts +++ b/src/globals.d.ts @@ -1,10 +1,30 @@ declare global { + /** + * This exists only at build time, so references to it in patches should insert it + * via String interpolation OR use different replacement code based on this + * but NEVER refrence it inside the patched code + * + * @example + * // BAD + * replace: "IS_WEB?foo:bar" + * // GOOD + * replace: IS_WEB ? "foo" : "bar" + * // also good + * replace: `${IS_WEB}?foo:bar` + */ export var IS_WEB: boolean; export var VencordNative: typeof import("./VencordNative").default; export var Vencord: typeof import("./Vencord"); export var appSettings: { set(setting: string, v: any): void; }; + /** + * Only available when running in Electron, undefined on web. + * Thus, avoid using this or only use it inside an {@link IS_WEB} guard. + * + * If you really must use it, mark your plugin as Desktop App only via + * `target: "DESKTOP"` + */ export var DiscordNative: any; interface Window { |