Raxol.Terminal.Parser.StateBehaviour behaviour (Raxol v0.5.0)

View Source

Defines the behaviour for parser states.

Summary

Types

emulator()

@type emulator() :: Raxol.Terminal.Emulator.t()

state()

@type state() :: any()

Callbacks

handle(emulator, state, binary)

@callback handle(emulator(), state(), binary()) ::
  {:continue, emulator(), state(), binary()}
  | {:finished, emulator(), state()}
  | {:incomplete, emulator(), state()}

handle_apc_string(emulator, state)

@callback handle_apc_string(emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}

handle_byte(byte, emulator, state)

@callback handle_byte(byte(), emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}

handle_control_sequence(emulator, state)

@callback handle_control_sequence(emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}

handle_dcs_string(emulator, state)

@callback handle_dcs_string(emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}

handle_escape(emulator, state)

@callback handle_escape(emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}

handle_osc_string(emulator, state)

@callback handle_osc_string(emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}

handle_pm_string(emulator, state)

@callback handle_pm_string(emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}

handle_sos_string(emulator, state)

@callback handle_sos_string(emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}

handle_unknown(emulator, state)

@callback handle_unknown(emulator(), state()) ::
  {:ok, emulator(), state()} | {:error, atom(), emulator(), state()}