Raxol.Terminal.Config.EnvironmentAdapterBehaviour behaviour (Raxol v0.3.0)

View Source

Defines the behaviour for terminal environment configuration.

This behaviour is responsible for:

  • Managing terminal environment variables
  • Handling terminal configuration
  • Providing environment-specific settings
  • Adapting to different terminal environments

Summary

Callbacks

Gets all environment variables.

Gets the value of an environment variable.

Gets terminal-specific configuration.

Gets the current terminal type.

Sets an environment variable.

Checks if a specific terminal feature is supported.

Updates terminal configuration.

Callbacks

get_all_env()

@callback get_all_env() :: {:ok, map()} | {:error, any()}

Gets all environment variables.

get_env(key)

@callback get_env(key :: String.t()) :: {:ok, String.t()} | {:error, any()}

Gets the value of an environment variable.

get_terminal_config()

@callback get_terminal_config() :: {:ok, map()} | {:error, any()}

Gets terminal-specific configuration.

get_terminal_type()

@callback get_terminal_type() :: {:ok, String.t()} | {:error, any()}

Gets the current terminal type.

set_env(key, value)

@callback set_env(key :: String.t(), value :: String.t()) :: :ok | {:error, any()}

Sets an environment variable.

supports_feature?(feature)

@callback supports_feature?(feature :: atom()) :: boolean()

Checks if a specific terminal feature is supported.

update_terminal_config(config)

@callback update_terminal_config(config :: map()) :: :ok | {:error, any()}

Updates terminal configuration.