Minga.Events (minga_sdk v0.1.0)

Copy Markdown View Source

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.

Summary

Types

topic()

@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

Functions

broadcast(topic, payload)

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

subscribe(topic)

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

unsubscribe(topic)

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