@sugarcube-org/core 0.0.1-alpha.15 → 0.0.1-alpha.17
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/README.md +1 -7
- package/dist/index.d.ts +220 -1124
- package/dist/index.js +18 -20
- package/package.json +2 -3
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,76 @@ 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
|
+
/**
|
|
137
|
+
* Checks if a sugarcube configuration file exists.
|
|
138
|
+
*
|
|
139
|
+
* @param basePath - Base path without extension (default: "sugarcube.config")
|
|
140
|
+
* @returns True if a .ts or .js config file exists
|
|
141
|
+
*/
|
|
142
|
+
declare function configFileExists(basePath?: string): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Loads and validates a sugarcube configuration file.
|
|
145
|
+
* Returns the user-facing config without internal defaults applied.
|
|
146
|
+
*
|
|
147
|
+
* @param configPath - Optional path to config file. If omitted, searches for sugarcube.config.ts/js
|
|
148
|
+
* @returns The validated config and its resolved path
|
|
149
|
+
* @throws Error if config file not found or invalid
|
|
150
|
+
*/
|
|
151
|
+
declare function loadSugarcubeConfig(configPath?: string): Promise<{
|
|
152
|
+
config: SugarcubeConfig;
|
|
153
|
+
configPath: string;
|
|
154
|
+
}>;
|
|
155
|
+
/**
|
|
156
|
+
* Loads, validates, and normalizes a sugarcube configuration file.
|
|
157
|
+
* Returns a complete internal config with all defaults applied.
|
|
158
|
+
*
|
|
159
|
+
* @param configPath - Optional path to config file. If omitted, searches for sugarcube.config.ts/js
|
|
160
|
+
* @returns The normalized config with defaults and its resolved path
|
|
161
|
+
* @throws Error if config file not found or invalid
|
|
162
|
+
*/
|
|
163
|
+
declare function loadInternalConfig(configPath?: string): Promise<LoadedConfig>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Validates a user configuration object against the schema and fills in defaults.
|
|
167
|
+
*
|
|
168
|
+
* @param config - The user configuration object to validate
|
|
169
|
+
* @returns The validated configuration with defaults filled in
|
|
170
|
+
* @throws Error if the configuration is invalid
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* const config = { resolver: "./tokens.resolver.json" };
|
|
174
|
+
* const validatedConfig = validateConfig(config);
|
|
175
|
+
*/
|
|
176
|
+
declare function validateConfig(config: Partial<SugarcubeConfig>): InternalConfig;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Fills in default values for any omitted fields in a user configuration.
|
|
180
|
+
*
|
|
181
|
+
* This function takes a user config (with optional fields) and
|
|
182
|
+
* returns a complete internal config (with all required fields filled in).
|
|
183
|
+
*
|
|
184
|
+
* @param userConfig - The user configuration with optional fields
|
|
185
|
+
* @returns A complete configuration with all defaults filled in
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* const userConfig = {
|
|
189
|
+
* resolver: "./tokens.resolver.json"
|
|
190
|
+
* };
|
|
191
|
+
* const completeConfig = fillDefaults(userConfig);
|
|
192
|
+
* // completeConfig.output.css === "src/styles"
|
|
193
|
+
*/
|
|
194
|
+
declare function fillDefaults(userConfig: SugarcubeConfig): InternalConfig;
|
|
195
|
+
|
|
109
196
|
type BaseError = {
|
|
110
197
|
message: string;
|
|
111
198
|
};
|
|
@@ -231,6 +318,35 @@ type TokenTree = {
|
|
|
231
318
|
sourcePath: string;
|
|
232
319
|
};
|
|
233
320
|
|
|
321
|
+
type FlattenError = BaseError & {
|
|
322
|
+
path: string;
|
|
323
|
+
source: TokenSource;
|
|
324
|
+
};
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* A generated CSS file with its output path and content.
|
|
328
|
+
*/
|
|
329
|
+
type CSSFile = {
|
|
330
|
+
/** The file path where the CSS will be written. */
|
|
331
|
+
path: string;
|
|
332
|
+
/** The generated CSS content. */
|
|
333
|
+
css: string;
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* Array of generated CSS files from the pipeline.
|
|
337
|
+
* Each file contains a path and the CSS content to write.
|
|
338
|
+
*/
|
|
339
|
+
type CSSFileOutput = CSSFile[];
|
|
340
|
+
|
|
341
|
+
/** In-memory token data keyed by file path. */
|
|
342
|
+
type TokenMemoryData = Record<string, {
|
|
343
|
+
context?: string;
|
|
344
|
+
content: string;
|
|
345
|
+
}>;
|
|
346
|
+
type LoadError = BaseError & {
|
|
347
|
+
file: string;
|
|
348
|
+
};
|
|
349
|
+
|
|
234
350
|
/**
|
|
235
351
|
* A token with all references resolved to their final values.
|
|
236
352
|
* Contains both the original value (which may include references)
|
|
@@ -264,78 +380,6 @@ type ResolutionError = BaseError & {
|
|
|
264
380
|
source: TokenSource;
|
|
265
381
|
};
|
|
266
382
|
|
|
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
383
|
type ValidationError = BaseError & {
|
|
340
384
|
path: string;
|
|
341
385
|
source: TokenSource;
|
|
@@ -345,7 +389,7 @@ type ValidationError = BaseError & {
|
|
|
345
389
|
* Metadata about a modifier (e.g., theme, density) for CSS generation.
|
|
346
390
|
* Used to build attribute selectors like [data-theme="dark"].
|
|
347
391
|
*/
|
|
348
|
-
type ModifierMeta
|
|
392
|
+
type ModifierMeta = {
|
|
349
393
|
/** The modifier name (e.g., "theme", "density"). */
|
|
350
394
|
name: string;
|
|
351
395
|
/** The HTML attribute name (e.g., "data-theme", "data-density"). */
|
|
@@ -365,7 +409,7 @@ type PipelineResult = {
|
|
|
365
409
|
/** The loaded and processed token trees. */
|
|
366
410
|
trees: TokenTree[];
|
|
367
411
|
/** Modifier metadata for CSS selector generation. */
|
|
368
|
-
modifiers?: ModifierMeta
|
|
412
|
+
modifiers?: ModifierMeta[];
|
|
369
413
|
/** Any errors that occurred during pipeline execution. */
|
|
370
414
|
errors: PipelineErrors;
|
|
371
415
|
};
|
|
@@ -415,16 +459,6 @@ type TokenPipelineSource = {
|
|
|
415
459
|
config: InternalConfig;
|
|
416
460
|
};
|
|
417
461
|
|
|
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
462
|
/**
|
|
429
463
|
* Result of loading and resolving tokens.
|
|
430
464
|
*/
|
|
@@ -434,7 +468,7 @@ type LoadAndResolveResult = {
|
|
|
434
468
|
/** Resolved tokens after reference resolution */
|
|
435
469
|
resolved: ResolvedTokens;
|
|
436
470
|
/** Modifier metadata for CSS selector generation */
|
|
437
|
-
modifiers: ModifierMeta
|
|
471
|
+
modifiers: ModifierMeta[];
|
|
438
472
|
/** Any errors that occurred */
|
|
439
473
|
errors: PipelineResult["errors"];
|
|
440
474
|
};
|
|
@@ -464,41 +498,48 @@ type LoadAndResolveResult = {
|
|
|
464
498
|
*/
|
|
465
499
|
declare function loadAndResolveTokens(source: TokenPipelineSource): Promise<LoadAndResolveResult>;
|
|
466
500
|
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
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;
|
|
501
|
+
type ConvertedToken<T extends TokenType = TokenType> = ResolvedToken<T> & {
|
|
502
|
+
$cssProperties: CSSProperties<T>;
|
|
503
|
+
};
|
|
504
|
+
type ConvertedTokens = {
|
|
505
|
+
[lookupKey: string]: ConvertedToken | NodeMetadata;
|
|
482
506
|
};
|
|
483
|
-
|
|
484
507
|
/**
|
|
485
|
-
*
|
|
486
|
-
*
|
|
508
|
+
* Tokens that have been converted to CSS properties, organized by context.
|
|
509
|
+
* Each context (e.g., "default", "dark") maps to its converted tokens.
|
|
487
510
|
*/
|
|
488
|
-
type
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
511
|
+
type NormalizedConvertedTokens = {
|
|
512
|
+
[context: string]: ConvertedTokens;
|
|
513
|
+
};
|
|
514
|
+
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;
|
|
515
|
+
type SimpleCSSProperties = {
|
|
516
|
+
value: string | number;
|
|
517
|
+
/** Feature queries for progressive enhancement (e.g., P3 colors). */
|
|
518
|
+
featureValues?: Array<{
|
|
519
|
+
query: string;
|
|
520
|
+
value: string;
|
|
521
|
+
}>;
|
|
522
|
+
};
|
|
523
|
+
type AlwaysDecomposedProperties = CSSTypographyProperties;
|
|
524
|
+
type CSSTypographyProperties = {
|
|
525
|
+
"font-family": string;
|
|
526
|
+
"font-size": string;
|
|
527
|
+
"font-weight"?: number | string;
|
|
528
|
+
"letter-spacing"?: string;
|
|
529
|
+
"line-height"?: number | string;
|
|
530
|
+
};
|
|
531
|
+
type CSSBorderProperties = {
|
|
532
|
+
value: string;
|
|
533
|
+
};
|
|
534
|
+
type CSSShadowProperties = {
|
|
535
|
+
value: string;
|
|
536
|
+
};
|
|
537
|
+
type CSSGradientProperties = {
|
|
538
|
+
value: string;
|
|
539
|
+
};
|
|
540
|
+
type CSSTransitionProperties = {
|
|
541
|
+
value: string;
|
|
493
542
|
};
|
|
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
543
|
|
|
503
544
|
/**
|
|
504
545
|
* Processes and converts token trees into CSS-ready format.
|
|
@@ -521,38 +562,62 @@ declare function loadInternalConfig(configPath?: string): Promise<LoadedConfig>;
|
|
|
521
562
|
declare function processAndConvertTokens(trees: TokenTree[], resolved: ResolvedTokens, config: InternalConfig, validationErrors?: ValidationError[]): Promise<NormalizedConvertedTokens>;
|
|
522
563
|
|
|
523
564
|
/**
|
|
524
|
-
*
|
|
525
|
-
*
|
|
565
|
+
* Generate CSS variable files from converted tokens.
|
|
566
|
+
*
|
|
567
|
+
* @param convertedTokens - The normalized and converted tokens
|
|
568
|
+
* @param config - The configuration object
|
|
569
|
+
* @param modifiers - Optional modifier metadata for generating per-modifier attribute selectors
|
|
570
|
+
* @returns Array of CSS file outputs
|
|
526
571
|
*/
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
defaultContext: string;
|
|
534
|
-
/** Available non-default context names */
|
|
535
|
-
contexts: string[];
|
|
536
|
-
};
|
|
537
|
-
/**
|
|
538
|
-
* Result of loading tokens from a resolver document.
|
|
572
|
+
declare function generateCSSVariables(convertedTokens: NormalizedConvertedTokens, config: InternalConfig, modifiers?: ModifierMeta[]): Promise<CSSFileOutput>;
|
|
573
|
+
|
|
574
|
+
type CSSObject = Record<string, string | number | undefined>;
|
|
575
|
+
/**
|
|
576
|
+
* Clears the token matching cache.
|
|
577
|
+
* Call this when tokens change (e.g., on hot reload in dev mode).
|
|
539
578
|
*/
|
|
540
|
-
|
|
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
|
-
};
|
|
579
|
+
declare function clearMatchCache(): void;
|
|
548
580
|
/**
|
|
549
|
-
*
|
|
581
|
+
* Converts a utilities configuration into UnoCSS dynamic rules.
|
|
550
582
|
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
583
|
+
* @param utilitiesConfig - The utilities configuration from sugarcube.config
|
|
584
|
+
* @param tokens - The converted tokens to generate rules for
|
|
585
|
+
* @returns Array of UnoCSS dynamic rules [pattern, handler]
|
|
586
|
+
*/
|
|
587
|
+
declare function convertConfigToUnoRules(utilitiesConfig: UtilitiesConfig, tokens: NormalizedConvertedTokens): Array<[RegExp, (m: RegExpMatchArray) => CSSObject]>;
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Performance monitor for tracking memory usage and watcher events.
|
|
591
|
+
* Only active when SUGARCUBE_PERF=true environment variable is set.
|
|
592
|
+
*/
|
|
593
|
+
declare class PerfMonitor implements Disposable {
|
|
594
|
+
#private;
|
|
595
|
+
private defaultFlush;
|
|
596
|
+
constructor(defaultFlush?: (message: string) => undefined);
|
|
597
|
+
log(message: string, data?: Record<string, unknown>): void;
|
|
598
|
+
trackWatcherEvent(file: string, moduleGraphSize: number): void;
|
|
599
|
+
logWatcherSetup(pattern: string, dir: string): void;
|
|
600
|
+
logModuleGraphStats(modules: number, urls: number, context: string): void;
|
|
601
|
+
startMemoryMonitor(): void;
|
|
602
|
+
stopMemoryMonitor(): void;
|
|
603
|
+
[Symbol.dispose](): void;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**
|
|
607
|
+
* Instrumentation for tracking function call counts and execution times.
|
|
608
|
+
* Only active when DEBUG=true environment variable is set.
|
|
609
|
+
* Inspired by Tailwind CSS instrumentation.
|
|
554
610
|
*/
|
|
555
|
-
declare
|
|
611
|
+
declare class Instrumentation implements Disposable {
|
|
612
|
+
#private;
|
|
613
|
+
private defaultFlush;
|
|
614
|
+
constructor(defaultFlush?: (message: string) => undefined);
|
|
615
|
+
hit(label: string): void;
|
|
616
|
+
start(label: string): void;
|
|
617
|
+
end(label: string): void;
|
|
618
|
+
report(flush?: (message: string) => undefined): void;
|
|
619
|
+
[Symbol.dispose](): void;
|
|
620
|
+
}
|
|
556
621
|
|
|
557
622
|
/**
|
|
558
623
|
* Writes CSS files to disk, creating directories as needed.
|
|
@@ -594,227 +659,6 @@ declare function writeCSSVariablesToDisk(output: CSSFileOutput): Promise<CSSFile
|
|
|
594
659
|
*/
|
|
595
660
|
declare function writeCSSUtilitiesToDisk(output: CSSFileOutput): Promise<CSSFileOutput>;
|
|
596
661
|
|
|
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
662
|
declare const userConfigSchema: z.ZodObject<{
|
|
819
663
|
resolver: z.ZodOptional<z.ZodString>;
|
|
820
664
|
transforms: z.ZodOptional<z.ZodObject<{
|
|
@@ -890,24 +734,7 @@ declare const userConfigSchema: z.ZodObject<{
|
|
|
890
734
|
stripDuplicates?: boolean | undefined;
|
|
891
735
|
}>, "many">]>>>;
|
|
892
736
|
}, "strip", z.ZodTypeAny, {
|
|
893
|
-
utilities?: Record<string, {
|
|
894
|
-
source: string;
|
|
895
|
-
directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
|
|
896
|
-
prefix?: string | undefined;
|
|
897
|
-
stripDuplicates?: boolean | undefined;
|
|
898
|
-
} | {
|
|
899
|
-
source: string;
|
|
900
|
-
directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
|
|
901
|
-
prefix?: string | undefined;
|
|
902
|
-
stripDuplicates?: boolean | undefined;
|
|
903
|
-
}[]> | undefined;
|
|
904
737
|
resolver?: string | undefined;
|
|
905
|
-
output?: {
|
|
906
|
-
components?: string | undefined;
|
|
907
|
-
css?: string | undefined;
|
|
908
|
-
themeAttribute?: string | undefined;
|
|
909
|
-
defaultContext?: string | undefined;
|
|
910
|
-
} | undefined;
|
|
911
738
|
transforms?: {
|
|
912
739
|
fluid?: {
|
|
913
740
|
min: number;
|
|
@@ -915,7 +742,12 @@ declare const userConfigSchema: z.ZodObject<{
|
|
|
915
742
|
} | undefined;
|
|
916
743
|
colorFallbackStrategy?: "native" | "polyfill" | undefined;
|
|
917
744
|
} | undefined;
|
|
918
|
-
|
|
745
|
+
output?: {
|
|
746
|
+
components?: string | undefined;
|
|
747
|
+
css?: string | undefined;
|
|
748
|
+
themeAttribute?: string | undefined;
|
|
749
|
+
defaultContext?: string | undefined;
|
|
750
|
+
} | undefined;
|
|
919
751
|
utilities?: Record<string, {
|
|
920
752
|
source: string;
|
|
921
753
|
directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
|
|
@@ -927,13 +759,8 @@ declare const userConfigSchema: z.ZodObject<{
|
|
|
927
759
|
prefix?: string | undefined;
|
|
928
760
|
stripDuplicates?: boolean | undefined;
|
|
929
761
|
}[]> | undefined;
|
|
762
|
+
}, {
|
|
930
763
|
resolver?: string | undefined;
|
|
931
|
-
output?: {
|
|
932
|
-
components?: string | undefined;
|
|
933
|
-
css?: string | undefined;
|
|
934
|
-
themeAttribute?: string | undefined;
|
|
935
|
-
defaultContext?: string | undefined;
|
|
936
|
-
} | undefined;
|
|
937
764
|
transforms?: {
|
|
938
765
|
fluid?: {
|
|
939
766
|
min: number;
|
|
@@ -941,121 +768,12 @@ declare const userConfigSchema: z.ZodObject<{
|
|
|
941
768
|
} | undefined;
|
|
942
769
|
colorFallbackStrategy?: "native" | "polyfill" | undefined;
|
|
943
770
|
} | undefined;
|
|
944
|
-
|
|
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
|
-
utilities?: Record<string, {
|
|
1034
|
-
source: string;
|
|
1035
|
-
directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
|
|
1036
|
-
prefix?: string | undefined;
|
|
1037
|
-
stripDuplicates?: boolean | undefined;
|
|
1038
|
-
} | {
|
|
1039
|
-
source: string;
|
|
1040
|
-
directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
|
|
1041
|
-
prefix?: string | undefined;
|
|
1042
|
-
stripDuplicates?: boolean | undefined;
|
|
1043
|
-
}[]> | undefined;
|
|
1044
|
-
resolver?: string | undefined;
|
|
1045
|
-
}, {
|
|
1046
|
-
output: {
|
|
1047
|
-
css: string;
|
|
1048
|
-
themeAttribute: string;
|
|
771
|
+
output?: {
|
|
1049
772
|
components?: string | undefined;
|
|
773
|
+
css?: string | undefined;
|
|
774
|
+
themeAttribute?: string | undefined;
|
|
1050
775
|
defaultContext?: string | undefined;
|
|
1051
|
-
};
|
|
1052
|
-
transforms: {
|
|
1053
|
-
fluid: {
|
|
1054
|
-
min: number;
|
|
1055
|
-
max: number;
|
|
1056
|
-
};
|
|
1057
|
-
colorFallbackStrategy: "native" | "polyfill";
|
|
1058
|
-
};
|
|
776
|
+
} | undefined;
|
|
1059
777
|
utilities?: Record<string, {
|
|
1060
778
|
source: string;
|
|
1061
779
|
directions?: "top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all" | ("top" | "right" | "bottom" | "left" | "x" | "y" | "full" | "all")[] | undefined;
|
|
@@ -1067,628 +785,6 @@ declare const internalConfigSchema: z.ZodObject<{
|
|
|
1067
785
|
prefix?: string | undefined;
|
|
1068
786
|
stripDuplicates?: boolean | undefined;
|
|
1069
787
|
}[]> | undefined;
|
|
1070
|
-
resolver?: string | undefined;
|
|
1071
788
|
}>;
|
|
1072
789
|
|
|
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
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1123
|
-
description?: string | undefined;
|
|
1124
|
-
}, {
|
|
1125
|
-
sources: (z.objectInputType<{
|
|
1126
|
-
$ref: z.ZodString;
|
|
1127
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
|
|
1128
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1129
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1161
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1162
|
-
description?: string | undefined;
|
|
1163
|
-
}, {
|
|
1164
|
-
contexts: Record<string, (z.objectInputType<{
|
|
1165
|
-
$ref: z.ZodString;
|
|
1166
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1167
|
-
default?: string | undefined;
|
|
1168
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1169
|
-
description?: string | undefined;
|
|
1170
|
-
}>, {
|
|
1171
|
-
contexts: Record<string, (z.objectOutputType<{
|
|
1172
|
-
$ref: z.ZodString;
|
|
1173
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1174
|
-
default?: string | undefined;
|
|
1175
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1176
|
-
description?: string | undefined;
|
|
1177
|
-
}, {
|
|
1178
|
-
contexts: Record<string, (z.objectInputType<{
|
|
1179
|
-
$ref: z.ZodString;
|
|
1180
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1181
|
-
default?: string | undefined;
|
|
1182
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1183
|
-
description?: string | 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
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1207
|
-
description?: string | undefined;
|
|
1208
|
-
}, {
|
|
1209
|
-
name: string;
|
|
1210
|
-
type: "set";
|
|
1211
|
-
sources: (z.objectInputType<{
|
|
1212
|
-
$ref: z.ZodString;
|
|
1213
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
|
|
1214
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1215
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1240
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1241
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1249
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1250
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1258
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1259
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1267
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1268
|
-
description?: string | 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
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1299
|
-
description?: string | undefined;
|
|
1300
|
-
}, {
|
|
1301
|
-
name: string;
|
|
1302
|
-
type: "set";
|
|
1303
|
-
sources: (z.objectInputType<{
|
|
1304
|
-
$ref: z.ZodString;
|
|
1305
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
|
|
1306
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1307
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1328
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1329
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1337
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1338
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1346
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1347
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1355
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1356
|
-
description?: string | 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
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1376
|
-
description?: string | undefined;
|
|
1377
|
-
}, {
|
|
1378
|
-
sources: (z.objectInputType<{
|
|
1379
|
-
$ref: z.ZodString;
|
|
1380
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
|
|
1381
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1382
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1403
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1404
|
-
description?: string | undefined;
|
|
1405
|
-
}, {
|
|
1406
|
-
contexts: Record<string, (z.objectInputType<{
|
|
1407
|
-
$ref: z.ZodString;
|
|
1408
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1409
|
-
default?: string | undefined;
|
|
1410
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1411
|
-
description?: string | undefined;
|
|
1412
|
-
}>, {
|
|
1413
|
-
contexts: Record<string, (z.objectOutputType<{
|
|
1414
|
-
$ref: z.ZodString;
|
|
1415
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1416
|
-
default?: string | undefined;
|
|
1417
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1418
|
-
description?: string | undefined;
|
|
1419
|
-
}, {
|
|
1420
|
-
contexts: Record<string, (z.objectInputType<{
|
|
1421
|
-
$ref: z.ZodString;
|
|
1422
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1423
|
-
default?: string | undefined;
|
|
1424
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1425
|
-
description?: string | 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
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1446
|
-
description?: string | undefined;
|
|
1447
|
-
}, {
|
|
1448
|
-
sources: (z.objectInputType<{
|
|
1449
|
-
$ref: z.ZodString;
|
|
1450
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
|
|
1451
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1452
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1470
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1471
|
-
description?: string | undefined;
|
|
1472
|
-
}, {
|
|
1473
|
-
contexts: Record<string, (z.objectInputType<{
|
|
1474
|
-
$ref: z.ZodString;
|
|
1475
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1476
|
-
default?: string | undefined;
|
|
1477
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1478
|
-
description?: string | undefined;
|
|
1479
|
-
}>, {
|
|
1480
|
-
contexts: Record<string, (z.objectOutputType<{
|
|
1481
|
-
$ref: z.ZodString;
|
|
1482
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1483
|
-
default?: string | undefined;
|
|
1484
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1485
|
-
description?: string | undefined;
|
|
1486
|
-
}, {
|
|
1487
|
-
contexts: Record<string, (z.objectInputType<{
|
|
1488
|
-
$ref: z.ZodString;
|
|
1489
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1490
|
-
default?: string | undefined;
|
|
1491
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1492
|
-
description?: string | 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
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1519
|
-
description?: string | undefined;
|
|
1520
|
-
}, {
|
|
1521
|
-
name: string;
|
|
1522
|
-
type: "set";
|
|
1523
|
-
sources: (z.objectInputType<{
|
|
1524
|
-
$ref: z.ZodString;
|
|
1525
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
|
|
1526
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1527
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1548
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1549
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1557
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1558
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1566
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1567
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1575
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1576
|
-
description?: string | 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
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1592
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1600
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1601
|
-
description?: string | undefined;
|
|
1602
|
-
})[];
|
|
1603
|
-
name?: string | undefined;
|
|
1604
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1605
|
-
description?: string | undefined;
|
|
1606
|
-
sets?: Record<string, {
|
|
1607
|
-
sources: (z.objectOutputType<{
|
|
1608
|
-
$ref: z.ZodString;
|
|
1609
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
|
|
1610
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1611
|
-
description?: string | undefined;
|
|
1612
|
-
}> | undefined;
|
|
1613
|
-
modifiers?: Record<string, {
|
|
1614
|
-
contexts: Record<string, (z.objectOutputType<{
|
|
1615
|
-
$ref: z.ZodString;
|
|
1616
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1617
|
-
default?: string | undefined;
|
|
1618
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1619
|
-
description?: string | undefined;
|
|
1620
|
-
}> | undefined;
|
|
1621
|
-
$schema?: string | 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
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1634
|
-
description?: string | 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
|
-
default?: string | undefined;
|
|
1642
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1643
|
-
description?: string | undefined;
|
|
1644
|
-
})[];
|
|
1645
|
-
name?: string | undefined;
|
|
1646
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1647
|
-
description?: string | undefined;
|
|
1648
|
-
sets?: Record<string, {
|
|
1649
|
-
sources: (z.objectInputType<{
|
|
1650
|
-
$ref: z.ZodString;
|
|
1651
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[];
|
|
1652
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1653
|
-
description?: string | undefined;
|
|
1654
|
-
}> | undefined;
|
|
1655
|
-
modifiers?: Record<string, {
|
|
1656
|
-
contexts: Record<string, (z.objectInputType<{
|
|
1657
|
-
$ref: z.ZodString;
|
|
1658
|
-
}, z.ZodTypeAny, "passthrough"> | Record<string, unknown>)[]>;
|
|
1659
|
-
default?: string | undefined;
|
|
1660
|
-
$extensions?: Record<string, unknown> | undefined;
|
|
1661
|
-
description?: string | undefined;
|
|
1662
|
-
}> | undefined;
|
|
1663
|
-
$schema?: string | 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
|
-
|
|
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 };
|
|
790
|
+
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 };
|