{
  "classes": [
    {
      "constants": [],
      "types": [
        {
          "lua_type": "type NodeType = \"element\"\n    | \"pcdata\"\n    | \"cdata\"\n    | \"comment\"\n    | \"pi\"\n    | \"declaration\"\n    | \"doctype\"\n    | \"document\"\n    | \"null\"",
          "name": "NodeType",
          "tags": [],
          "source": {
            "path": "",
            "line": 27
          },
          "fields": [],
          "desc": "Node type string"
        }
      ],
      "name": "@eryx/encoding/xml",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 154
          },
          "is_method": false,
          "signature": "xml.parse(source: string) → XmlDocument",
          "owner": "xml",
          "desc": "Parses an XML string and returns a new document.",
          "tags": [],
          "name": "parse",
          "return_str": "XmlDocument",
          "function_type": "Function",
          "errors": [
            {
              "desc": "Throws if the input is not well-formed XML. "
            }
          ],
          "returns": [
            {
              "lua_type": "XmlDocument",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "source",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 162
          },
          "is_method": false,
          "signature": "xml.load(path: string) → XmlDocument",
          "owner": "xml",
          "desc": "Loads and parses an XML file from disk.",
          "tags": [],
          "name": "load",
          "return_str": "XmlDocument",
          "function_type": "Function",
          "errors": [
            {
              "desc": "Throws if the file cannot be read or the XML is malformed. "
            }
          ],
          "returns": [
            {
              "lua_type": "XmlDocument",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 170
          },
          "is_method": false,
          "signature": "xml.document() → XmlDocument",
          "owner": "xml",
          "desc": "Creates a new, empty XML document.\nUse `AppendChild()` to add a root element and build the tree programmatically.\n",
          "tags": [],
          "name": "document",
          "return_str": "XmlDocument",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "XmlDocument",
              "desc": ""
            }
          ],
          "params": []
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "XML module – DOM parsing, manipulation, serialisation and XPath queries.\n\nBacked by pugixml. Provides two core types:\n [[XmlDocument]]: An XML document that owns the DOM tree.\n [[XmlNode]]: A lightweight handle to a single element within a document.\n\n## Quick start\n```luau\nlocal xml = require(\"xml\")\nlocal doc = xml.parse('<root><item id=\"1\">Hello</item></root>')\nlocal root = doc:root()\nprint(root.name)                    --> \"root\"\nprint(root:child(\"item\"):text())    --> \"Hello\"\nprint(root:child(\"item\"):attr(\"id\")) --> \"1\"\n\n XPath\nfor _, node in doc:xpath(\"//item[@id]\") do\n    print(node.name, node:attr(\"id\"))\nend\n```\n"
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 36
      },
      "tags": [],
      "properties": [
        {
          "tags": [],
          "lua_type": "name: string",
          "name": "name",
          "desc": "The element/PI tag name, or `\"\"` for text/comment nodes."
        },
        {
          "tags": [],
          "lua_type": "type: NodeType",
          "name": "type",
          "desc": "The node type (see [[NodeType]])."
        },
        {
          "tags": [],
          "lua_type": "value: string",
          "name": "value",
          "desc": "Shorthand for the first PCDATA/CDATA child's content (like `Text()`)."
        }
      ],
      "desc": "A lightweight handle to a single node in an XML DOM tree.\n\nNodes remain valid as long as their owning `XmlDocument` is alive.\nReading `.name`, `.type`, or `.value` uses `__index` and does not\nrequire a method call.\n",
      "name": "XmlNode",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 46
          },
          "is_method": true,
          "signature": "XmlNode:text() → string",
          "desc": "Returns the concatenated text content of this element (first PCDATA/CDATA child).",
          "tags": [],
          "name": "text",
          "return_str": "string",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 49
          },
          "is_method": true,
          "signature": "XmlNode:setText(value: string) → ()",
          "desc": "Sets the text content of this element (creates a PCDATA child if needed).",
          "tags": [],
          "name": "setText",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "value",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 52
          },
          "is_method": true,
          "signature": "XmlNode:children(name: string?) → { XmlNode }",
          "desc": "Returns a list of element children.  If `name` is given, only children with that tag name are included.",
          "tags": [],
          "name": "children",
          "return_str": "{ XmlNode }",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "{ XmlNode }",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string?",
              "name": "name",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 55
          },
          "is_method": true,
          "signature": "XmlNode:child(name: string) → XmlNode?",
          "desc": "Returns the first child element with the given tag name, or `nil` if not found.",
          "tags": [],
          "name": "child",
          "return_str": "XmlNode?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "name",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 58
          },
          "is_method": true,
          "signature": "XmlNode:appendChild(name: string) → XmlNode",
          "desc": "Appends a new child element with the given tag name.",
          "tags": [],
          "name": "appendChild",
          "return_str": "XmlNode",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "name",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 61
          },
          "is_method": true,
          "signature": "XmlNode:prependChild(name: string) → XmlNode",
          "desc": "Prepends a new child element with the given tag name.",
          "tags": [],
          "name": "prependChild",
          "return_str": "XmlNode",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "name",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 64
          },
          "is_method": true,
          "signature": "XmlNode:removeChild(child: string | XmlNode) → ()",
          "desc": "Removes a child by tag name or by XmlNode reference.",
          "tags": [],
          "name": "removeChild",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string | XmlNode",
              "name": "child",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 67
          },
          "is_method": true,
          "signature": "XmlNode:parent() → XmlNode?",
          "desc": "Returns the parent node, or `nil` for the document root.",
          "tags": [],
          "name": "parent",
          "return_str": "XmlNode?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode?",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 70
          },
          "is_method": true,
          "signature": "XmlNode:nextSibling(name: string?) → XmlNode?",
          "desc": "Returns the next sibling element.  If `name` is given, skips siblings until one with a matching tag name is found.",
          "tags": [],
          "name": "nextSibling",
          "return_str": "XmlNode?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string?",
              "name": "name",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 73
          },
          "is_method": true,
          "signature": "XmlNode:prevSibling(name: string?) → XmlNode?",
          "desc": "Returns the previous sibling element.",
          "tags": [],
          "name": "prevSibling",
          "return_str": "XmlNode?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string?",
              "name": "name",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 76
          },
          "is_method": true,
          "signature": "XmlNode:attr(name: string) → string?",
          "desc": "Returns the value of the attribute `name`, or `nil`.",
          "tags": [],
          "name": "attr",
          "return_str": "string?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "name",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 79
          },
          "is_method": true,
          "signature": "XmlNode:setAttr(name: string, value: string) → ()",
          "desc": "Sets (or creates) the attribute `name` to `value`.",
          "tags": [],
          "name": "setAttr",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "name",
              "desc": ""
            },
            {
              "lua_type": "string",
              "name": "value",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 82
          },
          "is_method": true,
          "signature": "XmlNode:removeAttr(name: string) → ()",
          "desc": "Removes the attribute with the given name.",
          "tags": [],
          "name": "removeAttr",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "name",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 85
          },
          "is_method": true,
          "signature": "XmlNode:attrs() → { [string]: string }",
          "desc": "Returns all attributes as a `{ [name] = value }` dictionary.",
          "tags": [],
          "name": "attrs",
          "return_str": "{ [string]: string }",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "{ [string]: string }",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 89
          },
          "is_method": true,
          "signature": "XmlNode:xpath(query: string) → { XmlNode }",
          "desc": "Evaluates an XPath expression relative to this node and\nreturns all matching nodes.",
          "tags": [],
          "name": "xpath",
          "return_str": "{ XmlNode }",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "{ XmlNode }",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "query",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 93
          },
          "is_method": true,
          "signature": "XmlNode:xpathOne(query: string) → XmlNode?",
          "desc": "Evaluates an XPath expression and returns the first match,\nor `nil`. ]]",
          "tags": [],
          "name": "xpathOne",
          "return_str": "XmlNode?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "query",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 97
          },
          "is_method": true,
          "signature": "XmlNode:xpathValue(query: string) → string | number | boolean | nil",
          "desc": "Evaluates an XPath expression that returns a scalar value\n(string, number, or boolean) rather than a node set.",
          "tags": [],
          "name": "xpathValue",
          "return_str": "string | number | boolean | nil",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string | number | boolean | nil",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "query",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 101
          },
          "is_method": true,
          "signature": "XmlNode:path(delimiter: string?) → string",
          "desc": "Returns the absolute path of this node from the document root.\nUses `delimiter` (default `\"/\"`) to separate path segments.",
          "tags": [],
          "name": "path",
          "return_str": "string",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string?",
              "name": "delimiter",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 104
          },
          "is_method": true,
          "signature": "XmlNode:setName(name: string) → ()",
          "desc": "Changes this element's tag name.",
          "tags": [],
          "name": "setName",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "name",
              "desc": ""
            }
          ]
        }
      ],
      "metamethods": [
        {
          "signature": "XmlNode:__tostring() → string",
          "name": "__tostring",
          "desc": ""
        }
      ],
      "types": []
    },
    {
      "is_primary_export": false,
      "source": {
        "path": "",
        "line": 118
      },
      "tags": [],
      "properties": [],
      "desc": "An XML document that owns a DOM tree.\n\nThe document is the entry point for parsing and serialisation.  It\nexposes XPath queries directly so you don't always need to grab the\nroot element first.\n",
      "name": "XmlDocument",
      "functions": [
        {
          "source": {
            "path": "",
            "line": 121
          },
          "is_method": true,
          "signature": "XmlDocument:root() → XmlNode?",
          "desc": "Returns the document element (the single top-level element).",
          "tags": [],
          "name": "root",
          "return_str": "XmlNode?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode?",
              "desc": ""
            }
          ],
          "params": []
        },
        {
          "source": {
            "path": "",
            "line": 129
          },
          "is_method": true,
          "signature": "XmlDocument:save(\n    indent: string?,  -- Indentation string (default `\"\\t\"`).\n    flags: string?  -- `\"raw\"` | `\"no_declaration\"` | `nil` (default includes a declaration and pretty-prints). \n) → string",
          "desc": "Serialises the entire document to a string.",
          "tags": [],
          "name": "save",
          "return_str": "string",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "string",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string?",
              "name": "indent",
              "desc": "Indentation string (default `\"\\t\"`)."
            },
            {
              "lua_type": "string?",
              "name": "flags",
              "desc": "`\"raw\"` | `\"no_declaration\"` | `nil` (default includes a declaration and pretty-prints). "
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 134
          },
          "is_method": true,
          "signature": "XmlDocument:saveFile(path: string, indent: string?, flags: string?) → ()",
          "desc": "Writes the document to a file on disk.\n",
          "tags": [],
          "name": "saveFile",
          "return_str": "()",
          "function_type": "Method",
          "returns": [],
          "params": [
            {
              "lua_type": "string",
              "name": "path",
              "desc": ""
            },
            {
              "lua_type": "string?",
              "name": "indent",
              "desc": ""
            },
            {
              "lua_type": "string?",
              "name": "flags",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 137
          },
          "is_method": true,
          "signature": "XmlDocument:xpath(query: string) → { XmlNode }",
          "desc": "Evaluates an XPath expression on the whole document and returns all matching nodes.",
          "tags": [],
          "name": "xpath",
          "return_str": "{ XmlNode }",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "{ XmlNode }",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "query",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 140
          },
          "is_method": true,
          "signature": "XmlDocument:xpathOne(query: string) → XmlNode?",
          "desc": "Evaluates an XPath expression and returns the first match, or `nil`.",
          "tags": [],
          "name": "xpathOne",
          "return_str": "XmlNode?",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode?",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "query",
              "desc": ""
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 143
          },
          "is_method": true,
          "signature": "XmlDocument:appendChild(name: string) → XmlNode",
          "desc": "Appends a top-level child element (useful when building documents from scratch with `xml.document()`).",
          "tags": [],
          "name": "appendChild",
          "return_str": "XmlNode",
          "function_type": "Method",
          "returns": [
            {
              "lua_type": "XmlNode",
              "desc": ""
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "name",
              "desc": ""
            }
          ]
        }
      ],
      "metamethods": [
        {
          "signature": "XmlDocument:__tostring() → string",
          "name": "__tostring",
          "desc": ""
        }
      ],
      "types": []
    }
  ]
}