@styleframe/scanner 3.1.0 → 3.1.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 +23 -0
- package/dist/index.cjs +1 -829
- package/dist/index.d.ts +17 -18
- package/dist/index.js +85 -818
- package/dist/node.cjs +1 -0
- package/dist/node.d.ts +138 -0
- package/dist/node.js +92 -0
- package/dist/watcher-Bn_8hGt2.js +387 -0
- package/dist/watcher-C8V8DPY6.cjs +1 -0
- package/package.json +8 -4
package/dist/index.d.ts
CHANGED
|
@@ -59,24 +59,6 @@ export declare function createChangeHandler(callback: (changedFiles: string[]) =
|
|
|
59
59
|
*/
|
|
60
60
|
export declare function createContentScanner(customExtractors?: Extractor[], utilities?: ScannerUtilitiesConfig): (content: string, filePath?: string) => ParsedUtility[];
|
|
61
61
|
|
|
62
|
-
/**
|
|
63
|
-
* Create a scanner instance for detecting utility classes in content files.
|
|
64
|
-
*
|
|
65
|
-
* @param config Scanner configuration
|
|
66
|
-
* @returns Scanner instance
|
|
67
|
-
*
|
|
68
|
-
* @example
|
|
69
|
-
* ```ts
|
|
70
|
-
* const scanner = createScanner({
|
|
71
|
-
* content: ['./src/components/*.tsx', './src/pages/*.vue'],
|
|
72
|
-
* });
|
|
73
|
-
*
|
|
74
|
-
* const result = await scanner.scan();
|
|
75
|
-
* const matches = scanner.match(result.allParsed, root);
|
|
76
|
-
* ```
|
|
77
|
-
*/
|
|
78
|
-
export declare function createScanner(config: ScannerConfig): Scanner;
|
|
79
|
-
|
|
80
62
|
/**
|
|
81
63
|
* Create a filter function that checks if a utility is in the used set.
|
|
82
64
|
*
|
|
@@ -303,6 +285,23 @@ export declare function parseUtilityClass(className: string): ParsedUtility | nu
|
|
|
303
285
|
*/
|
|
304
286
|
export declare function quickScan(content: string, filePath?: string, utilities?: ScannerUtilitiesConfig): ParsedUtility[];
|
|
305
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Register utility values detected by the scanner that don't yet exist on the root.
|
|
290
|
+
*
|
|
291
|
+
* For non-arbitrary values, uses the factory's autogenerate function (treating the
|
|
292
|
+
* value key as a token reference). For arbitrary values, registers with the literal
|
|
293
|
+
* CSS value directly.
|
|
294
|
+
*
|
|
295
|
+
* Registration happens via `factory.create(...)` on each matched factory, which is
|
|
296
|
+
* already bound to the `root` that produced the matches via `matchUtilities(parsed, root)`.
|
|
297
|
+
* The `root` parameter is part of the signature to document the mutation target.
|
|
298
|
+
*
|
|
299
|
+
* @param root The Styleframe root that will receive the new utilities
|
|
300
|
+
* @param matches Scanner match results produced from this same root
|
|
301
|
+
* @returns Number of newly registered values
|
|
302
|
+
*/
|
|
303
|
+
export declare function registerMatchedUtilities(_root: Root, matches: UtilityMatch[]): number;
|
|
304
|
+
|
|
306
305
|
/**
|
|
307
306
|
* Scanner instance interface
|
|
308
307
|
*/
|