Skip to content

Class: Webpack ​

Webpack is a utility class for getting internal webpack modules. An instance is available on BdApi. This is extremely useful for interacting with the internals of Discord.

Properties ​

Filters ​

Filters: object

Series of Filters to be used for finding webpack modules.

byComponentType() ​

byComponentType(filter): ExportedOnlyFilter

Generates a filter to search React functional components.

Parameters ​
ParameterType
filterExportedOnlyFilter
Returns ​

ExportedOnlyFilter

byDisplayName() ​

byDisplayName(name): ExportedOnlyFilter

Generates a function that filters by the displayName property.

Parameters ​
ParameterType
namestring
Returns ​

ExportedOnlyFilter

byKeys() ​

byKeys(...keys): ExportedOnlyFilter

Generates a function that filters by a set of properties.

Parameters ​
ParameterType
...keysstring[]
Returns ​

ExportedOnlyFilter

byPrototypeKeys() ​

byPrototypeKeys(...props): ExportedOnlyFilter

Generates a function that filters by a set of properties on the object's prototype.

Parameters ​
ParameterType
...propsstring[]
Returns ​

ExportedOnlyFilter

byRegex() ​

byRegex(regex): ExportedOnlyFilter

Generates a function that filters by a regex.

Parameters ​
ParameterType
regexRegExp
Returns ​

ExportedOnlyFilter

bySource() ​

bySource(...searches): ModuleFilter

Generates a function that filters by source code content.

Parameters ​
ParameterType
...searches(string | RegExp)[]
Returns ​

ModuleFilter

byStoreName() ​

byStoreName(name): ExportedOnlyFilter

Generates a function that filters by a specific internal Store name.

Parameters ​
ParameterType
namestring
Returns ​

ExportedOnlyFilter

byStrings() ​

byStrings(...strings): ExportedOnlyFilter

Generates a function that filters by strings.

Parameters ​
ParameterType
...stringsstring[]
Returns ​

ExportedOnlyFilter

combine() ​

combine(...filters): ModuleFilter

Generates a combined function from a list of filters.

Parameters ​
ParameterType
...filtersModuleFilter[]
Returns ​

ModuleFilter

not() ​

not(filter): ModuleFilter

Generates a filter that returns the opposite of the passed filter.

Parameters ​
ParameterType
filterModuleFilter
Returns ​

ModuleFilter


modules ​

modules: Record<PropertyKey, RawModule>

A Proxy that returns the module source by ID.


Stores ​

Stores: Record<StoreNameType, FluxStore>

An object containing all of Discord's internal stores which can be accessed by their name.

Methods ​

getAllByKeys() ​

getAllByKeys<T>(...props): T | undefined

Type Parameters ​

Type Parameter
T extends any[]

Parameters ​

ParameterType
...propsWithOptions<string, WebpackOptions>

Returns ​

T | undefined


getAllByPrototypeKeys() ​

getAllByPrototypeKeys<T>(...prototypes): T | undefined

Type Parameters ​

Type Parameter
T extends any[]

Parameters ​

ParameterType
...prototypesWithOptions<string, WebpackOptions>

Returns ​

T | undefined


getAllByRegex() ​

getAllByRegex<T>(regex, options?): T | undefined

Type Parameters ​

Type Parameter
T extends any[]

Parameters ​

ParameterType
regexRegExp
optionsWebpackOptions

Returns ​

T | undefined


getAllBySource() ​

getAllBySource<T>(...searches): T | undefined

Type Parameters ​

Type Parameter
T extends object[]

Parameters ​

ParameterType
...searchesWithOptions<string | RegExp, WebpackOptions>

Returns ​

T | undefined


getAllByStrings() ​

getAllByStrings<T>(...strings): T | undefined

Type Parameters ​

Type Parameter
T extends any[]

Parameters ​

ParameterType
...stringsWithOptions<string, WebpackOptions>

Returns ​

T | undefined


getBulk() ​

getBulk<T>(...queries): T

Type Parameters ​

Type Parameter
T extends any[]

Parameters ​

ParameterType
...queriesBulkQueries[]

Returns ​

T


getBulkKeyed() ​

getBulkKeyed<T>(queries): T

Type Parameters ​

Type Parameter
T extends object

Parameters ​

ParameterType
queriesRecord<keyof T, BulkQueries>

Returns ​

T


getById() ​

getById(id, options?): void | object

Parameters ​

ParameterType
idPropertyKey
optionsWebpackOptions

Returns ​

void | object


getByKeys() ​

getByKeys<T>(...props): T | undefined

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
...propsWithOptions<string, WebpackOptions>

Returns ​

T | undefined


getByPrototypeKeys() ​

getByPrototypeKeys<T>(...prototypes): T | undefined

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
...prototypesWithOptions<string, WebpackOptions>

Returns ​

T | undefined


getByRegex() ​

getByRegex<T>(regex, options?): T | undefined

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
regexRegExp
optionsWebpackOptions

Returns ​

T | undefined


getBySource() ​

getBySource<T>(...searches): T | undefined

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
...searchesWithOptions<string | RegExp, WebpackOptions>

Returns ​

T | undefined


getByStrings() ​

getByStrings<T>(...strings): T | undefined

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
...stringsWithOptions<string, WebpackOptions>

Returns ​

T | undefined


getMangled() ​

getMangled<T>(filter, mangled, options?): void | T

Type Parameters ​

Type Parameter
T extends object

Parameters ​

ParameterType
filterstring | number | RegExp | ModuleFilter | (string | RegExp)[]
mangledRecord<keyof T, ExportedOnlyFilter>
optionsMangledOptions

Returns ​

void | T


getMangledProxy() ​

getMangledProxy<T>(filter, mangled, options?): void | T

Type Parameters ​

Type Parameter
T extends object

Parameters ​

ParameterType
filterstring | number | RegExp | ModuleFilter | (string | RegExp)[]
mangledRecord<keyof T, ExportedOnlyFilter>
optionsMangledOptions

Returns ​

void | T


getModule() ​

getModule<T>(filter, options?): void | T

Type Parameters ​

Type Parameter
T extends unknown

Parameters ​

ParameterType
filterModuleFilter
optionsWebpackOptions

Returns ​

void | T


getModules() ​

getModules<T>(filter, options?): void | T

Type Parameters ​

Type Parameter
T extends any[]

Parameters ​

ParameterType
filterModuleFilter
optionsWebpackOptions

Returns ​

void | T


getProxy() ​

getProxy<T>(filter, options?): void | T

Type Parameters ​

Type Parameter
T extends object

Parameters ​

ParameterType
filterModuleFilter
optionsProxyOptions

Returns ​

void | T


getStore() ​

getStore(name): FluxStore | undefined

Parameters ​

ParameterType
namestring

Returns ​

FluxStore | undefined


getWithKey() ​

getWithKey(filter, options?): void | Generator<any, void, unknown>

Parameters ​

ParameterType
filterExportedOnlyFilter
optionsWithKeyOptions

Returns ​

void | Generator<any, void, unknown>


waitForModule() ​

waitForModule<T>(filter, options?): void | Promise<T | undefined>

Type Parameters ​

Type Parameter
T

Parameters ​

ParameterType
filterModuleFilter
optionsLazyOptions

Returns ​

void | Promise<T | undefined>