@stillwind/config 0.0.0-stage → 0.1.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1210 @@
1
+ import "valibot";
2
+ import { PreparedSource, ProjectInput } from "@stillwind/projection";
3
+ import { NativeIdentifierNaming } from "@stillwind/native";
4
+ import { Config } from "tailwindcss";
5
+ /**
6
+ * Maps public rule IDs to categories, native option names, and default detection settings.
7
+ * Each entry's category names the kind of problem the rule reports, and its nativeName
8
+ * identifies its field in the compiler binding. Null options indicate
9
+ * a severity-only rule. Other entries list accepted fields in options and initial values in defaults.
10
+ * Treat these shared catalog entries as readonly.
11
+ */
12
+ declare const lintRules: {
13
+ readonly "invalid-rule-group-input": {
14
+ readonly category: "input";
15
+ readonly nativeName: "invalidRuleGroupInput";
16
+ readonly defaults: null;
17
+ readonly options: null;
18
+ };
19
+ readonly "invalid-style-input": {
20
+ readonly category: "input";
21
+ readonly nativeName: "invalidStyleInput";
22
+ readonly defaults: null;
23
+ readonly options: null;
24
+ };
25
+ readonly "invalid-cva-config": {
26
+ readonly category: "input";
27
+ readonly nativeName: "invalidCvaConfig";
28
+ readonly defaults: null;
29
+ readonly options: null;
30
+ };
31
+ readonly "invalid-cva-input": {
32
+ readonly category: "input";
33
+ readonly nativeName: "invalidCvaInput";
34
+ readonly defaults: null;
35
+ readonly options: null;
36
+ };
37
+ readonly "invalid-keyframes-use": {
38
+ readonly category: "input";
39
+ readonly nativeName: "invalidKeyframesUse";
40
+ readonly defaults: null;
41
+ readonly options: null;
42
+ };
43
+ readonly "invalid-keyframes-definition": {
44
+ readonly category: "input";
45
+ readonly nativeName: "invalidKeyframesDefinition";
46
+ readonly defaults: null;
47
+ readonly options: null;
48
+ };
49
+ readonly "invalid-keyframes-variant": {
50
+ readonly category: "input";
51
+ readonly nativeName: "invalidKeyframesVariant";
52
+ readonly defaults: null;
53
+ readonly options: null;
54
+ };
55
+ readonly "invalid-view-transition-use": {
56
+ readonly category: "input";
57
+ readonly nativeName: "invalidViewTransitionUse";
58
+ readonly defaults: null;
59
+ readonly options: null;
60
+ };
61
+ readonly "invalid-view-transition-definition": {
62
+ readonly category: "input";
63
+ readonly nativeName: "invalidViewTransitionDefinition";
64
+ readonly defaults: null;
65
+ readonly options: null;
66
+ };
67
+ readonly "invalid-view-transition-variant": {
68
+ readonly category: "input";
69
+ readonly nativeName: "invalidViewTransitionVariant";
70
+ readonly defaults: null;
71
+ readonly options: null;
72
+ };
73
+ readonly "invalid-media-query": {
74
+ readonly category: "input";
75
+ readonly nativeName: "invalidMediaQuery";
76
+ readonly defaults: null;
77
+ readonly options: null;
78
+ };
79
+ readonly "invalid-css-input": {
80
+ readonly category: "input";
81
+ readonly nativeName: "invalidCssInput";
82
+ readonly defaults: null;
83
+ readonly options: null;
84
+ };
85
+ readonly "invalid-ref-input": {
86
+ readonly category: "input";
87
+ readonly nativeName: "invalidRefInput";
88
+ readonly defaults: null;
89
+ readonly options: null;
90
+ };
91
+ readonly "invalid-animation-option": {
92
+ readonly category: "input";
93
+ readonly nativeName: "invalidAnimationOption";
94
+ readonly defaults: null;
95
+ readonly options: null;
96
+ };
97
+ readonly "invalid-style-composition": {
98
+ readonly category: "input";
99
+ readonly nativeName: "invalidStyleComposition";
100
+ readonly defaults: null;
101
+ readonly options: null;
102
+ };
103
+ readonly "runtime-condition-requires-css-if": {
104
+ readonly category: "input";
105
+ readonly nativeName: "runtimeConditionRequiresCssIf";
106
+ readonly defaults: null;
107
+ readonly options: null;
108
+ };
109
+ readonly "invalid-utility": {
110
+ readonly category: "input";
111
+ readonly nativeName: "invalidUtility";
112
+ readonly defaults: null;
113
+ readonly options: null;
114
+ };
115
+ readonly "unknown-utility": {
116
+ readonly category: "input";
117
+ readonly nativeName: "unknownUtility";
118
+ readonly defaults: null;
119
+ readonly options: null;
120
+ };
121
+ readonly "invalid-marker-use": {
122
+ readonly category: "input";
123
+ readonly nativeName: "invalidMarkerUse";
124
+ readonly defaults: {
125
+ readonly severity: "warn";
126
+ readonly ignoredClasses: readonly [];
127
+ };
128
+ readonly options: readonly ["severity", "ignoredClasses"];
129
+ };
130
+ readonly "invalid-variant": {
131
+ readonly category: "input";
132
+ readonly nativeName: "invalidVariant";
133
+ readonly defaults: null;
134
+ readonly options: null;
135
+ };
136
+ readonly "unknown-variant": {
137
+ readonly category: "input";
138
+ readonly nativeName: "unknownVariant";
139
+ readonly defaults: null;
140
+ readonly options: null;
141
+ };
142
+ readonly "missing-document-target": {
143
+ readonly category: "input";
144
+ readonly nativeName: "missingDocumentTarget";
145
+ readonly defaults: null;
146
+ readonly options: null;
147
+ };
148
+ readonly "invalid-theme-reference": {
149
+ readonly category: "input";
150
+ readonly nativeName: "invalidThemeReference";
151
+ readonly defaults: null;
152
+ readonly options: null;
153
+ };
154
+ readonly "invalid-css-import": {
155
+ readonly category: "input";
156
+ readonly nativeName: "invalidCssImport";
157
+ readonly defaults: null;
158
+ readonly options: null;
159
+ };
160
+ readonly "invalid-css-directive": {
161
+ readonly category: "input";
162
+ readonly nativeName: "invalidCssDirective";
163
+ readonly defaults: null;
164
+ readonly options: null;
165
+ };
166
+ readonly "invalid-runtime-condition": {
167
+ readonly category: "input";
168
+ readonly nativeName: "invalidRuntimeCondition";
169
+ readonly defaults: null;
170
+ readonly options: null;
171
+ };
172
+ readonly "mutating-macro-argument": {
173
+ readonly category: "contract";
174
+ readonly nativeName: "mutatingMacroArgument";
175
+ readonly defaults: null;
176
+ readonly options: null;
177
+ };
178
+ readonly "suspending-macro-argument": {
179
+ readonly category: "contract";
180
+ readonly nativeName: "suspendingMacroArgument";
181
+ readonly defaults: null;
182
+ readonly options: null;
183
+ };
184
+ readonly "mismatched-framework-import": {
185
+ readonly category: "contract";
186
+ readonly nativeName: "mismatchedFrameworkImport";
187
+ readonly defaults: null;
188
+ readonly options: null;
189
+ };
190
+ readonly "duplicate-utility": {
191
+ readonly category: "hazard";
192
+ readonly nativeName: "duplicateUtility";
193
+ readonly defaults: null;
194
+ readonly options: null;
195
+ };
196
+ readonly "conflicting-utilities": {
197
+ readonly category: "hazard";
198
+ readonly nativeName: "conflictingUtilities";
199
+ readonly defaults: {
200
+ readonly severity: "warn";
201
+ readonly allowShorthandOverrides: false;
202
+ };
203
+ readonly options: readonly ["severity", "allowShorthandOverrides"];
204
+ };
205
+ readonly "conflicting-provider-properties": {
206
+ readonly category: "hazard";
207
+ readonly nativeName: "conflictingProviderProperties";
208
+ readonly defaults: null;
209
+ readonly options: null;
210
+ };
211
+ readonly "unverified-style-base": {
212
+ readonly category: "hazard";
213
+ readonly nativeName: "unverifiedStyleBase";
214
+ readonly defaults: null;
215
+ readonly options: null;
216
+ };
217
+ readonly "ambiguous-style-base-order": {
218
+ readonly category: "hazard";
219
+ readonly nativeName: "ambiguousStyleBaseOrder";
220
+ readonly defaults: null;
221
+ readonly options: null;
222
+ };
223
+ readonly "interfering-imported-style-base": {
224
+ readonly category: "hazard";
225
+ readonly nativeName: "interferingImportedStyleBase";
226
+ readonly defaults: null;
227
+ readonly options: null;
228
+ };
229
+ readonly "missing-ref-attachment": {
230
+ readonly category: "hazard";
231
+ readonly nativeName: "missingRefAttachment";
232
+ readonly defaults: null;
233
+ readonly options: null;
234
+ };
235
+ readonly "document-scoped-selector": {
236
+ readonly category: "hazard";
237
+ readonly nativeName: "documentScopedSelector";
238
+ readonly defaults: null;
239
+ readonly options: null;
240
+ };
241
+ readonly "repeated-nesting-selector": {
242
+ readonly category: "hazard";
243
+ readonly nativeName: "repeatedNestingSelector";
244
+ readonly defaults: null;
245
+ readonly options: null;
246
+ };
247
+ readonly "missing-view-transition-name": {
248
+ readonly category: "hazard";
249
+ readonly nativeName: "missingViewTransitionName";
250
+ readonly defaults: null;
251
+ readonly options: null;
252
+ };
253
+ readonly "duplicate-view-transition-name": {
254
+ readonly category: "hazard";
255
+ readonly nativeName: "duplicateViewTransitionName";
256
+ readonly defaults: null;
257
+ readonly options: null;
258
+ };
259
+ readonly "split-view-transition-class": {
260
+ readonly category: "hazard";
261
+ readonly nativeName: "splitViewTransitionClass";
262
+ readonly defaults: null;
263
+ readonly options: null;
264
+ };
265
+ readonly "ineffective-anchor-scope": {
266
+ readonly category: "hazard";
267
+ readonly nativeName: "ineffectiveAnchorScope";
268
+ readonly defaults: null;
269
+ readonly options: null;
270
+ };
271
+ readonly "incompatible-property-value": {
272
+ readonly category: "hazard";
273
+ readonly nativeName: "incompatiblePropertyValue";
274
+ readonly defaults: null;
275
+ readonly options: null;
276
+ };
277
+ readonly "unsatisfiable-variants": {
278
+ readonly category: "hazard";
279
+ readonly nativeName: "unsatisfiableVariants";
280
+ readonly defaults: null;
281
+ readonly options: null;
282
+ };
283
+ readonly "clamped-value": {
284
+ readonly category: "hazard";
285
+ readonly nativeName: "clampedValue";
286
+ readonly defaults: null;
287
+ readonly options: null;
288
+ };
289
+ readonly "duplicate-definition": {
290
+ readonly category: "hazard";
291
+ readonly nativeName: "duplicateDefinition";
292
+ readonly defaults: null;
293
+ readonly options: null;
294
+ };
295
+ readonly "bypassed-undefinition": {
296
+ readonly category: "hazard";
297
+ readonly nativeName: "bypassedUndefinition";
298
+ readonly defaults: null;
299
+ readonly options: null;
300
+ };
301
+ readonly "ignored-definition-condition": {
302
+ readonly category: "hazard";
303
+ readonly nativeName: "ignoredDefinitionCondition";
304
+ readonly defaults: null;
305
+ readonly options: null;
306
+ };
307
+ readonly "incompatible-theme-value": {
308
+ readonly category: "hazard";
309
+ readonly nativeName: "incompatibleThemeValue";
310
+ readonly defaults: null;
311
+ readonly options: null;
312
+ };
313
+ readonly "ignored-tailwind-feature": {
314
+ readonly category: "hazard";
315
+ readonly nativeName: "ignoredTailwindFeature";
316
+ readonly defaults: null;
317
+ readonly options: null;
318
+ };
319
+ readonly "no-arbitrary-colors": {
320
+ readonly category: "restriction";
321
+ readonly nativeName: "noArbitraryColors";
322
+ readonly defaults: null;
323
+ readonly options: null;
324
+ };
325
+ readonly "no-arbitrary-spacing": {
326
+ readonly category: "restriction";
327
+ readonly nativeName: "noArbitrarySpacing";
328
+ readonly defaults: {
329
+ readonly severity: "warn";
330
+ readonly properties: readonly [];
331
+ };
332
+ readonly options: readonly ["severity", "properties"];
333
+ };
334
+ readonly "no-class-property": {
335
+ readonly category: "restriction";
336
+ readonly nativeName: "noClassProperty";
337
+ readonly defaults: null;
338
+ readonly options: null;
339
+ };
340
+ readonly "no-restricted-utilities": {
341
+ readonly category: "restriction";
342
+ readonly nativeName: "noRestrictedUtilities";
343
+ readonly defaults: {
344
+ readonly severity: "warn";
345
+ readonly utilities: readonly [];
346
+ };
347
+ readonly options: readonly ["severity", "utilities"];
348
+ };
349
+ readonly "no-restricted-declarations": {
350
+ readonly category: "restriction";
351
+ readonly nativeName: "noRestrictedDeclarations";
352
+ readonly defaults: {
353
+ readonly severity: "warn";
354
+ readonly checkImplementation: true;
355
+ readonly rules: readonly [];
356
+ };
357
+ readonly options: readonly ["severity", "checkImplementation", "rules"];
358
+ };
359
+ readonly "no-important": {
360
+ readonly category: "restriction";
361
+ readonly nativeName: "noImportant";
362
+ readonly defaults: {
363
+ readonly severity: "warn";
364
+ readonly checkImplementation: true;
365
+ };
366
+ readonly options: readonly ["severity", "checkImplementation"];
367
+ };
368
+ readonly "no-restricted-length-units": {
369
+ readonly category: "restriction";
370
+ readonly nativeName: "noRestrictedLengthUnits";
371
+ readonly defaults: {
372
+ readonly severity: "warn";
373
+ readonly checkImplementation: false;
374
+ readonly rules: readonly [];
375
+ };
376
+ readonly options: readonly ["severity", "checkImplementation", "rules"];
377
+ };
378
+ readonly "no-restricted-theme-tokens": {
379
+ readonly category: "restriction";
380
+ readonly nativeName: "noRestrictedThemeTokens";
381
+ readonly defaults: {
382
+ readonly severity: "warn";
383
+ readonly checkImplementation: true;
384
+ readonly tokens: readonly [];
385
+ };
386
+ readonly options: readonly ["severity", "checkImplementation", "tokens"];
387
+ };
388
+ readonly "no-arbitrary-breakpoints": {
389
+ readonly category: "restriction";
390
+ readonly nativeName: "noArbitraryBreakpoints";
391
+ readonly defaults: null;
392
+ readonly options: null;
393
+ };
394
+ readonly "prefer-direct-styling": {
395
+ readonly category: "style";
396
+ readonly nativeName: "preferDirectStyling";
397
+ readonly defaults: null;
398
+ readonly options: null;
399
+ };
400
+ readonly "prefer-logical-properties": {
401
+ readonly category: "style";
402
+ readonly nativeName: "preferLogicalProperties";
403
+ readonly defaults: {
404
+ readonly severity: "warn";
405
+ readonly checkImplementation: false;
406
+ };
407
+ readonly options: readonly ["severity", "checkImplementation"];
408
+ };
409
+ readonly "prefer-typed-relationships": {
410
+ readonly category: "style";
411
+ readonly nativeName: "preferTypedRelationships";
412
+ readonly defaults: null;
413
+ readonly options: null;
414
+ };
415
+ readonly "prefer-canonical-utilities": {
416
+ readonly category: "style";
417
+ readonly nativeName: "preferCanonicalUtilities";
418
+ readonly defaults: {
419
+ readonly severity: "warn";
420
+ readonly pxToRem: true;
421
+ readonly collapse: true;
422
+ readonly logicalToPhysical: false;
423
+ readonly preserveSpecificity: true;
424
+ };
425
+ readonly options: readonly ["severity", "pxToRem", "collapse", "logicalToPhysical", "preserveSpecificity"];
426
+ };
427
+ readonly "prefer-sorted-utilities": {
428
+ readonly category: "style";
429
+ readonly nativeName: "preferSortedUtilities";
430
+ readonly defaults: null;
431
+ readonly options: null;
432
+ };
433
+ readonly "redundant-variant": {
434
+ readonly category: "style";
435
+ readonly nativeName: "redundantVariant";
436
+ readonly defaults: null;
437
+ readonly options: null;
438
+ };
439
+ readonly "prefer-typed-variables": {
440
+ readonly category: "style";
441
+ readonly nativeName: "preferTypedVariables";
442
+ readonly defaults: null;
443
+ readonly options: null;
444
+ };
445
+ readonly "prefer-explicit-nesting-selector": {
446
+ readonly category: "style";
447
+ readonly nativeName: "preferExplicitNestingSelector";
448
+ readonly defaults: null;
449
+ readonly options: null;
450
+ };
451
+ readonly "prefer-variant-directive": {
452
+ readonly category: "style";
453
+ readonly nativeName: "preferVariantDirective";
454
+ readonly defaults: {
455
+ readonly severity: "warn";
456
+ readonly pxToRem: false;
457
+ };
458
+ readonly options: readonly ["severity", "pxToRem"];
459
+ };
460
+ readonly "invalid-lint-suppression": {
461
+ readonly category: "suppression";
462
+ readonly nativeName: "invalidLintSuppression";
463
+ readonly defaults: null;
464
+ readonly options: null;
465
+ };
466
+ readonly "unused-lint-suppression": {
467
+ readonly category: "suppression";
468
+ readonly nativeName: "unusedLintSuppression";
469
+ readonly defaults: null;
470
+ readonly options: null;
471
+ };
472
+ };
473
+ /** Public kebab-case rule IDs used as keys in lint configuration. */
474
+ type LintRule = keyof typeof lintRules;
475
+ /** Kind of problem a rule reports, as declared by the Rust lint catalog. */
476
+ type LintCategory = (typeof lintRules)[LintRule]["category"];
477
+ /** Rules that accept only a severity string because their catalog entries have no option fields. */
478
+ type SimpleLintRule = { [K in LintRule]: (typeof lintRules)[K]["options"] extends null ? K : never; }[LintRule];
479
+ /**
480
+ * Reporting policy for a lint rule. Off disables its diagnostics and automatic fixes.
481
+ */
482
+ type LintSeverity = "warn" | "deny" | "off";
483
+ /**
484
+ * Detection and reporting policies for source utilities and compiler ordering.
485
+ */
486
+ type LintRules = Partial<Record<SimpleLintRule, LintSeverity>> & {
487
+ /** Severity or additional CSS property domains checked for arbitrary spacing. */
488
+ "no-arbitrary-spacing"?: LintSeverity | ArbitrarySpacingOptions;
489
+ /** Severity or patterns restricting authored utility spellings. */
490
+ "no-restricted-utilities"?: LintSeverity | RestrictedUtilitiesOptions;
491
+ /** Severity or restrictions on resolved CSS properties and values. */
492
+ "no-restricted-declarations"?: LintSeverity | RestrictedDeclarationsOptions;
493
+ /** Severity or checks of fixed implementation declarations for importance. */
494
+ "no-important"?: LintSeverity | ImportantOptions;
495
+ /** Severity or exceptions for a narrower property overriding a shorthand. */
496
+ "conflicting-utilities"?: LintSeverity | ConflictingUtilitiesOptions;
497
+ /** Severity or marker class names whose misuse is not reported. */
498
+ "invalid-marker-use"?: LintSeverity | MarkerUseOptions;
499
+ /** Severity or ordered restrictions on nonzero CSS length units. */
500
+ "no-restricted-length-units"?: LintSeverity | LengthUnitsOptions;
501
+ /** Severity or checks of fixed implementation declarations for physical properties. */
502
+ "prefer-logical-properties"?: LintSeverity | LogicalPropertiesOptions;
503
+ /** Severity or patterns restricting direct references to theme custom properties. */
504
+ "no-restricted-theme-tokens"?: LintSeverity | RestrictedThemeTokensOptions;
505
+ /** Severity and conversion settings for canonical utility replacements. */
506
+ "prefer-canonical-utilities"?: LintSeverity | CanonicalUtilitiesOptions;
507
+ /** Severity or length-conversion settings for `@variant` replacements in stylesheets. */
508
+ "prefer-variant-directive"?: LintSeverity | VariantDirectiveOptions;
509
+ };
510
+ /**
511
+ * A named, shareable lint configuration. Extended presets apply in order before rules.
512
+ */
513
+ interface LintPreset {
514
+ /** Optional display name used to identify this preset in configuration errors. */
515
+ readonly name?: string;
516
+ /** Earlier entries apply first. Omission adds no presets. Cycles are invalid. */
517
+ readonly extends?: readonly LintPreset[];
518
+ /** Rule overrides. Severity-only overrides preserve inherited detection options. */
519
+ readonly rules?: LintRules;
520
+ }
521
+ /**
522
+ * Packages or plugins whose utility definitions lint checks, in addition to the user's own
523
+ * definitions: true for all, false for none, or case-sensitive name globs using `*` and `?`.
524
+ */
525
+ type DefinitionScope = boolean | readonly string[];
526
+ /**
527
+ * Project-level lint settings that presets cannot supply.
528
+ */
529
+ interface LintScope {
530
+ /**
531
+ * Packages whose utility definitions lint checks, matched by package name, such as
532
+ * `stillwind` or `@scope/name`. Defaults to false.
533
+ */
534
+ readonly checkLibraries?: DefinitionScope;
535
+ /**
536
+ * Plugins whose utility definitions lint checks, matched by the name in the `@plugin`
537
+ * statement. A plugin file that your stylesheet loads by path is your own code. Defaults
538
+ * to false.
539
+ */
540
+ readonly checkPlugins?: DefinitionScope;
541
+ }
542
+ /**
543
+ * Project lint configuration. False disables all rules. An object with omitted extends uses no presets.
544
+ */
545
+ type LintConfig = (LintPreset & LintScope) | false;
546
+ /**
547
+ * Complete reporting settings with default detection options applied.
548
+ */
549
+ type ResolvedLintRules = { [K in keyof LintRules]-?: Exclude<LintRules[K], LintSeverity | undefined> extends never ? LintSeverity : Required<Exclude<LintRules[K], LintSeverity | undefined>> & {
550
+ /** Effective reporting policy after preset composition and rule defaults. */
551
+ severity: LintSeverity;
552
+ }; };
553
+ /**
554
+ * Selects additional domains beyond margin, padding, and gap.
555
+ */
556
+ type ArbitrarySpacingOptions = {
557
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
558
+ severity?: LintSeverity;
559
+ /** Complete property globs using `*` and `?`, with no whitespace and comparison that ignores ASCII case. */
560
+ properties?: readonly string[];
561
+ };
562
+ /**
563
+ * Forbids utility spellings independently of CSS resolution.
564
+ */
565
+ type RestrictedUtilitiesOptions = {
566
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
567
+ severity?: LintSeverity;
568
+ /** Restrictions on authored utility spellings. Each matching entry can supply an explanation. */
569
+ utilities?: readonly {
570
+ /** Nonempty, case-sensitive full utility glob without whitespace, enclosing variants, or important modifiers. */
571
+ pattern: string;
572
+ /** Optional project-specific diagnostic explanation, preserved without trimming. */
573
+ message?: string;
574
+ }[];
575
+ };
576
+ /**
577
+ * Forbids resolved declarations, including parsed shorthand components.
578
+ */
579
+ type RestrictedDeclarationsOptions = {
580
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
581
+ severity?: LintSeverity;
582
+ /**
583
+ * Include fixed `(implementation)` declarations. Omission preserves an inherited
584
+ * setting, or uses true. Captured candidate values and unmarked extensions remain checked.
585
+ */
586
+ checkImplementation?: boolean;
587
+ /** Every matching declaration restriction applies. Later entries do not override earlier entries. */
588
+ rules?: readonly {
589
+ /** Nonempty list of complete property globs with no whitespace. Comparison ignores ASCII case. */
590
+ properties: readonly string[];
591
+ /** Nonempty list of complete serialized value globs. Comparison ignores ASCII case, and whitespace, strings, and URLs remain CSS text. */
592
+ values: readonly string[];
593
+ /** Optional project-specific diagnostic explanation, preserved without trimming. */
594
+ message?: string;
595
+ }[];
596
+ };
597
+ /**
598
+ * Controls overlap between direct utility contributions.
599
+ */
600
+ type ConflictingUtilitiesOptions = {
601
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
602
+ severity?: LintSeverity;
603
+ /** Allows a narrower property to override part of a shorthand. Defaults to false. */
604
+ allowShorthandOverrides?: boolean;
605
+ };
606
+ /**
607
+ * Controls reports of candidates that cannot add the marker class that they name.
608
+ */
609
+ type MarkerUseOptions = {
610
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
611
+ severity?: LintSeverity;
612
+ /** Exact decoded marker class names, such as `group` or `foo/bar`, whose findings are not reported. */
613
+ ignoredClasses?: readonly string[];
614
+ };
615
+ /**
616
+ * Controls nonzero CSS lengths; later matching rules replace earlier restrictions.
617
+ */
618
+ type LengthUnitsOptions = {
619
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
620
+ severity?: LintSeverity;
621
+ /**
622
+ * Include fixed `(implementation)` declarations. Omission preserves an inherited
623
+ * setting, or uses false. Captured candidate values remain checked.
624
+ */
625
+ checkImplementation?: boolean;
626
+ /** Restrictions in precedence order. The last matching entry determines the forbidden units. */
627
+ rules?: readonly {
628
+ /** Nonempty list of complete property globs supporting `*` and `?`, without whitespace. Comparison ignores ASCII case. */
629
+ properties: readonly string[];
630
+ /** CSS length unit names compared without ASCII case. An empty list clears restrictions for matching properties. */
631
+ disallow: readonly string[];
632
+ }[];
633
+ };
634
+ /**
635
+ * Controls physical-property checks at utility use sites.
636
+ */
637
+ type LogicalPropertiesOptions = {
638
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
639
+ severity?: LintSeverity;
640
+ /**
641
+ * Include fixed `(implementation)` declarations. Omission preserves an inherited
642
+ * setting, or uses false. Captured candidate values remain checked.
643
+ */
644
+ checkImplementation?: boolean;
645
+ };
646
+ /**
647
+ * Selects theme token names without restricting semantic aliases of those tokens.
648
+ */
649
+ type RestrictedThemeTokensOptions = {
650
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
651
+ severity?: LintSeverity;
652
+ /**
653
+ * Include token uses from fixed `(implementation)` declarations. Omission preserves
654
+ * an inherited setting, or uses true. Tokens selected through placeholders or variant arguments remain checked.
655
+ */
656
+ checkImplementation?: boolean;
657
+ /** Case-sensitive full custom-property name globs with `*` and `?`. */
658
+ tokens?: readonly string[];
659
+ };
660
+ /**
661
+ * Controls importance restrictions on declarations and source modifiers.
662
+ */
663
+ type ImportantOptions = {
664
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
665
+ severity?: LintSeverity;
666
+ /**
667
+ * Include fixed `(implementation)` declarations. Omission preserves an inherited
668
+ * setting, or uses true. Source `!` modifiers and declarations with executable placeholders remain checked.
669
+ */
670
+ checkImplementation?: boolean;
671
+ };
672
+ /**
673
+ * Controls replacement of equivalent utility spellings.
674
+ */
675
+ type CanonicalUtilitiesOptions = {
676
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
677
+ severity?: LintSeverity;
678
+ /** Compares px and rem lengths using rootFontSize. Defaults to true. */
679
+ pxToRem?: boolean;
680
+ /** Combines equivalent utilities within one source container. Defaults to true. */
681
+ collapse?: boolean;
682
+ /** Allows logical and physical properties to share a shorthand. Defaults to false. */
683
+ logicalToPhysical?: boolean;
684
+ /** Keeps selector specificity. Set false to allow Tailwind's ancestor migrations. Defaults to true. */
685
+ preserveSpecificity?: boolean;
686
+ };
687
+ /**
688
+ * Controls replacement of nested rules and conditional at-rules with `@variant`.
689
+ */
690
+ type VariantDirectiveOptions = {
691
+ /** Omission preserves inherited severity, or uses warn for a newly configured rule. */
692
+ severity?: LintSeverity;
693
+ /**
694
+ * Lets `px` lengths in `@media` conditions match `rem` variants at 16px = 1rem. Defaults to false.
695
+ * `rem` in a media query follows the browser's default font size, so the replacement can switch at another width.
696
+ */
697
+ pxToRem?: boolean;
698
+ };
699
+ /**
700
+ * Applies an inline override to project lint settings without expanding presets.
701
+ * Omitted extends preserves the project's list; a supplied list replaces it.
702
+ * Omitted project settings select recommended. Rule fields merge and arrays replace.
703
+ * False replaces all settings. An object override of false enables only its own rules and presets.
704
+ * Neither input is modified.
705
+ *
706
+ * @param base - Project settings, or undefined to use recommended.
707
+ * @param override - Inline settings; undefined preserves the project settings.
708
+ * @returns False when lint remains disabled, or settings with inherited rule options preserved.
709
+ */
710
+ declare function mergeLintConfig(base: LintConfig | undefined, override: LintConfig | undefined): LintConfig;
711
+ /**
712
+ * Expands presets in order and applies rule defaults without modifying the input.
713
+ *
714
+ * @param config - Project lint settings. Undefined selects recommended; false or an empty object disables all rules.
715
+ * @param location - Field path used in configuration errors.
716
+ * @returns Every rule's severity and detection options, wrapped in rules for repeatable normalization.
717
+ * @throws If a preset has a cycle, an unknown field, or invalid effective rule options.
718
+ */
719
+ declare function resolveLintConfig(config?: LintConfig, location?: string): {
720
+ /** Complete lint policies with cloned detection options and default values. */
721
+ rules: ResolvedLintRules;
722
+ /** Packages whose utility definitions lint checks. */
723
+ checkLibraries: DefinitionScope;
724
+ /** Plugins whose utility definitions lint checks. */
725
+ checkPlugins: DefinitionScope;
726
+ };
727
+ /**
728
+ * A Stillwind plugin: JavaScript that generates Stillwind CSS for a design system.
729
+ *
730
+ * A stylesheet loads a plugin with `@plugin "<name>";` or `@plugin "<name>" { option: value; }`.
731
+ * The CSS that {@link StillwindPlugin.css} returns replaces the statement, so it can contain
732
+ * `@utility`, `@custom-variant`, `@theme`, and the other Stillwind directives.
733
+ *
734
+ * A `@stillwind-banner` block contains one `/*!` comment, such as a license notice, that the
735
+ * output keeps. A block inside `@theme` or `@utility` adds its notice only when the output uses a
736
+ * value of that `@theme` block or CSS of that utility. A block outside
737
+ * definitions adds its notice to every nonempty output.
738
+ *
739
+ * A plugin can also define utilities on demand. Its CSS declares a family with
740
+ * `@stillwind-dynamic <prefix>*;` for named candidates such as `icon-mdi--close`, with
741
+ * `@stillwind-dynamic <prefix>[*];` for bracket candidates such as `icon-[mdi--close]`, or with
742
+ * both. The host then passes the candidates of that family that modules use, and that are not
743
+ * defined yet, to {@link StillwindPlugin.resolve}. The returned CSS joins the plugin's CSS, and
744
+ * the host compiles the modules again.
745
+ */
746
+ interface StillwindPlugin {
747
+ /**
748
+ * Name that `@plugin` uses to select this plugin, such as `"@stillwind/plugin-iconify"`.
749
+ * A project's `plugins` entry takes precedence over a package of the same name.
750
+ */
751
+ readonly name: string;
752
+ /**
753
+ * Returns the CSS that replaces the `@plugin` statement.
754
+ *
755
+ * @param context - Options of the statement and host operations.
756
+ * @returns Stillwind CSS. It must not contain `@import` or `@plugin`.
757
+ */
758
+ css(context: PluginContext): string | Promise<string>;
759
+ /**
760
+ * Defines candidates of the dynamic families that the plugin's CSS declares.
761
+ *
762
+ * @param candidates - Utility names without variants, modifiers, or `!`, such as
763
+ * `icon-mdi--close`. When the family accepts both forms, a bracket spelling such as
764
+ * `icon-[mdi--close]` arrives in its named form. When the family accepts only the bracket form,
765
+ * the bracket spelling arrives as written, and the plugin defines it under that name, such as
766
+ * `@utility icon-[mdi--close]`.
767
+ * @param context - Options of the statement and host operations.
768
+ * @returns Stillwind CSS that defines some or all of the candidates. A candidate that it leaves
769
+ * undefined is not passed again while the design system is loaded.
770
+ */
771
+ resolve?(candidates: readonly string[], context: PluginContext): string | Promise<string>;
772
+ /**
773
+ * Lists the candidates that editors complete for the plugin's dynamic families.
774
+ *
775
+ * The host calls it once with an empty `input` for the candidates that editors always offer,
776
+ * and again with the text of an editor input. A plugin can therefore list a large family only
777
+ * after the input narrows it.
778
+ *
779
+ * @param context - Options of the statement and host operations.
780
+ * @param input - Utility text before the editor's cursor, without variants, such as
781
+ * `icon-mdi--cl`, or an empty string.
782
+ * @returns Utility names in the form that {@link StillwindPlugin.resolve} accepts. The host
783
+ * keeps only names that start with `input`. A name that ends with `-` is incomplete, such as
784
+ * `icon-mdi--`. Editors insert it and request completion again.
785
+ */
786
+ catalog?(context: PluginContext, input: string): readonly string[] | Promise<readonly string[]>;
787
+ }
788
+ /** Inputs of one loaded `@plugin` statement. */
789
+ interface PluginContext {
790
+ /**
791
+ * Declarations of the statement's options block, keyed by name. A later declaration of a name
792
+ * replaces an earlier one. Values are the trimmed declaration text without the semicolon. Each
793
+ * run of whitespace and comments between top-level tokens becomes one space, and strings keep
794
+ * their quotes. A statement without a block has no options.
795
+ */
796
+ readonly options: Readonly<Record<string, string>>;
797
+ /** Absolute project directory. */
798
+ readonly root: string;
799
+ /**
800
+ * Registers a file or directory that the plugin reads, so that a change reloads the design
801
+ * system. A file reloads it when its content changes. A directory reloads it when an entry is
802
+ * added, removed, or renamed. A change to an entry's content does not reload it unless the
803
+ * plugin also watches that entry. A host that does not reload the design system ignores both
804
+ * kinds.
805
+ *
806
+ * @param path - Absolute file or directory path.
807
+ * @param kind - Whether `path` names a file or a directory. Defaults to `"file"`.
808
+ */
809
+ watch(path: string, kind?: PluginWatchKind): void;
810
+ /**
811
+ * Resolves a module request from the stylesheet that contains the statement, with the host's
812
+ * module resolution. A plugin uses it instead of Node APIs, so that it also runs in browser hosts.
813
+ *
814
+ * @param specifier - Package specifier with an optional subpath, such as
815
+ * `@iconify-json/mdi/icons.json`, or a relative or absolute path.
816
+ * @returns The absolute path of the file, or undefined when the request does not resolve.
817
+ */
818
+ resolve(specifier: string): Promise<string | undefined>;
819
+ /**
820
+ * Reads a text file through the host.
821
+ *
822
+ * @param path - Absolute file path, such as a result of {@link PluginContext.resolve}.
823
+ * @returns The file's text.
824
+ * @throws If the file does not exist or cannot be read.
825
+ */
826
+ read(path: string): Promise<string>;
827
+ /**
828
+ * Lists the entries of a directory through the host. Listing does not watch the directory.
829
+ *
830
+ * @param path - Absolute directory path.
831
+ * @returns The directory's own entries in no particular order, without the entries of its
832
+ * subdirectories.
833
+ * @throws If the directory does not exist or cannot be read, or the host cannot list directories.
834
+ */
835
+ list(path: string): Promise<readonly PluginDirectoryEntry[]>;
836
+ }
837
+ /** Kind of path that {@link PluginContext.watch} registers. */
838
+ type PluginWatchKind = "file" | "directory";
839
+ /** One entry of a directory that {@link PluginContext.list} returns. */
840
+ interface PluginDirectoryEntry {
841
+ /** Entry name without the directory path. */
842
+ name: string;
843
+ /** Whether the entry is a directory or a symbolic link to a directory. */
844
+ directory: boolean;
845
+ }
846
+ /**
847
+ * Returns `plugin` unchanged with its type checked, for use in a configuration file.
848
+ *
849
+ * @param plugin - Plugin definition.
850
+ * @returns The same object.
851
+ */
852
+ declare function definePlugin(plugin: StillwindPlugin): StillwindPlugin;
853
+ /** Tailwind CSS configuration, with the keys of a file that Tailwind's `@config` loads. */
854
+ type TailwindConfig = Config;
855
+ /** Controls independent sorting targets in scripts and stylesheets. */
856
+ type UtilitySortOptions = {
857
+ /** Sorts utilities within each static string or template segment. Defaults to true. */
858
+ stringLiterals?: boolean;
859
+ /**
860
+ * Groups arrays, argument lists, and object entries by input kind. Defaults to true.
861
+ * Each ref's marker precedes its projections. Bases, utilities, and custom
862
+ * properties follow. Each group retains its original order.
863
+ */
864
+ arrays?: boolean;
865
+ /** Sorts utilities within each CSS `@apply` statement. Defaults to true. */
866
+ applyUtilities?: boolean;
867
+ /** Orders adjacent CSS `@apply` statements while preserving competing writes. Defaults to false. */
868
+ applyStatements?: boolean;
869
+ /** Orders adjacent applied CSS `@variant` blocks while preserving competing writes. Defaults to false. */
870
+ variantBlocks?: boolean;
871
+ };
872
+ /** Controls document CSS delivery through build integrations. */
873
+ interface BuildOptions {
874
+ /** Applies producer CSS to the document. Defaults to true. */
875
+ automatic?: boolean;
876
+ }
877
+ /**
878
+ * Compiler and design-system settings shared by build integrations and analysis services.
879
+ */
880
+ interface BaseConfig {
881
+ /**
882
+ * Lint presets and rule overrides. Omission uses recommended.
883
+ * False or an empty object disables lint rules and fixes while retaining compiler diagnostics.
884
+ */
885
+ lint?: LintConfig;
886
+ /** Targets for Stillwind sorting. False disables explicit sorting and its diagnostics and fixes. */
887
+ sort?: UtilitySortOptions | false;
888
+ /**
889
+ * Project directory, absolute or relative to the configuration file's directory.
890
+ * An inline override uses the application's build root instead. Defaults to that base directory.
891
+ */
892
+ root?: string;
893
+ /**
894
+ * TypeScript configuration path, absolute or relative to the adapter project root. Omission
895
+ * selects an existing root `tsconfig.json`. False uses isolated checker defaults. Semantic
896
+ * resolution uses these same settings. Backends capture them when created. Recreate the backend
897
+ * to apply changed settings.
898
+ */
899
+ tsconfig?: string | false;
900
+ /** Design-system stylesheet, absolute or relative to the project root. */
901
+ css?: string;
902
+ /**
903
+ * Orders utilities by authored definition positions or Tailwind property metadata.
904
+ * Defaults to authored.
905
+ */
906
+ utilityOrder?: "authored" | "tailwind";
907
+ /**
908
+ * Minimum browser versions, such as ["chrome111", "firefox113", "safari17"].
909
+ * A single string is accepted. An empty list keeps color fallbacks.
910
+ * Omission uses adapter defaults, or keeps fallbacks when the host supplies none.
911
+ * Removes generated compatibility branches only when every target supports the value.
912
+ */
913
+ target?: string | readonly string[];
914
+ /**
915
+ * Namespace for Stillwind-owned CSS identifiers.
916
+ * Starts with --, ends with -, and contains no whitespace.
917
+ * Defaults to --sw-.
918
+ */
919
+ prefix?: string;
920
+ /**
921
+ * Namespace for Tailwind-compatible custom properties.
922
+ * Uses the same format as prefix and may equal it.
923
+ * Defaults to --tw-.
924
+ */
925
+ tailwindPrefix?: string;
926
+ /**
927
+ * Replaces the leading -- of theme variables in generated CSS. Uses the same format as
928
+ * prefix and may equal the other prefixes. Omission keeps the authored names.
929
+ */
930
+ themePrefix?: string;
931
+ /**
932
+ * Stable namespace included in generated class identities. Use the same value for
933
+ * client and server builds. Changing it changes those identities. Defaults to empty.
934
+ */
935
+ classNamespace?: string;
936
+ /**
937
+ * Emit native CSS if() for experimental values and variants. False uses fallback helpers.
938
+ * Defaults to false. Comparisons, negated variants, and CSS-wide helper branches require true.
939
+ */
940
+ useCssIf?: boolean;
941
+ /**
942
+ * Host name generators, one optional function per identifier family. A function
943
+ * returns the name to write, or `undefined` to keep the compiler's own name. A
944
+ * generator must be pure: the same request has to produce the same name. Keep the
945
+ * functions stable for the life of the session, and update `namingRevision` with them.
946
+ */
947
+ naming?: NativeIdentifierNaming;
948
+ /**
949
+ * Caller-supplied revision of naming callbacks, included in artifact cache keys. Update it when
950
+ * callbacks change. The compiler does not derive it from functions. Defaults to an empty string.
951
+ */
952
+ namingRevision?: string;
953
+ /**
954
+ * Number of base-36 hash digits kept in built-in generated names. Defaults to 5.
955
+ * Integer values from 1 to 50 are accepted. Raising it lowers the chance of a collision.
956
+ */
957
+ hashLength?: number;
958
+ /**
959
+ * Plugins that `@plugin` statements of the design-system stylesheet select by name. An entry
960
+ * takes precedence over a package of the same name. A plugin without a matching statement is
961
+ * not loaded.
962
+ */
963
+ plugins?: readonly StillwindPlugin[];
964
+ /**
965
+ * Tailwind CSS configuration, or a promise for one, in place of Tailwind's `@config`. The host
966
+ * awaits it when it loads the design-system stylesheet, which requires the `tailwindcss`
967
+ * package.
968
+ *
969
+ * Its keys replace the same keys of the configurations that `@plugin` statements supply, as
970
+ * the keys of a `@config` file do in Tailwind. `theme`, `presets`, `plugins`, `darkMode`, and
971
+ * `important` apply as in Tailwind. A stylesheet's `@custom-variant dark` replaces the variant
972
+ * that `darkMode` defines. Plugins can read `prefix` and `blocklist` through `config()`, but
973
+ * these keys do not change output. Other keys have no effect.
974
+ */
975
+ tailwind?: TailwindConfig | Promise<TailwindConfig>;
976
+ /**
977
+ * Makes class utilities important, as Tailwind's `important` configuration key does. True
978
+ * marks every declaration of a class utility `!important`. A selector nests each class utility
979
+ * rule in a rule with that selector. Neither form changes `@apply`. Setting both this field and
980
+ * `tailwind.important` is an error.
981
+ */
982
+ important?: true | string;
983
+ /**
984
+ * Positive finite number of pixels per rem in the documents that use the CSS. Defaults to 16.
985
+ * Canonical lint converts pixel spacing with it, and editor previews annotate rem values with it.
986
+ * Media and container query annotations always use 16 because browsers evaluate rem there
987
+ * against the initial font size.
988
+ */
989
+ rootFontSize?: number;
990
+ }
991
+ /** Compiler and document CSS delivery settings shared by build adapters. */
992
+ interface BuildConfig extends BaseConfig, BuildOptions {}
993
+ /**
994
+ * Validates compiler fields and lint policies without resolving paths or invoking naming callbacks.
995
+ * @param value - Compiler settings with no analysis or delivery fields. CSS is optional here.
996
+ * @param location - Field path prepended to validation errors. Defaults to `config`.
997
+ * @param partial - Whether incomplete overrides can defer namespace collisions and required lint
998
+ * options until they are merged with project settings.
999
+ * @throws If a field is unknown or invalid, namespaces collide, or lint presets or effective options are invalid.
1000
+ */
1001
+ declare function validateCompilerConfig(value: unknown, location?: string, partial?: boolean): asserts value is BaseConfig;
1002
+ /** Compiler and delivery settings after defaults are applied. Authored paths remain unresolved. */
1003
+ interface NormalizedCompilerConfig extends BaseConfig, BuildOptions {
1004
+ /** Validated Stillwind namespace, defaulting to --sw-. */
1005
+ prefix: string;
1006
+ /** Validated Tailwind namespace, defaulting to --tw-. */
1007
+ tailwindPrefix: string;
1008
+ /** Validated theme variable namespace. Omission keeps authored names. */
1009
+ themePrefix?: string;
1010
+ /** Namespace shared by client and server class identities, defaulting to an empty string. */
1011
+ classNamespace: string;
1012
+ /** Ordering policy after applying the authored-order default. */
1013
+ utilityOrder: "authored" | "tailwind";
1014
+ /** Captured minimum browser versions. An empty list keeps color fallbacks. */
1015
+ target: string[];
1016
+ /** Whether native CSS if() features are enabled. Defaults to false. */
1017
+ useCssIf: boolean;
1018
+ /** Caller-supplied revision of naming callbacks, defaulting to an empty string. */
1019
+ namingRevision: string;
1020
+ /** Number of base-36 digits in generated hashes, between 1 and 50 inclusive. Defaults to 5. */
1021
+ hashLength: number;
1022
+ /** Positive finite number of pixels per rem. Defaults to 16. */
1023
+ rootFontSize: number;
1024
+ /** Explicit flags for every sorting target. A disabled sort setting makes every flag false. */
1025
+ sort: Required<UtilitySortOptions>;
1026
+ /** Expanded lint settings with a severity and default detection options for every rule. */
1027
+ lint: {
1028
+ /** Complete rules after ordered preset composition. Unconfigured rules are off. */
1029
+ rules: ResolvedLintRules;
1030
+ /** Packages whose utility definitions lint checks. Defaults to false. */
1031
+ checkLibraries: DefinitionScope;
1032
+ /** Plugins whose utility definitions lint checks. Defaults to false. */
1033
+ checkPlugins: DefinitionScope;
1034
+ };
1035
+ /** Whether producer CSS applies to the document. Defaults to true. */
1036
+ automatic: boolean;
1037
+ }
1038
+ /**
1039
+ * Validates compiler fields and applies defaults without resolving paths.
1040
+ * @param config - Compiler and delivery settings. Other fields are discarded before validation.
1041
+ * @returns A new object containing compiler and delivery settings with explicit sort flags and
1042
+ * expanded lint rules. Naming callbacks and other unchanged objects can retain input references.
1043
+ * @throws If compiler fields, delivery settings, namespace combinations, or effective lint policies are invalid.
1044
+ */
1045
+ declare function normalizeCompilerConfig(config: BaseConfig & BuildOptions): NormalizedCompilerConfig;
1046
+ /** One project's compiler settings, analysis scope, and source preparation operations. */
1047
+ interface AnalysisProjectConfig extends BaseConfig, BuildOptions {
1048
+ /** Nonempty design-system stylesheet path, absolute or relative to root. Authored whitespace is preserved. */
1049
+ css: string;
1050
+ /** Optional nonempty identifier used to select this project. Names must be unique, and authored whitespace is preserved. */
1051
+ name?: string;
1052
+ /**
1053
+ * Nonempty list of globs relative to root. Analysis enumerates these targets and filters reports
1054
+ * to their scope. Imported dependencies and global declarations can lie outside this scope.
1055
+ */
1056
+ files: readonly string[];
1057
+ /** Globs relative to root that remove analysis targets. node_modules and .git are always excluded. */
1058
+ exclude?: readonly string[];
1059
+ /** Omission reads files and prepares supported framework documents. */
1060
+ sources?: SourceProvider;
1061
+ /** Omission uses built-in framework converters. Custom preparation applies to unprepared inputs only. */
1062
+ projection?: ProjectionProvider;
1063
+ /** False skips checker queries while retaining locally determined diagnostics. */
1064
+ typeFacts?: false;
1065
+ /** Comments that editor previews add after values. Omission uses the defaults of each field. */
1066
+ preview?: PreviewOptions;
1067
+ }
1068
+ /** Selects the comments that editor previews add after CSS values. */
1069
+ interface PreviewOptions {
1070
+ /**
1071
+ * Adds the resolved value after each theme `var()` and after each `calc()` that evaluates to one
1072
+ * value. Defaults to true.
1073
+ */
1074
+ themeValues?: boolean;
1075
+ /**
1076
+ * Adds pixel equivalents for rem values, using the project's rootFontSize. Media and container
1077
+ * queries use 16 pixels per rem. Defaults to true.
1078
+ */
1079
+ pixelEquivalents?: boolean;
1080
+ /**
1081
+ * Adds hexadecimal sRGB equivalents for colors. "exact" skips colors outside the sRGB gamut.
1082
+ * "approximate" maps those colors into the gamut and marks the result with `≈`. False adds no
1083
+ * color comments. Defaults to "approximate".
1084
+ */
1085
+ colorEquivalents?: "approximate" | "exact" | false;
1086
+ }
1087
+ type Captured<T> = T extends ((...arguments_: never[]) => unknown) ? T : T extends object ? { readonly [K in keyof T]: Captured<T[K]>; } : T;
1088
+ /**
1089
+ * Project settings fixed for a service's lifetime, with provider functions preserved. The Tailwind
1090
+ * configuration keeps the caller's object or promise.
1091
+ */
1092
+ type CapturedProjectConfig = Captured<Omit<AnalysisProjectConfig, "tailwind">> & Pick<AnalysisProjectConfig, "tailwind">;
1093
+ /**
1094
+ * Captures configuration data and callback registries without changing the caller's objects.
1095
+ * @param config - Evaluated project settings. Provider methods retain their original receivers.
1096
+ * @returns Fixed settings. A previously captured configuration is shared without copying it again.
1097
+ */
1098
+ declare function captureProjectConfig(config: AnalysisProjectConfig): CapturedProjectConfig;
1099
+ /** Supplies original or prepared sources without starting a bundler. */
1100
+ type SourceProvider = {
1101
+ /** Reads original files through the analysis host, including captured unsaved buffers. */
1102
+ kind: "filesystem";
1103
+ } | {
1104
+ /** Delegates source support, loading, and optional dependency metadata to the caller. */
1105
+ kind: "custom";
1106
+ /**
1107
+ * Determines whether the host can analyze a resolved source.
1108
+ *
1109
+ * @param id - Full source identity used for loading and dependency traversal.
1110
+ * @returns Whether this provider supplies analyzable source for the identity.
1111
+ */
1112
+ supports(id: string): boolean;
1113
+ /**
1114
+ * Supplies source before or after preparation, preserving the requested resolver identity.
1115
+ *
1116
+ * @param id - Resolved source identity. The returned resolverId must equal this value.
1117
+ * @param context - Project root and buffers captured for this analysis. Consult these buffers
1118
+ * when loading unsaved documents.
1119
+ * @returns Original input for preparation, or prepared input with checker correspondences.
1120
+ * @throws If the source cannot be loaded or prepared.
1121
+ */
1122
+ load(id: string, context: SourceProviderContext): Promise<ProjectInput | PreparedSource>;
1123
+ /**
1124
+ * Supplies a source implementation resolution that takes precedence over checker resolution.
1125
+ *
1126
+ * @param specifier - Authored import request.
1127
+ * @param importer - Resolved identity of the importing source.
1128
+ * @param context - Root and captured buffers for the same analysis.
1129
+ * @returns A source identity, or null when this provider cannot resolve the request.
1130
+ * @throws If resolution fails for reasons other than an unknown request.
1131
+ */
1132
+ resolve?(specifier: string, importer: string, context: SourceProviderContext): Promise<string | null>;
1133
+ };
1134
+ /** Captured buffers shared by source reads, projections, and semantic queries. */
1135
+ interface SourceProviderContext {
1136
+ /** Absolute project directory used for relative compiler and checker identities. */
1137
+ root: string;
1138
+ /** Original source text keyed by absolute file path, captured before asynchronous analysis. */
1139
+ documents: ReadonlyMap<string, string>;
1140
+ }
1141
+ /** Selects framework converters or a caller-supplied preparation operation. */
1142
+ type ProjectionProvider = {
1143
+ /** Uses the built-in converter selected by the input's framework metadata. */
1144
+ kind: "framework";
1145
+ } | {
1146
+ /** Delegates preparation of original inputs to the caller. */
1147
+ kind: "custom";
1148
+ /**
1149
+ * Prepares original source for scanning and checker queries.
1150
+ *
1151
+ * @param input - Source input with its resolver, compiler, checker, and document identities.
1152
+ * @returns Prepared source preserving those identities and original source correspondences.
1153
+ * @throws If conversion or validation of source correspondences fails.
1154
+ */
1155
+ prepare(input: ProjectInput): Promise<PreparedSource>;
1156
+ };
1157
+ /** Configuration file settings evaluated by build integrations and analysis hosts. */
1158
+ interface StillwindConfig {
1159
+ /** Nonempty project list. Projects keep independent scopes and design systems. Supplied names must be unique. */
1160
+ projects: AnalysisProjectConfig[];
1161
+ }
1162
+ /** Called without arguments during configuration evaluation. Returns settings directly or asynchronously. */
1163
+ type StillwindConfigFactory = () => StillwindConfig | Promise<StillwindConfig>;
1164
+ /** Configuration module export accepted by Node hosts and build configuration consumers. */
1165
+ type StillwindConfigExport = StillwindConfig | Promise<StillwindConfig> | StillwindConfigFactory;
1166
+ /**
1167
+ * Provides contextual types and returns the supplied export unchanged. Factories run and promises
1168
+ * are awaited when the consumer calls resolveConfig. Definition does not validate their results.
1169
+ *
1170
+ * @param config - Settings, a promise for settings, or a factory returning either form.
1171
+ * @returns The same object, promise, or function with its inferred type preserved.
1172
+ */
1173
+ declare function defineConfig<T extends StillwindConfigExport>(config: T): T;
1174
+ /**
1175
+ * Awaits a configuration export, calls a factory once without arguments when supplied, and
1176
+ * validates the resulting settings. Factory exceptions and rejected promises propagate.
1177
+ *
1178
+ * @param value - Settings, a promise, or a factory from a configuration module's default export.
1179
+ * @returns The validated settings object without copying it.
1180
+ * @throws If evaluation fails or the resulting settings are invalid.
1181
+ */
1182
+ declare function resolveConfig(value: unknown): Promise<StillwindConfig>;
1183
+ /**
1184
+ * Validates evaluated projects and their compiler settings without running providers or resolving paths.
1185
+ * @param value - Evaluated settings with a nonempty project list, required CSS paths and file globs,
1186
+ * and unique names when names are supplied.
1187
+ * @returns The supplied settings with object and callback identities preserved.
1188
+ * @throws If a field, project name, effective lint policy, or compiler namespace is invalid.
1189
+ * Validation errors include the authored field path.
1190
+ */
1191
+ declare function validateConfig(value: unknown): StillwindConfig;
1192
+ /** Inline options that can pass through isolated loader workers. */
1193
+ type SerializableInlineConfig = Omit<InlineConfig, "naming" | "plugins" | "tailwind">;
1194
+ /** Build overrides and the selection of a configuration file and project. */
1195
+ interface InlineConfig extends BuildConfig {
1196
+ /**
1197
+ * Configuration file path, absolute or relative to the application root. An explicit path must
1198
+ * exist. Omission searches upward for stillwind.config.*. False disables file loading.
1199
+ */
1200
+ configFile?: string | false;
1201
+ /**
1202
+ * Exact configured project name. Omission selects the sole project or the unique project whose
1203
+ * root most closely contains the application root. Ambiguous selection fails during evaluation.
1204
+ */
1205
+ project?: string;
1206
+ }
1207
+ /** Filenames in precedence order within each searched directory. */
1208
+ declare const configurationFiles: string[];
1209
+ export { ArbitrarySpacingOptions as A, LintSeverity as B, normalizeCompilerConfig as C, PluginWatchKind as D, PluginDirectoryEntry as E, LengthUnitsOptions as F, RestrictedThemeTokensOptions as G, MarkerUseOptions as H, LintConfig as I, mergeLintConfig as J, RestrictedUtilitiesOptions as K, LintPreset as L, ConflictingUtilitiesOptions as M, DefinitionScope as N, StillwindPlugin as O, ImportantOptions as P, lintRules as Q, LintRules as R, UtilitySortOptions as S, PluginContext as T, ResolvedLintRules as U, LogicalPropertiesOptions as V, RestrictedDeclarationsOptions as W, LintCategory as X, resolveLintConfig as Y, LintRule as Z, BaseConfig as _, CapturedProjectConfig as a, NormalizedCompilerConfig as b, SourceProvider as c, StillwindConfigExport as d, StillwindConfigFactory as f, validateConfig as g, resolveConfig as h, AnalysisProjectConfig as i, CanonicalUtilitiesOptions as j, definePlugin as k, SourceProviderContext as l, defineConfig as m, SerializableInlineConfig as n, PreviewOptions as o, captureProjectConfig as p, VariantDirectiveOptions as q, configurationFiles as r, ProjectionProvider as s, InlineConfig as t, StillwindConfig as u, BuildConfig as v, validateCompilerConfig as w, TailwindConfig as x, BuildOptions as y, LintScope as z };
1210
+ //# sourceMappingURL=resolution-BnR6LLM-.d.ts.map