tiled-types
TypeScript icon, indicating that this package has built-in type declarations

1.3.0 • Public • Published

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 👍

And to Tiled contributors 💯

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.3.0
    28
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.3.0
    28
  • 1.2.1
    0
  • 1.2.0
    0
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i tiled-types

Weekly Downloads

28

Version

1.3.0

License

MIT

Unpacked Size

10.6 kB

Total Files

4

Last publish

Collaborators

  • chnapy