레퍼런스
classes
Registry

@pikokr/command.ts / Exports / Registry

Class: Registry

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Registry(logger, client): Registry

Parameters

NameType
loggerLogger<unknown>
clientCommandClient

Returns

Registry

Defined in

src/core/structures/Registry.ts:24 (opens in a new tab)

Properties

client

client: CommandClient

Defined in

src/core/structures/Registry.ts:26 (opens in a new tab)


emitters

emitters: Collection<string, __module>

Defined in

src/core/structures/Registry.ts:18 (opens in a new tab)


extensions

extensions: object[] = []

Defined in

src/core/structures/Registry.ts:16 (opens in a new tab)


globalHooks

globalHooks: Record<string, ComponentHookFn<unknown[]>[]> = {}

Defined in

src/core/structures/Registry.ts:22 (opens in a new tab)


logger

logger: Logger<unknown>

Defined in

src/core/structures/Registry.ts:20 (opens in a new tab)

Methods

addGlobalHook

addGlobalHook(name, fn): void

Parameters

NameType
namestring
fnComponentHookFn<unknown[]>

Returns

void

Defined in

src/core/structures/Registry.ts:33 (opens in a new tab)


getComponentsWithType

getComponentsWithType<T>(ext, type): T[]

Type parameters

Name
T

Parameters

NameType
extobject
typeunknown

Returns

T[]

Defined in

src/core/structures/Registry.ts:54 (opens in a new tab)


getComponentsWithTypeGlobal

getComponentsWithTypeGlobal<T>(type): T[]

Type parameters

Name
T

Parameters

NameType
typeunknown

Returns

T[]

Defined in

src/core/structures/Registry.ts:44 (opens in a new tab)


loadAllModulesInDirectory

loadAllModulesInDirectory(dir, pattern?): Promise<object[]>

Parameters

NameType
dirstring
pattern?RegExp

Returns

Promise<object[]>

Defined in

src/core/structures/Registry.ts:89 (opens in a new tab)


loadModulesAtPath

loadModulesAtPath(file): Promise<object[]>

Parameters

NameType
filestring

Returns

Promise<object[]>

Defined in

src/core/structures/Registry.ts:103 (opens in a new tab)


registerEventEmitter

registerEventEmitter(name, emitter): void

Parameters

NameType
namestring
emitter__module

Returns

void

Defined in

src/core/structures/Registry.ts:201 (opens in a new tab)


registerEventListeners

registerEventListeners(ext): void

Parameters

NameType
extobject

Returns

void

Defined in

src/core/structures/Registry.ts:60 (opens in a new tab)


registerModule

registerModule(ext): Promise<void>

Parameters

NameType
extobject

Returns

Promise<void>

Defined in

src/core/structures/Registry.ts:173 (opens in a new tab)


registerModules

registerModules(modules, p): Promise<object[]>

Parameters

NameType
modulesobject | object[]
pstring

Returns

Promise<object[]>

Defined in

src/core/structures/Registry.ts:118 (opens in a new tab)


reloadModules

reloadModules(): Promise<{ error?: Error ; extensions?: object[] ; file: string ; result: boolean }[]>

Returns

Promise<{ error?: Error ; extensions?: object[] ; file: string ; result: boolean }[]>

Defined in

src/core/structures/Registry.ts:135 (opens in a new tab)


runModuleHook

runModuleHook(ext, hookName, ...args): void

Parameters

NameType
extobject
hookNamestring
...argsunknown[]

Returns

void

Defined in

src/core/structures/Registry.ts:189 (opens in a new tab)


unregisterEventListeners

unregisterEventListeners(ext): void

Parameters

NameType
extobject

Returns

void

Defined in

src/core/structures/Registry.ts:76 (opens in a new tab)


unregisterModule

unregisterModule(ext): Promise<void>

Parameters

NameType
extobject

Returns

Promise<void>

Defined in

src/core/structures/Registry.ts:182 (opens in a new tab)