Documentation for types similar to Elixir's `@typedoc`

How do you write documentation for a type? For example, if I define a type in Elixir, I can write documentation for it like this:

@typedoc """
A pet animal.
@type pet :: :cat | :dog

However, the following errors out with EDoc :

%% @doc A pet animal.
-type pet() :: cat | dog.

with the following error:

... in module footer: at line 12: tag @doc not allowed here.
edoc: error in doclet 'edoc_doclet_chunks': {'EXIT',error}.
===> An unknown error occurred generating doc chunks with edoc. Run with DIAGNOSTICS=1 for more details.

Recently it was mentioned in the Erlang slack, that you have to put the comment after the type (and without @doc).

-type pet() :: cat | dog.
%% A pet animal.

This way edoc puts the comment below your type in the “Data Types”-section.