Partekatu honen bidez:


ListenerType type

type ListenerType<T> = [T] extends [(args: U) => any]
  ? U
  : [T] extends [void]
  ? Object
  : [T]