F
findByName
Finds a module by the name of its default export. Lazy unless { lazy: false } is passed: the search runs on first access.
function findByName<K extends MetroLookupFirst<MetroModuleName>, T extends MetroLookupArgs<string>>(first: K, ...rest: T): MetroFunctionSignatureOrArray<[K, ...T[]], string>Finds a module by the name of its default export. Lazy unless { lazy: false } is passed: the search runs on first access.
Parameters
| Name | Type | Description |
|---|---|---|
| first | K | The name to search for. |
| ...rest | T | Options, or further bulk items. |
Returns
MetroFunctionSignatureOrArray<[K, ...T[]], string>The matched function (or matches, for a bulk/all search), typed from Discord's modules when the name is known.
function findByName<T extends MetroLookupArgs<string>>(...args: T): MetroFunctionSignatureOrArray<T, string>Finds a module by the name of its default export. Lazy unless { lazy: false } is passed: the search runs on first access.
Parameters
| Name | Type | Description |
|---|---|---|
| ...args | T |
Returns
MetroFunctionSignatureOrArray<T, string>The matched function (or matches, for a bulk/all search), typed from Discord's modules when the name is known.