Scince May 8, 2020 official package is available here @figma/plugin-typings. This package no longer needed and should be replaced with official one.
This repository automatically making releases of official Figma plugin Typescript definitions file to @figma-plugin/types NPM module.
- Installation
npm i --save-dev @figma-plugin/types
# or
yarn add -D @figma-plugin/types
- Configure tsconfig.json
{
"compilerOptions": {
"moduleResolution": "node"
}
}
- Create index.d.ts in the root of project and import definitions to apply it globally:
import "@figma-plugin/types"
GitHub Actions cronjob checks for updates for figma.d.ts source every 24 hours, and if new version detected make a release to NPM.