Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RCKitEvent<T, D, R>

Event Base Class Event<T, D = void, R = void>

Type Parameters

  • T extends string

    Event Type

  • D = void

    The data type definitions included in the event instance

  • R = void

    The data type definition of the data sent back to the event dispatcher by the event handler through evt.sendResult(data)

Hierarchy

  • RCKitEvent

Index

Properties

data: D

The data contained in the event instance

type: T

Constructors

  • new RCKitEvent<T, D, R>(type: T, data?: D): RCKitEvent<T, D, R>
  • Type Parameters

    • T extends string

    • D = void

    • R = void

    Parameters

    • type: T
    • Optional data: D

    Returns RCKitEvent<T, D, R>

Methods

  • isImmediatePropagationStopped(): boolean
  • Did it prevent the spread of the event?

    Returns boolean

  • stopImmediatePropagation(): void
  • Prevent the invocation of listeners of the same type.

    Returns void

  • isDefaultPrevented(): boolean
  • Did it prevent the default behavior of the event?

    Returns boolean

  • preventDefault(): void
  • Prevent the default behavior of the event

    description

    This method will not prevent the spread of events, and not all events have default behaviors.

    Returns void

  • sendResult(data: R): void
  • Send data to the event dispatcher.

    Parameters

    • data: R

    Returns void

  • awaitResult(): Promise<R>
  • Wait for the listener of waiting time to return data.

    Returns Promise<R>

  • Clone event instance

    Parameters

    • ignoreResult: boolean

      Whether to ignore the returned data. If it is true, the cloned event instance cannot send back data through evt.sendResult(data).

    Returns RCKitEvent<T, D, R>