summaryrefslogtreecommitdiff
path: root/lib/chessh/ssh/screens/screen.ex
blob: be6e00e617ee7f833d94529e09cc8bfe1b088d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
defmodule Chessh.SSH.Client.Screen do
  @callback render(state :: Chessh.SSH.Client.State.t() | any()) :: any()
  @callback handle_input(action :: any(), state :: Chessh.SSH.Client.State.t()) ::
              Chessh.SSH.Client.State.t()

  defmacro __using__(_) do
    quote do
      @behaviour Chessh.SSH.Client.Screen

      @ascii_chars Application.compile_env!(:chessh, :ascii_chars_json_file)
                   |> File.read!()
                   |> Jason.decode!()
    end
  end
end