Browse Source

型定義追加

Takeru Ohta 11 years ago
parent
commit
12c857b232
2 changed files with 17 additions and 0 deletions
  1. 1 0
      README.md
  2. 16 0
      src/jsone.erl

+ 1 - 0
README.md

@@ -0,0 +1 @@
+http://www.ietf.org/rfc/rfc4627.txt

+ 16 - 0
src/jsone.erl

@@ -4,6 +4,22 @@
          decode/1, decode/2
         ]).
 
+-export_type([
+              json_value/0,
+              json_number/0,
+              json_string/0,
+              json_array/0,
+              json_object/0,
+              json_boolean/0
+             ]).
+
+-type json_value() :: json_number() | json_string() | json_array() | json_object() | json_boolean() | null.
+-type json_number() :: number().
+-type json_string() :: binary().
+-type json_array() :: [json_value()].
+-type json_object() :: {object, [{json_string(), json_value()}]}.
+-type json_boolean() :: boolean().
+
 decode(JsonText) ->
     decode(JsonText, []).