# @mapeditor/tiled-api

> TypeScript definitions for the Tiled scripting API

Latest version **1.12.0** (published 2026-07-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install @mapeditor/tiled-api
pnpm add @mapeditor/tiled-api
yarn add @mapeditor/tiled-api
bun add @mapeditor/tiled-api
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; high maintenance score; high quality score; popular repo.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.12.0 |
| Published | 2026-07-01 |
| First published | 2020-12-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 169.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 12952 |
| Maintainers | thorbjorn, ablu |

## Links

- npm: https://www.npmjs.com/package/@mapeditor/tiled-api
- Repository: https://github.com/mapeditor/tiled
- Homepage: https://www.mapeditor.org/
- Issues: https://github.com/mapeditor/tiled/issues
- Funding: https://github.com/sponsors/bjorn
- npm.io page: https://npm.io/package/@mapeditor/tiled-api

## Recent versions

- 1.12.0 (latest) — 2026-07-01
- 1.11.0 — 2024-08-15
- 1.10.1 — 2023-04-19
- 1.10.0 — 2023-03-15
- 1.9.2 — 2022-09-22
- 1.8.2 — 2022-05-03
- 1.8.1 — 2022-02-08
- 1.8.0 — 2022-02-07
- 1.6.0 — 2021-05-03
- 1.6.0-beta — 2021-04-29
- 1.4.3-beta — 2021-04-27
- 1.4.3-alpha2 — 2020-12-15
- 1.4.3-alpha — 2020-12-15

## README

# tiled-api

This package includes TypeScript definitions for the Tiled scripting API which
(depending on your editor support) also allow you to write simple JavaScript
scripts with automatic code completion.

## Online documentation

See: https://www.mapeditor.org/docs/scripting

## Writing a Tiled plugin with code completion in VS Code

Create a new project:

```bash
mkdir example-tiled-ts-plugin
cd example-tiled-ts-plugin
npm init
```

Install the Tiled definitions:
```bash
npm install @mapeditor/tiled-api --save-dev
```

Write your plugin and enjoy code-completion:
```js
/// <reference types="@mapeditor/tiled-api" />

const action = tiled.registerAction("CustomAction", function(action) {
    tiled.log(action.text + " was " + (action.checked ? "checked" : "unchecked"))
})

action.text = "My Custom Action"
action.checkable = true
action.shortcut = "Ctrl+K"

tiled.extendMenu("Edit", [
    { action: "CustomAction", before: "SelectAll" },
    { separator: true }
]);
```

Of course, when writing TypeScript code instead of JavaScript you also get
compilation errors instead of only syntax highlighting.

---
_Source: https://npm.io/package/@mapeditor/tiled-api · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
