@master/css-compiler 0.0.0-site.1793659883.g69c9aebcf628

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.
Files changed (80) hide show
  1. package/README.md +466 -0
  2. package/dist/compiler.d.ts +42 -0
  3. package/dist/compiler.js +248 -0
  4. package/dist/contracts.d.ts +31 -0
  5. package/dist/contracts.js +13 -0
  6. package/dist/diagnostics/contracts.d.ts +119 -0
  7. package/dist/diagnostics/contracts.js +1 -0
  8. package/dist/diagnostics/design-system.d.ts +31 -0
  9. package/dist/diagnostics/design-system.js +75 -0
  10. package/dist/diagnostics/index.d.ts +28 -0
  11. package/dist/diagnostics/index.js +304 -0
  12. package/dist/diagnostics/project-comparison.d.ts +4 -0
  13. package/dist/diagnostics/project-comparison.js +8 -0
  14. package/dist/index.d.ts +95 -0
  15. package/dist/index.js +34 -0
  16. package/dist/node-compiler.d.ts +133 -0
  17. package/dist/node-compiler.js +417 -0
  18. package/dist/node-imports.d.ts +54 -0
  19. package/dist/node-imports.js +253 -0
  20. package/dist/node.d.ts +21 -0
  21. package/dist/node.js +47 -0
  22. package/dist/notices.d.ts +5 -0
  23. package/dist/notices.js +29 -0
  24. package/dist/prepared-graph-cache.d.ts +5 -0
  25. package/dist/prepared-graph-cache.js +31 -0
  26. package/dist/project/binding-project.d.ts +29 -0
  27. package/dist/project/binding-project.js +100 -0
  28. package/dist/project/entries.d.ts +7 -0
  29. package/dist/project/entries.js +30 -0
  30. package/dist/project/manifest-sync.d.ts +5 -0
  31. package/dist/project/manifest-sync.js +40 -0
  32. package/dist/project/manifest.d.ts +5 -0
  33. package/dist/project/manifest.js +49 -0
  34. package/dist/project/options.d.ts +43 -0
  35. package/dist/project/options.js +1 -0
  36. package/dist/pure-css-cache.d.ts +11 -0
  37. package/dist/pure-css-cache.js +39 -0
  38. package/dist/session.d.ts +19 -0
  39. package/dist/session.js +46 -0
  40. package/dist/stylesheet/browser.d.ts +32 -0
  41. package/dist/stylesheet/browser.js +71 -0
  42. package/dist/stylesheet/compiled-source.d.ts +11 -0
  43. package/dist/stylesheet/compiled-source.js +96 -0
  44. package/dist/stylesheet/composition-cache.d.ts +18 -0
  45. package/dist/stylesheet/composition-cache.js +79 -0
  46. package/dist/stylesheet/delivery.d.ts +103 -0
  47. package/dist/stylesheet/delivery.js +367 -0
  48. package/dist/stylesheet/directives.d.ts +31 -0
  49. package/dist/stylesheet/directives.js +105 -0
  50. package/dist/stylesheet/index-public.d.ts +3 -0
  51. package/dist/stylesheet/index-public.js +4 -0
  52. package/dist/stylesheet/index.d.ts +39 -0
  53. package/dist/stylesheet/index.js +501 -0
  54. package/dist/stylesheet/linked-stylesheet.d.ts +10 -0
  55. package/dist/stylesheet/linked-stylesheet.js +13 -0
  56. package/dist/stylesheet/output-map.d.ts +20 -0
  57. package/dist/stylesheet/output-map.js +222 -0
  58. package/dist/stylesheet/public.d.ts +171 -0
  59. package/dist/stylesheet/public.js +346 -0
  60. package/dist/stylesheet/reference-files.d.ts +6 -0
  61. package/dist/stylesheet/reference-files.js +13 -0
  62. package/dist/stylesheet/reference-origins.d.ts +4 -0
  63. package/dist/stylesheet/reference-origins.js +28 -0
  64. package/dist/stylesheet/render-core.d.ts +35 -0
  65. package/dist/stylesheet/render-core.js +28 -0
  66. package/dist/stylesheet/render-delivery.d.ts +4 -0
  67. package/dist/stylesheet/render-delivery.js +61 -0
  68. package/dist/stylesheet/render.d.ts +5 -0
  69. package/dist/stylesheet/render.js +31 -0
  70. package/dist/stylesheet/source-context.d.ts +8 -0
  71. package/dist/stylesheet/source-context.js +71 -0
  72. package/dist/stylesheet/source-map-url.d.ts +4 -0
  73. package/dist/stylesheet/source-map-url.js +11 -0
  74. package/dist/stylesheet/source.d.ts +3 -0
  75. package/dist/stylesheet/source.js +52 -0
  76. package/dist/stylesheet/types.d.ts +162 -0
  77. package/dist/stylesheet/types.js +1 -0
  78. package/dist/value-validation.d.ts +19 -0
  79. package/dist/value-validation.js +96 -0
  80. package/package.json +79 -0
