TEventPayload: TEvents[EventName] extends { data: null }
    ? TEvents[EventName]["data"]
    : TEvents[EventName]

Resolves to the payload type for a given TEvents event name. Use this to type the parameter of an event handler without depending on the internal shape of TEvents.

Type Parameters