Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface AskEvent<R, Mode>

Method signatures that set the event name and instance type.

AskRoot => AskEvent => AskSelector => AskListener builds EventHandler

All overloads return the AskSelector interface.

Type parameters

Hierarchy

  • AskEvent

Index

Methods

Methods

events

  • events<EKey>(eventType: EKey): AskSelector<R, GlobalEventHandlersEventMap[EKey], Mode>
  • events<E>(eventType: string): AskSelector<R, E, Mode>
  • Method overload that infers the event instance type from the given event name.

    example
    EventDelegation
        .global()
        .events('click')
    

    Type parameters

    • EKey: keyof GlobalEventHandlersEventMap

      The event name literal type that's used to infer the Event instance type. This param is inferred from the eventType argument.

    Parameters

    • eventType: EKey

      The event name of events to listen to.

    Returns AskSelector<R, GlobalEventHandlersEventMap[EKey], Mode>

  • Method overload that allows to explicitly specify the event instance type.

    example
    EventDelegation
        .global()
        .events<CustomEvent>('my:event')
    

    Type parameters

    • E: Event

      The Event instance type. This param can be explicitly given to override the default Event type.

    Parameters

    • eventType: string

      The event name of events to listen to.

    Returns AskSelector<R, E, Mode>