{
  "classes": [
    {
      "constants": [],
      "types": [
        {
          "lua_type": "type EncodeOptions = {\n    pretty: boolean?,\n    indent: string?,\n    sortKeys: boolean?,\n}",
          "name": "EncodeOptions",
          "tags": [],
          "source": {
            "path": "",
            "line": 82
          },
          "fields": [
            {
              "lua_type": "pretty: boolean?",
              "name": "pretty",
              "desc": "Insert newlines and indentation for readability."
            },
            {
              "lua_type": "indent: string?",
              "name": "indent",
              "desc": "Indentation string used when `pretty` is enabled (default `\"  \"` - two spaces)."
            },
            {
              "lua_type": "sortKeys: boolean?",
              "name": "sortKeys",
              "desc": "Sort object keys alphabetically."
            }
          ],
          "desc": ""
        }
      ],
      "name": "@eryx/encoding/json",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 194
          },
          "is_method": false,
          "signature": "json.encode(\n    value: any,  -- -- The value to encode.\n    options: EncodeOptions?  -- Optional formatting options.\n) → (\n    string  -- The JSON string. \n)",
          "owner": "json",
          "desc": "Encodes a Luau value as a JSON string.\n\nTables with sequential integer keys (1 .. n) are encoded as JSON arrays.\nTables with string keys are encoded as JSON objects.  Nested structures\nare fully supported.\n\nSet `options.pretty` to `true` for indented, human-readable output.\nSet `options.sortKeys` to `true` to emit object keys in alphabetical order.\n",
          "tags": [],
          "name": "encode",
          "return_str": "string",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string",
              "desc": "The JSON string. "
            }
          ],
          "params": [
            {
              "lua_type": "any",
              "name": "value",
              "desc": "-- The value to encode."
            },
            {
              "lua_type": "EncodeOptions?",
              "name": "options",
              "desc": "Optional formatting options."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 500
          },
          "is_method": false,
          "signature": "json.decode(\n    str: string  -- A valid JSON string.\n) → (\n    any  -- The decoded Luau value. \n)",
          "owner": "json",
          "desc": "Decodes a JSON string into a Luau value.\n\n| JSON          | Luau          |\n|---------------|---------------|\n| string        | `string`      |\n| number        | `number`      |\n| true / false  | `boolean`     |\n| null          | `nil`         |\n| array  []     | Numeric table    |\n| object {}     | `{ [string]: any }` |\n\n> **Note:** JSON `null` values inside arrays will create holes in the\n> resulting Luau table.  Standalone `null` at the top level returns `nil`.\n",
          "tags": [],
          "name": "decode",
          "return_str": "any",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "any",
              "desc": "The decoded Luau value. "
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "str",
              "desc": "A valid JSON string."
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "JSON encoding and decoding.\n\nSerialises Luau values to JSON text and parses JSON text back into\nLuau values.  Follows RFC 8259 with sensible Luau-specific defaults.\n\n```luau\nlocal json = require(\"@eryx/encoding/json\")\n\nlocal str = json.encode({ name = \"Alice\", scores = {100, 97} })\nprint(str)  -- '{\"name\":\"Alice\",\"scores\":[100,97]}'\n\nlocal tbl = json.decode('{\"x\":1,\"y\":2}')\nprint(tbl.x, tbl.y)  -- 1  2\n```\n\n**Mapping rules:**\n\n| Luau          | JSON          |\n|---------------|---------------|\n| `string`      | string        |\n| `number`      | number        |\n| `boolean`     | true / false  |\n| `nil`         | null          |\n| Numeric table | array  []     |\n| Mixed table   | object {}     |\n"
    }
  ]
}