open-index/open-npm huggingface dataset:
npm package: @figma/create-widget
Description: Create a widget from figma widget templates
Author: Figma
Latest version: 1.0.7

# @figma/create-widget

[![npm](https://img.shields.io/npm/v/@figma/create-widget?logo=npm&cacheSeconds=1800)](https://www.npmjs.com/package/@figma/create-widget)

Create new [FigJam widgets](https://figma.com/widget-docs) with a single command.

```bash
npm init @figma/widget
```

## Widget Organization

The created widgets use:

- [esbuild](https://esbuild.github.io/) for bundling
- [vite](https://vitejs.dev/) and [react](https://reactjs.org/) if the iframe option is specified
- [typescript](https://www.typescriptlang.org/) for typechecking

| file/folder   | description                                                                      |
| ------------- | -------------------------------------------------------------------------------- |
| manifest.json | The widget's [manifest.json](https://www.figma.com/widget-docs/widget-manifest/) |
| widget-src/   | Contains the widget code                                                         |
| ui-src/       | Contains the iframe code                                                         |

## Getting Started

After running `npm init @figma/widget`, follow the provided prompts.

### `npm run dev`

This is the only command you need to run in development. It will start the following processes for you:

- bundling (both widget and iframe code)
- typechecking (both widget and iframe code)
- vite dev server (for iframe development)

### `npm run build`

This runs bundling with minification turned on. You should run this command before releasing your widget.

### `npm run test`

This runs typechecking and makes sure that your widget builds without errors.

## Credit

Credit to https://github.com/yuanqing/create-figma-plugin for providing a way to `npm init` widgets and plugins before this repository ever existed.
npm package: @figma/plugin-typings
Description: Typings for the Figma Plugin API
Author: Figma
Latest version: 1.124.0

# 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<x>.<y>`. Note that not all API releases include API changes, some are just bug fixes. Therefore, some typings versions are skipped.
npm package: @figma/rest-api-spec
Description: Typings for the Figma REST API
Author: Figma
Latest version: 0.37.0

# rest-api-spec

This repository contains the OpenAPI specification and Typescript types for the [Figma REST API](https://www.figma.com/developers/api).

[Changelog](https://www.figma.com/developers/api#changelog)

Note: this specification is currently in beta. If you notice any inaccuracies with the specification, please [file an issue](https://github.com/figma/rest-api-spec/issues) in this repository.

## Usage

The OpenAPI (v3.1.0) specification is located in the `openapi/` directory. This specification can be used with a [wide variety of tools](https://tools.openapis.org/) to generate API documentation, client SDKs, and more.

The Typescript types are generated from the OpenAPI specification and are located in `dist/`.

We use a custom code generator to convert the OpenAPI spec to TypeScript. While there are a number of existing OpenAPI-to-Typescript code generators, we adopted a custom solution that produces output that we believe is more optimal for the Figma REST API. In particular:

- All OpenAPI schemas, responses, and request parameters are exported as named types. This exposes named types inside complex node properties (e.g. `Paint`, `VariableAlias`, etc...).
- Types directly associated with API endpoints are prefixed with the OpenAPI operation ID (e.g. `getFile` -> `GetFilePathParams`, `GetFileQueryParams`, `GetFileResponse`). For API endpoints expecting a request body, the types are suffixed with `RequestBody` (e.g. `postComments` -> `PostCommentsRequestBody`).

To use these types in your Typescript code, install the package:

```sh
npm install --save-dev @figma/rest-api-spec
```

Then import the types that you need:

```ts
import { type GetFileResponse } from '@figma/rest-api-spec'

// Many popular HTTP clients let you annotate response types
const result = await axios.get<GetFileResponse>(url);
result.data // This has type GetFileResponse
```
npm package: @figma/widget-typings
Description: Typings for the Figma Widget API
Author: Figma
Latest version: 1.12.1

# Figma Widget API typings

[![npm](https://img.shields.io/npm/v/@figma/widget-typings?logo=npm&cacheSeconds=1800)](https://www.npmjs.com/package/@figma/widget-typings)

This repository contains the typings for the Figma Widget API.

## Usage

1. Installation

   Note that the widget api is an extention of the plugin api so you should install both `@figma/plugin-typings` and `@figma/widget-typings`

   ```sh
   npm i --save-dev @figma/plugin-typings @figma/widget-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 & widget 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 widget API is part of the host environment, as opposed to being a package that a plugin includes.

## About

Widget API releases have the format "Version X, Update Y". Equivalent tags are created in this repository as `v<x>.<y>`. Note that not all API releases include API changes, some are just bug fixes. Therefore, some typings versions are skipped.