Packages
Multi-surface application runtime for Elixir. One TEA module renders to terminal, browser (LiveView), SSH, and MCP (agents). 30+ widgets, flexbox + CSS grid, AI agent runtime, distributed swarm with CRDTs, time-travel debugging, session recording, sandboxed REPL, and agentic commerce.
Current section
Files
Jump to
Current section
Files
lib/raxol/core/user_preferences_behaviour.ex
defmodule Raxol.Core.UserPreferences.Behaviour do
@moduledoc """
Defines the behaviour for UserPreferences services.
"""
@doc """
Gets a user preference value by key path.
"""
@callback get(
key_or_path :: atom() | list(atom()) | String.t(),
pid_or_name :: GenServer.server() | atom() | nil
) :: any()
@callback get(key_or_path :: atom() | list(atom()) | String.t()) :: any()
@doc """
Sets a user preference value by key path.
"""
@callback set(
key_or_path :: atom() | list(atom()) | String.t(),
value :: any(),
pid_or_name :: GenServer.server() | atom() | nil
) :: :ok
@callback set(
key_or_path :: atom() | list(atom()) | String.t(),
value :: any()
) :: :ok
@doc """
Forces an immediate save of the current preferences.
"""
@callback save!(pid_or_name :: GenServer.server() | atom() | nil) ::
:ok | {:error, any()}
@callback save!() :: :ok | {:error, any()}
@doc """
Retrieves the entire preferences map.
"""
@callback get_all(pid_or_name :: GenServer.server() | atom() | nil) :: map()
@callback get_all() :: map()
end