typed

fun <E : Event> EventBus.typed(rootClass: Class<E>): TypedEventBus<E>

Java interop overload of typed. The rootClass token is unused at runtime (generics are erased) but satisfies Java's type inference:

TypedEventBus<NetworkEvent> bus =
TypedEventBusFactory.typed(underlying, NetworkEvent.class);

inline fun <E : Event> EventBus.typed(): TypedEventBus<E>

Returns a TypedEventBus view over this bus restricted to subtypes of E.

The returned bus shares the underlying handler registry; handlers registered on either the typed view or the original bus are visible to both.

val networkBus = EventBus().typed<NetworkEvent>()
networkBus.post(PacketReceived(bytes))