Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BaseEvent<TDataType, TEventType>

Base class for classes generated by createEventClass. Thin abstraction of AbstractEvent that adds an additional typed data field to events.

Type parameters

  • TDataType

    The type of the data field on this event. If not given, will set the type to undefined (no data field)

  • TEventType: string

    A union type of the possible string literals that are possibilities for the type property. If not set, will default to string (allows for all strings)

Hierarchy

Index

Constructors

constructor

  • new BaseEvent(type: TEventType, data: TDataType, bubbles?: boolean, cancelable?: boolean, setTimeStamp?: boolean): BaseEvent

Properties

bubbles

bubbles: boolean

If true, the event will also go through a bubbling phase. See EventDispatcher.dispatchEvent for more information on the event phases.

cancelable

cancelable: boolean

Indicates if preventDefault can be called on this event. This will prevent the 'default action' of the event from being executed. It is up to the EventDispatcher instance that dispatches the event to stop the default action from executing when the dispatchEvent method returns false

currentTarget

currentTarget: EventDispatcher | null = null

Will be updated by EventDispatcher during the dispatch of an event to the target that listeners are currently being called on. After completion of an event dispatch this value will be reset to null.

data

data: TDataType

defaultPrevented

defaultPrevented: boolean = false

true if cancelable is true and preventDefault has been called on this event.

eventPhase

eventPhase: EventPhase = EventPhase.NONE

The current event phase of this event. During event dispatch, this value will be either CAPTURING_PHASE, AT_TARGET or BUBBLING_PHASE. If this event is not currently being dispatched this will be set to NONE.

target

target: EventDispatcher | null = null

Will be updated by EventDispatcher when dispatchEvent is called with this event. The value will be set to the EventDispatcher instance that dispatched the event.

timeStamp

timeStamp: number

Indicates the time this event is dispatched in the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC. This value will only be set if the setTimestamp parameter in the constructor is set to true. Otherwise, this value will be 0.

type

type: TEventType

Methods

callListener

clone

preventDefault

  • preventDefault(): void

stopImmediatePropagation

  • stopImmediatePropagation(): void

stopPropagation

  • stopPropagation(): void

Generated using TypeDoc