F

findByFilePath

Finds a module by a segment of its file path. Lazy unless { lazy: false } is passed: the search runs on first access.

function findByFilePath<K extends MetroLookupFirst<MetroModulePath>, T extends MetroLookupArgs<string>>(first: K, ...rest: T): MetroModuleOrArray<[K, ...T[]], string>

Finds a module by a segment of its file path. Lazy unless { lazy: false } is passed: the search runs on first access.

Parameters

NameTypeDescription
firstK

The file path to search for.

...restT

Options, or further bulk items.

Returns

MetroModuleOrArray<[K, ...T[]], string>

The matched module, typed from Discord's modules when the path is known.

function findByFilePath<T extends MetroLookupArgs<string>>(...args: T): MetroModuleOrArray<T, string>

Finds a module by a segment of its file path. Lazy unless { lazy: false } is passed: the search runs on first access.

Parameters

NameTypeDescription
...argsT

Returns

MetroModuleOrArray<T, string>

The matched module, typed from Discord's modules when the path is known.