Skip to content

VariableCollection ​

Variable Collection properties ​

A Variable collection is a grouping of related Variable objects each with the same modes.

id ​

typescript
id: string [readonly]

The unique identifier of this variable collection.

name ​

typescript
name: string

The name of this variable collection.

hiddenFromPublishing ​

typescript
hiddenFromPublishing: boolean

Whether 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 ​

typescript
getPublishStatusAsync(): Promise<PublishStatus>

Returns the publishing status of this variable collection in the current file.

remote ​

typescript
remote: boolean [readonly]

Whether this variable collection is remote or local.

modes ​

typescript
modes: Array<{ modeId: string; name: string }> [readonly]

The list of modes defined for this variable collection.

variableIds ​

typescript
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 ​

typescript
defaultModeId: string [readonly]

The default mode ID for this collection.

key ​

typescript
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 ​

typescript
remove(): void

Removes this variable collection and all of its variables from the document.

removeMode ​

typescript
removeMode(modeId: string): void

Removes the given mode by ID.

addMode ​

typescript
addMode(name: string): string

Adds a new mode with the given name to this collection. Returns the newly created mode ID.

renameMode ​

typescript
renameMode(modeId: string, newName: string): void

Renames the given mode.

Plugin data properties ​

getPluginData ​

typescript
getPluginData(key: string): string

Retrieves 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 ​

typescript
setPluginData(key: string, value: string): void

Lets 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 ​

typescript
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 ​

typescript
getSharedPluginData(namespace: string, key: string): string

Retrieves 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 ​

typescript
setSharedPluginData(namespace: string, key: string, value: string): void

Lets 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 ​

typescript
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.