# Class Events<TEventData>

#### Type Parameters

- #### TEventData extends EventData = EventData

#### Hierarchy

- Base<EventsParams>
  - Events

#### Implements

- EventFunctions<TEventData>

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:36

#####
Index

### Constructors

constructor

### Properties

emitInternal
emitMetaEventInternal
eventData
getListeners
params
safeCallAnyListener
safeCallListener
anyMap
canEmitMetaEvents
defaultLogger?
eventsMap
isGlobalDebugEnabled

### Accessors

debug
logger
isDebugEnabled

### Methods

clearListeners
emit
emitMetaEvent
emitSerial
listenerCount
logIfDebugEnabled
off
offAny
on
onAny
once

## Constructors

### constructor

- new Events<TEventData>(params?): Events<TEventData>

- #### Type Parameters

  - #### TEventData extends EventData = EventData

  #### Parameters

  - ##### `Optional` params: BaseParamsFields & {
    debug?: DebugOptions;
    }

  #### Returns Events<TEventData>

  Overrides Base<EventsParams>.constructor

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:42

## Properties

### `Private` emitInternal

emitInternal: any

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:57

### `Private` emitMetaEventInternal

emitMetaEventInternal: any

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:58

### eventData

eventData: TEventData

Implementation of EventFunctions.eventData

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:41

### `Private` getListeners

getListeners: any

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:59

### `Readonly` params

params: BaseParamsFields & {
debug?: DebugOptions;
}

Inherited from Base.params

- Defined in protocol/packages/core/dist/types/lib/Base.d.ts:20

### `Private` safeCallAnyListener

safeCallAnyListener: any

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:60

### `Private` safeCallListener

safeCallListener: any

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:61

### `Static` `Protected` anyMap

anyMap: WeakMap<object, Set<EventAnyListener<EventArgs>>>

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:37

### `Static` `Private` canEmitMetaEvents

canEmitMetaEvents: any

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:39

### `Static` `Optional` defaultLogger

defaultLogger?: Logger

Inherited from Base.defaultLogger

- Defined in protocol/packages/core/dist/types/lib/Base.d.ts:21

### `Static` `Protected` eventsMap

eventsMap: WeakMap<object, Map<PropertyKey, Set<EventListenerInfo<EventArgs>>>>

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:38

### `Static` `Private` isGlobalDebugEnabled

isGlobalDebugEnabled: any

- Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:40

## Accessors

### debug

- get debug(): undefined | DebugOptions

- #### Returns undefined | DebugOptions

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:45

### `Protected` logger

- get logger(): Logger | Console

- #### Returns Logger | Console

  Inherited from Base.logger

  - Defined in protocol/packages/core/dist/types/lib/Base.d.ts:23

### `Static` isDebugEnabled

- get isDebugEnabled(): boolean

- #### Returns boolean

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:43
- set isDebugEnabled(newValue): void

- #### Parameters

  - ##### newValue: boolean

  #### Returns void

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:44

## Methods

### clearListeners

- clearListeners(eventNames): void

- #### Parameters

  - ##### eventNames: keyof TEventData | (keyof TEventData)[]

  #### Returns void

  Implementation of EventFunctions.clearListeners

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:46

### emit

- emit<TEventName>(eventName, eventArgs): Promise<void>

- #### Type Parameters

  - #### TEventName extends string | number | symbol

  #### Parameters

  - ##### eventName: TEventName

  - ##### eventArgs: TEventData[TEventName]

  #### Returns Promise<void>

  Implementation of EventFunctions.emit

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:47

### emitMetaEvent

- emitMetaEvent<TEventName>(eventName, eventArgs): Promise<void>

- #### Type Parameters

  - #### TEventName extends keyof MetaEventData<TEventData>

  #### Parameters

  - ##### eventName: TEventName

  - ##### eventArgs: MetaEventData<TEventData>[TEventName]

  #### Returns Promise<void>

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:48

### emitSerial

- emitSerial<TEventName>(eventName, eventArgs): Promise<void>

- #### Type Parameters

  - #### TEventName extends string | number | symbol

  #### Parameters

  - ##### eventName: TEventName

  - ##### eventArgs: TEventData[TEventName]

  #### Returns Promise<void>

  Implementation of EventFunctions.emitSerial

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:49

### listenerCount

- listenerCount(eventNames?): number

- #### Parameters

  - ##### `Optional` eventNames: keyof TEventData | (keyof TEventData)[]

  #### Returns number

  Implementation of EventFunctions.listenerCount

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:50

### logIfDebugEnabled

- logIfDebugEnabled<TEventName>(type, eventName?, eventArgs?): void

- #### Type Parameters

  - #### TEventName extends PropertyKey

  #### Parameters

  - ##### type: string

  - ##### `Optional` eventName: TEventName

  - ##### `Optional` eventArgs: EventArgs

  #### Returns void

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:51

### off

- off<TEventName, TEventListener>(eventNames, listener): void

- #### Type Parameters

  - #### TEventName extends string | number | symbol

  - #### TEventListener = EventListener<TEventData[TEventName]>

  #### Parameters

  - ##### eventNames: TEventName | TEventName[]

  - ##### listener: TEventListener

  #### Returns void

  Implementation of EventFunctions.off

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:52

### offAny

- offAny(listener): void

- #### Parameters

  - ##### listener: EventAnyListener<EventArgs>

  #### Returns void

  Implementation of EventFunctions.offAny

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:53

### on

- on<TEventName>(eventNames, listener, filter?): (() => void)

- #### Type Parameters

  - #### TEventName extends string | number | symbol = keyof TEventData

  #### Parameters

  - ##### eventNames: TEventName | TEventName[]

  - ##### listener: EventListener<TEventData[TEventName]>

  - ##### `Optional` filter: TEventData[TEventName]

  #### Returns (() => void)

  - - (): void

    - #### Returns void

  Implementation of EventFunctions.on

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:54

### onAny

- onAny(listener): (() => void)

- #### Parameters

  - ##### listener: EventAnyListener<EventArgs>

  #### Returns (() => void)

  - - (): void

    - #### Returns void

  Implementation of EventFunctions.onAny

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:55

### once

- once<TEventName>(eventName, listener): (() => void)

- #### Type Parameters

  - #### TEventName extends string | number | symbol

  #### Parameters

  - ##### eventName: TEventName

  - ##### listener: EventListener<TEventData[TEventName]>

  #### Returns (() => void)

  - - (): void

    - #### Returns void

  Implementation of EventFunctions.once

  - Defined in modules/packages/module/packages/events/dist/types/Events/Events.d.ts:56

Generated using TypeDoc