pub struct LocalVariable {
pub id: String,
pub name: String,
pub key: String,
pub variable_collection_id: String,
pub resolved_type: ResolvedType,
pub values_by_mode: HashMap<String, LocalVariableValuesByModeValue>,
pub remote: bool,
pub description: String,
pub hidden_from_publishing: bool,
pub scopes: Vec<VariableScope>,
pub code_syntax: Box<VariableCodeSyntax>,
pub deleted_but_referenced: Option<bool>,
}
Expand description
LocalVariable : A Variable is a single design token that defines values for each of the modes in its VariableCollection. These values can be applied to various kinds of design properties.
Fields§
§id: String
The unique identifier of this variable.
name: String
The name of this variable.
key: String
The key of this variable.
variable_collection_id: String
The id of the variable collection that contains this variable.
resolved_type: ResolvedType
The resolved type of the variable.
values_by_mode: HashMap<String, LocalVariableValuesByModeValue>
The values for each mode of this variable.
remote: bool
Whether this variable is remote.
description: String
The description of this variable.
Whether this variable is hidden when publishing the current file as a library. If the parent VariableCollection
is marked as hiddenFromPublishing
, then this variable will also be hidden from publishing via the UI. hiddenFromPublishing
is independently toggled for a variable and collection. However, both must be true for a given variable to be publishable.
scopes: Vec<VariableScope>
An array of scopes in the UI where this variable is shown. Setting this property will show/hide this variable in the variable picker UI for different fields. Setting scopes for a variable does not prevent that variable from being bound in other scopes (for example, via the Plugin API). This only limits the variables that are shown in pickers within the Figma UI.
code_syntax: Box<VariableCodeSyntax>
§deleted_but_referenced: Option<bool>
Indicates that the variable was deleted in the editor, but the document may still contain references to the variable. References to the variable may exist through bound values or variable aliases.
Implementations§
Source§impl LocalVariable
impl LocalVariable
Sourcepub fn new(
id: String,
name: String,
key: String,
variable_collection_id: String,
resolved_type: ResolvedType,
values_by_mode: HashMap<String, LocalVariableValuesByModeValue>,
remote: bool,
description: String,
hidden_from_publishing: bool,
scopes: Vec<VariableScope>,
code_syntax: VariableCodeSyntax,
) -> LocalVariable
pub fn new( id: String, name: String, key: String, variable_collection_id: String, resolved_type: ResolvedType, values_by_mode: HashMap<String, LocalVariableValuesByModeValue>, remote: bool, description: String, hidden_from_publishing: bool, scopes: Vec<VariableScope>, code_syntax: VariableCodeSyntax, ) -> LocalVariable
A Variable is a single design token that defines values for each of the modes in its VariableCollection. These values can be applied to various kinds of design properties.
Trait Implementations§
Source§impl Clone for LocalVariable
impl Clone for LocalVariable
Source§fn clone(&self) -> LocalVariable
fn clone(&self) -> LocalVariable
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more