Class: Webpack
Defined in: src/betterdiscord/api/webpack.ts:30
Webpack is a utility class for getting internal webpack modules. Instance is accessible through the BdApi. This is extremely useful for interacting with the internals of Discord.
Properties
Filters
static Filters: {
byComponentType: ExportedOnlyFilter;
byDisplayName: ExportedOnlyFilter;
byKeys: ExportedOnlyFilter;
byPrototypeKeys: ExportedOnlyFilter;
byRegex: ExportedOnlyFilter;
bySource: Filter;
byStoreName: ExportedOnlyFilter;
byStrings: ExportedOnlyFilter;
combine: Filter;
not: Filter;
};Defined in: src/betterdiscord/api/webpack.ts:42
Series of Filters to be used for finding webpack modules.
byComponentType()
byComponentType(filter: ExportedOnlyFilter): ExportedOnlyFilter;Generates a filter to search React functional components.
Parameters
| Parameter | Type |
|---|---|
filter | ExportedOnlyFilter |
Returns
byDisplayName()
byDisplayName(name: string): ExportedOnlyFilter;Generates a function that filters by the displayName property.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
byKeys()
byKeys(...keys: string[]): ExportedOnlyFilter;Generates a function that filters by a set of properties.
Parameters
| Parameter | Type |
|---|---|
...keys | string[] |
Returns
byPrototypeKeys()
byPrototypeKeys(...props: string[]): ExportedOnlyFilter;Generates a function that filters by a set of properties on the object's prototype.
Parameters
| Parameter | Type |
|---|---|
...props | string[] |
Returns
byRegex()
byRegex(regex: RegExp): ExportedOnlyFilter;Generates a function that filters by a regex.
Parameters
| Parameter | Type |
|---|---|
regex | RegExp |
Returns
bySource()
bySource(...searches: (
| string
| RegExp)[]): Filter;Generates a function that filters by source code content.
Parameters
| Parameter | Type |
|---|---|
...searches | ( | string | RegExp)[] |
Returns
byStoreName()
byStoreName(name: string): ExportedOnlyFilter;Generates a function that filters by a specific internal Store name.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
byStrings()
byStrings(...strings: string[]): ExportedOnlyFilter;Generates a function that filters by strings.
Parameters
| Parameter | Type |
|---|---|
...strings | string[] |
Returns
combine()
combine(...filters: Filter[]): Filter;Generates a combined function from a list of filters.
Parameters
| Parameter | Type |
|---|---|
...filters | Filter[] |
Returns
not()
not(filter: Filter): Filter;Generates a filter that returns the opposite of the passed filter.
Parameters
| Parameter | Type |
|---|---|
filter | Filter |
Returns
modules
static modules: Record<PropertyKey, RawModule>;Defined in: src/betterdiscord/api/webpack.ts:34
A Proxy that returns the module source by ID.
Stores
static Stores: Record<StoreNameType, FluxStore>;Defined in: src/betterdiscord/api/webpack.ts:36
Methods
getAllByKeys()
static getAllByKeys<T>(...props: WithOptions<string, WebpackOptions>): void | T;Defined in: src/betterdiscord/api/webpack.ts:147
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
...props | WithOptions<string, WebpackOptions> |
Returns
void | T
getAllByPrototypeKeys()
static getAllByPrototypeKeys<T>(...prototypes: WithOptions<string, WebpackOptions>): void | T;Defined in: src/betterdiscord/api/webpack.ts:136
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
...prototypes | WithOptions<string, WebpackOptions> |
Returns
void | T
getAllByRegex()
static getAllByRegex<T>(regex: RegExp, options: WebpackOptions): void | T;Defined in: src/betterdiscord/api/webpack.ts:119
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
regex | RegExp |
options | WebpackOptions |
Returns
void | T
getAllBySource()
static getAllBySource<T>(...searches: WithOptions<
| string
| RegExp, WebpackOptions>): void | T;Defined in: src/betterdiscord/api/webpack.ts:170
Type Parameters
| Type Parameter |
|---|
T extends object[] |
Parameters
| Parameter | Type |
|---|---|
...searches | WithOptions< | string | RegExp, WebpackOptions> |
Returns
void | T
getAllByStrings()
static getAllByStrings<T>(...strings: WithOptions<string, WebpackOptions>): void | T;Defined in: src/betterdiscord/api/webpack.ts:158
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
...strings | WithOptions<string, WebpackOptions> |
Returns
void | T
getBulk()
static getBulk<T>(...queries: BulkQueries[]): T;Defined in: src/betterdiscord/api/webpack.ts:104
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
...queries | BulkQueries[] |
Returns
T
getBulkKeyed()
static getBulkKeyed<T>(queries: Record<keyof T, BulkQueries>): T;Defined in: src/betterdiscord/api/webpack.ts:105
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type |
|---|---|
queries | Record<keyof T, BulkQueries> |
Returns
T
getById()
static getById(id: PropertyKey): object | undefined;Defined in: src/betterdiscord/api/webpack.ts:178
Parameters
| Parameter | Type |
|---|---|
id | PropertyKey |
Returns
object | undefined
getByKeys()
static getByKeys<T>(...props: WithOptions<string, WebpackOptions>): void | T;Defined in: src/betterdiscord/api/webpack.ts:142
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
...props | WithOptions<string, WebpackOptions> |
Returns
void | T
getByPrototypeKeys()
static getByPrototypeKeys<T>(...prototypes: WithOptions<string, WebpackOptions>): void | T;Defined in: src/betterdiscord/api/webpack.ts:131
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
...prototypes | WithOptions<string, WebpackOptions> |
Returns
void | T
getByRegex()
static getByRegex<T>(regex: RegExp, options: WebpackOptions): void | T;Defined in: src/betterdiscord/api/webpack.ts:115
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
regex | RegExp |
options | WebpackOptions |
Returns
void | T
getBySource()
static getBySource<T>(...searches: WithOptions<
| string
| RegExp, WebpackOptions>): void | T;Defined in: src/betterdiscord/api/webpack.ts:164
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
...searches | WithOptions< | string | RegExp, WebpackOptions> |
Returns
void | T
getByStrings()
static getByStrings<T>(...strings: WithOptions<string, WebpackOptions>): void | T;Defined in: src/betterdiscord/api/webpack.ts:153
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
...strings | WithOptions<string, WebpackOptions> |
Returns
void | T
getMangled()
static getMangled<T>(
filter:
| string
| RegExp
| Filter,
mangled: Record<keyof T, ExportedOnlyFilter>,
options: Options): void | T;Defined in: src/betterdiscord/api/webpack.ts:123
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type |
|---|---|
filter | | string | RegExp | Filter |
mangled | Record<keyof T, ExportedOnlyFilter> |
options | Options |
Returns
void | T
getModule()
static getModule<T>(filter: Filter, options: WebpackOptions): void | T;Defined in: src/betterdiscord/api/webpack.ts:87
Type Parameters
| Type Parameter |
|---|
T extends unknown |
Parameters
| Parameter | Type |
|---|---|
filter | Filter |
options | WebpackOptions |
Returns
void | T
getModules()
static getModules<T>(filter: Filter, options: WebpackOptions): void | T;Defined in: src/betterdiscord/api/webpack.ts:97
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
filter | Filter |
options | WebpackOptions |
Returns
void | T
getStore()
static getStore(name: string): FluxStore | undefined;Defined in: src/betterdiscord/api/webpack.ts:176
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
FluxStore | undefined
getWithKey()
static getWithKey(filter: ExportedOnlyFilter, options: WithKeyOptions):
| void
| Generator<any, void, unknown>;Defined in: src/betterdiscord/api/webpack.ts:79
Parameters
| Parameter | Type |
|---|---|
filter | ExportedOnlyFilter |
options | WithKeyOptions |
Returns
| void | Generator<any, void, unknown>
waitForModule()
static waitForModule<T>(filter: Filter, options: LazyOptions):
| void
| Promise<T | undefined>;Defined in: src/betterdiscord/api/webpack.ts:107
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
filter | Filter |
options | LazyOptions |
Returns
| void | Promise<T | undefined>