Raxol.Terminal.Modes.ModeStateManager (Raxol v0.5.0)

View Source

Manages the state of terminal modes, including transitions and validation. Handles mode dependencies, conflicts, and state persistence.

Summary

Functions

Returns a specification to start this module under a supervisor.

Checks if a mode is enabled.

Creates a new mode state with default values.

Resets a mode to its default value.

Sets a mode to a specific value.

Starts the ModeStateManager process.

Types

t()

@type t() :: %Raxol.Terminal.Modes.ModeStateManager{modes: term()}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

mode_enabled?(state, mode_name)

@spec mode_enabled?(t(), atom()) :: boolean()

Checks if a mode is enabled.

new()

@spec new() :: t()

Creates a new mode state with default values.

reset_mode(state, mode_name)

@spec reset_mode(t(), atom()) :: {:ok, t()} | {:error, term()}

Resets a mode to its default value.

set_mode(state, mode_name, value)

@spec set_mode(t(), atom(), Raxol.Terminal.Modes.Types.ModeTypes.mode_value()) ::
  {:ok, t()} | {:error, term()}

Sets a mode to a specific value.

start_link(init_arg)

Starts the ModeStateManager process.