Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mopsgamer/discord-env-types
Type definitions for Discord environment.
https://github.com/mopsgamer/discord-env-types
Last synced: about 2 months ago
JSON representation
Type definitions for Discord environment.
- Host: GitHub
- URL: https://github.com/mopsgamer/discord-env-types
- Owner: Mopsgamer
- License: mit
- Created: 2023-09-27T10:08:03.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-21T12:29:03.000Z (6 months ago)
- Last Synced: 2024-10-29T04:41:08.164Z (2 months ago)
- Homepage:
- Size: 258 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# discord-env-types
This package adds Discord environment types.> [!WARNING]
> The Discord environment is subject to change and some declarations may lie.## Installation
```npm
npm install --save-dev discord-env-types
```## Usage
If you want to declare global Discord environment variables:
```ts
import type DET from "discord-env-types";DiscordNative.clipboard.copy("test");
``````ts
import type DET from "discord-env-types";const PickedNative: Pick = ...;
PickedNative.clipboard.copy("test");DiscordNative.clipboard.copy("test");
```If you want to use types only, without global declarations:
```ts
import type DET from "discord-env-types/lib";const PickedNative: Pick = ...;
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`