Skip to main content

Class: EventController

Defined in: src/types/registry/Events/BaseEventType.ts:12

Constructors​

Constructor​

new EventController(logger: LoggerOptions): EventController

Defined in: src/types/registry/Events/BaseEventType.ts:39

Parameters​

ParameterType
loggerLoggerOptions

Returns​

EventController

Properties​

container​

protected readonly container: Container

Defined in: src/types/registry/Events/BaseEventType.ts:19

Name​

container

Description​

The process container.

Constant​


logger​

protected readonly logger: Logger

Defined in: src/types/registry/Events/BaseEventType.ts:29

Name​

Logger

Description​

The Logger for event files.

Prefixed automatically with ApplicationEvent.

Constant​


type​

readonly type: HandlerType = HandlerType.EVENT

Defined in: src/types/registry/Events/BaseEventType.ts:37

Name​

type

Description​

The type for the EventController class, this is for when processing controllers marked with a AUTO type in deployment.

Constant​

Methods​

run()​

run(..._args: any[]): any

Defined in: src/types/registry/Events/BaseEventType.ts:61

Function

Parameters​

ParameterType
..._argsany[]

Returns​

any

Name​

run()

Description​

The run function for this event, this function cannot be redefined to use another name, but only the content within the function.

For listeners listening on ApplicationEvent.ALL, the first parameter is the event that was emitted, followed by any argument for that event.

Placeholder run function if nothing is defined:

Example​

return;

@public
@function

setApplicationEventOptions()​

setApplicationEventOptions(): EventListenerOptions

Defined in: src/types/registry/Events/BaseEventType.ts:80

Function

Returns​

EventListenerOptions

Name​

setApplicationEventOptions()

Description​

Set the details for this event.

Example​

// Default Event Config
return {
type: ApplicationEvent.ALL,
};

@public
@function