tailwind-to-style 2.9.3-beta.0 → 2.10.0-beta.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/dist/index.d.ts CHANGED
@@ -1,7 +1,123 @@
1
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>
2
+ // Project: https://github.com/Bigetion/tailwind-to-style
3
+ // Definitions by: Bigetion
4
4
 
5
+ // Logger types
6
+ export class Logger {
7
+ constructor(level?: 'debug' | 'info' | 'warn' | 'error' | 'silent');
8
+ setLevel(level: 'debug' | 'info' | 'warn' | 'error' | 'silent'): void;
9
+ getLevel(): string;
10
+ debug(message: string, ...args: any[]): void;
11
+ info(message: string, ...args: any[]): void;
12
+ warn(message: string, ...args: any[]): void;
13
+ error(message: string, ...args: any[]): void;
14
+ }
15
+
16
+ export const logger: Logger;
17
+
18
+ // LRU Cache types
19
+ export class LRUCache<K = any, V = any> {
20
+ constructor(maxSize?: number);
21
+ get(key: K): V | undefined;
22
+ set(key: K, value: V): void;
23
+ has(key: K): boolean;
24
+ clear(): void;
25
+ delete(key: K): boolean;
26
+ readonly size: number;
27
+ }
28
+
29
+ // Error handling types
30
+ export class TwsError extends Error {
31
+ constructor(message: string, context?: Record<string, any>);
32
+ context: Record<string, any>;
33
+ timestamp: string;
34
+ }
35
+
36
+ export function onError(handler: (error: TwsError) => void): () => void;
37
+ export function handleError(error: Error, context?: Record<string, any>): TwsError;
38
+
39
+ // Tailwind cache types
40
+ export class TailwindCache {
41
+ getOrGenerate(generateFn: Function, convertFn: Function): any;
42
+ getCssString(): string | null;
43
+ getCssObject(): Record<string, string> | null;
44
+ isInitialized(): boolean;
45
+ reset(): void;
46
+ }
47
+
48
+ export function getTailwindCache(): TailwindCache;
49
+ export function resetTailwindCache(): void;
50
+
51
+ // Configuration and Plugin System
52
+ export interface ThemeExtension {
53
+ colors?: Record<string, string | Record<string, string>>;
54
+ spacing?: Record<string, string>;
55
+ borderRadius?: Record<string, string>;
56
+ fontSize?: Record<string, string>;
57
+ [key: string]: any;
58
+ }
59
+
60
+ export interface TailwindConfig {
61
+ theme?: {
62
+ extend?: ThemeExtension;
63
+ colors?: Record<string, string | Record<string, string>>;
64
+ spacing?: Record<string, string>;
65
+ [key: string]: any;
66
+ };
67
+ plugins?: Plugin[];
68
+ corePlugins?: Record<string, boolean>;
69
+ prefix?: string;
70
+ }
71
+
72
+ export interface Plugin {
73
+ name: string;
74
+ type: string;
75
+ utilities?: Record<string, string | Record<string, string>>;
76
+ components?: Record<string, string | Record<string, string>>;
77
+ handler?: any;
78
+ }
79
+
80
+ export interface UtilityPluginConfig {
81
+ prefix: string;
82
+ values: Record<string, string>;
83
+ formatter: (value: string, key: string) => Record<string, string>;
84
+ }
85
+
86
+ /**
87
+ * Configure tailwind-to-style with custom theme and plugins
88
+ */
89
+ export function configure(config: TailwindConfig): void;
90
+
91
+ /**
92
+ * Get current configuration
93
+ */
94
+ export function getConfig(): TailwindConfig;
95
+
96
+ /**
97
+ * Reset configuration to defaults
98
+ */
99
+ export function resetConfig(): void;
100
+
101
+ /**
102
+ * Create a custom plugin
103
+ */
104
+ export function createPlugin(name: string, definition: {
105
+ utilities?: Record<string, string | Record<string, string>>;
106
+ components?: Record<string, string | Record<string, string>>;
107
+ handler?: Function;
108
+ }): Plugin;
109
+
110
+ /**
111
+ * Create a utility plugin with dynamic values
112
+ */
113
+ export function createUtilityPlugin(name: string, config: UtilityPluginConfig): Plugin;
114
+
115
+ /**
116
+ * Create a variant plugin
117
+ */
118
+ export function createVariantPlugin(name: string, handler: (selector: string) => string): Plugin;
119
+
120
+ // Main function types
5
121
  export interface TwsxOptions {
6
122
  inject?: boolean;
7
123
  [key: string]: any;