windrunner 1.1.0 → 1.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/README.md CHANGED
@@ -42,7 +42,7 @@ npm install windrunner
42
42
 
43
43
  ```html
44
44
  <script type="module">
45
- import { windrunner } from "https://cdn.jsdelivr.net/npm/windrunner@1.0.1/dist/index.min.js";
45
+ import { windrunner } from "https://cdn.jsdelivr.net/npm/windrunner@1.1.2/dist/index.min.js";
46
46
  windrunner({ autoStart: true });
47
47
  </script>
48
48
  ```
@@ -279,7 +279,7 @@ windrunner({ autoStart: true, preflight: false });
279
279
  | Arbitrary values | ✓ | ✓ |
280
280
  | Preflight | ✓ | ✓ |
281
281
  | FOUC prevention | ✓ (onReady) | ✗ |
282
- | Plugins | | ✓ |
282
+ | Plugins | | ✓ |
283
283
  | Full utility coverage | ✓ | ✓ |
284
284
 
285
285
  ## 📚 Documentation
package/dist/index.d.ts CHANGED
@@ -35,10 +35,21 @@ export interface WindrunnerOptions {
35
35
  compatGenerateCss?: (options: Record<string, any>) => string;
36
36
  theme?: Record<string, any>;
37
37
  plugins?: Plugin[];
38
+ maxCacheSize?: number;
38
39
  onReady?: () => void;
40
+ onError?: (className: string) => void;
41
+ onCompile?: (className: string, cssRule: string) => void;
39
42
  [key: string]: any;
40
43
  }
41
44
 
45
+ export interface RuntimeStats {
46
+ cacheSize: number;
47
+ insertedRuleCount: number;
48
+ pendingElementCount: number;
49
+ isObserving: boolean;
50
+ isCompatLoaded: boolean;
51
+ }
52
+
42
53
  export interface Runtime {
43
54
  processClassName(className: string): string | undefined;
44
55
  processClassList(classList: string | string[] | ArrayLike<string>): string[];
@@ -48,6 +59,8 @@ export interface Runtime {
48
59
  flush(): void;
49
60
  start(): void;
50
61
  disconnect(): void;
62
+ clearCache(): void;
63
+ getStats(): RuntimeStats;
51
64
  isCompatLoaded(): boolean;
52
65
  getCacheSize(): number;
53
66
  getInsertedRuleCount(): number;