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
| Parameter | Type |
|---|---|
filter | ExportedOnlyFilter |
Returns
byDisplayName()
byDisplayName(
name):ExportedOnlyFilter
Generates a function that filters by the displayName property.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
byKeys()
byKeys(...
keys):ExportedOnlyFilter
Generates a function that filters by a set of properties.
Parameters
| Parameter | Type |
|---|---|
...keys | string[] |
Returns
byPrototypeKeys()
byPrototypeKeys(...
props):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):ExportedOnlyFilter
Generates a function that filters by a regex.
Parameters
| Parameter | Type |
|---|---|
regex | RegExp |
Returns
bySource()
bySource(...
searches):ModuleFilter
Generates a function that filters by source code content.
Parameters
| Parameter | Type |
|---|---|
...searches | (string | RegExp)[] |
Returns
byStoreName()
byStoreName(
name):ExportedOnlyFilter
Generates a function that filters by a specific internal Store name.
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
byStrings()
byStrings(...
strings):ExportedOnlyFilter
Generates a function that filters by strings.
Parameters
| Parameter | Type |
|---|---|
...strings | string[] |
Returns
combine()
combine(...
filters):ModuleFilter
Generates a combined function from a list of filters.
Parameters
| Parameter | Type |
|---|---|
...filters | ModuleFilter[] |
Returns
not()
not(
filter):ModuleFilter
Generates a filter that returns the opposite of the passed filter.
Parameters
| Parameter | Type |
|---|---|
filter | ModuleFilter |
Returns
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
| Parameter | Type |
|---|---|
...props | WithOptions<string, WebpackOptions> |
Returns
T | undefined
getAllByPrototypeKeys()
getAllByPrototypeKeys<
T>(...prototypes):T|undefined
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
...prototypes | WithOptions<string, WebpackOptions> |
Returns
T | undefined
getAllByRegex()
getAllByRegex<
T>(regex,options?):T|undefined
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
regex | RegExp |
options | WebpackOptions |
Returns
T | undefined
getAllBySource()
getAllBySource<
T>(...searches):T|undefined
Type Parameters
| Type Parameter |
|---|
T extends object[] |
Parameters
| Parameter | Type |
|---|---|
...searches | WithOptions<string | RegExp, WebpackOptions> |
Returns
T | undefined
getAllByStrings()
getAllByStrings<
T>(...strings):T|undefined
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
...strings | WithOptions<string, WebpackOptions> |
Returns
T | undefined
getBulk()
getBulk<
T>(...queries):T
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
...queries | BulkQueries[] |
Returns
T
getBulkKeyed()
getBulkKeyed<
T>(queries):T
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type |
|---|---|
queries | Record<keyof T, BulkQueries> |
Returns
T
getById()
getById(
id,options?):void|object
Parameters
| Parameter | Type |
|---|---|
id | PropertyKey |
options | WebpackOptions |
Returns
void | object
getByKeys()
getByKeys<
T>(...props):T|undefined
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
...props | WithOptions<string, WebpackOptions> |
Returns
T | undefined
getByPrototypeKeys()
getByPrototypeKeys<
T>(...prototypes):T|undefined
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
...prototypes | WithOptions<string, WebpackOptions> |
Returns
T | undefined
getByRegex()
getByRegex<
T>(regex,options?):T|undefined
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
regex | RegExp |
options | WebpackOptions |
Returns
T | undefined
getBySource()
getBySource<
T>(...searches):T|undefined
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
...searches | WithOptions<string | RegExp, WebpackOptions> |
Returns
T | undefined
getByStrings()
getByStrings<
T>(...strings):T|undefined
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
...strings | WithOptions<string, WebpackOptions> |
Returns
T | undefined
getMangled()
getMangled<
T>(filter,mangled,options?):void|T
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type |
|---|---|
filter | string | number | RegExp | ModuleFilter | (string | RegExp)[] |
mangled | Record<keyof T, ExportedOnlyFilter> |
options | MangledOptions |
Returns
void | T
getMangledProxy()
getMangledProxy<
T>(filter,mangled,options?):void|T
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type |
|---|---|
filter | string | number | RegExp | ModuleFilter | (string | RegExp)[] |
mangled | Record<keyof T, ExportedOnlyFilter> |
options | MangledOptions |
Returns
void | T
getModule()
getModule<
T>(filter,options?):void|T
Type Parameters
| Type Parameter |
|---|
T extends unknown |
Parameters
| Parameter | Type |
|---|---|
filter | ModuleFilter |
options | WebpackOptions |
Returns
void | T
getModules()
getModules<
T>(filter,options?):void|T
Type Parameters
| Type Parameter |
|---|
T extends any[] |
Parameters
| Parameter | Type |
|---|---|
filter | ModuleFilter |
options | WebpackOptions |
Returns
void | T
getProxy()
getProxy<
T>(filter,options?):void|T
Type Parameters
| Type Parameter |
|---|
T extends object |
Parameters
| Parameter | Type |
|---|---|
filter | ModuleFilter |
options | ProxyOptions |
Returns
void | T
getStore()
getStore(
name):FluxStore|undefined
Parameters
| Parameter | Type |
|---|---|
name | string |
Returns
FluxStore | undefined
getWithKey()
getWithKey(
filter,options?):void|Generator<any,void,unknown>
Parameters
| Parameter | Type |
|---|---|
filter | ExportedOnlyFilter |
options | WithKeyOptions |
Returns
void | Generator<any, void, unknown>
waitForModule()
waitForModule<
T>(filter,options?):void|Promise<T|undefined>
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
filter | ModuleFilter |
options | LazyOptions |
Returns
void | Promise<T | undefined>