debianize-mobilizon/lib/federation/activity_stream/converter/converter.ex
Thomas Citharel de047c8939
Various typespec and compilation improvements
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2021-09-26 17:52:20 +02:00

14 lines
395 B
Elixir

defmodule Mobilizon.Federation.ActivityStream.Converter do
@moduledoc """
Converter behaviour.
This module allows to convert from ActivityStream format to our own internal
one, and back.
"""
@type model_data :: map()
@callback as_to_model_data(as_data :: ActivityStream.t()) :: model_data() | {:error, any()}
@callback model_to_as(model :: struct()) :: ActivityStream.t()
end