@tailwindcss/node 0.0.0-insiders.d38554d → 0.0.0-insiders.d4f24c5
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 +6 -10
- package/dist/esm-cache.loader.d.mts +3 -2
- package/dist/esm-cache.loader.mjs +1 -1
- package/dist/index.d.mts +137 -6
- package/dist/index.d.ts +137 -6
- package/dist/index.js +16 -15
- package/dist/index.mjs +16 -15
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
</p>
|
|
14
14
|
|
|
15
15
|
<p align="center">
|
|
16
|
-
<a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci.yml?branch=
|
|
16
|
+
<a href="https://github.com/tailwindlabs/tailwindcss/actions"><img src="https://img.shields.io/github/actions/workflow/status/tailwindlabs/tailwindcss/ci.yml?branch=main" alt="Build Status"></a>
|
|
17
17
|
<a href="https://www.npmjs.com/package/tailwindcss"><img src="https://img.shields.io/npm/dt/tailwindcss.svg" alt="Total Downloads"></a>
|
|
18
|
-
<a href="https://github.com/
|
|
19
|
-
<a href="https://github.com/
|
|
18
|
+
<a href="https://github.com/tailwindlabs/tailwindcss/releases"><img src="https://img.shields.io/npm/v/tailwindcss.svg" alt="Latest Release"></a>
|
|
19
|
+
<a href="https://github.com/tailwindlabs/tailwindcss/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/tailwindcss.svg" alt="License"></a>
|
|
20
20
|
</p>
|
|
21
21
|
|
|
22
22
|
---
|
|
@@ -27,14 +27,10 @@ For full documentation, visit [tailwindcss.com](https://tailwindcss.com).
|
|
|
27
27
|
|
|
28
28
|
## Community
|
|
29
29
|
|
|
30
|
-
For help, discussion about best practices, or
|
|
30
|
+
For help, discussion about best practices, or feature ideas:
|
|
31
31
|
|
|
32
|
-
[Discuss Tailwind CSS on GitHub](https://github.com/
|
|
33
|
-
|
|
34
|
-
For chatting with others using the framework:
|
|
35
|
-
|
|
36
|
-
[Join the Tailwind CSS Discord Server](https://discord.gg/7NF8GNe)
|
|
32
|
+
[Discuss Tailwind CSS on GitHub](https://github.com/tailwindlabs/tailwindcss/discussions)
|
|
37
33
|
|
|
38
34
|
## Contributing
|
|
39
35
|
|
|
40
|
-
If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/
|
|
36
|
+
If you're interested in contributing to Tailwind CSS, please read our [contributing docs](https://github.com/tailwindlabs/tailwindcss/blob/main/.github/CONTRIBUTING.md) **before submitting a pull request**.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isBuiltin as
|
|
1
|
+
import{isBuiltin as p}from"module";var u=async(r,e,t)=>{let o=await t(r,e);return n(e,o)},a=(r,e,t)=>{let o=t(r,e);return n(e,o)};function n(r,e){if(e.url===import.meta.url||p(e.url)||!r.parentURL)return e;let o=new URL(r.parentURL).searchParams.get("id");if(o===null)return e;let l=new URL(e.url);return l.searchParams.set("id",o),{...e,url:`${l}`}}export{u as resolve,a as resolveSync};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { AstNode as AstNode$1 } from './ast';
|
|
1
2
|
import { Candidate, Variant } from './candidate';
|
|
2
3
|
import { compileAstNodes } from './compile';
|
|
3
|
-
import { ClassEntry, VariantEntry } from './intellisense';
|
|
4
|
+
import { ClassEntry, VariantEntry, CanonicalizeOptions } from './intellisense';
|
|
4
5
|
import { Theme } from './theme';
|
|
5
6
|
import { Utilities } from './utilities';
|
|
6
7
|
import { Variants } from './variants';
|
|
8
|
+
import * as tailwindcss from 'tailwindcss';
|
|
7
9
|
import { Polyfills, Features } from 'tailwindcss';
|
|
8
10
|
export { Features, Polyfills } from 'tailwindcss';
|
|
9
11
|
|
|
@@ -14,6 +16,10 @@ declare namespace env {
|
|
|
14
16
|
export { env_DEBUG as DEBUG };
|
|
15
17
|
}
|
|
16
18
|
|
|
19
|
+
declare const enum CompileAstFlags {
|
|
20
|
+
None = 0,
|
|
21
|
+
RespectImportant = 1
|
|
22
|
+
}
|
|
17
23
|
type DesignSystem = {
|
|
18
24
|
theme: Theme;
|
|
19
25
|
utilities: Utilities;
|
|
@@ -25,50 +31,143 @@ type DesignSystem = {
|
|
|
25
31
|
getVariants(): VariantEntry[];
|
|
26
32
|
parseCandidate(candidate: string): Readonly<Candidate>[];
|
|
27
33
|
parseVariant(variant: string): Readonly<Variant> | null;
|
|
28
|
-
compileAstNodes(candidate: Candidate): ReturnType<typeof compileAstNodes>;
|
|
34
|
+
compileAstNodes(candidate: Candidate, flags?: CompileAstFlags): ReturnType<typeof compileAstNodes>;
|
|
29
35
|
printCandidate(candidate: Candidate): string;
|
|
30
36
|
printVariant(variant: Variant): string;
|
|
31
37
|
getVariantOrder(): Map<Variant, number>;
|
|
32
38
|
resolveThemeValue(path: string, forceInline?: boolean): string | undefined;
|
|
33
39
|
trackUsedVariables(raw: string): void;
|
|
40
|
+
canonicalizeCandidates(candidates: string[], options?: CanonicalizeOptions): string[];
|
|
34
41
|
candidatesToCss(classes: string[]): (string | null)[];
|
|
42
|
+
candidatesToAst(classes: string[]): AstNode$1[][];
|
|
43
|
+
storage: Record<symbol, unknown>;
|
|
35
44
|
};
|
|
36
45
|
|
|
46
|
+
/**
|
|
47
|
+
* The source code for one or more nodes in the AST
|
|
48
|
+
*
|
|
49
|
+
* This generally corresponds to a stylesheet
|
|
50
|
+
*/
|
|
51
|
+
interface Source {
|
|
52
|
+
/**
|
|
53
|
+
* The path to the file that contains the referenced source code
|
|
54
|
+
*
|
|
55
|
+
* If this references the *output* source code, this is `null`.
|
|
56
|
+
*/
|
|
57
|
+
file: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* The referenced source code
|
|
60
|
+
*/
|
|
61
|
+
code: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The file and offsets within it that this node covers
|
|
65
|
+
*
|
|
66
|
+
* This can represent either:
|
|
67
|
+
* - A location in the original CSS which caused this node to be created
|
|
68
|
+
* - A location in the output CSS where this node resides
|
|
69
|
+
*/
|
|
70
|
+
type SourceLocation = [source: Source, start: number, end: number];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Line offset tables are the key to generating our source maps. They allow us
|
|
74
|
+
* to store indexes with our AST nodes and later convert them into positions as
|
|
75
|
+
* when given the source that the indexes refer to.
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* A position in source code
|
|
79
|
+
*
|
|
80
|
+
* https://tc39.es/ecma426/#sec-position-record-type
|
|
81
|
+
*/
|
|
82
|
+
interface Position {
|
|
83
|
+
/** The line number, one-based */
|
|
84
|
+
line: number;
|
|
85
|
+
/** The column/character number, one-based */
|
|
86
|
+
column: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface OriginalPosition extends Position {
|
|
90
|
+
source: DecodedSource;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A "decoded" sourcemap
|
|
94
|
+
*
|
|
95
|
+
* @see https://tc39.es/ecma426/#decoded-source-map-record
|
|
96
|
+
*/
|
|
97
|
+
interface DecodedSourceMap {
|
|
98
|
+
file: string | null;
|
|
99
|
+
sources: DecodedSource[];
|
|
100
|
+
mappings: DecodedMapping[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A "decoded" source
|
|
104
|
+
*
|
|
105
|
+
* @see https://tc39.es/ecma426/#decoded-source-record
|
|
106
|
+
*/
|
|
107
|
+
interface DecodedSource {
|
|
108
|
+
url: string | null;
|
|
109
|
+
content: string | null;
|
|
110
|
+
ignore: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A "decoded" mapping
|
|
114
|
+
*
|
|
115
|
+
* @see https://tc39.es/ecma426/#decoded-mapping-record
|
|
116
|
+
*/
|
|
117
|
+
interface DecodedMapping {
|
|
118
|
+
originalPosition: OriginalPosition | null;
|
|
119
|
+
generatedPosition: Position;
|
|
120
|
+
name: string | null;
|
|
121
|
+
}
|
|
122
|
+
|
|
37
123
|
type StyleRule = {
|
|
38
124
|
kind: 'rule';
|
|
39
125
|
selector: string;
|
|
40
126
|
nodes: AstNode[];
|
|
127
|
+
src?: SourceLocation;
|
|
128
|
+
dst?: SourceLocation;
|
|
41
129
|
};
|
|
42
130
|
type AtRule = {
|
|
43
131
|
kind: 'at-rule';
|
|
44
132
|
name: string;
|
|
45
133
|
params: string;
|
|
46
134
|
nodes: AstNode[];
|
|
135
|
+
src?: SourceLocation;
|
|
136
|
+
dst?: SourceLocation;
|
|
47
137
|
};
|
|
48
138
|
type Declaration = {
|
|
49
139
|
kind: 'declaration';
|
|
50
140
|
property: string;
|
|
51
141
|
value: string | undefined;
|
|
52
142
|
important: boolean;
|
|
143
|
+
src?: SourceLocation;
|
|
144
|
+
dst?: SourceLocation;
|
|
53
145
|
};
|
|
54
146
|
type Comment = {
|
|
55
147
|
kind: 'comment';
|
|
56
148
|
value: string;
|
|
149
|
+
src?: SourceLocation;
|
|
150
|
+
dst?: SourceLocation;
|
|
57
151
|
};
|
|
58
152
|
type Context = {
|
|
59
153
|
kind: 'context';
|
|
60
154
|
context: Record<string, string | boolean>;
|
|
61
155
|
nodes: AstNode[];
|
|
156
|
+
src?: undefined;
|
|
157
|
+
dst?: undefined;
|
|
62
158
|
};
|
|
63
159
|
type AtRoot = {
|
|
64
160
|
kind: 'at-root';
|
|
65
161
|
nodes: AstNode[];
|
|
162
|
+
src?: undefined;
|
|
163
|
+
dst?: undefined;
|
|
66
164
|
};
|
|
67
165
|
type AstNode = StyleRule | AtRule | Declaration | Comment | Context | AtRoot;
|
|
68
166
|
|
|
69
167
|
type Resolver = (id: string, base: string) => Promise<string | false | undefined>;
|
|
70
168
|
interface CompileOptions {
|
|
71
169
|
base: string;
|
|
170
|
+
from?: string;
|
|
72
171
|
onDependency: (path: string) => void;
|
|
73
172
|
shouldRewriteUrls?: boolean;
|
|
74
173
|
polyfills?: Polyfills;
|
|
@@ -100,22 +199,30 @@ declare function compile(css: string, options: CompileOptions): Promise<{
|
|
|
100
199
|
} | null;
|
|
101
200
|
features: Features;
|
|
102
201
|
build(candidates: string[]): string;
|
|
202
|
+
buildSourceMap(): tailwindcss.DecodedSourceMap;
|
|
103
203
|
}>;
|
|
104
204
|
declare function __unstable__loadDesignSystem(css: string, { base }: {
|
|
105
205
|
base: string;
|
|
106
206
|
}): Promise<DesignSystem>;
|
|
107
207
|
declare function loadModule(id: string, base: string, onDependency: (path: string) => void, customJsResolver?: Resolver): Promise<{
|
|
208
|
+
path: string;
|
|
108
209
|
base: string;
|
|
109
210
|
module: any;
|
|
110
211
|
}>;
|
|
111
212
|
|
|
112
213
|
declare class Instrumentation implements Disposable {
|
|
113
214
|
#private;
|
|
215
|
+
private shouldReport;
|
|
114
216
|
private defaultFlush;
|
|
115
|
-
constructor(defaultFlush?: (message: string) => undefined);
|
|
217
|
+
constructor(shouldReport?: boolean, defaultFlush?: (message: string) => undefined);
|
|
116
218
|
hit(label: string): void;
|
|
117
219
|
start(label: string): void;
|
|
118
220
|
end(label: string): void;
|
|
221
|
+
track(label: string): {
|
|
222
|
+
[Symbol.dispose]: () => void;
|
|
223
|
+
[Symbol.asyncDispose]: () => void;
|
|
224
|
+
};
|
|
225
|
+
span<T>(label: string, fn: () => T): T;
|
|
119
226
|
reset(): void;
|
|
120
227
|
report(flush?: (message: string) => undefined): void;
|
|
121
228
|
[Symbol.dispose](): void;
|
|
@@ -123,9 +230,33 @@ declare class Instrumentation implements Disposable {
|
|
|
123
230
|
|
|
124
231
|
declare function normalizePath(originalPath: string): string;
|
|
125
232
|
|
|
126
|
-
|
|
233
|
+
interface OptimizeOptions {
|
|
234
|
+
/**
|
|
235
|
+
* The file being transformed
|
|
236
|
+
*/
|
|
127
237
|
file?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Enabled minified output
|
|
240
|
+
*/
|
|
128
241
|
minify?: boolean;
|
|
129
|
-
|
|
242
|
+
/**
|
|
243
|
+
* The output source map before optimization
|
|
244
|
+
*
|
|
245
|
+
* If omitted a resulting source map will not be available
|
|
246
|
+
*/
|
|
247
|
+
map?: string;
|
|
248
|
+
}
|
|
249
|
+
interface TransformResult {
|
|
250
|
+
code: string;
|
|
251
|
+
map: string | undefined;
|
|
252
|
+
}
|
|
253
|
+
declare function optimize(input: string, { file, minify, map }?: OptimizeOptions): TransformResult;
|
|
254
|
+
|
|
255
|
+
interface SourceMap {
|
|
256
|
+
readonly raw: string;
|
|
257
|
+
readonly inline: string;
|
|
258
|
+
comment(url: string): string;
|
|
259
|
+
}
|
|
260
|
+
declare function toSourceMap(map: DecodedSourceMap | string): SourceMap;
|
|
130
261
|
|
|
131
|
-
export { type CompileOptions, Instrumentation, type Resolver, __unstable__loadDesignSystem, compile, compileAst, env, loadModule, normalizePath, optimize };
|
|
262
|
+
export { type CompileOptions, type DecodedSource, type DecodedSourceMap, Instrumentation, type OptimizeOptions, type Resolver, type SourceMap, type TransformResult, __unstable__loadDesignSystem, compile, compileAst, env, loadModule, normalizePath, optimize, toSourceMap };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { AstNode as AstNode$1 } from './ast';
|
|
1
2
|
import { Candidate, Variant } from './candidate';
|
|
2
3
|
import { compileAstNodes } from './compile';
|
|
3
|
-
import { ClassEntry, VariantEntry } from './intellisense';
|
|
4
|
+
import { ClassEntry, VariantEntry, CanonicalizeOptions } from './intellisense';
|
|
4
5
|
import { Theme } from './theme';
|
|
5
6
|
import { Utilities } from './utilities';
|
|
6
7
|
import { Variants } from './variants';
|
|
8
|
+
import * as tailwindcss from 'tailwindcss';
|
|
7
9
|
import { Polyfills, Features } from 'tailwindcss';
|
|
8
10
|
export { Features, Polyfills } from 'tailwindcss';
|
|
9
11
|
|
|
@@ -14,6 +16,10 @@ declare namespace env {
|
|
|
14
16
|
export { env_DEBUG as DEBUG };
|
|
15
17
|
}
|
|
16
18
|
|
|
19
|
+
declare const enum CompileAstFlags {
|
|
20
|
+
None = 0,
|
|
21
|
+
RespectImportant = 1
|
|
22
|
+
}
|
|
17
23
|
type DesignSystem = {
|
|
18
24
|
theme: Theme;
|
|
19
25
|
utilities: Utilities;
|
|
@@ -25,50 +31,143 @@ type DesignSystem = {
|
|
|
25
31
|
getVariants(): VariantEntry[];
|
|
26
32
|
parseCandidate(candidate: string): Readonly<Candidate>[];
|
|
27
33
|
parseVariant(variant: string): Readonly<Variant> | null;
|
|
28
|
-
compileAstNodes(candidate: Candidate): ReturnType<typeof compileAstNodes>;
|
|
34
|
+
compileAstNodes(candidate: Candidate, flags?: CompileAstFlags): ReturnType<typeof compileAstNodes>;
|
|
29
35
|
printCandidate(candidate: Candidate): string;
|
|
30
36
|
printVariant(variant: Variant): string;
|
|
31
37
|
getVariantOrder(): Map<Variant, number>;
|
|
32
38
|
resolveThemeValue(path: string, forceInline?: boolean): string | undefined;
|
|
33
39
|
trackUsedVariables(raw: string): void;
|
|
40
|
+
canonicalizeCandidates(candidates: string[], options?: CanonicalizeOptions): string[];
|
|
34
41
|
candidatesToCss(classes: string[]): (string | null)[];
|
|
42
|
+
candidatesToAst(classes: string[]): AstNode$1[][];
|
|
43
|
+
storage: Record<symbol, unknown>;
|
|
35
44
|
};
|
|
36
45
|
|
|
46
|
+
/**
|
|
47
|
+
* The source code for one or more nodes in the AST
|
|
48
|
+
*
|
|
49
|
+
* This generally corresponds to a stylesheet
|
|
50
|
+
*/
|
|
51
|
+
interface Source {
|
|
52
|
+
/**
|
|
53
|
+
* The path to the file that contains the referenced source code
|
|
54
|
+
*
|
|
55
|
+
* If this references the *output* source code, this is `null`.
|
|
56
|
+
*/
|
|
57
|
+
file: string | null;
|
|
58
|
+
/**
|
|
59
|
+
* The referenced source code
|
|
60
|
+
*/
|
|
61
|
+
code: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The file and offsets within it that this node covers
|
|
65
|
+
*
|
|
66
|
+
* This can represent either:
|
|
67
|
+
* - A location in the original CSS which caused this node to be created
|
|
68
|
+
* - A location in the output CSS where this node resides
|
|
69
|
+
*/
|
|
70
|
+
type SourceLocation = [source: Source, start: number, end: number];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Line offset tables are the key to generating our source maps. They allow us
|
|
74
|
+
* to store indexes with our AST nodes and later convert them into positions as
|
|
75
|
+
* when given the source that the indexes refer to.
|
|
76
|
+
*/
|
|
77
|
+
/**
|
|
78
|
+
* A position in source code
|
|
79
|
+
*
|
|
80
|
+
* https://tc39.es/ecma426/#sec-position-record-type
|
|
81
|
+
*/
|
|
82
|
+
interface Position {
|
|
83
|
+
/** The line number, one-based */
|
|
84
|
+
line: number;
|
|
85
|
+
/** The column/character number, one-based */
|
|
86
|
+
column: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
interface OriginalPosition extends Position {
|
|
90
|
+
source: DecodedSource;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A "decoded" sourcemap
|
|
94
|
+
*
|
|
95
|
+
* @see https://tc39.es/ecma426/#decoded-source-map-record
|
|
96
|
+
*/
|
|
97
|
+
interface DecodedSourceMap {
|
|
98
|
+
file: string | null;
|
|
99
|
+
sources: DecodedSource[];
|
|
100
|
+
mappings: DecodedMapping[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A "decoded" source
|
|
104
|
+
*
|
|
105
|
+
* @see https://tc39.es/ecma426/#decoded-source-record
|
|
106
|
+
*/
|
|
107
|
+
interface DecodedSource {
|
|
108
|
+
url: string | null;
|
|
109
|
+
content: string | null;
|
|
110
|
+
ignore: boolean;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* A "decoded" mapping
|
|
114
|
+
*
|
|
115
|
+
* @see https://tc39.es/ecma426/#decoded-mapping-record
|
|
116
|
+
*/
|
|
117
|
+
interface DecodedMapping {
|
|
118
|
+
originalPosition: OriginalPosition | null;
|
|
119
|
+
generatedPosition: Position;
|
|
120
|
+
name: string | null;
|
|
121
|
+
}
|
|
122
|
+
|
|
37
123
|
type StyleRule = {
|
|
38
124
|
kind: 'rule';
|
|
39
125
|
selector: string;
|
|
40
126
|
nodes: AstNode[];
|
|
127
|
+
src?: SourceLocation;
|
|
128
|
+
dst?: SourceLocation;
|
|
41
129
|
};
|
|
42
130
|
type AtRule = {
|
|
43
131
|
kind: 'at-rule';
|
|
44
132
|
name: string;
|
|
45
133
|
params: string;
|
|
46
134
|
nodes: AstNode[];
|
|
135
|
+
src?: SourceLocation;
|
|
136
|
+
dst?: SourceLocation;
|
|
47
137
|
};
|
|
48
138
|
type Declaration = {
|
|
49
139
|
kind: 'declaration';
|
|
50
140
|
property: string;
|
|
51
141
|
value: string | undefined;
|
|
52
142
|
important: boolean;
|
|
143
|
+
src?: SourceLocation;
|
|
144
|
+
dst?: SourceLocation;
|
|
53
145
|
};
|
|
54
146
|
type Comment = {
|
|
55
147
|
kind: 'comment';
|
|
56
148
|
value: string;
|
|
149
|
+
src?: SourceLocation;
|
|
150
|
+
dst?: SourceLocation;
|
|
57
151
|
};
|
|
58
152
|
type Context = {
|
|
59
153
|
kind: 'context';
|
|
60
154
|
context: Record<string, string | boolean>;
|
|
61
155
|
nodes: AstNode[];
|
|
156
|
+
src?: undefined;
|
|
157
|
+
dst?: undefined;
|
|
62
158
|
};
|
|
63
159
|
type AtRoot = {
|
|
64
160
|
kind: 'at-root';
|
|
65
161
|
nodes: AstNode[];
|
|
162
|
+
src?: undefined;
|
|
163
|
+
dst?: undefined;
|
|
66
164
|
};
|
|
67
165
|
type AstNode = StyleRule | AtRule | Declaration | Comment | Context | AtRoot;
|
|
68
166
|
|
|
69
167
|
type Resolver = (id: string, base: string) => Promise<string | false | undefined>;
|
|
70
168
|
interface CompileOptions {
|
|
71
169
|
base: string;
|
|
170
|
+
from?: string;
|
|
72
171
|
onDependency: (path: string) => void;
|
|
73
172
|
shouldRewriteUrls?: boolean;
|
|
74
173
|
polyfills?: Polyfills;
|
|
@@ -100,22 +199,30 @@ declare function compile(css: string, options: CompileOptions): Promise<{
|
|
|
100
199
|
} | null;
|
|
101
200
|
features: Features;
|
|
102
201
|
build(candidates: string[]): string;
|
|
202
|
+
buildSourceMap(): tailwindcss.DecodedSourceMap;
|
|
103
203
|
}>;
|
|
104
204
|
declare function __unstable__loadDesignSystem(css: string, { base }: {
|
|
105
205
|
base: string;
|
|
106
206
|
}): Promise<DesignSystem>;
|
|
107
207
|
declare function loadModule(id: string, base: string, onDependency: (path: string) => void, customJsResolver?: Resolver): Promise<{
|
|
208
|
+
path: string;
|
|
108
209
|
base: string;
|
|
109
210
|
module: any;
|
|
110
211
|
}>;
|
|
111
212
|
|
|
112
213
|
declare class Instrumentation implements Disposable {
|
|
113
214
|
#private;
|
|
215
|
+
private shouldReport;
|
|
114
216
|
private defaultFlush;
|
|
115
|
-
constructor(defaultFlush?: (message: string) => undefined);
|
|
217
|
+
constructor(shouldReport?: boolean, defaultFlush?: (message: string) => undefined);
|
|
116
218
|
hit(label: string): void;
|
|
117
219
|
start(label: string): void;
|
|
118
220
|
end(label: string): void;
|
|
221
|
+
track(label: string): {
|
|
222
|
+
[Symbol.dispose]: () => void;
|
|
223
|
+
[Symbol.asyncDispose]: () => void;
|
|
224
|
+
};
|
|
225
|
+
span<T>(label: string, fn: () => T): T;
|
|
119
226
|
reset(): void;
|
|
120
227
|
report(flush?: (message: string) => undefined): void;
|
|
121
228
|
[Symbol.dispose](): void;
|
|
@@ -123,9 +230,33 @@ declare class Instrumentation implements Disposable {
|
|
|
123
230
|
|
|
124
231
|
declare function normalizePath(originalPath: string): string;
|
|
125
232
|
|
|
126
|
-
|
|
233
|
+
interface OptimizeOptions {
|
|
234
|
+
/**
|
|
235
|
+
* The file being transformed
|
|
236
|
+
*/
|
|
127
237
|
file?: string;
|
|
238
|
+
/**
|
|
239
|
+
* Enabled minified output
|
|
240
|
+
*/
|
|
128
241
|
minify?: boolean;
|
|
129
|
-
|
|
242
|
+
/**
|
|
243
|
+
* The output source map before optimization
|
|
244
|
+
*
|
|
245
|
+
* If omitted a resulting source map will not be available
|
|
246
|
+
*/
|
|
247
|
+
map?: string;
|
|
248
|
+
}
|
|
249
|
+
interface TransformResult {
|
|
250
|
+
code: string;
|
|
251
|
+
map: string | undefined;
|
|
252
|
+
}
|
|
253
|
+
declare function optimize(input: string, { file, minify, map }?: OptimizeOptions): TransformResult;
|
|
254
|
+
|
|
255
|
+
interface SourceMap {
|
|
256
|
+
readonly raw: string;
|
|
257
|
+
readonly inline: string;
|
|
258
|
+
comment(url: string): string;
|
|
259
|
+
}
|
|
260
|
+
declare function toSourceMap(map: DecodedSourceMap | string): SourceMap;
|
|
130
261
|
|
|
131
|
-
export { type CompileOptions, Instrumentation, type Resolver, __unstable__loadDesignSystem, compile, compileAst, env, loadModule, normalizePath, optimize };
|
|
262
|
+
export { type CompileOptions, type DecodedSource, type DecodedSourceMap, Instrumentation, type OptimizeOptions, type Resolver, type SourceMap, type TransformResult, __unstable__loadDesignSystem, compile, compileAst, env, loadModule, normalizePath, optimize, toSourceMap };
|