Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support pluginData and sharedPluginData on files #54

Merged
merged 1 commit into from
Feb 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/figmaTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ export interface Global {
readonly visible?: boolean;
/** the type of the node, refer to table below for details */
readonly type: NodeType;
/** data written by plugins that is visible only to the plugin that wrote it. Requires the `pluginData` to include the ID of the plugin. */
readonly pluginData?: any;
/** data written by plugins that is visible to all plugins. Requires the `pluginData` parameter to include the string "shared". */
readonly sharedPluginData?: any;
}

/**
Expand Down
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export interface FileParams {
* Set to "paths" to export vector data
*/
readonly geometry?: string;

/**
* A comma separated list of plugin IDs and/or the string "shared".
* Any data present in the document written by those plugins will be included in the result in the `pluginData` and `sharedPluginData` properties.
*/
readonly plugin_data?: string;
}

export interface FileNodesParams {
Expand All @@ -41,6 +47,12 @@ export interface FileNodesParams {
* Set to "paths" to export vector data
*/
readonly geometry?: string;

/**
* A comma separated list of plugin IDs and/or the string "shared".
* Any data present in the document written by those plugins will be included in the result in the `pluginData` and `sharedPluginData` properties.
*/
readonly plugin_data?: string;
}

export type exportFormatOptions = 'jpg' | 'png' | 'svg' | 'pdf';
Expand Down