tailwind-styled-v4 5.0.11 → 5.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -4
- package/dist/{analyzeWorkspace-DDOQdzzI.d.ts → analyzeWorkspace-CopJNGmi.d.ts} +2 -0
- package/dist/{analyzeWorkspace-BS5O4rhC.d.mts → analyzeWorkspace-DpVPccjz.d.mts} +2 -0
- package/dist/analyzer.d.mts +4 -4
- package/dist/analyzer.d.ts +4 -4
- package/dist/analyzer.js +34 -69
- package/dist/analyzer.js.map +1 -1
- package/dist/analyzer.mjs +33 -68
- package/dist/analyzer.mjs.map +1 -1
- package/dist/animate.d.mts +4 -0
- package/dist/animate.d.ts +4 -0
- package/dist/animate.js +33 -11
- package/dist/animate.js.map +1 -1
- package/dist/animate.mjs +33 -11
- package/dist/animate.mjs.map +1 -1
- package/dist/atomic.js +57 -6
- package/dist/atomic.js.map +1 -1
- package/dist/atomic.mjs +57 -6
- package/dist/atomic.mjs.map +1 -1
- package/dist/cli.js +404 -190
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +401 -187
- package/dist/cli.mjs.map +1 -1
- package/dist/compiler.d.mts +2700 -212
- package/dist/compiler.d.ts +2700 -212
- package/dist/compiler.js +1996 -503
- package/dist/compiler.js.map +1 -1
- package/dist/compiler.mjs +1847 -448
- package/dist/compiler.mjs.map +1 -1
- package/dist/devtools.js +17 -4
- package/dist/devtools.js.map +1 -1
- package/dist/devtools.mjs +17 -4
- package/dist/devtools.mjs.map +1 -1
- package/dist/engine.d.mts +11 -470
- package/dist/engine.d.ts +11 -470
- package/dist/engine.js +2777 -455
- package/dist/engine.js.map +1 -1
- package/dist/engine.mjs +2776 -454
- package/dist/engine.mjs.map +1 -1
- package/dist/index-BDQw13kn.d.ts +464 -0
- package/dist/index-DJv28Uzq.d.mts +464 -0
- package/dist/index.browser.mjs +143 -255
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.d.mts +23 -39
- package/dist/index.d.ts +23 -39
- package/dist/index.js +7234 -1400
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7234 -1400
- package/dist/index.mjs.map +1 -1
- package/dist/next.d.mts +44 -1
- package/dist/next.d.ts +44 -1
- package/dist/next.js +3224 -1065
- package/dist/next.js.map +1 -1
- package/dist/next.mjs +3223 -1066
- package/dist/next.mjs.map +1 -1
- package/dist/rspack.d.mts +9 -0
- package/dist/rspack.d.ts +9 -0
- package/dist/rspack.js +99 -61
- package/dist/rspack.js.map +1 -1
- package/dist/rspack.mjs +99 -61
- package/dist/rspack.mjs.map +1 -1
- package/dist/runtime-css.d.mts +8 -0
- package/dist/runtime-css.d.ts +8 -0
- package/dist/runtime-css.js +23 -7
- package/dist/runtime-css.js.map +1 -1
- package/dist/runtime-css.mjs +23 -7
- package/dist/runtime-css.mjs.map +1 -1
- package/dist/scanner.js +16 -37
- package/dist/scanner.js.map +1 -1
- package/dist/scanner.mjs +15 -36
- package/dist/scanner.mjs.map +1 -1
- package/dist/shared.d.mts +107 -1
- package/dist/shared.d.ts +107 -1
- package/dist/shared.js +3014 -466
- package/dist/shared.js.map +1 -1
- package/dist/shared.mjs +3008 -445
- package/dist/shared.mjs.map +1 -1
- package/dist/svelte.js +39 -35
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +38 -34
- package/dist/svelte.mjs.map +1 -1
- package/dist/theme.js +85 -76
- package/dist/theme.js.map +1 -1
- package/dist/theme.mjs +83 -74
- package/dist/theme.mjs.map +1 -1
- package/dist/turbopackLoader.js +2351 -187
- package/dist/turbopackLoader.js.map +1 -1
- package/dist/turbopackLoader.mjs +2351 -187
- package/dist/turbopackLoader.mjs.map +1 -1
- package/dist/tw.js +404 -190
- package/dist/tw.js.map +1 -1
- package/dist/tw.mjs +401 -187
- package/dist/tw.mjs.map +1 -1
- package/dist/vite.js +2657 -320
- package/dist/vite.js.map +1 -1
- package/dist/vite.mjs +2657 -320
- package/dist/vite.mjs.map +1 -1
- package/dist/vue.js +39 -35
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +38 -34
- package/dist/vue.mjs.map +1 -1
- package/dist/webpackLoader.js +190 -33
- package/dist/webpackLoader.js.map +1 -1
- package/dist/webpackLoader.mjs +190 -33
- package/dist/webpackLoader.mjs.map +1 -1
- package/native/index.node +0 -0
- package/native/tailwind-styled-native.node +0 -0
- package/native/tailwind-styled-native.win32-x64-msvc.node +0 -0
- package/package.json +9 -4
- package/CHANGELOG.md +0 -285
|
@@ -0,0 +1,464 @@
|
|
|
1
|
+
import { e as AnalyzerSemanticReport, d as AnalyzerReport, h as analyzeWorkspace$1 } from './analyzeWorkspace-DpVPccjz.mjs';
|
|
2
|
+
import { b as ScanWorkspaceResult, a as ScanWorkspaceOptions } from './schemas-DR-SLxZZ.mjs';
|
|
3
|
+
|
|
4
|
+
declare class RuleId {
|
|
5
|
+
readonly value: number;
|
|
6
|
+
constructor(value: number);
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
9
|
+
declare class SelectorId {
|
|
10
|
+
readonly value: number;
|
|
11
|
+
constructor(value: number);
|
|
12
|
+
toString(): string;
|
|
13
|
+
}
|
|
14
|
+
declare class VariantChainId {
|
|
15
|
+
readonly value: number;
|
|
16
|
+
constructor(value: number);
|
|
17
|
+
toString(): string;
|
|
18
|
+
}
|
|
19
|
+
declare class PropertyId {
|
|
20
|
+
readonly value: number;
|
|
21
|
+
readonly name?: string | undefined;
|
|
22
|
+
constructor(value: number, name?: string | undefined);
|
|
23
|
+
toString(): string;
|
|
24
|
+
}
|
|
25
|
+
declare class ValueId {
|
|
26
|
+
readonly value: number;
|
|
27
|
+
readonly name?: string | undefined;
|
|
28
|
+
constructor(value: number, name?: string | undefined);
|
|
29
|
+
toString(): string;
|
|
30
|
+
}
|
|
31
|
+
declare class LayerId {
|
|
32
|
+
readonly value: number;
|
|
33
|
+
constructor(value: number);
|
|
34
|
+
toString(): string;
|
|
35
|
+
}
|
|
36
|
+
declare class ConditionId {
|
|
37
|
+
readonly value: number;
|
|
38
|
+
constructor(value: number);
|
|
39
|
+
toString(): string;
|
|
40
|
+
}
|
|
41
|
+
declare class CascadeResolutionId {
|
|
42
|
+
readonly value: number;
|
|
43
|
+
constructor(value: number);
|
|
44
|
+
toString(): string;
|
|
45
|
+
}
|
|
46
|
+
declare enum Origin {
|
|
47
|
+
UserAgent = 0,
|
|
48
|
+
UserNormal = 1,
|
|
49
|
+
AuthorNormal = 2,
|
|
50
|
+
AuthorImportant = 3,
|
|
51
|
+
UserImportant = 4
|
|
52
|
+
}
|
|
53
|
+
declare enum Importance {
|
|
54
|
+
Normal = 0,
|
|
55
|
+
Important = 1
|
|
56
|
+
}
|
|
57
|
+
declare enum ConditionResult {
|
|
58
|
+
Active = 0,
|
|
59
|
+
Inactive = 1,
|
|
60
|
+
Unknown = 2
|
|
61
|
+
}
|
|
62
|
+
declare enum CascadeStage {
|
|
63
|
+
Origin = 0,
|
|
64
|
+
Layer = 1,
|
|
65
|
+
Importance = 2,
|
|
66
|
+
Specificity = 3,
|
|
67
|
+
Order = 4
|
|
68
|
+
}
|
|
69
|
+
type ResolutionCause = {
|
|
70
|
+
type: "LowerOrigin";
|
|
71
|
+
winnerOrigin: Origin;
|
|
72
|
+
loserOrigin: Origin;
|
|
73
|
+
} | {
|
|
74
|
+
type: "LowerLayer";
|
|
75
|
+
winnerLayer: string;
|
|
76
|
+
loserLayer: string;
|
|
77
|
+
} | {
|
|
78
|
+
type: "LowerImportance";
|
|
79
|
+
} | {
|
|
80
|
+
type: "LowerSpecificity";
|
|
81
|
+
delta: number;
|
|
82
|
+
} | {
|
|
83
|
+
type: "EarlierOrder";
|
|
84
|
+
delta: number;
|
|
85
|
+
} | {
|
|
86
|
+
type: "InactiveCondition";
|
|
87
|
+
condition: string;
|
|
88
|
+
};
|
|
89
|
+
interface ResolutionReason {
|
|
90
|
+
causes: readonly ResolutionCause[];
|
|
91
|
+
finalDecision: string;
|
|
92
|
+
}
|
|
93
|
+
interface SelectorIR {
|
|
94
|
+
id: SelectorId;
|
|
95
|
+
normalized: string;
|
|
96
|
+
specificity: number;
|
|
97
|
+
parts: readonly string[];
|
|
98
|
+
}
|
|
99
|
+
interface VariantChainIR {
|
|
100
|
+
id: VariantChainId;
|
|
101
|
+
chain: readonly VariantChainId[];
|
|
102
|
+
conditionGraphId: number | null;
|
|
103
|
+
}
|
|
104
|
+
interface ConditionIR {
|
|
105
|
+
id: ConditionId;
|
|
106
|
+
conditionType: string;
|
|
107
|
+
expression: string;
|
|
108
|
+
}
|
|
109
|
+
interface RuleIR {
|
|
110
|
+
id: RuleId;
|
|
111
|
+
selector: SelectorId;
|
|
112
|
+
variantChain: VariantChainId;
|
|
113
|
+
property: PropertyId;
|
|
114
|
+
value: ValueId;
|
|
115
|
+
origin: Origin;
|
|
116
|
+
importance: Importance;
|
|
117
|
+
layer: LayerId | null;
|
|
118
|
+
layerOrder: number;
|
|
119
|
+
specificity: number;
|
|
120
|
+
condition: ConditionId | null;
|
|
121
|
+
conditionResult: ConditionResult;
|
|
122
|
+
insertionOrder: number;
|
|
123
|
+
fingerprint: string;
|
|
124
|
+
source: SourceLocation;
|
|
125
|
+
}
|
|
126
|
+
interface PropertyBucketIR {
|
|
127
|
+
property: PropertyId;
|
|
128
|
+
rules: readonly RuleId[];
|
|
129
|
+
}
|
|
130
|
+
interface CascadeResolutionIR {
|
|
131
|
+
id: CascadeResolutionId;
|
|
132
|
+
property: PropertyId;
|
|
133
|
+
winner: RuleId;
|
|
134
|
+
losers: readonly RuleId[];
|
|
135
|
+
reason: ResolutionReason;
|
|
136
|
+
stage: CascadeStage;
|
|
137
|
+
}
|
|
138
|
+
interface StyleGraphIR {
|
|
139
|
+
ruleConflicts: Map<RuleId, readonly RuleId[]>;
|
|
140
|
+
}
|
|
141
|
+
interface FinalComputedStyleIR {
|
|
142
|
+
className: string;
|
|
143
|
+
resolvedProperties: Map<PropertyId, CascadeResolutionId>;
|
|
144
|
+
}
|
|
145
|
+
interface SourceLocation {
|
|
146
|
+
file: string;
|
|
147
|
+
line: number;
|
|
148
|
+
column: number;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Generate a short fingerprint string from a list of ordered parts.
|
|
152
|
+
* Native-only: delegates to Rust `create_fingerprint()` (FNV-1a, base-36 output).
|
|
153
|
+
*/
|
|
154
|
+
declare function createFingerprint(parts: string[]): string;
|
|
155
|
+
declare function createResolutionReason(causes: ResolutionCause[], finalDecision: string): ResolutionReason;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* tailwind-styled-v4 — Cascade Resolver
|
|
159
|
+
*
|
|
160
|
+
* JS layer: state management (rule collection, class registration).
|
|
161
|
+
* Rust layer: cascade algorithm (sort, compare, resolve winner/loser).
|
|
162
|
+
*
|
|
163
|
+
* Moved to native: compareCascade, resolveProperty, buildResolutionReason,
|
|
164
|
+
* determineCascadeStage — all pure computation, zero browser API.
|
|
165
|
+
*
|
|
166
|
+
* Rust #[napi] fn: resolve_cascade(rules_json: String) -> String
|
|
167
|
+
*/
|
|
168
|
+
|
|
169
|
+
declare class CascadeResolver {
|
|
170
|
+
private readonly rules;
|
|
171
|
+
private readonly classRules;
|
|
172
|
+
private readonly styleGraph;
|
|
173
|
+
addRule(rule: RuleIR): void;
|
|
174
|
+
addRules(rules: RuleIR[]): void;
|
|
175
|
+
registerClass(className: string, ruleIds: RuleId[]): void;
|
|
176
|
+
getRule(ruleId: RuleId): RuleIR | undefined;
|
|
177
|
+
getClassRules(className: string): RuleId[] | undefined;
|
|
178
|
+
getStyleGraph(): StyleGraphIR;
|
|
179
|
+
/**
|
|
180
|
+
* Resolve cascade for a specific class.
|
|
181
|
+
* Delegates sort + winner selection to Rust.
|
|
182
|
+
*/
|
|
183
|
+
resolveByClassName(className: string): {
|
|
184
|
+
resolvedProperties: Map<PropertyId, CascadeResolutionIR>;
|
|
185
|
+
} | null;
|
|
186
|
+
/**
|
|
187
|
+
* Resolve cascade for all rules.
|
|
188
|
+
* Delegates sort + winner selection to Rust.
|
|
189
|
+
*/
|
|
190
|
+
resolveAllProperties(): Map<PropertyId, CascadeResolutionIR>;
|
|
191
|
+
/**
|
|
192
|
+
* Resolve cascade for a specific set of rule IDs.
|
|
193
|
+
*/
|
|
194
|
+
resolveForClass(classRuleIds: RuleId[]): Map<PropertyId, CascadeResolutionIR>;
|
|
195
|
+
/**
|
|
196
|
+
* Resolve cascade for a single property bucket.
|
|
197
|
+
*/
|
|
198
|
+
resolveProperty(property: PropertyId): CascadeResolutionIR | null;
|
|
199
|
+
getResolution(_id: CascadeResolutionId): CascadeResolutionIR | undefined;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* tailwind-styled-v4 — Cascade Tracer
|
|
204
|
+
*
|
|
205
|
+
* Delegates cascade resolution to CascadeResolver (Rust-backed).
|
|
206
|
+
* JS layer: format trace output only.
|
|
207
|
+
*
|
|
208
|
+
* Removed from JS: resolvePropertyTraced, compareCascadeTraced,
|
|
209
|
+
* buildResolutionReasonTraced, determineCascadeStageTraced.
|
|
210
|
+
*/
|
|
211
|
+
|
|
212
|
+
interface VariantTrace {
|
|
213
|
+
name: string;
|
|
214
|
+
value: string;
|
|
215
|
+
source: SourceLocation;
|
|
216
|
+
}
|
|
217
|
+
interface RuleTrace {
|
|
218
|
+
property: string;
|
|
219
|
+
value: string;
|
|
220
|
+
applied: boolean;
|
|
221
|
+
reason: string | null;
|
|
222
|
+
source: SourceLocation;
|
|
223
|
+
specificity: number;
|
|
224
|
+
}
|
|
225
|
+
interface ConflictTrace {
|
|
226
|
+
property: string;
|
|
227
|
+
winner: string;
|
|
228
|
+
loser: string;
|
|
229
|
+
stage: string;
|
|
230
|
+
causes: string[];
|
|
231
|
+
}
|
|
232
|
+
interface FinalStyleProperty {
|
|
233
|
+
property: string;
|
|
234
|
+
value: string;
|
|
235
|
+
}
|
|
236
|
+
interface TraceResult {
|
|
237
|
+
class: string;
|
|
238
|
+
definedAt: SourceLocation;
|
|
239
|
+
variants: VariantTrace[];
|
|
240
|
+
rules: RuleTrace[];
|
|
241
|
+
conflicts: ConflictTrace[];
|
|
242
|
+
finalStyle: FinalStyleProperty[];
|
|
243
|
+
}
|
|
244
|
+
interface ProvenanceData {
|
|
245
|
+
className: string;
|
|
246
|
+
source: SourceLocation;
|
|
247
|
+
variants: Map<string, VariantTrace>;
|
|
248
|
+
rules: Map<string, RuleIR[]>;
|
|
249
|
+
}
|
|
250
|
+
declare function buildProvenanceChain(className: string): ProvenanceData;
|
|
251
|
+
declare function trace(className: string, resolver: CascadeResolver): TraceResult;
|
|
252
|
+
|
|
253
|
+
interface EngineMetricsSnapshot {
|
|
254
|
+
eventsReceived: number;
|
|
255
|
+
eventsProcessed: number;
|
|
256
|
+
batchesProcessed: number;
|
|
257
|
+
incrementalUpdates: number;
|
|
258
|
+
fullRescans: number;
|
|
259
|
+
skippedLargeFiles: number;
|
|
260
|
+
queueMaxSize: number;
|
|
261
|
+
lastBuildMs: number;
|
|
262
|
+
avgBuildMs: number;
|
|
263
|
+
}
|
|
264
|
+
declare class EngineMetricsCollector {
|
|
265
|
+
private eventsReceived;
|
|
266
|
+
private eventsProcessed;
|
|
267
|
+
private batchesProcessed;
|
|
268
|
+
private incrementalUpdates;
|
|
269
|
+
private fullRescans;
|
|
270
|
+
private skippedLargeFiles;
|
|
271
|
+
private queueMaxSize;
|
|
272
|
+
private lastBuildMs;
|
|
273
|
+
private totalBuildMs;
|
|
274
|
+
markEventReceived(queueSize: number): void;
|
|
275
|
+
markBatchProcessed(batchSize: number): void;
|
|
276
|
+
markIncremental(): void;
|
|
277
|
+
markFullRescan(): void;
|
|
278
|
+
markSkippedLargeFile(): void;
|
|
279
|
+
markBuildDuration(ms: number): void;
|
|
280
|
+
snapshot(): EngineMetricsSnapshot;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
interface EnginePluginContext {
|
|
284
|
+
root: string;
|
|
285
|
+
timestamp: number;
|
|
286
|
+
}
|
|
287
|
+
interface EngineWatchContext {
|
|
288
|
+
root: string;
|
|
289
|
+
timestamp: number;
|
|
290
|
+
}
|
|
291
|
+
interface EnginePlugin {
|
|
292
|
+
name: string;
|
|
293
|
+
beforeScan?(context: EnginePluginContext): void | Promise<void>;
|
|
294
|
+
afterScan?(scan: ScanWorkspaceResult, context: EnginePluginContext): ScanWorkspaceResult | undefined | Promise<ScanWorkspaceResult | undefined>;
|
|
295
|
+
transformClasses?(classes: string[], context: EnginePluginContext): string[] | undefined | Promise<string[] | undefined>;
|
|
296
|
+
beforeBuild?(scan: ScanWorkspaceResult, context: EnginePluginContext): void | Promise<void>;
|
|
297
|
+
afterBuild?(result: BuildResult, context: EnginePluginContext): BuildResult | undefined | Promise<BuildResult | undefined>;
|
|
298
|
+
onError?(error: Error, context: EnginePluginContext): void | Promise<void>;
|
|
299
|
+
beforeWatch?(context: EngineWatchContext): void | Promise<void>;
|
|
300
|
+
afterWatch?(context: EngineWatchContext): void | Promise<void>;
|
|
301
|
+
}
|
|
302
|
+
declare function runBeforeScan(plugins: EnginePlugin[], context: EnginePluginContext): Promise<void>;
|
|
303
|
+
declare function runAfterScan(plugins: EnginePlugin[], scan: ScanWorkspaceResult, context: EnginePluginContext): Promise<ScanWorkspaceResult>;
|
|
304
|
+
declare function runTransformClasses(plugins: EnginePlugin[], classes: string[], context: EnginePluginContext): Promise<string[]>;
|
|
305
|
+
declare function runBeforeBuild(plugins: EnginePlugin[], scan: ScanWorkspaceResult, context: EnginePluginContext): Promise<void>;
|
|
306
|
+
declare function runAfterBuild(plugins: EnginePlugin[], result: BuildResult, context: EnginePluginContext): Promise<BuildResult>;
|
|
307
|
+
declare function runOnError(plugins: EnginePlugin[], error: Error, context: EnginePluginContext): Promise<void>;
|
|
308
|
+
declare function runBeforeWatch(plugins: EnginePlugin[], context: EngineWatchContext): Promise<void>;
|
|
309
|
+
declare function runAfterWatch(plugins: EnginePlugin[], context: EngineWatchContext): Promise<void>;
|
|
310
|
+
|
|
311
|
+
interface EngineOptions {
|
|
312
|
+
root?: string;
|
|
313
|
+
scanner?: ScanWorkspaceOptions;
|
|
314
|
+
compileCss?: boolean;
|
|
315
|
+
tailwindConfigPath?: string;
|
|
316
|
+
plugins?: EnginePlugin[];
|
|
317
|
+
/** Enable analyzer integration - provides semantic report (unused classes, conflicts). Default: false */
|
|
318
|
+
analyze?: boolean;
|
|
319
|
+
}
|
|
320
|
+
interface EngineWatchOptions {
|
|
321
|
+
debounceMs?: number;
|
|
322
|
+
maxEventsPerFlush?: number;
|
|
323
|
+
largeFileThreshold?: number;
|
|
324
|
+
}
|
|
325
|
+
interface BuildResult {
|
|
326
|
+
scan: ScanWorkspaceResult;
|
|
327
|
+
mergedClassList: string;
|
|
328
|
+
css: string;
|
|
329
|
+
/** Analyzer semantic report - present when analyze: true in options */
|
|
330
|
+
analysis?: {
|
|
331
|
+
unusedClasses: string[];
|
|
332
|
+
classConflicts: Array<{
|
|
333
|
+
className: string;
|
|
334
|
+
files: string[];
|
|
335
|
+
classes?: string[];
|
|
336
|
+
message?: string;
|
|
337
|
+
}>;
|
|
338
|
+
classUsage: Record<string, number>;
|
|
339
|
+
semantic?: AnalyzerSemanticReport;
|
|
340
|
+
report: AnalyzerReport;
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
type EngineBuildWatchEventType = "initial" | "change" | "unlink" | "full-rescan";
|
|
344
|
+
type EngineWatchEvent = {
|
|
345
|
+
type: EngineBuildWatchEventType;
|
|
346
|
+
filePath?: string;
|
|
347
|
+
result: BuildResult;
|
|
348
|
+
metrics?: EngineMetricsSnapshot;
|
|
349
|
+
} | {
|
|
350
|
+
type: "error";
|
|
351
|
+
filePath?: string;
|
|
352
|
+
error: string;
|
|
353
|
+
metrics?: EngineMetricsSnapshot;
|
|
354
|
+
};
|
|
355
|
+
interface TailwindStyledEngine {
|
|
356
|
+
scan(): Promise<ScanWorkspaceResult>;
|
|
357
|
+
scanWorkspace(): Promise<ScanWorkspaceResult>;
|
|
358
|
+
analyzeWorkspace(): Promise<Awaited<ReturnType<typeof analyzeWorkspace$1>>>;
|
|
359
|
+
generateSafelist(): Promise<string[]>;
|
|
360
|
+
build(): Promise<BuildResult>;
|
|
361
|
+
watch(onEvent: (event: EngineWatchEvent) => void, options?: EngineWatchOptions): Promise<{
|
|
362
|
+
close(): void;
|
|
363
|
+
}>;
|
|
364
|
+
}
|
|
365
|
+
declare function createEngine(rawOptions?: EngineOptions): Promise<TailwindStyledEngine>;
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* Scan workspace dan return hasil scan.
|
|
369
|
+
* Facade tipis di atas scanWorkspaceAsync dari @tailwind-styled/scanner.
|
|
370
|
+
*
|
|
371
|
+
* @example
|
|
372
|
+
* const result = await scanWorkspace({ root: "./src" })
|
|
373
|
+
* console.log(result.uniqueClasses)
|
|
374
|
+
*/
|
|
375
|
+
declare function scanWorkspace(opts?: {
|
|
376
|
+
root?: string;
|
|
377
|
+
extensions?: string[];
|
|
378
|
+
ignoreDirectories?: string[];
|
|
379
|
+
}): Promise<ScanWorkspaceResult>;
|
|
380
|
+
/**
|
|
381
|
+
* Analyze workspace — scan + analyze classes.
|
|
382
|
+
* Facade di atas runWorkspaceAnalysis.
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* const report = await analyzeWorkspace({ root: "./src" })
|
|
386
|
+
* console.log(report.topClasses)
|
|
387
|
+
*/
|
|
388
|
+
declare function analyzeWorkspace(opts?: {
|
|
389
|
+
root?: string;
|
|
390
|
+
top?: number;
|
|
391
|
+
}): Promise<Awaited<ReturnType<typeof analyzeWorkspace$1>>>;
|
|
392
|
+
/**
|
|
393
|
+
* Generate safelist dari scan result.
|
|
394
|
+
* Berguna untuk Tailwind config safelist generation.
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* const safelist = await generateSafelist({ root: "./src" })
|
|
398
|
+
* // Pakai di tailwind.config.ts: { safelist }
|
|
399
|
+
*/
|
|
400
|
+
declare function generateSafelist(opts?: {
|
|
401
|
+
root?: string;
|
|
402
|
+
}): Promise<string[]>;
|
|
403
|
+
/**
|
|
404
|
+
* Build CSS dari scan result.
|
|
405
|
+
* One-shot build tanpa watch mode.
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
* const result = await build({ root: "./src" })
|
|
409
|
+
* fs.writeFileSync("dist/tailwind.css", result.css)
|
|
410
|
+
*/
|
|
411
|
+
declare function build(opts?: EngineOptions): Promise<{
|
|
412
|
+
css: string;
|
|
413
|
+
classes: string[];
|
|
414
|
+
totalFiles: number;
|
|
415
|
+
}>;
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* High-level trace API — satu entry point untuk semua tooling.
|
|
419
|
+
*
|
|
420
|
+
* Dipakai oleh:
|
|
421
|
+
* - CLI: `tw trace <class>`
|
|
422
|
+
* - DevTools: TracePanel fetch
|
|
423
|
+
* - Dashboard: trace endpoint
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* const result = await traceClass("flex", scanResult, cssString)
|
|
427
|
+
* console.log(result.finalStyle) // [{ property: "display", value: "flex" }]
|
|
428
|
+
*/
|
|
429
|
+
declare function traceClass(className: string, scanResult: ScanWorkspaceResult, css: string): Promise<TraceResult | null>;
|
|
430
|
+
/**
|
|
431
|
+
* Trace multiple classes at once — for batch inspection.
|
|
432
|
+
*/
|
|
433
|
+
declare function traceClasses(classNames: string[], scanResult: ScanWorkspaceResult, css: string): Promise<Map<string, TraceResult>>;
|
|
434
|
+
interface InspectionReport {
|
|
435
|
+
className: string;
|
|
436
|
+
/** CSS rules yang dihasilkan */
|
|
437
|
+
css: string;
|
|
438
|
+
/** Properties yang di-set */
|
|
439
|
+
properties: Array<{
|
|
440
|
+
property: string;
|
|
441
|
+
value: string;
|
|
442
|
+
}>;
|
|
443
|
+
/** Classes yang berkonflik dengan ini */
|
|
444
|
+
conflicts: string[];
|
|
445
|
+
/** Files yang menggunakan class ini */
|
|
446
|
+
usedIn: string[];
|
|
447
|
+
/** Risk level untuk removal */
|
|
448
|
+
risk: "low" | "medium" | "high";
|
|
449
|
+
/** Estimated bundle contribution */
|
|
450
|
+
bundleBytes: number;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Inspect a single class — gabungan trace + impact + usage.
|
|
454
|
+
* Reusable surface untuk CLI (`tw why`), DevTools panel, dashboard endpoint.
|
|
455
|
+
*
|
|
456
|
+
* @example
|
|
457
|
+
* const report = await inspectClass("flex", scanResult, cssString)
|
|
458
|
+
* console.log(report.properties) // [{ property: "display", value: "flex" }]
|
|
459
|
+
* console.log(report.usedIn) // ["src/Button.tsx", "src/Card.tsx"]
|
|
460
|
+
* console.log(report.risk) // "low"
|
|
461
|
+
*/
|
|
462
|
+
declare function inspectClass(className: string, scanResult: ScanWorkspaceResult, css?: string): Promise<InspectionReport>;
|
|
463
|
+
|
|
464
|
+
export { runBeforeWatch as $, VariantChainId as A, type BuildResult as B, type CascadeResolutionIR as C, type VariantTrace as D, type EnginePlugin as E, type FinalComputedStyleIR as F, analyzeWorkspace as G, build as H, Importance as I, buildProvenanceChain as J, createEngine as K, LayerId as L, createFingerprint as M, createResolutionReason as N, Origin as O, type PropertyBucketIR as P, generateSafelist as Q, type RuleIR as R, type SourceLocation as S, type TailwindStyledEngine as T, inspectClass as U, ValueId as V, runAfterBuild as W, runAfterScan as X, runAfterWatch as Y, runBeforeBuild as Z, runBeforeScan as _, RuleId as a, runOnError as a0, runTransformClasses as a1, scanWorkspace as a2, trace as a3, traceClass as a4, traceClasses as a5, CascadeResolutionId as b, CascadeResolver as c, CascadeStage as d, type ConditionIR as e, ConditionId as f, ConditionResult as g, type ConflictTrace as h, EngineMetricsCollector as i, type EngineMetricsSnapshot as j, type EngineOptions as k, type EnginePluginContext as l, type EngineWatchContext as m, type EngineWatchEvent as n, type EngineWatchOptions as o, type FinalStyleProperty as p, type InspectionReport as q, PropertyId as r, type ResolutionCause as s, type ResolutionReason as t, type RuleTrace as u, type SelectorIR as v, SelectorId as w, type StyleGraphIR as x, type TraceResult as y, type VariantChainIR as z };
|