1.3.0 • Published 3 years ago

tiled-types v1.3.0

Weekly downloads
73
License
MIT
Repository
github
Last release
3 years ago

tiled-types

Type definitions of Tiled generated JSON https://github.com/bjorn/tiled.

Build Status

Made for Tiled 1.4.

Based on its documentation https://doc.mapeditor.org/en/stable/reference/json-map-format.

Installation

npm install tiled-types

Use

import TiledMap, { TiledLayerTilelayer } from "tiled-types";

// Assume we're in node context
const map: TiledMap = fs.readFileSync('path/to/schema.json', 'utf8');

const allTilelayers: TiledLayerTilelayer[] = map.layers
    .filter((l): l is TiledLayerTilelayer => l.type === 'tilelayer');

You can find quite the same example here

Credits

Thanks to type-zoo for there repo configuration :+1:

And to Tiled contributors :100:

1.3.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.0

4 years ago

1.0.0

4 years ago