Skip to content

Commit

Permalink
Added types object and array.
Browse files Browse the repository at this point in the history
  • Loading branch information
azizk committed Oct 15, 2023
1 parent 0b15a2c commit e416872
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/jason.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,15 @@ defmodule Jason do
@typedoc "Available decoding options."
@type decode_opt :: {:keys, keys} | {:strings, strings} | {:floats, floats} | {:objects, objects}

@typedoc "A plain JSON value where map keys can only be strings."
@type value :: nil | String.t() | number | boolean | [value] | %{String.t() => value}
@typedoc "A plain JSON object where keys can only be strings."
@type object :: %{String.t() => value}
@typedoc "A plain JSON array."
@type array :: [value]
@typedoc "A plain JSON value."
@type value :: nil | String.t() | number | boolean | array | object
@typedoc "A decoded JSON value where map keys can have any type."
@type decoded :: [decoded] | %{map_key => decoded} | value
@typedoc "The map key types that can be encoded."
@typedoc "The type of map keys that can be encoded."
@type encodable_key :: String.t() | number | atom | [encodable_key]
@typedoc "The types that can be encoded. Not included are: `tuple`s, `function`s, `reference`s, `port`s and `pid`s."
@type encodable :: String.t() | number | atom | [encodable] | %{encodable_key => encodable}
Expand Down

0 comments on commit e416872

Please sign in to comment.