Like this?
I haven't attempted it myself but I think it's just a matter of assigning different squares to different arrays and saving info into a JSON file.
Each array element has multiple conditions.
Maybe:
[0][0][x] can contain ID of square and actual position of a square in a map
[0][1][y] can contain info like number of directions possible and id of adjacent squares.
[0][2][z] can contain info like items and interact-able elements in the map...