Warning
The Discord environment is subject to change and some declarations may lie.
npm install --save-dev discord-env-types
If you want to declare global Discord environment variables:
import type DET from "discord-env-types";
DiscordNative.clipboard.copy("test");
import type DET from "discord-env-types";
const PickedNative: Pick<DET.DiscordNative, "clipboard" | "settings"> = ...;
PickedNative.clipboard.copy("test");
DiscordNative.clipboard.copy("test");
If you want to use types only, without global declarations:
import type DET from "discord-env-types/lib";
const PickedNative: Pick<DET.DiscordNative, "clipboard" | "settings"> = ...;
PickedNative.clipboard.copy("test");
DiscordNative.clipboard.copy("test"); // Error: Cannot find name 'DiscordNative'.
discord-env-types declares the types of the following variables:
__BILLING_STANDALONE__
__DISCORD_WINDOW_ID
__localeData__
__OVERLAY__
__SECRET_EMOTION__
__SENTRY__
__sentry_instrumentation_handlers__
__SENTRY_IPC__
__timingFunction
_
_ws
DiscordErrors
DiscordNative
DiscordSentry
DiscordVideo
GLOBAL_ENV
webpackChunkdiscord_app