@sugarcube-org/core 0.0.1-alpha.12 → 0.0.1-alpha.13

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.
package/dist/index.d.ts CHANGED
@@ -1,18 +1,14 @@
1
1
  import { z } from 'zod';
2
2
 
3
- /**
4
- * Directional variants for utility properties
5
- */
6
3
  type DirectionalVariant = "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all";
7
- /**
8
- * Properties-first utility configuration
9
- * This is the approach where users configure utilities by CSS property
10
- * Made it separate in case we want other types of configs later
11
- */
12
4
  type PropertyUtilityConfig = {
5
+ /** Token path pattern (e.g., "space.*", "color.primary.*"). */
13
6
  source: string;
7
+ /** Directional variants for spacing properties. */
14
8
  directions?: DirectionalVariant | DirectionalVariant[];
9
+ /** Custom prefix for generated classes. */
15
10
  prefix?: string;
11
+ /** Strip duplicate prefix (e.g., "text-text-quiet" → "text-quiet"). */
16
12
  stripDuplicates?: boolean;
17
13
  };
18
14
 
@@ -21,682 +17,401 @@ type FluidConfig = {
21
17
  min: number;
22
18
  max: number;
23
19
  };
24
- type UserTransformsConfig = {
25
- fluid?: FluidConfig;
26
- colorFallbackStrategy?: ColorFallbackStrategy;
27
- };
28
- /**
29
- * Configuration for transforms applied to tokens during processing (internal config)
30
- */
31
20
  type TransformsConfig = {
32
21
  fluid: FluidConfig;
33
22
  colorFallbackStrategy: ColorFallbackStrategy;
34
23
  };
35
- /**
36
- * Configuration for output directories (user config - optional fields)
37
- */
38
- type UserOutputConfig = {
39
- /** Output directory for CSS files */
40
- css?: string;
41
- /** Output directory for component files */
42
- components?: string;
43
- /** Attribute name for theme selectors (default: "data-theme") */
44
- themeAttribute?: string;
45
- /**
46
- * Which context should use :root selector (default: resolver's default).
47
- * Other contexts use [data-theme="contextName"].
48
- */
49
- defaultContext?: string;
50
- };
51
- /**
52
- * Configuration for output directories (internal config - required fields)
53
- */
54
24
  type OutputConfig = {
55
25
  css: string;
56
26
  components?: string;
57
- /** Attribute name for theme selectors */
58
27
  themeAttribute: string;
59
- /** Which context uses :root selector */
60
28
  defaultContext?: string;
61
29
  };
62
- /**
63
- * Utilities configuration
64
- * This is the approach where users configure utilities by CSS property
65
- * Can be a single configuration or an array of configurations
66
- */
67
30
  type UtilitiesConfig = Record<string, PropertyUtilityConfig | PropertyUtilityConfig[]>;
68
31
  /**
69
- * User configuration for Sugarcube.
32
+ * Configuration for sugarcube.
33
+ * This is the shape of your config file (sugarcube.config.ts).
70
34
  *
71
- * Configuration uses the DTCG resolver format:
72
- * ```ts
73
- * export default {
35
+ * @example
36
+ * // sugarcube.config.ts
37
+ * import { defineConfig } from "@sugarcube-org/vite";
38
+ *
39
+ * export default defineConfig({
74
40
  * resolver: "./tokens.resolver.json",
75
41
  * output: { css: "src/styles" }
76
- * }
77
- * ```
42
+ * });
78
43
  */
