From 24492e2bdf48e52f8075b64c3f3dcf51383c86eb Mon Sep 17 00:00:00 2001 From: alisdair sullivan Date: Sun, 17 Jul 2011 00:37:44 -0700 Subject: [PATCH] type specs update --- src/jsx_common.hrl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/jsx_common.hrl b/src/jsx_common.hrl index 378a768..d77f2b5 100644 --- a/src/jsx_common.hrl +++ b/src/jsx_common.hrl @@ -60,6 +60,9 @@ | {literal, true} | {literal, false} | {literal, null}. + + +-type jsx_encodeable() :: jsx_event() | [jsx_encodeable()]. -type jsx_iterator() :: jsx_decoder() | jsx_encoder(). @@ -68,12 +71,14 @@ %% this probably doesn't work properly -type jsx_decoder() :: fun((binary()) -> jsx_iterator_result()). --type jsx_encoder() :: fun((list(jsx_event())) -> jsx_iterator_result()). + + +-type jsx_encoder() :: fun((jsx_encodeable()) -> jsx_iterator_result()). -type jsx_iterator_result() :: {event, jsx_event(), fun(() -> jsx_iterator_result())} | {incomplete, jsx_iterator()} - | {error, {badjson, binary()}}. + | {error, {badjson, any()}}.