Theemo / @theemo/figma / FigmaParserConfig
Interface: FigmaParserConfig
Configuration for Figma Parser
Properties
considerMode()?
optional considerMode: (mode) => boolean;
Should this mode considered to be used for tokens?
Parameters
Parameter | Type | Description |
---|---|---|
mode | string | the name of the mode |
Returns
boolean
true, when the mode is used for tokens
See
Defined in
packages/@theemo/figma/src/config.ts:155
formats?
optional formats: ColorConfig;
The formats in which tokens are written to disk
Defined in
packages/@theemo/figma/src/config.ts:195
getConstraints()?
optional getConstraints: (mode, variable) => undefined | Partial<FeatureConstraints & ScopeConstraint>;
Returns the constraints for a considered mode
Parameters
Parameter | Type | Description |
---|---|---|
mode | string | the name of the mode |
variable | FigmaVariable | Figma Variable |
Returns
undefined
| Partial
<FeatureConstraints
& ScopeConstraint
>
the constraints for the given mode
See
Defined in
packages/@theemo/figma/src/config.ts:166
getNameFromStyle()?
optional getNameFromStyle: (style) => string;
To retrieve the name for a token from a Style
Parameters
Parameter | Type | Description |
---|---|---|
style | Style | Figma Style |
Returns
string
the name for the given style
See
Defined in
packages/@theemo/figma/src/config.ts:87
getNameFromText()?
optional getNameFromText: (node) => string;
To retrieve the name for a token from a Node
Parameters
Parameter | Type | Description |
---|---|---|
node | Node <"TEXT" > | Figma Text Node |
Returns
string
the token name for the text node
See
Defined in
packages/@theemo/figma/src/config.ts:112
getNameFromVariable()?
optional getNameFromVariable: (variable) => string;
Retrieve the token name for the given variable
Parameters
Parameter | Type | Description |
---|---|---|
variable | FigmaVariable | Figma Variable |
Returns
string
the token name for the variable
See
Defined in
packages/@theemo/figma/src/config.ts:146
getPropertiesForToken()?
optional getPropertiesForToken: (token, document) => Record<string, unknown>;
Add properties relevant for you to the token.
Parameters
Parameter | Type | Description |
---|---|---|
token | FigmaToken <"unknown" > | Figma Token |
document | File | The Figma File from which this token was sourced |
Returns
Record
<string
, unknown
>
an object with properties
See
Defined in
packages/@theemo/figma/src/config.ts:190
getTypeFromToken()?
optional getTypeFromToken: (token) => keyof TokenTypeRegistry;
When the type of a token was detected incorrectly or is missing for some other reasons, here is a chance to provide it
Parameters
Parameter | Type | Description |
---|---|---|
token | FigmaToken <"unknown" > | Figma Token |
Returns
keyof TokenTypeRegistry
the type of a token
See
Defined in
packages/@theemo/figma/src/config.ts:180
getValueFromText()?
optional getValueFromText: (node) => unknown;
To retrieve the value for a token from a Node
Parameters
Parameter | Type | Description |
---|---|---|
node | Node <"TEXT" > | Figma Text Node |
Returns
unknown
the token value of that text node
See
Defined in
packages/@theemo/figma/src/config.ts:122
isTokenByStyle()?
optional isTokenByStyle: (style) => boolean;
This is to verify that a given Style
node found in figmas node tree is considered to be a token or not
Parameters
Parameter | Type | Description |
---|---|---|
style | Style | Figma Style |
Returns
boolean
true, when this style should be considered a token
See
Defined in
packages/@theemo/figma/src/config.ts:77
isTokenByText()?
optional isTokenByText: (node) => boolean;
This is to verify that a given Node
found in figmas node tree is considered to be a token or not, depending on the name of the node
Parameters
Parameter | Type | Description |
---|---|---|
node | Node <"TEXT" > | Figma Text Node |
Returns
boolean
true, when this text node should be considered a token
See
Defined in
packages/@theemo/figma/src/config.ts:102
isTokenByVariable()?
optional isTokenByVariable: (variable) => boolean;
Should this variable be considered a token, or not?
Parameters
Parameter | Type | Description |
---|---|---|
variable | FigmaVariable | Figma Variable |
Returns
boolean
true, when this variable is considered to be atoken