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?

See

Documentation

Parameters

ParameterTypeDescription
modestringthe name of the mode

Returns

boolean

Source

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


formats?

ts
optional formats: ColorConfig;

The formats in which tokens are written to disk

Source

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


getConstraints()?

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

Returns the constraints for a considered mode

See

Parameters

ParameterTypeDescription
modestringthe name of the mode
variableFigmaVariableFigma Variable

Returns

void | Partial<FeatureConstraints & ScopeConstraint>

Source

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


getNameFromStyle()?

ts
optional getNameFromStyle: (style) => string;

To retrieve the name for a token from a Style

See

Parameters

ParameterTypeDescription
styleStyleFigma Style

Returns

string

Source

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


getNameFromText()?

ts
optional getNameFromText: (node) => string;

To retrieve the name for a token from a Node

See

Parameters

ParameterTypeDescription
nodeNode<"TEXT">Figma Text Node

Returns

string

Source

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


getNameFromVariable()?

ts
optional getNameFromVariable: (variable) => string;

Retrieve the token name for the given variable

See

Parameters

ParameterTypeDescription
variableFigmaVariableFigma Variable

Returns

string

Source

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


getPropertiesForToken()?

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

Add properties relevant for you to the token.

See

Documentation

Parameters

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

Returns

Record<string, unknown>

Source

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

See

Documentation

Parameters

ParameterTypeDescription
tokenFigmaToken<"unknown">Figma Token

Returns

keyof TokenTypeRegistry

Source

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


getValueFromText()?

ts
optional getValueFromText: (node) => unknown;

To retrieve the value for a token from a Node

See

Parameters

ParameterTypeDescription
nodeNode<"TEXT">Figma Text Node

Returns

unknown

Source

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

See

Parameters

ParameterTypeDescription
styleStyleFigma Style

Returns

boolean

Source

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

See

Parameters

ParameterTypeDescription
nodeNode<"TEXT">Figma Text Node

Returns

boolean

Source

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


isTokenByVariable()?

ts
optional isTokenByVariable: (variable) => boolean;

Should this variable be considered a token, or not?

See

Parameters

ParameterTypeDescription
variableFigmaVariableFigma Variable

Returns

boolean

Source

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