Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 54 additions & 7 deletions dist/api_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,10 @@ export type IndividualStrokesTrait = {
individualStrokeWeights?: StrokeWeights
}

export type VariableWidthStrokesTrait = object

export type ComplexStrokesTrait = object

export type CornerTrait = {
/**
* Radius of each corner if a single radius is set for all corners
Expand Down Expand Up @@ -795,6 +799,8 @@ export type DevStatusTrait = {

export type AnnotationsTrait = object

export type TransformModifiersTrait = object

export type FrameTraits = IsLayerTrait &
HasBlendModeAndOpacityTrait &
HasChildrenTrait &
Expand All @@ -807,6 +813,8 @@ export type FrameTraits = IsLayerTrait &
HasMaskTrait &
TransitionSourceTrait &
IndividualStrokesTrait &
VariableWidthStrokesTrait &
ComplexStrokesTrait &
DevStatusTrait &
AnnotationsTrait

Expand All @@ -817,7 +825,9 @@ export type DefaultShapeTraits = IsLayerTrait &
HasExportSettingsTrait &
HasEffectsTrait &
HasMaskTrait &
TransitionSourceTrait
TransitionSourceTrait &
VariableWidthStrokesTrait &
ComplexStrokesTrait

export type CornerRadiusShapeTraits = DefaultShapeTraits & CornerTrait

Expand Down Expand Up @@ -1087,7 +1097,8 @@ export type TransformGroupNode = {
* The type of this node, represented by the string literal "TRANSFORM_GROUP"
*/
type: 'TRANSFORM_GROUP'
} & FrameTraits
} & FrameTraits &
TransformModifiersTrait

