Skip to main content

Class: TypedEventTarget<TEvents>

Type parameters

NameType
TEventsextends Record<string, Event>

Hierarchy

Constructors

constructor

new TypedEventTarget<TEvents>()

Type parameters

NameType
TEventsextends Record<string, Event>

Methods

dispatchEvent

dispatchEvent<TEventType>(event): void

Type parameters

NameType
TEventTypeextends string

Parameters

NameType
eventTEvents[TEventType]

Returns

void

Defined in

packages/core/src/eventtarget.ts:53


addEventListener

addEventListener<TEventType>(type, handler): void

Type parameters

NameType
TEventTypeextends string

Parameters

NameType
typeTEventType
handler(event: TEvents[TEventType]) => void

Returns

void

Defined in

packages/core/src/eventtarget.ts:57


removeEventListener

removeEventListener<TEventType>(type, handler): void

Type parameters

NameType
TEventTypeextends string

Parameters

NameType
typeTEventType
handler(event: TEvents[TEventType]) => void

Returns

void

Defined in

packages/core/src/eventtarget.ts:64