method
Tiled.read
Tiled.read(path: string) -> value
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.