Function List
Following is a reference list of all blueprint functions to obtain design system data:
Available Functions
ds.tokenGroupContainingTokenId
configuration
Tokens
ds.allTokens
This function retrieves all tokens from the targeted design system as a flattened array. Note that this function will retrieve all tokens of all types. If you want tokens for just one type, use ds.tokensByType with appropriate type instead.
ds.tokensByType
This function retrieves all tokens of a specified type from the targeted design system as a flattened array. The type can be any of the design token types.
ds.tokensByGroupId
Because groups don't contain the tokens they carry by default (only their IDs in tokenIds property), this function retrieves all tokens of a specified group from the targeted design system as a flattened array. The type can be any of the design token types.
Token Groups
ds.allTokenGroups
This function retrieves all token groups as a flat list.
Note that this function doesn't retrieve tokens that belong to this group. To fetch the token values as well, request the tokens by using ds.tokensByGroupId(group.id) for each group that you are interested in.
ds.allTokenGroupTrees
Similarly to ds.allTokenGroups , this function retrieves all token groups defined inside the design system. However, in this case, instead of returning all groups a flat array, it returns trees instead. There will be exactly as many trees in the resulting array as there are token categories (ie. one for colors, one for gradients, and so on).
This function always gets you the root of each category. You can iterate through the tree recursively by using traverse flow, recursive for variant.
ds.tokenGroupsOfType
This function retrieves all token groups of one token type as a flat list. The result is the same as with ds.allTokenGroups, but other types than the provided one are filtered out.
ds.tokenGroupTreeByType
Similarly to ds.allTokenGroups , this function retrieves all token groups defined inside the design system for one specific token type. However, in this case, instead of returning all groups a flat array, it returns the root group instead. There is always only one root group per token type, so the result of this call is an object.
You can iterate through the tree recursively by using traverse flow, recursive for variant.
ds.tokenGroupContainingTokenId
This function retrieves the group that directly contains the provided token id. There is always one group that contains one design token. This function is especially useful in injected blueprints, as you don't have to be passing groups with tokens - and can just request them instead.
Design Systems
ds.currentDesignSystem
This function retrieves metadata about the design system which is currently executed. You can use it to enhance exported files with additional information such as the design system name.
Design System Versions
ds.currentDesignSystemVersion
This function retrieves the design system version which is currently executed. You can use it to enhance exported files with additional information such as the version name.
ds.allDesignSystemVersions
This function retrieves all design system versions for the design system that is being used when exporting. You can, for example, use it to quickly create release notes of the entire design system.
Configuration
configuration
This function retrieves the exporter configuration. You can read more about it in a section dedicated to exporter configuration.
Last updated
Was this helpful?