Orderly SDKs / Modules / @orderly.network/core / EventEmitter

Class: EventEmitter<EventTypes, Context>

@orderly.network/core.EventEmitter

Minimal EventEmitter interface that is molded against the Node.js EventEmitter interface.

Type parameters

NameType
EventTypesextends ValidEventTypes = string | symbol
Contextextends any = any

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EventEmitter<EventTypes, Context>()

Type parameters

NameType
EventTypesextends ValidEventTypes = string | symbol
Contextextends unknown = any

Properties

prefixed

Static prefixed: string | boolean

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:9

Methods

addListener

addListener<T>(event, fn, context?): EventEmitter<EventTypes, Context>

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fnEventListener<EventTypes, T>
context?Context

Returns

EventEmitter<EventTypes, Context>

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:45


emit

emit<T>(event, ...args): boolean

Calls each of the listeners registered for a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
...argsParameters<EventListener<EventTypes, T>>

Returns

boolean

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:32


eventNames

eventNames(): EventNames<EventTypes>[]

Return an array listing the events for which the emitter has registered listeners.

Returns

EventNames<EventTypes>[]

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:15


listenerCount

listenerCount(event): number

Return the number of listeners listening to a given event.

Parameters

NameType
eventEventNames<EventTypes>

Returns

number

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:27


listeners

listeners<T>(event): EventListener<EventTypes, T>[]

Return the listeners registered for a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT

Returns

EventListener<EventTypes, T>[]

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:20


off

off<T>(event, fn?, context?, once?): EventEmitter<EventTypes, Context>

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fn?EventListener<EventTypes, T>
context?Context
once?boolean

Returns

EventEmitter<EventTypes, Context>

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:69


on

on<T>(event, fn, context?): EventEmitter<EventTypes, Context>

Add a listener for a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fnEventListener<EventTypes, T>
context?Context

Returns

EventEmitter<EventTypes, Context>

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:40


once

once<T>(event, fn, context?): EventEmitter<EventTypes, Context>

Add a one-time listener for a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fnEventListener<EventTypes, T>
context?Context

Returns

EventEmitter<EventTypes, Context>

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:54


removeAllListeners

removeAllListeners(event?): EventEmitter<EventTypes, Context>

Remove all listeners, or those of the specified event.

Parameters

NameType
event?EventNames<EventTypes>

Returns

EventEmitter<EventTypes, Context>

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:79


removeListener

removeListener<T>(event, fn?, context?, once?): EventEmitter<EventTypes, Context>

Remove the listeners of a given event.

Type parameters

NameType
Textends string | symbol

Parameters

NameType
eventT
fn?EventListener<EventTypes, T>
context?Context
once?boolean

Returns

EventEmitter<EventTypes, Context>

Defined in

node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index.d.ts:63