Skip to content

fmajestic/betterdiscord-types

This branch is 26 commits behind Zerthox/betterdiscord-types:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

fcf9d72 · Dec 1, 2022

History

35 Commits
Nov 22, 2022
Aug 10, 2022
Aug 10, 2022
Dec 1, 2022
Oct 14, 2022
Dec 1, 2022
Nov 8, 2022
Dec 1, 2022
Nov 6, 2022
Dec 1, 2022
Nov 3, 2022
Dec 1, 2022
Nov 6, 2022
Dec 1, 2022
Oct 14, 2022
Aug 10, 2022
Nov 3, 2022
Oct 14, 2022
Oct 14, 2022

Repository files navigation

BetterDiscord Types

Typescript type definitions for BetterDiscord.

Usage

npm install @types/betterdiscord@github:zerthox/betterdiscord-types

Note: When installing under a name not starting with @types, definitions for globals may not be included. Importing the module somewhere or using for example typeRoots can fix this.

import type { Patcher, Filters } from "betterdiscord";

Custom Data Type

A custom type for BetterDiscord's BdApi.Data interface may be supplied. This enables more specific typing for Data's functions.

When used from BdApi directly, Data needs to be casted:

import type { Data } from "betterdiscord";

const TypedData = BdApi.Data as Data<CustomDataType>;

When using a bound version of BdApi, the custom type can be supplied in the constructor:

const BoundBdApi = new BdApi<CustomDataType>("PluginName");

About

Type definitions for BetterDiscord.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published