diff --git a/lib/expo/message.ex b/lib/expo/message.ex index 8af86a4..19466b8 100644 --- a/lib/expo/message.ex +++ b/lib/expo/message.ex @@ -42,12 +42,9 @@ defmodule Expo.Message do """ @type t :: Singular.t() | Plural.t() - @typedoc """ - The key that can be used to identify a message. - - See `key/1`. - """ - @opaque key :: Singular.key() | Plural.key() + @typep key :: + {msgctxt :: String.t(), msgid :: String.t()} + | {msgctxt :: String.t(), msgid :: String.t()} @doc """ Returns a "key" that can be used to identify a message. diff --git a/lib/expo/message/plural.ex b/lib/expo/message/plural.ex index b3e9023..2ad8433 100644 --- a/lib/expo/message/plural.ex +++ b/lib/expo/message/plural.ex @@ -19,15 +19,8 @@ defmodule Expo.Message.Plural do """ @type block :: :msgid | {:msgstr, non_neg_integer()} | :msgctxt | :msgid_plural - @typedoc """ - Metadata for this struct. - """ - @opaque meta :: %{optional(:source_line) => %{block() => non_neg_integer()}} - - @typedoc """ - The key that identifies this message. - """ - @opaque key :: {msgctxt :: String.t(), msgid :: String.t()} + @typep meta :: %{optional(:source_line) => %{block() => non_neg_integer()}} + @typep key :: {msgctxt :: String.t(), msgid :: String.t()} @typedoc """ The type for this struct. diff --git a/lib/expo/message/singular.ex b/lib/expo/message/singular.ex index 1387257..863566b 100644 --- a/lib/expo/message/singular.ex +++ b/lib/expo/message/singular.ex @@ -18,15 +18,8 @@ defmodule Expo.Message.Singular do """ @type block :: :msgid | :msgstr | :msgctxt - @typedoc """ - Metadata for this struct. - """ - @opaque meta :: %{optional(:source_line) => %{block() => non_neg_integer()}} - - @typedoc """ - The key that identifies this message. - """ - @opaque key :: {msgctxt :: String.t(), msgid :: String.t()} + @typep meta :: %{optional(:source_line) => %{block() => non_neg_integer()}} + @typep key :: {msgctxt :: String.t(), msgid :: String.t()} @typedoc """ The type for this struct. diff --git a/lib/expo/plural_forms.ex b/lib/expo/plural_forms.ex index b54e346..abc76c0 100644 --- a/lib/expo/plural_forms.ex +++ b/lib/expo/plural_forms.ex @@ -25,18 +25,12 @@ defmodule Expo.PluralForms do plural: plural_ast() } - @typedoc """ - The AST of a plural forms expression. - - This is evaluated internally to determine the plural form for a given number - using `index/2`, and is not meant to be inspected directly. - """ - @opaque plural_ast() :: - :n - | integer() - | {:!= | :> | :< | :== | :% | :<= | :>= | :&& | :||, plural_ast(), plural_ast()} - | {:if, plural_ast(), plural_ast(), plural_ast()} - | {:paren, plural_ast()} + @typep plural_ast() :: + :n + | integer() + | {:!= | :> | :< | :== | :% | :<= | :>= | :&& | :||, plural_ast(), plural_ast()} + | {:if, plural_ast(), plural_ast(), plural_ast()} + | {:paren, plural_ast()} @doc """ Parses a plural forms string into a `t:t/0` struct.