Skip to content

Theemo / @theemo/figma / FigmaParserConfig

Interface: FigmaParserConfig

Configuration for Figma Parser

Properties

considerMode()?

ts
optional considerMode: (mode) => boolean;

Should this mode considered to be used for tokens?

Parameters

ParameterTypeDescription
modestringthe name of the mode

Returns

boolean

true, when the mode is used for tokens

See

Documentation

Defined in

packages/@theemo/figma/src/config.ts:155


formats?

ts
optional formats: ColorConfig;

The formats in which tokens are written to disk

Defined in

packages/@theemo/figma/src/config.ts:195


getConstraints()?

ts
optional getConstraints: (mode, variable) => undefined | Partial<FeatureConstraints & ScopeConstraint>;

Returns the constraints for a considered mode

Parameters

ParameterTypeDescription
modestringthe name of the mode
variableFigmaVariableFigma Variable

Returns

undefined | Partial<FeatureConstraints & ScopeConstraint>

the constraints for the given mode

See

Defined in

packages/@theemo/figma/src/config.ts:166


getNameFromStyle()?

ts
optional getNameFromStyle: (style) => string;

To retrieve the name for a token from a Style

Parameters

ParameterTypeDescription
styleStyleFigma Style

Returns

string

the name for the given style

See

Defined in

packages/@theemo/figma/src/config.ts:87


getNameFromText()?

ts
optional getNameFromText: (node) => string;

To retrieve the name for a token from a Node

Parameters

ParameterTypeDescription
nodeNode<"TEXT">Figma Text Node

Returns

string

the token name for the text node

See

Defined in

packages/@theemo/figma/src/config.ts:112


getNameFromVariable()?

ts
optional getNameFromVariable: (variable) => string;

Retrieve the token name for the given variable

Parameters

ParameterTypeDescription
variableFigmaVariableFigma Variable

Returns

string

the token name for the variable

See

Defined in

packages/@theemo/figma/src/config.ts:146


getPropertiesForToken()?

ts
optional getPropertiesForToken: (token, document) => Record<string, unknown>;

Add properties relevant for you to the token.

Parameters

ParameterTypeDescription
tokenFigmaToken<"unknown">Figma Token
documentFileThe Figma File from which this token was sourced

Returns

Record<string, unknown>

an object with properties

See

Documentation

Defined in

packages/@theemo/figma/src/config.ts:190


getTypeFromToken()?

ts
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

ParameterTypeDescription
tokenFigmaToken<"unknown">Figma Token

Returns

keyof TokenTypeRegistry

the type of a token

See

Documentation

Defined in

packages/@theemo/figma/src/config.ts:180


getValueFromText()?

ts
optional getValueFromText: (node) => unknown;

To retrieve the value for a token from a Node

Parameters

ParameterTypeDescription
nodeNode<"TEXT">Figma Text Node

Returns

unknown

the token value of that text node

See

Defined in

packages/@theemo/figma/src/config.ts:122


isTokenByStyle()?

ts
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

ParameterTypeDescription
styleStyleFigma Style

Returns

boolean

true, when this style should be considered a token

See

Defined in

packages/@theemo/figma/src/config.ts:77


isTokenByText()?

ts
optional isTokenByText: (node) => boolean;

This is to verify that a given Nodefound in figmas node tree is considered to be a token or not, depending on the name of the node

Parameters

ParameterTypeDescription
nodeNode<"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()?

ts
optional isTokenByVariable: (variable) => boolean;

Should this variable be considered a token, or not?

Parameters

ParameterTypeDescription
variableFigmaVariableFigma Variable

Returns

boolean

true, when this variable is considered to be atoken

See

Defined in

packages/@theemo/figma/src/config.ts:136