@@ -0,0 +1,222 @@
1
+ import { sourceMapBase, sourceMapURL } from "./source-map-url.js";
2
+ import { SourceMap } from "node:module";
3
+ import { fileURLToPath, pathToFileURL } from "node:url";
4
+ // src/stylesheet/output-map.ts
5
+ const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
6
+ function vlq(value) {
7
+ let encoded = "", bits = value < 0 ? -value * 2 + 1 : value * 2;
8
+ do {
9
+ const digit = bits % 32;
10
+ bits = Math.floor(bits / 32);
11
+ encoded += alphabet[digit + (bits ? 32 : 0)];
12
+ } while (bits);
13
+ return encoded;
14
+ }
15
+ function positions(source) {
16
+ const starts = [0];
17
+ for (const match of source.matchAll(/\r\n?|\n/g)) starts.push(match.index + match[0].length);
18
+ return (offset) => {
19
+ let low = 0, high = starts.length;
20
+ while (low < high) {
21
+ const mid = low + high >>> 1;
22
+ if (starts[mid] <= offset) low = mid + 1;
23
+ else high = mid;
24
+ }
25
+ const line = Math.max(0, low - 1);
26
+ return {
27
+ line,
28
+ column: offset - starts[line]
29
+ };
30
+ };
31
+ }
32
+ /** Chain only compiler-provided offsets and host maps. No CSS parsing or matching. */
33
+ function origins(context) {
34
+ let payload, inputMap, invalidMap = false;
35
+ try {
36
+ payload = context.sourceMap ? JSON.parse(context.sourceMap) : void 0;
37
+ inputMap = payload ? new SourceMap(payload) : void 0;
38
+ } catch {
39
+ payload = void 0;
40
+ invalidMap = true;
41
+ }
42
+ const indices = /* @__PURE__ */ new Map();
43
+ const locate = (content, offset) => {
44
+ let index = indices.get(content);
45
+ if (!index) {
46
+ index = positions(content);
47
+ indices.set(content, index);
48
+ }
49
+ return index(offset);
50
+ };
51
+ const preparedLines = context.source.split(/\r\n?|\n/);
52
+ const authoredLines = payload?.sourcesContent?.map((content) => content?.split(/\r\n?|\n/));
53
+ const sourceBase = sourceMapBase(context.file, payload?.sourceRoot);
54
+ return (reference) => {
55
+ let file = reference.file ?? context.compilationFile, offset = reference.range.start;
56
+ if (file === context.compilationFile && context.graph?.sourceMappings) {
57
+ const spans = context.graph.sourceMappings;
58
+ let low = 0, high = spans.length;
59
+ while (low < high) {
60
+ const mid = low + high >>> 1;
61
+ if (spans[mid].generatedStart <= offset) low = mid + 1;
62
+ else high = mid;
63
+ }
64
+ const span = spans[low - 1];
65
+ if (offset >= (span?.generatedEnd ?? 0)) return;
66
+ if (!span?.source.file) return;
67
+ file = span.source.file;
68
+ offset = span.source.range.start + offset - span.generatedStart;
69
+ }
70
+ const content = file === context.file ? context.source : context.graph?.sources[file];
71
+ const point = content !== void 0 ? locate(content, offset) : reference.loc ? {
72
+ line: reference.loc.start.line - 1,
73
+ column: reference.loc.start.column - 1
74
+ } : void 0;
75
+ if (!point) return;
76
+ if (file === context.file && inputMap && payload) {
77
+ const entry = inputMap.findEntry(point.line, point.column);
78
+ if (!("originalSource" in entry) || !entry.originalSource || entry.generatedLine !== point.line) return;
79
+ const originalContent = payload.sourcesContent?.[payload.sources.indexOf(entry.originalSource)] ?? null;
80
+ let column = entry.originalColumn;
81
+ const length = point.column - entry.generatedColumn;
82
+ const prepared = preparedLines[point.line];
83
+ const authored = authoredLines?.[payload.sources.indexOf(entry.originalSource)]?.[entry.originalLine];
84
+ if (length > 0 && prepared !== void 0 && authored !== void 0 && prepared.slice(entry.generatedColumn, point.column) === authored.slice(entry.originalColumn, entry.originalColumn + length)) column += length;
85
+ return {
86
+ source: sourceMapURL(entry.originalSource, sourceBase).href,
87
+ line: entry.originalLine,
88
+ column,
89
+ content: originalContent
90
+ };
91
+ }
92
+ return {
93
+ source: sourceMapURL(file, pathToFileURL(context.file)).href + (invalidMap && file === context.file ? "?master-css-preprocessed" : ""),
94
+ ...point,
95
+ content: content ?? null
96
+ };
97
+ };
98
+ }
99
+ function serializeMap(code, points) {
100
+ const locate = positions(code);
101
+ const sources = [], sourcesContent = [], lines = [];
102
+ const offsets = /* @__PURE__ */ new Map();
103
+ for (const point of points) if (point.origin || !offsets.has(point.offset)) offsets.set(point.offset, point.origin);
104
+ let lastSource = 0, lastLine = 0, lastColumn = 0, generatedLine = -1, generatedColumn = 0;
105
+ for (const [offset, origin] of [...offsets].sort(([a], [b]) => a - b)) {
106
+ if (offset < 0 || offset > code.length) continue;
107
+ const point = locate(offset);
108
+ if (point.line !== generatedLine) {
109
+ generatedLine = point.line;
110
+ generatedColumn = 0;
111
+ }
112
+ while (lines.length <= point.line) lines.push([]);
113
+ const segment = [point.column - generatedColumn];
114
+ generatedColumn = point.column;
115
+ if (origin) {
116
+ let index = sources.indexOf(origin.source);
117
+ if (index === -1) {
118
+ index = sources.length;
119
+ sources.push(origin.source);
120
+ sourcesContent.push(origin.content);
121
+ }
122
+ segment.push(index - lastSource, origin.line - lastLine, origin.column - lastColumn);
123
+ lastSource = index;
124
+ lastLine = origin.line;
125
+ lastColumn = origin.column;
126
+ }
127
+ lines[point.line].push(segment.map(vlq).join(""));
128
+ }
129
+ return JSON.stringify({
130
+ version: 3,
131
+ sources,
132
+ sourcesContent,
133
+ names: [],
134
+ mappings: lines.map((line) => line.join(",")).join(";")
135
+ });
136
+ }
137
+ function stylesheetOutputMap(code, mappings, context, mappedLength = code.length) {
138
+ const origin = origins(context);
139
+ const points = mappings.flatMap((mapping) => [{
140
+ offset: mapping.generatedStart,
141
+ origin: origin(mapping.source)
142
+ }, ...mapping.generatedEnd === void 0 ? [] : [{ offset: mapping.generatedEnd }]]);
143
+ points.push({ offset: mappedLength });
144
+ return serializeMap(code, points);
145
+ }
146
+ /** The concatenation order is supplied by the owning compiler result. */
147
+ function stylesheetOutputMappings(nativeCSS, native = [], generated = []) {
148
+ const shift = nativeCSS.length ? nativeCSS.length + 1 : 0;
149
+ return [...native, ...generated.map((mapping) => ({
150
+ ...mapping,
151
+ generatedStart: mapping.generatedStart + shift,
152
+ generatedEnd: mapping.generatedEnd === void 0 ? void 0 : mapping.generatedEnd + shift
153
+ }))];
154
+ }
155
+ /** Exact graph copies also form the input map for structured lowering errors. */
156
+ function stylesheetInputMap(code, context) {
157
+ const origin = origins(context), points = [];
158
+ for (const span of context.graph?.sourceMappings ?? []) {
159
+ const end = span.generatedEnd ?? span.generatedStart;
160
+ const offsets = [span.generatedStart, ...Array.from(code.slice(span.generatedStart, end).matchAll(/\r\n?|\n/g), (match) => span.generatedStart + match.index + match[0].length)];
161
+ for (const offset of offsets) if (offset < end) points.push({
162
+ offset,
163
+ origin: origin({
164
+ file: context.compilationFile,
165
+ range: {
166
+ start: offset,
167
+ end: offset
168
+ }
169
+ })
170
+ });
171
+ points.push({ offset: end });
172
+ }
173
+ return serializeMap(code, points);
174
+ }
175
+ /** Map validation to the same authoring segments as browser devtools. */
176
+ function stylesheetValidationSource(css, source, sourceMap, mappings) {
177
+ if (!sourceMap) return {
178
+ css,
179
+ source,
180
+ mappings
181
+ };
182
+ let payload, map;
183
+ try {
184
+ payload = JSON.parse(sourceMap);
185
+ map = new SourceMap(payload);
186
+ } catch {
187
+ return {
188
+ css,
189
+ source
190
+ };
191
+ }
192
+ const locate = positions(css);
193
+ return {
194
+ css,
195
+ source,
196
+ locate(range) {
197
+ const start = locate(range.start), end = locate(range.end);
198
+ const entry = map.findEntry(start.line, start.column);
199
+ if (!("originalSource" in entry) || !entry.originalSource || entry.generatedLine !== start.line) return;
200
+ const url = sourceMapURL(entry.originalSource, sourceMapBase(source ?? "/", payload.sourceRoot));
201
+ const file = url.protocol === "file:" ? fileURLToPath(url) : url.href;
202
+ const original = payload.sourcesContent?.[payload.sources.indexOf(entry.originalSource)]?.split(/\r\n?|\n/)[entry.originalLine];
203
+ const generated = css.split(/\r\n?|\n/)[start.line];
204
+ const offset = start.column - entry.generatedColumn, length = end.column - entry.generatedColumn;
205
+ const exact = start.line === end.line && offset >= 0 && length >= offset && original !== void 0 && original.slice(entry.originalColumn, entry.originalColumn + length) === generated.slice(entry.generatedColumn, end.column);
206
+ return {
207
+ source: file,
208
+ range: {
209
+ start: {
210
+ line: entry.originalLine,
211
+ character: entry.originalColumn + (exact ? offset : 0)
212
+ },
213
+ end: {
214
+ line: entry.originalLine,
215
+ character: entry.originalColumn + (exact ? length : 0)
216
+ }
217
+ }
218
+ };
219
+ }
220
+ };
221
+ }
222
+ export { stylesheetInputMap, stylesheetOutputMap, stylesheetOutputMappings, stylesheetValidationSource };
@@ -0,0 +1,171 @@
1
+ import { MasterCSSScanner } from "@master/css-tooling/scanner/node";
2
+ import { MasterCSSManifest } from "@master/css-schema/manifest";
3
+ import { MasterCSSCompileOptions, MasterCSSCompileResult } from "../index.js";
4
+ import { CSSImportFileResolver, CSSImportFileResolver as MasterCSSStylesheetImportResolver, CSSImportSource as MasterCSSStylesheetImportSource } from "../node-imports.js";
5
+ import { StylesheetDeliveryOptions, StylesheetDeliveryOptions as MasterCSSStylesheetDeliveryOptions, StylesheetResourceAsset, StylesheetResourceAsset as MasterCSSStylesheetResourceAsset } from "./delivery.js";
6
+ import { MasterCSSEmittedGlobals } from "@master/css-schema/emitted-globals";
7
+ import { PreparedStylesheetSource as MasterCSSPreparedStylesheet, SassModule, SassModule as MasterCSSSassCompiler, StylesheetPreparationOptions as MasterCSSStylesheetPreparationOptions } from "./types.js";
8
+ import { StylesheetSourceContext } from "./source-context.js";
9
+ import { prepareStylesheetSource as prepareStylesheet } from "./index.js";
10
+ interface MasterCSSStylesheetCompileOptions extends MasterCSSCompileOptions, StylesheetSourceContext {
11
+ /** Absolute definition files applied before authored @reference and local definitions. Does not load their native CSS or scanning policy. */
12
+ readonly referenceFiles?: readonly string[];
13
+ readonly delivery?: StylesheetDeliveryOptions;
14
+ readonly baseManifest: MasterCSSManifest;
15
+ readonly projectDir?: string;
16
+ readonly loadSass?: (projectDir?: string) => SassModule;
17
+ readonly signal?: AbortSignal;
18
+ }
19
+ interface MasterCSSRenderedStylesheetCompileOptions extends MasterCSSStylesheetCompileOptions {
20
+ /** Globals already present outside this render; emit only additional resources. */
21
+ readonly emittedGlobals?: MasterCSSEmittedGlobals;
22
+ }
23
+ interface MasterCSSCompiledStylesheet extends MasterCSSCompileResult {
24
+ readonly entry?: string;
25
+ /** Delivery assets, including the entry. Each map describes its final CSS. */
26
+ readonly stylesheets?: readonly {
27
+ readonly id: string;
28
+ readonly href: string;
29
+ readonly css: string;
30
+ readonly sourceMap: string;
31
+ }[];
32
+ readonly resources?: readonly StylesheetResourceAsset[];
33
+ readonly manifest: MasterCSSManifest;
34
+ readonly emittedGlobals: Required<MasterCSSEmittedGlobals>;
35
+ }
36
+ interface MasterCSSStylesheetTransformResult {
37
+ /** Generated resources retain their original global selectors and conditions. */
38
+ readonly globalStylesheet?: Readonly<{
39
+ css: string;
40
+ sourceMap?: string;
41
+ }>;
42
+ readonly diagnostics: readonly import('@master/css-schema').MasterCSSDiagnostic[];
43
+ readonly sourceMap?: string;
44
+ /** Retained child stylesheets; delivery hosts must publish every returned asset. */
45
+ readonly stylesheets?: readonly {
46
+ readonly id: string;
47
+ readonly href: string;
48
+ readonly css: string;
49
+ }[];
50
+ readonly resources?: readonly StylesheetResourceAsset[];
51
+ readonly code: string;
52
+ readonly dependencies: readonly string[];
53
+ readonly transformed: boolean;
54
+ readonly compilation?: MasterCSSCompileResult;
55
+ }
56
+ interface MasterCSSStylesheetTransformOptions extends MasterCSSStylesheetCompileOptions {
57
+ /** Leave native CSS to its host when it needs no Master CSS resource expansion. */
58
+ readonly preserveUnchangedNativeCSS?: boolean;
59
+ /** Defaults to inline; separate returns globals outside code for scoped hosts. */
60
+ readonly generatedGlobals?: 'inline' | 'separate';
61
+ /** Also resolve resource usage in native CSS using the supplied context. */
62
+ readonly transformNativeStylesheets?: boolean;
63
+ readonly emittedGlobals?: MasterCSSEmittedGlobals;
64
+ }
65
+ interface MasterCSSStylesheetResolutionOptions extends StylesheetSourceContext {
66
+ readonly projectDir?: string;
67
+ /** Classify a prepared graph without flattening its CSS for delivery hosts. */
68
+ readonly preserveImports?: boolean;
69
+ readonly signal?: AbortSignal;
70
+ }
71
+ interface MasterCSSStylesheetDependencyOptions {
72
+ readonly projectDir?: string;
73
+ readonly signal?: AbortSignal;
74
+ }
75
+ interface MasterCSSStylesheetAsyncResolutionOptions extends MasterCSSStylesheetResolutionOptions {
76
+ readonly baseFile?: string;
77
+ readonly resolveImport?: CSSImportFileResolver;
78
+ readonly onDependency?: (file: string) => void;
79
+ }
80
+ type MasterCSSStylesheetKind = 'entry' | 'local' | 'master-package' | 'master-package-entry' | 'plain';
81
+ interface MasterCSSStylesheetResolution {
82
+ readonly id: string;
83
+ readonly kind: MasterCSSStylesheetKind;
84
+ readonly source: string;
85
+ readonly compilationSource: string;
86
+ readonly outputSource: string;
87
+ readonly dependencies: readonly string[];
88
+ }
89
+ interface MasterCSSStylesheetHostOptions {
90
+ readonly masterImport?: string;
91
+ readonly masterSource?: string;
92
+ readonly signal?: AbortSignal;
93
+ }
94
+ interface MasterCSSStylesheetCompositionOptions extends MasterCSSStylesheetCompileOptions {
95
+ /** Compose only these registered source IDs; omitted selects all and an empty list selects none. */
96
+ readonly sourceIds?: readonly string[];
97
+ readonly scanner: MasterCSSScanner;
98
+ readonly manifest?: MasterCSSManifest;
99
+ readonly classes?: readonly string[];
100
+ readonly includeGeneratedCSS?: boolean;
101
+ readonly includeNativeCSS?: boolean;
102
+ readonly includeMasterBaseCSS?: boolean;
103
+ }
104
+ interface MasterCSSStylesheetComposition {
105
+ readonly diagnostics: readonly import('@master/css-schema').MasterCSSDiagnostic[];
106
+ readonly stylesheets?: readonly {
107
+ readonly id: string;
108
+ readonly href: string;
109
+ readonly css: string;
110
+ }[];
111
+ readonly resources?: readonly StylesheetResourceAsset[];
112
+ readonly dependencies?: readonly string[];
113
+ readonly css: string;
114
+ readonly emittedGlobals: Required<MasterCSSEmittedGlobals>;
115
+ }
116
+ interface MasterCSSStylesheetSourceSnapshot {
117
+ readonly id: string;
118
+ readonly source: string;
119
+ readonly dependencies: readonly string[];
120
+ readonly sourceDependencies: readonly string[];
121
+ readonly isMasterCSS: boolean;
122
+ readonly prunesNativeCSS: boolean;
123
+ }
124
+ interface MasterCSSStylesheetCollectionSnapshot {
125
+ readonly size: number;
126
+ readonly sourceIds: readonly string[];
127
+ readonly dependencies: readonly string[];
128
+ readonly sources: readonly MasterCSSStylesheetSourceSnapshot[];
129
+ }
130
+ declare function resolveStylesheetSync(id: string, source: string, options?: MasterCSSStylesheetResolutionOptions): MasterCSSStylesheetResolution | undefined;
131
+ declare function resolveStylesheet(id: string, source: string, options?: MasterCSSStylesheetAsyncResolutionOptions): Promise<MasterCSSStylesheetResolution | undefined>;
132
+ interface MasterCSSStylesheetDependencies {
133
+ /** References are resolved while lowering; this import inventory cannot prove their context unchanged. */
134
+ readonly hasReferences: boolean;
135
+ readonly dependencies: readonly string[];
136
+ readonly edges: readonly Readonly<{
137
+ from: string;
138
+ specifier: string;
139
+ resolved: string;
140
+ }>[];
141
+ }
142
+ /** Resolve the complete delivery graph, including package CSS, without lowering or flattening.
143
+ * Unlike classification-only dependency collection, resolution failures propagate.
144
+ */
145
+ declare function resolveStylesheetDependenciesSync(id: string, source: string, options?: MasterCSSStylesheetDependencyOptions): MasterCSSStylesheetDependencies;
146
+ declare function collectStylesheetDependenciesSync(id: string, source?: string, options?: MasterCSSStylesheetDependencyOptions): readonly string[];
147
+ declare function collectStylesheetDependencies(id: string, source?: string, options?: MasterCSSStylesheetDependencyOptions): Promise<readonly string[]>;
148
+ declare function composeStylesheetHostSync(source: string, options?: MasterCSSStylesheetHostOptions): string;
149
+ declare function composeStylesheetHost(source: string, options?: MasterCSSStylesheetHostOptions): Promise<string>;
150
+ declare function compileStylesheet(id: string, source: string, options: MasterCSSStylesheetCompileOptions): Promise<MasterCSSCompileResult>;
151
+ declare function compileRenderedStylesheet(id: string, source: string, options: MasterCSSRenderedStylesheetCompileOptions): Promise<MasterCSSCompiledStylesheet>;
152
+ declare function collectStylesheetEmittedGlobals(entries: readonly string[], options: MasterCSSStylesheetCompileOptions): Promise<Readonly<{
153
+ emittedGlobals: Required<MasterCSSEmittedGlobals>;
154
+ dependencies: readonly string[];
155
+ }>>;
156
+ declare function transformStylesheet(id: string, source: string, options: MasterCSSStylesheetTransformOptions): Promise<MasterCSSStylesheetTransformResult>;
157
+ declare class MasterCSSStylesheetCollection implements Disposable {
158
+ #private;
159
+ private constructor();
160
+ get size(): number;
161
+ register(scanner: MasterCSSScanner, id: string, source: string, options: MasterCSSStylesheetCompileOptions): Promise<MasterCSSCompileResult>;
162
+ delete(id: string): boolean;
163
+ clear(): void;
164
+ compose(options: MasterCSSStylesheetCompositionOptions): Promise<MasterCSSStylesheetComposition>;
165
+ snapshot(): MasterCSSStylesheetCollectionSnapshot;
166
+ dispose(): void;
167
+ [Symbol.dispose](): void;
168
+ private assertActive;
169
+ }
170
+ declare function createStylesheetCollection(): MasterCSSStylesheetCollection;
171
+ export { MasterCSSCompiledStylesheet, type MasterCSSPreparedStylesheet, MasterCSSRenderedStylesheetCompileOptions, type MasterCSSSassCompiler, MasterCSSStylesheetAsyncResolutionOptions, MasterCSSStylesheetCollection, MasterCSSStylesheetCollectionSnapshot, MasterCSSStylesheetCompileOptions, MasterCSSStylesheetComposition, MasterCSSStylesheetCompositionOptions, type MasterCSSStylesheetDeliveryOptions, MasterCSSStylesheetDependencies, MasterCSSStylesheetDependencyOptions, MasterCSSStylesheetHostOptions, type MasterCSSStylesheetImportResolver, type MasterCSSStylesheetImportSource, MasterCSSStylesheetKind, type MasterCSSStylesheetPreparationOptions, MasterCSSStylesheetResolution, MasterCSSStylesheetResolutionOptions, type MasterCSSStylesheetResourceAsset, MasterCSSStylesheetSourceSnapshot, MasterCSSStylesheetTransformOptions, MasterCSSStylesheetTransformResult, collectStylesheetDependencies, collectStylesheetDependenciesSync, collectStylesheetEmittedGlobals, compileRenderedStylesheet, compileStylesheet, composeStylesheetHost, composeStylesheetHostSync, createStylesheetCollection, prepareStylesheet, resolveStylesheet, resolveStylesheetDependenciesSync, resolveStylesheetSync, transformStylesheet };