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