From 51dd910b7a323c9634ecd7b41e2e7880018dd997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Mon, 19 Jan 2026 16:33:08 +0100 Subject: [PATCH] :books: Document better the tokens value in plugins API --- plugins/libs/plugin-types/index.d.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins/libs/plugin-types/index.d.ts b/plugins/libs/plugin-types/index.d.ts index 57b29ff591..1430931602 100644 --- a/plugins/libs/plugin-types/index.d.ts +++ b/plugins/libs/plugin-types/index.d.ts @@ -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.