Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/figma/plugin-typings
Typings for the Figma Plugin API
https://github.com/figma/plugin-typings
figma typescript
Last synced: 3 days ago
JSON representation
Typings for the Figma Plugin API
- Host: GitHub
- URL: https://github.com/figma/plugin-typings
- Owner: figma
- License: mit
- Created: 2020-04-27T20:43:28.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2025-01-06T16:40:11.000Z (20 days ago)
- Last Synced: 2025-01-17T10:03:35.697Z (10 days ago)
- Topics: figma, typescript
- Language: Shell
- Homepage:
- Size: 368 KB
- Stars: 201
- Watchers: 77
- Forks: 45
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - plugin-typings
README
# Figma Plugin API typings
[![npm](https://img.shields.io/npm/v/@figma/plugin-typings?logo=npm&cacheSeconds=1800)](https://www.npmjs.com/package/@figma/plugin-typings)This repository contains the typings for the Figma Plugin API.
## Usage
1. Installation
```sh
npm i --save-dev @figma/plugin-typings
# or
yarn add -D @figma/plugin-typings
```2. Configure _tsconfig.json_
```js
{
"compilerOptions": {
"typeRoots": [
"./node_modules/@types",
"./node_modules/@figma"
]
}
}
```
The configuration above is needed for the TypeScript compiler to use type definitions found in both `./node_modules/@types` and `./node_modules/@figma`. Normally, most external type definitions are from DefinitelyTyped and are installed in `/@types`, which included by TypeScript by default. Since we host the plugin typings separately, they are installed outside in `/@figma` instead.Types should become globally available without needing to use import statements. We do it this way because the plugin API is part of the host environment, as opposed to being a package that a plugin includes.
## About
Plugin API releases have the format "Version X, Update Y". Equivalent tags are created in this repository as `v.`. Note that not all API releases include API changes, some are just bug fixes. Therefore, some typings versions are skipped.