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

1.3.2 • Public • Published

tiled-lua-types

Forked from tiled-types

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

Made for Tiled 1.4.

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

Installation

yarn add -D Nyaacinth/tiled-lua-types

Use

import TiledMap, { TiledLayerTilelayer } from "tiled-lua-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 💯

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i tiled-lua-types

    Weekly Downloads

    1

    Version

    1.3.2

    License

    MIT

    Unpacked Size

    9.79 kB

    Total Files

    4

    Last publish

    Collaborators

    • nyaacinth