📚 Document better the tokens value in plugins API

This commit is contained in:
Andrés Moya
2026-01-19 16:33:08 +01:00
parent 8e79469611
commit 51dd910b7a

View File

@@ -4960,6 +4960,15 @@ export interface TokenTypography extends TokenBase {
readonly resolvedValue: TokenTypographyValue[] | undefined;
}
/**
* Any possible type of value field in a token.
*/
export type TokenValueString =
| TokenShadowValueString
| TokenTypographyValueString
| string
| string[];
/**
* The supported Design Tokens in Penpot.
*/
@@ -5086,9 +5095,10 @@ export interface TokenSet {
* @param type Thetype of token.
* @param name The name of the token (required). It may contain
* a group path, separated by `.`.
* @param value The value of the token (required), in the string form.
* @return Returns the created Token.
*/
addToken(type: TokenType, name: string, value: unknown): Token;
addToken(type: TokenType, name: string, value: TokenValueString): Token;
/**
* Adds to the catalog a new TokenSet equal to this one but with a new id.