Skip to content

Commit 93f1cc3

Browse files
committed
fix: allow token value to be string for all types (references)
1 parent a611e37 commit 93f1cc3

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.changeset/tiny-shoes-explain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tokens-studio/types': patch
3+
---
4+
5+
Allow token value to be string for any token types, since it can always be a reference which is of type string.

src/types/tokens/SingleGenericToken.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import { ColorModifier } from '../Modifier.js';
44
type _SingleGenericToken<T, V, Named, P> = {
55
type?: T;
66
$type?: T;
7-
value?: V;
8-
$value?: V;
9-
rawValue?: V;
7+
value?: V & string; // & string because token value can always be a reference!
8+
$value?: V & string;
9+
rawValue?: V & string;
1010
description?: string;
1111
$description?: string;
1212
oldDescription?: string;
13-
oldValue?: V;
13+
oldValue?: V & string;
1414
internal__Parent?: string;
1515
inheritTypeLevel?: number;
1616
$extensions?: { 'studio.tokens': { modify: ColorModifier } };

0 commit comments

Comments
 (0)