├── CONTRIBUTING.md ├── package.json ├── LICENSE ├── README.md └── dist └── api_types.ts /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | If you notice any inaccuracies with the OpenAPI specification or Typescript types, please [file an issue](https://github.com/figma/rest-api-spec/issues). 4 | 5 | For bug reports and feature requests for the Figma REST API itself, please [contact Figma support](https://help.figma.com/hc/en-us/requests/new). 6 | 7 | Since the specification is auto-generated, we are not accepting pull requests in this repository. -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@figma/rest-api-spec", 3 | "version": "0.34.0", 4 | "description": "Typings for the Figma REST API", 5 | "main": "dist/api_types.ts", 6 | "repository": { 7 | "type": "git", 8 | "url": "git+https://github.com/figma/rest-api-spec.git" 9 | }, 10 | "keywords": [ 11 | "figma", 12 | "REST", 13 | "typings" 14 | ], 15 | "author": "Figma", 16 | "license": "MIT License", 17 | "bugs": { 18 | "url": "https://github.com/figma/rest-api-spec/issues" 19 | }, 20 | "homepage": "https://github.com/figma/rest-api-spec" 21 | } 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Figma 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rest-api-spec 2 | 3 | This repository contains the OpenAPI specification and Typescript types for the [Figma REST API](https://www.figma.com/developers/api). 4 | 5 | [Changelog](https://www.figma.com/developers/api#changelog) 6 | 7 | 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. 8 | 9 | ## Usage 10 | 11 | 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. 12 | 13 | The Typescript types are generated from the OpenAPI specification and are located in `dist/`. 14 | 15 | 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: 16 | 17 | - 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...). 18 | - 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`). 19 | 20 | To use these types in your Typescript code, install the package: 21 | 22 | ```sh 23 | npm install --save-dev @figma/rest-api-spec 24 | ``` 25 | 26 | Then import the types that you need: 27 | 28 | ```ts 29 | import { type GetFileResponse } from '@figma/rest-api-spec' 30 | 31 | // Many popular HTTP clients let you annotate response types 32 | const result = await axios.get(url); 33 | result.data // This has type GetFileResponse 34 | ``` 35 | 36 | -------------------------------------------------------------------------------- /dist/api_types.ts: -------------------------------------------------------------------------------- 1 | export type IsLayerTrait = { 2 | /** 3 | * A string uniquely identifying this node within the document. 4 | */ 5 | id: string 6 | 7 | /** 8 | * The name given to the node by the user in the tool. 9 | */ 10 | name: string 11 | 12 | /** 13 | * The type of the node 14 | */ 15 | type: string 16 | 17 | /** 18 | * Whether or not the node is visible on the canvas. 19 | */ 20 | visible?: boolean 21 | 22 | /** 23 | * If true, layer is locked and cannot be edited 24 | */ 25 | locked?: boolean 26 | 27 | /** 28 | * Whether the layer is fixed while the parent is scrolling 29 | * 30 | * @deprecated 31 | */ 32 | isFixed?: boolean 33 | 34 | /** 35 | * How layer should be treated when the frame is resized 36 | */ 37 | scrollBehavior: 'SCROLLS' | 'FIXED' | 'STICKY_SCROLLS' 38 | 39 | /** 40 | * The rotation of the node, if not 0. 41 | */ 42 | rotation?: number 43 | 44 | /** 45 | * A mapping of a layer's property to component property name of component properties attached to 46 | * this node. The component property name can be used to look up more information on the 47 | * corresponding component's or component set's componentPropertyDefinitions. 48 | */ 49 | componentPropertyReferences?: { [key: string]: string } 50 | 51 | /** 52 | * Data written by plugins that is visible only to the plugin that wrote it. Requires the 53 | * `pluginData` to include the ID of the plugin. 54 | */ 55 | pluginData?: unknown 56 | 57 | /** 58 | * Data written by plugins that is visible to all plugins. Requires the `pluginData` parameter to 59 | * include the string "shared". 60 | */ 61 | sharedPluginData?: unknown 62 | 63 | /** 64 | * A mapping of field to the variables applied to this field. Most fields will only map to a single 65 | * `VariableAlias`. However, for properties like `fills`, `strokes`, `size`, `componentProperties`, 66 | * and `textRangeFills`, it is possible to have multiple variables bound to the field. 67 | */ 68 | boundVariables?: { 69 | size?: { 70 | x?: VariableAlias 71 | 72 | y?: VariableAlias 73 | } 74 | 75 | individualStrokeWeights?: { 76 | top?: VariableAlias 77 | 78 | bottom?: VariableAlias 79 | 80 | left?: VariableAlias 81 | 82 | right?: VariableAlias 83 | } 84 | 85 | characters?: VariableAlias 86 | 87 | itemSpacing?: VariableAlias 88 | 89 | paddingLeft?: VariableAlias 90 | 91 | paddingRight?: VariableAlias 92 | 93 | paddingTop?: VariableAlias 94 | 95 | paddingBottom?: VariableAlias 96 | 97 | visible?: VariableAlias 98 | 99 | topLeftRadius?: VariableAlias 100 | 101 | topRightRadius?: VariableAlias 102 | 103 | bottomLeftRadius?: VariableAlias 104 | 105 | bottomRightRadius?: VariableAlias 106 | 107 | minWidth?: VariableAlias 108 | 109 | maxWidth?: VariableAlias 110 | 111 | minHeight?: VariableAlias 112 | 113 | maxHeight?: VariableAlias 114 | 115 | counterAxisSpacing?: VariableAlias 116 | 117 | opacity?: VariableAlias 118 | 119 | fontFamily?: VariableAlias[] 120 | 121 | fontSize?: VariableAlias[] 122 | 123 | fontStyle?: VariableAlias[] 124 | 125 | fontWeight?: VariableAlias[] 126 | 127 | letterSpacing?: VariableAlias[] 128 | 129 | lineHeight?: VariableAlias[] 130 | 131 | paragraphSpacing?: VariableAlias[] 132 | 133 | paragraphIndent?: VariableAlias[] 134 | 135 | fills?: VariableAlias[] 136 | 137 | strokes?: VariableAlias[] 138 | 139 | componentProperties?: { [key: string]: VariableAlias } 140 | 141 | textRangeFills?: VariableAlias[] 142 | 143 | effects?: VariableAlias[] 144 | 145 | layoutGrids?: VariableAlias[] 146 | 147 | rectangleCornerRadii?: { 148 | RECTANGLE_TOP_LEFT_CORNER_RADIUS?: VariableAlias 149 | 150 | RECTANGLE_TOP_RIGHT_CORNER_RADIUS?: VariableAlias 151 | 152 | RECTANGLE_BOTTOM_LEFT_CORNER_RADIUS?: VariableAlias 153 | 154 | RECTANGLE_BOTTOM_RIGHT_CORNER_RADIUS?: VariableAlias 155 | } 156 | } 157 | 158 | /** 159 | * A mapping of variable collection ID to mode ID representing the explicitly set modes for this 160 | * node. 161 | */ 162 | explicitVariableModes?: { [key: string]: string } 163 | } 164 | 165 | export type HasChildrenTrait = { 166 | /** 167 | * An array of nodes that are direct children of this node 168 | */ 169 | children: SubcanvasNode[] 170 | } 171 | 172 | export type HasLayoutTrait = { 173 | /** 174 | * Bounding box of the node in absolute space coordinates. 175 | */ 176 | absoluteBoundingBox: Rectangle | null 177 | 178 | /** 179 | * The actual bounds of a node accounting for drop shadows, thick strokes, and anything else that 180 | * may fall outside the node's regular bounding box defined in `x`, `y`, `width`, and `height`. The 181 | * `x` and `y` inside this property represent the absolute position of the node on the page. This 182 | * value will be `null` if the node is invisible. 183 | */ 184 | absoluteRenderBounds: Rectangle | null 185 | 186 | /** 187 | * Keep height and width constrained to same ratio. 188 | */ 189 | preserveRatio?: boolean 190 | 191 | /** 192 | * Horizontal and vertical layout constraints for node. 193 | */ 194 | constraints?: LayoutConstraint 195 | 196 | /** 197 | * The top two rows of a matrix that represents the 2D transform of this node relative to its 198 | * parent. The bottom row of the matrix is implicitly always (0, 0, 1). Use to transform coordinates 199 | * in geometry. Only present if `geometry=paths` is passed. 200 | */ 201 | relativeTransform?: Transform 202 | 203 | /** 204 | * Width and height of element. This is different from the width and height of the bounding box in 205 | * that the absolute bounding box represents the element after scaling and rotation. Only present if 206 | * `geometry=paths` is passed. 207 | */ 208 | size?: Vector 209 | 210 | /** 211 | * Determines if the layer should stretch along the parent's counter axis. This property is only 212 | * provided for direct children of auto-layout frames. 213 | * 214 | * - `INHERIT` 215 | * - `STRETCH` 216 | * 217 | * In previous versions of auto layout, determined how the layer is aligned inside an auto-layout 218 | * frame. This property is only provided for direct children of auto-layout frames. 219 | * 220 | * - `MIN` 221 | * - `CENTER` 222 | * - `MAX` 223 | * - `STRETCH` 224 | * 225 | * In horizontal auto-layout frames, "MIN" and "MAX" correspond to "TOP" and "BOTTOM". In vertical 226 | * auto-layout frames, "MIN" and "MAX" correspond to "LEFT" and "RIGHT". 227 | */ 228 | layoutAlign?: 'INHERIT' | 'STRETCH' | 'MIN' | 'CENTER' | 'MAX' 229 | 230 | /** 231 | * This property is applicable only for direct children of auto-layout frames, ignored otherwise. 232 | * Determines whether a layer should stretch along the parent's primary axis. A `0` corresponds to a 233 | * fixed size and `1` corresponds to stretch. 234 | */ 235 | layoutGrow?: 0 | 1 236 | 237 | /** 238 | * Determines whether a layer's size and position should be determined by auto-layout settings or 239 | * manually adjustable. 240 | */ 241 | layoutPositioning?: 'AUTO' | 'ABSOLUTE' 242 | 243 | /** 244 | * The minimum width of the frame. This property is only applicable for auto-layout frames or direct 245 | * children of auto-layout frames. 246 | */ 247 | minWidth?: number 248 | 249 | /** 250 | * The maximum width of the frame. This property is only applicable for auto-layout frames or direct 251 | * children of auto-layout frames. 252 | */ 253 | maxWidth?: number 254 | 255 | /** 256 | * The minimum height of the frame. This property is only applicable for auto-layout frames or 257 | * direct children of auto-layout frames. 258 | */ 259 | minHeight?: number 260 | 261 | /** 262 | * The maximum height of the frame. This property is only applicable for auto-layout frames or 263 | * direct children of auto-layout frames. 264 | */ 265 | maxHeight?: number 266 | 267 | /** 268 | * The horizontal sizing setting on this auto-layout frame or frame child. 269 | * 270 | * - `FIXED` 271 | * - `HUG`: only valid on auto-layout frames and text nodes 272 | * - `FILL`: only valid on auto-layout frame children 273 | */ 274 | layoutSizingHorizontal?: 'FIXED' | 'HUG' | 'FILL' 275 | 276 | /** 277 | * The vertical sizing setting on this auto-layout frame or frame child. 278 | * 279 | * - `FIXED` 280 | * - `HUG`: only valid on auto-layout frames and text nodes 281 | * - `FILL`: only valid on auto-layout frame children 282 | */ 283 | layoutSizingVertical?: 'FIXED' | 'HUG' | 'FILL' 284 | 285 | /** 286 | * The number of rows in the grid layout. This property is only applicable for auto-layout frames 287 | * with `layoutMode: "GRID"`. 288 | */ 289 | gridRowCount?: number 290 | 291 | /** 292 | * The number of columns in the grid layout. This property is only applicable for auto-layout frames 293 | * with `layoutMode: "GRID"`. 294 | */ 295 | gridColumnCount?: number 296 | 297 | /** 298 | * The distance between rows in the grid layout. This property is only applicable for auto-layout 299 | * frames with `layoutMode: "GRID"`. 300 | */ 301 | gridRowGap?: number 302 | 303 | /** 304 | * The distance between columns in the grid layout. This property is only applicable for auto-layout 305 | * frames with `layoutMode: "GRID"`. 306 | */ 307 | gridColumnGap?: number 308 | 309 | /** 310 | * The string for the CSS grid-template-columns property. This property is only applicable for 311 | * auto-layout frames with `layoutMode: "GRID"`. 312 | */ 313 | gridColumnsSizing?: string 314 | 315 | /** 316 | * The string for the CSS grid-template-rows property. This property is only applicable for 317 | * auto-layout frames with `layoutMode: "GRID"`. 318 | */ 319 | gridRowsSizing?: string 320 | 321 | /** 322 | * Determines how a GRID frame's child should be aligned in the horizontal direction within its grid 323 | * area. This property is only applicable for direct children of frames with `layoutMode: "GRID"`. 324 | */ 325 | gridChildHorizontalAlign?: 'AUTO' | 'MIN' | 'CENTER' | 'MAX' 326 | 327 | /** 328 | * Determines how a GRID frame's child should be aligned in the vertical direction within its grid 329 | * area. This property is only applicable for direct children of frames with `layoutMode: "GRID"`. 330 | */ 331 | gridChildVerticalAlign?: 'AUTO' | 'MIN' | 'CENTER' | 'MAX' 332 | 333 | /** 334 | * The number of rows that a GRID frame's child should span. This property is only applicable for 335 | * direct children of frames with `layoutMode: "GRID"`. 336 | */ 337 | gridRowSpan?: number 338 | 339 | /** 340 | * The number of columns that a GRID frame's child should span. This property is only applicable for 341 | * direct children of frames with `layoutMode: "GRID"`. 342 | */ 343 | gridColumnSpan?: number 344 | 345 | /** 346 | * The index of the row that a GRID frame's child should be anchored to. This property is only 347 | * applicable for direct children of frames with `layoutMode: "GRID"`. 348 | */ 349 | gridRowAnchorIndex?: number 350 | 351 | /** 352 | * The index of the column that a GRID frame's child should be anchored to. This property is only 353 | * applicable for direct children of frames with `layoutMode: "GRID"`. 354 | */ 355 | gridColumnAnchorIndex?: number 356 | } 357 | 358 | export type HasFramePropertiesTrait = { 359 | /** 360 | * Whether or not this node clip content outside of its bounds 361 | */ 362 | clipsContent: boolean 363 | 364 | /** 365 | * Background of the node. This is deprecated, as backgrounds for frames are now in the `fills` 366 | * field. 367 | * 368 | * @deprecated 369 | */ 370 | background?: Paint[] 371 | 372 | /** 373 | * Background color of the node. This is deprecated, as frames now support more than a solid color 374 | * as a background. Please use the `fills` field instead. 375 | * 376 | * @deprecated 377 | */ 378 | backgroundColor?: RGBA 379 | 380 | /** 381 | * An array of layout grids attached to this node (see layout grids section for more details). GROUP 382 | * nodes do not have this attribute 383 | */ 384 | layoutGrids?: LayoutGrid[] 385 | 386 | /** 387 | * Whether a node has primary axis scrolling, horizontal or vertical. 388 | */ 389 | overflowDirection?: 390 | | 'HORIZONTAL_SCROLLING' 391 | | 'VERTICAL_SCROLLING' 392 | | 'HORIZONTAL_AND_VERTICAL_SCROLLING' 393 | | 'NONE' 394 | 395 | /** 396 | * Whether this layer uses auto-layout to position its children. 397 | */ 398 | layoutMode?: 'NONE' | 'HORIZONTAL' | 'VERTICAL' | 'GRID' 399 | 400 | /** 401 | * Whether the primary axis has a fixed length (determined by the user) or an automatic length 402 | * (determined by the layout engine). This property is only applicable for auto-layout frames. 403 | */ 404 | primaryAxisSizingMode?: 'FIXED' | 'AUTO' 405 | 406 | /** 407 | * Whether the counter axis has a fixed length (determined by the user) or an automatic length 408 | * (determined by the layout engine). This property is only applicable for auto-layout frames. 409 | */ 410 | counterAxisSizingMode?: 'FIXED' | 'AUTO' 411 | 412 | /** 413 | * Determines how the auto-layout frame's children should be aligned in the primary axis direction. 414 | * This property is only applicable for auto-layout frames. 415 | */ 416 | primaryAxisAlignItems?: 'MIN' | 'CENTER' | 'MAX' | 'SPACE_BETWEEN' 417 | 418 | /** 419 | * Determines how the auto-layout frame's children should be aligned in the counter axis direction. 420 | * This property is only applicable for auto-layout frames. 421 | */ 422 | counterAxisAlignItems?: 'MIN' | 'CENTER' | 'MAX' | 'BASELINE' 423 | 424 | /** 425 | * The padding between the left border of the frame and its children. This property is only 426 | * applicable for auto-layout frames. 427 | */ 428 | paddingLeft?: number 429 | 430 | /** 431 | * The padding between the right border of the frame and its children. This property is only 432 | * applicable for auto-layout frames. 433 | */ 434 | paddingRight?: number 435 | 436 | /** 437 | * The padding between the top border of the frame and its children. This property is only 438 | * applicable for auto-layout frames. 439 | */ 440 | paddingTop?: number 441 | 442 | /** 443 | * The padding between the bottom border of the frame and its children. This property is only 444 | * applicable for auto-layout frames. 445 | */ 446 | paddingBottom?: number 447 | 448 | /** 449 | * The distance between children of the frame. Can be negative. This property is only applicable for 450 | * auto-layout frames. 451 | */ 452 | itemSpacing?: number 453 | 454 | /** 455 | * Determines the canvas stacking order of layers in this frame. When true, the first layer will be 456 | * draw on top. This property is only applicable for auto-layout frames. 457 | */ 458 | itemReverseZIndex?: boolean 459 | 460 | /** 461 | * Determines whether strokes are included in layout calculations. When true, auto-layout frames 462 | * behave like css "box-sizing: border-box". This property is only applicable for auto-layout 463 | * frames. 464 | */ 465 | strokesIncludedInLayout?: boolean 466 | 467 | /** 468 | * Whether this auto-layout frame has wrapping enabled. 469 | */ 470 | layoutWrap?: 'NO_WRAP' | 'WRAP' 471 | 472 | /** 473 | * The distance between wrapped tracks of an auto-layout frame. This property is only applicable for 474 | * auto-layout frames with `layoutWrap: "WRAP"` 475 | */ 476 | counterAxisSpacing?: number 477 | 478 | /** 479 | * Determines how the auto-layout frame’s wrapped tracks should be aligned in the counter axis 480 | * direction. This property is only applicable for auto-layout frames with `layoutWrap: "WRAP"`. 481 | */ 482 | counterAxisAlignContent?: 'AUTO' | 'SPACE_BETWEEN' 483 | } 484 | 485 | export type HasBlendModeAndOpacityTrait = { 486 | /** 487 | * How this node blends with nodes behind it in the scene (see blend mode section for more details) 488 | */ 489 | blendMode: BlendMode 490 | 491 | /** 492 | * Opacity of the node 493 | */ 494 | opacity?: number 495 | } 496 | 497 | export type HasExportSettingsTrait = { 498 | /** 499 | * An array of export settings representing images to export from the node. 500 | */ 501 | exportSettings?: ExportSetting[] 502 | } 503 | 504 | export type HasGeometryTrait = MinimalFillsTrait & 505 | MinimalStrokesTrait & { 506 | /** 507 | * Map from ID to PaintOverride for looking up fill overrides. To see which regions are overridden, 508 | * you must use the `geometry=paths` option. Each path returned may have an `overrideID` which maps 509 | * to this table. 510 | */ 511 | fillOverrideTable?: { [key: string]: PaintOverride | null } 512 | 513 | /** 514 | * Only specified if parameter `geometry=paths` is used. An array of paths representing the object 515 | * fill. 516 | */ 517 | fillGeometry?: Path[] 518 | 519 | /** 520 | * Only specified if parameter `geometry=paths` is used. An array of paths representing the object 521 | * stroke. 522 | */ 523 | strokeGeometry?: Path[] 524 | 525 | /** 526 | * A string enum describing the end caps of vector paths. 527 | */ 528 | strokeCap?: 529 | | 'NONE' 530 | | 'ROUND' 531 | | 'SQUARE' 532 | | 'LINE_ARROW' 533 | | 'TRIANGLE_ARROW' 534 | | 'DIAMOND_FILLED' 535 | | 'CIRCLE_FILLED' 536 | | 'TRIANGLE_FILLED' 537 | | 'WASHI_TAPE_1' 538 | | 'WASHI_TAPE_2' 539 | | 'WASHI_TAPE_3' 540 | | 'WASHI_TAPE_4' 541 | | 'WASHI_TAPE_5' 542 | | 'WASHI_TAPE_6' 543 | 544 | /** 545 | * Only valid if `strokeJoin` is "MITER". The corner angle, in degrees, below which `strokeJoin` 546 | * will be set to "BEVEL" to avoid super sharp corners. By default this is 28.96 degrees. 547 | */ 548 | strokeMiterAngle?: number 549 | } 550 | 551 | export type MinimalFillsTrait = { 552 | /** 553 | * An array of fill paints applied to the node. 554 | */ 555 | fills: Paint[] 556 | 557 | /** 558 | * A mapping of a StyleType to style ID (see Style) of styles present on this node. The style ID can 559 | * be used to look up more information about the style in the top-level styles field. 560 | */ 561 | styles?: { [key: string]: string } 562 | } 563 | 564 | export type MinimalStrokesTrait = { 565 | /** 566 | * An array of stroke paints applied to the node. 567 | */ 568 | strokes?: Paint[] 569 | 570 | /** 571 | * The weight of strokes on the node. 572 | */ 573 | strokeWeight?: number 574 | 575 | /** 576 | * Position of stroke relative to vector outline, as a string enum 577 | * 578 | * - `INSIDE`: stroke drawn inside the shape boundary 579 | * - `OUTSIDE`: stroke drawn outside the shape boundary 580 | * - `CENTER`: stroke drawn centered along the shape boundary 581 | */ 582 | strokeAlign?: 'INSIDE' | 'OUTSIDE' | 'CENTER' 583 | 584 | /** 585 | * A string enum with value of "MITER", "BEVEL", or "ROUND", describing how corners in vector paths 586 | * are rendered. 587 | */ 588 | strokeJoin?: 'MITER' | 'BEVEL' | 'ROUND' 589 | 590 | /** 591 | * An array of floating point numbers describing the pattern of dash length and gap lengths that the 592 | * vector stroke will use when drawn. 593 | * 594 | * For example a value of [1, 2] indicates that the stroke will be drawn with a dash of length 1 595 | * followed by a gap of length 2, repeated. 596 | */ 597 | strokeDashes?: number[] 598 | } 599 | 600 | export type IndividualStrokesTrait = { 601 | /** 602 | * An object including the top, bottom, left, and right stroke weights. Only returned if individual 603 | * stroke weights are used. 604 | */ 605 | individualStrokeWeights?: StrokeWeights 606 | } 607 | 608 | export type CornerTrait = { 609 | /** 610 | * Radius of each corner if a single radius is set for all corners 611 | */ 612 | cornerRadius?: number 613 | 614 | /** 615 | * A value that lets you control how "smooth" the corners are. Ranges from 0 to 1. 0 is the default 616 | * and means that the corner is perfectly circular. A value of 0.6 means the corner matches the iOS 617 | * 7 "squircle" icon shape. Other values produce various other curves. 618 | */ 619 | cornerSmoothing?: number 620 | 621 | /** 622 | * Array of length 4 of the radius of each corner of the frame, starting in the top left and 623 | * proceeding clockwise. 624 | * 625 | * Values are given in the order top-left, top-right, bottom-right, bottom-left. 626 | */ 627 | rectangleCornerRadii?: number[] 628 | } 629 | 630 | export type HasEffectsTrait = { 631 | /** 632 | * An array of effects attached to this node (see effects section for more details) 633 | */ 634 | effects: Effect[] 635 | } 636 | 637 | export type HasMaskTrait = { 638 | /** 639 | * Does this node mask sibling nodes in front of it? 640 | */ 641 | isMask?: boolean 642 | 643 | /** 644 | * If this layer is a mask, this property describes the operation used to mask the layer's siblings. 645 | * The value may be one of the following: 646 | * 647 | * - ALPHA: the mask node's alpha channel will be used to determine the opacity of each pixel in the 648 | * masked result. 649 | * - VECTOR: if the mask node has visible fill paints, every pixel inside the node's fill regions will 650 | * be fully visible in the masked result. If the mask has visible stroke paints, every pixel 651 | * inside the node's stroke regions will be fully visible in the masked result. 652 | * - LUMINANCE: the luminance value of each pixel of the mask node will be used to determine the 653 | * opacity of that pixel in the masked result. 654 | */ 655 | maskType?: 'ALPHA' | 'VECTOR' | 'LUMINANCE' 656 | 657 | /** 658 | * True if maskType is VECTOR. This field is deprecated; use maskType instead. 659 | * 660 | * @deprecated 661 | */ 662 | isMaskOutline?: boolean 663 | } 664 | 665 | export type ComponentPropertiesTrait = { 666 | /** 667 | * A mapping of name to `ComponentPropertyDefinition` for every component property on this 668 | * component. Each property has a type, defaultValue, and other optional values. 669 | */ 670 | componentPropertyDefinitions?: { [key: string]: ComponentPropertyDefinition } 671 | } 672 | 673 | export type TypePropertiesTrait = { 674 | /** 675 | * The raw characters in the text node. 676 | */ 677 | characters: string 678 | 679 | /** 680 | * Style of text including font family and weight. 681 | */ 682 | style: TypeStyle 683 | 684 | /** 685 | * The array corresponds to characters in the text box, where each element references the 686 | * 'styleOverrideTable' to apply specific styles to each character. The array's length can be less 687 | * than or equal to the number of characters due to the removal of trailing zeros. Elements with a 688 | * value of 0 indicate characters that use the default type style. If the array is shorter than the 689 | * total number of characters, the characters beyond the array's length also use the default style. 690 | */ 691 | characterStyleOverrides: number[] 692 | 693 | /** 694 | * Internal property, preserved for backward compatibility. Avoid using this value. 695 | */ 696 | layoutVersion?: number 697 | 698 | /** 699 | * Map from ID to TypeStyle for looking up style overrides. 700 | */ 701 | styleOverrideTable: { [key: string]: TypeStyle } 702 | 703 | /** 704 | * An array with the same number of elements as lines in the text node, where lines are delimited by 705 | * newline or paragraph separator characters. Each element in the array corresponds to the list type 706 | * of a specific line. List types are represented as string enums with one of these possible 707 | * values: 708 | * 709 | * - `NONE`: Not a list item. 710 | * - `ORDERED`: Text is an ordered list (numbered). 711 | * - `UNORDERED`: Text is an unordered list (bulleted). 712 | */ 713 | lineTypes: ('NONE' | 'ORDERED' | 'UNORDERED')[] 714 | 715 | /** 716 | * An array with the same number of elements as lines in the text node, where lines are delimited by 717 | * newline or paragraph separator characters. Each element in the array corresponds to the 718 | * indentation level of a specific line. 719 | */ 720 | lineIndentations: number[] 721 | } 722 | 723 | export type TextPathPropertiesTrait = { 724 | /** 725 | * The raw characters in the text path node. 726 | */ 727 | characters: string 728 | 729 | /** 730 | * Style of text including font family and weight. 731 | */ 732 | style: TextPathTypeStyle 733 | 734 | /** 735 | * The array corresponds to characters in the text box, where each element references the 736 | * 'styleOverrideTable' to apply specific styles to each character. The array's length can be less 737 | * than or equal to the number of characters due to the removal of trailing zeros. Elements with a 738 | * value of 0 indicate characters that use the default type style. If the array is shorter than the 739 | * total number of characters, the characters beyond the array's length also use the default style. 740 | */ 741 | characterStyleOverrides: number[] 742 | 743 | /** 744 | * Internal property, preserved for backward compatibility. Avoid using this value. 745 | */ 746 | layoutVersion?: number 747 | 748 | /** 749 | * Map from ID to TextPathTypeStyle for looking up style overrides. 750 | */ 751 | styleOverrideTable: { [key: string]: TextPathTypeStyle } 752 | } 753 | 754 | export type HasTextSublayerTrait = { 755 | /** 756 | * Text contained within a text box. 757 | */ 758 | characters: string 759 | } 760 | 761 | export type TransitionSourceTrait = { 762 | /** 763 | * Node ID of node to transition to in prototyping 764 | */ 765 | transitionNodeID?: string 766 | 767 | /** 768 | * The duration of the prototyping transition on this node (in milliseconds). This will override the 769 | * default transition duration on the prototype, for this node. 770 | */ 771 | transitionDuration?: number 772 | 773 | /** 774 | * The easing curve used in the prototyping transition on this node. 775 | */ 776 | transitionEasing?: EasingType 777 | 778 | interactions?: Interaction[] 779 | } 780 | 781 | export type DevStatusTrait = { 782 | /** 783 | * Represents whether or not a node has a particular handoff (or dev) status applied to it. 784 | */ 785 | devStatus?: { 786 | type: 'NONE' | 'READY_FOR_DEV' | 'COMPLETED' 787 | 788 | /** 789 | * An optional field where the designer can add more information about the design and what has 790 | * changed. 791 | */ 792 | description?: string 793 | } 794 | } 795 | 796 | export type AnnotationsTrait = object 797 | 798 | export type FrameTraits = IsLayerTrait & 799 | HasBlendModeAndOpacityTrait & 800 | HasChildrenTrait & 801 | HasLayoutTrait & 802 | HasFramePropertiesTrait & 803 | CornerTrait & 804 | HasGeometryTrait & 805 | HasExportSettingsTrait & 806 | HasEffectsTrait & 807 | HasMaskTrait & 808 | TransitionSourceTrait & 809 | IndividualStrokesTrait & 810 | DevStatusTrait & 811 | AnnotationsTrait 812 | 813 | export type DefaultShapeTraits = IsLayerTrait & 814 | HasBlendModeAndOpacityTrait & 815 | HasLayoutTrait & 816 | HasGeometryTrait & 817 | HasExportSettingsTrait & 818 | HasEffectsTrait & 819 | HasMaskTrait & 820 | TransitionSourceTrait 821 | 822 | export type CornerRadiusShapeTraits = DefaultShapeTraits & CornerTrait 823 | 824 | export type RectangularShapeTraits = DefaultShapeTraits & 825 | CornerTrait & 826 | IndividualStrokesTrait & 827 | AnnotationsTrait 828 | 829 | export type Node = 830 | | BooleanOperationNode 831 | | ComponentNode 832 | | ComponentSetNode 833 | | ConnectorNode 834 | | EllipseNode 835 | | EmbedNode 836 | | FrameNode 837 | | GroupNode 838 | | InstanceNode 839 | | LineNode 840 | | LinkUnfurlNode 841 | | RectangleNode 842 | | RegularPolygonNode 843 | | SectionNode 844 | | ShapeWithTextNode 845 | | SliceNode 846 | | StarNode 847 | | StickyNode 848 | | TableNode 849 | | TableCellNode 850 | | TextNode 851 | | TextPathNode 852 | | TransformGroupNode 853 | | VectorNode 854 | | WashiTapeNode 855 | | WidgetNode 856 | | DocumentNode 857 | | CanvasNode 858 | 859 | export type DocumentNode = { 860 | type: 'DOCUMENT' 861 | 862 | children: CanvasNode[] 863 | } & IsLayerTrait 864 | 865 | export type CanvasNode = { 866 | type: 'CANVAS' 867 | 868 | children: SubcanvasNode[] 869 | 870 | /** 871 | * Background color of the canvas. 872 | */ 873 | backgroundColor: RGBA 874 | 875 | /** 876 | * Node ID that corresponds to the start frame for prototypes. This is deprecated with the 877 | * introduction of multiple flows. Please use the `flowStartingPoints` field. 878 | * 879 | * @deprecated 880 | */ 881 | prototypeStartNodeID: string | null 882 | 883 | /** 884 | * An array of flow starting points sorted by its position in the prototype settings panel. 885 | */ 886 | flowStartingPoints: FlowStartingPoint[] 887 | 888 | /** 889 | * The device used to view a prototype. 890 | */ 891 | prototypeDevice: PrototypeDevice 892 | 893 | /** 894 | * The background color of the prototype (currently only supports a single solid color paint). 895 | */ 896 | prototypeBackgrounds?: RGBA[] 897 | 898 | measurements?: Measurement[] 899 | } & IsLayerTrait & 900 | HasExportSettingsTrait 901 | 902 | export type SubcanvasNode = 903 | | BooleanOperationNode 904 | | ComponentNode 905 | | ComponentSetNode 906 | | ConnectorNode 907 | | EllipseNode 908 | | EmbedNode 909 | | FrameNode 910 | | GroupNode 911 | | InstanceNode 912 | | LineNode 913 | | LinkUnfurlNode 914 | | RectangleNode 915 | | RegularPolygonNode 916 | | SectionNode 917 | | ShapeWithTextNode 918 | | SliceNode 919 | | StarNode 920 | | StickyNode 921 | | TableNode 922 | | TableCellNode 923 | | TextNode 924 | | TextPathNode 925 | | TransformGroupNode 926 | | VectorNode 927 | | WashiTapeNode 928 | | WidgetNode 929 | 930 | export type BooleanOperationNode = { 931 | /** 932 | * The type of this node, represented by the string literal "BOOLEAN_OPERATION" 933 | */ 934 | type: 'BOOLEAN_OPERATION' 935 | 936 | /** 937 | * A string enum indicating the type of boolean operation applied. 938 | */ 939 | booleanOperation: 'UNION' | 'INTERSECT' | 'SUBTRACT' | 'EXCLUDE' 940 | } & IsLayerTrait & 941 | HasBlendModeAndOpacityTrait & 942 | HasChildrenTrait & 943 | HasLayoutTrait & 944 | HasGeometryTrait & 945 | HasExportSettingsTrait & 946 | HasEffectsTrait & 947 | HasMaskTrait & 948 | TransitionSourceTrait 949 | 950 | export type SectionNode = { 951 | /** 952 | * The type of this node, represented by the string literal "SECTION" 953 | */ 954 | type: 'SECTION' 955 | 956 | /** 957 | * Whether the contents of the section are visible 958 | */ 959 | sectionContentsHidden: boolean 960 | } & IsLayerTrait & 961 | HasGeometryTrait & 962 | HasChildrenTrait & 963 | HasLayoutTrait & 964 | DevStatusTrait 965 | 966 | export type FrameNode = { 967 | /** 968 | * The type of this node, represented by the string literal "FRAME" 969 | */ 970 | type: 'FRAME' 971 | } & FrameTraits 972 | 973 | export type GroupNode = { 974 | /** 975 | * The type of this node, represented by the string literal "GROUP" 976 | */ 977 | type: 'GROUP' 978 | } & FrameTraits 979 | 980 | export type ComponentNode = { 981 | /** 982 | * The type of this node, represented by the string literal "COMPONENT" 983 | */ 984 | type: 'COMPONENT' 985 | } & FrameTraits & 986 | ComponentPropertiesTrait 987 | 988 | export type ComponentSetNode = { 989 | /** 990 | * The type of this node, represented by the string literal "COMPONENT_SET" 991 | */ 992 | type: 'COMPONENT_SET' 993 | } & FrameTraits & 994 | ComponentPropertiesTrait 995 | 996 | export type VectorNode = { 997 | /** 998 | * The type of this node, represented by the string literal "VECTOR" 999 | */ 1000 | type: 'VECTOR' 1001 | } & CornerRadiusShapeTraits & 1002 | AnnotationsTrait 1003 | 1004 | export type StarNode = { 1005 | /** 1006 | * The type of this node, represented by the string literal "STAR" 1007 | */ 1008 | type: 'STAR' 1009 | } & CornerRadiusShapeTraits & 1010 | AnnotationsTrait 1011 | 1012 | export type LineNode = { 1013 | /** 1014 | * The type of this node, represented by the string literal "LINE" 1015 | */ 1016 | type: 'LINE' 1017 | } & DefaultShapeTraits & 1018 | AnnotationsTrait 1019 | 1020 | export type EllipseNode = { 1021 | /** 1022 | * The type of this node, represented by the string literal "ELLIPSE" 1023 | */ 1024 | type: 'ELLIPSE' 1025 | 1026 | arcData: ArcData 1027 | } & DefaultShapeTraits & 1028 | AnnotationsTrait 1029 | 1030 | export type RegularPolygonNode = { 1031 | /** 1032 | * The type of this node, represented by the string literal "REGULAR_POLYGON" 1033 | */ 1034 | type: 'REGULAR_POLYGON' 1035 | } & CornerRadiusShapeTraits & 1036 | AnnotationsTrait 1037 | 1038 | export type RectangleNode = { 1039 | /** 1040 | * The type of this node, represented by the string literal "RECTANGLE" 1041 | */ 1042 | type: 'RECTANGLE' 1043 | } & RectangularShapeTraits 1044 | 1045 | export type TextNode = { 1046 | /** 1047 | * The type of this node, represented by the string literal "TEXT" 1048 | */ 1049 | type: 'TEXT' 1050 | } & DefaultShapeTraits & 1051 | TypePropertiesTrait & 1052 | AnnotationsTrait 1053 | 1054 | export type TextPathNode = { 1055 | /** 1056 | * The type of this node, represented by the string literal "TEXT_PATH" 1057 | */ 1058 | type: 'TEXT_PATH' 1059 | } & DefaultShapeTraits & 1060 | TextPathPropertiesTrait 1061 | 1062 | export type TableNode = { 1063 | /** 1064 | * The type of this node, represented by the string literal "TABLE" 1065 | */ 1066 | type: 'TABLE' 1067 | } & IsLayerTrait & 1068 | HasChildrenTrait & 1069 | HasLayoutTrait & 1070 | MinimalStrokesTrait & 1071 | HasEffectsTrait & 1072 | HasBlendModeAndOpacityTrait & 1073 | HasExportSettingsTrait 1074 | 1075 | export type TableCellNode = { 1076 | /** 1077 | * The type of this node, represented by the string literal "TABLE_CELL" 1078 | */ 1079 | type: 'TABLE_CELL' 1080 | } & IsLayerTrait & 1081 | MinimalFillsTrait & 1082 | HasLayoutTrait & 1083 | HasTextSublayerTrait 1084 | 1085 | export type TransformGroupNode = { 1086 | /** 1087 | * The type of this node, represented by the string literal "TRANSFORM_GROUP" 1088 | */ 1089 | type: 'TRANSFORM_GROUP' 1090 | } & FrameTraits 1091 | 1092 | export type SliceNode = { 1093 | /** 1094 | * The type of this node, represented by the string literal "SLICE" 1095 | */ 1096 | type: 'SLICE' 1097 | } & IsLayerTrait 1098 | 1099 | export type InstanceNode = { 1100 | /** 1101 | * The type of this node, represented by the string literal "INSTANCE" 1102 | */ 1103 | type: 'INSTANCE' 1104 | 1105 | /** 1106 | * ID of component that this instance came from. 1107 | */ 1108 | componentId: string 1109 | 1110 | /** 1111 | * If true, this node has been marked as exposed to its containing component or component set. 1112 | */ 1113 | isExposedInstance?: boolean 1114 | 1115 | /** 1116 | * IDs of instances that have been exposed to this node's level. 1117 | */ 1118 | exposedInstances?: string[] 1119 | 1120 | /** 1121 | * A mapping of name to `ComponentProperty` for all component properties on this instance. Each 1122 | * property has a type, value, and other optional values. 1123 | */ 1124 | componentProperties?: { [key: string]: ComponentProperty } 1125 | 1126 | /** 1127 | * An array of all of the fields directly overridden on this instance. Inherited overrides are not 1128 | * included. 1129 | */ 1130 | overrides: Overrides[] 1131 | } & FrameTraits 1132 | 1133 | export type EmbedNode = { 1134 | /** 1135 | * The type of this node, represented by the string literal "EMBED" 1136 | */ 1137 | type: 'EMBED' 1138 | } & IsLayerTrait & 1139 | HasExportSettingsTrait 1140 | 1141 | export type LinkUnfurlNode = { 1142 | /** 1143 | * The type of this node, represented by the string literal "LINK_UNFURL" 1144 | */ 1145 | type: 'LINK_UNFURL' 1146 | } & IsLayerTrait & 1147 | HasExportSettingsTrait 1148 | 1149 | export type StickyNode = { 1150 | /** 1151 | * The type of this node, represented by the string literal "STICKY" 1152 | */ 1153 | type: 'STICKY' 1154 | 1155 | /** 1156 | * If true, author name is visible. 1157 | */ 1158 | authorVisible?: boolean 1159 | } & IsLayerTrait & 1160 | HasLayoutTrait & 1161 | HasBlendModeAndOpacityTrait & 1162 | MinimalFillsTrait & 1163 | HasMaskTrait & 1164 | HasEffectsTrait & 1165 | HasExportSettingsTrait & 1166 | HasTextSublayerTrait 1167 | 1168 | export type ShapeWithTextNode = { 1169 | /** 1170 | * The type of this node, represented by the string literal "SHAPE_WITH_TEXT" 1171 | */ 1172 | type: 'SHAPE_WITH_TEXT' 1173 | 1174 | /** 1175 | * Geometric shape type. Most shape types have the same name as their tooltip but there are a few 1176 | * exceptions. ENG_DATABASE: Cylinder, ENG_QUEUE: Horizontal cylinder, ENG_FILE: File, ENG_FOLDER: 1177 | * Folder. 1178 | */ 1179 | shapeType: ShapeType 1180 | } & IsLayerTrait & 1181 | HasLayoutTrait & 1182 | HasBlendModeAndOpacityTrait & 1183 | MinimalFillsTrait & 1184 | HasMaskTrait & 1185 | HasEffectsTrait & 1186 | HasExportSettingsTrait & 1187 | HasTextSublayerTrait & 1188 | CornerTrait & 1189 | MinimalStrokesTrait 1190 | 1191 | export type ConnectorNode = { 1192 | /** 1193 | * The type of this node, represented by the string literal "CONNECTOR" 1194 | */ 1195 | type: 'CONNECTOR' 1196 | 1197 | /** 1198 | * The starting point of the connector. 1199 | */ 1200 | connectorStart: ConnectorEndpoint 1201 | 1202 | /** 1203 | * The ending point of the connector. 1204 | */ 1205 | connectorEnd: ConnectorEndpoint 1206 | 1207 | /** 1208 | * A string enum describing the end cap of the start of the connector. 1209 | */ 1210 | connectorStartStrokeCap: 1211 | | 'NONE' 1212 | | 'LINE_ARROW' 1213 | | 'TRIANGLE_ARROW' 1214 | | 'DIAMOND_FILLED' 1215 | | 'CIRCLE_FILLED' 1216 | | 'TRIANGLE_FILLED' 1217 | 1218 | /** 1219 | * A string enum describing the end cap of the end of the connector. 1220 | */ 1221 | connectorEndStrokeCap: 1222 | | 'NONE' 1223 | | 'LINE_ARROW' 1224 | | 'TRIANGLE_ARROW' 1225 | | 'DIAMOND_FILLED' 1226 | | 'CIRCLE_FILLED' 1227 | | 'TRIANGLE_FILLED' 1228 | 1229 | /** 1230 | * Connector line type. 1231 | */ 1232 | connectorLineType: ConnectorLineType 1233 | 1234 | /** 1235 | * Connector text background. 1236 | */ 1237 | textBackground?: ConnectorTextBackground 1238 | } & IsLayerTrait & 1239 | HasLayoutTrait & 1240 | HasBlendModeAndOpacityTrait & 1241 | HasEffectsTrait & 1242 | HasExportSettingsTrait & 1243 | HasTextSublayerTrait & 1244 | MinimalStrokesTrait 1245 | 1246 | export type WashiTapeNode = { 1247 | /** 1248 | * The type of this node, represented by the string literal "WASHI_TAPE" 1249 | */ 1250 | type: 'WASHI_TAPE' 1251 | } & DefaultShapeTraits 1252 | 1253 | export type WidgetNode = { 1254 | /** 1255 | * The type of this node, represented by the string literal "WIDGET" 1256 | */ 1257 | type: 'WIDGET' 1258 | } & IsLayerTrait & 1259 | HasExportSettingsTrait & 1260 | HasChildrenTrait 1261 | 1262 | /** 1263 | * An RGB color 1264 | */ 1265 | export type RGB = { 1266 | /** 1267 | * Red channel value, between 0 and 1. 1268 | */ 1269 | r: number 1270 | 1271 | /** 1272 | * Green channel value, between 0 and 1. 1273 | */ 1274 | g: number 1275 | 1276 | /** 1277 | * Blue channel value, between 0 and 1. 1278 | */ 1279 | b: number 1280 | } 1281 | 1282 | /** 1283 | * An RGBA color 1284 | */ 1285 | export type RGBA = { 1286 | /** 1287 | * Red channel value, between 0 and 1. 1288 | */ 1289 | r: number 1290 | 1291 | /** 1292 | * Green channel value, between 0 and 1. 1293 | */ 1294 | g: number 1295 | 1296 | /** 1297 | * Blue channel value, between 0 and 1. 1298 | */ 1299 | b: number 1300 | 1301 | /** 1302 | * Alpha channel value, between 0 and 1. 1303 | */ 1304 | a: number 1305 | } 1306 | 1307 | /** 1308 | * A flow starting point used when launching a prototype to enter Presentation view. 1309 | */ 1310 | export type FlowStartingPoint = { 1311 | /** 1312 | * Unique identifier specifying the frame. 1313 | */ 1314 | nodeId: string 1315 | 1316 | /** 1317 | * Name of flow. 1318 | */ 1319 | name: string 1320 | } 1321 | 1322 | /** 1323 | * A width and a height. 1324 | */ 1325 | export type Size = { 1326 | /** 1327 | * The width of a size. 1328 | */ 1329 | width: number 1330 | 1331 | /** 1332 | * The height of a size. 1333 | */ 1334 | height: number 1335 | } 1336 | 1337 | /** 1338 | * The device used to view a prototype. 1339 | */ 1340 | export type PrototypeDevice = { 1341 | type: 'NONE' | 'PRESET' | 'CUSTOM' | 'PRESENTATION' 1342 | 1343 | size?: Size 1344 | 1345 | presetIdentifier?: string 1346 | 1347 | rotation: 'NONE' | 'CCW_90' 1348 | } 1349 | 1350 | /** 1351 | * Sizing constraint for exports. 1352 | */ 1353 | export type Constraint = { 1354 | /** 1355 | * Type of constraint to apply: 1356 | * 1357 | * - `SCALE`: Scale by `value`. 1358 | * - `WIDTH`: Scale proportionally and set width to `value`. 1359 | * - `HEIGHT`: Scale proportionally and set height to `value`. 1360 | */ 1361 | type: 'SCALE' | 'WIDTH' | 'HEIGHT' 1362 | 1363 | /** 1364 | * See type property for effect of this field. 1365 | */ 1366 | value: number 1367 | } 1368 | 1369 | /** 1370 | * An export setting. 1371 | */ 1372 | export type ExportSetting = { 1373 | suffix: string 1374 | 1375 | format: 'JPG' | 'PNG' | 'SVG' | 'PDF' 1376 | 1377 | constraint: Constraint 1378 | } 1379 | 1380 | /** 1381 | * This type is a string enum with the following possible values 1382 | * 1383 | * Normal blends: 1384 | * 1385 | * - `PASS_THROUGH` (only applicable to objects with children) 1386 | * - `NORMAL` 1387 | * 1388 | * Darken: 1389 | * 1390 | * - `DARKEN` 1391 | * - `MULTIPLY` 1392 | * - `LINEAR_BURN` 1393 | * - `COLOR_BURN` 1394 | * 1395 | * Lighten: 1396 | * 1397 | * - `LIGHTEN` 1398 | * - `SCREEN` 1399 | * - `LINEAR_DODGE` 1400 | * - `COLOR_DODGE` 1401 | * 1402 | * Contrast: 1403 | * 1404 | * - `OVERLAY` 1405 | * - `SOFT_LIGHT` 1406 | * - `HARD_LIGHT` 1407 | * 1408 | * Inversion: 1409 | * 1410 | * - `DIFFERENCE` 1411 | * - `EXCLUSION` 1412 | * 1413 | * Component: 1414 | * 1415 | * - `HUE` 1416 | * - `SATURATION` 1417 | * - `COLOR` 1418 | * - `LUMINOSITY` 1419 | */ 1420 | export type BlendMode = 1421 | | 'PASS_THROUGH' 1422 | | 'NORMAL' 1423 | | 'DARKEN' 1424 | | 'MULTIPLY' 1425 | | 'LINEAR_BURN' 1426 | | 'COLOR_BURN' 1427 | | 'LIGHTEN' 1428 | | 'SCREEN' 1429 | | 'LINEAR_DODGE' 1430 | | 'COLOR_DODGE' 1431 | | 'OVERLAY' 1432 | | 'SOFT_LIGHT' 1433 | | 'HARD_LIGHT' 1434 | | 'DIFFERENCE' 1435 | | 'EXCLUSION' 1436 | | 'HUE' 1437 | | 'SATURATION' 1438 | | 'COLOR' 1439 | | 'LUMINOSITY' 1440 | 1441 | /** 1442 | * A 2d vector. 1443 | */ 1444 | export type Vector = { 1445 | /** 1446 | * X coordinate of the vector. 1447 | */ 1448 | x: number 1449 | 1450 | /** 1451 | * Y coordinate of the vector. 1452 | */ 1453 | y: number 1454 | } 1455 | 1456 | /** 1457 | * A single color stop with its position along the gradient axis, color, and bound variables if any 1458 | */ 1459 | export type ColorStop = { 1460 | /** 1461 | * Value between 0 and 1 representing position along gradient axis. 1462 | */ 1463 | position: number 1464 | 1465 | /** 1466 | * Color attached to corresponding position. 1467 | */ 1468 | color: RGBA 1469 | 1470 | /** 1471 | * The variables bound to a particular gradient stop 1472 | */ 1473 | boundVariables?: { color?: VariableAlias } 1474 | } 1475 | 1476 | /** 1477 | * A transformation matrix is standard way in computer graphics to represent translation and 1478 | * rotation. These are the top two rows of a 3x3 matrix. The bottom row of the matrix is assumed to 1479 | * be [0, 0, 1]. This is known as an affine transform and is enough to represent translation, 1480 | * rotation, and skew. 1481 | * 1482 | * The identity transform is [[1, 0, 0], [0, 1, 0]]. 1483 | * 1484 | * A translation matrix will typically look like: 1485 | * 1486 | * ;[ 1487 | * [1, 0, tx], 1488 | * [0, 1, ty], 1489 | * ] 1490 | * 1491 | * And a rotation matrix will typically look like: 1492 | * 1493 | * ;[ 1494 | * [cos(angle), sin(angle), 0], 1495 | * [-sin(angle), cos(angle), 0], 1496 | * ] 1497 | * 1498 | * Another way to think about this transform is as three vectors: 1499 | * 1500 | * - The x axis (t[0][0], t[1][0]) 1501 | * - The y axis (t[0][1], t[1][1]) 1502 | * - The translation offset (t[0][2], t[1][2]) 1503 | * 1504 | * The most common usage of the Transform matrix is the `relativeTransform property`. This 1505 | * particular usage of the matrix has a few additional restrictions. The translation offset can take 1506 | * on any value but we do enforce that the axis vectors are unit vectors (i.e. have length 1). The 1507 | * axes are not required to be at 90° angles to each other. 1508 | */ 1509 | export type Transform = number[][] 1510 | 1511 | /** 1512 | * Image filters to apply to the node. 1513 | */ 1514 | export type ImageFilters = { 1515 | exposure?: number 1516 | 1517 | contrast?: number 1518 | 1519 | saturation?: number 1520 | 1521 | temperature?: number 1522 | 1523 | tint?: number 1524 | 1525 | highlights?: number 1526 | 1527 | shadows?: number 1528 | } 1529 | 1530 | export type BasePaint = { 1531 | /** 1532 | * Is the paint enabled? 1533 | */ 1534 | visible?: boolean 1535 | 1536 | /** 1537 | * Overall opacity of paint (colors within the paint can also have opacity values which would blend 1538 | * with this) 1539 | */ 1540 | opacity?: number 1541 | 1542 | /** 1543 | * How this node blends with nodes behind it in the scene 1544 | */ 1545 | blendMode: BlendMode 1546 | } 1547 | 1548 | export type SolidPaint = { 1549 | /** 1550 | * The string literal "SOLID" representing the paint's type. Always check the `type` before reading 1551 | * other properties. 1552 | */ 1553 | type: 'SOLID' 1554 | 1555 | /** 1556 | * Solid color of the paint 1557 | */ 1558 | color: RGBA 1559 | 1560 | /** 1561 | * The variables bound to a particular field on this paint 1562 | */ 1563 | boundVariables?: { color?: VariableAlias } 1564 | } & BasePaint 1565 | 1566 | export type GradientPaint = { 1567 | /** 1568 | * The string literal representing the paint's type. Always check the `type` before reading other 1569 | * properties. 1570 | */ 1571 | type: 'GRADIENT_LINEAR' | 'GRADIENT_RADIAL' | 'GRADIENT_ANGULAR' | 'GRADIENT_DIAMOND' 1572 | 1573 | /** 1574 | * This field contains three vectors, each of which are a position in normalized object space 1575 | * (normalized object space is if the top left corner of the bounding box of the object is (0, 0) 1576 | * and the bottom right is (1,1)). The first position corresponds to the start of the gradient 1577 | * (value 0 for the purposes of calculating gradient stops), the second position is the end of the 1578 | * gradient (value 1), and the third handle position determines the width of the gradient. 1579 | */ 1580 | gradientHandlePositions: Vector[] 1581 | 1582 | /** 1583 | * Positions of key points along the gradient axis with the colors anchored there. Colors along the 1584 | * gradient are interpolated smoothly between neighboring gradient stops. 1585 | */ 1586 | gradientStops: ColorStop[] 1587 | } & BasePaint 1588 | 1589 | export type ImagePaint = { 1590 | /** 1591 | * The string literal "IMAGE" representing the paint's type. Always check the `type` before reading 1592 | * other properties. 1593 | */ 1594 | type: 'IMAGE' 1595 | 1596 | /** 1597 | * Image scaling mode. 1598 | */ 1599 | scaleMode: 'FILL' | 'FIT' | 'TILE' | 'STRETCH' 1600 | 1601 | /** 1602 | * A reference to an image embedded in this node. To download the image using this reference, use 1603 | * the `GET file images` endpoint to retrieve the mapping from image references to image URLs. 1604 | */ 1605 | imageRef: string 1606 | 1607 | /** 1608 | * Affine transform applied to the image, only present if `scaleMode` is `STRETCH` 1609 | */ 1610 | imageTransform?: Transform 1611 | 1612 | /** 1613 | * Amount image is scaled by in tiling, only present if scaleMode is `TILE`. 1614 | */ 1615 | scalingFactor?: number 1616 | 1617 | /** 1618 | * Defines what image filters have been applied to this paint, if any. If this property is not 1619 | * defined, no filters have been applied. 1620 | */ 1621 | filters?: ImageFilters 1622 | 1623 | /** 1624 | * Image rotation, in degrees. 1625 | */ 1626 | rotation?: number 1627 | 1628 | /** 1629 | * A reference to an animated GIF embedded in this node. To download the image using this reference, 1630 | * use the `GET file images` endpoint to retrieve the mapping from image references to image URLs. 1631 | */ 1632 | gifRef?: string 1633 | } & BasePaint 1634 | 1635 | export type PatternPaint = { 1636 | /** 1637 | * The string literal "PATTERN" representing the paint's type. Always check the `type` before 1638 | * reading other properties. 1639 | */ 1640 | type: 'PATTERN' 1641 | 1642 | /** 1643 | * The node id of the source node for the pattern 1644 | */ 1645 | sourceNodeId: string 1646 | 1647 | /** 1648 | * The tile type for the pattern 1649 | */ 1650 | tileType: 'RECTANGULAR' | 'HORIZONTAL_HEXAGONAL' | 'VERTICAL_HEXAGONAL' 1651 | 1652 | /** 1653 | * The scaling factor for the pattern 1654 | */ 1655 | scalingFactor: number 1656 | 1657 | /** 1658 | * The spacing for the pattern 1659 | */ 1660 | spacing: Vector 1661 | 1662 | /** 1663 | * The horizontal alignment for the pattern 1664 | */ 1665 | horizontalAlignment: 'START' | 'CENTER' | 'END' 1666 | 1667 | /** 1668 | * The vertical alignment for the pattern 1669 | */ 1670 | verticalAlignment: 'START' | 'CENTER' | 'END' 1671 | } & BasePaint 1672 | 1673 | export type Paint = SolidPaint | GradientPaint | ImagePaint | PatternPaint 1674 | 1675 | /** 1676 | * Layout constraint relative to containing Frame 1677 | */ 1678 | export type LayoutConstraint = { 1679 | /** 1680 | * Vertical constraint (relative to containing frame) as an enum: 1681 | * 1682 | * - `TOP`: Node is laid out relative to top of the containing frame 1683 | * - `BOTTOM`: Node is laid out relative to bottom of the containing frame 1684 | * - `CENTER`: Node is vertically centered relative to containing frame 1685 | * - `TOP_BOTTOM`: Both top and bottom of node are constrained relative to containing frame (node 1686 | * stretches with frame) 1687 | * - `SCALE`: Node scales vertically with containing frame 1688 | */ 1689 | vertical: 'TOP' | 'BOTTOM' | 'CENTER' | 'TOP_BOTTOM' | 'SCALE' 1690 | 1691 | /** 1692 | * Horizontal constraint (relative to containing frame) as an enum: 1693 | * 1694 | * - `LEFT`: Node is laid out relative to left of the containing frame 1695 | * - `RIGHT`: Node is laid out relative to right of the containing frame 1696 | * - `CENTER`: Node is horizontally centered relative to containing frame 1697 | * - `LEFT_RIGHT`: Both left and right of node are constrained relative to containing frame (node 1698 | * stretches with frame) 1699 | * - `SCALE`: Node scales horizontally with containing frame 1700 | */ 1701 | horizontal: 'LEFT' | 'RIGHT' | 'CENTER' | 'LEFT_RIGHT' | 'SCALE' 1702 | } 1703 | 1704 | /** 1705 | * A rectangle that expresses a bounding box in absolute coordinates. 1706 | */ 1707 | export type Rectangle = { 1708 | /** 1709 | * X coordinate of top left corner of the rectangle. 1710 | */ 1711 | x: number 1712 | 1713 | /** 1714 | * Y coordinate of top left corner of the rectangle. 1715 | */ 1716 | y: number 1717 | 1718 | /** 1719 | * Width of the rectangle. 1720 | */ 1721 | width: number 1722 | 1723 | /** 1724 | * Height of the rectangle. 1725 | */ 1726 | height: number 1727 | } 1728 | 1729 | /** 1730 | * Guides to align and place objects within a frames. 1731 | */ 1732 | export type LayoutGrid = { 1733 | /** 1734 | * Orientation of the grid as a string enum 1735 | * 1736 | * - `COLUMNS`: Vertical grid 1737 | * - `ROWS`: Horizontal grid 1738 | * - `GRID`: Square grid 1739 | */ 1740 | pattern: 'COLUMNS' | 'ROWS' | 'GRID' 1741 | 1742 | /** 1743 | * Width of column grid or height of row grid or square grid spacing. 1744 | */ 1745 | sectionSize: number 1746 | 1747 | /** 1748 | * Is the grid currently visible? 1749 | */ 1750 | visible: boolean 1751 | 1752 | /** 1753 | * Color of the grid 1754 | */ 1755 | color: RGBA 1756 | 1757 | /** 1758 | * Positioning of grid as a string enum 1759 | * 1760 | * - `MIN`: Grid starts at the left or top of the frame 1761 | * - `MAX`: Grid starts at the right or bottom of the frame 1762 | * - `STRETCH`: Grid is stretched to fit the frame 1763 | * - `CENTER`: Grid is center aligned 1764 | */ 1765 | alignment: 'MIN' | 'MAX' | 'STRETCH' | 'CENTER' 1766 | 1767 | /** 1768 | * Spacing in between columns and rows 1769 | */ 1770 | gutterSize: number 1771 | 1772 | /** 1773 | * Spacing before the first column or row 1774 | */ 1775 | offset: number 1776 | 1777 | /** 1778 | * Number of columns or rows 1779 | */ 1780 | count: number 1781 | 1782 | /** 1783 | * The variables bound to a particular field on this layout grid 1784 | */ 1785 | boundVariables?: { 1786 | gutterSize?: VariableAlias 1787 | 1788 | numSections?: VariableAlias 1789 | 1790 | sectionSize?: VariableAlias 1791 | 1792 | offset?: VariableAlias 1793 | } 1794 | } 1795 | 1796 | /** 1797 | * Base properties shared by all shadow effects 1798 | */ 1799 | export type BaseShadowEffect = { 1800 | /** 1801 | * The color of the shadow 1802 | */ 1803 | color: RGBA 1804 | 1805 | /** 1806 | * Blend mode of the shadow 1807 | */ 1808 | blendMode: BlendMode 1809 | 1810 | /** 1811 | * How far the shadow is projected in the x and y directions 1812 | */ 1813 | offset: Vector 1814 | 1815 | /** 1816 | * Radius of the blur effect (applies to shadows as well) 1817 | */ 1818 | radius: number 1819 | 1820 | /** 1821 | * The distance by which to expand (or contract) the shadow. 1822 | * 1823 | * For drop shadows, a positive `spread` value creates a shadow larger than the node, whereas a 1824 | * negative value creates a shadow smaller than the node. 1825 | * 1826 | * For inner shadows, a positive `spread` value contracts the shadow. Spread values are only 1827 | * accepted on rectangles and ellipses, or on frames, components, and instances with visible fill 1828 | * paints and `clipsContent` enabled. When left unspecified, the default value is 0. 1829 | */ 1830 | spread?: number 1831 | 1832 | /** 1833 | * Whether this shadow is visible. 1834 | */ 1835 | visible: boolean 1836 | 1837 | /** 1838 | * The variables bound to a particular field on this shadow effect 1839 | */ 1840 | boundVariables?: { 1841 | radius?: VariableAlias 1842 | 1843 | spread?: VariableAlias 1844 | 1845 | color?: VariableAlias 1846 | 1847 | offsetX?: VariableAlias 1848 | 1849 | offsetY?: VariableAlias 1850 | } 1851 | } 1852 | 1853 | export type DropShadowEffect = { 1854 | /** 1855 | * A string literal representing the effect's type. Always check the type before reading other 1856 | * properties. 1857 | */ 1858 | type: 'DROP_SHADOW' 1859 | 1860 | /** 1861 | * Whether to show the shadow behind translucent or transparent pixels 1862 | */ 1863 | showShadowBehindNode: boolean 1864 | } & BaseShadowEffect 1865 | 1866 | export type InnerShadowEffect = { 1867 | /** 1868 | * A string literal representing the effect's type. Always check the type before reading other 1869 | * properties. 1870 | */ 1871 | type?: 'INNER_SHADOW' 1872 | } & BaseShadowEffect 1873 | 1874 | export type BlurEffect = NormalBlurEffect | ProgressiveBlurEffect 1875 | 1876 | /** 1877 | * Base properties shared by all blur effects 1878 | */ 1879 | export type BaseBlurEffect = { 1880 | /** 1881 | * A string literal representing the effect's type. Always check the type before reading other 1882 | * properties. 1883 | */ 1884 | type: 'LAYER_BLUR' | 'BACKGROUND_BLUR' 1885 | 1886 | /** 1887 | * Whether this blur is active. 1888 | */ 1889 | visible: boolean 1890 | 1891 | /** 1892 | * Radius of the blur effect 1893 | */ 1894 | radius: number 1895 | 1896 | /** 1897 | * The variables bound to a particular field on this blur effect 1898 | */ 1899 | boundVariables?: { radius?: VariableAlias } 1900 | } 1901 | 1902 | export type NormalBlurEffect = { 1903 | /** 1904 | * The string literal 'NORMAL' representing the blur type. Always check the blurType before reading 1905 | * other properties. 1906 | */ 1907 | blurType?: 'NORMAL' 1908 | } & BaseBlurEffect 1909 | 1910 | export type ProgressiveBlurEffect = { 1911 | /** 1912 | * The string literal 'PROGRESSIVE' representing the blur type. Always check the blurType before 1913 | * reading other properties. 1914 | */ 1915 | blurType: 'PROGRESSIVE' 1916 | 1917 | /** 1918 | * The starting radius of the progressive blur 1919 | */ 1920 | startRadius: number 1921 | 1922 | /** 1923 | * The starting offset of the progressive blur 1924 | */ 1925 | startOffset: Vector 1926 | 1927 | /** 1928 | * The ending offset of the progressive blur 1929 | */ 1930 | endOffset: Vector 1931 | } & BaseBlurEffect 1932 | 1933 | /** 1934 | * A texture effect 1935 | */ 1936 | export type TextureEffect = { 1937 | /** 1938 | * The string literal 'TEXTURE' representing the effect's type. Always check the type before reading 1939 | * other properties. 1940 | */ 1941 | type: 'TEXTURE' 1942 | 1943 | /** 1944 | * Whether the texture effect is visible. 1945 | */ 1946 | visible: boolean 1947 | 1948 | /** 1949 | * The size of the texture effect 1950 | */ 1951 | noiseSize: number 1952 | 1953 | /** 1954 | * The radius of the texture effect 1955 | */ 1956 | radius: number 1957 | 1958 | /** 1959 | * Whether the texture is clipped to the shape 1960 | */ 1961 | clipToShape: boolean 1962 | } 1963 | 1964 | export type MonotoneNoiseEffect = { 1965 | /** 1966 | * The string literal 'MONOTONE' representing the noise type. 1967 | */ 1968 | noiseType: 'MONOTONE' 1969 | } & BaseNoiseEffect 1970 | 1971 | export type MultitoneNoiseEffect = { 1972 | /** 1973 | * The string literal 'MULTITONE' representing the noise type. 1974 | */ 1975 | noiseType: 'MULTITONE' 1976 | 1977 | /** 1978 | * The opacity of the noise effect 1979 | */ 1980 | opacity: number 1981 | } & BaseNoiseEffect 1982 | 1983 | export type DuotoneNoiseEffect = { 1984 | /** 1985 | * The string literal 'DUOTONE' representing the noise type. 1986 | */ 1987 | noiseType: 'DUOTONE' 1988 | 1989 | /** 1990 | * The secondary color of the noise effect 1991 | */ 1992 | secondaryColor: RGBA 1993 | } & BaseNoiseEffect 1994 | 1995 | /** 1996 | * A noise effect 1997 | */ 1998 | export type BaseNoiseEffect = { 1999 | /** 2000 | * The string literal 'NOISE' representing the effect's type. Always check the type before reading 2001 | * other properties. 2002 | */ 2003 | type: 'NOISE' 2004 | 2005 | /** 2006 | * The color of the noise effect 2007 | */ 2008 | color: RGBA 2009 | 2010 | /** 2011 | * Whether the noise effect is visible. 2012 | */ 2013 | visible: boolean 2014 | 2015 | /** 2016 | * Blend mode of the noise effect 2017 | */ 2018 | blendMode: BlendMode 2019 | 2020 | /** 2021 | * The size of the noise effect 2022 | */ 2023 | noiseSize: number 2024 | 2025 | /** 2026 | * The density of the noise effect 2027 | */ 2028 | density: number 2029 | } 2030 | 2031 | export type NoiseEffect = MonotoneNoiseEffect | MultitoneNoiseEffect | DuotoneNoiseEffect 2032 | 2033 | export type Effect = DropShadowEffect | InnerShadowEffect | BlurEffect | TextureEffect | NoiseEffect 2034 | 2035 | /** 2036 | * A set of properties that can be applied to nodes and published. Styles for a property can be 2037 | * created in the corresponding property's panel while editing a file. 2038 | */ 2039 | export type Style = { 2040 | /** 2041 | * The key of the style 2042 | */ 2043 | key: string 2044 | 2045 | /** 2046 | * Name of the style 2047 | */ 2048 | name: string 2049 | 2050 | /** 2051 | * Description of the style 2052 | */ 2053 | description: string 2054 | 2055 | /** 2056 | * Whether this style is a remote style that doesn't live in this file 2057 | */ 2058 | remote: boolean 2059 | 2060 | styleType: StyleType 2061 | } 2062 | 2063 | /** 2064 | * This type is a string enum with the following possible values: 2065 | * 2066 | * - `EASE_IN`: Ease in with an animation curve similar to CSS ease-in. 2067 | * - `EASE_OUT`: Ease out with an animation curve similar to CSS ease-out. 2068 | * - `EASE_IN_AND_OUT`: Ease in and then out with an animation curve similar to CSS ease-in-out. 2069 | * - `LINEAR`: No easing, similar to CSS linear. 2070 | * - `EASE_IN_BACK`: Ease in with an animation curve that moves past the initial keyframe's value and 2071 | * then accelerates as it reaches the end. 2072 | * - `EASE_OUT_BACK`: Ease out with an animation curve that starts fast, then slows and goes past the 2073 | * ending keyframe's value. 2074 | * - `EASE_IN_AND_OUT_BACK`: Ease in and then out with an animation curve that overshoots the initial 2075 | * keyframe's value, then accelerates quickly before it slows and overshoots the ending keyframes 2076 | * value. 2077 | * - `CUSTOM_CUBIC_BEZIER`: User-defined cubic bezier curve. 2078 | * - `GENTLE`: Gentle animation similar to react-spring. 2079 | * - `QUICK`: Quick spring animation, great for toasts and notifications. 2080 | * - `BOUNCY`: Bouncy spring, for delightful animations like a heart bounce. 2081 | * - `SLOW`: Slow spring, useful as a steady, natural way to scale up fullscreen content. 2082 | * - `CUSTOM_SPRING`: User-defined spring animation. 2083 | */ 2084 | export type EasingType = 2085 | | 'EASE_IN' 2086 | | 'EASE_OUT' 2087 | | 'EASE_IN_AND_OUT' 2088 | | 'LINEAR' 2089 | | 'EASE_IN_BACK' 2090 | | 'EASE_OUT_BACK' 2091 | | 'EASE_IN_AND_OUT_BACK' 2092 | | 'CUSTOM_CUBIC_BEZIER' 2093 | | 'GENTLE' 2094 | | 'QUICK' 2095 | | 'BOUNCY' 2096 | | 'SLOW' 2097 | | 'CUSTOM_SPRING' 2098 | 2099 | /** 2100 | * Individual stroke weights 2101 | */ 2102 | export type StrokeWeights = { 2103 | /** 2104 | * The top stroke weight. 2105 | */ 2106 | top: number 2107 | 2108 | /** 2109 | * The right stroke weight. 2110 | */ 2111 | right: number 2112 | 2113 | /** 2114 | * The bottom stroke weight. 2115 | */ 2116 | bottom: number 2117 | 2118 | /** 2119 | * The left stroke weight. 2120 | */ 2121 | left: number 2122 | } 2123 | 2124 | /** 2125 | * Paint metadata to override default paints. 2126 | */ 2127 | export type PaintOverride = { 2128 | /** 2129 | * Paints applied to characters. 2130 | */ 2131 | fills?: Paint[] 2132 | 2133 | /** 2134 | * ID of style node, if any, that this inherits fill data from. 2135 | */ 2136 | inheritFillStyleId?: string 2137 | } 2138 | 2139 | /** 2140 | * Defines a single path 2141 | */ 2142 | export type Path = { 2143 | /** 2144 | * A series of path commands that encodes how to draw the path. 2145 | */ 2146 | path: string 2147 | 2148 | /** 2149 | * The winding rule for the path (same as in SVGs). This determines whether a given point in space 2150 | * is inside or outside the path. 2151 | */ 2152 | windingRule: 'NONZERO' | 'EVENODD' 2153 | 2154 | /** 2155 | * If there is a per-region fill, this refers to an ID in the `fillOverrideTable`. 2156 | */ 2157 | overrideID?: number 2158 | } 2159 | 2160 | /** 2161 | * Information about the arc properties of an ellipse. 0° is the x axis and increasing angles rotate 2162 | * clockwise. 2163 | */ 2164 | export type ArcData = { 2165 | /** 2166 | * Start of the sweep in radians. 2167 | */ 2168 | startingAngle: number 2169 | 2170 | /** 2171 | * End of the sweep in radians. 2172 | */ 2173 | endingAngle: number 2174 | 2175 | /** 2176 | * Inner radius value between 0 and 1 2177 | */ 2178 | innerRadius: number 2179 | } 2180 | 2181 | /** 2182 | * A link to either a URL or another frame (node) in the document. 2183 | */ 2184 | export type Hyperlink = { 2185 | /** 2186 | * The type of hyperlink. Can be either `URL` or `NODE`. 2187 | */ 2188 | type: 'URL' | 'NODE' 2189 | 2190 | /** 2191 | * The URL that the hyperlink points to, if `type` is `URL`. 2192 | */ 2193 | url?: string 2194 | 2195 | /** 2196 | * The ID of the node that the hyperlink points to, if `type` is `NODE`. 2197 | */ 2198 | nodeID?: string 2199 | } 2200 | 2201 | export type BaseTypeStyle = { 2202 | /** 2203 | * Font family of text (standard name). 2204 | */ 2205 | fontFamily?: string 2206 | 2207 | /** 2208 | * PostScript font name. 2209 | */ 2210 | fontPostScriptName?: string | null 2211 | 2212 | /** 2213 | * Describes visual weight or emphasis, such as Bold or Italic. 2214 | */ 2215 | fontStyle?: string 2216 | 2217 | /** 2218 | * Whether or not text is italicized. 2219 | */ 2220 | italic?: boolean 2221 | 2222 | /** 2223 | * Numeric font weight. 2224 | */ 2225 | fontWeight?: number 2226 | 2227 | /** 2228 | * Font size in px. 2229 | */ 2230 | fontSize?: number 2231 | 2232 | /** 2233 | * Text casing applied to the node, default is the original casing. 2234 | */ 2235 | textCase?: 'ORIGINAL' | 'UPPER' | 'LOWER' | 'TITLE' | 'SMALL_CAPS' | 'SMALL_CAPS_FORCED' 2236 | 2237 | /** 2238 | * Horizontal text alignment as string enum. 2239 | */ 2240 | textAlignHorizontal?: 'LEFT' | 'RIGHT' | 'CENTER' | 'JUSTIFIED' 2241 | 2242 | /** 2243 | * Vertical text alignment as string enum. 2244 | */ 2245 | textAlignVertical?: 'TOP' | 'CENTER' | 'BOTTOM' 2246 | 2247 | /** 2248 | * Space between characters in px. 2249 | */ 2250 | letterSpacing?: number 2251 | 2252 | /** 2253 | * An array of fill paints applied to the characters. 2254 | */ 2255 | fills?: Paint[] 2256 | 2257 | /** 2258 | * Link to a URL or frame. 2259 | */ 2260 | hyperlink?: Hyperlink 2261 | 2262 | /** 2263 | * A map of OpenType feature flags to 1 or 0, 1 if it is enabled and 0 if it is disabled. Note that 2264 | * some flags aren't reflected here. For example, SMCP (small caps) is still represented by the 2265 | * `textCase` field. 2266 | */ 2267 | opentypeFlags?: { [key: string]: number } 2268 | 2269 | /** 2270 | * Indicates how the font weight was overridden when there is a text style override. 2271 | */ 2272 | semanticWeight?: 'BOLD' | 'NORMAL' 2273 | 2274 | /** 2275 | * Indicates how the font style was overridden when there is a text style override. 2276 | */ 2277 | semanticItalic?: 'ITALIC' | 'NORMAL' 2278 | } 2279 | 2280 | export type TypeStyle = { 2281 | /** 2282 | * Space between paragraphs in px, 0 if not present. 2283 | */ 2284 | paragraphSpacing?: number 2285 | 2286 | /** 2287 | * Paragraph indentation in px, 0 if not present. 2288 | */ 2289 | paragraphIndent?: number 2290 | 2291 | /** 2292 | * Space between list items in px, 0 if not present. 2293 | */ 2294 | listSpacing?: number 2295 | 2296 | /** 2297 | * Text decoration applied to the node, default is none. 2298 | */ 2299 | textDecoration?: 'NONE' | 'STRIKETHROUGH' | 'UNDERLINE' 2300 | 2301 | /** 2302 | * Dimensions along which text will auto resize, default is that the text does not auto-resize. 2303 | * TRUNCATE means that the text will be shortened and trailing text will be replaced with "…" if the 2304 | * text contents is larger than the bounds. `TRUNCATE` as a return value is deprecated and will be 2305 | * removed in a future version. Read from `textTruncation` instead. 2306 | */ 2307 | textAutoResize?: 'NONE' | 'WIDTH_AND_HEIGHT' | 'HEIGHT' | 'TRUNCATE' 2308 | 2309 | /** 2310 | * Whether this text node will truncate with an ellipsis when the text contents is larger than the 2311 | * text node. 2312 | */ 2313 | textTruncation?: 'DISABLED' | 'ENDING' 2314 | 2315 | /** 2316 | * When `textTruncation: "ENDING"` is set, `maxLines` determines how many lines a text node can grow 2317 | * to before it truncates. 2318 | */ 2319 | maxLines?: number 2320 | 2321 | /** 2322 | * Line height in px. 2323 | */ 2324 | lineHeightPx?: number 2325 | 2326 | /** 2327 | * Line height as a percentage of normal line height. This is deprecated; in a future version of the 2328 | * API only lineHeightPx and lineHeightPercentFontSize will be returned. 2329 | */ 2330 | lineHeightPercent?: number 2331 | 2332 | /** 2333 | * Line height as a percentage of the font size. Only returned when `lineHeightPercent` (deprecated) 2334 | * is not 100. 2335 | */ 2336 | lineHeightPercentFontSize?: number 2337 | 2338 | /** 2339 | * The unit of the line height value specified by the user. 2340 | */ 2341 | lineHeightUnit?: 'PIXELS' | 'FONT_SIZE_%' | 'INTRINSIC_%' 2342 | 2343 | /** 2344 | * Whether or not this style has overrides over a text style. The possible fields to override are 2345 | * semanticWeight, semanticItalic, hyperlink, and textDecoration. If this is true, then those fields 2346 | * are overrides if present. 2347 | */ 2348 | isOverrideOverTextStyle?: boolean 2349 | 2350 | /** 2351 | * The variables bound to a particular field on this style 2352 | */ 2353 | boundVariables?: { 2354 | fontFamily?: VariableAlias 2355 | 2356 | fontSize?: VariableAlias 2357 | 2358 | fontStyle?: VariableAlias 2359 | 2360 | fontWeight?: VariableAlias 2361 | 2362 | letterSpacing?: VariableAlias 2363 | 2364 | lineHeight?: VariableAlias 2365 | 2366 | paragraphSpacing?: VariableAlias 2367 | 2368 | paragraphIndent?: VariableAlias 2369 | } 2370 | } & BaseTypeStyle 2371 | 2372 | export type TextPathTypeStyle = { 2373 | /** 2374 | * Whether or not this style has overrides over a text style. The possible fields to override are 2375 | * semanticWeight, semanticItalic, and hyperlink. If this is true, then those fields are overrides 2376 | * if present. 2377 | */ 2378 | isOverrideOverTextStyle?: boolean 2379 | 2380 | /** 2381 | * The variables bound to a particular field on this style 2382 | */ 2383 | boundVariables?: { 2384 | fontFamily?: VariableAlias 2385 | 2386 | fontSize?: VariableAlias 2387 | 2388 | fontStyle?: VariableAlias 2389 | 2390 | fontWeight?: VariableAlias 2391 | 2392 | letterSpacing?: VariableAlias 2393 | } 2394 | } & BaseTypeStyle 2395 | 2396 | /** 2397 | * Component property type. 2398 | */ 2399 | export type ComponentPropertyType = 'BOOLEAN' | 'INSTANCE_SWAP' | 'TEXT' | 'VARIANT' 2400 | 2401 | /** 2402 | * Instance swap preferred value. 2403 | */ 2404 | export type InstanceSwapPreferredValue = { 2405 | /** 2406 | * Type of node for this preferred value. 2407 | */ 2408 | type: 'COMPONENT' | 'COMPONENT_SET' 2409 | 2410 | /** 2411 | * Key of this component or component set. 2412 | */ 2413 | key: string 2414 | } 2415 | 2416 | /** 2417 | * A property of a component. 2418 | */ 2419 | export type ComponentPropertyDefinition = { 2420 | /** 2421 | * Type of this component property. 2422 | */ 2423 | type: ComponentPropertyType 2424 | 2425 | /** 2426 | * Initial value of this property for instances. 2427 | */ 2428 | defaultValue: boolean | string 2429 | 2430 | /** 2431 | * All possible values for this property. Only exists on VARIANT properties. 2432 | */ 2433 | variantOptions?: string[] 2434 | 2435 | /** 2436 | * Preferred values for this property. Only applicable if type is `INSTANCE_SWAP`. 2437 | */ 2438 | preferredValues?: InstanceSwapPreferredValue[] 2439 | } 2440 | 2441 | /** 2442 | * A property of a component. 2443 | */ 2444 | export type ComponentProperty = { 2445 | /** 2446 | * Type of this component property. 2447 | */ 2448 | type: ComponentPropertyType 2449 | 2450 | /** 2451 | * Value of the property for this component instance. 2452 | */ 2453 | value: boolean | string 2454 | 2455 | /** 2456 | * Preferred values for this property. Only applicable if type is `INSTANCE_SWAP`. 2457 | */ 2458 | preferredValues?: InstanceSwapPreferredValue[] 2459 | 2460 | /** 2461 | * The variables bound to a particular field on this component property 2462 | */ 2463 | boundVariables?: { value?: VariableAlias } 2464 | } 2465 | 2466 | /** 2467 | * Fields directly overridden on an instance. Inherited overrides are not included. 2468 | */ 2469 | export type Overrides = { 2470 | /** 2471 | * A unique ID for a node. 2472 | */ 2473 | id: string 2474 | 2475 | /** 2476 | * An array of properties. 2477 | */ 2478 | overriddenFields: string[] 2479 | } 2480 | 2481 | /** 2482 | * Geometric shape type. 2483 | */ 2484 | export type ShapeType = 2485 | | 'SQUARE' 2486 | | 'ELLIPSE' 2487 | | 'ROUNDED_RECTANGLE' 2488 | | 'DIAMOND' 2489 | | 'TRIANGLE_UP' 2490 | | 'TRIANGLE_DOWN' 2491 | | 'PARALLELOGRAM_RIGHT' 2492 | | 'PARALLELOGRAM_LEFT' 2493 | | 'ENG_DATABASE' 2494 | | 'ENG_QUEUE' 2495 | | 'ENG_FILE' 2496 | | 'ENG_FOLDER' 2497 | | 'TRAPEZOID' 2498 | | 'PREDEFINED_PROCESS' 2499 | | 'SHIELD' 2500 | | 'DOCUMENT_SINGLE' 2501 | | 'DOCUMENT_MULTIPLE' 2502 | | 'MANUAL_INPUT' 2503 | | 'HEXAGON' 2504 | | 'CHEVRON' 2505 | | 'PENTAGON' 2506 | | 'OCTAGON' 2507 | | 'STAR' 2508 | | 'PLUS' 2509 | | 'ARROW_LEFT' 2510 | | 'ARROW_RIGHT' 2511 | | 'SUMMING_JUNCTION' 2512 | | 'OR' 2513 | | 'SPEECH_BUBBLE' 2514 | | 'INTERNAL_STORAGE' 2515 | 2516 | /** 2517 | * Stores canvas location for a connector start/end point. 2518 | */ 2519 | export type ConnectorEndpoint = 2520 | | { 2521 | /** 2522 | * Node ID that this endpoint attaches to. 2523 | */ 2524 | endpointNodeId?: string 2525 | 2526 | /** 2527 | * The position of the endpoint relative to the node. 2528 | */ 2529 | position?: Vector 2530 | } 2531 | | { 2532 | /** 2533 | * Node ID that this endpoint attaches to. 2534 | */ 2535 | endpointNodeId?: string 2536 | 2537 | /** 2538 | * The magnet type is a string enum. 2539 | */ 2540 | magnet?: 'AUTO' | 'TOP' | 'BOTTOM' | 'LEFT' | 'RIGHT' | 'CENTER' 2541 | } 2542 | 2543 | /** 2544 | * Connector line type. 2545 | */ 2546 | export type ConnectorLineType = 'STRAIGHT' | 'ELBOWED' | 'CURVED' 2547 | 2548 | export type ConnectorTextBackground = CornerTrait & MinimalFillsTrait 2549 | 2550 | /** 2551 | * A description of a main component. Helps you identify which component instances are attached to. 2552 | */ 2553 | export type Component = { 2554 | /** 2555 | * The key of the component 2556 | */ 2557 | key: string 2558 | 2559 | /** 2560 | * Name of the component 2561 | */ 2562 | name: string 2563 | 2564 | /** 2565 | * The description of the component as entered in the editor 2566 | */ 2567 | description: string 2568 | 2569 | /** 2570 | * The ID of the component set if the component belongs to one 2571 | */ 2572 | componentSetId?: string 2573 | 2574 | /** 2575 | * An array of documentation links attached to this component 2576 | */ 2577 | documentationLinks: DocumentationLink[] 2578 | 2579 | /** 2580 | * Whether this component is a remote component that doesn't live in this file 2581 | */ 2582 | remote: boolean 2583 | } 2584 | 2585 | /** 2586 | * A description of a component set, which is a node containing a set of variants of a component. 2587 | */ 2588 | export type ComponentSet = { 2589 | /** 2590 | * The key of the component set 2591 | */ 2592 | key: string 2593 | 2594 | /** 2595 | * Name of the component set 2596 | */ 2597 | name: string 2598 | 2599 | /** 2600 | * The description of the component set as entered in the editor 2601 | */ 2602 | description: string 2603 | 2604 | /** 2605 | * An array of documentation links attached to this component set 2606 | */ 2607 | documentationLinks?: DocumentationLink[] 2608 | 2609 | /** 2610 | * Whether this component set is a remote component set that doesn't live in this file 2611 | */ 2612 | remote?: boolean 2613 | } 2614 | 2615 | /** 2616 | * Represents a link to documentation for a component or component set. 2617 | */ 2618 | export type DocumentationLink = { 2619 | /** 2620 | * Should be a valid URI (e.g. https://www.figma.com). 2621 | */ 2622 | uri: string 2623 | } 2624 | 2625 | /** 2626 | * Contains a variable alias 2627 | */ 2628 | export type VariableAlias = { 2629 | type: 'VARIABLE_ALIAS' 2630 | 2631 | /** 2632 | * The id of the variable that the current variable is aliased to. This variable can be a local or 2633 | * remote variable, and both can be retrieved via the GET /v1/files/:file_key/variables/local 2634 | * endpoint. 2635 | */ 2636 | id: string 2637 | } 2638 | 2639 | /** 2640 | * An interaction in the Figma viewer, containing a trigger and one or more actions. 2641 | */ 2642 | export type Interaction = { 2643 | /** 2644 | * The user event that initiates the interaction. 2645 | */ 2646 | trigger: Trigger | null 2647 | 2648 | /** 2649 | * The actions that are performed when the trigger is activated. 2650 | */ 2651 | actions?: Action[] 2652 | } 2653 | 2654 | /** 2655 | * The `"ON_HOVER"` and `"ON_PRESS"` trigger types revert the navigation when the trigger is 2656 | * finished (the result is temporary). `"MOUSE_ENTER"`, `"MOUSE_LEAVE"`, `"MOUSE_UP"` and 2657 | * `"MOUSE_DOWN"` are permanent, one-way navigation. The `delay` parameter requires the trigger to 2658 | * be held for a certain duration of time before the action occurs. Both `timeout` and `delay` 2659 | * values are in milliseconds. The `"ON_MEDIA_HIT"` and `"ON_MEDIA_END"` trigger types can only 2660 | * trigger from a video. They fire when a video reaches a certain time or ends. The `timestamp` 2661 | * value is in seconds. 2662 | */ 2663 | export type Trigger = 2664 | | { type: 'ON_CLICK' | 'ON_HOVER' | 'ON_PRESS' | 'ON_DRAG' } 2665 | | AfterTimeoutTrigger 2666 | | { 2667 | type: 'MOUSE_ENTER' | 'MOUSE_LEAVE' | 'MOUSE_UP' | 'MOUSE_DOWN' 2668 | 2669 | delay: number 2670 | 2671 | /** 2672 | * Whether this is a [deprecated 2673 | * version](https://help.figma.com/hc/en-us/articles/360040035834-Prototype-triggers#h_01HHN04REHJNP168R26P1CMP0A) 2674 | * of the trigger that was left unchanged for backwards compatibility. If not present, the trigger 2675 | * is the latest version. 2676 | */ 2677 | deprecatedVersion?: boolean 2678 | } 2679 | | OnKeyDownTrigger 2680 | | OnMediaHitTrigger 2681 | | { type: 'ON_MEDIA_END' } 2682 | 2683 | export type AfterTimeoutTrigger = { 2684 | type: 'AFTER_TIMEOUT' 2685 | 2686 | timeout: number 2687 | } 2688 | 2689 | export type OnKeyDownTrigger = { 2690 | type: 'ON_KEY_DOWN' 2691 | 2692 | device: 'KEYBOARD' | 'XBOX_ONE' | 'PS4' | 'SWITCH_PRO' | 'UNKNOWN_CONTROLLER' 2693 | 2694 | keyCodes: number[] 2695 | } 2696 | 2697 | export type OnMediaHitTrigger = { 2698 | type: 'ON_MEDIA_HIT' 2699 | 2700 | mediaHitTime: number 2701 | } 2702 | 2703 | /** 2704 | * An action that is performed when a trigger is activated. 2705 | */ 2706 | export type Action = 2707 | | { type: 'BACK' | 'CLOSE' } 2708 | | OpenURLAction 2709 | | UpdateMediaRuntimeAction 2710 | | SetVariableAction 2711 | | SetVariableModeAction 2712 | | ConditionalAction 2713 | | NodeAction 2714 | 2715 | /** 2716 | * An action that opens a URL. 2717 | */ 2718 | export type OpenURLAction = { 2719 | type: 'URL' 2720 | 2721 | url: string 2722 | } 2723 | 2724 | /** 2725 | * An action that affects a video node in the Figma viewer. For example, to play, pause, or skip. 2726 | */ 2727 | export type UpdateMediaRuntimeAction = 2728 | | { 2729 | type: 'UPDATE_MEDIA_RUNTIME' 2730 | 2731 | destinationId: string | null 2732 | 2733 | mediaAction: 'PLAY' | 'PAUSE' | 'TOGGLE_PLAY_PAUSE' | 'MUTE' | 'UNMUTE' | 'TOGGLE_MUTE_UNMUTE' 2734 | } 2735 | | { 2736 | type: 'UPDATE_MEDIA_RUNTIME' 2737 | 2738 | destinationId?: string | null 2739 | 2740 | mediaAction: 'SKIP_FORWARD' | 'SKIP_BACKWARD' 2741 | 2742 | amountToSkip: number 2743 | } 2744 | | { 2745 | type: 'UPDATE_MEDIA_RUNTIME' 2746 | 2747 | destinationId?: string | null 2748 | 2749 | mediaAction: 'SKIP_TO' 2750 | 2751 | newTimestamp: number 2752 | } 2753 | 2754 | /** 2755 | * An action that navigates to a specific node in the Figma viewer. 2756 | */ 2757 | export type NodeAction = { 2758 | type: 'NODE' 2759 | 2760 | destinationId: string | null 2761 | 2762 | navigation: Navigation 2763 | 2764 | transition: Transition | null 2765 | 2766 | /** 2767 | * Whether the scroll offsets of any scrollable elements in the current screen or overlay are 2768 | * preserved when navigating to the destination. This is applicable only if the layout of both the 2769 | * current frame and its destination are the same. 2770 | */ 2771 | preserveScrollPosition?: boolean 2772 | 2773 | /** 2774 | * Applicable only when `navigation` is `"OVERLAY"` and the destination is a frame with 2775 | * `overlayPosition` equal to `"MANUAL"`. This value represents the offset by which the overlay is 2776 | * opened relative to this node. 2777 | */ 2778 | overlayRelativePosition?: Vector 2779 | 2780 | /** 2781 | * When true, all videos within the destination frame will reset their memorized playback position 2782 | * to 00:00 before starting to play. 2783 | */ 2784 | resetVideoPosition?: boolean 2785 | 2786 | /** 2787 | * Whether the scroll offsets of any scrollable elements in the current screen or overlay reset when 2788 | * navigating to the destination. This is applicable only if the layout of both the current frame 2789 | * and its destination are the same. 2790 | */ 2791 | resetScrollPosition?: boolean 2792 | 2793 | /** 2794 | * Whether the state of any interactive components in the current screen or overlay reset when 2795 | * navigating to the destination. This is applicable if there are interactive components in the 2796 | * destination frame. 2797 | */ 2798 | resetInteractiveComponents?: boolean 2799 | } 2800 | 2801 | /** 2802 | * The method of navigation. The possible values are: 2803 | * 2804 | * - `"NAVIGATE"`: Replaces the current screen with the destination, also closing all overlays. 2805 | * - `"OVERLAY"`: Opens the destination as an overlay on the current screen. 2806 | * - `"SWAP"`: On an overlay, replaces the current (topmost) overlay with the destination. On a 2807 | * top-level frame, behaves the same as `"NAVIGATE"` except that no entry is added to the 2808 | * navigation history. 2809 | * - `"SCROLL_TO"`: Scrolls to the destination on the current screen. 2810 | * - `"CHANGE_TO"`: Changes the closest ancestor instance of source node to the specified variant. 2811 | */ 2812 | export type Navigation = 'NAVIGATE' | 'SWAP' | 'OVERLAY' | 'SCROLL_TO' | 'CHANGE_TO' 2813 | 2814 | export type Transition = SimpleTransition | DirectionalTransition 2815 | 2816 | /** 2817 | * Describes an animation used when navigating in a prototype. 2818 | */ 2819 | export type SimpleTransition = { 2820 | type: 'DISSOLVE' | 'SMART_ANIMATE' | 'SCROLL_ANIMATE' 2821 | 2822 | /** 2823 | * The duration of the transition in milliseconds. 2824 | */ 2825 | duration: number 2826 | 2827 | /** 2828 | * The easing curve of the transition. 2829 | */ 2830 | easing: Easing 2831 | } 2832 | 2833 | /** 2834 | * Describes an animation used when navigating in a prototype. 2835 | */ 2836 | export type DirectionalTransition = { 2837 | type: 'MOVE_IN' | 'MOVE_OUT' | 'PUSH' | 'SLIDE_IN' | 'SLIDE_OUT' 2838 | 2839 | direction: 'LEFT' | 'RIGHT' | 'TOP' | 'BOTTOM' 2840 | 2841 | /** 2842 | * The duration of the transition in milliseconds. 2843 | */ 2844 | duration: number 2845 | 2846 | /** 2847 | * The easing curve of the transition. 2848 | */ 2849 | easing: Easing 2850 | 2851 | /** 2852 | * When the transition `type` is `"SMART_ANIMATE"` or when `matchLayers` is `true`, then the 2853 | * transition will be performed using smart animate, which attempts to match corresponding layers an 2854 | * interpolate other properties during the animation. 2855 | */ 2856 | matchLayers?: boolean 2857 | } 2858 | 2859 | /** 2860 | * Describes an easing curve. 2861 | */ 2862 | export type Easing = { 2863 | /** 2864 | * The type of easing curve. 2865 | */ 2866 | type: EasingType 2867 | 2868 | /** 2869 | * A cubic bezier curve that defines the easing. 2870 | */ 2871 | easingFunctionCubicBezier?: { 2872 | /** 2873 | * The x component of the first control point. 2874 | */ 2875 | x1: number 2876 | 2877 | /** 2878 | * The y component of the first control point. 2879 | */ 2880 | y1: number 2881 | 2882 | /** 2883 | * The x component of the second control point. 2884 | */ 2885 | x2: number 2886 | 2887 | /** 2888 | * The y component of the second control point. 2889 | */ 2890 | y2: number 2891 | } 2892 | 2893 | /** 2894 | * A spring function that defines the easing. 2895 | */ 2896 | easingFunctionSpring?: { 2897 | mass: number 2898 | 2899 | stiffness: number 2900 | 2901 | damping: number 2902 | } 2903 | } 2904 | 2905 | /** 2906 | * Sets a variable to a specific value. 2907 | */ 2908 | export type SetVariableAction = { 2909 | type: 'SET_VARIABLE' 2910 | 2911 | variableId: string | null 2912 | 2913 | variableValue?: VariableData 2914 | } 2915 | 2916 | /** 2917 | * Sets a variable to a specific mode. 2918 | */ 2919 | export type SetVariableModeAction = { 2920 | type: 'SET_VARIABLE_MODE' 2921 | 2922 | variableCollectionId?: string | null 2923 | 2924 | variableModeId?: string | null 2925 | } 2926 | 2927 | /** 2928 | * Checks if a condition is met before performing certain actions by using an if/else conditional 2929 | * statement. 2930 | */ 2931 | export type ConditionalAction = { 2932 | type: 'CONDITIONAL' 2933 | 2934 | conditionalBlocks: ConditionalBlock[] 2935 | } 2936 | 2937 | /** 2938 | * A value to set a variable to during prototyping. 2939 | */ 2940 | export type VariableData = { 2941 | type?: VariableDataType 2942 | 2943 | resolvedType?: VariableResolvedDataType 2944 | 2945 | value?: boolean | number | string | RGB | RGBA | VariableAlias | Expression 2946 | } 2947 | 2948 | /** 2949 | * Defines the types of data a VariableData object can hold 2950 | */ 2951 | export type VariableDataType = 2952 | | 'BOOLEAN' 2953 | | 'FLOAT' 2954 | | 'STRING' 2955 | | 'COLOR' 2956 | | 'VARIABLE_ALIAS' 2957 | | 'EXPRESSION' 2958 | 2959 | /** 2960 | * Defines the types of data a VariableData object can eventually equal 2961 | */ 2962 | export type VariableResolvedDataType = 'BOOLEAN' | 'FLOAT' | 'STRING' | 'COLOR' 2963 | 2964 | /** 2965 | * Defines the [Expression](https://help.figma.com/hc/en-us/articles/15253194385943) object, which 2966 | * contains a list of `VariableData` objects strung together by operators (`ExpressionFunction`). 2967 | */ 2968 | export type Expression = { 2969 | expressionFunction: ExpressionFunction 2970 | 2971 | expressionArguments: VariableData[] 2972 | } 2973 | 2974 | /** 2975 | * Defines the list of operators available to use in an Expression. 2976 | */ 2977 | export type ExpressionFunction = 2978 | | 'ADDITION' 2979 | | 'SUBTRACTION' 2980 | | 'MULTIPLICATION' 2981 | | 'DIVISION' 2982 | | 'EQUALS' 2983 | | 'NOT_EQUAL' 2984 | | 'LESS_THAN' 2985 | | 'LESS_THAN_OR_EQUAL' 2986 | | 'GREATER_THAN' 2987 | | 'GREATER_THAN_OR_EQUAL' 2988 | | 'AND' 2989 | | 'OR' 2990 | | 'VAR_MODE_LOOKUP' 2991 | | 'NEGATE' 2992 | | 'NOT' 2993 | 2994 | /** 2995 | * Either the if or else conditional blocks. The if block contains a condition to check. If that 2996 | * condition is met then it will run those list of actions, else it will run the actions in the else 2997 | * block. 2998 | */ 2999 | export type ConditionalBlock = { 3000 | condition?: VariableData 3001 | 3002 | actions: Action[] 3003 | } 3004 | 3005 | /** 3006 | * A pinned distance between two nodes in Dev Mode 3007 | */ 3008 | export type Measurement = { 3009 | id: string 3010 | 3011 | start: MeasurementStartEnd 3012 | 3013 | end: MeasurementStartEnd 3014 | 3015 | offset: MeasurementOffsetInner | MeasurementOffsetOuter 3016 | 3017 | /** 3018 | * When manually overridden, the displayed value of the measurement 3019 | */ 3020 | freeText?: string 3021 | } 3022 | 3023 | /** 3024 | * The node and side a measurement is pinned to 3025 | */ 3026 | export type MeasurementStartEnd = { 3027 | nodeId: string 3028 | 3029 | side: 'TOP' | 'RIGHT' | 'BOTTOM' | 'LEFT' 3030 | } 3031 | 3032 | /** 3033 | * Measurement offset relative to the inside of the start node 3034 | */ 3035 | export type MeasurementOffsetInner = { 3036 | type: 'INNER' 3037 | 3038 | relative: number 3039 | } 3040 | 3041 | /** 3042 | * Measurement offset relative to the outside of the start node 3043 | */ 3044 | export type MeasurementOffsetOuter = { 3045 | type: 'OUTER' 3046 | 3047 | fixed: number 3048 | } 3049 | 3050 | /** 3051 | * Position of a comment relative to the frame to which it is attached. 3052 | */ 3053 | export type FrameOffset = { 3054 | /** 3055 | * Unique id specifying the frame. 3056 | */ 3057 | node_id: string 3058 | 3059 | /** 3060 | * 2D vector offset within the frame from the top-left corner. 3061 | */ 3062 | node_offset: Vector 3063 | } 3064 | 3065 | /** 3066 | * Position of a region comment on the canvas. 3067 | */ 3068 | export type Region = { 3069 | /** 3070 | * X coordinate of the position. 3071 | */ 3072 | x: number 3073 | 3074 | /** 3075 | * Y coordinate of the position. 3076 | */ 3077 | y: number 3078 | 3079 | /** 3080 | * The height of the comment region. Must be greater than 0. 3081 | */ 3082 | region_height: number 3083 | 3084 | /** 3085 | * The width of the comment region. Must be greater than 0. 3086 | */ 3087 | region_width: number 3088 | 3089 | /** 3090 | * The corner of the comment region to pin to the node's corner as a string enum. 3091 | */ 3092 | comment_pin_corner?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' 3093 | } 3094 | 3095 | /** 3096 | * Position of a region comment relative to the frame to which it is attached. 3097 | */ 3098 | export type FrameOffsetRegion = { 3099 | /** 3100 | * Unique id specifying the frame. 3101 | */ 3102 | node_id: string 3103 | 3104 | /** 3105 | * 2D vector offset within the frame from the top-left corner. 3106 | */ 3107 | node_offset: Vector 3108 | 3109 | /** 3110 | * The height of the comment region. Must be greater than 0. 3111 | */ 3112 | region_height: number 3113 | 3114 | /** 3115 | * The width of the comment region. Must be greater than 0. 3116 | */ 3117 | region_width: number 3118 | 3119 | /** 3120 | * The corner of the comment region to pin to the node's corner as a string enum. 3121 | */ 3122 | comment_pin_corner?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' 3123 | } 3124 | 3125 | /** 3126 | * A comment or reply left by a user. 3127 | */ 3128 | export type Comment = { 3129 | /** 3130 | * Unique identifier for comment. 3131 | */ 3132 | id: string 3133 | 3134 | /** 3135 | * Positioning information of the comment. Includes information on the location of the comment pin, 3136 | * which is either the absolute coordinates on the canvas or a relative offset within a frame. If 3137 | * the comment is a region, it will also contain the region height, width, and position of the 3138 | * anchor in regards to the region. 3139 | */ 3140 | client_meta: Vector | FrameOffset | Region | FrameOffsetRegion 3141 | 3142 | /** 3143 | * The file in which the comment lives 3144 | */ 3145 | file_key: string 3146 | 3147 | /** 3148 | * If present, the id of the comment to which this is the reply 3149 | */ 3150 | parent_id?: string 3151 | 3152 | /** 3153 | * The user who left the comment 3154 | */ 3155 | user: User 3156 | 3157 | /** 3158 | * The UTC ISO 8601 time at which the comment was left 3159 | */ 3160 | created_at: string 3161 | 3162 | /** 3163 | * If set, the UTC ISO 8601 time the comment was resolved 3164 | */ 3165 | resolved_at?: string | null 3166 | 3167 | /** 3168 | * The content of the comment 3169 | */ 3170 | message: string 3171 | 3172 | /** 3173 | * Only set for top level comments. The number displayed with the comment in the UI 3174 | */ 3175 | order_id: string | null 3176 | 3177 | /** 3178 | * An array of reactions to the comment 3179 | */ 3180 | reactions: Reaction[] 3181 | } 3182 | 3183 | /** 3184 | * A reaction left by a user. 3185 | */ 3186 | export type Reaction = { 3187 | /** 3188 | * The user who left the reaction. 3189 | */ 3190 | user: User 3191 | 3192 | emoji: Emoji 3193 | 3194 | /** 3195 | * The UTC ISO 8601 time at which the reaction was left. 3196 | */ 3197 | created_at: string 3198 | } 3199 | 3200 | /** 3201 | * The emoji type of reaction as shortcode (e.g. `:heart:`, `:+1::skin-tone-2:`). The list of 3202 | * accepted emoji shortcodes can be found in [this 3203 | * file](https://raw.githubusercontent.com/missive/emoji-mart/main/packages/emoji-mart-data/sets/14/native.json) 3204 | * under the top-level emojis and aliases fields, with optional skin tone modifiers when 3205 | * applicable. 3206 | */ 3207 | export type Emoji = string 3208 | 3209 | /** 3210 | * A description of a user. 3211 | */ 3212 | export type User = { 3213 | /** 3214 | * Unique stable id of the user. 3215 | */ 3216 | id: string 3217 | 3218 | /** 3219 | * Name of the user. 3220 | */ 3221 | handle: string 3222 | 3223 | /** 3224 | * URL link to the user's profile image. 3225 | */ 3226 | img_url: string 3227 | } 3228 | 3229 | /** 3230 | * Data on the frame a component resides in. 3231 | */ 3232 | export type FrameInfo = { 3233 | /** 3234 | * The ID of the frame node within the file. 3235 | */ 3236 | nodeId?: string 3237 | 3238 | /** 3239 | * The name of the frame node. 3240 | */ 3241 | name?: string 3242 | 3243 | /** 3244 | * The background color of the frame node. 3245 | */ 3246 | backgroundColor?: string 3247 | 3248 | /** 3249 | * The ID of the page containing the frame node. 3250 | */ 3251 | pageId: string 3252 | 3253 | /** 3254 | * The name of the page containing the frame node. 3255 | */ 3256 | pageName: string 3257 | 3258 | /** 3259 | * Deprecated - Use containingComponentSet instead. 3260 | * 3261 | * @deprecated 3262 | */ 3263 | containingStateGroup?: { 3264 | /** 3265 | * The ID of the state group node. 3266 | */ 3267 | nodeId?: string 3268 | 3269 | /** 3270 | * The name of the state group node. 3271 | */ 3272 | name?: string 3273 | } | null 3274 | 3275 | /** 3276 | * The component set node that contains the frame node. 3277 | */ 3278 | containingComponentSet?: { 3279 | /** 3280 | * The ID of the component set node. 3281 | */ 3282 | nodeId?: string 3283 | 3284 | /** 3285 | * The name of the component set node. 3286 | */ 3287 | name?: string 3288 | } | null 3289 | } 3290 | 3291 | /** 3292 | * An arrangement of published UI elements that can be instantiated across figma files. 3293 | */ 3294 | export type PublishedComponent = { 3295 | /** 3296 | * The unique identifier for the component. 3297 | */ 3298 | key: string 3299 | 3300 | /** 3301 | * The unique identifier of the Figma file that contains the component. 3302 | */ 3303 | file_key: string 3304 | 3305 | /** 3306 | * The unique identifier of the component node within the Figma file. 3307 | */ 3308 | node_id: string 3309 | 3310 | /** 3311 | * A URL to a thumbnail image of the component. 3312 | */ 3313 | thumbnail_url?: string 3314 | 3315 | /** 3316 | * The name of the component. 3317 | */ 3318 | name: string 3319 | 3320 | /** 3321 | * The description of the component as entered by the publisher. 3322 | */ 3323 | description: string 3324 | 3325 | /** 3326 | * The UTC ISO 8601 time when the component was created. 3327 | */ 3328 | created_at: string 3329 | 3330 | /** 3331 | * The UTC ISO 8601 time when the component was last updated. 3332 | */ 3333 | updated_at: string 3334 | 3335 | /** 3336 | * The user who last updated the component. 3337 | */ 3338 | user: User 3339 | 3340 | /** 3341 | * The containing frame of the component. 3342 | */ 3343 | containing_frame?: FrameInfo 3344 | } 3345 | 3346 | /** 3347 | * A node containing a set of variants of a component. 3348 | */ 3349 | export type PublishedComponentSet = { 3350 | /** 3351 | * The unique identifier for the component set. 3352 | */ 3353 | key: string 3354 | 3355 | /** 3356 | * The unique identifier of the Figma file that contains the component set. 3357 | */ 3358 | file_key: string 3359 | 3360 | /** 3361 | * The unique identifier of the component set node within the Figma file. 3362 | */ 3363 | node_id: string 3364 | 3365 | /** 3366 | * A URL to a thumbnail image of the component set. 3367 | */ 3368 | thumbnail_url?: string 3369 | 3370 | /** 3371 | * The name of the component set. 3372 | */ 3373 | name: string 3374 | 3375 | /** 3376 | * The description of the component set as entered by the publisher. 3377 | */ 3378 | description: string 3379 | 3380 | /** 3381 | * The UTC ISO 8601 time when the component set was created. 3382 | */ 3383 | created_at: string 3384 | 3385 | /** 3386 | * The UTC ISO 8601 time when the component set was last updated. 3387 | */ 3388 | updated_at: string 3389 | 3390 | /** 3391 | * The user who last updated the component set. 3392 | */ 3393 | user: User 3394 | 3395 | /** 3396 | * The containing frame of the component set. 3397 | */ 3398 | containing_frame?: FrameInfo 3399 | } 3400 | 3401 | /** 3402 | * The type of style 3403 | */ 3404 | export type StyleType = 'FILL' | 'TEXT' | 'EFFECT' | 'GRID' 3405 | 3406 | /** 3407 | * A set of published properties that can be applied to nodes. 3408 | */ 3409 | export type PublishedStyle = { 3410 | /** 3411 | * The unique identifier for the style 3412 | */ 3413 | key: string 3414 | 3415 | /** 3416 | * The unique identifier of the Figma file that contains the style. 3417 | */ 3418 | file_key: string 3419 | 3420 | /** 3421 | * ID of the style node within the figma file 3422 | */ 3423 | node_id: string 3424 | 3425 | style_type: StyleType 3426 | 3427 | /** 3428 | * A URL to a thumbnail image of the style. 3429 | */ 3430 | thumbnail_url?: string 3431 | 3432 | /** 3433 | * The name of the style. 3434 | */ 3435 | name: string 3436 | 3437 | /** 3438 | * The description of the style as entered by the publisher. 3439 | */ 3440 | description: string 3441 | 3442 | /** 3443 | * The UTC ISO 8601 time when the style was created. 3444 | */ 3445 | created_at: string 3446 | 3447 | /** 3448 | * The UTC ISO 8601 time when the style was last updated. 3449 | */ 3450 | updated_at: string 3451 | 3452 | /** 3453 | * The user who last updated the style. 3454 | */ 3455 | user: User 3456 | 3457 | /** 3458 | * A user specified order number by which the style can be sorted. 3459 | */ 3460 | sort_position: string 3461 | } 3462 | 3463 | /** 3464 | * A Project can be identified by both the Project name, and the Project ID. 3465 | */ 3466 | export type Project = { 3467 | /** 3468 | * The ID of the project. 3469 | */ 3470 | id: string 3471 | 3472 | /** 3473 | * The name of the project. 3474 | */ 3475 | name: string 3476 | } 3477 | 3478 | /** 3479 | * A version of a file 3480 | */ 3481 | export type Version = { 3482 | /** 3483 | * Unique identifier for version 3484 | */ 3485 | id: string 3486 | 3487 | /** 3488 | * The UTC ISO 8601 time at which the version was created 3489 | */ 3490 | created_at: string 3491 | 3492 | /** 3493 | * The label given to the version in the editor 3494 | */ 3495 | label: string | null 3496 | 3497 | /** 3498 | * The description of the version as entered in the editor 3499 | */ 3500 | description: string | null 3501 | 3502 | /** 3503 | * The user that created the version 3504 | */ 3505 | user: User 3506 | 3507 | /** 3508 | * A URL to a thumbnail image of the file version. 3509 | */ 3510 | thumbnail_url?: string 3511 | } 3512 | 3513 | /** 3514 | * A description of an HTTP webhook (from Figma back to your application) 3515 | */ 3516 | export type WebhookV2 = { 3517 | /** 3518 | * The ID of the webhook 3519 | */ 3520 | id: string 3521 | 3522 | /** 3523 | * The event this webhook triggers on 3524 | */ 3525 | event_type: WebhookV2Event 3526 | 3527 | /** 3528 | * The team id you are subscribed to for updates. This is deprecated, use context and context_id 3529 | * instead 3530 | * 3531 | * @deprecated 3532 | */ 3533 | team_id: string 3534 | 3535 | /** 3536 | * The type of context this webhook is attached to. The value will be "PROJECT", "TEAM", or "FILE" 3537 | */ 3538 | context: string 3539 | 3540 | /** 3541 | * The ID of the context this webhook is attached to 3542 | */ 3543 | context_id: string 3544 | 3545 | /** 3546 | * The plan API ID of the team or organization where this webhook was created 3547 | */ 3548 | plan_api_id: string 3549 | 3550 | /** 3551 | * The current status of the webhook 3552 | */ 3553 | status: WebhookV2Status 3554 | 3555 | /** 3556 | * The client ID of the OAuth application that registered this webhook, if any 3557 | */ 3558 | client_id: string | null 3559 | 3560 | /** 3561 | * The passcode that will be passed back to the webhook endpoint. For security, when using the GET 3562 | * endpoints, the value is an empty string 3563 | */ 3564 | passcode: string 3565 | 3566 | /** 3567 | * The endpoint that will be hit when the webhook is triggered 3568 | */ 3569 | endpoint: string 3570 | 3571 | /** 3572 | * Optional user-provided description or name for the webhook. This is provided to help make 3573 | * maintaining a number of webhooks more convenient. Max length 140 characters. 3574 | */ 3575 | description: string | null 3576 | } 3577 | 3578 | /** 3579 | * An enum representing the possible events that a webhook can subscribe to 3580 | */ 3581 | export type WebhookV2Event = 3582 | | 'PING' 3583 | | 'FILE_UPDATE' 3584 | | 'FILE_VERSION_UPDATE' 3585 | | 'FILE_DELETE' 3586 | | 'LIBRARY_PUBLISH' 3587 | | 'FILE_COMMENT' 3588 | | 'DEV_MODE_STATUS_UPDATE' 3589 | 3590 | /** 3591 | * An enum representing the possible statuses you can set a webhook to: 3592 | * 3593 | * - `ACTIVE`: The webhook is healthy and receive all events 3594 | * - `PAUSED`: The webhook is paused and will not receive any events 3595 | */ 3596 | export type WebhookV2Status = 'ACTIVE' | 'PAUSED' 3597 | 3598 | /** 3599 | * Information regarding the most recent interactions sent to a webhook endpoint 3600 | */ 3601 | export type WebhookV2Request = { 3602 | /** 3603 | * The ID of the webhook the requests were sent to 3604 | */ 3605 | webhook_id: string 3606 | 3607 | request_info: WebhookV2RequestInfo 3608 | 3609 | response_info: WebhookV2ResponseInfo 3610 | 3611 | /** 3612 | * Error message for this request. NULL if no error occurred 3613 | */ 3614 | error_msg: string | null 3615 | } 3616 | 3617 | /** 3618 | * Information regarding the request sent to a webhook endpoint 3619 | */ 3620 | export type WebhookV2RequestInfo = { 3621 | /** 3622 | * The ID of the webhook 3623 | */ 3624 | id: string 3625 | 3626 | /** 3627 | * The actual endpoint the request was sent to 3628 | */ 3629 | endpoint: string 3630 | 3631 | /** 3632 | * The contents of the request that was sent to the endpoint 3633 | */ 3634 | payload: object 3635 | 3636 | /** 3637 | * UTC ISO 8601 timestamp of when the request was sent 3638 | */ 3639 | sent_at: string 3640 | } 3641 | 3642 | /** 3643 | * Information regarding the reply sent back from a webhook endpoint 3644 | */ 3645 | export type WebhookV2ResponseInfo = object | null 3646 | 3647 | /** 3648 | * An object representing the library item information in the payload of the `LIBRARY_PUBLISH` event 3649 | */ 3650 | export type LibraryItemData = { 3651 | /** 3652 | * Unique identifier for the library item 3653 | */ 3654 | key: string 3655 | 3656 | /** 3657 | * Name of the library item 3658 | */ 3659 | name: string 3660 | } 3661 | 3662 | /** 3663 | * An object representing a fragment of a comment left by a user, used in the payload of the 3664 | * `FILE_COMMENT` event. Note only ONE of the fields below will be set 3665 | */ 3666 | export type CommentFragment = { 3667 | /** 3668 | * Comment text that is set if a fragment is text based 3669 | */ 3670 | text?: string 3671 | 3672 | /** 3673 | * User id that is set if a fragment refers to a user mention 3674 | */ 3675 | mention?: string 3676 | } 3677 | 3678 | export type WebhookBasePayload = { 3679 | /** 3680 | * The passcode specified when the webhook was created, should match what was initially provided 3681 | */ 3682 | passcode: string 3683 | 3684 | /** 3685 | * UTC ISO 8601 timestamp of when the event was triggered. 3686 | */ 3687 | timestamp: string 3688 | 3689 | /** 3690 | * The id of the webhook that caused the callback 3691 | */ 3692 | webhook_id: string 3693 | } 3694 | 3695 | export type WebhookPingPayload = WebhookBasePayload & { event_type: 'PING' } 3696 | 3697 | export type WebhookFileUpdatePayload = WebhookBasePayload & { 3698 | event_type: 'FILE_UPDATE' 3699 | 3700 | /** 3701 | * The key of the file that was updated 3702 | */ 3703 | file_key: string 3704 | 3705 | /** 3706 | * The name of the file that was updated 3707 | */ 3708 | file_name: string 3709 | } 3710 | 3711 | export type WebhookFileDeletePayload = WebhookBasePayload & { 3712 | event_type: 'FILE_DELETE' 3713 | 3714 | /** 3715 | * The key of the file that was deleted 3716 | */ 3717 | file_key: string 3718 | 3719 | /** 3720 | * The name of the file that was deleted 3721 | */ 3722 | file_name: string 3723 | 3724 | /** 3725 | * The user that deleted the file and triggered this event 3726 | */ 3727 | triggered_by: User 3728 | } 3729 | 3730 | export type WebhookFileVersionUpdatePayload = WebhookBasePayload & { 3731 | event_type: 'FILE_VERSION_UPDATE' 3732 | 3733 | /** 3734 | * UTC ISO 8601 timestamp of when the version was created 3735 | */ 3736 | created_at: string 3737 | 3738 | /** 3739 | * Description of the version in the version history 3740 | */ 3741 | description?: string 3742 | 3743 | /** 3744 | * The key of the file that was updated 3745 | */ 3746 | file_key: string 3747 | 3748 | /** 3749 | * The name of the file that was updated 3750 | */ 3751 | file_name: string 3752 | 3753 | /** 3754 | * The user that created the named version and triggered this event 3755 | */ 3756 | triggered_by: User 3757 | 3758 | /** 3759 | * ID of the published version 3760 | */ 3761 | version_id: string 3762 | } 3763 | 3764 | export type WebhookLibraryPublishPayload = WebhookBasePayload & { 3765 | event_type: 'LIBRARY_PUBLISH' 3766 | 3767 | /** 3768 | * Components that were created by the library publish 3769 | */ 3770 | created_components: LibraryItemData[] 3771 | 3772 | /** 3773 | * Styles that were created by the library publish 3774 | */ 3775 | created_styles: LibraryItemData[] 3776 | 3777 | /** 3778 | * Variables that were created by the library publish 3779 | */ 3780 | created_variables: LibraryItemData[] 3781 | 3782 | /** 3783 | * Components that were modified by the library publish 3784 | */ 3785 | modified_components: LibraryItemData[] 3786 | 3787 | /** 3788 | * Styles that were modified by the library publish 3789 | */ 3790 | modified_styles: LibraryItemData[] 3791 | 3792 | /** 3793 | * Variables that were modified by the library publish 3794 | */ 3795 | modified_variables: LibraryItemData[] 3796 | 3797 | /** 3798 | * Components that were deleted by the library publish 3799 | */ 3800 | deleted_components: LibraryItemData[] 3801 | 3802 | /** 3803 | * Styles that were deleted by the library publish 3804 | */ 3805 | deleted_styles: LibraryItemData[] 3806 | 3807 | /** 3808 | * Variables that were deleted by the library publish 3809 | */ 3810 | deleted_variables: LibraryItemData[] 3811 | 3812 | /** 3813 | * Description of the library publish 3814 | */ 3815 | description?: string 3816 | 3817 | /** 3818 | * The key of the file that was published 3819 | */ 3820 | file_key: string 3821 | 3822 | /** 3823 | * The name of the file that was published 3824 | */ 3825 | file_name: string 3826 | 3827 | /** 3828 | * The library item that was published 3829 | */ 3830 | library_item: LibraryItemData 3831 | 3832 | /** 3833 | * The user that published the library and triggered this event 3834 | */ 3835 | triggered_by: User 3836 | } 3837 | 3838 | export type WebhookFileCommentPayload = WebhookBasePayload & { 3839 | event_type: 'FILE_COMMENT' 3840 | 3841 | /** 3842 | * Contents of the comment itself 3843 | */ 3844 | comment: CommentFragment[] 3845 | 3846 | /** 3847 | * Unique identifier for comment 3848 | */ 3849 | comment_id: string 3850 | 3851 | /** 3852 | * The UTC ISO 8601 time at which the comment was left 3853 | */ 3854 | created_at: string 3855 | 3856 | /** 3857 | * The key of the file that was commented on 3858 | */ 3859 | file_key: string 3860 | 3861 | /** 3862 | * The name of the file that was commented on 3863 | */ 3864 | file_name: string 3865 | 3866 | /** 3867 | * Users that were mentioned in the comment 3868 | */ 3869 | mentions?: User[] 3870 | 3871 | /** 3872 | * The user that made the comment and triggered this event 3873 | */ 3874 | triggered_by: User 3875 | } 3876 | 3877 | export type WebhookDevModeStatusUpdatePayload = WebhookBasePayload & { 3878 | event_type: 'DEV_MODE_STATUS_UPDATE' 3879 | 3880 | /** 3881 | * The key of the file that was updated 3882 | */ 3883 | file_key: string 3884 | 3885 | /** 3886 | * The name of the file that was updated 3887 | */ 3888 | file_name: string 3889 | 3890 | /** 3891 | * The id of the node where the Dev Mode status changed. For example, "43:2" 3892 | */ 3893 | node_id: string 3894 | 3895 | /** 3896 | * An array of related links that have been applied to the layer in the file 3897 | */ 3898 | related_links: DevResource[] 3899 | 3900 | /** 3901 | * The Dev Mode status. Either "NONE", "READY_FOR_DEV", or "COMPLETED" 3902 | */ 3903 | status: string 3904 | 3905 | /** 3906 | * The user that made the status change and triggered the event 3907 | */ 3908 | triggered_by: User 3909 | } 3910 | 3911 | /** 3912 | * A Figma user 3913 | */ 3914 | export type ActivityLogUserEntity = { 3915 | /** 3916 | * The type of entity. 3917 | */ 3918 | type: 'user' 3919 | 3920 | /** 3921 | * Unique stable id of the user. 3922 | */ 3923 | id: string 3924 | 3925 | /** 3926 | * Name of the user. 3927 | */ 3928 | name: string 3929 | 3930 | /** 3931 | * Email associated with the user's account. 3932 | */ 3933 | email: string 3934 | } 3935 | 3936 | /** 3937 | * A Figma Design or FigJam file 3938 | */ 3939 | export type ActivityLogFileEntity = { 3940 | /** 3941 | * The type of entity. 3942 | */ 3943 | type: 'file' 3944 | 3945 | /** 3946 | * Unique identifier of the file. 3947 | */ 3948 | key: string 3949 | 3950 | /** 3951 | * Name of the file. 3952 | */ 3953 | name: string 3954 | 3955 | /** 3956 | * Indicates if the object is a file on Figma Design or FigJam. 3957 | */ 3958 | editor_type: 'figma' | 'figjam' 3959 | 3960 | /** 3961 | * Access policy for users who have the link to the file. 3962 | */ 3963 | link_access: LinkAccess 3964 | 3965 | /** 3966 | * Access policy for users who have the link to the file's prototype. 3967 | */ 3968 | proto_link_access: 'view' | 'org_view' | 'inherit' 3969 | } 3970 | 3971 | /** 3972 | * A file branch that diverges from and can be merged back into the main file 3973 | */ 3974 | export type ActivityLogFileRepoEntity = { 3975 | /** 3976 | * The type of entity. 3977 | */ 3978 | type: 'file_repo' 3979 | 3980 | /** 3981 | * Unique identifier of the file branch. 3982 | */ 3983 | id: string 3984 | 3985 | /** 3986 | * Name of the file. 3987 | */ 3988 | name: string 3989 | 3990 | /** 3991 | * Key of the main file. 3992 | */ 3993 | main_file_key: string 3994 | } 3995 | 3996 | /** 3997 | * A project that a collection of Figma files are grouped under 3998 | */ 3999 | export type ActivityLogProjectEntity = { 4000 | /** 4001 | * The type of entity. 4002 | */ 4003 | type: 'project' 4004 | 4005 | /** 4006 | * Unique identifier of the project. 4007 | */ 4008 | id: string 4009 | 4010 | /** 4011 | * Name of the project. 4012 | */ 4013 | name: string 4014 | } 4015 | 4016 | /** 4017 | * A Figma team that contains multiple users and projects 4018 | */ 4019 | export type ActivityLogTeamEntity = { 4020 | /** 4021 | * The type of entity. 4022 | */ 4023 | type: 'team' 4024 | 4025 | /** 4026 | * Unique identifier of the team. 4027 | */ 4028 | id: string 4029 | 4030 | /** 4031 | * Name of the team. 4032 | */ 4033 | name: string 4034 | } 4035 | 4036 | /** 4037 | * Part of the organizational hierarchy of managing files and users within Figma, only available on 4038 | * the Enterprise Plan 4039 | */ 4040 | export type ActivityLogWorkspaceEntity = { 4041 | /** 4042 | * The type of entity. 4043 | */ 4044 | type: 'workspace' 4045 | 4046 | /** 4047 | * Unique identifier of the workspace. 4048 | */ 4049 | id: string 4050 | 4051 | /** 4052 | * Name of the workspace. 4053 | */ 4054 | name: string 4055 | } 4056 | 4057 | /** 4058 | * A Figma organization 4059 | */ 4060 | export type ActivityLogOrgEntity = { 4061 | /** 4062 | * The type of entity. 4063 | */ 4064 | type: 'org' 4065 | 4066 | /** 4067 | * Unique identifier of the organization. 4068 | */ 4069 | id: string 4070 | 4071 | /** 4072 | * Name of the organization. 4073 | */ 4074 | name: string 4075 | } 4076 | 4077 | /** 4078 | * A Figma plugin 4079 | */ 4080 | export type ActivityLogPluginEntity = { 4081 | /** 4082 | * The type of entity. 4083 | */ 4084 | type: 'plugin' 4085 | 4086 | /** 4087 | * Unique identifier of the plugin. 4088 | */ 4089 | id: string 4090 | 4091 | /** 4092 | * Name of the plugin. 4093 | */ 4094 | name: string 4095 | 4096 | /** 4097 | * Indicates if the object is a plugin is available on Figma Design or FigJam. 4098 | */ 4099 | editor_type: 'figma' | 'figjam' 4100 | } 4101 | 4102 | /** 4103 | * A Figma widget 4104 | */ 4105 | export type ActivityLogWidgetEntity = { 4106 | /** 4107 | * The type of entity. 4108 | */ 4109 | type: 'widget' 4110 | 4111 | /** 4112 | * Unique identifier of the widget. 4113 | */ 4114 | id: string 4115 | 4116 | /** 4117 | * Name of the widget. 4118 | */ 4119 | name: string 4120 | 4121 | /** 4122 | * Indicates if the object is a widget available on Figma Design or FigJam. 4123 | */ 4124 | editor_type: 'figma' | 'figjam' 4125 | } 4126 | 4127 | /** 4128 | * An event returned by the Activity Logs API. 4129 | */ 4130 | export type ActivityLog = { 4131 | /** 4132 | * The ID of the event. 4133 | */ 4134 | id: string 4135 | 4136 | /** 4137 | * The timestamp of the event in seconds since the Unix epoch. 4138 | */ 4139 | timestamp: number 4140 | 4141 | /** 4142 | * The user who performed the action. 4143 | */ 4144 | actor: object | null 4145 | 4146 | /** 4147 | * The task or activity the actor performed. 4148 | */ 4149 | action: { 4150 | /** 4151 | * The type of the action. 4152 | */ 4153 | type: string 4154 | 4155 | /** 4156 | * Metadata of the action. Each action type supports its own metadata attributes. 4157 | */ 4158 | details: object | null 4159 | } 4160 | 4161 | /** 4162 | * The resource the actor took the action on. It can be a user, file, project or other resource 4163 | * types. 4164 | */ 4165 | entity: 4166 | | ActivityLogUserEntity 4167 | | ActivityLogFileEntity 4168 | | ActivityLogFileRepoEntity 4169 | | ActivityLogProjectEntity 4170 | | ActivityLogTeamEntity 4171 | | ActivityLogWorkspaceEntity 4172 | | ActivityLogOrgEntity 4173 | | ActivityLogPluginEntity 4174 | | ActivityLogWidgetEntity 4175 | 4176 | /** 4177 | * Contextual information about the event. 4178 | */ 4179 | context: { 4180 | /** 4181 | * The third-party application that triggered the event, if applicable. 4182 | */ 4183 | client_name: string | null 4184 | 4185 | /** 4186 | * The IP address from of the client that sent the event request. 4187 | */ 4188 | ip_address: string 4189 | 4190 | /** 4191 | * If Figma's Support team triggered the event. This is either true or false. 4192 | */ 4193 | is_figma_support_team_action: boolean 4194 | 4195 | /** 4196 | * The id of the organization where the event took place. 4197 | */ 4198 | org_id: string 4199 | 4200 | /** 4201 | * The id of the team where the event took place -- if this took place in a specific team. 4202 | */ 4203 | team_id: string | null 4204 | } 4205 | } 4206 | 4207 | /** 4208 | * An object describing the user's payment status. 4209 | */ 4210 | export type PaymentStatus = { 4211 | /** 4212 | * The current payment status of the user on the resource, as a string enum: 4213 | * 4214 | * - `UNPAID`: user has not paid for the resource 4215 | * - `PAID`: user has an active purchase on the resource 4216 | * - `TRIAL`: user is in the trial period for a subscription resource 4217 | */ 4218 | type?: 'UNPAID' | 'PAID' | 'TRIAL' 4219 | } 4220 | 4221 | /** 4222 | * An object describing a user's payment information for a plugin, widget, or Community file. 4223 | */ 4224 | export type PaymentInformation = { 4225 | /** 4226 | * The ID of the user whose payment information was queried. Can be used to verify the validity of a 4227 | * response. 4228 | */ 4229 | user_id: string 4230 | 4231 | /** 4232 | * The ID of the plugin, widget, or Community file that was queried. Can be used to verify the 4233 | * validity of a response. 4234 | */ 4235 | resource_id: string 4236 | 4237 | /** 4238 | * The type of the resource. 4239 | */ 4240 | resource_type: 'PLUGIN' | 'WIDGET' | 'COMMUNITY_FILE' 4241 | 4242 | payment_status: PaymentStatus 4243 | 4244 | /** 4245 | * The UTC ISO 8601 timestamp indicating when the user purchased the resource. No value is given if 4246 | * the user has never purchased the resource. 4247 | * 4248 | * Note that a value will still be returned if the user had purchased the resource, but no longer 4249 | * has active access to it (e.g. purchase refunded, subscription ended). 4250 | */ 4251 | date_of_purchase?: string 4252 | } 4253 | 4254 | /** 4255 | * Scopes allow a variable to be shown or hidden in the variable picker for various fields. This 4256 | * declutters the Figma UI if you have a large number of variables. Variable scopes are currently 4257 | * supported on `FLOAT`, `STRING`, and `COLOR` variables. 4258 | * 4259 | * `ALL_SCOPES` is a special scope that means that the variable will be shown in the variable picker 4260 | * for all variable fields. If `ALL_SCOPES` is set, no additional scopes can be set. 4261 | * 4262 | * `ALL_FILLS` is a special scope that means that the variable will be shown in the variable picker 4263 | * for all fill fields. If `ALL_FILLS` is set, no additional fill scopes can be set. 4264 | * 4265 | * Valid scopes for `FLOAT` variables: 4266 | * 4267 | * - `ALL_SCOPES` 4268 | * - `TEXT_CONTENT` 4269 | * - `WIDTH_HEIGHT` 4270 | * - `GAP` 4271 | * - `STROKE_FLOAT` 4272 | * - `EFFECT_FLOAT` 4273 | * - `OPACITY` 4274 | * - `FONT_WEIGHT` 4275 | * - `FONT_SIZE` 4276 | * - `LINE_HEIGHT` 4277 | * - `LETTER_SPACING` 4278 | * - `PARAGRAPH_SPACING` 4279 | * - `PARAGRAPH_INDENT` 4280 | * 4281 | * Valid scopes for `STRING` variables: 4282 | * 4283 | * - `ALL_SCOPES` 4284 | * - `TEXT_CONTENT` 4285 | * - `FONT_FAMILY` 4286 | * - `FONT_STYLE` 4287 | * 4288 | * Valid scopes for `COLOR` variables: 4289 | * 4290 | * - `ALL_SCOPES` 4291 | * - `ALL_FILLS` 4292 | * - `FRAME_FILL` 4293 | * - `SHAPE_FILL` 4294 | * - `TEXT_FILL` 4295 | * - `STROKE_COLOR` 4296 | * - `EFFECT_COLOR` 4297 | */ 4298 | export type VariableScope = 4299 | | 'ALL_SCOPES' 4300 | | 'TEXT_CONTENT' 4301 | | 'CORNER_RADIUS' 4302 | | 'WIDTH_HEIGHT' 4303 | | 'GAP' 4304 | | 'ALL_FILLS' 4305 | | 'FRAME_FILL' 4306 | | 'SHAPE_FILL' 4307 | | 'TEXT_FILL' 4308 | | 'STROKE_COLOR' 4309 | | 'STROKE_FLOAT' 4310 | | 'EFFECT_FLOAT' 4311 | | 'EFFECT_COLOR' 4312 | | 'OPACITY' 4313 | | 'FONT_FAMILY' 4314 | | 'FONT_STYLE' 4315 | | 'FONT_WEIGHT' 4316 | | 'FONT_SIZE' 4317 | | 'LINE_HEIGHT' 4318 | | 'LETTER_SPACING' 4319 | | 'PARAGRAPH_SPACING' 4320 | | 'PARAGRAPH_INDENT' 4321 | | 'FONT_VARIATIONS' 4322 | 4323 | /** 4324 | * An object containing platform-specific code syntax definitions for a variable. All platforms are 4325 | * optional. 4326 | */ 4327 | export type VariableCodeSyntax = { 4328 | WEB?: string 4329 | 4330 | ANDROID?: string 4331 | 4332 | iOS?: string 4333 | } 4334 | 4335 | /** 4336 | * A grouping of related Variable objects each with the same modes. 4337 | */ 4338 | export type LocalVariableCollection = { 4339 | /** 4340 | * The unique identifier of this variable collection. 4341 | */ 4342 | id: string 4343 | 4344 | /** 4345 | * The name of this variable collection. 4346 | */ 4347 | name: string 4348 | 4349 | /** 4350 | * The key of this variable collection. 4351 | */ 4352 | key: string 4353 | 4354 | /** 4355 | * The modes of this variable collection. 4356 | */ 4357 | modes: { 4358 | /** 4359 | * The unique identifier of this mode. 4360 | */ 4361 | modeId: string 4362 | 4363 | /** 4364 | * The name of this mode. 4365 | */ 4366 | name: string 4367 | }[] 4368 | 4369 | /** 4370 | * The id of the default mode. 4371 | */ 4372 | defaultModeId: string 4373 | 4374 | /** 4375 | * Whether this variable collection is remote. 4376 | */ 4377 | remote: boolean 4378 | 4379 | /** 4380 | * Whether this variable collection is hidden when publishing the current file as a library. 4381 | */ 4382 | hiddenFromPublishing: boolean 4383 | 4384 | /** 4385 | * The ids of the variables in the collection. Note that the order of these variables is roughly the 4386 | * same as what is shown in Figma Design, however it does not account for groups. As a result, the 4387 | * order of these variables may not exactly reflect the exact ordering and grouping shown in the 4388 | * authoring UI. 4389 | */ 4390 | variableIds: string[] 4391 | } 4392 | 4393 | /** 4394 | * A Variable is a single design token that defines values for each of the modes in its 4395 | * VariableCollection. These values can be applied to various kinds of design properties. 4396 | */ 4397 | export type LocalVariable = { 4398 | /** 4399 | * The unique identifier of this variable. 4400 | */ 4401 | id: string 4402 | 4403 | /** 4404 | * The name of this variable. 4405 | */ 4406 | name: string 4407 | 4408 | /** 4409 | * The key of this variable. 4410 | */ 4411 | key: string 4412 | 4413 | /** 4414 | * The id of the variable collection that contains this variable. 4415 | */ 4416 | variableCollectionId: string 4417 | 4418 | /** 4419 | * The resolved type of the variable. 4420 | */ 4421 | resolvedType: VariableResolvedDataType 4422 | 4423 | /** 4424 | * The values for each mode of this variable. 4425 | */ 4426 | valuesByMode: { [key: string]: boolean | number | string | RGBA | VariableAlias } 4427 | 4428 | /** 4429 | * Whether this variable is remote. 4430 | */ 4431 | remote: boolean 4432 | 4433 | /** 4434 | * The description of this variable. 4435 | */ 4436 | description: string 4437 | 4438 | /** 4439 | * Whether this variable is hidden when publishing the current file as a library. 4440 | * 4441 | * If the parent `VariableCollection` is marked as `hiddenFromPublishing`, then this variable will 4442 | * also be hidden from publishing via the UI. `hiddenFromPublishing` is independently toggled for a 4443 | * variable and collection. However, both must be true for a given variable to be publishable. 4444 | */ 4445 | hiddenFromPublishing: boolean 4446 | 4447 | /** 4448 | * An array of scopes in the UI where this variable is shown. Setting this property will show/hide 4449 | * this variable in the variable picker UI for different fields. 4450 | * 4451 | * Setting scopes for a variable does not prevent that variable from being bound in other scopes 4452 | * (for example, via the Plugin API). This only limits the variables that are shown in pickers 4453 | * within the Figma UI. 4454 | */ 4455 | scopes: VariableScope[] 4456 | 4457 | codeSyntax: VariableCodeSyntax 4458 | 4459 | /** 4460 | * Indicates that the variable was deleted in the editor, but the document may still contain 4461 | * references to the variable. References to the variable may exist through bound values or variable 4462 | * aliases. 4463 | */ 4464 | deletedButReferenced?: boolean 4465 | } 4466 | 4467 | /** 4468 | * A grouping of related Variable objects each with the same modes. 4469 | */ 4470 | export type PublishedVariableCollection = { 4471 | /** 4472 | * The unique identifier of this variable collection. 4473 | */ 4474 | id: string 4475 | 4476 | /** 4477 | * The ID of the variable collection that is used by subscribing files. This ID changes every time 4478 | * the variable collection is modified and published. 4479 | */ 4480 | subscribed_id: string 4481 | 4482 | /** 4483 | * The name of this variable collection. 4484 | */ 4485 | name: string 4486 | 4487 | /** 4488 | * The key of this variable collection. 4489 | */ 4490 | key: string 4491 | 4492 | /** 4493 | * The UTC ISO 8601 time at which the variable collection was last updated. 4494 | * 4495 | * This timestamp will change any time a variable in the collection is changed. 4496 | */ 4497 | updatedAt: string 4498 | } 4499 | 4500 | /** 4501 | * A Variable is a single design token that defines values for each of the modes in its 4502 | * VariableCollection. These values can be applied to various kinds of design properties. 4503 | */ 4504 | export type PublishedVariable = { 4505 | /** 4506 | * The unique identifier of this variable. 4507 | */ 4508 | id: string 4509 | 4510 | /** 4511 | * The ID of the variable that is used by subscribing files. This ID changes every time the variable 4512 | * is modified and published. 4513 | */ 4514 | subscribed_id: string 4515 | 4516 | /** 4517 | * The name of this variable. 4518 | */ 4519 | name: string 4520 | 4521 | /** 4522 | * The key of this variable. 4523 | */ 4524 | key: string 4525 | 4526 | /** 4527 | * The id of the variable collection that contains this variable. 4528 | */ 4529 | variableCollectionId: string 4530 | 4531 | /** 4532 | * The resolved type of the variable. 4533 | */ 4534 | resolvedDataType: VariableResolvedDataType 4535 | 4536 | /** 4537 | * The UTC ISO 8601 time at which the variable was last updated. 4538 | */ 4539 | updatedAt: string 4540 | } 4541 | 4542 | /** 4543 | * An object that contains details about creating a `VariableCollection`. 4544 | */ 4545 | export type VariableCollectionCreate = { 4546 | /** 4547 | * The action to perform for the variable collection. 4548 | */ 4549 | action: 'CREATE' 4550 | 4551 | /** 4552 | * A temporary id for this variable collection. 4553 | */ 4554 | id?: string 4555 | 4556 | /** 4557 | * The name of this variable collection. 4558 | */ 4559 | name: string 4560 | 4561 | /** 4562 | * The initial mode refers to the mode that is created by default. You can set a temporary id here, 4563 | * in order to reference this mode later in this request. 4564 | */ 4565 | initialModeId?: string 4566 | 4567 | /** 4568 | * Whether this variable collection is hidden when publishing the current file as a library. 4569 | */ 4570 | hiddenFromPublishing?: boolean 4571 | } 4572 | 4573 | /** 4574 | * An object that contains details about updating a `VariableCollection`. 4575 | */ 4576 | export type VariableCollectionUpdate = { 4577 | /** 4578 | * The action to perform for the variable collection. 4579 | */ 4580 | action: 'UPDATE' 4581 | 4582 | /** 4583 | * The id of the variable collection to update. 4584 | */ 4585 | id: string 4586 | 4587 | /** 4588 | * The name of this variable collection. 4589 | */ 4590 | name?: string 4591 | 4592 | /** 4593 | * Whether this variable collection is hidden when publishing the current file as a library. 4594 | */ 4595 | hiddenFromPublishing?: boolean 4596 | } 4597 | 4598 | /** 4599 | * An object that contains details about deleting a `VariableCollection`. 4600 | */ 4601 | export type VariableCollectionDelete = { 4602 | /** 4603 | * The action to perform for the variable collection. 4604 | */ 4605 | action: 'DELETE' 4606 | 4607 | /** 4608 | * The id of the variable collection to delete. 4609 | */ 4610 | id: string 4611 | } 4612 | 4613 | export type VariableCollectionChange = 4614 | | VariableCollectionCreate 4615 | | VariableCollectionUpdate 4616 | | VariableCollectionDelete 4617 | 4618 | /** 4619 | * An object that contains details about creating a `VariableMode`. 4620 | */ 4621 | export type VariableModeCreate = { 4622 | /** 4623 | * The action to perform for the variable mode. 4624 | */ 4625 | action: 'CREATE' 4626 | 4627 | /** 4628 | * A temporary id for this variable mode. 4629 | */ 4630 | id?: string 4631 | 4632 | /** 4633 | * The name of this variable mode. 4634 | */ 4635 | name: string 4636 | 4637 | /** 4638 | * The variable collection that will contain the mode. You can use the temporary id of a variable 4639 | * collection. 4640 | */ 4641 | variableCollectionId: string 4642 | } 4643 | 4644 | /** 4645 | * An object that contains details about updating a `VariableMode`. 4646 | */ 4647 | export type VariableModeUpdate = { 4648 | /** 4649 | * The action to perform for the variable mode. 4650 | */ 4651 | action: 'UPDATE' 4652 | 4653 | /** 4654 | * The id of the variable mode to update. 4655 | */ 4656 | id: string 4657 | 4658 | /** 4659 | * The name of this variable mode. 4660 | */ 4661 | name?: string 4662 | 4663 | /** 4664 | * The variable collection that contains the mode. 4665 | */ 4666 | variableCollectionId: string 4667 | } 4668 | 4669 | /** 4670 | * An object that contains details about deleting a `VariableMode`. 4671 | */ 4672 | export type VariableModeDelete = { 4673 | /** 4674 | * The action to perform for the variable mode. 4675 | */ 4676 | action: 'DELETE' 4677 | 4678 | /** 4679 | * The id of the variable mode to delete. 4680 | */ 4681 | id: string 4682 | } 4683 | 4684 | export type VariableModeChange = VariableModeCreate | VariableModeUpdate | VariableModeDelete 4685 | 4686 | /** 4687 | * An object that contains details about creating a `Variable`. 4688 | */ 4689 | export type VariableCreate = { 4690 | /** 4691 | * The action to perform for the variable. 4692 | */ 4693 | action: 'CREATE' 4694 | 4695 | /** 4696 | * A temporary id for this variable. 4697 | */ 4698 | id?: string 4699 | 4700 | /** 4701 | * The name of this variable. 4702 | */ 4703 | name: string 4704 | 4705 | /** 4706 | * The variable collection that will contain the variable. You can use the temporary id of a 4707 | * variable collection. 4708 | */ 4709 | variableCollectionId: string 4710 | 4711 | /** 4712 | * The resolved type of the variable. 4713 | */ 4714 | resolvedType: VariableResolvedDataType 4715 | 4716 | /** 4717 | * The description of this variable. 4718 | */ 4719 | description?: string 4720 | 4721 | /** 4722 | * Whether this variable is hidden when publishing the current file as a library. 4723 | */ 4724 | hiddenFromPublishing?: boolean 4725 | 4726 | /** 4727 | * An array of scopes in the UI where this variable is shown. Setting this property will show/hide 4728 | * this variable in the variable picker UI for different fields. 4729 | */ 4730 | scopes?: VariableScope[] 4731 | 4732 | codeSyntax?: VariableCodeSyntax 4733 | } 4734 | 4735 | /** 4736 | * An object that contains details about updating a `Variable`. 4737 | */ 4738 | export type VariableUpdate = { 4739 | /** 4740 | * The action to perform for the variable. 4741 | */ 4742 | action: 'UPDATE' 4743 | 4744 | /** 4745 | * The id of the variable to update. 4746 | */ 4747 | id: string 4748 | 4749 | /** 4750 | * The name of this variable. 4751 | */ 4752 | name?: string 4753 | 4754 | /** 4755 | * The description of this variable. 4756 | */ 4757 | description?: string 4758 | 4759 | /** 4760 | * Whether this variable is hidden when publishing the current file as a library. 4761 | */ 4762 | hiddenFromPublishing?: boolean 4763 | 4764 | /** 4765 | * An array of scopes in the UI where this variable is shown. Setting this property will show/hide 4766 | * this variable in the variable picker UI for different fields. 4767 | */ 4768 | scopes?: VariableScope[] 4769 | 4770 | codeSyntax?: VariableCodeSyntax 4771 | } 4772 | 4773 | /** 4774 | * An object that contains details about deleting a `Variable`. 4775 | */ 4776 | export type VariableDelete = { 4777 | /** 4778 | * The action to perform for the variable. 4779 | */ 4780 | action: 'DELETE' 4781 | 4782 | /** 4783 | * The id of the variable to delete. 4784 | */ 4785 | id: string 4786 | } 4787 | 4788 | export type VariableChange = VariableCreate | VariableUpdate | VariableDelete 4789 | 4790 | /** 4791 | * An object that represents a value for a given mode of a variable. All properties are required. 4792 | */ 4793 | export type VariableModeValue = { 4794 | /** 4795 | * The target variable. You can use the temporary id of a variable. 4796 | */ 4797 | variableId: string 4798 | 4799 | /** 4800 | * Must correspond to a mode in the variable collection that contains the target variable. 4801 | */ 4802 | modeId: string 4803 | 4804 | value: VariableValue 4805 | } 4806 | 4807 | /** 4808 | * The value for the variable. The value must match the variable's type. If setting to a variable 4809 | * alias, the alias must resolve to this type. 4810 | */ 4811 | export type VariableValue = boolean | number | string | RGB | RGBA | VariableAlias 4812 | 4813 | /** 4814 | * A dev resource in a file 4815 | */ 4816 | export type DevResource = { 4817 | /** 4818 | * Unique identifier of the dev resource 4819 | */ 4820 | id: string 4821 | 4822 | /** 4823 | * The name of the dev resource. 4824 | */ 4825 | name: string 4826 | 4827 | /** 4828 | * The URL of the dev resource. 4829 | */ 4830 | url: string 4831 | 4832 | /** 4833 | * The file key where the dev resource belongs. 4834 | */ 4835 | file_key: string 4836 | 4837 | /** 4838 | * The target node to attach the dev resource to. 4839 | */ 4840 | node_id: string 4841 | } 4842 | 4843 | /** 4844 | * Library analytics component actions data broken down by asset. 4845 | */ 4846 | export type LibraryAnalyticsComponentActionsByAsset = { 4847 | /** 4848 | * The date in ISO 8601 format. e.g. 2023-12-13 4849 | */ 4850 | week: string 4851 | 4852 | /** 4853 | * Unique, stable id of the component. 4854 | */ 4855 | component_key: string 4856 | 4857 | /** 4858 | * Name of the component. 4859 | */ 4860 | component_name: string 4861 | 4862 | /** 4863 | * Unique, stable id of the component set that this component belongs to. 4864 | */ 4865 | component_set_key?: string 4866 | 4867 | /** 4868 | * Name of the component set that this component belongs to. 4869 | */ 4870 | component_set_name?: string 4871 | 4872 | /** 4873 | * The number of detach events for this period. 4874 | */ 4875 | detachments: number 4876 | 4877 | /** 4878 | * The number of insertion events for this period. 4879 | */ 4880 | insertions: number 4881 | } 4882 | 4883 | /** 4884 | * Library analytics action data broken down by team. 4885 | */ 4886 | export type LibraryAnalyticsComponentActionsByTeam = { 4887 | /** 4888 | * The date in ISO 8601 format. e.g. 2023-12-13 4889 | */ 4890 | week: string 4891 | 4892 | /** 4893 | * The name of the team using the library. 4894 | */ 4895 | team_name: string 4896 | 4897 | /** 4898 | * The name of the workspace that the team belongs to. 4899 | */ 4900 | workspace_name?: string 4901 | 4902 | /** 4903 | * The number of detach events for this period. 4904 | */ 4905 | detachments: number 4906 | 4907 | /** 4908 | * The number of insertion events for this period. 4909 | */ 4910 | insertions: number 4911 | } 4912 | 4913 | /** 4914 | * Library analytics component usage data broken down by component. 4915 | */ 4916 | export type LibraryAnalyticsComponentUsagesByAsset = { 4917 | /** 4918 | * Unique, stable id of the component. 4919 | */ 4920 | component_key: string 4921 | 4922 | /** 4923 | * Name of the component. 4924 | */ 4925 | component_name: string 4926 | 4927 | /** 4928 | * Unique, stable id of the component set that this component belongs to. 4929 | */ 4930 | component_set_key?: string 4931 | 4932 | /** 4933 | * Name of the component set that this component belongs to. 4934 | */ 4935 | component_set_name?: string 4936 | 4937 | /** 4938 | * The number of instances of the component within the organization. 4939 | */ 4940 | usages: number 4941 | 4942 | /** 4943 | * The number of teams using the component within the organization. 4944 | */ 4945 | teams_using: number 4946 | 4947 | /** 4948 | * The number of files using the component within the organization. 4949 | */ 4950 | files_using: number 4951 | } 4952 | 4953 | /** 4954 | * Library analytics component usage data broken down by file. 4955 | */ 4956 | export type LibraryAnalyticsComponentUsagesByFile = { 4957 | /** 4958 | * The name of the file using the library. 4959 | */ 4960 | file_name: string 4961 | 4962 | /** 4963 | * The name of the team the file belongs to. 4964 | */ 4965 | team_name: string 4966 | 4967 | /** 4968 | * The name of the workspace that the file belongs to. 4969 | */ 4970 | workspace_name?: string 4971 | 4972 | /** 4973 | * The number of component instances from the library used within the file. 4974 | */ 4975 | usages: number 4976 | } 4977 | 4978 | /** 4979 | * Library analytics style actions data broken down by asset. 4980 | */ 4981 | export type LibraryAnalyticsStyleActionsByAsset = { 4982 | /** 4983 | * The date in ISO 8601 format. e.g. 2023-12-13 4984 | */ 4985 | week: string 4986 | 4987 | /** 4988 | * Unique, stable id of the style. 4989 | */ 4990 | style_key: string 4991 | 4992 | /** 4993 | * The name of the style. 4994 | */ 4995 | style_name: string 4996 | 4997 | /** 4998 | * The type of the style. 4999 | */ 5000 | style_type: string 5001 | 5002 | /** 5003 | * The number of detach events for this period. 5004 | */ 5005 | detachments: number 5006 | 5007 | /** 5008 | * The number of insertion events for this period. 5009 | */ 5010 | insertions: number 5011 | } 5012 | 5013 | /** 5014 | * Library analytics style action data broken down by team. 5015 | */ 5016 | export type LibraryAnalyticsStyleActionsByTeam = { 5017 | /** 5018 | * The date in ISO 8601 format. e.g. 2023-12-13 5019 | */ 5020 | week: string 5021 | 5022 | /** 5023 | * The name of the team using the library. 5024 | */ 5025 | team_name: string 5026 | 5027 | /** 5028 | * The name of the workspace that the team belongs to. 5029 | */ 5030 | workspace_name?: string 5031 | 5032 | /** 5033 | * The number of detach events for this period. 5034 | */ 5035 | detachments: number 5036 | 5037 | /** 5038 | * The number of insertion events for this period. 5039 | */ 5040 | insertions: number 5041 | } 5042 | 5043 | /** 5044 | * Library analytics style usage data broken down by component. 5045 | */ 5046 | export type LibraryAnalyticsStyleUsagesByAsset = { 5047 | /** 5048 | * Unique, stable id of the style. 5049 | */ 5050 | style_key: string 5051 | 5052 | /** 5053 | * The name of the style. 5054 | */ 5055 | style_name: string 5056 | 5057 | /** 5058 | * The type of the style. 5059 | */ 5060 | style_type: string 5061 | 5062 | /** 5063 | * The number of usages of the style within the organization. 5064 | */ 5065 | usages: number 5066 | 5067 | /** 5068 | * The number of teams using the style within the organization. 5069 | */ 5070 | teams_using: number 5071 | 5072 | /** 5073 | * The number of files using the style within the organization. 5074 | */ 5075 | files_using: number 5076 | } 5077 | 5078 | /** 5079 | * Library analytics style usage data broken down by file. 5080 | */ 5081 | export type LibraryAnalyticsStyleUsagesByFile = { 5082 | /** 5083 | * The name of the file using the library. 5084 | */ 5085 | file_name: string 5086 | 5087 | /** 5088 | * The name of the team the file belongs to. 5089 | */ 5090 | team_name: string 5091 | 5092 | /** 5093 | * The name of the workspace that the file belongs to. 5094 | */ 5095 | workspace_name?: string 5096 | 5097 | /** 5098 | * The number of times styles from this library are used within the file. 5099 | */ 5100 | usages: number 5101 | } 5102 | 5103 | /** 5104 | * Library analytics variable actions data broken down by asset. 5105 | */ 5106 | export type LibraryAnalyticsVariableActionsByAsset = { 5107 | /** 5108 | * The date in ISO 8601 format. e.g. 2023-12-13 5109 | */ 5110 | week: string 5111 | 5112 | /** 5113 | * Unique, stable id of the variable. 5114 | */ 5115 | variable_key: string 5116 | 5117 | /** 5118 | * The name of the variable. 5119 | */ 5120 | variable_name: string 5121 | 5122 | /** 5123 | * The type of the variable. 5124 | */ 5125 | variable_type: string 5126 | 5127 | /** 5128 | * Unique, stable id of the collection the variable belongs to. 5129 | */ 5130 | collection_key: string 5131 | 5132 | /** 5133 | * The name of the collection the variable belongs to. 5134 | */ 5135 | collection_name: string 5136 | 5137 | /** 5138 | * The number of detach events for this period. 5139 | */ 5140 | detachments: number 5141 | 5142 | /** 5143 | * The number of insertion events for this period. 5144 | */ 5145 | insertions: number 5146 | } 5147 | 5148 | /** 5149 | * Library analytics variable action data broken down by team. 5150 | */ 5151 | export type LibraryAnalyticsVariableActionsByTeam = { 5152 | /** 5153 | * The date in ISO 8601 format. e.g. 2023-12-13 5154 | */ 5155 | week: string 5156 | 5157 | /** 5158 | * The name of the team using the library. 5159 | */ 5160 | team_name: string 5161 | 5162 | /** 5163 | * The name of the workspace that the team belongs to. 5164 | */ 5165 | workspace_name?: string 5166 | 5167 | /** 5168 | * The number of detach events for this period. 5169 | */ 5170 | detachments: number 5171 | 5172 | /** 5173 | * The number of insertion events for this period. 5174 | */ 5175 | insertions: number 5176 | } 5177 | 5178 | /** 5179 | * Library analytics variable usage data broken down by component. 5180 | */ 5181 | export type LibraryAnalyticsVariableUsagesByAsset = { 5182 | /** 5183 | * Unique, stable id of the variable. 5184 | */ 5185 | variable_key: string 5186 | 5187 | /** 5188 | * The name of the variable. 5189 | */ 5190 | variable_name: string 5191 | 5192 | /** 5193 | * The type of the variable. 5194 | */ 5195 | variable_type: string 5196 | 5197 | /** 5198 | * Unique, stable id of the collection the variable belongs to. 5199 | */ 5200 | collection_key: string 5201 | 5202 | /** 5203 | * The name of the collection the variable belongs to. 5204 | */ 5205 | collection_name: string 5206 | 5207 | /** 5208 | * The number of usages of the variable within the organization. 5209 | */ 5210 | usages: number 5211 | 5212 | /** 5213 | * The number of teams using the variable within the organization. 5214 | */ 5215 | teams_using: number 5216 | 5217 | /** 5218 | * The number of files using the variable within the organization. 5219 | */ 5220 | files_using: number 5221 | } 5222 | 5223 | /** 5224 | * Library analytics variable usage data broken down by file. 5225 | */ 5226 | export type LibraryAnalyticsVariableUsagesByFile = { 5227 | /** 5228 | * The name of the file using the library. 5229 | */ 5230 | file_name: string 5231 | 5232 | /** 5233 | * The name of the team the file belongs to. 5234 | */ 5235 | team_name: string 5236 | 5237 | /** 5238 | * The name of the workspace that the file belongs to. 5239 | */ 5240 | workspace_name?: string 5241 | 5242 | /** 5243 | * The number of times variables from this library are used within the file. 5244 | */ 5245 | usages: number 5246 | } 5247 | 5248 | /** 5249 | * If pagination is needed due to the length of the response, identifies the next and previous 5250 | * pages. 5251 | */ 5252 | export type ResponsePagination = { 5253 | /** 5254 | * A URL that calls the previous page of the response. 5255 | */ 5256 | prev_page?: string 5257 | 5258 | /** 5259 | * A URL that calls the next page of the response. 5260 | */ 5261 | next_page?: string 5262 | } 5263 | 5264 | /** 5265 | * Pagination cursor 5266 | */ 5267 | export type ResponseCursor = { 5268 | before?: number 5269 | 5270 | after?: number 5271 | } 5272 | 5273 | /** 5274 | * A response indicating an error occurred. 5275 | */ 5276 | export type ErrorResponsePayloadWithErrMessage = { 5277 | /** 5278 | * Status code 5279 | */ 5280 | status: number 5281 | 5282 | /** 5283 | * A string describing the error 5284 | */ 5285 | err: string 5286 | } 5287 | 5288 | /** 5289 | * A response indicating an error occurred. 5290 | */ 5291 | export type ErrorResponsePayloadWithErrorBoolean = { 5292 | /** 5293 | * For erroneous requests, this value is always `true`. 5294 | */ 5295 | error: true 5296 | 5297 | /** 5298 | * Status code 5299 | */ 5300 | status: number 5301 | 5302 | /** 5303 | * A string describing the error 5304 | */ 5305 | message: string 5306 | } 5307 | 5308 | /** 5309 | * Access policy for users who have the link to the resource. 5310 | */ 5311 | export type LinkAccess = 'view' | 'edit' | 'org_view' | 'org_edit' | 'inherit' 5312 | 5313 | /** 5314 | * The role of the user making the API request in relation to the resource. 5315 | */ 5316 | export type Role = 'owner' | 'editor' | 'viewer' 5317 | 5318 | /** 5319 | * Response from the GET /v1/files/{file_key} endpoint. 5320 | */ 5321 | export type GetFileResponse = { 5322 | /** 5323 | * The name of the file as it appears in the editor. 5324 | */ 5325 | name: string 5326 | 5327 | /** 5328 | * The role of the user making the API request in relation to the file. 5329 | */ 5330 | role: Role 5331 | 5332 | /** 5333 | * The UTC ISO 8601 time at which the file was last modified. 5334 | */ 5335 | lastModified: string 5336 | 5337 | /** 5338 | * The type of editor associated with this file. 5339 | */ 5340 | editorType: 'figma' | 'figjam' 5341 | 5342 | /** 5343 | * A URL to a thumbnail image of the file. 5344 | */ 5345 | thumbnailUrl?: string 5346 | 5347 | /** 5348 | * The version number of the file. This number is incremented when a file is modified and can be 5349 | * used to check if the file has changed between requests. 5350 | */ 5351 | version: string 5352 | 5353 | document: DocumentNode 5354 | 5355 | /** 5356 | * A mapping from component IDs to component metadata. 5357 | */ 5358 | components: { [key: string]: Component } 5359 | 5360 | /** 5361 | * A mapping from component set IDs to component set metadata. 5362 | */ 5363 | componentSets: { [key: string]: ComponentSet } 5364 | 5365 | /** 5366 | * The version of the file schema that this file uses. 5367 | */ 5368 | schemaVersion: number 5369 | 5370 | /** 5371 | * A mapping from style IDs to style metadata. 5372 | */ 5373 | styles: { [key: string]: Style } 5374 | 5375 | /** 5376 | * The share permission level of the file link. 5377 | */ 5378 | linkAccess?: string 5379 | 5380 | /** 5381 | * The key of the main file for this file. If present, this file is a component or component set. 5382 | */ 5383 | mainFileKey?: string 5384 | 5385 | /** 5386 | * A list of branches for this file. 5387 | */ 5388 | branches?: { 5389 | /** 5390 | * The key of the branch. 5391 | */ 5392 | key: string 5393 | 5394 | /** 5395 | * The name of the branch. 5396 | */ 5397 | name: string 5398 | 5399 | /** 5400 | * A URL to a thumbnail image of the branch. 5401 | */ 5402 | thumbnail_url: string 5403 | 5404 | /** 5405 | * The UTC ISO 8601 time at which the branch was last modified. 5406 | */ 5407 | last_modified: string 5408 | }[] 5409 | } 5410 | 5411 | /** 5412 | * Response from the GET /v1/files/{file_key}/nodes endpoint. 5413 | */ 5414 | export type GetFileNodesResponse = { 5415 | /** 5416 | * The name of the file as it appears in the editor. 5417 | */ 5418 | name: string 5419 | 5420 | /** 5421 | * The role of the user making the API request in relation to the file. 5422 | */ 5423 | role: Role 5424 | 5425 | /** 5426 | * The UTC ISO 8601 time at which the file was last modified. 5427 | */ 5428 | lastModified: string 5429 | 5430 | /** 5431 | * The type of editor associated with this file. 5432 | */ 5433 | editorType: 'figma' | 'figjam' 5434 | 5435 | /** 5436 | * A URL to a thumbnail image of the file. 5437 | */ 5438 | thumbnailUrl: string 5439 | 5440 | /** 5441 | * The version number of the file. This number is incremented when a file is modified and can be 5442 | * used to check if the file has changed between requests. 5443 | */ 5444 | version: string 5445 | 5446 | /** 5447 | * A mapping from node IDs to node metadata. 5448 | */ 5449 | nodes: { 5450 | [key: string]: { 5451 | document: Node 5452 | 5453 | /** 5454 | * A mapping from component IDs to component metadata. 5455 | */ 5456 | components: { [key: string]: Component } 5457 | 5458 | /** 5459 | * A mapping from component set IDs to component set metadata. 5460 | */ 5461 | componentSets: { [key: string]: ComponentSet } 5462 | 5463 | /** 5464 | * The version of the file schema that this file uses. 5465 | */ 5466 | schemaVersion: number 5467 | 5468 | /** 5469 | * A mapping from style IDs to style metadata. 5470 | */ 5471 | styles: { [key: string]: Style } 5472 | } 5473 | } 5474 | } 5475 | 5476 | /** 5477 | * Response from the GET /v1/images/{file_key} endpoint. 5478 | */ 5479 | export type GetImagesResponse = { 5480 | /** 5481 | * For successful requests, this value is always `null`. 5482 | */ 5483 | err: null 5484 | 5485 | /** 5486 | * A map from node IDs to URLs of the rendered images. 5487 | */ 5488 | images: { [key: string]: string | null } 5489 | } 5490 | 5491 | /** 5492 | * Response from the GET /v1/files/{file_key}/images endpoint. 5493 | */ 5494 | export type GetImageFillsResponse = { 5495 | /** 5496 | * For successful requests, this value is always `false`. 5497 | */ 5498 | error: false 5499 | 5500 | /** 5501 | * Status code 5502 | */ 5503 | status: 200 5504 | 5505 | meta: { 5506 | /** 5507 | * A map of image references to URLs of the image fills. 5508 | */ 5509 | images: { [key: string]: string } 5510 | } 5511 | } 5512 | 5513 | /** 5514 | * Response from the GET /v1/files/{file_key}/meta endpoint. 5515 | */ 5516 | export type GetFileMetaResponse = { 5517 | /** 5518 | * The name of the file. 5519 | */ 5520 | name: string 5521 | 5522 | /** 5523 | * The name of the project containing the file. 5524 | */ 5525 | folder_name?: string 5526 | 5527 | /** 5528 | * The UTC ISO 8601 time at which the file content was last modified. 5529 | */ 5530 | last_touched_at: string 5531 | 5532 | /** 5533 | * The user who created the file. 5534 | */ 5535 | creator: User 5536 | 5537 | /** 5538 | * The user who last modified the file contents. 5539 | */ 5540 | last_touched_by?: User 5541 | 5542 | /** 5543 | * A URL to a thumbnail image of the file. 5544 | */ 5545 | thumbnail_url?: string 5546 | 5547 | /** 5548 | * The type of editor associated with this file. 5549 | */ 5550 | editorType: 'figma' | 'figjam' | 'slides' | 'buzz' | 'sites' | 'make' 5551 | 5552 | /** 5553 | * The role of the user making the API request in relation to the file. 5554 | */ 5555 | role?: Role 5556 | 5557 | /** 5558 | * Access policy for users who have the link to the file. 5559 | */ 5560 | link_access?: LinkAccess 5561 | 5562 | /** 5563 | * The URL of the file. 5564 | */ 5565 | url?: string 5566 | 5567 | /** 5568 | * The version number of the file. This number is incremented when a file is modified and can be 5569 | * used to check if the file has changed between requests. 5570 | */ 5571 | version?: string 5572 | } 5573 | 5574 | /** 5575 | * Response from the GET /v1/teams/{team_id}/projects endpoint. 5576 | */ 5577 | export type GetTeamProjectsResponse = { 5578 | /** 5579 | * The team's name. 5580 | */ 5581 | name: string 5582 | 5583 | /** 5584 | * An array of projects. 5585 | */ 5586 | projects: Project[] 5587 | } 5588 | 5589 | /** 5590 | * Response from the GET /v1/projects/{project_id}/files endpoint. 5591 | */ 5592 | export type GetProjectFilesResponse = { 5593 | /** 5594 | * The project's name. 5595 | */ 5596 | name: string 5597 | 5598 | /** 5599 | * An array of files. 5600 | */ 5601 | files: { 5602 | /** 5603 | * The file's key. 5604 | */ 5605 | key: string 5606 | 5607 | /** 5608 | * The file's name. 5609 | */ 5610 | name: string 5611 | 5612 | /** 5613 | * The file's thumbnail URL. 5614 | */ 5615 | thumbnail_url?: string 5616 | 5617 | /** 5618 | * The UTC ISO 8601 time at which the file was last modified. 5619 | */ 5620 | last_modified: string 5621 | }[] 5622 | } 5623 | 5624 | /** 5625 | * Response from the GET /v1/files/{file_key}/versions endpoint. 5626 | */ 5627 | export type GetFileVersionsResponse = { 5628 | /** 5629 | * An array of versions. 5630 | */ 5631 | versions: Version[] 5632 | 5633 | pagination: ResponsePagination 5634 | } 5635 | 5636 | /** 5637 | * Response from the GET /v1/files/{file_key}/comments endpoint. 5638 | */ 5639 | export type GetCommentsResponse = { 5640 | /** 5641 | * An array of comments. 5642 | */ 5643 | comments: Comment[] 5644 | } 5645 | 5646 | /** 5647 | * Response from the POST /v1/files/{file_key}/comments endpoint. 5648 | */ 5649 | export type PostCommentResponse = Comment 5650 | 5651 | /** 5652 | * Response from the DELETE /v1/files/{file_key}/comments/{comment_id} endpoint. 5653 | */ 5654 | export type DeleteCommentResponse = { 5655 | /** 5656 | * The status of the request. 5657 | */ 5658 | status: 200 5659 | 5660 | /** 5661 | * For successful requests, this value is always `false`. 5662 | */ 5663 | error: false 5664 | } 5665 | 5666 | /** 5667 | * Response from the GET /v1/files/{file_key}/comments/{comment_id}/reactions endpoint. 5668 | */ 5669 | export type GetCommentReactionsResponse = { 5670 | /** 5671 | * An array of reactions. 5672 | */ 5673 | reactions: Reaction[] 5674 | 5675 | pagination: ResponsePagination 5676 | } 5677 | 5678 | /** 5679 | * Response from the POST /v1/files/{file_key}/comments/{comment_id}/reactions endpoint. 5680 | */ 5681 | export type PostCommentReactionResponse = { 5682 | /** 5683 | * The status of the request. 5684 | */ 5685 | status: 200 5686 | 5687 | /** 5688 | * For successful requests, this value is always `false`. 5689 | */ 5690 | error: false 5691 | } 5692 | 5693 | /** 5694 | * Response from the DELETE /v1/files/{file_key}/comments/{comment_id}/reactions endpoint. 5695 | */ 5696 | export type DeleteCommentReactionResponse = { 5697 | /** 5698 | * The status of the request. 5699 | */ 5700 | status: 200 5701 | 5702 | /** 5703 | * For successful requests, this value is always `false`. 5704 | */ 5705 | error: false 5706 | } 5707 | 5708 | /** 5709 | * Response from the GET /v1/me endpoint. 5710 | */ 5711 | export type GetMeResponse = User & { 5712 | /** 5713 | * Email associated with the user's account. This property is only present on the /v1/me endpoint. 5714 | */ 5715 | email: string 5716 | } 5717 | 5718 | /** 5719 | * Response from the GET /v1/teams/{team_id}/components endpoint. 5720 | */ 5721 | export type GetTeamComponentsResponse = { 5722 | /** 5723 | * The status of the request. 5724 | */ 5725 | status: 200 5726 | 5727 | /** 5728 | * For successful requests, this value is always `false`. 5729 | */ 5730 | error: false 5731 | 5732 | meta: { 5733 | components: PublishedComponent[] 5734 | 5735 | cursor?: ResponseCursor 5736 | } 5737 | } 5738 | 5739 | /** 5740 | * Response from the GET /v1/files/{file_key}/components endpoint. 5741 | */ 5742 | export type GetFileComponentsResponse = { 5743 | /** 5744 | * The status of the request. 5745 | */ 5746 | status: 200 5747 | 5748 | /** 5749 | * For successful requests, this value is always `false`. 5750 | */ 5751 | error: false 5752 | 5753 | meta: { components: PublishedComponent[] } 5754 | } 5755 | 5756 | /** 5757 | * Response from the GET /v1/components/{key} endpoint. 5758 | */ 5759 | export type GetComponentResponse = { 5760 | /** 5761 | * The status of the request. 5762 | */ 5763 | status: 200 5764 | 5765 | /** 5766 | * For successful requests, this value is always `false`. 5767 | */ 5768 | error: false 5769 | 5770 | meta: PublishedComponent 5771 | } 5772 | 5773 | /** 5774 | * Response from the GET /v1/teams/{team_id}/component_sets endpoint. 5775 | */ 5776 | export type GetTeamComponentSetsResponse = { 5777 | /** 5778 | * The status of the request. 5779 | */ 5780 | status: 200 5781 | 5782 | /** 5783 | * For successful requests, this value is always `false`. 5784 | */ 5785 | error: false 5786 | 5787 | meta: { 5788 | component_sets: PublishedComponentSet[] 5789 | 5790 | cursor?: ResponseCursor 5791 | } 5792 | } 5793 | 5794 | /** 5795 | * Response from the GET /v1/files/{file_key}/component_sets endpoint. 5796 | */ 5797 | export type GetFileComponentSetsResponse = { 5798 | /** 5799 | * The status of the request. 5800 | */ 5801 | status: 200 5802 | 5803 | /** 5804 | * For successful requests, this value is always `false`. 5805 | */ 5806 | error: false 5807 | 5808 | meta: { component_sets: PublishedComponentSet[] } 5809 | } 5810 | 5811 | /** 5812 | * Response from the GET /v1/component_sets/{key} endpoint. 5813 | */ 5814 | export type GetComponentSetResponse = { 5815 | /** 5816 | * The status of the request. 5817 | */ 5818 | status: 200 5819 | 5820 | /** 5821 | * For successful requests, this value is always `false`. 5822 | */ 5823 | error: false 5824 | 5825 | meta: PublishedComponentSet 5826 | } 5827 | 5828 | /** 5829 | * Response from the GET /v1/teams/{team_id}/styles endpoint. 5830 | */ 5831 | export type GetTeamStylesResponse = { 5832 | /** 5833 | * The status of the request. 5834 | */ 5835 | status: 200 5836 | 5837 | /** 5838 | * For successful requests, this value is always `false`. 5839 | */ 5840 | error: false 5841 | 5842 | meta: { 5843 | styles: PublishedStyle[] 5844 | 5845 | cursor?: ResponseCursor 5846 | } 5847 | } 5848 | 5849 | /** 5850 | * Response from the GET /v1/files/{file_key}/styles endpoint. 5851 | */ 5852 | export type GetFileStylesResponse = { 5853 | /** 5854 | * The status of the request. 5855 | */ 5856 | status: 200 5857 | 5858 | /** 5859 | * For successful requests, this value is always `false`. 5860 | */ 5861 | error: false 5862 | 5863 | meta: { styles: PublishedStyle[] } 5864 | } 5865 | 5866 | /** 5867 | * Response from the GET /v1/styles/{key} endpoint. 5868 | */ 5869 | export type GetStyleResponse = { 5870 | /** 5871 | * The status of the request. 5872 | */ 5873 | status: 200 5874 | 5875 | /** 5876 | * For successful requests, this value is always `false`. 5877 | */ 5878 | error: false 5879 | 5880 | meta: PublishedStyle 5881 | } 5882 | 5883 | /** 5884 | * Response from the POST /v2/webhooks endpoint. 5885 | */ 5886 | export type PostWebhookResponse = WebhookV2 5887 | 5888 | /** 5889 | * Response from the GET /v2/webhooks/{webhook_id} endpoint. 5890 | */ 5891 | export type GetWebhookResponse = WebhookV2 5892 | 5893 | /** 5894 | * Response from the GET /v2/webhooks endpoint. 5895 | */ 5896 | export type GetWebhooksResponse = { 5897 | /** 5898 | * An array of webhooks. 5899 | */ 5900 | webhooks: WebhookV2[] 5901 | 5902 | pagination?: ResponsePagination 5903 | } 5904 | 5905 | /** 5906 | * Response from the PUT /v2/webhooks/{webhook_id} endpoint. 5907 | */ 5908 | export type PutWebhookResponse = WebhookV2 5909 | 5910 | /** 5911 | * Response from the DELETE /v2/webhooks/{webhook_id} endpoint. 5912 | */ 5913 | export type DeleteWebhookResponse = WebhookV2 5914 | 5915 | /** 5916 | * Response from the GET /v2/teams/{team_id}/webhooks endpoint. 5917 | */ 5918 | export type GetTeamWebhooksResponse = { 5919 | /** 5920 | * An array of webhooks. 5921 | */ 5922 | webhooks: WebhookV2[] 5923 | } 5924 | 5925 | /** 5926 | * Response from the GET /v2/webhooks/{webhook_id}/requests endpoint. 5927 | */ 5928 | export type GetWebhookRequestsResponse = { 5929 | /** 5930 | * An array of webhook requests. 5931 | */ 5932 | requests: WebhookV2Request[] 5933 | } 5934 | 5935 | /** 5936 | * Response from the GET /v1/activity_logs endpoint. 5937 | */ 5938 | export type GetActivityLogsResponse = { 5939 | /** 5940 | * The response status code. 5941 | */ 5942 | status?: 200 5943 | 5944 | /** 5945 | * For successful requests, this value is always `false`. 5946 | */ 5947 | error?: false 5948 | 5949 | meta?: { 5950 | /** 5951 | * An array of activity logs sorted by timestamp in ascending order by default. 5952 | */ 5953 | activity_logs?: ActivityLog[] 5954 | 5955 | /** 5956 | * Encodes the last event (the most recent event) 5957 | */ 5958 | cursor?: string 5959 | 5960 | /** 5961 | * Whether there is a next page of events 5962 | */ 5963 | next_page?: boolean 5964 | } 5965 | } 5966 | 5967 | /** 5968 | * Response from the GET /v1/payments endpoint. 5969 | */ 5970 | export type GetPaymentsResponse = { 5971 | /** 5972 | * The response status code. 5973 | */ 5974 | status: 200 5975 | 5976 | /** 5977 | * For successful requests, this value is always `false`. 5978 | */ 5979 | error: false 5980 | 5981 | meta: PaymentInformation 5982 | } 5983 | 5984 | /** 5985 | * Response from the GET /v1/files/{file_key}/variables/local endpoint. 5986 | */ 5987 | export type GetLocalVariablesResponse = { 5988 | /** 5989 | * The response status code. 5990 | */ 5991 | status: 200 5992 | 5993 | /** 5994 | * For successful requests, this value is always `false`. 5995 | */ 5996 | error: false 5997 | 5998 | meta: { 5999 | /** 6000 | * A map of variable ids to variables 6001 | */ 6002 | variables: { [key: string]: LocalVariable } 6003 | 6004 | /** 6005 | * A map of variable collection ids to variable collections 6006 | */ 6007 | variableCollections: { [key: string]: LocalVariableCollection } 6008 | } 6009 | } 6010 | 6011 | /** 6012 | * Response from the GET /v1/files/{file_key}/variables/published endpoint. 6013 | */ 6014 | export type GetPublishedVariablesResponse = { 6015 | /** 6016 | * The response status code. 6017 | */ 6018 | status: 200 6019 | 6020 | /** 6021 | * For successful requests, this value is always `false`. 6022 | */ 6023 | error: false 6024 | 6025 | meta: { 6026 | /** 6027 | * A map of variable ids to variables 6028 | */ 6029 | variables: { [key: string]: PublishedVariable } 6030 | 6031 | /** 6032 | * A map of variable collection ids to variable collections 6033 | */ 6034 | variableCollections: { [key: string]: PublishedVariableCollection } 6035 | } 6036 | } 6037 | 6038 | /** 6039 | * Response from the POST /v1/files/{file_key}/variables endpoint. 6040 | */ 6041 | export type PostVariablesResponse = { 6042 | /** 6043 | * The response status code. 6044 | */ 6045 | status: 200 6046 | 6047 | /** 6048 | * For successful requests, this value is always `false`. 6049 | */ 6050 | error: false 6051 | 6052 | meta: { 6053 | /** 6054 | * A map of temporary ids in the request to the real ids of the newly created objects 6055 | */ 6056 | tempIdToRealId: { [key: string]: string } 6057 | } 6058 | } 6059 | 6060 | /** 6061 | * Response from the GET /v1/files/{file_key}/dev_resources endpoint. 6062 | */ 6063 | export type GetDevResourcesResponse = { 6064 | /** 6065 | * An array of dev resources. 6066 | */ 6067 | dev_resources: DevResource[] 6068 | } 6069 | 6070 | /** 6071 | * Response from the POST /v1/dev_resources endpoint. 6072 | */ 6073 | export type PostDevResourcesResponse = { 6074 | /** 6075 | * An array of links created. 6076 | */ 6077 | links_created: DevResource[] 6078 | 6079 | /** 6080 | * An array of errors. 6081 | */ 6082 | errors?: { 6083 | /** 6084 | * The file key. 6085 | */ 6086 | file_key?: string | null 6087 | 6088 | /** 6089 | * The node id. 6090 | */ 6091 | node_id?: string | null 6092 | 6093 | /** 6094 | * The error message. 6095 | */ 6096 | error: string 6097 | }[] 6098 | } 6099 | 6100 | /** 6101 | * Response from the PUT /v1/dev_resources endpoint. 6102 | */ 6103 | export type PutDevResourcesResponse = { 6104 | /** 6105 | * An array of links updated. 6106 | */ 6107 | links_updated?: DevResource[] 6108 | 6109 | /** 6110 | * An array of errors. 6111 | */ 6112 | errors?: { 6113 | /** 6114 | * The id of the dev resource. 6115 | */ 6116 | id?: string 6117 | 6118 | /** 6119 | * The error message. 6120 | */ 6121 | error: string 6122 | }[] 6123 | } 6124 | 6125 | /** 6126 | * Response from the DELETE /v1/files/{file_key}/dev_resources/{dev_resource_id} endpoint. 6127 | */ 6128 | export type DeleteDevResourceResponse = void 6129 | 6130 | /** 6131 | * Response from the GET /v1/analytics/libraries/{file_key}/component/actions. 6132 | */ 6133 | export type GetLibraryAnalyticsComponentActionsResponse = { 6134 | /** 6135 | * An array of analytics data. 6136 | */ 6137 | rows: LibraryAnalyticsComponentActionsByAsset[] | LibraryAnalyticsComponentActionsByTeam[] 6138 | 6139 | /** 6140 | * Whether there is a next page of data that can be fetched. 6141 | */ 6142 | next_page: boolean 6143 | 6144 | /** 6145 | * The cursor to use to fetch the next page of data. Not present if next_page is false. 6146 | */ 6147 | cursor?: string 6148 | } 6149 | 6150 | /** 6151 | * Response from the PUT /v1/analytics/libraries/{file_key}/component/usages. 6152 | */ 6153 | export type GetLibraryAnalyticsComponentUsagesResponse = { 6154 | /** 6155 | * An array of analytics data. 6156 | */ 6157 | rows: LibraryAnalyticsComponentUsagesByAsset[] | LibraryAnalyticsComponentUsagesByFile[] 6158 | 6159 | /** 6160 | * Whether there is a next page of data that can be fetched. 6161 | */ 6162 | next_page: boolean 6163 | 6164 | /** 6165 | * The cursor to use to fetch the next page of data. Not present if next_page is false. 6166 | */ 6167 | cursor?: string 6168 | } 6169 | 6170 | /** 6171 | * Response from the GET /v1/analytics/libraries/{file_key}/style/actions. 6172 | */ 6173 | export type GetLibraryAnalyticsStyleActionsResponse = { 6174 | /** 6175 | * An array of analytics data. 6176 | */ 6177 | rows: LibraryAnalyticsStyleActionsByAsset[] | LibraryAnalyticsStyleActionsByTeam[] 6178 | 6179 | /** 6180 | * Whether there is a next page of data that can be fetched. 6181 | */ 6182 | next_page: boolean 6183 | 6184 | /** 6185 | * The cursor to use to fetch the next page of data. Not present if next_page is false. 6186 | */ 6187 | cursor?: string 6188 | } 6189 | 6190 | /** 6191 | * Response from the PUT /v1/analytics/libraries/{file_key}/style/usages. 6192 | */ 6193 | export type GetLibraryAnalyticsStyleUsagesResponse = { 6194 | /** 6195 | * An array of analytics data. 6196 | */ 6197 | rows: LibraryAnalyticsStyleUsagesByAsset[] | LibraryAnalyticsStyleUsagesByFile[] 6198 | 6199 | /** 6200 | * Whether there is a next page of data that can be fetched. 6201 | */ 6202 | next_page: boolean 6203 | 6204 | /** 6205 | * The cursor to use to fetch the next page of data. Not present if next_page is false. 6206 | */ 6207 | cursor?: string 6208 | } 6209 | 6210 | /** 6211 | * Response from the GET /v1/analytics/libraries/{file_key}/variable/actions. 6212 | */ 6213 | export type GetLibraryAnalyticsVariableActionsResponse = { 6214 | /** 6215 | * An array of analytics data. 6216 | */ 6217 | rows: LibraryAnalyticsVariableActionsByAsset[] | LibraryAnalyticsVariableActionsByTeam[] 6218 | 6219 | /** 6220 | * Whether there is a next page of data that can be fetched. 6221 | */ 6222 | next_page: boolean 6223 | 6224 | /** 6225 | * The cursor to use to fetch the next page of data. Not present if next_page is false. 6226 | */ 6227 | cursor?: string 6228 | } 6229 | 6230 | /** 6231 | * Response from the PUT /v1/analytics/libraries/{file_key}/variable/usages. 6232 | */ 6233 | export type GetLibraryAnalyticsVariableUsagesResponse = { 6234 | /** 6235 | * An array of analytics data. 6236 | */ 6237 | rows: LibraryAnalyticsVariableUsagesByAsset[] | LibraryAnalyticsVariableUsagesByFile[] 6238 | 6239 | /** 6240 | * Whether there is a next page of data that can be fetched. 6241 | */ 6242 | next_page: boolean 6243 | 6244 | /** 6245 | * The cursor to use to fetch the next page of data. Not present if next_page is false. 6246 | */ 6247 | cursor?: string 6248 | } 6249 | 6250 | /** 6251 | * Bad request. Parameters are invalid or malformed. Please check the input formats. This error can 6252 | * also happen if the requested resources are too large to complete the request, which results in a 6253 | * timeout. Please reduce the number and size of objects requested. 6254 | */ 6255 | export type BadRequestErrorResponseWithErrMessage = ErrorResponsePayloadWithErrMessage & { 6256 | /** 6257 | * Status code 6258 | */ 6259 | status: 400 6260 | } 6261 | 6262 | /** 6263 | * Bad request. Parameters are invalid or malformed. Please check the input formats. This error can 6264 | * also happen if the requested resources are too large to complete the request, which results in a 6265 | * timeout. Please reduce the number and size of objects requested. 6266 | */ 6267 | export type BadRequestErrorResponseWithErrorBoolean = ErrorResponsePayloadWithErrorBoolean & { 6268 | /** 6269 | * Status code 6270 | */ 6271 | status: 400 6272 | } 6273 | 6274 | /** 6275 | * Token is missing or incorrect. 6276 | */ 6277 | export type UnauthorizedErrorResponseWithErrorBoolean = ErrorResponsePayloadWithErrorBoolean & { 6278 | /** 6279 | * Status code 6280 | */ 6281 | status: 401 6282 | } 6283 | 6284 | /** 6285 | * The request was valid, but the server is refusing action. The user might not have the necessary 6286 | * permissions for a resource, or may need an account of some sort. 6287 | */ 6288 | export type ForbiddenErrorResponseWithErrMessage = ErrorResponsePayloadWithErrMessage & { 6289 | /** 6290 | * Status code 6291 | */ 6292 | status: 403 6293 | } 6294 | 6295 | /** 6296 | * The request was valid, but the server is refusing action. The user might not have the necessary 6297 | * permissions for a resource, or may need an account of some sort. 6298 | */ 6299 | export type ForbiddenErrorResponseWithErrorBoolean = ErrorResponsePayloadWithErrorBoolean & { 6300 | /** 6301 | * Status code 6302 | */ 6303 | status: 403 6304 | } 6305 | 6306 | /** 6307 | * The requested file or resource was not found. 6308 | */ 6309 | export type NotFoundErrorResponseWithErrMessage = ErrorResponsePayloadWithErrMessage & { 6310 | /** 6311 | * Status code 6312 | */ 6313 | status: 404 6314 | } 6315 | 6316 | /** 6317 | * The requested file or resource was not found. 6318 | */ 6319 | export type NotFoundErrorResponseWithErrorBoolean = ErrorResponsePayloadWithErrorBoolean & { 6320 | /** 6321 | * Status code 6322 | */ 6323 | status: 404 6324 | } 6325 | 6326 | /** 6327 | * In some cases API requests may be throttled or rate limited. Please wait a while before 6328 | * attempting the request again (typically a minute). 6329 | */ 6330 | export type TooManyRequestsErrorResponseWithErrMessage = ErrorResponsePayloadWithErrMessage & { 6331 | /** 6332 | * Status code 6333 | */ 6334 | status: 429 6335 | } 6336 | 6337 | /** 6338 | * In some cases API requests may be throttled or rate limited. Please wait a while before 6339 | * attempting the request again (typically a minute). 6340 | */ 6341 | export type TooManyRequestsErrorResponseWithErrorBoolean = ErrorResponsePayloadWithErrorBoolean & { 6342 | /** 6343 | * Status code 6344 | */ 6345 | status: 429 6346 | } 6347 | 6348 | /** 6349 | * An internal server error occurred. 6350 | */ 6351 | export type InternalServerErrorResponseWithErrMessage = ErrorResponsePayloadWithErrMessage & { 6352 | /** 6353 | * Status code 6354 | */ 6355 | status: 500 6356 | } 6357 | 6358 | /** 6359 | * An internal server error occurred. 6360 | */ 6361 | export type InternalServerErrorResponseWithErrorBoolean = ErrorResponsePayloadWithErrorBoolean & { 6362 | /** 6363 | * Status code 6364 | */ 6365 | status: 500 6366 | } 6367 | 6368 | /** 6369 | * Path parameters for GET /v1/files/{file_key} 6370 | */ 6371 | export type GetFilePathParams = { 6372 | /** 6373 | * File to export JSON from. This can be a file key or branch key. Use `GET /v1/files/:key` with 6374 | * the `branch_data` query param to get the branch key. 6375 | */ 6376 | file_key: string 6377 | } 6378 | 6379 | /** 6380 | * Query parameters for GET /v1/files/{file_key} 6381 | */ 6382 | export type GetFileQueryParams = { 6383 | /** 6384 | * A specific version ID to get. Omitting this will get the current version of the file. 6385 | */ 6386 | version?: string 6387 | /** 6388 | * Comma separated list of nodes that you care about in the document. If specified, only a subset of 6389 | * the document will be returned corresponding to the nodes listed, their children, and everything 6390 | * between the root node and the listed nodes. 6391 | * 6392 | * Note: There may be other nodes included in the returned JSON that are outside the ancestor chains 6393 | * of the desired nodes. The response may also include dependencies of anything in the nodes' 6394 | * subtrees. For example, if a node subtree contains an instance of a local component that lives 6395 | * elsewhere in that file, that component and its ancestor chain will also be included. 6396 | * 6397 | * For historical reasons, top-level canvas nodes are always returned, regardless of whether they 6398 | * are listed in the `ids` parameter. This quirk may be removed in a future version of the API. 6399 | */ 6400 | ids?: string 6401 | /** 6402 | * Positive integer representing how deep into the document tree to traverse. For example, setting 6403 | * this to 1 returns only Pages, setting it to 2 returns Pages and all top level objects on each 6404 | * page. Not setting this parameter returns all nodes. 6405 | */ 6406 | depth?: number 6407 | /** 6408 | * Set to "paths" to export vector data. 6409 | */ 6410 | geometry?: string 6411 | /** 6412 | * A comma separated list of plugin IDs and/or the string "shared". Any data present in the document 6413 | * written by those plugins will be included in the result in the `pluginData` and 6414 | * `sharedPluginData` properties. 6415 | */ 6416 | plugin_data?: string 6417 | /** 6418 | * Returns branch metadata for the requested file. If the file is a branch, the main file's key will 6419 | * be included in the returned response. If the file has branches, their metadata will be included 6420 | * in the returned response. Default: false. 6421 | */ 6422 | branch_data?: boolean 6423 | } 6424 | 6425 | /** 6426 | * Path parameters for GET /v1/files/{file_key}/nodes 6427 | */ 6428 | export type GetFileNodesPathParams = { 6429 | /** 6430 | * File to export JSON from. This can be a file key or branch key. Use `GET /v1/files/:key` with 6431 | * the `branch_data` query param to get the branch key. 6432 | */ 6433 | file_key: string 6434 | } 6435 | 6436 | /** 6437 | * Query parameters for GET /v1/files/{file_key}/nodes 6438 | */ 6439 | export type GetFileNodesQueryParams = { 6440 | /** 6441 | * A comma separated list of node IDs to retrieve and convert. 6442 | */ 6443 | ids: string 6444 | /** 6445 | * A specific version ID to get. Omitting this will get the current version of the file. 6446 | */ 6447 | version?: string 6448 | /** 6449 | * Positive integer representing how deep into the node tree to traverse. For example, setting this 6450 | * to 1 will return only the children directly underneath the desired nodes. Not setting this 6451 | * parameter returns all nodes. 6452 | * 6453 | * Note: this parameter behaves differently from the same parameter in the `GET /v1/files/:key` 6454 | * endpoint. In this endpoint, the depth will be counted starting from the desired node rather than 6455 | * the document root node. 6456 | */ 6457 | depth?: number 6458 | /** 6459 | * Set to "paths" to export vector data. 6460 | */ 6461 | geometry?: string 6462 | /** 6463 | * A comma separated list of plugin IDs and/or the string "shared". Any data present in the document 6464 | * written by those plugins will be included in the result in the `pluginData` and 6465 | * `sharedPluginData` properties. 6466 | */ 6467 | plugin_data?: string 6468 | } 6469 | 6470 | /** 6471 | * Path parameters for GET /v1/images/{file_key} 6472 | */ 6473 | export type GetImagesPathParams = { 6474 | /** 6475 | * File to export images from. This can be a file key or branch key. Use `GET /v1/files/:key` with 6476 | * the `branch_data` query param to get the branch key. 6477 | */ 6478 | file_key: string 6479 | } 6480 | 6481 | /** 6482 | * Query parameters for GET /v1/images/{file_key} 6483 | */ 6484 | export type GetImagesQueryParams = { 6485 | /** 6486 | * A comma separated list of node IDs to render. 6487 | */ 6488 | ids: string 6489 | /** 6490 | * A specific version ID to get. Omitting this will get the current version of the file. 6491 | */ 6492 | version?: string 6493 | /** 6494 | * A number between 0.01 and 4, the image scaling factor. 6495 | */ 6496 | scale?: number 6497 | /** 6498 | * A string enum for the image output format. 6499 | */ 6500 | format?: 'jpg' | 'png' | 'svg' | 'pdf' 6501 | /** 6502 | * Whether text elements are rendered as outlines (vector paths) or as `` elements in SVGs. 6503 | * 6504 | * Rendering text elements as outlines guarantees that the text looks exactly the same in the SVG as 6505 | * it does in the browser/inside Figma. 6506 | * 6507 | * Exporting as `` allows text to be selectable inside SVGs and generally makes the SVG easier 6508 | * to read. However, this relies on the browser's rendering engine which can vary between browsers 6509 | * and/or operating systems. As such, visual accuracy is not guaranteed as the result could look 6510 | * different than in Figma. 6511 | */ 6512 | svg_outline_text?: boolean 6513 | /** 6514 | * Whether to include id attributes for all SVG elements. Adds the layer name to the `id` attribute 6515 | * of an svg element. 6516 | */ 6517 | svg_include_id?: boolean 6518 | /** 6519 | * Whether to include node id attributes for all SVG elements. Adds the node id to a `data-node-id` 6520 | * attribute of an svg element. 6521 | */ 6522 | svg_include_node_id?: boolean 6523 | /** 6524 | * Whether to simplify inside/outside strokes and use stroke attribute if possible instead of 6525 | * ``. 6526 | */ 6527 | svg_simplify_stroke?: boolean 6528 | /** 6529 | * Whether content that overlaps the node should be excluded from rendering. Passing false (i.e., 6530 | * rendering overlaps) may increase processing time, since more of the document must be included in 6531 | * rendering. 6532 | */ 6533 | contents_only?: boolean 6534 | /** 6535 | * Use the full dimensions of the node regardless of whether or not it is cropped or the space 6536 | * around it is empty. Use this to export text nodes without cropping. 6537 | */ 6538 | use_absolute_bounds?: boolean 6539 | } 6540 | 6541 | /** 6542 | * Path parameters for GET /v1/files/{file_key}/images 6543 | */ 6544 | export type GetImageFillsPathParams = { 6545 | /** 6546 | * File to get image URLs from. This can be a file key or branch key. Use `GET /v1/files/:key` with 6547 | * the `branch_data` query param to get the branch key. 6548 | */ 6549 | file_key: string 6550 | } 6551 | 6552 | /** 6553 | * Path parameters for GET /v1/files/{file_key}/meta 6554 | */ 6555 | export type GetFileMetaPathParams = { 6556 | /** 6557 | * File to get metadata for. This can be a file key or branch key. Use `GET /v1/files/:key` with 6558 | * the `branch_data` query param to get the branch key. 6559 | */ 6560 | file_key: string 6561 | } 6562 | 6563 | /** 6564 | * Path parameters for GET /v1/teams/{team_id}/projects 6565 | */ 6566 | export type GetTeamProjectsPathParams = { 6567 | /** 6568 | * ID of the team to list projects from 6569 | */ 6570 | team_id: string 6571 | } 6572 | 6573 | /** 6574 | * Path parameters for GET /v1/projects/{project_id}/files 6575 | */ 6576 | export type GetProjectFilesPathParams = { 6577 | /** 6578 | * ID of the project to list files from 6579 | */ 6580 | project_id: string 6581 | } 6582 | 6583 | /** 6584 | * Query parameters for GET /v1/projects/{project_id}/files 6585 | */ 6586 | export type GetProjectFilesQueryParams = { 6587 | /** 6588 | * Returns branch metadata in the response for each main file with a branch inside the project. 6589 | */ 6590 | branch_data?: boolean 6591 | } 6592 | 6593 | /** 6594 | * Path parameters for GET /v1/files/{file_key}/versions 6595 | */ 6596 | export type GetFileVersionsPathParams = { 6597 | /** 6598 | * File to get version history from. This can be a file key or branch key. Use `GET /v1/files/:key` 6599 | * with the `branch_data` query param to get the branch key. 6600 | */ 6601 | file_key: string 6602 | } 6603 | 6604 | /** 6605 | * Query parameters for GET /v1/files/{file_key}/versions 6606 | */ 6607 | export type GetFileVersionsQueryParams = { 6608 | /** 6609 | * The number of items returned in a page of the response. If not included, `page_size` is `30`. 6610 | */ 6611 | page_size?: number 6612 | /** 6613 | * A version ID for one of the versions in the history. Gets versions before this ID. Used for 6614 | * paginating. If the response is not paginated, this link returns the same data in the current 6615 | * response. 6616 | */ 6617 | before?: number 6618 | /** 6619 | * A version ID for one of the versions in the history. Gets versions after this ID. Used for 6620 | * paginating. If the response is not paginated, this property is not included. 6621 | */ 6622 | after?: number 6623 | } 6624 | 6625 | /** 6626 | * Path parameters for GET /v1/files/{file_key}/comments 6627 | */ 6628 | export type GetCommentsPathParams = { 6629 | /** 6630 | * File to get comments from. This can be a file key or branch key. Use `GET /v1/files/:key` with 6631 | * the `branch_data` query param to get the branch key. 6632 | */ 6633 | file_key: string 6634 | } 6635 | 6636 | /** 6637 | * Query parameters for GET /v1/files/{file_key}/comments 6638 | */ 6639 | export type GetCommentsQueryParams = { 6640 | /** 6641 | * If enabled, will return comments as their markdown equivalents when applicable. 6642 | */ 6643 | as_md?: boolean 6644 | } 6645 | 6646 | /** 6647 | * Path parameters for POST /v1/files/{file_key}/comments 6648 | */ 6649 | export type PostCommentPathParams = { 6650 | /** 6651 | * File to add comments in. This can be a file key or branch key. Use `GET /v1/files/:key` with the 6652 | * `branch_data` query param to get the branch key. 6653 | */ 6654 | file_key: string 6655 | } 6656 | 6657 | /** 6658 | * Request body parameters for POST /v1/files/{file_key}/comments 6659 | */ 6660 | export type PostCommentRequestBody = { 6661 | /** 6662 | * The text contents of the comment to post. 6663 | */ 6664 | message: string 6665 | 6666 | /** 6667 | * The ID of the comment to reply to, if any. This must be a root comment. You cannot reply to other 6668 | * replies (a comment that has a parent_id). 6669 | */ 6670 | comment_id?: string 6671 | 6672 | /** 6673 | * The position where to place the comment. 6674 | */ 6675 | client_meta?: Vector | FrameOffset | Region | FrameOffsetRegion 6676 | } 6677 | 6678 | /** 6679 | * Path parameters for DELETE /v1/files/{file_key}/comments/{comment_id} 6680 | */ 6681 | export type DeleteCommentPathParams = { 6682 | /** 6683 | * File to delete comment from. This can be a file key or branch key. Use `GET /v1/files/:key` with 6684 | * the `branch_data` query param to get the branch key. 6685 | */ 6686 | file_key: string 6687 | /** 6688 | * Comment id of comment to delete 6689 | */ 6690 | comment_id: string 6691 | } 6692 | 6693 | /** 6694 | * Path parameters for DELETE /v1/files/{file_key}/comments/{comment_id}/reactions 6695 | */ 6696 | export type DeleteCommentReactionPathParams = { 6697 | /** 6698 | * File to delete comment reaction from. This can be a file key or branch key. Use `GET 6699 | * /v1/files/:key` with the `branch_data` query param to get the branch key. 6700 | */ 6701 | file_key: string 6702 | /** 6703 | * ID of comment to delete reaction from. 6704 | */ 6705 | comment_id: string 6706 | } 6707 | 6708 | /** 6709 | * Query parameters for DELETE /v1/files/{file_key}/comments/{comment_id}/reactions 6710 | */ 6711 | export type DeleteCommentReactionQueryParams = { emoji: Emoji } 6712 | 6713 | /** 6714 | * Path parameters for GET /v1/files/{file_key}/comments/{comment_id}/reactions 6715 | */ 6716 | export type GetCommentReactionsPathParams = { 6717 | /** 6718 | * File to get comment containing reactions from. This can be a file key or branch key. Use `GET 6719 | * /v1/files/:key` with the `branch_data` query param to get the branch key. 6720 | */ 6721 | file_key: string 6722 | /** 6723 | * ID of comment to get reactions from. 6724 | */ 6725 | comment_id: string 6726 | } 6727 | 6728 | /** 6729 | * Query parameters for GET /v1/files/{file_key}/comments/{comment_id}/reactions 6730 | */ 6731 | export type GetCommentReactionsQueryParams = { 6732 | /** 6733 | * Cursor for pagination, retrieved from the response of the previous call. 6734 | */ 6735 | cursor?: string 6736 | } 6737 | 6738 | /** 6739 | * Path parameters for POST /v1/files/{file_key}/comments/{comment_id}/reactions 6740 | */ 6741 | export type PostCommentReactionPathParams = { 6742 | /** 6743 | * File to post comment reactions to. This can be a file key or branch key. Use `GET 6744 | * /v1/files/:key` with the `branch_data` query param to get the branch key. 6745 | */ 6746 | file_key: string 6747 | /** 6748 | * ID of comment to react to. 6749 | */ 6750 | comment_id: string 6751 | } 6752 | 6753 | /** 6754 | * Request body parameters for POST /v1/files/{file_key}/comments/{comment_id}/reactions 6755 | */ 6756 | export type PostCommentReactionRequestBody = { emoji: Emoji } 6757 | 6758 | /** 6759 | * Path parameters for GET /v1/teams/{team_id}/components 6760 | */ 6761 | export type GetTeamComponentsPathParams = { 6762 | /** 6763 | * Id of the team to list components from. 6764 | */ 6765 | team_id: string 6766 | } 6767 | 6768 | /** 6769 | * Query parameters for GET /v1/teams/{team_id}/components 6770 | */ 6771 | export type GetTeamComponentsQueryParams = { 6772 | /** 6773 | * Number of items to return in a paged list of results. Defaults to 30. Maximum of 1000. 6774 | */ 6775 | page_size?: number 6776 | /** 6777 | * Cursor indicating which id after which to start retrieving components for. Exclusive with before. 6778 | * The cursor value is an internally tracked integer that doesn't correspond to any Ids. 6779 | */ 6780 | after?: number 6781 | /** 6782 | * Cursor indicating which id before which to start retrieving components for. Exclusive with after. 6783 | * The cursor value is an internally tracked integer that doesn't correspond to any Ids. 6784 | */ 6785 | before?: number 6786 | } 6787 | 6788 | /** 6789 | * Path parameters for GET /v1/files/{file_key}/components 6790 | */ 6791 | export type GetFileComponentsPathParams = { 6792 | /** 6793 | * File to list components from. This must be a main file key, not a branch key, as it is not 6794 | * possible to publish from branches. 6795 | */ 6796 | file_key: string 6797 | } 6798 | 6799 | /** 6800 | * Path parameters for GET /v1/components/{key} 6801 | */ 6802 | export type GetComponentPathParams = { 6803 | /** 6804 | * The unique identifier of the component. 6805 | */ 6806 | key: string 6807 | } 6808 | 6809 | /** 6810 | * Path parameters for GET /v1/teams/{team_id}/component_sets 6811 | */ 6812 | export type GetTeamComponentSetsPathParams = { 6813 | /** 6814 | * Id of the team to list component sets from. 6815 | */ 6816 | team_id: string 6817 | } 6818 | 6819 | /** 6820 | * Query parameters for GET /v1/teams/{team_id}/component_sets 6821 | */ 6822 | export type GetTeamComponentSetsQueryParams = { 6823 | /** 6824 | * Number of items to return in a paged list of results. Defaults to 30. 6825 | */ 6826 | page_size?: number 6827 | /** 6828 | * Cursor indicating which id after which to start retrieving component sets for. Exclusive with 6829 | * before. The cursor value is an internally tracked integer that doesn't correspond to any Ids. 6830 | */ 6831 | after?: number 6832 | /** 6833 | * Cursor indicating which id before which to start retrieving component sets for. Exclusive with 6834 | * after. The cursor value is an internally tracked integer that doesn't correspond to any Ids. 6835 | */ 6836 | before?: number 6837 | } 6838 | 6839 | /** 6840 | * Path parameters for GET /v1/files/{file_key}/component_sets 6841 | */ 6842 | export type GetFileComponentSetsPathParams = { 6843 | /** 6844 | * File to list component sets from. This must be a main file key, not a branch key, as it is not 6845 | * possible to publish from branches. 6846 | */ 6847 | file_key: string 6848 | } 6849 | 6850 | /** 6851 | * Path parameters for GET /v1/component_sets/{key} 6852 | */ 6853 | export type GetComponentSetPathParams = { 6854 | /** 6855 | * The unique identifier of the component set. 6856 | */ 6857 | key: string 6858 | } 6859 | 6860 | /** 6861 | * Path parameters for GET /v1/teams/{team_id}/styles 6862 | */ 6863 | export type GetTeamStylesPathParams = { 6864 | /** 6865 | * Id of the team to list styles from. 6866 | */ 6867 | team_id: string 6868 | } 6869 | 6870 | /** 6871 | * Query parameters for GET /v1/teams/{team_id}/styles 6872 | */ 6873 | export type GetTeamStylesQueryParams = { 6874 | /** 6875 | * Number of items to return in a paged list of results. Defaults to 30. 6876 | */ 6877 | page_size?: number 6878 | /** 6879 | * Cursor indicating which id after which to start retrieving styles for. Exclusive with before. The 6880 | * cursor value is an internally tracked integer that doesn't correspond to any Ids. 6881 | */ 6882 | after?: number 6883 | /** 6884 | * Cursor indicating which id before which to start retrieving styles for. Exclusive with after. The 6885 | * cursor value is an internally tracked integer that doesn't correspond to any Ids. 6886 | */ 6887 | before?: number 6888 | } 6889 | 6890 | /** 6891 | * Path parameters for GET /v1/files/{file_key}/styles 6892 | */ 6893 | export type GetFileStylesPathParams = { 6894 | /** 6895 | * File to list styles from. This must be a main file key, not a branch key, as it is not possible 6896 | * to publish from branches. 6897 | */ 6898 | file_key: string 6899 | } 6900 | 6901 | /** 6902 | * Path parameters for GET /v1/styles/{key} 6903 | */ 6904 | export type GetStylePathParams = { 6905 | /** 6906 | * The unique identifier of the style. 6907 | */ 6908 | key: string 6909 | } 6910 | 6911 | /** 6912 | * Query parameters for GET /v2/webhooks 6913 | */ 6914 | export type GetWebhooksQueryParams = { 6915 | /** 6916 | * Context to create the resource on. Should be "team", "project", or "file". 6917 | */ 6918 | context?: string 6919 | /** 6920 | * The id of the context that you want to get attached webhooks for. If you're using context_id, you 6921 | * cannot use plan_api_id. 6922 | */ 6923 | context_id?: string 6924 | /** 6925 | * The id of your plan. Use this to get all webhooks for all contexts you have access to. If you're 6926 | * using plan_api_id, you cannot use context or context_id. When you use plan_api_id, the response 6927 | * is paginated. 6928 | */ 6929 | plan_api_id?: string 6930 | /** 6931 | * If you're using plan_api_id, this is the cursor to use for pagination. If you're using context or 6932 | * context_id, this parameter is ignored. Provide the next_page or prev_page value from the previous 6933 | * response to get the next or previous page of results. 6934 | */ 6935 | cursor?: string 6936 | } 6937 | 6938 | /** 6939 | * Request body parameters for POST /v2/webhooks 6940 | */ 6941 | export type PostWebhookRequestBody = { 6942 | event_type: WebhookV2Event 6943 | 6944 | /** 6945 | * Team id to receive updates about. This is deprecated, use 'context' and 'context_id' instead. 6946 | * 6947 | * @deprecated 6948 | */ 6949 | team_id?: string 6950 | 6951 | /** 6952 | * Context to create the webhook for. Must be "team", "project", or "file". 6953 | */ 6954 | context: string 6955 | 6956 | /** 6957 | * The id of the context you want to receive updates about. 6958 | */ 6959 | context_id: string 6960 | 6961 | /** 6962 | * The HTTP endpoint that will receive a POST request when the event triggers. Max length 2048 6963 | * characters. 6964 | */ 6965 | endpoint: string 6966 | 6967 | /** 6968 | * String that will be passed back to your webhook endpoint to verify that it is being called by 6969 | * Figma. Max length 100 characters. 6970 | */ 6971 | passcode: string 6972 | 6973 | /** 6974 | * State of the webhook, including any error state it may be in 6975 | */ 6976 | status?: WebhookV2Status 6977 | 6978 | /** 6979 | * User provided description or name for the webhook. Max length 150 characters. 6980 | */ 6981 | description?: string 6982 | } 6983 | 6984 | /** 6985 | * Path parameters for DELETE /v2/webhooks/{webhook_id} 6986 | */ 6987 | export type DeleteWebhookPathParams = { 6988 | /** 6989 | * ID of webhook to delete 6990 | */ 6991 | webhook_id: string 6992 | } 6993 | 6994 | /** 6995 | * Path parameters for GET /v2/webhooks/{webhook_id} 6996 | */ 6997 | export type GetWebhookPathParams = { 6998 | /** 6999 | * ID of webhook to get 7000 | */ 7001 | webhook_id: string 7002 | } 7003 | 7004 | /** 7005 | * Path parameters for PUT /v2/webhooks/{webhook_id} 7006 | */ 7007 | export type PutWebhookPathParams = { 7008 | /** 7009 | * ID of webhook to update 7010 | */ 7011 | webhook_id: string 7012 | } 7013 | 7014 | /** 7015 | * Request body parameters for PUT /v2/webhooks/{webhook_id} 7016 | */ 7017 | export type PutWebhookRequestBody = { 7018 | event_type: WebhookV2Event 7019 | 7020 | /** 7021 | * The HTTP endpoint that will receive a POST request when the event triggers. Max length 2048 7022 | * characters. 7023 | */ 7024 | endpoint: string 7025 | 7026 | /** 7027 | * String that will be passed back to your webhook endpoint to verify that it is being called by 7028 | * Figma. Max length 100 characters. 7029 | */ 7030 | passcode: string 7031 | 7032 | /** 7033 | * State of the webhook, including any error state it may be in 7034 | */ 7035 | status?: WebhookV2Status 7036 | 7037 | /** 7038 | * User provided description or name for the webhook. Max length 150 characters. 7039 | */ 7040 | description?: string 7041 | } 7042 | 7043 | /** 7044 | * Path parameters for GET /v2/teams/{team_id}/webhooks 7045 | */ 7046 | export type GetTeamWebhooksPathParams = { 7047 | /** 7048 | * ID of team to get webhooks for 7049 | */ 7050 | team_id: string 7051 | } 7052 | 7053 | /** 7054 | * Path parameters for GET /v2/webhooks/{webhook_id}/requests 7055 | */ 7056 | export type GetWebhookRequestsPathParams = { 7057 | /** 7058 | * The id of the webhook subscription you want to see events from 7059 | */ 7060 | webhook_id: string 7061 | } 7062 | 7063 | /** 7064 | * Query parameters for GET /v1/activity_logs 7065 | */ 7066 | export type GetActivityLogsQueryParams = { 7067 | /** 7068 | * Event type(s) to include in the response. Can have multiple values separated by comma. All 7069 | * events are returned by default. 7070 | */ 7071 | events?: string 7072 | /** 7073 | * Unix timestamp of the least recent event to include. This param defaults to one year ago if 7074 | * unspecified. 7075 | */ 7076 | start_time?: number 7077 | /** 7078 | * Unix timestamp of the most recent event to include. This param defaults to the current timestamp 7079 | * if unspecified. 7080 | */ 7081 | end_time?: number 7082 | /** 7083 | * Maximum number of events to return. This param defaults to 1000 if unspecified. 7084 | */ 7085 | limit?: number 7086 | /** 7087 | * Event order by timestamp. This param can be either "asc" (default) or "desc". 7088 | */ 7089 | order?: 'asc' | 'desc' 7090 | } 7091 | 7092 | /** 7093 | * Query parameters for GET /v1/payments 7094 | */ 7095 | export type GetPaymentsQueryParams = { 7096 | /** 7097 | * Short-lived token returned from "getPluginPaymentTokenAsync" in the plugin payments API and used 7098 | * to authenticate to this endpoint. Read more about generating this token through "Calling the 7099 | * Payments REST API from a plugin or widget" below. 7100 | */ 7101 | plugin_payment_token?: string 7102 | /** 7103 | * The ID of the user to query payment information about. You can get the user ID by having the user 7104 | * OAuth2 to the Figma REST API. 7105 | */ 7106 | user_id?: string 7107 | /** 7108 | * The ID of the Community file to query a user's payment information on. You can get the Community 7109 | * file ID from the file's Community page (look for the number after "file/" in the URL). Provide 7110 | * exactly one of "community_file_id", "plugin_id", or "widget_id". 7111 | */ 7112 | community_file_id?: string 7113 | /** 7114 | * The ID of the plugin to query a user's payment information on. You can get the plugin ID from the 7115 | * plugin's manifest, or from the plugin's Community page (look for the number after "plugin/" in 7116 | * the URL). Provide exactly one of "community_file_id", "plugin_id", or "widget_id". 7117 | */ 7118 | plugin_id?: string 7119 | /** 7120 | * The ID of the widget to query a user's payment information on. You can get the widget ID from the 7121 | * widget's manifest, or from the widget's Community page (look for the number after "widget/" in 7122 | * the URL). Provide exactly one of "community_file_id", "plugin_id", or "widget_id". 7123 | */ 7124 | widget_id?: string 7125 | } 7126 | 7127 | /** 7128 | * Path parameters for GET /v1/files/{file_key}/variables/local 7129 | */ 7130 | export type GetLocalVariablesPathParams = { 7131 | /** 7132 | * File to get variables from. This can be a file key or branch key. Use `GET /v1/files/:key` with 7133 | * the `branch_data` query param to get the branch key. 7134 | */ 7135 | file_key: string 7136 | } 7137 | 7138 | /** 7139 | * Path parameters for GET /v1/files/{file_key}/variables/published 7140 | */ 7141 | export type GetPublishedVariablesPathParams = { 7142 | /** 7143 | * File to get variables from. This must be a main file key, not a branch key, as it is not 7144 | * possible to publish from branches. 7145 | */ 7146 | file_key: string 7147 | } 7148 | 7149 | /** 7150 | * Path parameters for POST /v1/files/{file_key}/variables 7151 | */ 7152 | export type PostVariablesPathParams = { 7153 | /** 7154 | * File to modify variables in. This can be a file key or branch key. Use `GET /v1/files/:key` with 7155 | * the `branch_data` query param to get the branch key. 7156 | */ 7157 | file_key: string 7158 | } 7159 | 7160 | /** 7161 | * Request body parameters for POST /v1/files/{file_key}/variables 7162 | */ 7163 | export type PostVariablesRequestBody = { 7164 | /** 7165 | * For creating, updating, and deleting variable collections. 7166 | */ 7167 | variableCollections?: VariableCollectionChange[] 7168 | 7169 | /** 7170 | * For creating, updating, and deleting modes within variable collections. 7171 | */ 7172 | variableModes?: VariableModeChange[] 7173 | 7174 | /** 7175 | * For creating, updating, and deleting variables. 7176 | */ 7177 | variables?: VariableChange[] 7178 | 7179 | /** 7180 | * For setting a specific value, given a variable and a mode. 7181 | */ 7182 | variableModeValues?: VariableModeValue[] 7183 | } 7184 | 7185 | /** 7186 | * Path parameters for GET /v1/files/{file_key}/dev_resources 7187 | */ 7188 | export type GetDevResourcesPathParams = { 7189 | /** 7190 | * The file to get the dev resources from. This must be a main file key, not a branch key. 7191 | */ 7192 | file_key: string 7193 | } 7194 | 7195 | /** 7196 | * Query parameters for GET /v1/files/{file_key}/dev_resources 7197 | */ 7198 | export type GetDevResourcesQueryParams = { 7199 | /** 7200 | * Comma separated list of nodes that you care about in the document. If specified, only dev 7201 | * resources attached to these nodes will be returned. If not specified, all dev resources in the 7202 | * file will be returned. 7203 | */ 7204 | node_ids?: string 7205 | } 7206 | 7207 | /** 7208 | * Request body parameters for POST /v1/dev_resources 7209 | */ 7210 | export type PostDevResourcesRequestBody = { 7211 | /** 7212 | * An array of dev resources. 7213 | */ 7214 | dev_resources: { 7215 | /** 7216 | * The name of the dev resource. 7217 | */ 7218 | name: string 7219 | 7220 | /** 7221 | * The URL of the dev resource. 7222 | */ 7223 | url: string 7224 | 7225 | /** 7226 | * The file key where the dev resource belongs. 7227 | */ 7228 | file_key: string 7229 | 7230 | /** 7231 | * The target node to attach the dev resource to. 7232 | */ 7233 | node_id: string 7234 | }[] 7235 | } 7236 | 7237 | /** 7238 | * Request body parameters for PUT /v1/dev_resources 7239 | */ 7240 | export type PutDevResourcesRequestBody = { 7241 | /** 7242 | * An array of dev resources. 7243 | */ 7244 | dev_resources: { 7245 | /** 7246 | * Unique identifier of the dev resource 7247 | */ 7248 | id: string 7249 | 7250 | /** 7251 | * The name of the dev resource. 7252 | */ 7253 | name?: string 7254 | 7255 | /** 7256 | * The URL of the dev resource. 7257 | */ 7258 | url?: string 7259 | }[] 7260 | } 7261 | 7262 | /** 7263 | * Path parameters for DELETE /v1/files/{file_key}/dev_resources/{dev_resource_id} 7264 | */ 7265 | export type DeleteDevResourcePathParams = { 7266 | /** 7267 | * The file to delete the dev resource from. This must be a main file key, not a branch key. 7268 | */ 7269 | file_key: string 7270 | /** 7271 | * The id of the dev resource to delete. 7272 | */ 7273 | dev_resource_id: string 7274 | } 7275 | 7276 | /** 7277 | * Path parameters for GET /v1/analytics/libraries/{file_key}/component/actions 7278 | */ 7279 | export type GetLibraryAnalyticsComponentActionsPathParams = { 7280 | /** 7281 | * File key of the library to fetch analytics data for. 7282 | */ 7283 | file_key: string 7284 | } 7285 | 7286 | /** 7287 | * Query parameters for GET /v1/analytics/libraries/{file_key}/component/actions 7288 | */ 7289 | export type GetLibraryAnalyticsComponentActionsQueryParams = { 7290 | /** 7291 | * Cursor indicating what page of data to fetch. Obtained from prior API call. 7292 | */ 7293 | cursor?: string 7294 | /** 7295 | * A dimension to group returned analytics data by. 7296 | */ 7297 | group_by: 'component' | 'team' 7298 | /** 7299 | * ISO 8601 date string (YYYY-MM-DD) of the earliest week to include. Dates are rounded back to the 7300 | * nearest start of a week. Defaults to one year prior. 7301 | */ 7302 | start_date?: string 7303 | /** 7304 | * ISO 8601 date string (YYYY-MM-DD) of the latest week to include. Dates are rounded forward to the 7305 | * nearest end of a week. Defaults to the latest computed week. 7306 | */ 7307 | end_date?: string 7308 | } 7309 | 7310 | /** 7311 | * Path parameters for GET /v1/analytics/libraries/{file_key}/component/usages 7312 | */ 7313 | export type GetLibraryAnalyticsComponentUsagesPathParams = { 7314 | /** 7315 | * File key of the library to fetch analytics data for. 7316 | */ 7317 | file_key: string 7318 | } 7319 | 7320 | /** 7321 | * Query parameters for GET /v1/analytics/libraries/{file_key}/component/usages 7322 | */ 7323 | export type GetLibraryAnalyticsComponentUsagesQueryParams = { 7324 | /** 7325 | * Cursor indicating what page of data to fetch. Obtained from prior API call. 7326 | */ 7327 | cursor?: string 7328 | /** 7329 | * A dimension to group returned analytics data by. 7330 | */ 7331 | group_by: 'component' | 'file' 7332 | } 7333 | 7334 | /** 7335 | * Path parameters for GET /v1/analytics/libraries/{file_key}/style/actions 7336 | */ 7337 | export type GetLibraryAnalyticsStyleActionsPathParams = { 7338 | /** 7339 | * File key of the library to fetch analytics data for. 7340 | */ 7341 | file_key: string 7342 | } 7343 | 7344 | /** 7345 | * Query parameters for GET /v1/analytics/libraries/{file_key}/style/actions 7346 | */ 7347 | export type GetLibraryAnalyticsStyleActionsQueryParams = { 7348 | /** 7349 | * Cursor indicating what page of data to fetch. Obtained from prior API call. 7350 | */ 7351 | cursor?: string 7352 | /** 7353 | * A dimension to group returned analytics data by. 7354 | */ 7355 | group_by: 'style' | 'team' 7356 | /** 7357 | * ISO 8601 date string (YYYY-MM-DD) of the earliest week to include. Dates are rounded back to the 7358 | * nearest start of a week. Defaults to one year prior. 7359 | */ 7360 | start_date?: string 7361 | /** 7362 | * ISO 8601 date string (YYYY-MM-DD) of the latest week to include. Dates are rounded forward to the 7363 | * nearest end of a week. Defaults to the latest computed week. 7364 | */ 7365 | end_date?: string 7366 | } 7367 | 7368 | /** 7369 | * Path parameters for GET /v1/analytics/libraries/{file_key}/style/usages 7370 | */ 7371 | export type GetLibraryAnalyticsStyleUsagesPathParams = { 7372 | /** 7373 | * File key of the library to fetch analytics data for. 7374 | */ 7375 | file_key: string 7376 | } 7377 | 7378 | /** 7379 | * Query parameters for GET /v1/analytics/libraries/{file_key}/style/usages 7380 | */ 7381 | export type GetLibraryAnalyticsStyleUsagesQueryParams = { 7382 | /** 7383 | * Cursor indicating what page of data to fetch. Obtained from prior API call. 7384 | */ 7385 | cursor?: string 7386 | /** 7387 | * A dimension to group returned analytics data by. 7388 | */ 7389 | group_by: 'style' | 'file' 7390 | } 7391 | 7392 | /** 7393 | * Path parameters for GET /v1/analytics/libraries/{file_key}/variable/actions 7394 | */ 7395 | export type GetLibraryAnalyticsVariableActionsPathParams = { 7396 | /** 7397 | * File key of the library to fetch analytics data for. 7398 | */ 7399 | file_key: string 7400 | } 7401 | 7402 | /** 7403 | * Query parameters for GET /v1/analytics/libraries/{file_key}/variable/actions 7404 | */ 7405 | export type GetLibraryAnalyticsVariableActionsQueryParams = { 7406 | /** 7407 | * Cursor indicating what page of data to fetch. Obtained from prior API call. 7408 | */ 7409 | cursor?: string 7410 | /** 7411 | * A dimension to group returned analytics data by. 7412 | */ 7413 | group_by: 'variable' | 'team' 7414 | /** 7415 | * ISO 8601 date string (YYYY-MM-DD) of the earliest week to include. Dates are rounded back to the 7416 | * nearest start of a week. Defaults to one year prior. 7417 | */ 7418 | start_date?: string 7419 | /** 7420 | * ISO 8601 date string (YYYY-MM-DD) of the latest week to include. Dates are rounded forward to the 7421 | * nearest end of a week. Defaults to the latest computed week. 7422 | */ 7423 | end_date?: string 7424 | } 7425 | 7426 | /** 7427 | * Path parameters for GET /v1/analytics/libraries/{file_key}/variable/usages 7428 | */ 7429 | export type GetLibraryAnalyticsVariableUsagesPathParams = { 7430 | /** 7431 | * File key of the library to fetch analytics data for. 7432 | */ 7433 | file_key: string 7434 | } 7435 | 7436 | /** 7437 | * Query parameters for GET /v1/analytics/libraries/{file_key}/variable/usages 7438 | */ 7439 | export type GetLibraryAnalyticsVariableUsagesQueryParams = { 7440 | /** 7441 | * Cursor indicating what page of data to fetch. Obtained from prior API call. 7442 | */ 7443 | cursor?: string 7444 | /** 7445 | * A dimension to group returned analytics data by. 7446 | */ 7447 | group_by: 'variable' | 'file' 7448 | } 7449 | --------------------------------------------------------------------------------