getEspBus

getEspBus()

Typed accessor for the singleton bus.

Called without a type parameter it knows every built-in Espalier event. Consuming applications can extend the map with their own events so that a single bus instance carries both sets of types:

// Internal Espalier usage — no type parameter needed:
const bus = getEspBus();
bus.publish("show-toast", { message: "Saved!" });

// Application usage — extend with custom events:
type AppBusEvents = EspBusEventMap & {
  "sse-notification": { type: string; payload: unknown };
  "cart-updated":     { itemCount: number };
};

const bus = getEspBus<AppBusEvents>();
bus.publish("sse-notification", { … });   // ✓ app event
bus.publish("show-toast", { … });          // ✓ Espalier event

Where does this show?