Raxol.Plugins.PluginManager (Raxol v0.2.0)
View SourceManages plugins for the Raxol terminal emulator. Handles plugin loading, lifecycle management, and event dispatching.
Summary
Functions
Disables a plugin by name.
Enables a plugin by name.
Gets the current API version of the plugin manager.
Gets a plugin by name.
Allows plugins to process or replace cells generated by the renderer.
Iterates through enabled plugins that implement handle_cells/3
.
The callback should return {:ok, updated_plugin_state, cells_to_render, commands}
.
Processes a keyboard event through all enabled plugins. Plugins can return commands and choose to halt propagation. Returns {:ok, updated_manager, list_of_commands, :propagate | :halt} or {:error, reason}.
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}.
Notifies all enabled plugins of a terminal resize event.
Gets a list of all loaded plugins.
Loads a plugin module and initializes it with the given configuration.
Loads multiple plugins in the correct dependency order.
Creates a new plugin manager with default configuration.
Processes input through all enabled plugins.
Processes mouse events through all enabled plugins.
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.
Runs render-related hooks for all enabled plugins. Collects any direct output commands (e.g., escape sequences) returned by plugins. Returns {:ok, updated_manager, list_of_output_commands}
Unloads a plugin by name.
Updates the state of a specific plugin within the manager.
The update_fun
receives the current plugin state and should return the new state.
Types
@type t() :: %Raxol.Plugins.PluginManager{ api_version: String.t(), config: Raxol.Plugins.PluginConfig.t(), plugins: %{required(String.t()) => Raxol.Plugins.Plugin.t()} }
Functions
Disables a plugin by name.
Enables a plugin by name.
Gets the current API version of the plugin manager.
Gets a plugin by name.
Allows plugins to process or replace cells generated by the renderer.
Iterates through enabled plugins that implement handle_cells/3
.
The callback should return {:ok, updated_plugin_state, cells_to_render, commands}
.
Returns {:ok, updated_manager, processed_cells, collected_commands}
.
Processes a keyboard event through all enabled plugins. Plugins can return commands and choose to halt propagation. Returns {:ok, updated_manager, list_of_commands, :propagate | :halt} or {:error, reason}.
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}.
Notifies all enabled plugins of a terminal resize event.
Gets a list of all loaded plugins.
Loads a plugin module and initializes it with the given configuration.
Loads multiple plugins in the correct dependency order.
Creates a new plugin manager with default configuration.
Processes input through all enabled plugins.
Processes mouse events through all enabled plugins.
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.
Runs render-related hooks for all enabled plugins. Collects any direct output commands (e.g., escape sequences) returned by plugins. Returns {:ok, updated_manager, list_of_output_commands}
Unloads a plugin by name.
Updates the state of a specific plugin within the manager.
The update_fun
receives the current plugin state and should return the new state.