Theemo / @theemo/figma / Plugin
Interface: Plugin
Defined in: packages/figma/src/plugin.ts:11
A Plugin
which can be used to help parse tokens when being used in the figmaReader()
See
Methods
getPluginData()?
optional getPluginData(): string;
Defined in: packages/figma/src/plugin.ts:32
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
getProperties()?
optional getProperties(token): Partial<Token<"unknown">>;
Defined in: packages/figma/src/plugin.ts:42
Any additional properties to a token, that your plugin is fetching can be attached to the token here
Parameters
Parameter | Type | Description |
---|---|---|
token | FigmaToken | the FigmaToken |
Returns
Partial
<Token
<"unknown"
>>
any additional token properties from your plugin
See
FigmaParserConfig.getProperties
parse()?
optional parse(file, fileId): TokenCollection<FigmaToken<"unknown">>;
Defined in: packages/figma/src/plugin.ts:50
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"
>>
resolve()?
optional resolve(token, tokens): FigmaToken;
Defined in: packages/figma/src/plugin.ts:59
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 | the token to be resolved |
tokens | TokenCollection <FigmaToken <"unknown" >> | all tokens |
Returns
setup()?
optional setup(config): void | Promise<void>;
Defined in: packages/figma/src/plugin.ts:17
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
>