--- id: tiled-read name: Tiled.read category: tiled kind: namespace-method tokens: Tiled.read sig: Tiled.read(path: string) -> value tip: Read a map file into the intermediate value tree. order: 1 ns: Tiled member: read --- Reads a Tiled map file at path — auto-detecting TMX (XML) vs TMJ (JSON) by its first byte — and returns the intermediate map Value tree in Tiled's JSON schema: orientation, width/height, tilewidth/tileheight, a tilesets list and a layers list. Every tile layer's data is decoded to a dense GID int list (CSV split, or base64 → zlib/gzip inflate → little-endian u32s), so the two formats yield structurally identical trees.