@sugarcube-org/core 0.0.1-alpha.14 → 0.0.1-alpha.16

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 (3) hide show
  1. package/dist/index.d.ts +177 -1123
  2. package/dist/index.js +18 -20
  3. package/package.json +3 -4
package/dist/index.d.ts CHANGED
@@ -1,5 +1,22 @@
1
1
  import { z } from 'zod';
2
2
 
3
+ declare const DEFAULT_CONFIG: {
4
+ readonly output: {
5
+ readonly css: "src/styles";
6
+ readonly components: "src/components/ui";
7
+ readonly themeAttribute: "data-theme";
8
+ };
9
+ readonly transforms: {
10
+ readonly fluid: {
11
+ readonly min: 320;
12
+ readonly max: 1200;
13
+ };
14
+ readonly colorFallbackStrategy: "native";
15
+ };
16
+ };
17
+
18
+ declare const DEFAULT_STYLES_PATH = "src/styles";
19
+
3
20
  type DirectionalVariant = "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all";
4
21
  type PropertyUtilityConfig = {
5
22
  /** Token path pattern (e.g., "space.*", "color.primary.*"). */
@@ -106,6 +123,54 @@ interface InternalConfig {
106
123
  utilities?: UtilitiesConfig;
107
124
  }
108
125
 
126
+ /**
127
+ * Result of loading a sugarcube configuration file.
128
+ * Contains the validated, normalized configuration and its source path.
129
+ */
130
+ type LoadedConfig = {
131
+ /** The validated and normalized configuration with defaults applied. */
132
+ config: InternalConfig;
133
+ /** The absolute path to the config file that was loaded. */
134
+ configPath: string;
135
+ };
136
+ declare function configFileExists(basePath?: string): boolean;
137
+ declare function loadSugarcubeConfig(configPath?: string): Promise<{
138
+ config: SugarcubeConfig;
139
+ configPath: string;
140
+ }>;
141
+ declare function loadInternalConfig(configPath?: string): Promise<LoadedConfig>;
142
+
143
+ /**
144
+ * Validates a user configuration object against the schema and fills in defaults.
145
+ *
146
+ * @param config - The user configuration object to validate
147
+ * @returns The validated configuration with defaults filled in
148
+ * @throws Error if the configuration is invalid
149
+ *
150
+ * @example
151
+ * const config = { resolver: "./tokens.resolver.json" };
152
+ * const validatedConfig = validateConfig(config);
153
+ */
154
+ declare function validateConfig(config: Partial<SugarcubeConfig>): InternalConfig;
155
+
156
+ /**
157
+ * Fills in default values for any omitted fields in a user configuration.
158
+ *
159
+ * This function takes a user config (with optional fields) and
160
+ * returns a complete internal config (with all required fields filled in).
161
+ *
162
+ * @param userConfig - The user configuration with optional fields
163
+ * @returns A complete configuration with all defaults filled in
164
+ *
165
+ * @example
166
+ * const userConfig = {
167
+ * resolver: "./tokens.resolver.json"
168
+ * };
169
+ * const completeConfig = fillDefaults(userConfig);
170
+ * // completeConfig.output.css === "src/styles"
171
+ */
172
+ declare function fillDefaults(userConfig: SugarcubeConfig): InternalConfig;
173
+
109
174
  type BaseError = {
110
175
  message: string;
111
176
  };
@@ -231,6 +296,35 @@ type TokenTree = {
231
296
  sourcePath: string;
232
297
  };
233
298
 
299
+ type FlattenError = BaseError & {
300
+ path: string;
301
+ source: TokenSource;
302
+ };
303
+
304
+ /**
305
+ * A generated CSS file with its output path and content.
306
+ */
307
+ type CSSFile = {
308
+ /** The file path where the CSS will be written. */
309
+ path: string;
310
+ /** The generated CSS content. */
311
+ css: string;
312
+ };
313
+ /**
314
+ * Array of generated CSS files from the pipeline.
315
+ * Each file contains a path and the CSS content to write.
316
+ */
317
+ type CSSFileOutput = CSSFile[];
318
+
319
+ /** In-memory token data keyed by file path. */
320
+ type TokenMemoryData = Record<string, {
321
+ context?: string;
322
+ content: string;
323
+ }>;
324
+ type LoadError = BaseError & {
325
+ file: string;
326
+ };
327
+
234
328
  /**
235
329
  * A token with all references resolved to their final values.
236
330
  * Contains both the original value (which may include references)
@@ -264,78 +358,6 @@ type ResolutionError = BaseError & {
264
358
  source: TokenSource;
265
359
  };
266
360
 
267
- type ConvertedToken<T extends TokenType = TokenType> = ResolvedToken<T> & {
268
- $cssProperties: CSSProperties<T>;
269
- };
270
- type ConvertedTokens = {
271
- [lookupKey: string]: ConvertedToken | NodeMetadata;
272
- };
273
- /**
274
- * Tokens that have been converted to CSS properties, organized by context.
275
- * Each context (e.g., "default", "dark") maps to its converted tokens.
276
- */
277
- type NormalizedConvertedTokens = {
278
- [context: string]: ConvertedTokens;
279
- };
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;
281
- type SimpleCSSProperties = {
282
- value: string | number;
283
- /** Feature queries for progressive enhancement (e.g., P3 colors). */
284
- featureValues?: Array<{
285
- query: string;
286
- value: string;
287
- }>;
288
- };
289
- type AlwaysDecomposedProperties = CSSTypographyProperties;
290
- type CSSTypographyProperties = {
291
- "font-family": string;
292
- "font-size": string;
293
- "font-weight"?: number | string;
294
- "letter-spacing"?: string;
295
- "line-height"?: number | string;
296
- };
297
- type CSSBorderProperties = {
298
- value: string;
299
- };
300
- type CSSShadowProperties = {
301
- value: string;
302
- };
303
- type CSSGradientProperties = {
304
- value: string;
305
- };
306
- type CSSTransitionProperties = {
307
- value: string;
308
- };
309
-
310
- /**
311
- * A generated CSS file with its output path and content.
312
- */
313
- type CSSFile = {
314
- /** The file path where the CSS will be written. */
315
- path: string;
316
- /** The generated CSS content. */
317
- css: string;
318
- };
319
- /**
320
- * Array of generated CSS files from the pipeline.
321
- * Each file contains a path and the CSS content to write.
322
- */
323
- type CSSFileOutput = CSSFile[];
324
-
325
- type FlattenError = BaseError & {
326
- path: string;
327
- source: TokenSource;
328
- };
329
-
330
- /** In-memory token data keyed by file path. */
331
- type TokenMemoryData = Record<string, {
332
- context?: string;
333
- content: string;
334
- }>;
335
- type LoadError = BaseError & {
336
- file: string;
337
- };
338
-
339
361
  type ValidationError = BaseError & {
340
362
  path: string;
341
363
  source: TokenSource;
@@ -345,7 +367,7 @@ type ValidationError = BaseError & {
345
367
  * Metadata about a modifier (e.g., theme, density) for CSS generation.
346
368
  * Used to build attribute selectors like [data-theme="dark"].
347
369
  */
348
- type ModifierMeta$1 = {
370
+ type ModifierMeta = {
349
371
  /** The modifier name (e.g., "theme", "density"). */
350
372
  name: string;
351
373
  /** The HTML attribute name (e.g., "data-theme", "data-density"). */
@@ -365,7 +387,7 @@ type PipelineResult = {
365
387
  /** The loaded and processed token trees. */
366
388
  trees: TokenTree[];
367
389
  /** Modifier metadata for CSS selector generation. */
368
- modifiers?: ModifierMeta$1[];
390
+ modifiers?: ModifierMeta[];
369
391
  /** Any errors that occurred during pipeline execution. */
370
392
  errors: PipelineErrors;
371
393
  };
@@ -415,16 +437,6 @@ type TokenPipelineSource = {
415
437
  config: InternalConfig;
416
438
  };
417
439
 
418
- /**
419
- * Generate CSS variable files from converted tokens.
420
- *
421
- * @param convertedTokens - The normalized and converted tokens
422
- * @param config - The configuration object
423
- * @param modifiers - Optional modifier metadata for generating per-modifier attribute selectors
424
- * @returns Array of CSS file outputs
425
- */
426
- declare function generateCSSVariables(convertedTokens: NormalizedConvertedTokens, config: InternalConfig, modifiers?: ModifierMeta$1[]): Promise<CSSFileOutput>;
427
-
428
440
  /**
429
441
  * Result of loading and resolving tokens.
430
442
  */
@@ -434,7 +446,7 @@ type LoadAndResolveResult = {
434
446
  /** Resolved tokens after reference resolution */
435
447
  resolved: ResolvedTokens;
436
448
  /** Modifier metadata for CSS selector generation */
437
- modifiers: ModifierMeta$1[];
449
+ modifiers: ModifierMeta[];
438
450
  /** Any errors that occurred */
439
451
  errors: PipelineResult["errors"];
440
452
  };
@@ -464,41 +476,48 @@ type LoadAndResolveResult = {
464
476
  */
465
477
  declare function loadAndResolveTokens(source: TokenPipelineSource): Promise<LoadAndResolveResult>;
466
478
 
467
- /**
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.
471
- */
472
- type NormalizedTokens = Record<string, ResolvedTokens>;
473
- /**
474
- * Result of the normalization process.
475
- * Contains tokens organized by context and the default context name.
476
- */
477
- type NormalizeResult = {
478
- /** Tokens organized by context name. */
479
- tokens: NormalizedTokens;
480
- /** The context that should use :root selector in CSS output. */
481
- defaultContext?: string;
479
+ type ConvertedToken<T extends TokenType = TokenType> = ResolvedToken<T> & {
480
+ $cssProperties: CSSProperties<T>;
481
+ };
482
+ type ConvertedTokens = {
483
+ [lookupKey: string]: ConvertedToken | NodeMetadata;
482
484
  };
483
-
484
485
  /**
485
- * Result of loading a sugarcube configuration file.
486
- * Contains the validated, normalized configuration and its source path.
486
+ * Tokens that have been converted to CSS properties, organized by context.
487
+ * Each context (e.g., "default", "dark") maps to its converted tokens.
487
488
  */
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;
489
+ type NormalizedConvertedTokens = {
490
+ [context: string]: ConvertedTokens;
491
+ };
492
+ 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;
493
+ type SimpleCSSProperties = {
494
+ value: string | number;
495
+ /** Feature queries for progressive enhancement (e.g., P3 colors). */
496
+ featureValues?: Array<{
497
+ query: string;
498
+ value: string;
499
+ }>;
500
+ };
501
+ type AlwaysDecomposedProperties = CSSTypographyProperties;
502
+ type CSSTypographyProperties = {
503
+ "font-family": string;
504
+ "font-size": string;
505
+ "font-weight"?: number | string;
506
+ "letter-spacing"?: string;
507
+ "line-height"?: number | string;
508
+ };
509
+ type CSSBorderProperties = {
510
+ value: string;
511
+ };
512
+ type CSSShadowProperties = {
513
+ value: string;
514
+ };
515
+ type CSSGradientProperties = {
516
+ value: string;
517
+ };
518
+ type CSSTransitionProperties = {
519
+ value: string;
493
520
  };
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>;
502
521
 
503
522
  /**
504
523
  * Processes and converts token trees into CSS-ready format.
@@ -521,42 +540,46 @@ declare function loadInternalConfig(configPath?: string): Promise<LoadedConfig>;
521
540
  declare function processAndConvertTokens(trees: TokenTree[], resolved: ResolvedTokens, config: InternalConfig, validationErrors?: ValidationError[]): Promise<NormalizedConvertedTokens>;
522
541
 
523
542
  /**
524
- * Modifier metadata for CSS generation.
525
- * Used to build selectors like [data-theme="dark"].
526
- */
527
- type ModifierMeta = {
528
- /** The modifier name (e.g., "theme", "density") */
529
- name: string;
530
- /** Auto-derived CSS attribute (e.g., "data-theme", "data-density") */
531
- attribute: string;
532
- /** The default context name */
533
- defaultContext: string;
534
- /** Available non-default context names */
535
- contexts: string[];
536
- };
537
- /**
538
- * Result of loading tokens from a resolver document.
539
- */
540
- type ResolverLoadResult = {
541
- /** Token trees for pipeline processing (base + all modifier contexts) */
542
- trees: TokenTree[];
543
- /** Modifier metadata for CSS selector generation */
544
- modifiers: ModifierMeta[];
545
- /** Any errors encountered during loading */
546
- errors: LoadError[];
547
- };
548
- /**
549
- * Load tokens from a resolver document.
543
+ * Generate CSS variable files from converted tokens.
550
544
  *
551
- * Returns TokenTree[] with compound context keys for modifier contexts:
552
- * - Base tokens: context = undefined (maps to :root)
553
- * - Modifier contexts: context = "modifierName:contextName" (e.g., "theme:dark")
545
+ * @param convertedTokens - The normalized and converted tokens
546
+ * @param config - The configuration object
547
+ * @param modifiers - Optional modifier metadata for generating per-modifier attribute selectors
548
+ * @returns Array of CSS file outputs
554
549
  */
555
- declare function loadFromResolver(resolverPath: string): Promise<ResolverLoadResult>;
550
+ declare function generateCSSVariables(convertedTokens: NormalizedConvertedTokens, config: InternalConfig, modifiers?: ModifierMeta[]): Promise<CSSFileOutput>;
556
551
 
557
- /**
558
- * Writes CSS files to disk, creating directories as needed.
559
- *
552
+ type CSSObject = Record<string, string | number | undefined>;
553
+ declare function clearMatchCache(): void;
554
+ declare function convertConfigToUnoRules(utilitiesConfig: UtilitiesConfig, tokens: NormalizedConvertedTokens): Array<[RegExp, (m: RegExpMatchArray) => CSSObject]>;
555
+
556
+ declare class PerfMonitor implements Disposable {
557
+ #private;
558
+ private defaultFlush;
559
+ constructor(defaultFlush?: (message: string) => undefined);
560
+ log(message: string, data?: Record<string, unknown>): void;
561
+ trackWatcherEvent(file: string, moduleGraphSize: number): void;
562
+ logWatcherSetup(pattern: string, dir: string): void;
563
+ logModuleGraphStats(modules: number, urls: number, context: string): void;
564
+ startMemoryMonitor(): void;
565
+ stopMemoryMonitor(): void;
566
+ [Symbol.dispose](): void;
567
+ }
568
+
569
+ declare class Instrumentation implements Disposable {
570
+ #private;
571
+ private defaultFlush;
572
+ constructor(defaultFlush?: (message: string) => undefined);
573
+ hit(label: string): void;
574
+ start(label: string): void;
575
+ end(label: string): void;
576
+ report(flush?: (message: string) => undefined): void;
577
+ [Symbol.dispose](): void;
578
+ }
579
+
580
+ /**
581
+ * Writes CSS files to disk, creating directories as needed.
582
+ *
560
583
  * This function:
561
584
  * 1. Creates any missing directories in the file path
562
585
  * 2. Adds a warning banner to prevent direct edits
@@ -594,227 +617,6 @@ declare function writeCSSVariablesToDisk(output: CSSFileOutput): Promise<CSSFile
594
617
  */
595
618
  declare function writeCSSUtilitiesToDisk(output: CSSFileOutput): Promise<CSSFileOutput>;
596
619
 
597
- /**
598
- * Validates a user configuration object against the user schema.
599
- *
600
- * @param config - The user configuration object to validate
601
- * @returns The validated user configuration
602
- * @throws Error if the configuration is invalid
603
- */
604
- declare function validateSugarcubeConfig(config: Partial<SugarcubeConfig>): SugarcubeConfig;
605
- /**
606
- * Validates an internal configuration object against the internal schema.
607
- *
608
- * @param config - The internal configuration object to validate
609
- * @returns The validated internal configuration
610
- * @throws Error if the configuration is invalid
611
- */
612
- declare function validateInternalConfig(config: InternalConfig): InternalConfig;
613
- /**
614
- * Validates a user configuration object against the schema and fills in defaults.
615
- *
616
- * @param config - The user configuration object to validate
617
- * @returns The validated configuration with defaults filled in
618
- * @throws Error if the configuration is invalid
619
- *
620
- * @example
621
- * const config = { resolver: "./tokens.resolver.json" };
622
- * const validatedConfig = validateConfig(config);
623
- */
624
- declare function validateConfig(config: Partial<SugarcubeConfig>): InternalConfig;
625
- /**
626
- * Parses and validates a JSON configuration string.
627
- *
628
- * @param configString - The JSON configuration string to parse and validate
629
- * @returns The validated and normalized configuration
630
- * @throws Error if the JSON is invalid or the configuration is invalid
631
- */
632
- declare function parseAndValidateConfig(configString: string): InternalConfig;
633
-
634
- /**
635
- * Fills in default values for any omitted fields in a user configuration.
636
- *
637
- * This function takes a user config (with optional fields) and
638
- * returns a complete internal config (with all required fields filled in).
639
- *
640
- * @param userConfig - The user configuration with optional fields
641
- * @returns A complete configuration with all defaults filled in
642
- *
643
- * @example
644
- * const userConfig = {
645
- * resolver: "./tokens.resolver.json"
646
- * };
647
- * const completeConfig = fillDefaults(userConfig);
648
- * // completeConfig.output.css === "src/styles"
649
- */
650
- declare function fillDefaults(userConfig: SugarcubeConfig): InternalConfig;
651
-
652
- interface CSSImport {
653
- path: string;
654
- layer: string;
655
- relativePath: string;
656
- }
657
- declare function discoverAllFiles(stylesDir: string, config: InternalConfig): Promise<CSSImport[]>;
658
-
659
- declare function generateIndexContent(files: CSSImport[]): string;
660
-
661
- declare class Instrumentation implements Disposable {
662
- #private;
663
- private defaultFlush;
664
- constructor(defaultFlush?: (message: string) => undefined);
665
- hit(label: string): void;
666
- start(label: string): void;
667
- end(label: string): void;
668
- report(flush?: (message: string) => undefined): void;
669
- [Symbol.dispose](): void;
670
- }
671
-
672
- declare class PerfMonitor implements Disposable {
673
- #private;
674
- private defaultFlush;
675
- constructor(defaultFlush?: (message: string) => undefined);
676
- log(message: string, data?: Record<string, unknown>): void;
677
- trackWatcherEvent(file: string, moduleGraphSize: number): void;
678
- logWatcherSetup(pattern: string, dir: string): void;
679
- logModuleGraphStats(modules: number, urls: number, context: string): void;
680
- startMemoryMonitor(): void;
681
- stopMemoryMonitor(): void;
682
- [Symbol.dispose](): void;
683
- }
684
-
685
- type CSSObject = Record<string, string | number | undefined>;
686
- declare function clearMatchCache(): void;
687
- declare function convertConfigToUnoRules(utilitiesConfig: UtilitiesConfig, tokens: NormalizedConvertedTokens): Array<[RegExp, (m: RegExpMatchArray) => CSSObject]>;
688
-
689
- declare const SUGARCUBE_FILE = "_sugarcube.css";
690
- declare const GLOBAL_DIR = "global";
691
- declare const UTILITIES_DIR = "utilities";
692
- declare const VARIABLES_FILE_SUFFIX = ".variables.gen.css";
693
- declare const DEFAULT_VARIABLES_FILENAME = "tokens";
694
- declare const DEFAULT_UTILITIES_FILENAME = "utilities.gen.css";
695
- declare const DEFAULT_STYLES_PATH = "src/styles";
696
- declare const DEFAULT_DESIGN_TOKENS_PATH = "src/design-tokens";
697
- declare const SUGARCUBE_CONFIG_FILE = "sugarcube.config.ts";
698
-
699
- declare const DEFAULT_CONFIG: {
700
- readonly output: {
701
- readonly css: "src/styles";
702
- readonly components: "src/components/ui";
703
- readonly themeAttribute: "data-theme";
704
- };
705
- readonly transforms: {
706
- readonly fluid: {
707
- readonly min: 320;
708
- readonly max: 1200;
709
- };
710
- readonly colorFallbackStrategy: "native";
711
- };
712
- };
713
-
714
- declare const DEFAULT_COLLECTION = "default";
715
- declare const DEFAULT_CONTEXT = "default";
716
-
717
- declare const ErrorMessages: {
718
- readonly LOAD: {
719
- readonly NO_FILES_FOUND: (pattern: string) => string;
720
- readonly INVALID_JSON: (path: string, message: string) => string;
721
- readonly GLOB_ERROR: (pattern: string, error: string) => string;
722
- };
723
- readonly FLATTEN: {
724
- readonly INVALID_TOKEN_NAME: (name: string) => string;
725
- readonly MISSING_DOLLAR_PREFIX: (path: string) => string;
726
- readonly INVALID_TOKEN_NESTING: (path: string) => string;
727
- readonly COMPOSITE_TOKEN_MISSING_TYPE: (path: string) => string;
728
- readonly CONFLICT_TOKEN_VS_GROUP: (path: string) => string;
729
- readonly CONFLICT_INCOMPATIBLE_TYPES: (expected: string, received: string, path: string) => string;
730
- };
731
- readonly METADATA: {
732
- readonly COLLECTION_ERROR: (message: string) => string;
733
- readonly INVALID_EXTENSIONS: (path: string) => string;
734
- readonly INVALID_DESCRIPTION: (path: string) => string;
735
- };
736
- readonly VALIDATE: {
737
- readonly MISSING_TYPE: (path: string) => string;
738
- readonly UNKNOWN_TOKEN_TYPE: (type: string, path: string) => string;
739
- readonly INVALID_COLOR: (value: unknown, path: string) => string;
740
- readonly INVALID_DIMENSION: (value: unknown, path: string) => string;
741
- readonly INVALID_DIMENSION_UNIT: (unit: unknown, path: string) => string;
742
- readonly INVALID_FONT_FAMILY: (value: unknown, path: string) => string;
743
- readonly INVALID_FONT_WEIGHT: (value: unknown, path: string) => string;
744
- readonly INVALID_DURATION: (value: unknown, path: string) => string;
745
- readonly INVALID_DURATION_UNIT: (unit: unknown, path: string) => string;
746
- readonly INVALID_CUBIC_BEZIER: (value: unknown, path: string) => string;
747
- readonly INVALID_STROKE_STYLE: (value: unknown, path: string) => string;
748
- readonly INVALID_STROKE_LINE_CAP: (value: unknown, path: string) => string;
749
- readonly INVALID_BORDER: (value: unknown, path: string) => string;
750
- readonly INVALID_SHADOW: (value: unknown, path: string) => string;
751
- readonly INVALID_SHADOW_INSET: (value: unknown, path: string) => string;
752
- readonly INVALID_TRANSITION: (value: unknown, path: string) => string;
753
- readonly INVALID_GRADIENT: (value: unknown, path: string) => string;
754
- readonly INVALID_GRADIENT_STOP_POSITION: (value: unknown, path: string) => string;
755
- readonly INVALID_TYPOGRAPHY: (value: unknown, path: string) => string;
756
- readonly MISSING_REQUIRED_PROPERTY: (prop: string, path: string) => string;
757
- readonly INVALID_NUMBER: (value: unknown, path: string) => string;
758
- readonly INVALID_ARRAY: (value: unknown, path: string) => string;
759
- readonly MISSING_FLUID_CONFIG: (path: string) => string;
760
- readonly INVALID_FLUID_DIMENSION: (value: unknown, path: string) => string;
761
- readonly INVALID_VIEWPORT_CONFIG: (value: unknown, path: string) => string;
762
- readonly MISMATCHED_UNITS: (unit1: unknown, unit2: unknown, path: string) => string;
763
- readonly INVALID_FLUID_VALUE_RANGE: (path: string) => string;
764
- readonly INVALID_TOKEN_TYPE: (expected: string, received: string, path: string) => string;
765
- readonly INVALID_TYPE: (expected: string, value: unknown, path: string) => string;
766
- readonly INVALID_ENUM_VALUE: (enumValues: unknown[], value: unknown, path: string) => string;
767
- };
768
- readonly RESOLVE: {
769
- readonly CIRCULAR_REFERENCE: (path: string, ref: string) => string;
770
- readonly REFERENCE_NOT_FOUND: (ref: string, path: string) => string;
771
- readonly TYPE_MISMATCH: (path: string) => string;
772
- };
773
- readonly GENERATE: {
774
- readonly INVALID_CSS_VALUE: (key: string, value: unknown) => string;
775
- readonly INVALID_VARIABLE_NAME: (path: string, name: string) => string;
776
- };
777
- readonly CONFIG: {
778
- readonly INVALID_JSON: (error: string) => string;
779
- readonly INVALID_CONFIG: (path: string, message: string) => string;
780
- readonly DUPLICATE_FILENAMES: (filename: string, paths: string[]) => string;
781
- readonly FILE_NOT_FOUND: (path: string) => string;
782
- };
783
- readonly UTILITIES: {
784
- readonly RESERVED_PREFIX: (prefix: string, tokenType: string) => string;
785
- readonly DUPLICATE_CLASS_NAME: (className: string, paths: string[]) => string;
786
- readonly INVALID_PROPERTY_MAPPING: (tokenType: string) => string;
787
- readonly DUPLICATE_PREFIX: (prefix: string, tokenType: string) => string;
788
- readonly MISSING_SOURCE: (property: string) => string;
789
- readonly INVALID_SOURCE_PATTERN: (property: string, source: string) => string;
790
- readonly INVALID_DIRECTIONS: (property: string) => string;
791
- readonly INVALID_CONFIG_OBJECT: "utilitiesConfig must be an object";
792
- readonly INVALID_TOKENS_OBJECT: "tokens must be an object";
793
- };
794
- readonly RESOLVER: {
795
- readonly FILE_NOT_FOUND: (path: string) => string;
796
- readonly INVALID_JSON: (message: string) => string;
797
- readonly INVALID_REFERENCE: (ref: string) => string;
798
- readonly INVALID_SOURCE_REFERENCE: (ref: string) => string;
799
- readonly UNDEFINED_SET: (name: string) => string;
800
- readonly UNDEFINED_MODIFIER: (name: string) => string;
801
- readonly CIRCULAR_REFERENCE: (ref: string) => string;
802
- readonly EXTERNAL_FILE_NOT_FOUND: (path: string) => string;
803
- readonly EXTERNAL_FILE_ERROR: (path: string, message: string) => string;
804
- readonly INVALID_JSON_POINTER: (pointer: string, reason: string) => string;
805
- readonly DUPLICATE_NAME: (name: string) => string;
806
- readonly MODIFIER_NEEDS_CONTEXTS: "Modifier must have at least one context defined.";
807
- readonly MODIFIER_SINGLE_CONTEXT: "Modifier has only one context. Consider using a set instead, or add more contexts.";
808
- readonly INVALID_DEFAULT: (name: string, contexts: string[]) => string;
809
- readonly UNKNOWN_MODIFIER: (name: string) => string;
810
- readonly INVALID_CONTEXT: (context: string, modifier: string, valid: string[]) => string;
811
- readonly MISSING_REQUIRED_INPUT: (name: string) => string;
812
- readonly INVALID_INPUT_TYPE: (name: string) => string;
813
- readonly MALFORMED_REFERENCE: (key: string, value: string) => string;
814
- readonly RESOLVER_AS_TOKEN_SOURCE: (path: string) => string;
815
- };
816
- };
817
-
818
620
  declare const userConfigSchema: z.ZodObject<{
819
621
  resolver: z.ZodOptional<z.ZodString>;
820
622
  transforms: z.ZodOptional<z.ZodObject<{
@@ -848,13 +650,13 @@ declare const userConfigSchema: z.ZodObject<{
848
650
  themeAttribute: z.ZodOptional<z.ZodString>;
849
651
  defaultContext: z.ZodOptional<z.ZodString>;
850
652
  }, "strip", z.ZodTypeAny, {
851
- css?: string | undefined;
852
653
  components?: string | undefined;
654
+ css?: string | undefined;
853
655
  themeAttribute?: string | undefined;
854
656
  defaultContext?: string | undefined;
855
657
  }, {
856
- css?: string | undefined;
857
658
  components?: string | undefined;
659
+ css?: string | undefined;
858
660
  themeAttribute?: string | undefined;
859
661
  defaultContext?: string | undefined;
860
662
  }>>;
@@ -899,8 +701,8 @@ declare const userConfigSchema: z.ZodObject<{
899
701
  colorFallbackStrategy?: "native" | "polyfill" | undefined;
900
702
  } | undefined;
901
703
  output?: {
902
- css?: string | undefined;
903
704
  components?: string | undefined;
705
+ css?: string | undefined;
904
706
  themeAttribute?: string | undefined;
905
707
  defaultContext?: string | undefined;
906
708
  } | undefined;
@@ -925,8 +727,8 @@ declare const userConfigSchema: z.ZodObject<{
925
727
  colorFallbackStrategy?: "native" | "polyfill" | undefined;
926
728
  } | undefined;
927
729
  output?: {
928
- css?: string | undefined;
929
730
  components?: string | undefined;
731
+ css?: string | undefined;
930
732
  themeAttribute?: string | undefined;
931
733
  defaultContext?: string | undefined;
932
734
  } | undefined;
@@ -942,753 +744,5 @@ declare const userConfigSchema: z.ZodObject<{
942
744
  stripDuplicates?: boolean | undefined;
943
745
  }[]> | undefined;
944
746
  }>;
945
- declare const internalConfigSchema: z.ZodObject<{
946
- resolver: z.ZodOptional<z.ZodString>;
947
- transforms: z.ZodObject<{
948
- fluid: z.ZodObject<{
949
- min: z.ZodNumber;
950
- max: z.ZodNumber;
951
- }, "strip", z.ZodTypeAny, {
952
- min: number;
953
- max: number;
954
- }, {
955
- min: number;
956
- max: number;
957
- }>;
958
- colorFallbackStrategy: z.ZodEnum<["native", "polyfill"]>;
959
- }, "strip", z.ZodTypeAny, {
960
- fluid: {
961
- min: number;
962
- max: number;
963
- };
964
- colorFallbackStrategy: "native" | "polyfill";
965
- }, {
966
- fluid: {
967
- min: number;
968
- max: number;
969
- };
970
- colorFallbackStrategy: "native" | "polyfill";
971
- }>;
972
- output: z.ZodObject<{
973
- css: z.ZodString;
974
- components: z.ZodOptional<z.ZodString>;
975
- themeAttribute: z.ZodString;
976
- defaultContext: z.ZodOptional<z.ZodString>;
977
- }, "strip", z.ZodTypeAny, {
978
- css: string;
979
- themeAttribute: string;
980
- components?: string | undefined;
981
- defaultContext?: string | undefined;
982
- }, {
983
- css: string;
984
- themeAttribute: string;
985
- components?: string | undefined;
986
- defaultContext?: string | undefined;
987
- }>;
988
- utilities: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
989
- source: z.ZodString;
990
- directions: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["top", "right", "bottom", "left", "x", "y", "full", "all"]>, z.ZodArray<z.ZodEnum<["top", "right", "bottom", "left", "x", "y", "full", "all"]>, "many">]>>;
991
- prefix: z.ZodOptional<z.ZodString>;
992
- stripDuplicates: z.ZodOptional<z.ZodBoolean>;
993
- }, "strip", z.ZodTypeAny, {
994
- source: string;
995
- directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
996
- prefix?: string | undefined;
997
- stripDuplicates?: boolean | undefined;
998
- }, {
999
- source: string;
1000
- directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
1001
- prefix?: string | undefined;
1002
- stripDuplicates?: boolean | undefined;
1003
- }>, z.ZodArray<z.ZodObject<{
1004
- source: z.ZodString;
1005
- directions: z.ZodOptional<z.ZodUnion<[z.ZodEnum<["top", "right", "bottom", "left", "x", "y", "full", "all"]>, z.ZodArray<z.ZodEnum<["top", "right", "bottom", "left", "x", "y", "full", "all"]>, "many">]>>;
1006
- prefix: z.ZodOptional<z.ZodString>;
1007
- stripDuplicates: z.ZodOptional<z.ZodBoolean>;
1008
- }, "strip", z.ZodTypeAny, {
1009
- source: string;
1010
- directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
1011
- prefix?: string | undefined;
1012
- stripDuplicates?: boolean | undefined;
1013
- }, {
1014
- source: string;
1015
- directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
1016
- prefix?: string | undefined;
1017
- stripDuplicates?: boolean | undefined;
1018
- }>, "many">]>>>;
1019
- }, "strip", z.ZodTypeAny, {
1020
- output: {
1021
- css: string;
1022
- themeAttribute: string;
1023
- components?: string | undefined;
1024
- defaultContext?: string | undefined;
1025
- };
1026
- transforms: {
1027
- fluid: {
1028
- min: number;
1029
- max: number;
1030
- };
1031
- colorFallbackStrategy: "native" | "polyfill";
1032
- };
1033
- resolver?: string | undefined;
1034
- utilities?: Record<string, {
1035
- source: string;
1036
- directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
1037
- prefix?: string | undefined;
1038
- stripDuplicates?: boolean | undefined;
1039
- } | {
1040
- source: string;
1041
- directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
1042
- prefix?: string | undefined;
1043
- stripDuplicates?: boolean | undefined;
1044
- }[]> | undefined;
1045
- }, {
1046
- output: {
1047
- css: string;
1048
- themeAttribute: string;
1049
- components?: string | undefined;
1050
- defaultContext?: string | undefined;
1051
- };
1052
- transforms: {
1053
- fluid: {
1054
- min: number;
1055
- max: number;
1056
- };
1057
- colorFallbackStrategy: "native" | "polyfill";
1058
- };
1059
- resolver?: string | undefined;
1060
- utilities?: Record<string, {
1061
- source: string;
1062
- directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
1063
- prefix?: string | undefined;
1064
- stripDuplicates?: boolean | undefined;
1065
- } | {
1066
- source: string;
1067
- directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
1068
- prefix?: string | undefined;
1069
- stripDuplicates?: boolean | undefined;
1070
- }[]> | undefined;
1071
- }>;
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
-
1667
- declare function isResolvedToken(token: unknown): token is ResolvedToken;
1668
- declare function isResolvedTokenOfType<T extends TokenType>(token: unknown, type: T): token is ResolvedToken<T>;
1669
-
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
747
 
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 };
748
+ export { type CSSFileOutput, DEFAULT_CONFIG, DEFAULT_STYLES_PATH, Instrumentation, type InternalConfig, type ModifierMeta, type NormalizedConvertedTokens, PerfMonitor, type ResolvedTokens, type SugarcubeConfig, type TokenPipelineSource, type TokenTree, clearMatchCache, configFileExists, convertConfigToUnoRules, fillDefaults, generateCSSVariables, loadAndResolveTokens, loadInternalConfig, loadSugarcubeConfig, processAndConvertTokens, userConfigSchema, validateConfig, writeCSSUtilitiesToDisk, writeCSSVariablesToDisk };