Raxol.Plugins.Manager.Events (Raxol v2.0.1)

View Source

Handles plugin event processing. Provides functions for processing various types of events through plugins.

Summary

Functions

Broadcasts an event to all enabled plugins. Returns {:ok, updated_manager} or {:error, reason}.

Disables a plugin in the manager. Returns {:ok, updated_manager} or {:error, reason}.

Enables a plugin in the manager. Returns {:ok, updated_manager} or {:error, reason}.

Gets a plugin by name from the manager. Returns {:ok, plugin} or {:error, :not_found}.

Processes a mouse event through all enabled plugins, providing cell context. Plugins can choose to halt propagation if they handle the event. Returns {:ok, updated_manager, :propagate | :halt} or {:error, reason}. Delegates to Raxol.Plugins.EventHandler.handle_mouse_event/3.

Notifies all enabled plugins of a terminal resize event. Delegates to Raxol.Plugins.EventHandler.handle_resize/3.

Loads a plugin module and initializes it. Delegates to Raxol.Plugins.Manager.Core.load_plugin/2 or /3. Returns {:ok, updated_manager} or {:error, reason}.

Processes input through all enabled plugins. Delegates to Raxol.Plugins.EventHandler.handle_input/2.

Processes output through all enabled plugins. Returns {:ok, manager, transformed_output} if a plugin transforms the output, or {:ok, manager} if no transformation is needed. Delegates to Raxol.Plugins.EventHandler.handle_output/2.

Unloads a plugin from the manager. Returns {:ok, updated_manager} or {:error, reason}.

Functions

broadcast_event(manager, event)

Broadcasts an event to all enabled plugins. Returns {:ok, updated_manager} or {:error, reason}.

disable_plugin(manager, plugin_name)

Disables a plugin in the manager. Returns {:ok, updated_manager} or {:error, reason}.

enable_plugin(manager, plugin_name)

Enables a plugin in the manager. Returns {:ok, updated_manager} or {:error, reason}.

get_plugin(manager, plugin_name)

Gets a plugin by name from the manager. Returns {:ok, plugin} or {:error, :not_found}.

handle_mouse_event(manager, event, rendered_cells)

Processes a mouse event through all enabled plugins, providing cell context. Plugins can choose to halt propagation if they handle the event. Returns {:ok, updated_manager, :propagate | :halt} or {:error, reason}. Delegates to Raxol.Plugins.EventHandler.handle_mouse_event/3.

handle_resize(manager, width, height)

Notifies all enabled plugins of a terminal resize event. Delegates to Raxol.Plugins.EventHandler.handle_resize/3.

load_plugin(manager, module)

Loads a plugin module and initializes it. Delegates to Raxol.Plugins.Manager.Core.load_plugin/2 or /3. Returns {:ok, updated_manager} or {:error, reason}.

load_plugin(manager, module, config)

new()

process_input(manager, input)

Processes input through all enabled plugins. Delegates to Raxol.Plugins.EventHandler.handle_input/2.

process_output(manager, output)

Processes output through all enabled plugins. Returns {:ok, manager, transformed_output} if a plugin transforms the output, or {:ok, manager} if no transformation is needed. Delegates to Raxol.Plugins.EventHandler.handle_output/2.

unload_plugin(manager, plugin_name)

Unloads a plugin from the manager. Returns {:ok, updated_manager} or {:error, reason}.