Type Alias EventFor<T, D>

EventFor: Expand<{ type: T } & D>

Represents a ZeroMQ event type.

Type Parameters

  • T extends string

    The event type (e.g., "bind", "connect", "close", etc.), which is stored in the type property.

  • D = {}

    The base event data type (which is unified by the type).

type AllEvents = EventFor<"bind", { address: string }>
// is equivalent to
type AllEvents = { type: "bind", address: string }