(ns ^{:go-imports []
      :doc "Implements encoding and decoding of JSON as defined in RFC 4627."}
  json)

(defn read-string
  "Parses the JSON-encoded data and return the result as a Joker value.
  Optional opts map may have the following keys:
  :keywords? - if true, JSON keys will be converted from strings to keywords."
  {:added "1.0"
   :go {1 "readString(s, nil)"
        2 "readString(s, opts)"}}
  ([^String s])
  ([^String s ^Map opts]))

(defn write-string
  "Returns the JSON encoding of v. Optional opts may include :prefix and :indent keys
  with the same semantics as prefix and indent arguments to Go's json.MarshalIndent function."
  {:added "1.0"
   :go {1 "writeString(v, EmptyArrayMap())"
        2 "writeString(v, opts)"}}
  ([^Object v])
  ([^Object v ^Map opts]))

(defn json-seq
  "Returns the json records from rdr as a lazy sequence.
  rdr must be a string or implement io.Reader.
  Optional opts map may have the following keys:
  :keywords? - if true, JSON keys will be converted from strings to keywords."
  {:added "1.0"
   :go {1 "jsonSeqOpts(rdr, EmptyArrayMap())"
        2 "jsonSeqOpts(rdr, opts)"}}
  ([^Object rdr])
  ([^Object rdr ^Map opts]))
