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?
See
Parameters
Parameter | Type | Description |
---|---|---|
mode | string | the name of the mode |
Returns
boolean
Source
packages/@theemo/figma/src/config.ts:155
formats?
optional formats: ColorConfig;
The formats in which tokens are written to disk
Source
packages/@theemo/figma/src/config.ts:195
getConstraints()?
optional getConstraints: (mode, variable) => void | Partial<FeatureConstraints & ScopeConstraint>;
Returns the constraints for a considered mode
See
Parameters
Parameter | Type | Description |
---|---|---|
mode | string | the name of the mode |
variable | FigmaVariable | Figma Variable |
Returns
void
| Partial
<FeatureConstraints
& ScopeConstraint
>
Source
packages/@theemo/figma/src/config.ts:166
getNameFromStyle()?
optional getNameFromStyle: (style) => string;
To retrieve the name for a token from a Style
See
Parameters
Parameter | Type | Description |
---|---|---|
style | Style | Figma Style |
Returns
string
Source
packages/@theemo/figma/src/config.ts:87
getNameFromText()?
optional getNameFromText: (node) => string;
To retrieve the name for a token from a Node
See
Parameters
Parameter | Type | Description |
---|---|---|
node | Node <"TEXT" > | Figma Text Node |
Returns
string
Source
packages/@theemo/figma/src/config.ts:112
getNameFromVariable()?
optional getNameFromVariable: (variable) => string;
Retrieve the token name for the given variable
See
Parameters
Parameter | Type | Description |
---|---|---|
variable | FigmaVariable | Figma Variable |
Returns
string
Source
packages/@theemo/figma/src/config.ts:146
getPropertiesForToken()?
optional getPropertiesForToken: (token, document) => Record<string, unknown>;
Add properties relevant for you to the token.
See
Parameters
Parameter | Type | Description |
---|---|---|
token | FigmaToken <"unknown" > | Figma Token |
document | File | The Figma File from which this token was sourced |
Returns
Record
<string
, unknown
>
Source
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
See
Parameters
Parameter | Type | Description |
---|---|---|
token | FigmaToken <"unknown" > | Figma Token |
Returns
keyof TokenTypeRegistry
Source
packages/@theemo/figma/src/config.ts:180
getValueFromText()?
optional getValueFromText: (node) => unknown;
To retrieve the value for a token from a Node
See
Parameters
Parameter | Type | Description |
---|---|---|
node | Node <"TEXT" > | Figma Text Node |
Returns
unknown
Source
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
See
Parameters
Parameter | Type | Description |
---|---|---|
style | Style | Figma Style |
Returns
boolean
Source
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
See
Parameters
Parameter | Type | Description |
---|---|---|
node | Node <"TEXT" > | Figma Text Node |
Returns
boolean
Source
packages/@theemo/figma/src/config.ts:102
isTokenByVariable()?
optional isTokenByVariable: (variable) => boolean;
Should this variable be considered a token, or not?
See
Parameters
Parameter | Type | Description |
---|---|---|
variable | FigmaVariable | Figma Variable |
Returns
boolean