@tokens-studio/tokenscript-interpreter 0.36.4 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/chunk-2EEKBDOX.js +5308 -0
  2. package/dist/chunk-2EEKBDOX.js.map +1 -0
  3. package/dist/chunk-2NMUBWBX.js +5861 -0
  4. package/dist/chunk-2NMUBWBX.js.map +1 -0
  5. package/dist/chunk-2OHE65GL.js +5779 -0
  6. package/dist/chunk-2OHE65GL.js.map +1 -0
  7. package/dist/chunk-2PZR6BQ6.js +5773 -0
  8. package/dist/chunk-2PZR6BQ6.js.map +1 -0
  9. package/dist/chunk-2QDDLPUW.js +5858 -0
  10. package/dist/chunk-2QDDLPUW.js.map +1 -0
  11. package/dist/chunk-4DUQBXYY.js +5762 -0
  12. package/dist/chunk-4DUQBXYY.js.map +1 -0
  13. package/dist/chunk-4SLJE4IW.js +5322 -0
  14. package/dist/chunk-4SLJE4IW.js.map +1 -0
  15. package/dist/chunk-6ABZOYUP.js +5802 -0
  16. package/dist/chunk-6ABZOYUP.js.map +1 -0
  17. package/dist/chunk-6HQZVWXZ.js +5341 -0
  18. package/dist/chunk-6HQZVWXZ.js.map +1 -0
  19. package/dist/chunk-6UY773C4.js +5292 -0
  20. package/dist/chunk-6UY773C4.js.map +1 -0
  21. package/dist/chunk-75Z55XEZ.js +5681 -0
  22. package/dist/chunk-75Z55XEZ.js.map +1 -0
  23. package/dist/chunk-7IWYKR22.js +5778 -0
  24. package/dist/chunk-7IWYKR22.js.map +1 -0
  25. package/dist/chunk-AVZUAMNS.js +5757 -0
  26. package/dist/chunk-AVZUAMNS.js.map +1 -0
  27. package/dist/chunk-BL7GZSRR.js +5724 -0
  28. package/dist/chunk-BL7GZSRR.js.map +1 -0
  29. package/dist/chunk-BMZ5NY7J.js +93 -0
  30. package/dist/chunk-BMZ5NY7J.js.map +1 -0
  31. package/dist/{chunk-AXH5N7KV.js → chunk-BNLQ6GCU.js} +2 -6
  32. package/dist/chunk-BNLQ6GCU.js.map +1 -0
  33. package/dist/chunk-BSJBGMCX.js +93 -0
  34. package/dist/{chunk-RI2BWY7D.js.map → chunk-BSJBGMCX.js.map} +1 -1
  35. package/dist/chunk-BUJRELXW.js +5342 -0
  36. package/dist/chunk-BUJRELXW.js.map +1 -0
  37. package/dist/chunk-DCOIGXSK.js +5763 -0
  38. package/dist/chunk-DCOIGXSK.js.map +1 -0
  39. package/dist/chunk-DZDZDYPO.js +5654 -0
  40. package/dist/chunk-DZDZDYPO.js.map +1 -0
  41. package/dist/{chunk-OCQX3WYJ.js → chunk-GAE7SZLZ.js} +111 -8
  42. package/dist/chunk-GAE7SZLZ.js.map +1 -0
  43. package/dist/chunk-HFLLWRRV.js +5791 -0
  44. package/dist/chunk-HFLLWRRV.js.map +1 -0
  45. package/dist/{lib/chunk-AEOBCHBK.js → chunk-JL4UU4PY.js} +2 -9
  46. package/dist/chunk-JL4UU4PY.js.map +1 -0
  47. package/dist/{chunk-CKLFRLH7.js → chunk-JUGNHFDN.js} +220 -338
  48. package/dist/chunk-JUGNHFDN.js.map +1 -0
  49. package/dist/{chunk-RI2BWY7D.js → chunk-K2OUSWUX.js} +2 -3
  50. package/dist/chunk-K2OUSWUX.js.map +1 -0
  51. package/dist/chunk-KOLA6XR5.js +5770 -0
  52. package/dist/chunk-KOLA6XR5.js.map +1 -0
  53. package/dist/{chunk-3ZOUTFP5.js → chunk-L77CTMYP.js} +169 -296
  54. package/dist/chunk-L77CTMYP.js.map +1 -0
  55. package/dist/chunk-LIXBSHBJ.js +99 -0
  56. package/dist/chunk-LIXBSHBJ.js.map +1 -0
  57. package/dist/chunk-LM5SZQV5.js +5763 -0
  58. package/dist/chunk-LM5SZQV5.js.map +1 -0
  59. package/dist/chunk-M76AGXPG.js +5772 -0
  60. package/dist/chunk-M76AGXPG.js.map +1 -0
  61. package/dist/{chunk-QP7M6WUR.js → chunk-OV2GMYVM.js} +221 -341
  62. package/dist/chunk-OV2GMYVM.js.map +1 -0
  63. package/dist/{chunk-33CDF4L4.js → chunk-P4VLJQEI.js} +235 -838
  64. package/dist/chunk-P4VLJQEI.js.map +1 -0
  65. package/dist/chunk-QLSMLF5S.js +5302 -0
  66. package/dist/chunk-QLSMLF5S.js.map +1 -0
  67. package/dist/chunk-QYTZHMUN.js +5831 -0
  68. package/dist/chunk-QYTZHMUN.js.map +1 -0
  69. package/dist/chunk-SBM4WTQW.js +5771 -0
  70. package/dist/chunk-SBM4WTQW.js.map +1 -0
  71. package/dist/chunk-UAQCLV6Y.js +5816 -0
  72. package/dist/chunk-UAQCLV6Y.js.map +1 -0
  73. package/dist/chunk-YIZGWYGL.js +5300 -0
  74. package/dist/chunk-YIZGWYGL.js.map +1 -0
  75. package/dist/{chunk-LZTXD3LN.js → chunk-Z437BNC5.js} +10 -3
  76. package/dist/chunk-Z437BNC5.js.map +1 -0
  77. package/dist/cli.js +138 -16
  78. package/dist/cli.js.map +1 -1
  79. package/dist/compliance-suite.js +3 -5
  80. package/dist/compliance-suite.js.map +1 -1
  81. package/dist/config-Bb9I9K-y.d.ts +1005 -0
  82. package/dist/config-Be-GTPYh.d.ts +976 -0
  83. package/dist/config-BkIqJNxv.d.ts +1009 -0
  84. package/dist/config-Cp5BqDfR.d.ts +731 -0
  85. package/dist/config-D36YRJGj.d.ts +1007 -0
  86. package/dist/{config-CFhN7-6U.d.ts → config-DB5rZBMx.d.ts} +109 -17
  87. package/dist/config-DQj8LHMT.d.ts +995 -0
  88. package/dist/{config-Bsd6DPFy.d.ts → config-Mw_Iq324.d.ts} +3 -1
  89. package/dist/{config-DtbN3iyg.d.ts → config-P6Ivo_zY.d.ts} +105 -26
  90. package/dist/config-RCpZF46f.d.ts +960 -0
  91. package/dist/lib/{chunk-K65UI6KX.cjs → chunk-EMRAAGPR.cjs} +102 -100
  92. package/dist/lib/chunk-EMRAAGPR.cjs.map +1 -0
  93. package/dist/lib/{chunk-UF6I25ED.cjs → chunk-JQKYSUJJ.cjs} +685 -567
  94. package/dist/lib/chunk-JQKYSUJJ.cjs.map +1 -0
  95. package/dist/lib/{chunk-S7WGJBSX.js → chunk-MD2DETZV.js} +5 -3
  96. package/dist/lib/chunk-MD2DETZV.js.map +1 -0
  97. package/dist/lib/chunk-SLITBMFB.js +114 -0
  98. package/dist/lib/chunk-SLITBMFB.js.map +1 -0
  99. package/dist/lib/{chunk-2BDFE7U4.js → chunk-VXZQQBEA.js} +132 -15
  100. package/dist/lib/chunk-VXZQQBEA.js.map +1 -0
  101. package/dist/lib/{chunk-KHF2VXWO.cjs → chunk-ZMMIYWFF.cjs} +10 -2
  102. package/dist/lib/chunk-ZMMIYWFF.cjs.map +1 -0
  103. package/dist/lib/index.cjs +99 -91
  104. package/dist/lib/index.d.cts +4 -4
  105. package/dist/lib/index.d.ts +4 -4
  106. package/dist/lib/index.js +3 -3
  107. package/dist/lib/{interpreter-DdF_Hj-J.d.ts → interpreter-ByrEtz7T.d.ts} +54 -4
  108. package/dist/lib/{interpreter-Cz_vWDDa.d.cts → interpreter-CG0Jw_k-.d.cts} +54 -4
  109. package/dist/lib/interpreter.cjs +81 -73
  110. package/dist/lib/interpreter.d.cts +7 -6
  111. package/dist/lib/interpreter.d.ts +7 -6
  112. package/dist/lib/interpreter.js +3 -3
  113. package/dist/lib/processor-node.cjs +12 -12
  114. package/dist/lib/processor-node.d.cts +3 -3
  115. package/dist/lib/processor-node.d.ts +3 -3
  116. package/dist/lib/processor-node.js +3 -3
  117. package/dist/lib/processor.cjs +17 -17
  118. package/dist/lib/processor.d.cts +4 -4
  119. package/dist/lib/processor.d.ts +4 -4
  120. package/dist/lib/processor.js +3 -3
  121. package/dist/lib/schema.cjs +5 -5
  122. package/dist/lib/schema.d.cts +1 -1
  123. package/dist/lib/schema.d.ts +1 -1
  124. package/dist/lib/schema.js +3 -3
  125. package/dist/lib/syntax-highlighting.cjs +15 -15
  126. package/dist/lib/syntax-highlighting.d.cts +1 -1
  127. package/dist/lib/syntax-highlighting.d.ts +1 -1
  128. package/dist/lib/syntax-highlighting.js +2 -2
  129. package/dist/lib/{types-DRpZJjkx.d.ts → types-BZAWM2oN.d.ts} +2 -2
  130. package/dist/lib/{types-6QQt-XVS.d.cts → types-BhyJ6plH.d.cts} +2 -2
  131. package/dist/lib/{types-CxQPMHn1.d.ts → types-DA9_CC7p.d.cts} +3 -1
  132. package/dist/lib/{types-CxQPMHn1.d.cts → types-DA9_CC7p.d.ts} +3 -1
  133. package/dist/lib/types.cjs +10 -6
  134. package/dist/lib/types.d.cts +1 -1
  135. package/dist/lib/types.d.ts +1 -1
  136. package/dist/lib/types.js +1 -1
  137. package/dist/processor/index.d.ts +1 -1
  138. package/dist/processor/index.js +18 -2
  139. package/dist/processor/index.js.map +1 -1
  140. package/dist/repl.d.ts +15 -3
  141. package/dist/repl.js +6 -8
  142. package/dist/repl.js.map +1 -1
  143. package/dist/token-schemas.js +414 -0
  144. package/dist/types.d.ts +1 -1
  145. package/dist/types.js +1 -1
  146. package/package.json +1 -1
  147. package/dist/chunk-33CDF4L4.js.map +0 -1
  148. package/dist/chunk-3ZOUTFP5.js.map +0 -1
  149. package/dist/chunk-5S3H4SYX.js +0 -6460
  150. package/dist/chunk-5S3H4SYX.js.map +0 -1
  151. package/dist/chunk-AXH5N7KV.js.map +0 -1
  152. package/dist/chunk-CKLFRLH7.js.map +0 -1
  153. package/dist/chunk-GJIOYGP6.js +0 -6446
  154. package/dist/chunk-GJIOYGP6.js.map +0 -1
  155. package/dist/chunk-HHCPY4WI.js +0 -6456
  156. package/dist/chunk-HHCPY4WI.js.map +0 -1
  157. package/dist/chunk-LZTXD3LN.js.map +0 -1
  158. package/dist/chunk-MXKGYBE4.js +0 -6457
  159. package/dist/chunk-MXKGYBE4.js.map +0 -1
  160. package/dist/chunk-NGG6MBER.js +0 -6452
  161. package/dist/chunk-NGG6MBER.js.map +0 -1
  162. package/dist/chunk-OCQX3WYJ.js.map +0 -1
  163. package/dist/chunk-QP7M6WUR.js.map +0 -1
  164. package/dist/lib/chunk-2BDFE7U4.js.map +0 -1
  165. package/dist/lib/chunk-AEOBCHBK.js.map +0 -1
  166. package/dist/lib/chunk-K65UI6KX.cjs.map +0 -1
  167. package/dist/lib/chunk-KHF2VXWO.cjs.map +0 -1
  168. package/dist/lib/chunk-S7WGJBSX.js.map +0 -1
  169. package/dist/lib/chunk-UF6I25ED.cjs.map +0 -1
