Theemo / @theemo/figma / Plugin
Interface: Plugin
A Plugin
which can be used to help parse tokens when being used in the figmaReader()
See
Methods
getPluginData()?
optional getPluginData(): string
Figma plugins can store data and make it accessible through the REST API.
Your reader plugin has the chance to read that information here.
The value here will be appended when making a GET request to Figma. Such as:
GET /v1/files/:key?plugin_data=S{YOUR_PLUGIN_DATA}
Returns
string
See
Defined in
packages/@theemo/figma/src/plugin.ts:32
getProperties()?
optional getProperties(token): Partial<Token<"unknown">>
Any additional properties to a token, that your plugin is fetching can be attached to the token here
Parameters
Parameter | Type | Description |
---|---|---|
token | FigmaToken <"unknown" > | the FigmaToken |
Returns
Partial
<Token
<"unknown"
>>
any additional token properties from your plugin
See
FigmaParserConfig.getProperties
Defined in
packages/@theemo/figma/src/plugin.ts:42
parse()?
optional parse(file, fileId): TokenCollection<FigmaToken<"unknown">>
Your plugin can parse a source file
Parameters
Parameter | Type | Description |
---|---|---|
file | File | the entire file itself |
fileId | string | the fileId |
Returns
TokenCollection
<FigmaToken
<"unknown"
>>
Defined in
packages/@theemo/figma/src/plugin.ts:50
resolve()?
optional resolve(token, tokens): FigmaToken<"unknown">
Resolving tokens, in case your plugin stores information needed to resolve tokens. Use this method to support resolving tokens.
Parameters
Parameter | Type | Description |
---|---|---|
token | FigmaToken <"unknown" > | the token to be resolved |
tokens | TokenCollection <FigmaToken <"unknown" >> | all tokens |
Returns
FigmaToken
<"unknown"
>
Defined in
packages/@theemo/figma/src/plugin.ts:59
setup()?
optional setup(config): void | Promise<void>
Any setup step required for your plugin.
Parameters
Parameter | Type | Description |
---|---|---|
config | FigmaParserConfigWithDefaults | Receivse the Figma Reader Parser config with defaults |
Returns
void
| Promise
<void
>