79
- interface UserConfig {
44
+ interface SugarcubeConfig {
80
45
  /**
81
- * Path to the resolver.json file.
82
- * Resolver defines all token sources, sets, and modifiers.
83
- * Required for token processing, optional for validation-only scenarios.
46
+ * Path to the DTCG resolver document (.resolver.json).
47
+ * The resolver defines token sources, sets, and modifiers.
84
48
  */
85
49
  resolver?: string;
86
- transforms?: UserTransformsConfig;
87
- output?: UserOutputConfig;
50
+ /**
51
+ * Token transformation options.
52
+ */
53
+ transforms?: {
54
+ /**
55
+ * Viewport range for fluid typography calculations.
56
+ * Tokens with $type: "fluidDimension" will scale between min and max viewport widths.
57
+ */
58
+ fluid?: FluidConfig;
59
+ /**
60
+ * How to handle colors that can't be represented in sRGB.
61
+ * - "native": Use CSS color functions directly (modern browsers only)
62
+ * - "polyfill": Generate fallback values for older browsers
63
+ */
64
+ colorFallbackStrategy?: ColorFallbackStrategy;
65
+ };
66
+ /**
67
+ * Output configuration.
68
+ */
69
+ output?: {
70
+ /** Directory path where CSS files will be written. */
71
+ css?: string;
72
+ /** Directory path where component files will be written. */
73
+ components?: string;
74
+ /**
75
+ * HTML attribute used for theme selectors.
76
+ * @default "data-theme"
77
+ */
78
+ themeAttribute?: string;
79
+ /**
80
+ * Which context should use the :root selector.
81
+ * Other contexts will use [themeAttribute="contextName"] selectors.
82
+ * @default The resolver's default context
83
+ */
84
+ defaultContext?: string;
85
+ };
86
+ /**
87
+ * CSS utility class generation configuration.
88
+ * Maps CSS property names to token sources and options.
89
+ *
90
+ * @example
91
+ * utilities: {
92
+ * "background-color": { source: "color.background.*" },
93
+ * "padding": { source: "space.*", directions: ["x", "y", "all"] }
94
+ * }
95
+ */
88
96
  utilities?: UtilitiesConfig;
89
97
  }
90
98
  /**
91
- * Internal configuration type - what code uses (complete, required fields)
99
+ * Normalized configuration with all defaults applied.
100
+ * Used internally after processing SugarcubeConfig.
92
101
  */
93
102
  interface InternalConfig {
94
- /** Path to the resolver.json file (optional for validation-only scenarios) */
95
103
  resolver?: string;
96
104
  transforms: TransformsConfig;
97
105
  output: OutputConfig;
98
106
  utilities?: UtilitiesConfig;
99
107
  }
100
108
 
101
- /**
102
- * Base error type that all other error types extend from.
103
- * Used as the foundation for all error types in the system.
104
- * Provides a consistent structure for error messages across the codebase.
105
- */
106
109
  type BaseError = {
107
- /** A human-readable error message describing what went wrong */
108
110
  message: string;
109
111
  };
110
112
 
111
- /**
112
- * A token value that can either be a raw value or a reference.
113
- * This is the base type for all token values in the W3C Design Token Format.
114
- * @template T - The type of token (e.g., "color", "dimension", etc.)
115
- */
116
113
  type TokenValue<T extends TokenType> = RawTokenValue<T> | Reference<T>;
117
- /**
118
- * The actual value of a token without references.
119
- * This represents the concrete value that will be used in the final output.
120
- * @template T - The type of token (e.g., "color", "dimension", etc.)
121
- */
122
114
  type RawTokenValue<T extends TokenType> = T extends SimpleTokenType ? SimpleTokenValue<T> : T extends CompositeTokenType ? CompositeTokenValue<T> : never;
123
- /**
124
- * A reference to another token, with optional type checking.
125
- * References are strings that point to other tokens in the token tree.
126
- * The phantom type parameter ensures type safety when resolving references.
127
- * @template T - The type of token being referenced
128
- */
115
+ /** Reference to another token. String format: "{path.to.token}". */
129
116
  type Reference<T extends TokenType = TokenType> = string & {
130
- /** Phantom type for type safety during reference resolution */
131
117
  __tokenType?: T;
132
118
  };
133
- /**
134
- * Metadata that can be attached to any node in the token tree.
135
- * This includes descriptions and custom extensions as defined in the W3C spec.
136
- */
137
119
  type NodeMetadata = {
138
- /** Optional description of the token or group */
139
120
  $description?: string;
140
- /** Optional custom extensions as defined in the W3C spec */
141
121
  $extensions?: {
142
122
  [key: string]: unknown;
143
123
  };
144
124
  };
145
- /**
146
- * A single token with its value and metadata.
147
- * This is the basic building block of the token system.
148
- */
149
125
  type Token = NodeMetadata & {
150
- /** The value of the token, which can be a raw value or a reference */
151
126
  $value: TokenValue<TokenType>;
152
- /** Optional type specification, can be inherited from parent groups */
153
127
  $type?: TokenType;
154
128
  };
155
- /**
156
- * A group of tokens that can be nested.
157
- * The type allows for:
158
- * - Regular token properties (non-$ prefixed) which must be Token | TokenGroup
159
- * - Metadata properties from NodeMetadata (like $description, $extensions)
160
- * - $type property for type inheritance as specified in the W3C spec
161
- * - undefined to support optional metadata properties
162
- */
163
129
  type TokenGroup = NodeMetadata & {
164
- /** Optional type specification for the group, can be inherited by child tokens */
165
130
  $type?: TokenType;
166
- /** Dynamic properties that can be either tokens, token groups, or undefined */
167
131
  [key: string]: Token | TokenGroup | TokenType | undefined;
168
132
  };
169
- /**
170
- * All possible token types, either simple or composite.
171
- * This is the union of all supported token types in the system.
172
- */
173
133
  type TokenType = SimpleTokenType | CompositeTokenType;
174
- /**
175
- * Token types that contain a single value.
176
- * These are the basic building blocks of the token system.
177
- */
178
134
  type SimpleTokenType = "color" | "dimension" | "fluidDimension" | "duration" | "cubicBezier" | "fontFamily" | "fontWeight" | "number";
179
- /**
180
- * Values for simple token types.
181
- * Maps each simple token type to its corresponding value type.
182
- * @template T - The type of token (e.g., "color", "dimension", etc.)
183
- */
184
135
  type SimpleTokenValue<T extends SimpleTokenType = SimpleTokenType> = T extends "color" ? Color : T extends "dimension" ? Dimension : T extends "fluidDimension" ? FluidDimension : T extends "duration" ? Duration : T extends "cubicBezier" ? CubicBezier : T extends "fontFamily" ? FontFamily : T extends "fontWeight" ? FontWeight : T extends "number" ? number : never;
185
- /**
186
- * Token types that contain multiple values or are structurally complex.
187
- * These types combine multiple simple types to create more complex tokens.
188
- */
189
136
  type CompositeTokenType = AlwaysDecomposedType | "border" | "shadow" | "gradient" | "transition" | StructuralCompositeType;
190
- /**
191
- * Token types that must always be broken down into their constituent parts.
192
- * These types are never used directly in CSS output.
193
- */
137
+ /** Types that decompose into multiple CSS properties (e.g., typography → font-family, font-size, etc.). */
194
138
  type AlwaysDecomposedType = "typography";
195
- /**
196
- * Token types that define structural patterns.
197
- * These types are used to define reusable patterns in the token system.
198
- */
199
139
  type StructuralCompositeType = "strokeStyle";
200
- /**
201
- * Values for composite token types.
202
- * Maps each composite token type to its corresponding value type.
203
- * @template T - The type of token (e.g., "typography", "border", etc.)
204
- */
205
140
  type CompositeTokenValue<T extends CompositeTokenType = CompositeTokenType> = T extends "typography" ? Typography : T extends "border" ? Border : T extends "shadow" ? Shadow : T extends "gradient" ? Gradient : T extends "transition" ? Transition : T extends "strokeStyle" ? StrokeStyle : never;
206
- /**
207
- * A color value in any valid CSS color format.
208
- * This can be either:
209
- * - A string that is valid in CSS color contexts (legacy format)
210
- * - A W3C color object with colorSpace, components, and optional alpha/hex
211
- */
141
+ /** CSS color string or W3C color object with colorSpace. */
212
142
  type Color = string | {
213
- /** The color space - supports "oklch" and "display-p3" */
214
143
  colorSpace: "oklch" | "display-p3";
215
- /** Array of 3 numbers representing the color components */
216
144
  components: [number, number, number];
217
- /** Optional alpha value between 0 and 1 (defaults to 1 if omitted) */
218
145
  alpha?: number;
219
- /** Optional hex fallback value for compatibility */
220
146
  hex?: string;
221
147
  };
222
- /**
223
- * A dimensional value with a numeric value and unit.
224
- * Used for measurements like width, height, spacing, etc.
225
- */
226
148
  type Dimension = {
227
- /** The numeric value of the dimension */
228
149
  value: number;
229
- /** The unit of measurement (px or rem) */
230
150
  unit: "px" | "rem";
231
151
  };
232
- /**
233
- * A fluid dimension that scales between min and max values.
234
- * Used for responsive design tokens that need to scale with viewport size.
235
- */
152
+ /** Responsive dimension that scales between viewport sizes. */
236
153
  type FluidDimension = {
237
- /** The minimum value at the smallest viewport size */
238
154
  min: Dimension;
239
- /** The maximum value at the largest viewport size */
240
155
  max: Dimension;
241
156
  };
242
- /**
243
- * A duration value with a numeric value and time unit.
244
- * Used for animations, transitions, and other time-based values.
245
- */
246
157
  type Duration = {
247
- /** The numeric value of the duration */
248
158
  value: number;
249
- /** The unit of time (milliseconds or seconds) */
250
159
  unit: "ms" | "s";
251
160
  };
252
- /**
253
- * A cubic bezier curve defined by four control points.
254
- * Used for defining custom easing functions in animations and transitions.
255
- * The four numbers represent the x,y coordinates of the two control points.
256
- */
161
+ /** Bezier curve control points: [x1, y1, x2, y2]. */
257
162
  type CubicBezier = [number, number, number, number];
258
- /**
259
- * A font family name or list of fallback fonts.
260
- * Can be a single font name or an array of fonts in order of preference.
261
- */
262
163
  type FontFamily = string | string[];
263
- /**
264
- * A font weight value as either a number or semantic string.
265
- * Numbers range from 100-900, strings are semantic names for common weights.
266
- */
267
164
  type FontWeight = number | FontWeightString;
268
- /**
269
- * Semantic font weight names.
270
- * These are standardized names for common font weights.
271
- */
272
165
  type FontWeightString = "thin" | "hairline" | "extra-light" | "ultra-light" | "light" | "normal" | "regular" | "book" | "medium" | "semi-bold" | "demi-bold" | "bold" | "extra-bold" | "ultra-bold" | "black" | "heavy" | "extra-black" | "ultra-black";
273
- /**
274
- * Line cap style for strokes.
275
- * Defines how the end of a stroke should be rendered.
276
- */
277
166
  type LineCap = "round" | "butt" | "square";
278
- /**
279
- * Typography token combining font properties.
280
- * This is a composite type that combines multiple font-related properties.
281
- */
282
167
  type Typography = {
283
- /** The font family to use */
284
168
  fontFamily: TokenValue<"fontFamily">;
285
- /** The size of the font */
286
169
  fontSize: TokenValue<"dimension">;
287
- /** Optional font weight */
288
170
  fontWeight?: TokenValue<"fontWeight">;
289
- /** Optional letter spacing */
290
171
  letterSpacing?: TokenValue<"dimension">;
291
- /** Optional line height as a multiplier */
292
172
  lineHeight?: TokenValue<"number">;
293
173
  };
294
- /**
295
- * Transition token defining animation properties.
296
- * Used to define how properties should animate between states.
297
- */
298
174
  type Transition = {
299
- /** How long the transition should take */
300
175
  duration: TokenValue<"duration">;
301
- /** Optional delay before the transition starts */
302
176
  delay?: TokenValue<"duration">;
303
- /** The easing function to use for the transition */
304
177
  timingFunction: TokenValue<"cubicBezier">;
305
178
  };
306
- /**
307
- * Predefined stroke style keywords.
308
- * These are the standard stroke styles available in CSS.
309
- */
310
179
  type StrokeStyleKeyword = "solid" | "dashed" | "dotted" | "double" | "groove" | "ridge" | "outset" | "inset";
311
- /**
312
- * Custom stroke style definition.
313
- * Used when the predefined stroke styles are not sufficient.
314
- */
315
180
  type StrokeStyleCustom = {
316
- /** Array of dimensions defining the dash pattern */
317
181
  dashArray: Array<TokenValue<"dimension">>;
318
- /** How the ends of the stroke should be rendered */
319
182
  lineCap: LineCap;
320
183
  };
321
- /**
322
- * A stroke style can be either a predefined keyword or a custom definition.
323
- * This allows for both simple and complex stroke styles.
324
- */
325
184
  type StrokeStyle = StrokeStyleKeyword | StrokeStyleCustom;
326
- /**
327
- * Border token combining color, width, and style.
328
- * This is a composite type that defines a complete border.
329
- */
330
185
  type Border = {
331
- /** The color of the border */
332
186
  color: TokenValue<"color">;
333
- /** The width of the border */
334
187
  width: TokenValue<"dimension">;
335
- /** The style of the border, either a stroke style or a reference to one */
336
188
  style: StrokeStyle | Reference<"strokeStyle">;
337
189
  };
338
- /**
339
- * A single shadow definition.
340
- * This is the basic building block for shadow tokens.
341
- */
342
190
  type ShadowObject = {
343
- /** The color of the shadow */
344
191
  color: TokenValue<"color">;
345
- /** Horizontal offset of the shadow */
346
192
  offsetX: TokenValue<"dimension">;
347
- /** Vertical offset of the shadow */
348
193
  offsetY: TokenValue<"dimension">;
349
- /** How much the shadow should blur */
350
194
  blur: TokenValue<"dimension">;
351
- /** How much the shadow should spread */
352
195
  spread: TokenValue<"dimension">;
353
- /** Whether the shadow should be inset */
354
196
  inset?: boolean;
355
197
  };
356
- /**
357
- * A shadow can be either a single shadow or multiple shadows.
358
- * Multiple shadows are rendered in order, with later shadows appearing on top.
359
- */
360
198
  type Shadow = ShadowObject | ShadowObject[];
361
- /**
362
- * A single stop in a gradient.
363
- * Defines the color and position of a point in the gradient.
364
- */
365
199
  type GradientStop = {
366
- /** The color at this point in the gradient */
367
200
  color: TokenValue<"color">;
368
- /** The position of this point in the gradient (0-1) */
369
201
  position: number | Reference<"number">;
370
202
  };
371
- /**
372
- * A gradient is defined by a series of stops.
373
- * The stops define how the gradient transitions between colors.
374
- */
375
203
  type Gradient = GradientStop[];
376
204
 
377
205
  /**
378
- * Source information for a token, tracking its context and origin.
379
- * This metadata helps with error reporting and token organization.
380
- *
381
- * Terminology aligns with DTCG Resolver Module 2025.10:
382
- * - "context" = a resolved variation from a modifier (e.g., "light", "dark")
206
+ * Source information for a token, tracking where it came from.
207
+ * Used for error reporting and context-aware processing.
383
208
  */
384
209
  type TokenSource = {
385
210
  /**
386
- * Optional context name for modifier variations (e.g., "dark", "light", "compact").
387
- *
388
- * TODO: Future enhancement - support multiple orthogonal modifiers.
389
- * The DTCG spec supports multiple modifiers (e.g., theme + density), which would
390
- * require changing this to: `context?: string | Record<string, string>`
391
- * For example: `{ theme: "dark", density: "compact" }`
392
- * This would also require updating CSS generation to produce combined selectors
393
- * like `[data-theme="dark"][data-density="compact"]`.
211
+ * The context name for modifier variations (e.g., "dark", "light").
212
+ * Aligns with DTCG Resolver Module 2025.10 terminology.
394
213
  */
395
214
  context?: string;
396
- /** The path to the source file containing this token */
215
+ /** The file path where this token was defined. */
397
216
  sourcePath: string;
398
217
  };
399
218
  /**
400
- * A complete token tree with context information.
401
- * This represents a single token file's contents with its metadata.
402
- *
403
- * Terminology aligns with DTCG Resolver Module 2025.10:
404
- * - "context" = a resolved variation from a modifier (e.g., "light", "dark")
219
+ * A loaded token file with its contents and source metadata.
220
+ * Represents a single token file after loading but before processing.
405
221
  */
406
222
  type TokenTree = {
407
223
  /**
408
- * Optional context name for modifier variations (e.g., "dark", "light", "compact").
409
- *
410
- * TODO: Future enhancement - support multiple orthogonal modifiers.
411
- * See TokenSource.context for details.
224
+ * The context name for modifier variations (e.g., "dark", "compact").
225
+ * Undefined for base/default tokens.
412
226
  */
413
227
  context?: string;
414
- /** The actual token data following the W3C design tokens format */
228
+ /** The token data following the W3C Design Tokens format. */
415
229
  tokens: TokenGroup;
416
- /** The path to the source file containing these tokens */
230
+ /** The file path where these tokens were loaded from. */
417
231
  sourcePath: string;
418
232
  };
419
233
 
420
234
  /**
421
- * A resolved token with its final value.
422
- * Contains both the original token data and its resolved value after reference resolution.
423
- * @template T - The type of token (e.g., "color", "dimension", etc.)
235
+ * A token with all references resolved to their final values.
236
+ * Contains both the original value (which may include references)
237
+ * and the fully resolved value.
424
238
  */
425
239
  type ResolvedToken<T extends TokenType = TokenType> = NodeMetadata & {
426
- /** The type of the token */
240
+ /** The token type (e.g., "color", "dimension"). */
427
241
  $type: T;
428
- /** The original value of the token, which may contain references */
242
+ /** The original value, which may contain references like "{color.primary}". */
429
243
  $value: RawTokenValue<T>;
430
- /** The path to this token in the token tree */
244
+ /** The dot-separated path to this token (e.g., "color.primary"). */
431
245
  $path: string;
432
- /** Information about where this token was loaded from */
246
+ /** Source information about where this token was defined. */
433
247
  $source: TokenSource;
434
- /** The original path before any resolution */
248
+ /** The original path before any processing. */
435
249
  $originalPath: string;
436
- /** The final resolved value after all references are resolved */
250
+ /** The final value after all references have been resolved. */
437
251
  $resolvedValue: RawTokenValue<T>;
438
252
  };
439
253
  /**
440
- * A map of resolved tokens by their lookup path.
441
- * Used to store the final resolved state of all tokens in a collection.
442
- * Keys are token paths, values are either resolved tokens or node metadata.
254
+ * A collection of resolved tokens keyed by their lookup path.
255
+ * Includes both tokens and group metadata nodes.
443
256
  */
444
257
  type ResolvedTokens = {
445
- /** Token path as key, resolved token or metadata as value */
446
258
  [lookupKey: string]: ResolvedToken | NodeMetadata;
447
259
  };
448
- /**
449
- * Type of resolution error that occurred.
450
- * - "circular": A circular reference was detected
451
- * - "missing": A referenced token could not be found
452
- * - "type-mismatch": A referenced token's type doesn't match the expected type
453
- */
454
260
  type ResolutionErrorType = "circular" | "missing" | "type-mismatch";
455
- /**
456
- * An error that occurred during token resolution.
457
- * Extends the base error type with resolution-specific information.
458
- */
459
261
  type ResolutionError = BaseError & {
460
- /** The type of resolution error that occurred */
461
262
  type: ResolutionErrorType;
462
- /** The path to the token that failed resolution */
463
263
  path: string;
464
- /** Source information about where the token was loaded from */
465
264
  source: TokenSource;
466
265
  };
467
266
 
468
- /**
469
- * A token that has been converted to CSS properties.
470
- * Extends ResolvedToken with CSS-specific properties.
471
- * @template T The type of token
472
- */
473
267
  type ConvertedToken<T extends TokenType = TokenType> = ResolvedToken<T> & {
474
- /** The CSS properties generated from the token */
475
268
  $cssProperties: CSSProperties<T>;
476
269
  };
477
- /**
478
- * A collection of converted tokens.
479
- * Maps token paths to their converted values or metadata nodes.
480
- */
481
270
  type ConvertedTokens = {
482
271
  [lookupKey: string]: ConvertedToken | NodeMetadata;
483
272
  };
484
273
  /**
485
- * A collection of converted tokens organized by context.
486
- * Structure: context tokens
487
- *
488
- * Example:
489
- * {
490
- * default: { "color.primary": { ... } },
491
- * dark: { "color.primary": { ... } },
492
- * ocean: { "color.primary": { ... } }
493
- * }
274
+ * Tokens that have been converted to CSS properties, organized by context.
275
+ * Each context (e.g., "default", "dark") maps to its converted tokens.
494
276
  */
495
277
  type NormalizedConvertedTokens = {
496
278
  [context: string]: ConvertedTokens;
497
279
  };
498
- /**
499
- * CSS property types for different token types.
500
- * Maps token types to their corresponding CSS property structures.
501
- * @template T The type of token
502
- */
503
280
  type CSSProperties<T extends TokenType> = T extends SimpleTokenType ? SimpleCSSProperties : T extends AlwaysDecomposedType ? AlwaysDecomposedProperties : T extends "border" ? CSSBorderProperties : T extends "shadow" ? CSSShadowProperties : T extends "gradient" ? CSSGradientProperties : T extends "transition" ? CSSTransitionProperties : T extends StructuralCompositeType ? SimpleCSSProperties : never;
504
- /**
505
- * Simple CSS properties with a single value.
506
- * Used for tokens that map to a single CSS property.
507
- */
508
281
  type SimpleCSSProperties = {
509
- /** The CSS value */
510
282
  value: string | number;
511
- /** Optional feature queries for responsive values */
283
+ /** Feature queries for progressive enhancement (e.g., P3 colors). */
512
284
  featureValues?: Array<{
513
285
  query: string;
514
286
  value: string;
515
287
  }>;
516
288
  };
517
- /**
518
- * CSS properties that are always broken down into multiple properties.
519
- * Currently only used for typography tokens.
520
- */
521
289
  type AlwaysDecomposedProperties = CSSTypographyProperties;
522
- /**
523
- * CSS properties specific to typography tokens.
524
- * Maps typography tokens to their corresponding CSS properties.
525
- */
526
290
  type CSSTypographyProperties = {
527
- /** The font family to use */
528
291
  "font-family": string;
529
- /** The font size */
530
292
  "font-size": string;
531
- /** The font weight */
532
293
  "font-weight"?: number | string;
533
- /** The letter spacing */
534
294
  "letter-spacing"?: string;
535
- /** The line height */
536
295
  "line-height"?: number | string;
537
296
  };
538
- /**
539
- * CSS properties for specific token types.
540
- * These types represent tokens that map to single CSS properties.
541
- */
542
- /**
543
- * CSS properties for border tokens.
544
- */
545
297
  type CSSBorderProperties = {
546
- /** The border value */
547
298
  value: string;
548
299
  };
549
- /**
550
- * CSS properties for shadow tokens.
551
- */
552
300
  type CSSShadowProperties = {
553
- /** The shadow value */
554
301
  value: string;
555
302
  };
556
- /**
557
- * CSS properties for gradient tokens.
558
- */
559
303
  type CSSGradientProperties = {
560
- /** The gradient value */
561
304
  value: string;
562
305
  };
563
- /**
564
- * CSS properties for transition tokens.
565
- */
566
306
  type CSSTransitionProperties = {
567
- /** The transition value */
568
307
  value: string;
569
308
  };
570
309
 
571
310
  /**
572
- * Represents a single CSS file output with its path and content
311
+ * A generated CSS file with its output path and content.
573
312
  */
574
313
  type CSSFile = {
575
- /** The path where the CSS file will be written */
314
+ /** The file path where the CSS will be written. */
576
315
  path: string;
577
- /** The CSS content to write to the file */
316
+ /** The generated CSS content. */
578
317
  css: string;
579
318
  };
580
319
  /**
581
- * Represents multiple CSS file outputs
320
+ * Array of generated CSS files from the pipeline.
321
+ * Each file contains a path and the CSS content to write.
582
322
  */
583
323
  type CSSFileOutput = CSSFile[];
584
324
 
585
- /**
586
- * An error that occurred during token flattening.
587
- * Extends the base error type with flattening-specific information.
588
- */
589
325
  type FlattenError = BaseError & {
590
- /** The path to the token that failed flattening */
591
326
  path: string;
592
- /** Source information about where the token was loaded from */
593
327
  source: TokenSource;
594
328
  };
595
329
 
596
- /**
597
- * Result of loading a Sugarcube configuration file
598
- */
599
- type LoadedConfig = {
600
- /** The validated configuration */
601
- config: InternalConfig;
602
- /** The path to the config file that was loaded */
603
- configPath: string;
604
- };
605
- /**
606
- * Data structure for loading tokens from memory.
607
- * Maps file paths to their token content and metadata.
608
- * Used for programmatic token loading.
609
- *
610
- * Terminology aligns with DTCG Resolver Module 2025.10:
611
- * - "context" = a resolved variation from a modifier (e.g., "light", "dark")
612
- */
330
+ /** In-memory token data keyed by file path. */
613
331
  type TokenMemoryData = Record<string, {
614
- /**
615
- * Optional context name for modifier variations (e.g., "dark", "light").
616
- * See TokenSource.context for future enhancement notes.
617
- */
618
332
  context?: string;
619
- /** The raw token content as a string */
620
333
  content: string;
621
334
  }>;
622
- /**
623
- * An error that occurred during token loading.
624
- * Extends the base error type with file-specific information.
625
- */
626
335
  type LoadError = BaseError & {
627
- /** The file path where the error occurred */
628
336
  file: string;
629
337
  };
630
338
 
631
- /**
632
- * An error that occurred during token validation.
633
- * Extends the base error type with token-specific information.
634
- */
635
339
  type ValidationError = BaseError & {
636
- /** The path to the token that failed validation */
637
340
  path: string;
638
- /** Source information about where the token was loaded from */
639
341
  source: TokenSource;
640
342
  };
641
343
 
642
344
  /**
643
- * Modifier metadata for CSS generation.
644
- * Used to build selectors like [data-theme="dark"].
345
+ * Metadata about a modifier (e.g., theme, density) for CSS generation.
346
+ * Used to build attribute selectors like [data-theme="dark"].
645
347
  */
646
348
  type ModifierMeta$1 = {
647
- /** The modifier name (e.g., "theme", "density") */
349
+ /** The modifier name (e.g., "theme", "density"). */
648
350
  name: string;
649
- /** Auto-derived CSS attribute (e.g., "data-theme", "data-density") */
351
+ /** The HTML attribute name (e.g., "data-theme", "data-density"). */
650
352
  attribute: string;
651
- /** The default context name */
353
+ /** The default context that uses :root selector. */
652
354
  defaultContext: string;
653
- /** Available non-default context names */
355
+ /** Available non-default context names. */
654
356
  contexts: string[];
655
357
  };
656
358
  /**
657
- * Result of running any pipeline.
658
- * Contains the generated output, token trees, and any errors.
359
+ * Result of running the token processing pipeline.
360
+ * Contains generated CSS output, processed tokens, and any errors encountered.
659
361
  */
660
362
  type PipelineResult = {
661
- /** The generated output (e.g. CSS files) */
363
+ /** The generated CSS files ready to be written to disk. */
662
364
  output: CSSFileOutput;
663
- /** The loaded token trees */
365
+ /** The loaded and processed token trees. */
664
366
  trees: TokenTree[];
665
- /** Modifier metadata for CSS selector generation */
367
+ /** Modifier metadata for CSS selector generation. */
666
368
  modifiers?: ModifierMeta$1[];
667
- /** Any errors that occurred during pipeline execution */
369
+ /** Any errors that occurred during pipeline execution. */
668
370
  errors: PipelineErrors;
669
371
  };
670
372
  /**
671
- * Common error types that can occur during pipeline execution.
672
- * Organizes errors by the pipeline stage where they occurred.
373
+ * Errors organized by the pipeline stage where they occurred.
673
374
  */
674
375
  type PipelineErrors = {
675
- /** Errors that occurred during token loading */
376
+ /** Errors from loading token files. */
676
377
  load: LoadError[];
677
- /** Errors that occurred during token flattening */
378
+ /** Errors from flattening token trees. */
678
379
  flatten: FlattenError[];
679
- /** Errors that occurred during token validation */
380
+ /** Errors from validating token values. */
680
381
  validation: ValidationError[];
681
- /** Errors that occurred during token resolution */
382
+ /** Errors from resolving token references. */
682
383
  resolution: ResolutionError[];
683
384
  };
684
385
  /**
685
- * Defines how tokens should be loaded and processed.
686
- * - "resolver": Load from a DTCG resolver document (primary method)
687
- * - "memory": Load from in-memory data (for testing/programmatic use)
386
+ * Defines the source of tokens for the pipeline.
387
+ *
388
+ * @example
389
+ * // Load from a DTCG resolver document
390
+ * const source: TokenPipelineSource = {
391
+ * type: "resolver",
392
+ * resolverPath: "./tokens.resolver.json",
393
+ * config: internalConfig
394
+ * };
395
+ *
396
+ * @example
397
+ * // Load from in-memory data (for testing)
398
+ * const source: TokenPipelineSource = {
399
+ * type: "memory",
400
+ * data: { "tokens.json": { content: '{"color": {...}}' } },
401
+ * config: internalConfig
402
+ * };
688
403
  */
689
404
  type TokenPipelineSource = {
690
405
  type: "resolver";
691
- /** Path to the .resolver.json file */
406
+ /** Path to the DTCG resolver document (.resolver.json). */
692
407
  resolverPath: string;
693
- /** Configuration for output and transforms */
408
+ /** Pipeline configuration. */
694
409
  config: InternalConfig;
695
410
  } | {
696
411
  type: "memory";
697
- /** In-memory token data */
412
+ /** In-memory token data keyed by file path. */
698
413
  data: TokenMemoryData;
699
- /** Configuration for output and transforms */
414
+ /** Pipeline configuration. */
700
415
  config: InternalConfig;
701
416
  };
702
417
 
@@ -710,13 +425,6 @@ type TokenPipelineSource = {
710
425
  */
711
426
  declare function generateCSSVariables(convertedTokens: NormalizedConvertedTokens, config: InternalConfig, modifiers?: ModifierMeta$1[]): Promise<CSSFileOutput>;
712
427
 
713
- /**
714
- * Core token processing pipeline.
715
- *
716
- * Loads tokens from a resolver document, flattens, validates, and resolves references.
717
- * Returns processed tokens ready for CSS generation.
718
- */
719
-
720
428
  /**
721
429
  * Result of loading and resolving tokens.
722
430
  */
@@ -757,69 +465,40 @@ type LoadAndResolveResult = {
757
465
  declare function loadAndResolveTokens(source: TokenPipelineSource): Promise<LoadAndResolveResult>;
758
466
 
759
467
  /**
760
- * Normalized tokens organized by context.
761
- * Structure: context tokens
762
- *
763
- * This is the structure for resolver-based configs where sets merge
764
- * and modifiers define contexts (light, dark, ocean, etc.).
765
- *
766
- * Example:
767
- * {
768
- * light: { "color.primary": { $value: "#3b82f6" } },
769
- * dark: { "color.primary": { $value: "#60a5fa" } },
770
- * ocean: { "color.primary": { $value: "#0ea5e9" } }
771
- * }
468
+ * Resolved tokens organized by context name.
469
+ * Each key is a context (e.g., "default", "dark", "light")
470
+ * and the value is the resolved tokens for that context.
772
471
  */
773
472
  type NormalizedTokens = Record<string, ResolvedTokens>;
774
473
  /**
775
474
  * Result of the normalization process.
475
+ * Contains tokens organized by context and the default context name.
776
476
  */
777
477
  type NormalizeResult = {
778
- /** The normalized tokens organized by context */
478
+ /** Tokens organized by context name. */
779
479
  tokens: NormalizedTokens;
780
- /** The default context name */
480
+ /** The context that should use :root selector in CSS output. */
781
481
  defaultContext?: string;
782
482
  };
783
483
 
784
- type NamedUtilityValue = {
785
- kind: "named";
786
- value: string;
787
- fraction: string | null;
788
- };
789
- type ArbitraryUtilityValue = {
790
- kind: "arbitrary";
791
- value: string;
792
- };
793
- type UtilityValue = NamedUtilityValue | ArbitraryUtilityValue;
794
- type StaticVariant = {
795
- kind: "static";
796
- root: string;
797
- };
798
- type FunctionalVariant = {
799
- kind: "functional";
800
- root: string;
801
- value: UtilityValue;
802
- };
803
- type Variant = StaticVariant | FunctionalVariant;
804
- type StaticCandidate = {
805
- kind: "static";
806
- root: string;
807
- variants: Variant[];
808
- raw: string;
809
- };
810
- type FunctionalCandidate = {
811
- kind: "functional";
812
- root: string;
813
- value: UtilityValue | null;
814
- variants: Variant[];
815
- raw: string;
484
+ /**
485
+ * Result of loading a sugarcube configuration file.
486
+ * Contains the validated, normalized configuration and its source path.
487
+ */
488
+ type LoadedConfig = {
489
+ /** The validated and normalized configuration with defaults applied. */
490
+ config: InternalConfig;
491
+ /** The absolute path to the config file that was loaded. */
492
+ configPath: string;
816
493
  };
817
- type Candidate = StaticCandidate | FunctionalCandidate;
818
- interface StaticUtilityPattern {
819
- properties: string[];
820
- validator: (candidate: Candidate) => boolean;
821
- generator: (candidate: Candidate) => string;
822
- }
494
+ declare function findConfigFile(basePath?: string): string | null;
495
+ declare function configFileExists(basePath?: string): boolean;
496
+ declare function loadTSConfig(configPath: string): Promise<unknown>;
497
+ declare function loadSugarcubeConfig(configPath?: string): Promise<{
498
+ config: SugarcubeConfig;
499
+ configPath: string;
500
+ }>;
501
+ declare function loadInternalConfig(configPath?: string): Promise<LoadedConfig>;
823
502
 
824
503
  /**
825
504
  * Processes and converts token trees into CSS-ready format.
@@ -841,14 +520,6 @@ interface StaticUtilityPattern {
841
520
  */
842
521
  declare function processAndConvertTokens(trees: TokenTree[], resolved: ResolvedTokens, config: InternalConfig, validationErrors?: ValidationError[]): Promise<NormalizedConvertedTokens>;
843
522
 
844
- /**
845
- * Resolver-based token loading for DTCG Resolver Module 2025.10
846
- * https://www.designtokens.org/TR/2025.10/resolver/
847
- *
848
- * This module loads tokens from a resolver document, producing TokenTree[]
849
- * for pipeline compatibility plus modifier metadata for CSS generation.
850
- */
851
-
852
523
  /**
853
524
  * Modifier metadata for CSS generation.
854
525
  * Used to build selectors like [data-theme="dark"].
@@ -877,29 +548,12 @@ type ResolverLoadResult = {
877
548
  /**
878
549
  * Load tokens from a resolver document.
879
550
  *
880
- * This function:
881
- * 1. Parses the resolver document
882
- * 2. Processes all sets and modifier contexts
883
- * 3. Returns TokenTree[] with context info for the pipeline
884
- * 4. Returns modifier metadata for CSS selector generation
885
- *
886
- * Token trees use compound context keys for non-default modifier contexts:
551
+ * Returns TokenTree[] with compound context keys for modifier contexts:
887
552
  * - Base tokens: context = undefined (maps to :root)
888
553
  * - Modifier contexts: context = "modifierName:contextName" (e.g., "theme:dark")
889
- *
890
- * @param resolverPath - Path to the .resolver.json file
891
- * @returns ResolverLoadResult with trees, modifier metadata, and errors
892
- *
893
- * @example
894
- * const result = await loadFromResolver("tokens.resolver.json");
895
- * // result.trees -> TokenTree[] for flatten/validate/resolve
896
- * // result.modifiers -> metadata for CSS selector generation
897
554
  */
898
555
  declare function loadFromResolver(resolverPath: string): Promise<ResolverLoadResult>;
899
556
 
900
- declare function generateIndex(stylesDir: string, config: InternalConfig): Promise<string>;
901
- declare function shouldRegenerateIndex(stylesDir: string, config: InternalConfig): Promise<boolean>;
902
-
903
557
  /**
904
558
  * Writes CSS files to disk, creating directories as needed.
905
559
  *
@@ -940,15 +594,6 @@ declare function writeCSSVariablesToDisk(output: CSSFileOutput): Promise<CSSFile
940
594
  */
941
595
  declare function writeCSSUtilitiesToDisk(output: CSSFileOutput): Promise<CSSFileOutput>;
942
596
 
943
- declare function findConfigFile(basePath?: string): string | null;
944
- declare function configFileExists(basePath?: string): boolean;
945
- declare function loadTSConfig(configPath: string): Promise<unknown>;
946
- declare function loadUserConfig(configPath?: string): Promise<{
947
- config: UserConfig;
948
- configPath: string;
949
- }>;
950
- declare function loadInternalConfig(configPath?: string): Promise<LoadedConfig>;
951
-
952
597
  /**
953
598
  * Validates a user configuration object against the user schema.
954
599
  *
@@ -956,7 +601,7 @@ declare function loadInternalConfig(configPath?: string): Promise<LoadedConfig>;
956
601
  * @returns The validated user configuration
957
602
  * @throws Error if the configuration is invalid
958
603
  */
959
- declare function validateUserConfig(config: Partial<UserConfig>): UserConfig;
604
+ declare function validateSugarcubeConfig(config: Partial<SugarcubeConfig>): SugarcubeConfig;
960
605
  /**
961
606
  * Validates an internal configuration object against the internal schema.
962
607
  *
@@ -968,12 +613,6 @@ declare function validateInternalConfig(config: InternalConfig): InternalConfig;
968
613
  /**
969
614
  * Validates a user configuration object against the schema and fills in defaults.
970
615
  *
971
- * This function:
972
- * 1. Validates the configuration structure using the user schema
973
- * 2. Fills in default values
974
- * 3. Validates the complete configuration using the internal schema
975
- * 4. Returns the validated configuration with defaults filled in
976
- *
977
616
  * @param config - The user configuration object to validate
978
617
  * @returns The validated configuration with defaults filled in
979
618
  * @throws Error if the configuration is invalid
@@ -982,15 +621,10 @@ declare function validateInternalConfig(config: InternalConfig): InternalConfig;
982
621
  * const config = { resolver: "./tokens.resolver.json" };
983
622
  * const validatedConfig = validateConfig(config);
984
623
  */
985
- declare function validateConfig(config: Partial<UserConfig>): InternalConfig;
624
+ declare function validateConfig(config: Partial<SugarcubeConfig>): InternalConfig;
986
625
  /**
987
626
  * Parses and validates a JSON configuration string.
988
627
  *
989
- * This function:
990
- * 1. Parses the JSON string into a configuration object
991
- * 2. Validates and normalizes the configuration using validateConfig
992
- * 3. Returns the validated and normalized configuration
993
- *
994
628
  * @param configString - The JSON configuration string to parse and validate
995
629
  * @returns The validated and normalized configuration
996
630
  * @throws Error if the JSON is invalid or the configuration is invalid
@@ -1013,7 +647,7 @@ declare function parseAndValidateConfig(configString: string): InternalConfig;
1013
647
  * const completeConfig = fillDefaults(userConfig);
1014
648
  * // completeConfig.output.css === "src/styles"
1015
649
  */
1016
- declare function fillDefaults(userConfig: UserConfig): InternalConfig;
650
+ declare function fillDefaults(userConfig: SugarcubeConfig): InternalConfig;
1017
651
 
1018
652
  interface CSSImport {
1019
653
  path: string;
@@ -1035,15 +669,6 @@ declare class Instrumentation implements Disposable {
1035
669
  [Symbol.dispose](): void;
1036
670
  }
1037
671
 
1038
- /**
1039
- * Performance monitor for debugging Vite dev server performance.
1040
- * Enable with: SUGARCUBE_PERF=1 pnpm dev
1041
- *
1042
- * Tracks:
1043
- * - File watcher activity and frequency
1044
- * - Memory usage changes over time
1045
- * - Module graph size during operations
1046
- */
1047
672
  declare class PerfMonitor implements Disposable {
1048
673
  #private;
1049
674
  private defaultFlush;
@@ -1190,10 +815,6 @@ declare const ErrorMessages: {
1190
815
  };
1191
816
  };
1192
817
 
1193
- /**
1194
- * User Config Schema - what users write (minimal, optional fields)
1195
- * Uses DTCG resolver format exclusively.
1196
- */
1197
818
  declare const userConfigSchema: z.ZodObject<{
1198
819
  resolver: z.ZodOptional<z.ZodString>;
1199
820
  transforms: z.ZodOptional<z.ZodObject<{
@@ -1321,9 +942,6 @@ declare const userConfigSchema: z.ZodObject<{
1321
942
  stripDuplicates?: boolean | undefined;
1322
943
  }[]> | undefined;
1323
944
  }>;
1324
- /**
1325
- * Internal Config Schema - what code uses (complete, required fields)
1326
- */
1327
945
  declare const internalConfigSchema: z.ZodObject<{
1328
946
  resolver: z.ZodOptional<z.ZodString>;
1329
947
  transforms: z.ZodObject<{
@@ -1452,7 +1070,625 @@ declare const internalConfigSchema: z.ZodObject<{
1452
1070
  }[]> | undefined;
1453
1071
  }>;
1454
1072
 
1073
+ /**
1074
+ * Name schema for sets, modifiers, and contexts.
1075
+ * Names MUST NOT:
1076
+ * - Start with '$' (reserved prefix per DTCG spec)
1077
+ * - Contain '{' or '}' (used in reference syntax)
1078
+ * - Contain '.' (used as path separator in references)
1079
+ */
1080
+ declare const nameSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
1081
+ /**
1082
+ * Reference object schema.
1083
+ * The $ref property uses JSON Pointer syntax for same-document references
1084
+ * or file paths for external references.
1085
+ */
1086
+ declare const referenceObjectSchema: z.ZodObject<{
1087
+ $ref: z.ZodString;
1088
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1089
+ $ref: z.ZodString;
1090
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1091
+ $ref: z.ZodString;
1092
+ }, z.ZodTypeAny, "passthrough">>;
1093
+ /**
1094
+ * Source schema - either a reference or inline token group.
1095
+ * We use z.unknown() for inline tokens since we don't need to validate
1096
+ * token structure at the resolver level.
1097
+ */
1098
+ declare const sourceSchema: z.ZodUnion<[z.ZodObject<{
1099
+ $ref: z.ZodString;
1100
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1101
+ $ref: z.ZodString;
1102
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1103
+ $ref: z.ZodString;
1104
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
1105
+ /**
1106
+ * Set definition schema for root-level sets map.
1107
+ */
1108
+ declare const setDefinitionSchema: z.ZodObject<{
1109
+ description: z.ZodOptional<z.ZodString>;
1110
+ sources: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1111
+ $ref: z.ZodString;
1112
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1113
+ $ref: z.ZodString;
1114
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1115
+ $ref: z.ZodString;
1116
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">;
1117
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1118
+ }, "strip", z.ZodTypeAny, {
1119
+ sources: (z.objectOutputType<{
1120
+ $ref: z.ZodString;
1121
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1122
+ description?: string | undefined;
1123
+ $extensions?: Record<string, unknown> | undefined;
1124
+ }, {
1125
+ sources: (z.objectInputType<{
1126
+ $ref: z.ZodString;
1127
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1128
+ description?: string | undefined;
1129
+ $extensions?: Record<string, unknown> | undefined;
1130
+ }>;
1131
+ /**
1132
+ * Modifier contexts schema.
1133
+ * Each key is a context name, value is an array of sources.
1134
+ */
1135
+ declare const modifierContextsSchema: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1136
+ $ref: z.ZodString;
1137
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1138
+ $ref: z.ZodString;
1139
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1140
+ $ref: z.ZodString;
1141
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">>;
1142
+ /**
1143
+ * Modifier definition schema for root-level modifiers map.
1144
+ */
1145
+ declare const modifierDefinitionSchema: z.ZodEffects<z.ZodObject<{
1146
+ description: z.ZodOptional<z.ZodString>;
1147
+ contexts: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1148
+ $ref: z.ZodString;
1149
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1150
+ $ref: z.ZodString;
1151
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1152
+ $ref: z.ZodString;
1153
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">>;
1154
+ default: z.ZodOptional<z.ZodString>;
1155
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1156
+ }, "strip", z.ZodTypeAny, {
1157
+ contexts: Record<string, (z.objectOutputType<{
1158
+ $ref: z.ZodString;
1159
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1160
+ description?: string | undefined;
1161
+ default?: string | undefined;
1162
+ $extensions?: Record<string, unknown> | undefined;
1163
+ }, {
1164
+ contexts: Record<string, (z.objectInputType<{
1165
+ $ref: z.ZodString;
1166
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1167
+ description?: string | undefined;
1168
+ default?: string | undefined;
1169
+ $extensions?: Record<string, unknown> | undefined;
1170
+ }>, {
1171
+ contexts: Record<string, (z.objectOutputType<{
1172
+ $ref: z.ZodString;
1173
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1174
+ description?: string | undefined;
1175
+ default?: string | undefined;
1176
+ $extensions?: Record<string, unknown> | undefined;
1177
+ }, {
1178
+ contexts: Record<string, (z.objectInputType<{
1179
+ $ref: z.ZodString;
1180
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1181
+ description?: string | undefined;
1182
+ default?: string | undefined;
1183
+ $extensions?: Record<string, unknown> | undefined;
1184
+ }>;
1185
+ /**
1186
+ * Inline set schema for resolutionOrder.
1187
+ */
1188
+ declare const inlineSetSchema: z.ZodObject<{
1189
+ type: z.ZodLiteral<"set">;
1190
+ name: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
1191
+ sources: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1192
+ $ref: z.ZodString;
1193
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1194
+ $ref: z.ZodString;
1195
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1196
+ $ref: z.ZodString;
1197
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">;
1198
+ description: z.ZodOptional<z.ZodString>;
1199
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1200
+ }, "strip", z.ZodTypeAny, {
1201
+ name: string;
1202
+ type: "set";
1203
+ sources: (z.objectOutputType<{
1204
+ $ref: z.ZodString;
1205
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1206
+ description?: string | undefined;
1207
+ $extensions?: Record<string, unknown> | undefined;
1208
+ }, {
1209
+ name: string;
1210
+ type: "set";
1211
+ sources: (z.objectInputType<{
1212
+ $ref: z.ZodString;
1213
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1214
+ description?: string | undefined;
1215
+ $extensions?: Record<string, unknown> | undefined;
1216
+ }>;
1217
+ /**
1218
+ * Inline modifier schema for resolutionOrder.
1219
+ */
1220
+ declare const inlineModifierSchema: z.ZodEffects<z.ZodObject<{
1221
+ type: z.ZodLiteral<"modifier">;
1222
+ name: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
1223
+ contexts: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1224
+ $ref: z.ZodString;
1225
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1226
+ $ref: z.ZodString;
1227
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1228
+ $ref: z.ZodString;
1229
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">>;
1230
+ description: z.ZodOptional<z.ZodString>;
1231
+ default: z.ZodOptional<z.ZodString>;
1232
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1233
+ }, "strip", z.ZodTypeAny, {
1234
+ name: string;
1235
+ type: "modifier";
1236
+ contexts: Record<string, (z.objectOutputType<{
1237
+ $ref: z.ZodString;
1238
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1239
+ description?: string | undefined;
1240
+ default?: string | undefined;
1241
+ $extensions?: Record<string, unknown> | undefined;
1242
+ }, {
1243
+ name: string;
1244
+ type: "modifier";
1245
+ contexts: Record<string, (z.objectInputType<{
1246
+ $ref: z.ZodString;
1247
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1248
+ description?: string | undefined;
1249
+ default?: string | undefined;
1250
+ $extensions?: Record<string, unknown> | undefined;
1251
+ }>, {
1252
+ name: string;
1253
+ type: "modifier";
1254
+ contexts: Record<string, (z.objectOutputType<{
1255
+ $ref: z.ZodString;
1256
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1257
+ description?: string | undefined;
1258
+ default?: string | undefined;
1259
+ $extensions?: Record<string, unknown> | undefined;
1260
+ }, {
1261
+ name: string;
1262
+ type: "modifier";
1263
+ contexts: Record<string, (z.objectInputType<{
1264
+ $ref: z.ZodString;
1265
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1266
+ description?: string | undefined;
1267
+ default?: string | undefined;
1268
+ $extensions?: Record<string, unknown> | undefined;
1269
+ }>;
1270
+ /**
1271
+ * Resolution order item schema.
1272
+ * Can be a reference, inline set, or inline modifier.
1273
+ */
1274
+ declare const resolutionOrderItemSchema: z.ZodUnion<[z.ZodObject<{
1275
+ $ref: z.ZodString;
1276
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1277
+ $ref: z.ZodString;
1278
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1279
+ $ref: z.ZodString;
1280
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1281
+ type: z.ZodLiteral<"set">;
1282
+ name: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
1283
+ sources: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1284
+ $ref: z.ZodString;
1285
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1286
+ $ref: z.ZodString;
1287
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1288
+ $ref: z.ZodString;
1289
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">;
1290
+ description: z.ZodOptional<z.ZodString>;
1291
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1292
+ }, "strip", z.ZodTypeAny, {
1293
+ name: string;
1294
+ type: "set";
1295
+ sources: (z.objectOutputType<{
1296
+ $ref: z.ZodString;
1297
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1298
+ description?: string | undefined;
1299
+ $extensions?: Record<string, unknown> | undefined;
1300
+ }, {
1301
+ name: string;
1302
+ type: "set";
1303
+ sources: (z.objectInputType<{
1304
+ $ref: z.ZodString;
1305
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1306
+ description?: string | undefined;
1307
+ $extensions?: Record<string, unknown> | undefined;
1308
+ }>, z.ZodEffects<z.ZodObject<{
1309
+ type: z.ZodLiteral<"modifier">;
1310
+ name: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
1311
+ contexts: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1312
+ $ref: z.ZodString;
1313
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1314
+ $ref: z.ZodString;
1315
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1316
+ $ref: z.ZodString;
1317
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">>;
1318
+ description: z.ZodOptional<z.ZodString>;
1319
+ default: z.ZodOptional<z.ZodString>;
1320
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1321
+ }, "strip", z.ZodTypeAny, {
1322
+ name: string;
1323
+ type: "modifier";
1324
+ contexts: Record<string, (z.objectOutputType<{
1325
+ $ref: z.ZodString;
1326
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1327
+ description?: string | undefined;
1328
+ default?: string | undefined;
1329
+ $extensions?: Record<string, unknown> | undefined;
1330
+ }, {
1331
+ name: string;
1332
+ type: "modifier";
1333
+ contexts: Record<string, (z.objectInputType<{
1334
+ $ref: z.ZodString;
1335
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1336
+ description?: string | undefined;
1337
+ default?: string | undefined;
1338
+ $extensions?: Record<string, unknown> | undefined;
1339
+ }>, {
1340
+ name: string;
1341
+ type: "modifier";
1342
+ contexts: Record<string, (z.objectOutputType<{
1343
+ $ref: z.ZodString;
1344
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1345
+ description?: string | undefined;
1346
+ default?: string | undefined;
1347
+ $extensions?: Record<string, unknown> | undefined;
1348
+ }, {
1349
+ name: string;
1350
+ type: "modifier";
1351
+ contexts: Record<string, (z.objectInputType<{
1352
+ $ref: z.ZodString;
1353
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1354
+ description?: string | undefined;
1355
+ default?: string | undefined;
1356
+ $extensions?: Record<string, unknown> | undefined;
1357
+ }>]>;
1358
+ /**
1359
+ * Root-level sets map schema.
1360
+ */
1361
+ declare const setsMapSchema: z.ZodRecord<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, z.ZodObject<{
1362
+ description: z.ZodOptional<z.ZodString>;
1363
+ sources: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1364
+ $ref: z.ZodString;
1365
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1366
+ $ref: z.ZodString;
1367
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1368
+ $ref: z.ZodString;
1369
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">;
1370
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1371
+ }, "strip", z.ZodTypeAny, {
1372
+ sources: (z.objectOutputType<{
1373
+ $ref: z.ZodString;
1374
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1375
+ description?: string | undefined;
1376
+ $extensions?: Record<string, unknown> | undefined;
1377
+ }, {
1378
+ sources: (z.objectInputType<{
1379
+ $ref: z.ZodString;
1380
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1381
+ description?: string | undefined;
1382
+ $extensions?: Record<string, unknown> | undefined;
1383
+ }>>;
1384
+ /**
1385
+ * Root-level modifiers map schema.
1386
+ */
1387
+ declare const modifiersMapSchema: z.ZodRecord<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, z.ZodEffects<z.ZodObject<{
1388
+ description: z.ZodOptional<z.ZodString>;
1389
+ contexts: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1390
+ $ref: z.ZodString;
1391
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1392
+ $ref: z.ZodString;
1393
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1394
+ $ref: z.ZodString;
1395
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">>;
1396
+ default: z.ZodOptional<z.ZodString>;
1397
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1398
+ }, "strip", z.ZodTypeAny, {
1399
+ contexts: Record<string, (z.objectOutputType<{
1400
+ $ref: z.ZodString;
1401
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1402
+ description?: string | undefined;
1403
+ default?: string | undefined;
1404
+ $extensions?: Record<string, unknown> | undefined;
1405
+ }, {
1406
+ contexts: Record<string, (z.objectInputType<{
1407
+ $ref: z.ZodString;
1408
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1409
+ description?: string | undefined;
1410
+ default?: string | undefined;
1411
+ $extensions?: Record<string, unknown> | undefined;
1412
+ }>, {
1413
+ contexts: Record<string, (z.objectOutputType<{
1414
+ $ref: z.ZodString;
1415
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1416
+ description?: string | undefined;
1417
+ default?: string | undefined;
1418
+ $extensions?: Record<string, unknown> | undefined;
1419
+ }, {
1420
+ contexts: Record<string, (z.objectInputType<{
1421
+ $ref: z.ZodString;
1422
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1423
+ description?: string | undefined;
1424
+ default?: string | undefined;
1425
+ $extensions?: Record<string, unknown> | undefined;
1426
+ }>>;
1427
+ declare const resolverDocumentSchema: z.ZodObject<{
1428
+ version: z.ZodLiteral<"2025.10">;
1429
+ name: z.ZodOptional<z.ZodString>;
1430
+ description: z.ZodOptional<z.ZodString>;
1431
+ sets: z.ZodOptional<z.ZodRecord<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, z.ZodObject<{
1432
+ description: z.ZodOptional<z.ZodString>;
1433
+ sources: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1434
+ $ref: z.ZodString;
1435
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1436
+ $ref: z.ZodString;
1437
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1438
+ $ref: z.ZodString;
1439
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">;
1440
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1441
+ }, "strip", z.ZodTypeAny, {
1442
+ sources: (z.objectOutputType<{
1443
+ $ref: z.ZodString;
1444
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1445
+ description?: string | undefined;
1446
+ $extensions?: Record<string, unknown> | undefined;
1447
+ }, {
1448
+ sources: (z.objectInputType<{
1449
+ $ref: z.ZodString;
1450
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1451
+ description?: string | undefined;
1452
+ $extensions?: Record<string, unknown> | undefined;
1453
+ }>>>;
1454
+ modifiers: z.ZodOptional<z.ZodRecord<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>, z.ZodEffects<z.ZodObject<{
1455
+ description: z.ZodOptional<z.ZodString>;
1456
+ contexts: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1457
+ $ref: z.ZodString;
1458
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1459
+ $ref: z.ZodString;
1460
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1461
+ $ref: z.ZodString;
1462
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">>;
1463
+ default: z.ZodOptional<z.ZodString>;
1464
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1465
+ }, "strip", z.ZodTypeAny, {
1466
+ contexts: Record<string, (z.objectOutputType<{
1467
+ $ref: z.ZodString;
1468
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1469
+ description?: string | undefined;
1470
+ default?: string | undefined;
1471
+ $extensions?: Record<string, unknown> | undefined;
1472
+ }, {
1473
+ contexts: Record<string, (z.objectInputType<{
1474
+ $ref: z.ZodString;
1475
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1476
+ description?: string | undefined;
1477
+ default?: string | undefined;
1478
+ $extensions?: Record<string, unknown> | undefined;
1479
+ }>, {
1480
+ contexts: Record<string, (z.objectOutputType<{
1481
+ $ref: z.ZodString;
1482
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1483
+ description?: string | undefined;
1484
+ default?: string | undefined;
1485
+ $extensions?: Record<string, unknown> | undefined;
1486
+ }, {
1487
+ contexts: Record<string, (z.objectInputType<{
1488
+ $ref: z.ZodString;
1489
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1490
+ description?: string | undefined;
1491
+ default?: string | undefined;
1492
+ $extensions?: Record<string, unknown> | undefined;
1493
+ }>>>;
1494
+ resolutionOrder: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1495
+ $ref: z.ZodString;
1496
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1497
+ $ref: z.ZodString;
1498
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1499
+ $ref: z.ZodString;
1500
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1501
+ type: z.ZodLiteral<"set">;
1502
+ name: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
1503
+ sources: z.ZodArray<z.ZodUnion<[z.ZodObject<{
1504
+ $ref: z.ZodString;
1505
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1506
+ $ref: z.ZodString;
1507
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1508
+ $ref: z.ZodString;
1509
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">;
1510
+ description: z.ZodOptional<z.ZodString>;
1511
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1512
+ }, "strip", z.ZodTypeAny, {
1513
+ name: string;
1514
+ type: "set";
1515
+ sources: (z.objectOutputType<{
1516
+ $ref: z.ZodString;
1517
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1518
+ description?: string | undefined;
1519
+ $extensions?: Record<string, unknown> | undefined;
1520
+ }, {
1521
+ name: string;
1522
+ type: "set";
1523
+ sources: (z.objectInputType<{
1524
+ $ref: z.ZodString;
1525
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1526
+ description?: string | undefined;
1527
+ $extensions?: Record<string, unknown> | undefined;
1528
+ }>, z.ZodEffects<z.ZodObject<{
1529
+ type: z.ZodLiteral<"modifier">;
1530
+ name: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
1531
+ contexts: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<[z.ZodObject<{
1532
+ $ref: z.ZodString;
1533
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1534
+ $ref: z.ZodString;
1535
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1536
+ $ref: z.ZodString;
1537
+ }, z.ZodTypeAny, "passthrough">>, z.ZodRecord<z.ZodString, z.ZodUnknown>]>, "many">>;
1538
+ description: z.ZodOptional<z.ZodString>;
1539
+ default: z.ZodOptional<z.ZodString>;
1540
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1541
+ }, "strip", z.ZodTypeAny, {
1542
+ name: string;
1543
+ type: "modifier";
1544
+ contexts: Record<string, (z.objectOutputType<{
1545
+ $ref: z.ZodString;
1546
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1547
+ description?: string | undefined;
1548
+ default?: string | undefined;
1549
+ $extensions?: Record<string, unknown> | undefined;
1550
+ }, {
1551
+ name: string;
1552
+ type: "modifier";
1553
+ contexts: Record<string, (z.objectInputType<{
1554
+ $ref: z.ZodString;
1555
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1556
+ description?: string | undefined;
1557
+ default?: string | undefined;
1558
+ $extensions?: Record<string, unknown> | undefined;
1559
+ }>, {
1560
+ name: string;
1561
+ type: "modifier";
1562
+ contexts: Record<string, (z.objectOutputType<{
1563
+ $ref: z.ZodString;
1564
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1565
+ description?: string | undefined;
1566
+ default?: string | undefined;
1567
+ $extensions?: Record<string, unknown> | undefined;
1568
+ }, {
1569
+ name: string;
1570
+ type: "modifier";
1571
+ contexts: Record<string, (z.objectInputType<{
1572
+ $ref: z.ZodString;
1573
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1574
+ description?: string | undefined;
1575
+ default?: string | undefined;
1576
+ $extensions?: Record<string, unknown> | undefined;
1577
+ }>]>, "many">;
1578
+ $schema: z.ZodOptional<z.ZodString>;
1579
+ $extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1580
+ $defs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1581
+ }, "strip", z.ZodTypeAny, {
1582
+ version: "2025.10";
1583
+ resolutionOrder: (z.objectOutputType<{
1584
+ $ref: z.ZodString;
1585
+ }, z.ZodTypeAny, "passthrough"> | {
1586
+ name: string;
1587
+ type: "set";
1588
+ sources: (z.objectOutputType<{
1589
+ $ref: z.ZodString;
1590
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1591
+ description?: string | undefined;
1592
+ $extensions?: Record<string, unknown> | undefined;
1593
+ } | {
1594
+ name: string;
1595
+ type: "modifier";
1596
+ contexts: Record<string, (z.objectOutputType<{
1597
+ $ref: z.ZodString;
1598
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1599
+ description?: string | undefined;
1600
+ default?: string | undefined;
1601
+ $extensions?: Record<string, unknown> | undefined;
1602
+ })[];
1603
+ name?: string | undefined;
1604
+ description?: string | undefined;
1605
+ sets?: Record<string, {
1606
+ sources: (z.objectOutputType<{
1607
+ $ref: z.ZodString;
1608
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1609
+ description?: string | undefined;
1610
+ $extensions?: Record<string, unknown> | undefined;
1611
+ }> | undefined;
1612
+ modifiers?: Record<string, {
1613
+ contexts: Record<string, (z.objectOutputType<{
1614
+ $ref: z.ZodString;
1615
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1616
+ description?: string | undefined;
1617
+ default?: string | undefined;
1618
+ $extensions?: Record<string, unknown> | undefined;
1619
+ }> | undefined;
1620
+ $schema?: string | undefined;
1621
+ $extensions?: Record<string, unknown> | undefined;
1622
+ $defs?: Record<string, unknown> | undefined;
1623
+ }, {
1624
+ version: "2025.10";
1625
+ resolutionOrder: (z.objectInputType<{
1626
+ $ref: z.ZodString;
1627
+ }, z.ZodTypeAny, "passthrough"> | {
1628
+ name: string;
1629
+ type: "set";
1630
+ sources: (z.objectInputType<{
1631
+ $ref: z.ZodString;
1632
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1633
+ description?: string | undefined;
1634
+ $extensions?: Record<string, unknown> | undefined;
1635
+ } | {
1636
+ name: string;
1637
+ type: "modifier";
1638
+ contexts: Record<string, (z.objectInputType<{
1639
+ $ref: z.ZodString;
1640
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1641
+ description?: string | undefined;
1642
+ default?: string | undefined;
1643
+ $extensions?: Record<string, unknown> | undefined;
1644
+ })[];
1645
+ name?: string | undefined;
1646
+ description?: string | undefined;
1647
+ sets?: Record<string, {
1648
+ sources: (z.objectInputType<{
1649
+ $ref: z.ZodString;
1650
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
1651
+ description?: string | undefined;
1652
+ $extensions?: Record<string, unknown> | undefined;
1653
+ }> | undefined;
1654
+ modifiers?: Record<string, {
1655
+ contexts: Record<string, (z.objectInputType<{
1656
+ $ref: z.ZodString;
1657
+ }, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
1658
+ description?: string | undefined;
1659
+ default?: string | undefined;
1660
+ $extensions?: Record<string, unknown> | undefined;
1661
+ }> | undefined;
1662
+ $schema?: string | undefined;
1663
+ $extensions?: Record<string, unknown> | undefined;
1664
+ $defs?: Record<string, unknown> | undefined;
1665
+ }>;
1666
+
1455
1667
  declare function isResolvedToken(token: unknown): token is ResolvedToken;
1456
1668
  declare function isResolvedTokenOfType<T extends TokenType>(token: unknown, type: T): token is ResolvedToken<T>;
1457
1669
 
1458
- export { type ArbitraryUtilityValue, type CSSFileOutput, type Candidate, DEFAULT_COLLECTION, DEFAULT_CONFIG, DEFAULT_CONTEXT, DEFAULT_DESIGN_TOKENS_PATH, DEFAULT_STYLES_PATH, DEFAULT_UTILITIES_FILENAME, DEFAULT_VARIABLES_FILENAME, ErrorMessages, type FunctionalCandidate, type FunctionalVariant, GLOBAL_DIR, Instrumentation, type InternalConfig, type LoadAndResolveResult, type LoadedConfig, type ModifierMeta, type NamedUtilityValue, type NormalizeResult, type NormalizedConvertedTokens, type NormalizedTokens, type OutputConfig, PerfMonitor, type ModifierMeta$1 as PipelineModifierMeta, type PipelineResult, type ResolvedToken, type ResolvedTokens, type ResolverLoadResult, SUGARCUBE_CONFIG_FILE, SUGARCUBE_FILE, type StaticCandidate, type StaticUtilityPattern, type StaticVariant, type TokenPipelineSource, type TokenTree, UTILITIES_DIR, type UserConfig, type UserOutputConfig, type UtilitiesConfig, type UtilityValue, VARIABLES_FILE_SUFFIX, type Variant, clearMatchCache, configFileExists, convertConfigToUnoRules, discoverAllFiles, fillDefaults, findConfigFile, generateCSSVariables, generateIndex, generateIndexContent, internalConfigSchema, isResolvedToken, isResolvedTokenOfType, loadAndResolveTokens, loadFromResolver, loadInternalConfig, loadTSConfig, loadUserConfig, parseAndValidateConfig, processAndConvertTokens, shouldRegenerateIndex, userConfigSchema, validateConfig, validateInternalConfig, validateUserConfig, writeCSSUtilitiesToDisk, writeCSSVariablesToDisk };
1670
+ /**
1671
+ * Check if an object is a reference (has $ref property).
1672
+ */
1673
+ declare function isReference(value: unknown): value is {
1674
+ $ref: string;
1675
+ };
1676
+ /**
1677
+ * Type guard for inline set in resolutionOrder.
1678
+ */
1679
+ declare function isInlineSet(item: unknown): item is {
1680
+ type: "set";
1681
+ name: string;
1682
+ sources: unknown[];
1683
+ };
1684
+ /**
1685
+ * Type guard for inline modifier in resolutionOrder.
1686
+ */
1687
+ declare function isInlineModifier(item: unknown): item is {
1688
+ type: "modifier";
1689
+ name: string;
1690
+ contexts: Record<string, unknown[]>;
1691
+ default?: string;
1692
+ };
1693
+
1694
+ export { type CSSFileOutput, DEFAULT_COLLECTION, DEFAULT_CONFIG, DEFAULT_CONTEXT, DEFAULT_DESIGN_TOKENS_PATH, DEFAULT_STYLES_PATH, DEFAULT_UTILITIES_FILENAME, DEFAULT_VARIABLES_FILENAME, ErrorMessages, GLOBAL_DIR, Instrumentation, type InternalConfig, type LoadAndResolveResult, type LoadedConfig, type ModifierMeta, type NormalizeResult, type NormalizedConvertedTokens, type NormalizedTokens, type OutputConfig, PerfMonitor, type ModifierMeta$1 as PipelineModifierMeta, type PipelineResult, type ResolvedToken, type ResolvedTokens, type ResolverLoadResult, SUGARCUBE_CONFIG_FILE, SUGARCUBE_FILE, type SugarcubeConfig, type TokenPipelineSource, type TokenTree, UTILITIES_DIR, type UtilitiesConfig, VARIABLES_FILE_SUFFIX, clearMatchCache, configFileExists, convertConfigToUnoRules, discoverAllFiles, fillDefaults, findConfigFile, generateCSSVariables, generateIndexContent, inlineModifierSchema, inlineSetSchema, internalConfigSchema, isInlineModifier, isInlineSet, isReference, isResolvedToken, isResolvedTokenOfType, loadAndResolveTokens, loadFromResolver, loadInternalConfig, loadSugarcubeConfig, loadTSConfig, modifierContextsSchema, modifierDefinitionSchema, modifiersMapSchema, nameSchema, parseAndValidateConfig, processAndConvertTokens, referenceObjectSchema, resolutionOrderItemSchema, resolverDocumentSchema, setDefinitionSchema, setsMapSchema, sourceSchema, userConfigSchema, validateConfig, validateInternalConfig, validateSugarcubeConfig, writeCSSUtilitiesToDisk, writeCSSVariablesToDisk };