View Source Termite.Terminal.Adapter behaviour (Termite v0.3.0)

The behaviour module for implementing an adapter.

Summary

Callbacks

Return a reference for the reader for handling input messages.

Returns a map of the width and height

Start the terminal adapter.

Write a string to the terminal. This function is expected to be implemented synchronously in the adapter.

Callbacks

@callback reader(terminal :: term()) :: {:ok, reference()} | {:error, atom()}

Return a reference for the reader for handling input messages.

@callback resize(terminal :: term()) :: %{width: integer(), height: integer()}

Returns a map of the width and height

@callback start(opts :: %{}) :: {:ok, term()} | {:error, atom()}

Start the terminal adapter.

@callback write(terminal :: term(), string :: String.t()) ::
  {:ok, term()} | {:error, atom()}

Write a string to the terminal. This function is expected to be implemented synchronously in the adapter.