tailwind-styled-v4 5.0.0 → 5.0.2
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/CHANGELOG.md +398 -0
- package/LICENSE +21 -0
- package/README.md +532 -0
- package/dist/analyzer.d.mts +114 -0
- package/dist/analyzer.d.ts +114 -0
- package/dist/analyzer.js +6808 -0
- package/dist/analyzer.js.map +1 -0
- package/dist/analyzer.mjs +6798 -0
- package/dist/analyzer.mjs.map +1 -0
- package/dist/{animate.d.cts → animate.d.mts} +3 -30
- package/dist/animate.d.ts +3 -30
- package/dist/animate.js +7096 -352
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +7482 -0
- package/dist/animate.mjs.map +1 -0
- package/dist/atomic.d.mts +18 -0
- package/dist/atomic.d.ts +18 -0
- package/dist/atomic.js +191 -0
- package/dist/atomic.js.map +1 -0
- package/dist/atomic.mjs +185 -0
- package/dist/atomic.mjs.map +1 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +45008 -0
- package/dist/cli.js.map +1 -0
- package/dist/cli.mjs +44980 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/compiler.d.mts +1009 -0
- package/dist/compiler.d.ts +1009 -0
- package/dist/compiler.js +4937 -0
- package/dist/compiler.js.map +1 -0
- package/dist/compiler.mjs +4862 -0
- package/dist/compiler.mjs.map +1 -0
- package/dist/dashboard.d.mts +272 -0
- package/dist/dashboard.d.ts +272 -0
- package/dist/dashboard.js +249 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/dashboard.mjs +239 -0
- package/dist/dashboard.mjs.map +1 -0
- package/dist/devtools.js +171 -158
- package/dist/devtools.js.map +1 -1
- package/dist/{devtools.cjs → devtools.mjs} +166 -167
- package/dist/devtools.mjs.map +1 -0
- package/dist/engine.d.mts +398 -0
- package/dist/engine.d.ts +398 -0
- package/dist/engine.js +19264 -0
- package/dist/engine.js.map +1 -0
- package/dist/engine.mjs +19227 -0
- package/dist/engine.mjs.map +1 -0
- package/dist/{index.d.cts → index.d.mts} +12 -5
- package/dist/index.d.ts +12 -5
- package/dist/index.js +7178 -27
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8408 -0
- package/dist/index.mjs.map +1 -0
- package/dist/liveTokenEngine-DYN3Zale.d.mts +34 -0
- package/dist/liveTokenEngine-DYN3Zale.d.ts +34 -0
- package/dist/{next.d.cts → next.d.mts} +2 -1
- package/dist/next.d.ts +2 -1
- package/dist/next.js +24027 -28
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +24232 -0
- package/dist/next.mjs.map +1 -0
- package/dist/plugin.d.mts +90 -0
- package/dist/plugin.d.ts +90 -0
- package/dist/plugin.js +185 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugin.mjs +174 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/pluginRegistry.d.mts +83 -0
- package/dist/pluginRegistry.d.ts +83 -0
- package/dist/pluginRegistry.js +303 -0
- package/dist/pluginRegistry.js.map +1 -0
- package/dist/pluginRegistry.mjs +298 -0
- package/dist/pluginRegistry.mjs.map +1 -0
- package/dist/preset.js +9 -4
- package/dist/preset.js.map +1 -1
- package/dist/{preset.cjs → preset.mjs} +5 -14
- package/dist/preset.mjs.map +1 -0
- package/dist/rspack.d.mts +33 -0
- package/dist/rspack.d.ts +33 -0
- package/dist/rspack.js +66 -0
- package/dist/rspack.js.map +1 -0
- package/dist/rspack.mjs +55 -0
- package/dist/rspack.mjs.map +1 -0
- package/dist/runtime.d.mts +62 -0
- package/dist/runtime.d.ts +62 -0
- package/dist/runtime.js +455 -0
- package/dist/runtime.js.map +1 -0
- package/dist/runtime.mjs +436 -0
- package/dist/runtime.mjs.map +1 -0
- package/dist/runtimeCss.d.mts +65 -0
- package/dist/runtimeCss.d.ts +65 -0
- package/dist/{css.cjs → runtimeCss.js} +71 -4
- package/dist/runtimeCss.js.map +1 -0
- package/dist/{css.js → runtimeCss.mjs} +66 -5
- package/dist/runtimeCss.mjs.map +1 -0
- package/dist/scanner.d.mts +25 -0
- package/dist/scanner.d.ts +25 -0
- package/dist/scanner.js +5774 -0
- package/dist/scanner.js.map +1 -0
- package/dist/scanner.mjs +5760 -0
- package/dist/scanner.mjs.map +1 -0
- package/dist/shared.d.mts +85 -0
- package/dist/shared.d.ts +85 -0
- package/dist/shared.js +255 -0
- package/dist/shared.js.map +1 -0
- package/dist/shared.mjs +233 -0
- package/dist/shared.mjs.map +1 -0
- package/dist/storybookAddon.d.mts +108 -0
- package/dist/storybookAddon.d.ts +108 -0
- package/dist/storybookAddon.js +95 -0
- package/dist/storybookAddon.js.map +1 -0
- package/dist/storybookAddon.mjs +88 -0
- package/dist/storybookAddon.mjs.map +1 -0
- package/dist/svelte.d.mts +114 -0
- package/dist/svelte.d.ts +114 -0
- package/dist/svelte.js +67 -0
- package/dist/svelte.js.map +1 -0
- package/dist/svelte.mjs +59 -0
- package/dist/svelte.mjs.map +1 -0
- package/dist/testing.d.mts +185 -0
- package/dist/testing.d.ts +185 -0
- package/dist/testing.js +173 -0
- package/dist/testing.js.map +1 -0
- package/dist/testing.mjs +158 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/theme.d.mts +188 -0
- package/dist/theme.d.ts +188 -0
- package/dist/theme.js +334 -0
- package/dist/theme.js.map +1 -0
- package/dist/theme.mjs +311 -0
- package/dist/theme.mjs.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types-DXr2PmGP.d.mts +31 -0
- package/dist/types-DXr2PmGP.d.ts +31 -0
- package/dist/vite.js +29611 -17
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +29712 -0
- package/dist/vite.mjs.map +1 -0
- package/dist/vue.d.mts +89 -0
- package/dist/vue.d.ts +89 -0
- package/dist/vue.js +104 -0
- package/dist/vue.js.map +1 -0
- package/dist/vue.mjs +96 -0
- package/dist/vue.mjs.map +1 -0
- package/package.json +170 -64
- package/dist/animate.cjs +0 -771
- package/dist/animate.cjs.map +0 -1
- package/dist/chunk-VZEJV27B.js +0 -11
- package/dist/chunk-VZEJV27B.js.map +0 -1
- package/dist/chunk-Y5D3E72P.cjs +0 -13
- package/dist/chunk-Y5D3E72P.cjs.map +0 -1
- package/dist/css.cjs.map +0 -1
- package/dist/css.d.cts +0 -30
- package/dist/css.d.ts +0 -30
- package/dist/css.js.map +0 -1
- package/dist/devtools.cjs.map +0 -1
- package/dist/index.cjs +0 -1353
- package/dist/index.cjs.map +0 -1
- package/dist/next.cjs +0 -248
- package/dist/next.cjs.map +0 -1
- package/dist/preset.cjs.map +0 -1
- package/dist/turbopackLoader.cjs +0 -37
- package/dist/turbopackLoader.cjs.map +0 -1
- package/dist/turbopackLoader.d.cts +0 -12
- package/dist/turbopackLoader.d.ts +0 -12
- package/dist/turbopackLoader.js +0 -35
- package/dist/turbopackLoader.js.map +0 -1
- package/dist/vite.cjs +0 -138
- package/dist/vite.cjs.map +0 -1
- package/dist/webpackLoader.cjs +0 -51
- package/dist/webpackLoader.cjs.map +0 -1
- package/dist/webpackLoader.d.cts +0 -17
- package/dist/webpackLoader.d.ts +0 -17
- package/dist/webpackLoader.js +0 -49
- package/dist/webpackLoader.js.map +0 -1
- /package/dist/{devtools.d.cts → devtools.d.mts} +0 -0
- /package/dist/{preset.d.cts → preset.d.mts} +0 -0
- /package/dist/{vite.d.cts → vite.d.mts} +0 -0
package/dist/engine.d.ts
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
import { ScanWorkspaceResult, ScanWorkspaceOptions } from './scanner.js';
|
|
2
|
+
export { ScanFileResult } from './scanner.js';
|
|
3
|
+
|
|
4
|
+
interface EngineMetricsSnapshot {
|
|
5
|
+
eventsReceived: number;
|
|
6
|
+
eventsProcessed: number;
|
|
7
|
+
batchesProcessed: number;
|
|
8
|
+
incrementalUpdates: number;
|
|
9
|
+
fullRescans: number;
|
|
10
|
+
skippedLargeFiles: number;
|
|
11
|
+
queueMaxSize: number;
|
|
12
|
+
lastBuildMs: number;
|
|
13
|
+
avgBuildMs: number;
|
|
14
|
+
}
|
|
15
|
+
declare class EngineMetricsCollector {
|
|
16
|
+
private eventsReceived;
|
|
17
|
+
private eventsProcessed;
|
|
18
|
+
private batchesProcessed;
|
|
19
|
+
private incrementalUpdates;
|
|
20
|
+
private fullRescans;
|
|
21
|
+
private skippedLargeFiles;
|
|
22
|
+
private queueMaxSize;
|
|
23
|
+
private lastBuildMs;
|
|
24
|
+
private totalBuildMs;
|
|
25
|
+
markEventReceived(queueSize: number): void;
|
|
26
|
+
markBatchProcessed(batchSize: number): void;
|
|
27
|
+
markIncremental(): void;
|
|
28
|
+
markFullRescan(): void;
|
|
29
|
+
markSkippedLargeFile(): void;
|
|
30
|
+
markBuildDuration(ms: number): void;
|
|
31
|
+
snapshot(): EngineMetricsSnapshot;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
interface EnginePluginContext {
|
|
35
|
+
root: string;
|
|
36
|
+
timestamp: number;
|
|
37
|
+
}
|
|
38
|
+
interface EngineWatchContext {
|
|
39
|
+
root: string;
|
|
40
|
+
timestamp: number;
|
|
41
|
+
}
|
|
42
|
+
interface EnginePlugin {
|
|
43
|
+
name: string;
|
|
44
|
+
beforeScan?(context: EnginePluginContext): void | Promise<void>;
|
|
45
|
+
afterScan?(scan: ScanWorkspaceResult, context: EnginePluginContext): ScanWorkspaceResult | void | Promise<ScanWorkspaceResult | void>;
|
|
46
|
+
transformClasses?(classes: string[], context: EnginePluginContext): string[] | void | Promise<string[] | void>;
|
|
47
|
+
beforeBuild?(scan: ScanWorkspaceResult, context: EnginePluginContext): void | Promise<void>;
|
|
48
|
+
afterBuild?(result: BuildResult, context: EnginePluginContext): BuildResult | void | Promise<BuildResult | void>;
|
|
49
|
+
onError?(error: Error, context: EnginePluginContext): void | Promise<void>;
|
|
50
|
+
beforeWatch?(context: EngineWatchContext): void | Promise<void>;
|
|
51
|
+
afterWatch?(context: EngineWatchContext): void | Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
declare function runBeforeScan(plugins: EnginePlugin[], context: EnginePluginContext): Promise<void>;
|
|
54
|
+
declare function runAfterScan(plugins: EnginePlugin[], scan: ScanWorkspaceResult, context: EnginePluginContext): Promise<ScanWorkspaceResult>;
|
|
55
|
+
declare function runTransformClasses(plugins: EnginePlugin[], classes: string[], context: EnginePluginContext): Promise<string[]>;
|
|
56
|
+
declare function runBeforeBuild(plugins: EnginePlugin[], scan: ScanWorkspaceResult, context: EnginePluginContext): Promise<void>;
|
|
57
|
+
declare function runAfterBuild(plugins: EnginePlugin[], result: BuildResult, context: EnginePluginContext): Promise<BuildResult>;
|
|
58
|
+
declare function runOnError(plugins: EnginePlugin[], error: Error, context: EnginePluginContext): Promise<void>;
|
|
59
|
+
declare function runBeforeWatch(plugins: EnginePlugin[], context: EngineWatchContext): Promise<void>;
|
|
60
|
+
declare function runAfterWatch(plugins: EnginePlugin[], context: EngineWatchContext): Promise<void>;
|
|
61
|
+
|
|
62
|
+
declare class RuleId {
|
|
63
|
+
readonly value: number;
|
|
64
|
+
constructor(value: number);
|
|
65
|
+
toString(): string;
|
|
66
|
+
}
|
|
67
|
+
declare class SelectorId {
|
|
68
|
+
readonly value: number;
|
|
69
|
+
constructor(value: number);
|
|
70
|
+
toString(): string;
|
|
71
|
+
}
|
|
72
|
+
declare class VariantChainId {
|
|
73
|
+
readonly value: number;
|
|
74
|
+
constructor(value: number);
|
|
75
|
+
toString(): string;
|
|
76
|
+
}
|
|
77
|
+
declare class PropertyId {
|
|
78
|
+
readonly value: number;
|
|
79
|
+
constructor(value: number);
|
|
80
|
+
toString(): string;
|
|
81
|
+
}
|
|
82
|
+
declare class ValueId {
|
|
83
|
+
readonly value: number;
|
|
84
|
+
constructor(value: number);
|
|
85
|
+
toString(): string;
|
|
86
|
+
}
|
|
87
|
+
declare class LayerId {
|
|
88
|
+
readonly value: number;
|
|
89
|
+
constructor(value: number);
|
|
90
|
+
toString(): string;
|
|
91
|
+
}
|
|
92
|
+
declare class ConditionId {
|
|
93
|
+
readonly value: number;
|
|
94
|
+
constructor(value: number);
|
|
95
|
+
toString(): string;
|
|
96
|
+
}
|
|
97
|
+
declare class CascadeResolutionId {
|
|
98
|
+
readonly value: number;
|
|
99
|
+
constructor(value: number);
|
|
100
|
+
toString(): string;
|
|
101
|
+
}
|
|
102
|
+
declare enum Origin {
|
|
103
|
+
UserAgent = 0,
|
|
104
|
+
UserNormal = 1,
|
|
105
|
+
AuthorNormal = 2,
|
|
106
|
+
AuthorImportant = 3,
|
|
107
|
+
UserImportant = 4
|
|
108
|
+
}
|
|
109
|
+
declare enum Importance {
|
|
110
|
+
Normal = 0,
|
|
111
|
+
Important = 1
|
|
112
|
+
}
|
|
113
|
+
declare enum ConditionResult {
|
|
114
|
+
Active = 0,
|
|
115
|
+
Inactive = 1,
|
|
116
|
+
Unknown = 2
|
|
117
|
+
}
|
|
118
|
+
declare enum CascadeStage {
|
|
119
|
+
Origin = 0,
|
|
120
|
+
Layer = 1,
|
|
121
|
+
Importance = 2,
|
|
122
|
+
Specificity = 3,
|
|
123
|
+
Order = 4
|
|
124
|
+
}
|
|
125
|
+
type ResolutionCause = {
|
|
126
|
+
type: "LowerOrigin";
|
|
127
|
+
winnerOrigin: Origin;
|
|
128
|
+
loserOrigin: Origin;
|
|
129
|
+
} | {
|
|
130
|
+
type: "LowerLayer";
|
|
131
|
+
winnerLayer: string;
|
|
132
|
+
loserLayer: string;
|
|
133
|
+
} | {
|
|
134
|
+
type: "LowerImportance";
|
|
135
|
+
} | {
|
|
136
|
+
type: "LowerSpecificity";
|
|
137
|
+
delta: number;
|
|
138
|
+
} | {
|
|
139
|
+
type: "EarlierOrder";
|
|
140
|
+
delta: number;
|
|
141
|
+
} | {
|
|
142
|
+
type: "InactiveCondition";
|
|
143
|
+
condition: string;
|
|
144
|
+
};
|
|
145
|
+
interface ResolutionReason {
|
|
146
|
+
causes: readonly ResolutionCause[];
|
|
147
|
+
finalDecision: string;
|
|
148
|
+
}
|
|
149
|
+
interface SelectorIR {
|
|
150
|
+
id: SelectorId;
|
|
151
|
+
normalized: string;
|
|
152
|
+
specificity: number;
|
|
153
|
+
parts: readonly string[];
|
|
154
|
+
}
|
|
155
|
+
interface VariantChainIR {
|
|
156
|
+
id: VariantChainId;
|
|
157
|
+
chain: readonly VariantChainId[];
|
|
158
|
+
conditionGraphId: number | null;
|
|
159
|
+
}
|
|
160
|
+
interface ConditionIR {
|
|
161
|
+
id: ConditionId;
|
|
162
|
+
conditionType: string;
|
|
163
|
+
expression: string;
|
|
164
|
+
}
|
|
165
|
+
interface RuleIR {
|
|
166
|
+
id: RuleId;
|
|
167
|
+
selector: SelectorId;
|
|
168
|
+
variantChain: VariantChainId;
|
|
169
|
+
property: PropertyId;
|
|
170
|
+
value: ValueId;
|
|
171
|
+
origin: Origin;
|
|
172
|
+
importance: Importance;
|
|
173
|
+
layer: LayerId | null;
|
|
174
|
+
layerOrder: number;
|
|
175
|
+
specificity: number;
|
|
176
|
+
condition: ConditionId | null;
|
|
177
|
+
conditionResult: ConditionResult;
|
|
178
|
+
insertionOrder: number;
|
|
179
|
+
fingerprint: string;
|
|
180
|
+
source: SourceLocation;
|
|
181
|
+
}
|
|
182
|
+
interface PropertyBucketIR {
|
|
183
|
+
property: PropertyId;
|
|
184
|
+
rules: readonly RuleId[];
|
|
185
|
+
}
|
|
186
|
+
interface CascadeResolutionIR {
|
|
187
|
+
id: CascadeResolutionId;
|
|
188
|
+
property: PropertyId;
|
|
189
|
+
winner: RuleId;
|
|
190
|
+
losers: readonly RuleId[];
|
|
191
|
+
reason: ResolutionReason;
|
|
192
|
+
stage: CascadeStage;
|
|
193
|
+
}
|
|
194
|
+
interface StyleGraphIR {
|
|
195
|
+
ruleConflicts: Map<RuleId, readonly RuleId[]>;
|
|
196
|
+
}
|
|
197
|
+
interface FinalComputedStyleIR {
|
|
198
|
+
className: string;
|
|
199
|
+
resolvedProperties: Map<PropertyId, CascadeResolutionId>;
|
|
200
|
+
}
|
|
201
|
+
interface SourceLocation {
|
|
202
|
+
file: string;
|
|
203
|
+
line: number;
|
|
204
|
+
column: number;
|
|
205
|
+
}
|
|
206
|
+
declare function createFingerprint(parts: string[]): string;
|
|
207
|
+
declare function compareCascadeOrder(a: RuleIR, b: RuleIR): number;
|
|
208
|
+
declare function createResolutionReason(causes: ResolutionCause[], finalDecision: string): ResolutionReason;
|
|
209
|
+
|
|
210
|
+
interface ClassBundleInfo {
|
|
211
|
+
className: string;
|
|
212
|
+
usageCount: number;
|
|
213
|
+
usedInFiles: SourceLocation[];
|
|
214
|
+
bundleSize: number;
|
|
215
|
+
componentsAffected: number;
|
|
216
|
+
variantChain: string[];
|
|
217
|
+
isDeadCode: boolean;
|
|
218
|
+
dependencies: string[];
|
|
219
|
+
}
|
|
220
|
+
interface BundleAnalysisResult {
|
|
221
|
+
className: string;
|
|
222
|
+
totalUsage: number;
|
|
223
|
+
files: SourceLocation[];
|
|
224
|
+
bundleSizeBytes: number;
|
|
225
|
+
variantChains: string[];
|
|
226
|
+
isDeadCode: boolean;
|
|
227
|
+
dependencies: string[];
|
|
228
|
+
}
|
|
229
|
+
declare class BundleAnalyzer {
|
|
230
|
+
private classUsages;
|
|
231
|
+
private classCounts;
|
|
232
|
+
analyzeClass(className: string, scanResult: ScanWorkspaceResult, css: string): BundleAnalysisResult;
|
|
233
|
+
analyzeAll(scanResult: ScanWorkspaceResult, css: string): Map<string, BundleAnalysisResult>;
|
|
234
|
+
calculateBundleContribution(className: string, css: string): number;
|
|
235
|
+
detectDeadCode(scanResult: ScanWorkspaceResult, css: string): string[];
|
|
236
|
+
private countClassUsage;
|
|
237
|
+
private getFilesUsingClass;
|
|
238
|
+
private extractVariantChains;
|
|
239
|
+
private extractDependencies;
|
|
240
|
+
private checkIsDeadCode;
|
|
241
|
+
private extractClassesFromCss;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
interface ImpactReport {
|
|
245
|
+
className: string;
|
|
246
|
+
totalComponents: number;
|
|
247
|
+
directUsage: number;
|
|
248
|
+
indirectUsage: number;
|
|
249
|
+
bundleSizeBytes: number;
|
|
250
|
+
estimatedSavings: number;
|
|
251
|
+
riskLevel: "low" | "medium" | "high";
|
|
252
|
+
suggestions: string[];
|
|
253
|
+
}
|
|
254
|
+
interface ComponentImpact {
|
|
255
|
+
file: string;
|
|
256
|
+
line: number;
|
|
257
|
+
column: number;
|
|
258
|
+
usageType: "direct" | "variant" | "component";
|
|
259
|
+
variant?: string;
|
|
260
|
+
}
|
|
261
|
+
declare class ImpactTracker {
|
|
262
|
+
private bundleAnalyzer;
|
|
263
|
+
private criticalPatterns;
|
|
264
|
+
constructor();
|
|
265
|
+
calculateImpact(className: string, bundleAnalysis: BundleAnalysisResult, scanResult: any): ImpactReport;
|
|
266
|
+
findAffectedComponents(className: string, scanResult: any): ComponentImpact[];
|
|
267
|
+
calculateRisk(className: string, impact: ImpactReport): "low" | "medium" | "high";
|
|
268
|
+
generateSuggestions(className: string, impact: ImpactReport): string[];
|
|
269
|
+
private isCriticalClass;
|
|
270
|
+
private calculateSavings;
|
|
271
|
+
private createEmptyReport;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
interface ClassUsage {
|
|
275
|
+
className: string;
|
|
276
|
+
source: SourceLocation;
|
|
277
|
+
specificity: number;
|
|
278
|
+
isOverride: boolean;
|
|
279
|
+
variants: string[];
|
|
280
|
+
}
|
|
281
|
+
interface ReverseLookupResult {
|
|
282
|
+
property: string;
|
|
283
|
+
value: string;
|
|
284
|
+
usedInClasses: ClassUsage[];
|
|
285
|
+
}
|
|
286
|
+
declare class ReverseLookup {
|
|
287
|
+
private parsedCache;
|
|
288
|
+
private parseCSS;
|
|
289
|
+
private findClosingBrace;
|
|
290
|
+
private calculateSpecificity;
|
|
291
|
+
fromCSS(cssProperty: string, cssValue: string, css: string): ReverseLookupResult[];
|
|
292
|
+
fromBundle(className: string, css: string): RuleIR[];
|
|
293
|
+
findDependents(className: string, css: string): string[];
|
|
294
|
+
findByProperty(property: string, css: string): ReverseLookupResult[];
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Apply an incremental file-change event to an existing scan result.
|
|
299
|
+
*
|
|
300
|
+
* Tries Rust processFileChange first for per-file diffing;
|
|
301
|
+
* falls back to the JS implementation when native is unavailable.
|
|
302
|
+
*/
|
|
303
|
+
declare function applyIncrementalChange(previous: ScanWorkspaceResult, filePath: string, type: "change" | "unlink", scanner?: ScanWorkspaceOptions): ScanWorkspaceResult;
|
|
304
|
+
|
|
305
|
+
interface WatcherOptions {
|
|
306
|
+
ignoreDirectories?: string[];
|
|
307
|
+
/**
|
|
308
|
+
* Delay before emitting change event to reduce noisy bursts.
|
|
309
|
+
*/
|
|
310
|
+
debounceMs?: number;
|
|
311
|
+
onError?: (error: Error, directory: string) => void;
|
|
312
|
+
}
|
|
313
|
+
interface WatcherEvent {
|
|
314
|
+
type: "change" | "unlink";
|
|
315
|
+
filePath: string;
|
|
316
|
+
}
|
|
317
|
+
interface WorkspaceWatcher {
|
|
318
|
+
close(): void;
|
|
319
|
+
}
|
|
320
|
+
declare function watchWorkspace$1(rootDir: string, onEvent: (event: WatcherEvent) => void, options?: WatcherOptions): WorkspaceWatcher;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* tailwind-styled-v4 - Rust notify watch backend.
|
|
324
|
+
*
|
|
325
|
+
* Uses native notify when available and falls back to Node fs.watch.
|
|
326
|
+
* Keeps the same public API as watch.ts.
|
|
327
|
+
*/
|
|
328
|
+
interface NativeWatchOptions {
|
|
329
|
+
pollIntervalMs?: number;
|
|
330
|
+
extensions?: string[];
|
|
331
|
+
onError?: (error: Error) => void;
|
|
332
|
+
}
|
|
333
|
+
type WatchEventKind = "add" | "change" | "unlink" | "rename";
|
|
334
|
+
interface WatchEvent {
|
|
335
|
+
kind: WatchEventKind;
|
|
336
|
+
path: string;
|
|
337
|
+
}
|
|
338
|
+
type WatchCallback = (events: WatchEvent[]) => void;
|
|
339
|
+
interface WatchHandle {
|
|
340
|
+
stop(): void;
|
|
341
|
+
engine: string;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Start recursive watch.
|
|
345
|
+
* Callback is polled at `pollIntervalMs` (default 500ms) when events exist.
|
|
346
|
+
*/
|
|
347
|
+
declare function watchWorkspace(rootDir: string, callback: WatchCallback, options?: NativeWatchOptions): WatchHandle;
|
|
348
|
+
|
|
349
|
+
interface EngineOptions {
|
|
350
|
+
root?: string;
|
|
351
|
+
scanner?: ScanWorkspaceOptions;
|
|
352
|
+
compileCss?: boolean;
|
|
353
|
+
tailwindConfigPath?: string;
|
|
354
|
+
plugins?: EnginePlugin[];
|
|
355
|
+
/** Enable analyzer integration - provides semantic report (unused classes, conflicts). Default: false */
|
|
356
|
+
analyze?: boolean;
|
|
357
|
+
}
|
|
358
|
+
interface EngineWatchOptions {
|
|
359
|
+
debounceMs?: number;
|
|
360
|
+
maxEventsPerFlush?: number;
|
|
361
|
+
largeFileThreshold?: number;
|
|
362
|
+
}
|
|
363
|
+
interface BuildResult {
|
|
364
|
+
scan: ScanWorkspaceResult;
|
|
365
|
+
mergedClassList: string;
|
|
366
|
+
css: string;
|
|
367
|
+
/** Analyzer semantic report - present when analyze: true in options */
|
|
368
|
+
analysis?: {
|
|
369
|
+
unusedClasses: unknown[];
|
|
370
|
+
classConflicts: Array<{
|
|
371
|
+
className: string;
|
|
372
|
+
files: string[];
|
|
373
|
+
}>;
|
|
374
|
+
classUsage: Record<string, number>;
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
type EngineBuildWatchEventType = "initial" | "change" | "unlink" | "full-rescan";
|
|
378
|
+
type EngineWatchEvent = {
|
|
379
|
+
type: EngineBuildWatchEventType;
|
|
380
|
+
filePath?: string;
|
|
381
|
+
result: BuildResult;
|
|
382
|
+
metrics?: EngineMetricsSnapshot;
|
|
383
|
+
} | {
|
|
384
|
+
type: "error";
|
|
385
|
+
filePath?: string;
|
|
386
|
+
error: string;
|
|
387
|
+
metrics?: EngineMetricsSnapshot;
|
|
388
|
+
};
|
|
389
|
+
interface TailwindStyledEngine {
|
|
390
|
+
scan(): Promise<ScanWorkspaceResult>;
|
|
391
|
+
build(): Promise<BuildResult>;
|
|
392
|
+
watch(onEvent: (event: EngineWatchEvent) => void, options?: EngineWatchOptions): Promise<{
|
|
393
|
+
close(): void;
|
|
394
|
+
}>;
|
|
395
|
+
}
|
|
396
|
+
declare function createEngine(options?: EngineOptions): Promise<TailwindStyledEngine>;
|
|
397
|
+
|
|
398
|
+
export { type BuildResult, type BundleAnalysisResult, BundleAnalyzer, type CascadeResolutionIR, CascadeResolutionId, CascadeStage, type ClassBundleInfo, type ClassUsage, type ComponentImpact, type ConditionIR, ConditionId, ConditionResult, EngineMetricsCollector, type EngineMetricsSnapshot, type EngineOptions, type EnginePlugin, type EnginePluginContext, type EngineWatchContext, type EngineWatchEvent, type EngineWatchOptions, type FinalComputedStyleIR, type ImpactReport, ImpactTracker, Importance, LayerId, Origin, type PropertyBucketIR, PropertyId, type ResolutionCause, type ResolutionReason, ReverseLookup, type ReverseLookupResult, type RuleIR, RuleId, ScanWorkspaceOptions, ScanWorkspaceResult, type SelectorIR, SelectorId, type SourceLocation, type StyleGraphIR, type TailwindStyledEngine, ValueId, type VariantChainIR, VariantChainId, type WatchCallback, type WatchEvent, type WatchEventKind, type WatchHandle, type WorkspaceWatcher, applyIncrementalChange, compareCascadeOrder, createEngine, createFingerprint, createResolutionReason, runAfterBuild, runAfterScan, runAfterWatch, runBeforeBuild, runBeforeScan, runBeforeWatch, runOnError, runTransformClasses, watchWorkspace$1 as watchWorkspaceLegacy, watchWorkspace as watchWorkspaceNative };
|