sig
  type lexeme =
      [ `Ae
      | `As
      | `Bool of bool
      | `Float of float
      | `Name of string
      | `Null
      | `Oe
      | `Os
      | `String of string ]
  val pp_lexeme : Format.formatter -> [< OpamJson.lexeme ] -> unit
  type error =
      [ `Expected of
          [ `Aval of bool
          | `Comment
          | `Eoi
          | `Json
          | `Name
          | `Name_sep
          | `Omem of bool
          | `Value ]
      | `Illegal_BOM
      | `Illegal_bytes of string
      | `Illegal_escape of
          [ `Lone_hi_surrogate of int
          | `Lone_lo_surrogate of int
          | `Not_esc_uchar of int
          | `Not_hex_uchar of int
          | `Not_lo_surrogate of int ]
      | `Illegal_literal of string
      | `Illegal_number of string
      | `Illegal_string_uchar of int
      | `Unclosed of [ `As | `Comment | `Os | `String ] ]
  val pp_error : Format.formatter -> [< OpamJson.error ] -> unit
  type encoding = [ `UTF_16 | `UTF_16BE | `UTF_16LE | `UTF_8 ]
  type src =
      [ `Channel of Pervasives.in_channel | `Manual | `String of string ]
  type decoder
  val decoder :
    ?encoding:[< OpamJson.encoding ] -> [< OpamJson.src ] -> OpamJson.decoder
  val decode :
    OpamJson.decoder ->
    [> `Await | `End | `Error of OpamJson.error | `Lexeme of OpamJson.lexeme ]
  val decoded_range : OpamJson.decoder -> (int * int) * (int * int)
  val decoder_encoding : OpamJson.decoder -> OpamJson.encoding
  val decoder_src : OpamJson.decoder -> OpamJson.src
  type dst =
      [ `Buffer of Buffer.t | `Channel of Pervasives.out_channel | `Manual ]
  type encoder
  val encoder : ?minify:bool -> [< OpamJson.dst ] -> OpamJson.encoder
  val encode :
    OpamJson.encoder ->
    [< `Await | `End | `Lexeme of OpamJson.lexeme ] -> [ `Ok | `Partial ]
  val encoder_dst : OpamJson.encoder -> OpamJson.dst
  val encoder_minify : OpamJson.encoder -> bool
  module Manual :
    sig
      val src : OpamJson.decoder -> string -> int -> int -> unit
      val dst : OpamJson.encoder -> string -> int -> int -> unit
      val dst_rem : OpamJson.encoder -> int
    end
  module Uncut :
    sig
      val decode :
        OpamJson.decoder ->
        [ `Await
        | `Comment of [ `M | `S ] * string
        | `End
        | `Error of OpamJson.error
        | `Lexeme of OpamJson.lexeme
        | `White of string ]
      val pp_decode :
        Format.formatter ->
        [< `Await
         | `Comment of [ `M | `S ] * string
         | `End
         | `Error of OpamJson.error
         | `Lexeme of OpamJson.lexeme
         | `White of string ] ->
        unit
      val encode :
        OpamJson.encoder ->
        [< `Await
         | `Comment of [ `M | `S ] * string
         | `End
         | `Lexeme of OpamJson.lexeme
         | `White of string ] ->
        [ `Ok | `Partial ]
    end
  type t =
      [ `A of OpamJson.t list
      | `Bool of bool
      | `Float of float
      | `Null
      | `O of (string * OpamJson.t) list
      | `String of string ]
  val to_string : OpamJson.t -> string
  val add : OpamJson.t -> unit
  val output : unit -> unit
  val set_output : (string -> unit) -> unit
  val verbose : unit -> bool
end