# `Minga.Events`
[🔗](https://github.com/jsmestad/minga/blob/main/sdk/lib/minga/events.ex#L1)

Event bus for subscribing to editor lifecycle events.

Extensions use `subscribe/1` to receive events in their process mailbox
as `{:minga_event, topic, payload}` messages.

This is a compile-time stub. At runtime, the real module in Minga's
BEAM VM provides the implementation.

# `topic`

```elixir
@type topic() ::
  :buffer_saved
  | :buffer_opened
  | :buffer_closed
  | :buffer_changed
  | :mode_changed
  | :git_status_changed
  | :diagnostics_updated
  | :agent_session_stopped
  | :agent_hook
  | :file_written
  | :ghost_cursor_removed
```

# `broadcast`

```elixir
@spec broadcast(atom(), map()) :: :ok
```

# `subscribe`

```elixir
@spec subscribe(topic()) :: :ok
```

# `unsubscribe`

```elixir
@spec unsubscribe(topic()) :: :ok
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
