tailwind-to-style 2.6.3 → 2.7.1
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 +159 -22
- package/dist/index.browser.js +2172 -1491
- package/dist/index.cjs.js +2172 -1491
- package/dist/index.d.ts +82 -0
- package/dist/index.esm.js +2172 -1492
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Type definitions for tailwind-to-style
|
|
2
|
+
// Project: https://github.com/your-username/tailwind-to-style
|
|
3
|
+
// Definitions by: Your Name <https://github.com/your-username>
|
|
4
|
+
|
|
5
|
+
export interface TwsxOptions {
|
|
6
|
+
inject?: boolean;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface PerformanceStats {
|
|
11
|
+
cacheStats: {
|
|
12
|
+
cssResolution: number;
|
|
13
|
+
configOptions: number;
|
|
14
|
+
parseSelector: number;
|
|
15
|
+
encodeBracket: number;
|
|
16
|
+
decodeBracket: number;
|
|
17
|
+
};
|
|
18
|
+
injectionStats: {
|
|
19
|
+
uniqueStylesheets: number;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface PerformanceUtils {
|
|
24
|
+
getStats(): PerformanceStats;
|
|
25
|
+
clearCaches(): void;
|
|
26
|
+
enablePerformanceLogging(enabled?: boolean): void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface StyleObject {
|
|
30
|
+
[selector: string]: string | StyleObject | Array<string | StyleObject>;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Converts Tailwind CSS classes to inline styles or JSON object
|
|
35
|
+
* @param classNames - String containing Tailwind classes to convert
|
|
36
|
+
* @param convertToJson - If true, returns JSON object, if false returns CSS string
|
|
37
|
+
* @returns CSS inline string or style JSON object
|
|
38
|
+
*/
|
|
39
|
+
export function tws(classNames: string, convertToJson?: false): string;
|
|
40
|
+
export function tws(classNames: string, convertToJson: true): Record<string, string>;
|
|
41
|
+
export function tws(classNames: string, convertToJson?: boolean): string | Record<string, string>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Generates CSS string from style object with SCSS-like syntax
|
|
45
|
+
* Supports nested selectors, state variants, responsive variants, and @css directives
|
|
46
|
+
* @param obj - Object with SCSS-like style format
|
|
47
|
+
* @param options - Additional options
|
|
48
|
+
* @returns Generated CSS string
|
|
49
|
+
*/
|
|
50
|
+
export function twsx(obj: StyleObject, options?: TwsxOptions): string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Debounced version of tws function with performance monitoring
|
|
54
|
+
* @param classNames - String containing Tailwind classes to convert
|
|
55
|
+
* @param convertToJson - If true, returns JSON object, if false returns CSS string
|
|
56
|
+
* @returns CSS inline string or style JSON object
|
|
57
|
+
*/
|
|
58
|
+
export const debouncedTws: typeof tws;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Debounced version of twsx function with performance monitoring
|
|
62
|
+
* @param obj - Object with SCSS-like style format
|
|
63
|
+
* @param options - Additional options
|
|
64
|
+
* @returns Generated CSS string
|
|
65
|
+
*/
|
|
66
|
+
export const debouncedTwsx: typeof twsx;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Performance utilities for debugging and monitoring
|
|
70
|
+
*/
|
|
71
|
+
export const performanceUtils: PerformanceUtils;
|
|
72
|
+
|
|
73
|
+
// Default export (if needed)
|
|
74
|
+
declare const tailwindToStyle: {
|
|
75
|
+
tws: typeof tws;
|
|
76
|
+
twsx: typeof twsx;
|
|
77
|
+
debouncedTws: typeof debouncedTws;
|
|
78
|
+
debouncedTwsx: typeof debouncedTwsx;
|
|
79
|
+
performanceUtils: typeof performanceUtils;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default tailwindToStyle;
|