VariableCollection
Variable Collection properties
A Variable collection is a grouping of related Variable objects each with the same modes.
id
id: string [readonly]The unique identifier of this variable collection.
name
name: stringThe name of this variable collection.
hiddenFromPublishing
hiddenFromPublishing: booleanWhether this variable collection is hidden when publishing the current file as a library. Can only true if remote is false (e.g. this is a local variable collection).
getPublishStatusAsync
getPublishStatusAsync(): Promise<PublishStatus>Returns the publishing status of this variable collection in the current file.
remote
remote: boolean [readonly]Whether this variable collection is remote or local.
modes
modes: Array<{ modeId: string; name: string }> [readonly]The list of modes defined for this variable collection.
variableIds
variableIds: string[] [readonly]The list of variables contained in this variable collection. Note that the order of these variables is roughly the same as what is shown in Pixso Design, however it does not account for groups. As a result, the order of these variables may not exactly reflect the exact ordering and grouping shown in the authoring UI.
defaultModeId
defaultModeId: string [readonly]The default mode ID for this collection.
key
key: string [readonly]The key to use with getVariablesInLibraryCollectionAsync. Note that while this key is present on local and published variable collections, TeamLibaryAPI can only be used to query the variables of variable collections that are already published.
remove
remove(): voidRemoves this variable collection and all of its variables from the document.
removeMode
removeMode(modeId: string): voidRemoves the given mode by ID.
addMode
addMode(name: string): stringAdds a new mode with the given name to this collection. Returns the newly created mode ID.
renameMode
renameMode(modeId: string, newName: string): voidRenames the given mode.
Plugin data properties
getPluginData
getPluginData(key: string): stringRetrieves custom information that was stored on this node or style using setPluginData. If there is no data stored for the provided key, an empty string is returned.
setPluginData
setPluginData(key: string, value: string): voidLets you store custom information on any node or style, private to your plugin. The total size of your entry (pluginId, key, value) cannot exceed 100 kB.
getPluginDataKeys
getPluginDataKeys(): string[]Retrieves a list of all keys stored on this node or style using using setPluginData. This enables iterating through all data stored privately on a node or style by your plugin.
getSharedPluginData
getSharedPluginData(namespace: string, key: string): stringRetrieves custom information that was stored on this node or style using setSharedPluginData. If there is no data stored for the provided namespace and key, an empty string is returned.
setSharedPluginData
setSharedPluginData(namespace: string, key: string, value: string): voidLets you store custom information on any node or style, public to all plugins. The total size of your entry (namespace, key, value) cannot exceed 100 kB.
getSharedPluginDataKeys
getSharedPluginDataKeys(namespace: string): string[]Retrieves a list of all keys stored on this node or style using using setSharedPluginData. This enables iterating through all data stored publicly on a node or style by your plugin.