Skip to content

Mopsgamer/discord-env-types

Repository files navigation

discord-env-types

This package adds Discord environment types.

Warning

The Discord environment is subject to change and some declarations may lie.

Installation

npm install --save-dev discord-env-types

Usage

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'.

Declarations

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

About

Type definitions for Discord environment.

Resources

License

Stars

Watchers

Forks

Packages

No packages published