Behaviour for output destinations that receive rendered prompt-runner text and raw events.
@type opts() :: keyword()
@type state() :: term()
@callback close(state()) :: :ok
@callback flush(state()) :: {:ok, state()}
@callback init(opts()) :: {:ok, state()} | {:error, term()}
@callback write(iodata(), state()) :: {:ok, state()} | {:error, term(), state()}
@callback write_event(event :: map(), iodata(), state()) :: {:ok, state()} | {:error, term(), state()}