windrunner 1.1.2 → 1.1.4
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 +5 -5
- package/dist/index.d.ts +242 -10
- package/dist/index.esm.js +390 -274
- package/dist/index.esm.js.map +7 -0
- package/dist/index.js +392 -274
- package/dist/index.js.map +7 -0
- package/dist/index.min.js +4 -3
- package/dist/react.d.ts +69 -0
- package/dist/react.esm.js +4180 -0
- package/dist/react.esm.js.map +7 -0
- package/dist/react.js +4209 -0
- package/dist/react.js.map +7 -0
- package/package.json +13 -1
package/dist/react.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React integration types for Windrunner
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type { RefObject, Context, ReactNode } from 'react';
|
|
6
|
+
import type { WindrunnerOptions, Runtime } from './index';
|
|
7
|
+
|
|
8
|
+
// ─── Hook Types ───────────────────────────────────────────────────────────────
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Main hook for Windrunner runtime in React apps
|
|
12
|
+
* Creates and manages a Windrunner instance with automatic lifecycle handling
|
|
13
|
+
*/
|
|
14
|
+
export function useWindrunner(options?: WindrunnerOptions): Runtime | null;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Hook for compiling individual class names to CSS
|
|
18
|
+
* Useful for dynamic class generation or server-side rendering prep
|
|
19
|
+
*/
|
|
20
|
+
export function useCompileClass(options?: WindrunnerOptions): (className: string) => string;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Hook for processing and compiling a list of class names
|
|
24
|
+
* Automatically triggers compilation for all classes in the list
|
|
25
|
+
*/
|
|
26
|
+
export function useClassList(
|
|
27
|
+
classList: string | string[],
|
|
28
|
+
options?: WindrunnerOptions
|
|
29
|
+
): string[];
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Hook for scanning a specific element and its children for class names
|
|
33
|
+
* Useful for portals, dynamic content, or third-party components
|
|
34
|
+
*/
|
|
35
|
+
export function useScanElement(
|
|
36
|
+
elementRef: RefObject<HTMLElement>,
|
|
37
|
+
options?: WindrunnerOptions
|
|
38
|
+
): void;
|
|
39
|
+
|
|
40
|
+
// ─── Context Provider Types ───────────────────────────────────────────────────
|
|
41
|
+
|
|
42
|
+
export interface WindrunnerProviderProps extends WindrunnerOptions {
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Optional context provider for Windrunner
|
|
48
|
+
* Useful if you want to share a single Windrunner instance across your app
|
|
49
|
+
*/
|
|
50
|
+
export function WindrunnerProvider(props: WindrunnerProviderProps): JSX.Element;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Hook to access Windrunner instance from context
|
|
54
|
+
* Only works inside WindrunnerProvider
|
|
55
|
+
*/
|
|
56
|
+
export function useWindrunnerContext(): Runtime;
|
|
57
|
+
|
|
58
|
+
// ─── Default Export ───────────────────────────────────────────────────────────
|
|
59
|
+
|
|
60
|
+
declare const reactIntegration: {
|
|
61
|
+
useWindrunner: typeof useWindrunner;
|
|
62
|
+
useCompileClass: typeof useCompileClass;
|
|
63
|
+
useClassList: typeof useClassList;
|
|
64
|
+
useScanElement: typeof useScanElement;
|
|
65
|
+
WindrunnerProvider: typeof WindrunnerProvider;
|
|
66
|
+
useWindrunnerContext: typeof useWindrunnerContext;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default reactIntegration;
|