@@ -0,0 +1,960 @@
1
+ declare enum Operations {
2
+ SUBTRACT = "-",
3
+ ADD = "+",
4
+ MULTIPLY = "*",
5
+ DIVIDE = "/",
6
+ POWER = "^",
7
+ LOGIC_AND = "&&",
8
+ LOGIC_OR = "||",
9
+ LOGIC_NOT = "!"
10
+ }
11
+ declare enum SupportedFormats {
12
+ PX = "px",
13
+ EM = "em",
14
+ REM = "rem",
15
+ VW = "vw",
16
+ VH = "vh",
17
+ PT = "pt",
18
+ IN = "in",
19
+ CM = "cm",
20
+ MM = "mm",
21
+ DEG = "deg",
22
+ PERCENTAGE = "%"
23
+ }
24
+ declare enum ReservedKeyword {
25
+ TRUE = "true",
26
+ FALSE = "false",
27
+ NULL = "null",
28
+ UNDEFINED = "undefined",
29
+ WHILE = "while",
30
+ IF = "if",
31
+ ELSE = "else",
32
+ ELIF = "elif",
33
+ RETURN = "return",
34
+ VARIABLE = "variable"
35
+ }
36
+ declare enum TokenType {
37
+ REFERENCE = "REFERENCE",
38
+ NUMBER = "NUMBER",
39
+ OPERATION = "OPERATION",
40
+ FORMAT = "FORMAT",
41
+ LPAREN = "LPAREN",
42
+ RPAREN = "RPAREN",
43
+ EOF = "EOF",
44
+ COMMA = "COMMA",
45
+ HEX_COLOR = "HEX_COLOR",
46
+ STRING = "STRING",
47
+ EXPLICIT_STRING = "EXPLICIT_STRING",
48
+ ASSIGN = "ASSIGN",
49
+ IS_EQ = "IS_EQ",
50
+ IS_GT = "GT",
51
+ IS_LT = "LT",
52
+ IS_GT_EQ = "IS_GT_EQ",
53
+ IS_LT_EQ = "IS_LT_EQ",
54
+ IS_NOT_EQ = "IS_NOT_EQ",
55
+ RESERVED_KEYWORD = "RESERVED_KEYWORD",
56
+ SEMICOLON = "SEMICOLON",
57
+ LOGIC_NOT = "LOGIC_NOT",
58
+ COLON = "COLON",
59
+ DOT = "DOT",
60
+ LOGIC_AND = "LOGIC_AND",
61
+ LOGIC_OR = "LOGIC_OR",
62
+ LBLOCK = "LBLOCK",
63
+ RBLOCK = "RBLOCK"
64
+ }
65
+ interface Token {
66
+ type: TokenType;
67
+ value: any;
68
+ line: number;
69
+ pos: number;
70
+ endPos: number;
71
+ }
72
+ interface ASTNode {
73
+ token?: Token;
74
+ nodeType: string;
75
+ }
76
+ interface ISymbolType {
77
+ type: string;
78
+ value: any;
79
+ cloneIfMutable(): ISymbolType;
80
+ deepCopy(): ISymbolType;
81
+ typeEquals(other: ISymbolType): boolean;
82
+ equals(other: ISymbolType): boolean;
83
+ validValue(value: any): boolean;
84
+ toJSON?(): any;
85
+ toString(): string;
86
+ getTypeName(): string;
87
+ toJs(options?: {
88
+ recursive?: boolean;
89
+ stringify?: boolean;
90
+ }): any;
91
+ hasMethod?(methodName: string, args: ISymbolType[]): boolean;
92
+ callMethod?(methodName: string, args: ISymbolType[]): ISymbolType | null | undefined;
93
+ hasAttribute?(attributeName: string): boolean;
94
+ getAttribute?(attributeName: string): ISymbolType | null;
95
+ setAttribute?(attributeName: string, value: ISymbolType, config?: Config): void;
96
+ }
97
+ declare const UNINTERPRETED_KEYWORDS: string[];
98
+ type ReferenceRecordValue = string | number | ISymbolType;
99
+ type ReferenceRecord = Record<string, ReferenceRecordValue | Array<ReferenceRecordValue>>;
100
+
101
+ declare class IdentifierNode implements ASTNode {
102
+ token: Token;
103
+ nodeType: string;
104
+ name: string;
105
+ constructor(token: Token);
106
+ }
107
+ declare class ReassignNode implements ASTNode {
108
+ identifier: IdentifierNode | IdentifierNode[];
109
+ value: ASTNode;
110
+ token?: Token | undefined;
111
+ nodeType: string;
112
+ constructor(identifier: IdentifierNode | IdentifierNode[], value: ASTNode, token?: Token | undefined);
113
+ baseIdentifier(): IdentifierNode;
114
+ isAttributeAssignment(): boolean;
115
+ identifierToString(): string;
116
+ attributesChain(): IdentifierNode[];
117
+ attributesStringChain(): string[];
118
+ }
119
+
120
+ interface ToJsOptions {
121
+ /** Whether to recursively convert nested values (default: true) */
122
+ recursive?: boolean;
123
+ /** Whether to use toString() for structured types (default: false) */
124
+ stringify?: boolean;
125
+ }
126
+ type SupportedMethods = Record<string, MethodDefinitionDef>;
127
+ interface MethodArgumentDef {
128
+ name: string;
129
+ type: any;
130
+ optional?: boolean;
131
+ }
132
+ interface MethodDefinitionDef {
133
+ name?: string;
134
+ function: (...args: any[]) => ISymbolType | null | undefined;
135
+ args: MethodArgumentDef[];
136
+ returnType: any;
137
+ }
138
+ declare abstract class BaseSymbolType implements ISymbolType {
139
+ abstract type: string;
140
+ value: any | null;
141
+ config?: Config;
142
+ static _SUPPORTED_METHODS?: SupportedMethods;
143
+ constructor(value: any, config?: Config);
144
+ abstract validValue(value: any): boolean;
145
+ /**
146
+ * Forces creating a deepCopy of provided symbol no matter if it's immutable or not.
147
+ */
148
+ abstract deepCopy(): ISymbolType;
149
+ /**
150
+ * Returns a copy of the symbol if it's mutable, otherwise returns the same instance.
151
+ *
152
+ * This method is used to prevent reference sharing issues when storing symbols in
153
+ * containers like lists and dictionaries. Immutable symbols (Number, String, Boolean,
154
+ * NumberWithUnit, Null, hex ColorSymbol) can safely share references since they
155
+ * cannot be modified after creation. Mutable symbols (List, Dictionary, dynamic
156
+ * ColorSymbol) need to be deep copied to prevent unintended mutations.
157
+ *
158
+ * @returns For immutable symbols: returns `this` (same reference)
159
+ * For mutable symbols: returns `this.deepCopy()` (new instance)
160
+ */
161
+ abstract cloneIfMutable(): ISymbolType;
162
+ abstract toJs(options?: ToJsOptions): JsValue;
163
+ toString(): string;
164
+ getTypeName(): string;
165
+ typeEquals(other: ISymbolType): boolean;
166
+ equals(other: ISymbolType): boolean;
167
+ hasMethod?(methodName: string, args: ISymbolType[]): boolean;
168
+ callMethod?(methodName: string, args: ISymbolType[]): ISymbolType | null | undefined;
169
+ hasAttribute?(_attributeName: string): boolean;
170
+ getAttribute?(attributeName: string): ISymbolType | null;
171
+ setAttribute?(attributeName: string, _value: ISymbolType): void;
172
+ }
173
+ type NumberValue = number | null;
174
+ declare class NumberSymbol extends BaseSymbolType {
175
+ type: string;
176
+ static readonly type = "Number";
177
+ static _SUPPORTED_METHODS: {
178
+ to_string: {
179
+ name: string;
180
+ function: (this: NumberSymbol, radix?: NumberSymbol) => StringSymbol;
181
+ args: {
182
+ name: string;
183
+ type: string;
184
+ optional: boolean;
185
+ }[];
186
+ returnType: string;
187
+ };
188
+ };
189
+ value: NumberValue;
190
+ constructor(value: number | NumberSymbol | NumberWithUnitSymbol | null, config?: Config);
191
+ validValue(val: any): boolean;
192
+ expectSafeValue(val: any): asserts val is number;
193
+ toString(): string;
194
+ deepCopy(): NumberSymbol;
195
+ cloneIfMutable(): NumberSymbol;
196
+ static empty(): NumberSymbol;
197
+ hasAttribute(attributeName: string): boolean;
198
+ getAttribute(attributeName: string): ISymbolType | null;
199
+ toStringSymbol(radix?: NumberSymbol): StringSymbol;
200
+ toJs(_options?: ToJsOptions): NumberValue;
201
+ }
202
+ type StringValue = string | null;
203
+ declare class StringSymbol extends BaseSymbolType {
204
+ type: string;
205
+ static readonly type = "String";
206
+ static _SUPPORTED_METHODS: {
207
+ upper: {
208
+ function: (this: StringSymbol) => StringSymbol;
209
+ args: never[];
210
+ returnType: string;
211
+ };
212
+ lower: {
213
+ function: (this: StringSymbol) => StringSymbol;
214
+ args: never[];
215
+ returnType: string;
216
+ };
217
+ length: {
218
+ function: (this: StringSymbol) => NumberSymbol;
219
+ args: never[];
220
+ returnType: string;
221
+ };
222
+ concat: {
223
+ function: (this: StringSymbol, other: StringSymbol) => StringSymbol;
224
+ args: {
225
+ name: string;
226
+ type: string;
227
+ }[];
228
+ returnType: string;
229
+ };
230
+ split: {
231
+ function: (this: StringSymbol, delimiter?: StringSymbol) => ListSymbol;
232
+ args: {
233
+ name: string;
234
+ type: string;
235
+ optional: boolean;
236
+ }[];
237
+ returnType: string;
238
+ };
239
+ };
240
+ value: StringValue;
241
+ constructor(value: string | StringSymbol | null, config?: Config);
242
+ validValue(val: any): boolean;
243
+ expectSafeValue(val: any): asserts val is string;
244
+ upper(): StringSymbol;
245
+ deepCopy(): StringSymbol;
246
+ cloneIfMutable(): StringSymbol;
247
+ static empty(): StringSymbol;
248
+ lower(): StringSymbol;
249
+ length(): NumberSymbol;
250
+ concat(other: StringSymbol): StringSymbol;
251
+ split(delimiter?: StringSymbol): ListSymbol;
252
+ toJs(_options?: ToJsOptions): StringValue;
253
+ }
254
+ declare class ListSymbol extends BaseSymbolType {
255
+ type: string;
256
+ static readonly type = "List";
257
+ static _SUPPORTED_METHODS: {
258
+ append: {
259
+ function: (this: ListSymbol, item: ISymbolType) => ListSymbol;
260
+ args: {
261
+ name: string;
262
+ type: string;
263
+ }[];
264
+ returnType: string;
265
+ };
266
+ extend: {
267
+ function: (this: ListSymbol, ...items: ISymbolType[]) => ListSymbol;
268
+ args: never[];
269
+ returnType: string;
270
+ };
271
+ insert: {
272
+ function: (this: ListSymbol, index: NumberSymbol, item: ISymbolType) => ListSymbol;
273
+ args: {
274
+ name: string;
275
+ type: string;
276
+ }[];
277
+ returnType: string;
278
+ };
279
+ delete: {
280
+ function: (this: ListSymbol, index: NumberSymbol) => ListSymbol;
281
+ args: {
282
+ name: string;
283
+ type: string;
284
+ }[];
285
+ returnType: string;
286
+ };
287
+ length: {
288
+ function: (this: ListSymbol) => NumberSymbol;
289
+ args: never[];
290
+ returnType: string;
291
+ };
292
+ index: {
293
+ function: (this: ListSymbol, item: ISymbolType) => NumberSymbol;
294
+ args: {
295
+ name: string;
296
+ type: string;
297
+ }[];
298
+ returnType: string;
299
+ };
300
+ get: {
301
+ function: (this: ListSymbol, index: NumberSymbol) => ISymbolType;
302
+ args: {
303
+ name: string;
304
+ type: string;
305
+ }[];
306
+ returnType: string;
307
+ };
308
+ update: {
309
+ function: (this: ListSymbol, index: NumberSymbol, item: ISymbolType) => ListSymbol;
310
+ args: {
311
+ name: string;
312
+ type: string;
313
+ }[];
314
+ returnType: string;
315
+ };
316
+ join: {
317
+ function: (this: ListSymbol, separator?: StringSymbol) => StringSymbol;
318
+ args: {
319
+ name: string;
320
+ type: string;
321
+ optional: boolean;
322
+ }[];
323
+ returnType: string;
324
+ };
325
+ };
326
+ value: ISymbolType[];
327
+ isImplicit: boolean;
328
+ constructor(elements: ISymbolType[] | null, isImplicit?: boolean, config?: Config);
329
+ validValue(val: any): boolean;
330
+ toString(): string;
331
+ append(item: ISymbolType): ListSymbol;
332
+ extend(...items: ISymbolType[]): ListSymbol;
333
+ insert(indexSymbol: NumberSymbol, item: ISymbolType): ListSymbol;
334
+ delete(indexSymbol: NumberSymbol): ListSymbol;
335
+ length(): NumberSymbol;
336
+ index(item: ISymbolType): NumberSymbol;
337
+ get(indexSymbol: NumberSymbol): ISymbolType;
338
+ update(indexSymbol: NumberSymbol, item: ISymbolType): ListSymbol;
339
+ join(separator?: StringSymbol): StringSymbol;
340
+ deepCopy(): ListSymbol;
341
+ cloneIfMutable(): ListSymbol;
342
+ static empty(): ListSymbol;
343
+ getTypeName(): string;
344
+ toJs(options?: ToJsOptions): JsValue[];
345
+ }
346
+ type NumberWithUnitValue = number | null;
347
+ declare class NumberWithUnitSymbol extends BaseSymbolType {
348
+ type: string;
349
+ static readonly type = "NumberWithUnit";
350
+ static _SUPPORTED_METHODS: {
351
+ to_string: {
352
+ name: string;
353
+ function: (this: NumberWithUnitSymbol) => StringSymbol;
354
+ args: {
355
+ name: string;
356
+ type: string;
357
+ optional: boolean;
358
+ }[];
359
+ returnType: string;
360
+ };
361
+ to_number: {
362
+ function: (this: NumberWithUnitSymbol) => NumberSymbol;
363
+ args: never[];
364
+ returnType: string;
365
+ };
366
+ };
367
+ value: NumberWithUnitValue;
368
+ unit: SupportedFormats;
369
+ constructor(value: number | NumberSymbol | null, unit: SupportedFormats | string, config?: Config);
370
+ validValue(val: any): boolean;
371
+ static fromRecord(record: {
372
+ value: number | string;
373
+ unit: string;
374
+ type?: string;
375
+ }, config?: Config): NumberWithUnitSymbol | undefined;
376
+ toString(): string;
377
+ expectSafeValue(val: any): asserts val is number;
378
+ toStringSymbol(): StringSymbol;
379
+ to_number(): NumberSymbol;
380
+ equals(other: ISymbolType): boolean;
381
+ deepCopy(): NumberWithUnitSymbol;
382
+ cloneIfMutable(): NumberWithUnitSymbol;
383
+ static empty(): NumberWithUnitSymbol;
384
+ hasAttribute(attributeName: string): boolean;
385
+ getAttribute(attributeName: string): ISymbolType | null;
386
+ getTypeName(): string;
387
+ toJs(options?: ToJsOptions): string | {
388
+ value: number | null;
389
+ unit: string;
390
+ };
391
+ }
392
+ type TokenValue = Map<string, ISymbolType> | ISymbolType[];
393
+ declare class TokenSymbol extends BaseSymbolType {
394
+ type: string;
395
+ static readonly type = "Token";
396
+ static _SUPPORTED_METHODS: {
397
+ get: {
398
+ function: (this: TokenSymbol, keyOrIndex: StringSymbol | NumberSymbol) => ISymbolType;
399
+ args: {
400
+ name: string;
401
+ type: string;
402
+ optional: boolean;
403
+ }[];
404
+ returnType: string;
405
+ };
406
+ set: {
407
+ function: (this: TokenSymbol, key: StringSymbol, value: ISymbolType) => TokenSymbol;
408
+ args: {
409
+ name: string;
410
+ type: string;
411
+ optional: boolean;
412
+ }[];
413
+ returnType: string;
414
+ };
415
+ keys: {
416
+ function: (this: TokenSymbol) => ListSymbol;
417
+ args: never[];
418
+ returnType: string;
419
+ };
420
+ values: {
421
+ function: (this: TokenSymbol) => ListSymbol;
422
+ args: never[];
423
+ returnType: string;
424
+ };
425
+ length: {
426
+ function: (this: TokenSymbol) => NumberSymbol;
427
+ args: never[];
428
+ returnType: string;
429
+ };
430
+ append: {
431
+ function: (this: TokenSymbol, item: ISymbolType) => TokenSymbol;
432
+ args: {
433
+ name: string;
434
+ type: string;
435
+ }[];
436
+ returnType: string;
437
+ };
438
+ extend: {
439
+ function: (this: TokenSymbol, ...items: ISymbolType[]) => TokenSymbol;
440
+ args: never[];
441
+ returnType: string;
442
+ };
443
+ insert: {
444
+ function: (this: TokenSymbol, index: NumberSymbol, item: ISymbolType) => TokenSymbol;
445
+ args: {
446
+ name: string;
447
+ type: string;
448
+ }[];
449
+ returnType: string;
450
+ };
451
+ delete: {
452
+ function: (this: TokenSymbol, index: NumberSymbol) => TokenSymbol;
453
+ args: {
454
+ name: string;
455
+ type: string;
456
+ }[];
457
+ returnType: string;
458
+ };
459
+ index: {
460
+ function: (this: TokenSymbol, item: ISymbolType) => NumberSymbol;
461
+ args: {
462
+ name: string;
463
+ type: string;
464
+ }[];
465
+ returnType: string;
466
+ };
467
+ update: {
468
+ function: (this: TokenSymbol, index: NumberSymbol, item: ISymbolType) => TokenSymbol;
469
+ args: {
470
+ name: string;
471
+ type: string;
472
+ }[];
473
+ returnType: string;
474
+ };
475
+ join: {
476
+ function: (this: TokenSymbol, separator?: StringSymbol) => StringSymbol;
477
+ args: {
478
+ name: string;
479
+ type: string;
480
+ optional: boolean;
481
+ }[];
482
+ returnType: string;
483
+ };
484
+ };
485
+ subType: string;
486
+ value: TokenValue;
487
+ constructor(subType: string, value: TokenValue | Record<string, ISymbolType> | TokenSymbol | null, config?: Config);
488
+ validValue(val: any): boolean;
489
+ toString(): string;
490
+ get(keyOrIndex: StringSymbol | NumberSymbol | string | number): ISymbolType;
491
+ set(key: StringSymbol, value: ISymbolType): TokenSymbol;
492
+ keys(): ListSymbol;
493
+ values(): ListSymbol;
494
+ length(): NumberSymbol;
495
+ append(item: ISymbolType): TokenSymbol;
496
+ extend(...items: ISymbolType[]): TokenSymbol;
497
+ insert(indexSymbol: NumberSymbol, item: ISymbolType): TokenSymbol;
498
+ delete(indexSymbol: NumberSymbol): TokenSymbol;
499
+ index(item: ISymbolType): NumberSymbol;
500
+ update(indexSymbol: NumberSymbol, item: ISymbolType): TokenSymbol;
501
+ join(separator?: StringSymbol): StringSymbol;
502
+ deepCopy(): TokenSymbol;
503
+ cloneIfMutable(): TokenSymbol;
504
+ static empty(): TokenSymbol;
505
+ hasAttribute(attributeName: string): boolean;
506
+ getAttribute(attributeName: string): ISymbolType | null;
507
+ getTypeName(): string;
508
+ toJs(options?: ToJsOptions): JsValue[] | Record<string, JsValue>;
509
+ }
510
+ type dynamicColorValue = Record<string, ISymbolType>;
511
+ type ColorValue = string | dynamicColorValue | null;
512
+ declare class ColorSymbol extends BaseSymbolType {
513
+ type: string;
514
+ static readonly type = "Color";
515
+ static _SUPPORTED_METHODS: {
516
+ to_string: {
517
+ name: string;
518
+ function: (this: ColorSymbol) => StringSymbol;
519
+ args: never[];
520
+ returnType: string;
521
+ };
522
+ };
523
+ subType: string | null;
524
+ value: ColorValue;
525
+ alpha: number | null;
526
+ static empty(): ColorSymbol;
527
+ constructor(value: ColorValue, subType?: string, alpha?: number | null, config?: Config);
528
+ toStringSymbol(): StringSymbol;
529
+ toString(): string;
530
+ to(targetType: string): ColorSymbol;
531
+ typeEquals(other: ISymbolType): boolean;
532
+ isHex(): boolean;
533
+ validValue(val: any): boolean;
534
+ equals(other: ISymbolType): boolean;
535
+ deepCopy(): ColorSymbol;
536
+ cloneIfMutable(): ColorSymbol;
537
+ hasAttribute(attributeName: string): boolean;
538
+ getAttribute(attributeName: string): ISymbolType | null;
539
+ hasMethod(methodName: string, args: ISymbolType[]): boolean;
540
+ callMethod(methodName: string, args: ISymbolType[]): ISymbolType | null | undefined;
541
+ getTypeName(): string;
542
+ toJs(options?: ToJsOptions): string | Record<string, JsValue>;
543
+ }
544
+ /**
545
+ * Represents a JavaScript value that can be produced from a TokenScript symbol.
546
+ * This includes primitives, arrays, and plain objects (recursively).
547
+ */
548
+ type JsValue = string | number | boolean | null | JsValue[] | {
549
+ [key: string]: JsValue;
550
+ };
551
+
552
+ /**
553
+ * Utilities for working with TokenScript schema URIs
554
+ *
555
+ * Handles URI construction, parsing, and manipulation for the TokenScript schema registry.
556
+ */
557
+ type SemanticVersion = {
558
+ major: number;
559
+ } | {
560
+ major: number;
561
+ minor: number;
562
+ } | {
563
+ major: number;
564
+ minor: number;
565
+ patch: number;
566
+ };
567
+
568
+ type uri = string;
569
+ type specType = string;
570
+ /**
571
+ * Base manager class that provides common functionality for managing specifications,
572
+ * conversions, and BFS-based conversion path resolution.
573
+ */
574
+ declare abstract class BaseManager<TSpec, TInput, TOutput> {
575
+ protected specs: Map<uri, TSpec>;
576
+ protected specTypes: Map<uri, specType>;
577
+ protected conversions: Map<uri, Map<uri, (input: TInput) => TOutput>>;
578
+ protected parentConfig?: Config;
579
+ protected removeVersionFromUri(uri: uri): uri;
580
+ /**
581
+ * Check if two URIs point to the same schema (ignoring version)
582
+ */
583
+ protected isSameSchemaUri(uri1: uri, uri2: uri): boolean;
584
+ /**
585
+ * Parse semantic version from URI
586
+ * Example: "/api/v1/schema/srgb-color/0.0.1/" -> { major: 0, minor: 0, patch: 1 }
587
+ */
588
+ protected parseSemverFromUri(uri: uri): SemanticVersion | null;
589
+ /**
590
+ * Get base URI without version
591
+ * Example: "/api/v1/schema/srgb-color/0.0.1/" -> "/api/v1/schema/srgb-color/"
592
+ */
593
+ protected getBaseUri(uri: uri): uri;
594
+ /**
595
+ * Generate version resolution candidates from most specific to least specific
596
+ * Example: "0.0.1" -> ["0.0.1", "0.0", "0", "latest"]
597
+ */
598
+ protected generateVersionCandidates(uri: uri): uri[];
599
+ /**
600
+ * Find the latest (highest) semantic version for a URI
601
+ */
602
+ protected findLatestVersion(uri: uri): uri | null;
603
+ /**
604
+ * Resolve URI by trying version candidates from most specific to least specific
605
+ */
606
+ protected resolveVersionUri(uri: uri): uri | null;
607
+ /**
608
+ * Find a conversion path from source to target format using BFS with version resolution
609
+ */
610
+ protected findConversionPath(sourceUri: uri, targetUri: uri): uri[];
611
+ /**
612
+ * Check if a conversion path exists between source and target URIs with version resolution
613
+ */
614
+ hasConversion(sourceUri: uri, targetUri: uri): boolean;
615
+ /**
616
+ * Get a specification by its URI with version resolution
617
+ */
618
+ getSpec(uri: uri): TSpec | undefined;
619
+ /**
620
+ * Convert input through a chain of conversions to reach the target URI with version resolution
621
+ */
622
+ protected convertThroughPath(input: TInput, sourceUri: uri, targetUri: uri): TOutput;
623
+ /**
624
+ * Register a conversion function between two URIs
625
+ */
626
+ protected registerConversionFunction(sourceUri: uri, targetUri: uri, conversionFn: (input: TInput) => TOutput): void;
627
+ abstract register(uri: uri, spec: TSpec | specType): TSpec;
628
+ protected abstract getSpecName(spec: TSpec): string;
629
+ /**
630
+ * Abstract method for creating a clone of the manager
631
+ */
632
+ abstract clone(): this;
633
+ /**
634
+ * Set the parent config reference
635
+ */
636
+ setParentConfig(config: Config): void;
637
+ /**
638
+ * Get the parent config reference
639
+ */
640
+ getParentConfig(): Config | undefined;
641
+ /**
642
+ * Creates interpreter configuration with full context for conversion functions and initializers.
643
+ * Uses parent config if available to provide access to all managers and registrations.
644
+ */
645
+ protected createInterpreterConfig(references: Record<string, any>): {
646
+ references: Record<string, any>;
647
+ config?: Config;
648
+ };
649
+ }
650
+
651
+ interface SpecProperty$1 {
652
+ type: "number" | "string" | "color";
653
+ }
654
+ interface SpecSchemaType$1 {
655
+ type: "object";
656
+ properties: Record<string, SpecProperty$1>;
657
+ required?: string[];
658
+ order?: string[];
659
+ additionalProperties?: boolean;
660
+ }
661
+ interface ColorSpecification {
662
+ name: string;
663
+ type: "color";
664
+ description?: string;
665
+ schema?: SpecSchemaType$1;
666
+ initializers: Array<{
667
+ title?: string;
668
+ keyword: string;
669
+ description?: string;
670
+ script: {
671
+ type: string;
672
+ script: string;
673
+ };
674
+ }>;
675
+ conversions: Array<{
676
+ source: string;
677
+ target: string;
678
+ description?: string;
679
+ lossless: boolean;
680
+ script: {
681
+ type: string;
682
+ script: string;
683
+ };
684
+ }>;
685
+ }
686
+
687
+ type uriType$2 = string;
688
+ type Specs$1 = Map<uriType$2, ColorSpecification>;
689
+ interface FormatColorOptions {
690
+ decimalPlaces?: number;
691
+ removeTrailingZeros?: boolean;
692
+ }
693
+ declare class ColorManager extends BaseManager<ColorSpecification, ColorSymbol, ColorSymbol> {
694
+ private initializers;
695
+ constructor(defaultSpecs?: Specs$1);
696
+ protected getSpecName(spec: ColorSpecification): string;
697
+ /**
698
+ * Creates a clone of this class to be passed down to initializers and conversion functions
699
+ * Links properties to the parent config.
700
+ */
701
+ clone(): this;
702
+ registerRootInitializers(_uri: uriType$2, spec: ColorSpecification): void;
703
+ registerConversions(uri: uriType$2, spec: ColorSpecification): void;
704
+ register(uri: uriType$2, spec: ColorSpecification | string): ColorSpecification;
705
+ getSpecByType(type: string): ColorSpecification | undefined;
706
+ getSpecFromColor(color: ColorSymbol): ColorSpecification | undefined;
707
+ hasInitializer(keyword: string): boolean;
708
+ executeInitializer(keyword: string, args: Array<ISymbolType>): ColorSymbol;
709
+ hasConversionByType(sourceType: string, targetType: string): boolean;
710
+ convertTo(color: ColorSymbol, targetUri: string): ColorSymbol;
711
+ convertToByType(color: ColorSymbol, targetType: string): ColorSymbol;
712
+ setAttribute(color: ColorSymbol, node: ReassignNode, attributeValue: ISymbolType): ColorSymbol;
713
+ /**
714
+ * Formats a number value, rounding to specified decimal places and optionally removing trailing zeros.
715
+ *
716
+ * @param value - The numeric value to format
717
+ * @param decimalPlaces - Number of decimal places to round to
718
+ * @param removeTrailingZeros - Whether to remove trailing zeros
719
+ * @returns Formatted number string
720
+ */
721
+ private formatNumber;
722
+ /**
723
+ * Formats a ColorSymbol as a string representation using the appropriate schema-defined format.
724
+ *
725
+ * For hex colors (string values), returns the hex string as-is.
726
+ * For dynamic colors (object values), uses the schema's `order` property to determine
727
+ * parameter order and formats as a function call (e.g., "hsl(0, 100, 50.0)").
728
+ * If alpha is set and less than 1, it is included as the fourth parameter.
729
+ *
730
+ * @param color - The ColorSymbol to format
731
+ * @param opts - Formatting options for numeric values
732
+ * @returns Formatted string representation of the color, or empty string if formatting fails
733
+ *
734
+ * @example
735
+ * ```typescript
736
+ * // Hex color
737
+ * const hexColor = new ColorSymbol("#ff0000", "Hex");
738
+ * manager.formatColorMethod(hexColor); // "#ff0000"
739
+ *
740
+ * // HSL color with schema order ["h", "s", "l"]
741
+ * const hslColor = new ColorSymbol({ h: 0, s: 100, l: 50.123456 }, "HSL");
742
+ * manager.formatColorMethod(hslColor); // "hsl(0, 100, 50.12)"
743
+ *
744
+ * // RGB color with alpha
745
+ * const rgbColor = new ColorSymbol({ r: 255, g: 0, b: 0 }, "RGB", undefined, 0.5);
746
+ * manager.formatColorMethod(rgbColor); // "rgb(255, 0, 0, 0.5)"
747
+ * ```
748
+ */
749
+ formatColorMethod(color: ColorSymbol, opts?: FormatColorOptions): string;
750
+ }
751
+
752
+ interface FunctionSpecification {
753
+ name: string;
754
+ type: "function";
755
+ input?: {
756
+ type: "object";
757
+ properties?: Record<string, unknown>;
758
+ };
759
+ script: {
760
+ type: string;
761
+ script: string;
762
+ };
763
+ keyword: string;
764
+ description?: string;
765
+ requirements?: string[];
766
+ }
767
+
768
+ type functionName = string;
769
+ type FunctionImpl = (...args: ISymbolType[]) => ISymbolType;
770
+ declare class FunctionsManager extends BaseManager<FunctionSpecification, ISymbolType[], ISymbolType> {
771
+ private functionMap;
772
+ constructor();
773
+ protected getSpecName(spec: FunctionSpecification): string;
774
+ clone(): this;
775
+ register(name: functionName, spec: FunctionSpecification | string): FunctionSpecification;
776
+ private setupBuiltinFunctions;
777
+ private registerFunction;
778
+ private registerDynamicFunction;
779
+ getFunction(name: string): FunctionImpl | undefined;
780
+ hasFunction(name: string): boolean;
781
+ getFunctionNames(): string[];
782
+ }
783
+
784
+ interface SpecProperty {
785
+ type: "number" | "string" | "token" | "object";
786
+ url?: string;
787
+ properties?: Record<string, SpecProperty>;
788
+ validations?: Record<string, string>;
789
+ }
790
+ interface SpecSchemaType {
791
+ type: "object" | "number" | "string";
792
+ properties?: Record<string, SpecProperty>;
793
+ validations?: Record<string, string>;
794
+ required?: string[];
795
+ order?: string[];
796
+ additionalProperties?: boolean;
797
+ }
798
+ interface TokenSpecification {
799
+ name: string;
800
+ type: "token";
801
+ description?: string;
802
+ url?: string;
803
+ schema?: SpecSchemaType;
804
+ /** TokenScript validation script. Receives {input} and should return true or error string. Can be a string (direct script) or object with type and script (built schema). */
805
+ validation?: string | {
806
+ type: string;
807
+ script: string;
808
+ };
809
+ }
810
+
811
+ type uriType$1 = string;
812
+ /**
813
+ * Result of validating a token value.
814
+ * For nested validation failures, path indicates where the error occurred.
815
+ */
816
+ interface ValidationResult {
817
+ valid: boolean;
818
+ error?: string;
819
+ tokenType?: string;
820
+ path?: (string | number)[];
821
+ }
822
+ declare class TokenManager extends BaseManager<TokenSpecification, TokenSymbol, TokenSymbol> {
823
+ /**
824
+ * TokenScript validation scripts by token type.
825
+ * The script receives {input} as the value to validate.
826
+ * Should return true if valid, or a string error code if invalid.
827
+ */
828
+ private validationScripts;
829
+ /**
830
+ * Cached parsed ASTs for validation scripts.
831
+ * Avoids re-parsing the same script on every validation call.
832
+ */
833
+ private validationAstCache;
834
+ /**
835
+ * Cached Interpreter instances for validation scripts.
836
+ * Reusing interpreters avoids recreating Config, SymbolTable, etc.
837
+ */
838
+ private validationInterpreterCache;
839
+ protected getSpecName(spec: TokenSpecification): string;
840
+ getSpecByType(type: string): TokenSpecification | undefined;
841
+ clone(): this;
842
+ register(uri: uriType$1, spec: TokenSpecification | string): TokenSpecification;
843
+ /**
844
+ * Register a TokenScript validation script for a token type.
845
+ * The script receives {input} as the value to validate.
846
+ * Accepts either a string (direct script) or an object with type and script properties (built schema).
847
+ */
848
+ registerValidation(tokenType: string, validation: string | {
849
+ type: string;
850
+ script: string;
851
+ }): void;
852
+ /**
853
+ * Get validation script for a token type.
854
+ */
855
+ getValidation(tokenType: string): string | undefined;
856
+ /**
857
+ * Get possible error codes from validation scripts by walking the AST.
858
+ * Finds all return statements that return string literals (error codes).
859
+ *
860
+ * @param tokenType - Optional token type to get errors for. If omitted, returns all error types.
861
+ * @returns Array of error code strings
862
+ */
863
+ validationErrorTypes(tokenType?: string): string[];
864
+ /**
865
+ * Extract error codes from a validation script's AST.
866
+ * Walks the tree and returns string values from return statements.
867
+ */
868
+ private extractErrorTypesFromAST;
869
+ /**
870
+ * Validate a token value against its type using TokenScript.
871
+ * Automatically performs deep validation for nested token properties.
872
+ * Returns an array of validation results (empty or single valid result if all pass).
873
+ *
874
+ * @param tokenType - The token type name (e.g., "typography", "color")
875
+ * @param value - The symbol value to validate
876
+ * @param visitedUrls - Set of URLs already visited (for circular reference detection)
877
+ * @param basePath - Path prefix for nested validation errors
878
+ * @param depth - Current nesting depth (for max depth protection)
879
+ */
880
+ validate(tokenType: string, value: ISymbolType, visitedUrls?: Set<string>, basePath?: (string | number)[], depth?: number): ValidationResult[];
881
+ /**
882
+ * Run the validation script for a token type.
883
+ * Internal method used by validate().
884
+ * Uses cached Interpreter when available to avoid recreation overhead.
885
+ */
886
+ private runValidationScript;
887
+ /**
888
+ * Extract a Map from various symbol types that can contain key-value pairs.
889
+ */
890
+ private getValueMap;
891
+ }
892
+
893
+ interface ScriptBlock {
894
+ type?: string;
895
+ script: string;
896
+ }
897
+ interface Conversion {
898
+ source: string;
899
+ target: string;
900
+ script: ScriptBlock;
901
+ description?: string;
902
+ }
903
+ interface UnitSpecification {
904
+ name: string;
905
+ type: "absolute" | "relative";
906
+ keyword: string;
907
+ description?: string;
908
+ conversions?: Conversion[];
909
+ to_absolute?: ScriptBlock;
910
+ }
911
+
912
+ type uriType = string;
913
+ type unitKey = string;
914
+ type Specs = Map<uriType, UnitSpecification>;
915
+ declare class UnitManager extends BaseManager<UnitSpecification, NumberWithUnitSymbol, NumberWithUnitSymbol> {
916
+ private unitKeywords;
917
+ constructor(defaultSpecs?: Specs);
918
+ protected getSpecName(spec: UnitSpecification): string;
919
+ /**
920
+ * Creates a clone of this class to be passed down to initializers and conversion functions
921
+ * Links properties to the parent config.
922
+ */
923
+ clone(): this;
924
+ registerConversions(uri: uriType, spec: UnitSpecification): void;
925
+ register(uri: uriType, spec: UnitSpecification | string): UnitSpecification;
926
+ getSpecByKeyword(keyword: unitKey): UnitSpecification | undefined;
927
+ getUriByKeyword(keyword: unitKey): string | undefined;
928
+ convertTo(unit: NumberWithUnitSymbol, targetUri: uriType): NumberWithUnitSymbol;
929
+ private isOneNumberRelative;
930
+ private convertRelative;
931
+ convertToCommonFormat(inputs: Array<NumberSymbol | NumberWithUnitSymbol>): Array<NumberSymbol | NumberWithUnitSymbol>;
932
+ }
933
+
934
+ interface LanguageOptions {
935
+ MAX_ITERATIONS: number;
936
+ }
937
+ interface ConfigOptions {
938
+ languageOptions?: LanguageOptions;
939
+ colorManager?: ColorManager;
940
+ unitManager?: UnitManager;
941
+ functionsManager?: FunctionsManager;
942
+ tokenManager?: TokenManager;
943
+ }
944
+ declare class Config {
945
+ languageOptions: LanguageOptions;
946
+ colorManager: ColorManager;
947
+ unitManager: UnitManager;
948
+ functionsManager: FunctionsManager;
949
+ tokenManager: TokenManager;
950
+ constructor(options?: ConfigOptions);
951
+ getType(baseType: string, subType?: string): ISymbolType;
952
+ isTypeDefined(baseType: string, subType?: string): boolean;
953
+ clone(): Config;
954
+ registerSchemas(schemas: Array<{
955
+ uri: string;
956
+ schema: ColorSpecification | FunctionSpecification | TokenSpecification;
957
+ }>): Config;
958
+ }
959
+
960
+ export { type ASTNode as A, Config as C, type ISymbolType as I, Operations as O, type ReferenceRecord as R, SupportedFormats as S, type Token as T, UNINTERPRETED_KEYWORDS as U, ReservedKeyword as a, TokenType as b, type ReferenceRecordValue as c };