export type SliceNode = {
/**
Expand Down Expand Up @@ -4360,6 +4371,12 @@ export type LocalVariableCollection = {
*/
modeId: string

/**
* The unique identifier of this mode's parent mode from the parent variable collection. This will
* be `undefined` if this mode does not inherit from a parent mode.
*/
parentModeId?: string

/**
* The name of this mode.
*/
Expand All @@ -4376,6 +4393,23 @@ export type LocalVariableCollection = {
*/
remote: boolean

/**
* Whether this variable collection is an extension of another variable collection.
*/
isExtension?: boolean

/**
* The id of the parent variable collection that this variable collection is an extension of. If
* this variable collection is not an extension, this value will be `undefined`.
*/
parentVariableCollectionId?: string

/**
* The overrides for the variables in this variable collection as a map of variable ids to a map of
* mode ids to variable values.
*/
variableOverrides?: { [key: string]: { [key: string]: VariableValue } }

/**
* Whether this variable collection is hidden when publishing the current file as a library.
*/
Expand Down Expand Up @@ -4568,6 +4602,17 @@ export type VariableCollectionCreate = {
* Whether this variable collection is hidden when publishing the current file as a library.
*/
hiddenFromPublishing?: boolean

/**
* The id of the parent variable collection that this variable collection is extending from.
*/
parentVariableCollectionId?: string

/**
* Maps inherited modes from the parent variable collection to the initial mode ids on the extended
* variable collection.
*/
initialModeIdToParentModeIdMapping?: { [key: string]: string }
}

/**
Expand Down Expand Up @@ -4636,7 +4681,7 @@ export type VariableModeCreate = {

/**
* The variable collection that will contain the mode. You can use the temporary id of a variable
* collection.
* collection. New modes cannot be created on extended collections.
*/
variableCollectionId: string
}
Expand All @@ -4661,7 +4706,7 @@ export type VariableModeUpdate = {
name?: string

/**
* The variable collection that contains the mode.
* The variable collection that contains the mode. Modes cannot be updated on extended collections.
*/
variableCollectionId: string
}
Expand All @@ -4676,7 +4721,8 @@ export type VariableModeDelete = {
action: 'DELETE'

/**
* The id of the variable mode to delete.
* The id of the variable mode to delete. Modes cannot be deleted on extended collections unless its
* parent mode has been deleted.
*/
id: string
}
Expand Down Expand Up @@ -4806,9 +4852,10 @@ export type VariableModeValue = {

/**
* The value for the variable. The value must match the variable's type. If setting to a variable
* alias, the alias must resolve to this type.
* alias, the alias must resolve to this type. If overriding a value, the value type must match the
* variable's type. If removing an overridden value, the value must be `null`.
*/
export type VariableValue = boolean | number | string | RGB | RGBA | VariableAlias
export type VariableValue = boolean | number | string | RGB | RGBA | VariableAlias | null

/**
* A dev resource in a file
Expand Down
62 changes: 57 additions & 5 deletions openapi/openapi.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
openapi: 3.1.0
info:
title: Figma API
version: 0.34.0
version: 0.35.0
description: |-
This is the OpenAPI specification for the [Figma REST API](https://www.figma.com/developers/api).

Expand Down Expand Up @@ -3290,6 +3290,12 @@ components:
$ref: "#/components/schemas/StrokeWeights"
description: An object including the top, bottom, left, and right stroke
weights. Only returned if individual stroke weights are used.
VariableWidthStrokesTrait:
type: object
properties: {}
ComplexStrokesTrait:
type: object
properties: {}
CornerTrait:
type: object
properties:
Expand Down Expand Up @@ -3453,6 +3459,7 @@ components:
- style
- characterStyleOverrides
- styleOverrideTable
- textPathStartData
HasTextSublayerTrait:
type: object
properties:
Expand Down Expand Up @@ -3504,6 +3511,9 @@ components:
AnnotationsTrait:
type: object
properties: {}
TransformModifiersTrait:
type: object
properties: {}
FrameTraits:
allOf:
- $ref: "#/components/schemas/IsLayerTrait"
Expand All @@ -3518,6 +3528,8 @@ components:
- $ref: "#/components/schemas/HasMaskTrait"
- $ref: "#/components/schemas/TransitionSourceTrait"
- $ref: "#/components/schemas/IndividualStrokesTrait"
- $ref: "#/components/schemas/VariableWidthStrokesTrait"
- $ref: "#/components/schemas/ComplexStrokesTrait"
- $ref: "#/components/schemas/DevStatusTrait"
- $ref: "#/components/schemas/AnnotationsTrait"
DefaultShapeTraits:
Expand All @@ -3530,6 +3542,8 @@ components:
- $ref: "#/components/schemas/HasEffectsTrait"
- $ref: "#/components/schemas/HasMaskTrait"
- $ref: "#/components/schemas/TransitionSourceTrait"
- $ref: "#/components/schemas/VariableWidthStrokesTrait"
- $ref: "#/components/schemas/ComplexStrokesTrait"
CornerRadiusShapeTraits:
allOf:
- $ref: "#/components/schemas/DefaultShapeTraits"
Expand Down Expand Up @@ -3985,6 +3999,7 @@ components:
required:
- type
- $ref: "#/components/schemas/FrameTraits"
- $ref: "#/components/schemas/TransformModifiersTrait"
SliceNode:
allOf:
- type: object
Expand Down Expand Up @@ -7646,6 +7661,11 @@ components:
modeId:
type: string
description: The unique identifier of this mode.
parentModeId:
type: string
description: The unique identifier of this mode's parent mode from the parent
variable collection. This will be `undefined` if this mode
does not inherit from a parent mode.
name:
type: string
description: The name of this mode.
Expand All @@ -7658,6 +7678,23 @@ components:
remote:
type: boolean
description: Whether this variable collection is remote.
isExtension:
type: boolean
description: Whether this variable collection is an extension of another
variable collection.
parentVariableCollectionId:
type: string
description: The id of the parent variable collection that this variable
collection is an extension of. If this variable collection is not an
extension, this value will be `undefined`.
variableOverrides:
type: object
description: The overrides for the variables in this variable collection as a
map of variable ids to a map of mode ids to variable values.
additionalProperties:
type: object
additionalProperties:
$ref: "#/components/schemas/VariableValue"
hiddenFromPublishing:
type: boolean
description: Whether this variable collection is hidden when publishing the
Expand Down Expand Up @@ -7845,6 +7882,16 @@ components:
description: Whether this variable collection is hidden when publishing the
current file as a library.
default: false
parentVariableCollectionId:
type: string
description: The id of the parent variable collection that this variable
collection is extending from.
initialModeIdToParentModeIdMapping:
type: object
description: Maps inherited modes from the parent variable collection to the
initial mode ids on the extended variable collection.
additionalProperties:
type: string
required:
- action
- name
Expand Down Expand Up @@ -7915,7 +7962,8 @@ components:
variableCollectionId:
type: string
description: The variable collection that will contain the mode. You can use the
temporary id of a variable collection.
temporary id of a variable collection. New modes cannot be created
on extended collections.
required:
- action
- name
Expand All @@ -7937,7 +7985,8 @@ components:
description: The name of this variable mode.
variableCollectionId:
type: string
description: The variable collection that contains the mode.
description: The variable collection that contains the mode. Modes cannot be
updated on extended collections.
required:
- action
- id
Expand All @@ -7953,7 +8002,8 @@ components:
- DELETE
id:
type: string
description: The id of the variable mode to delete.
description: The id of the variable mode to delete. Modes cannot be deleted on
extended collections unless its parent mode has been deleted.
required:
- action
- id
Expand Down Expand Up @@ -8094,14 +8144,16 @@ components:
VariableValue:
description: The value for the variable. The value must match the variable's
type. If setting to a variable alias, the alias must resolve to this
type.
type. If overriding a value, the value type must match the variable's
type. If removing an overridden value, the value must be `null`.
oneOf:
- type: boolean
- type: number
- type: string
- $ref: "#/components/schemas/RGB"
- $ref: "#/components/schemas/RGBA"
- $ref: "#/components/schemas/VariableAlias"
- type: "null"
DevResource:
type: object
description: A dev resource in a file
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@figma/rest-api-spec",
"version": "0.34.0",
"version": "0.35.0",
"description": "Typings for the Figma REST API",
"main": "dist/api_types.ts",
"repository": {
Expand Down