svger-cli 2.0.1 → 2.0.3

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.
Files changed (91) hide show
  1. package/.svgerconfig.example.json +38 -0
  2. package/CHANGELOG.md +64 -0
  3. package/DEVELOPMENT.md +353 -0
  4. package/README.md +24 -5
  5. package/SECURITY.md +69 -0
  6. package/dist/builder.js +16 -16
  7. package/dist/clean.js +2 -2
  8. package/dist/cli.js +38 -38
  9. package/dist/config.js +11 -11
  10. package/dist/core/error-handler.d.ts +63 -0
  11. package/dist/core/error-handler.js +227 -0
  12. package/dist/core/framework-templates.d.ts +17 -0
  13. package/{src/core/framework-templates.ts → dist/core/framework-templates.js} +104 -139
  14. package/dist/core/logger.d.ts +22 -0
  15. package/dist/core/logger.js +85 -0
  16. package/dist/core/performance-engine.d.ts +67 -0
  17. package/dist/core/performance-engine.js +252 -0
  18. package/dist/core/plugin-manager.d.ts +56 -0
  19. package/dist/core/plugin-manager.js +191 -0
  20. package/dist/core/style-compiler.d.ts +88 -0
  21. package/dist/core/style-compiler.js +468 -0
  22. package/dist/core/template-manager.d.ts +64 -0
  23. package/{src/core/template-manager.ts → dist/core/template-manager.js} +172 -255
  24. package/dist/index.d.ts +153 -0
  25. package/{src/index.ts → dist/index.js} +32 -110
  26. package/dist/lock.js +7 -7
  27. package/dist/processors/svg-processor.d.ts +73 -0
  28. package/dist/processors/svg-processor.js +261 -0
  29. package/dist/services/config.d.ts +55 -0
  30. package/dist/services/config.js +211 -0
  31. package/dist/services/file-watcher.d.ts +54 -0
  32. package/dist/services/file-watcher.js +180 -0
  33. package/dist/services/svg-service.d.ts +81 -0
  34. package/dist/services/svg-service.js +395 -0
  35. package/dist/templates/ComponentTemplate.js +25 -25
  36. package/dist/types/index.d.ts +146 -0
  37. package/dist/types/index.js +4 -0
  38. package/dist/utils/native.d.ts +104 -0
  39. package/dist/utils/native.js +340 -0
  40. package/dist/watch.d.ts +1 -1
  41. package/dist/watch.js +14 -14
  42. package/package.json +154 -14
  43. package/.svgconfig.json +0 -3
  44. package/CODE_OF_CONDUCT.md +0 -79
  45. package/CONTRIBUTING.md +0 -146
  46. package/TESTING.md +0 -143
  47. package/cli-framework.test.js +0 -16
  48. package/cli-test-angular/Arrowbenddownleft.component.ts +0 -27
  49. package/cli-test-angular/Vite.component.ts +0 -27
  50. package/cli-test-angular/index.ts +0 -25
  51. package/cli-test-output/Arrowbenddownleft.vue +0 -33
  52. package/cli-test-output/Vite.vue +0 -33
  53. package/cli-test-output/index.ts +0 -25
  54. package/cli-test-react/Arrowbenddownleft.tsx +0 -39
  55. package/cli-test-react/Vite.tsx +0 -39
  56. package/cli-test-react/index.ts +0 -25
  57. package/cli-test-svelte/Arrowbenddownleft.svelte +0 -22
  58. package/cli-test-svelte/Vite.svelte +0 -22
  59. package/cli-test-svelte/index.ts +0 -25
  60. package/frameworks.test.js +0 -170
  61. package/my-svgs/ArrowBendDownLeft.svg +0 -6
  62. package/my-svgs/vite.svg +0 -1
  63. package/src/builder.ts +0 -104
  64. package/src/clean.ts +0 -21
  65. package/src/cli.ts +0 -221
  66. package/src/config.ts +0 -81
  67. package/src/core/error-handler.ts +0 -303
  68. package/src/core/logger.ts +0 -104
  69. package/src/core/performance-engine.ts +0 -327
  70. package/src/core/plugin-manager.ts +0 -228
  71. package/src/core/style-compiler.ts +0 -605
  72. package/src/lock.ts +0 -74
  73. package/src/processors/svg-processor.ts +0 -288
  74. package/src/services/config.ts +0 -241
  75. package/src/services/file-watcher.ts +0 -218
  76. package/src/services/svg-service.ts +0 -468
  77. package/src/templates/ComponentTemplate.ts +0 -57
  78. package/src/types/index.ts +0 -169
  79. package/src/utils/native.ts +0 -352
  80. package/src/watch.ts +0 -88
  81. package/test-output-mulit/TestIcon-angular-module.component.ts +0 -26
  82. package/test-output-mulit/TestIcon-angular-standalone.component.ts +0 -27
  83. package/test-output-mulit/TestIcon-lit.ts +0 -35
  84. package/test-output-mulit/TestIcon-preact.tsx +0 -38
  85. package/test-output-mulit/TestIcon-react.tsx +0 -35
  86. package/test-output-mulit/TestIcon-solid.tsx +0 -27
  87. package/test-output-mulit/TestIcon-svelte.svelte +0 -22
  88. package/test-output-mulit/TestIcon-vanilla.ts +0 -37
  89. package/test-output-mulit/TestIcon-vue-composition.vue +0 -33
  90. package/test-output-mulit/TestIcon-vue-options.vue +0 -31
  91. package/tsconfig.json +0 -18
@@ -0,0 +1,252 @@
1
+ import os from 'os';
2
+ import { logger } from '../core/logger.js';
3
+ import { svgProcessor } from '../processors/svg-processor.js';
4
+ /**
5
+ * Performance optimization engine for batch processing and parallel execution
6
+ */
7
+ export class PerformanceEngine {
8
+ static instance;
9
+ processingCache = new Map();
10
+ cacheTimeout = 5 * 60 * 1000; // 5 minutes
11
+ constructor() { }
12
+ static getInstance() {
13
+ if (!PerformanceEngine.instance) {
14
+ PerformanceEngine.instance = new PerformanceEngine();
15
+ }
16
+ return PerformanceEngine.instance;
17
+ }
18
+ /**
19
+ * Process multiple SVG files in parallel with optimized batching
20
+ */
21
+ async processBatch(files, config = {}) {
22
+ const { batchSize = 10, parallel = true, maxConcurrency = Math.min(4, os.cpus().length), } = config;
23
+ logger.info(`Processing ${files.length} files with ${parallel ? 'parallel' : 'sequential'} execution`);
24
+ const startTime = Date.now();
25
+ const results = [];
26
+ if (!parallel) {
27
+ // Sequential processing for stability
28
+ for (const file of files) {
29
+ const result = await this.processSingleWithCaching(file);
30
+ results.push(result);
31
+ }
32
+ }
33
+ else {
34
+ // Parallel processing with controlled concurrency
35
+ const batches = this.createBatches(files, batchSize);
36
+ for (const batch of batches) {
37
+ const semaphore = new Semaphore(maxConcurrency);
38
+ const batchPromises = batch.map(file => this.withSemaphore(semaphore, () => this.processSingleWithCaching(file)));
39
+ const batchResults = await Promise.all(batchPromises);
40
+ results.push(...batchResults);
41
+ }
42
+ }
43
+ const totalDuration = Date.now() - startTime;
44
+ const successful = results.filter(r => r.success).length;
45
+ logger.info(`Batch processing complete: ${successful}/${files.length} successful in ${totalDuration}ms`);
46
+ return results;
47
+ }
48
+ /**
49
+ * Process single file with caching support
50
+ */
51
+ async processSingleWithCaching(file) {
52
+ const startTime = Date.now();
53
+ const cacheKey = this.generateCacheKey(file.path, file.options || {});
54
+ // Check cache first
55
+ const cached = this.getCachedResult(cacheKey);
56
+ if (cached) {
57
+ logger.debug(`Cache hit for ${file.path}`);
58
+ return {
59
+ success: true,
60
+ filePath: file.path,
61
+ duration: Date.now() - startTime,
62
+ };
63
+ }
64
+ try {
65
+ const result = await svgProcessor.processSVGFile(file.path, file.outputDir, file.options);
66
+ // Cache successful results
67
+ if (result.success) {
68
+ this.setCachedResult(cacheKey, result);
69
+ }
70
+ return {
71
+ success: result.success,
72
+ filePath: file.path,
73
+ error: result.error,
74
+ duration: Date.now() - startTime,
75
+ };
76
+ }
77
+ catch (error) {
78
+ return {
79
+ success: false,
80
+ filePath: file.path,
81
+ error: error,
82
+ duration: Date.now() - startTime,
83
+ };
84
+ }
85
+ }
86
+ /**
87
+ * Optimize SVG content with performance considerations
88
+ */
89
+ optimizeSVGContent(content, level = 'balanced') {
90
+ const startTime = performance.now();
91
+ let optimized = content;
92
+ switch (level) {
93
+ case 'fast':
94
+ // Basic optimizations only
95
+ optimized = this.applyFastOptimizations(content);
96
+ break;
97
+ case 'balanced':
98
+ // Standard optimizations with good performance/quality balance
99
+ optimized = this.applyBalancedOptimizations(content);
100
+ break;
101
+ case 'maximum':
102
+ // Comprehensive optimizations
103
+ optimized = this.applyMaximumOptimizations(content);
104
+ break;
105
+ }
106
+ const duration = performance.now() - startTime;
107
+ const compressionRatio = (1 - optimized.length / content.length) * 100;
108
+ logger.debug(`SVG optimization (${level}): ${compressionRatio.toFixed(1)}% reduction in ${duration.toFixed(2)}ms`);
109
+ return optimized;
110
+ }
111
+ /**
112
+ * Memory usage monitoring and optimization
113
+ */
114
+ monitorMemoryUsage() {
115
+ const memUsage = process.memoryUsage();
116
+ const cacheSize = this.processingCache.size;
117
+ const recommendations = [];
118
+ // Memory usage analysis
119
+ const heapUsedMB = memUsage.heapUsed / 1024 / 1024;
120
+ const heapTotalMB = memUsage.heapTotal / 1024 / 1024;
121
+ if (heapUsedMB > 500) {
122
+ recommendations.push('Consider reducing batch size or enabling sequential processing');
123
+ }
124
+ if (cacheSize > 1000) {
125
+ recommendations.push('Cache size is large, consider clearing old entries');
126
+ }
127
+ if (memUsage.external > 100 * 1024 * 1024) {
128
+ recommendations.push('High external memory usage detected');
129
+ }
130
+ return {
131
+ heapUsed: heapUsedMB,
132
+ heapTotal: heapTotalMB,
133
+ external: memUsage.external / 1024 / 1024,
134
+ cacheSize,
135
+ recommendations,
136
+ };
137
+ }
138
+ /**
139
+ * Clear processing cache
140
+ */
141
+ clearCache() {
142
+ this.processingCache.clear();
143
+ logger.debug('Processing cache cleared');
144
+ }
145
+ /**
146
+ * Get performance metrics
147
+ */
148
+ getPerformanceMetrics() {
149
+ // This would be implemented with proper metrics collection
150
+ return {
151
+ cacheHitRate: 0, // Placeholder
152
+ averageProcessingTime: 0, // Placeholder
153
+ memoryUsage: this.monitorMemoryUsage(),
154
+ };
155
+ }
156
+ // Private helper methods
157
+ createBatches(items, batchSize) {
158
+ const batches = [];
159
+ for (let i = 0; i < items.length; i += batchSize) {
160
+ batches.push(items.slice(i, i + batchSize));
161
+ }
162
+ return batches;
163
+ }
164
+ async withSemaphore(semaphore, task) {
165
+ await semaphore.acquire();
166
+ try {
167
+ return await task();
168
+ }
169
+ finally {
170
+ semaphore.release();
171
+ }
172
+ }
173
+ generateCacheKey(filePath, options) {
174
+ // Create a hash of file path and options for caching
175
+ const key = JSON.stringify({ filePath, options });
176
+ return Buffer.from(key).toString('base64');
177
+ }
178
+ getCachedResult(key) {
179
+ const cached = this.processingCache.get(key);
180
+ if (!cached)
181
+ return null;
182
+ // Check if cache entry is still valid
183
+ if (Date.now() - cached.timestamp > this.cacheTimeout) {
184
+ this.processingCache.delete(key);
185
+ return null;
186
+ }
187
+ return cached.result;
188
+ }
189
+ setCachedResult(key, result) {
190
+ this.processingCache.set(key, {
191
+ result,
192
+ timestamp: Date.now(),
193
+ });
194
+ }
195
+ applyFastOptimizations(content) {
196
+ return content
197
+ .replace(/\s+/g, ' ') // Normalize whitespace
198
+ .replace(/>\s+</g, '><') // Remove spaces between tags
199
+ .trim();
200
+ }
201
+ applyBalancedOptimizations(content) {
202
+ let optimized = this.applyFastOptimizations(content);
203
+ // Remove unnecessary attributes
204
+ optimized = optimized
205
+ .replace(/\s+id="[^"]*"/g, '') // Remove IDs (usually not needed in components)
206
+ .replace(/\s+class="[^"]*"/g, '') // Remove classes
207
+ .replace(/<!--[\s\S]*?-->/g, '') // Remove comments
208
+ .replace(/\s+xmlns="[^"]*"/g, ''); // Remove xmlns (React adds it)
209
+ return optimized;
210
+ }
211
+ applyMaximumOptimizations(content) {
212
+ let optimized = this.applyBalancedOptimizations(content);
213
+ // Advanced optimizations
214
+ optimized = optimized
215
+ .replace(/\s+style="[^"]*"/g, '') // Remove inline styles
216
+ .replace(/\s+data-[^=]*="[^"]*"/g, '') // Remove data attributes
217
+ .replace(/fill="none"/g, '') // Remove default fill
218
+ .replace(/stroke="none"/g, '') // Remove default stroke
219
+ .replace(/\s+version="[^"]*"/g, '') // Remove version
220
+ .replace(/\s+baseProfile="[^"]*"/g, ''); // Remove baseProfile
221
+ return optimized;
222
+ }
223
+ }
224
+ /**
225
+ * Semaphore for controlling concurrency
226
+ */
227
+ class Semaphore {
228
+ permits;
229
+ waitQueue = [];
230
+ constructor(permits) {
231
+ this.permits = permits;
232
+ }
233
+ async acquire() {
234
+ if (this.permits > 0) {
235
+ this.permits--;
236
+ return Promise.resolve();
237
+ }
238
+ return new Promise(resolve => {
239
+ this.waitQueue.push(resolve);
240
+ });
241
+ }
242
+ release() {
243
+ this.permits++;
244
+ if (this.waitQueue.length > 0) {
245
+ const resolve = this.waitQueue.shift();
246
+ this.permits--;
247
+ resolve();
248
+ }
249
+ }
250
+ }
251
+ // Export singleton instance
252
+ export const performanceEngine = PerformanceEngine.getInstance();
@@ -0,0 +1,56 @@
1
+ import { Plugin, PluginConfig } from '../types/index.js';
2
+ /**
3
+ * Plugin management system for extending SVG processing capabilities
4
+ */
5
+ export declare class PluginManager {
6
+ private static instance;
7
+ private plugins;
8
+ private activePlugins;
9
+ private constructor();
10
+ static getInstance(): PluginManager;
11
+ /**
12
+ * Load built-in plugins
13
+ */
14
+ private loadBuiltinPlugins;
15
+ /**
16
+ * Register a new plugin
17
+ */
18
+ registerPlugin(plugin: Plugin): void;
19
+ /**
20
+ * Enable a plugin
21
+ */
22
+ enablePlugin(name: string, config?: PluginConfig): void;
23
+ /**
24
+ * Disable a plugin
25
+ */
26
+ disablePlugin(name: string): void;
27
+ /**
28
+ * Process content through all active plugins
29
+ */
30
+ processContent(content: string, pluginConfigs?: PluginConfig[]): Promise<string>;
31
+ /**
32
+ * Get list of available plugins
33
+ */
34
+ getAvailablePlugins(): Array<{
35
+ name: string;
36
+ version: string;
37
+ enabled: boolean;
38
+ }>;
39
+ /**
40
+ * Built-in SVG optimizer
41
+ */
42
+ private optimizeSVG;
43
+ /**
44
+ * Built-in color theme applier
45
+ */
46
+ private applyColorTheme;
47
+ /**
48
+ * Built-in size normalizer
49
+ */
50
+ private normalizeSizes;
51
+ /**
52
+ * Clear all plugins (useful for testing)
53
+ */
54
+ clear(): void;
55
+ }
56
+ export declare const pluginManager: PluginManager;
@@ -0,0 +1,191 @@
1
+ import { logger } from '../core/logger.js';
2
+ /**
3
+ * Plugin management system for extending SVG processing capabilities
4
+ */
5
+ export class PluginManager {
6
+ static instance;
7
+ plugins = new Map();
8
+ activePlugins = new Set();
9
+ constructor() {
10
+ this.loadBuiltinPlugins();
11
+ }
12
+ static getInstance() {
13
+ if (!PluginManager.instance) {
14
+ PluginManager.instance = new PluginManager();
15
+ }
16
+ return PluginManager.instance;
17
+ }
18
+ /**
19
+ * Load built-in plugins
20
+ */
21
+ loadBuiltinPlugins() {
22
+ // SVG Optimizer Plugin
23
+ this.registerPlugin({
24
+ name: 'svg-optimizer',
25
+ version: '1.0.0',
26
+ process: async (content, options) => {
27
+ return this.optimizeSVG(content, options);
28
+ },
29
+ validate: (options) => true,
30
+ });
31
+ // Color Theme Plugin
32
+ this.registerPlugin({
33
+ name: 'color-theme',
34
+ version: '1.0.0',
35
+ process: async (content, options) => {
36
+ return this.applyColorTheme(content, options);
37
+ },
38
+ validate: (options) => {
39
+ return options && typeof options.theme === 'object';
40
+ },
41
+ });
42
+ // Size Normalizer Plugin
43
+ this.registerPlugin({
44
+ name: 'size-normalizer',
45
+ version: '1.0.0',
46
+ process: async (content, options) => {
47
+ return this.normalizeSizes(content, options);
48
+ },
49
+ });
50
+ logger.debug('Built-in plugins loaded');
51
+ }
52
+ /**
53
+ * Register a new plugin
54
+ */
55
+ registerPlugin(plugin) {
56
+ if (this.plugins.has(plugin.name)) {
57
+ logger.warn(`Plugin ${plugin.name} is already registered, overwriting`);
58
+ }
59
+ this.plugins.set(plugin.name, plugin);
60
+ logger.debug(`Plugin registered: ${plugin.name} v${plugin.version}`);
61
+ }
62
+ /**
63
+ * Enable a plugin
64
+ */
65
+ enablePlugin(name, config) {
66
+ const plugin = this.plugins.get(name);
67
+ if (!plugin) {
68
+ throw new Error(`Plugin not found: ${name}`);
69
+ }
70
+ if (plugin.validate &&
71
+ config?.options &&
72
+ !plugin.validate(config.options)) {
73
+ throw new Error(`Invalid options for plugin: ${name}`);
74
+ }
75
+ this.activePlugins.add(name);
76
+ logger.info(`Plugin enabled: ${name}`);
77
+ }
78
+ /**
79
+ * Disable a plugin
80
+ */
81
+ disablePlugin(name) {
82
+ this.activePlugins.delete(name);
83
+ logger.info(`Plugin disabled: ${name}`);
84
+ }
85
+ /**
86
+ * Process content through all active plugins
87
+ */
88
+ async processContent(content, pluginConfigs = []) {
89
+ let processedContent = content;
90
+ for (const config of pluginConfigs) {
91
+ const plugin = this.plugins.get(config.name);
92
+ if (!plugin) {
93
+ logger.warn(`Plugin not found: ${config.name}, skipping`);
94
+ continue;
95
+ }
96
+ if (!this.activePlugins.has(config.name)) {
97
+ logger.debug(`Plugin ${config.name} is disabled, skipping`);
98
+ continue;
99
+ }
100
+ try {
101
+ logger.debug(`Processing with plugin: ${config.name}`);
102
+ processedContent = await plugin.process(processedContent, config.options);
103
+ }
104
+ catch (error) {
105
+ logger.error(`Plugin ${config.name} failed:`, error);
106
+ // Continue processing with other plugins
107
+ }
108
+ }
109
+ return processedContent;
110
+ }
111
+ /**
112
+ * Get list of available plugins
113
+ */
114
+ getAvailablePlugins() {
115
+ return Array.from(this.plugins.entries()).map(([name, plugin]) => ({
116
+ name,
117
+ version: plugin.version,
118
+ enabled: this.activePlugins.has(name),
119
+ }));
120
+ }
121
+ /**
122
+ * Built-in SVG optimizer
123
+ */
124
+ optimizeSVG(content, options = {}) {
125
+ let optimized = content;
126
+ // Remove unnecessary whitespace
127
+ if (options.removeWhitespace !== false) {
128
+ optimized = optimized.replace(/>\s+</g, '><');
129
+ }
130
+ // Remove empty groups
131
+ if (options.removeEmptyGroups !== false) {
132
+ optimized = optimized.replace(/<g[^>]*>\s*<\/g>/g, '');
133
+ }
134
+ // Merge similar paths (basic implementation)
135
+ if (options.mergePaths === true) {
136
+ // This would require more sophisticated path parsing
137
+ logger.debug('Path merging not implemented yet');
138
+ }
139
+ // Remove comments
140
+ if (options.removeComments !== false) {
141
+ optimized = optimized.replace(/<!--[\s\S]*?-->/g, '');
142
+ }
143
+ return optimized;
144
+ }
145
+ /**
146
+ * Built-in color theme applier
147
+ */
148
+ applyColorTheme(content, options = {}) {
149
+ if (!options.theme) {
150
+ return content;
151
+ }
152
+ let themed = content;
153
+ const theme = options.theme;
154
+ // Replace colors according to theme
155
+ for (const [originalColor, newColor] of Object.entries(theme)) {
156
+ const colorRegex = new RegExp(`(fill|stroke)=["']${originalColor}["']`, 'g');
157
+ themed = themed.replace(colorRegex, `$1="${newColor}"`);
158
+ }
159
+ return themed;
160
+ }
161
+ /**
162
+ * Built-in size normalizer
163
+ */
164
+ normalizeSizes(content, options = {}) {
165
+ const targetSize = options.size || 24;
166
+ // This is a basic implementation - would need more sophisticated sizing logic
167
+ let normalized = content;
168
+ // Normalize stroke-width relative to size
169
+ if (options.normalizeStrokes !== false) {
170
+ const strokeRegex = /stroke-width=["']([^"']+)["']/g;
171
+ normalized = normalized.replace(strokeRegex, (match, width) => {
172
+ const numericWidth = parseFloat(width);
173
+ if (!isNaN(numericWidth)) {
174
+ const normalizedWidth = (numericWidth / 24) * targetSize;
175
+ return `stroke-width="${normalizedWidth}"`;
176
+ }
177
+ return match;
178
+ });
179
+ }
180
+ return normalized;
181
+ }
182
+ /**
183
+ * Clear all plugins (useful for testing)
184
+ */
185
+ clear() {
186
+ this.plugins.clear();
187
+ this.activePlugins.clear();
188
+ }
189
+ }
190
+ // Export singleton instance
191
+ export const pluginManager = PluginManager.getInstance();
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Comprehensive styling system for SVG components
3
+ * Supports all CSS properties, responsive design, theming, and dynamic styling
4
+ */
5
+ export interface StyleTheme {
6
+ name: string;
7
+ colors: Record<string, string>;
8
+ sizes: Record<string, number | string>;
9
+ spacing: Record<string, number | string>;
10
+ breakpoints?: Record<string, string>;
11
+ animations?: Record<string, string>;
12
+ }
13
+ export interface ResponsiveValue<T> {
14
+ base: T;
15
+ sm?: T;
16
+ md?: T;
17
+ lg?: T;
18
+ xl?: T;
19
+ [key: string]: T | undefined;
20
+ }
21
+ export interface SVGStyleOptions {
22
+ fill?: string | ResponsiveValue<string>;
23
+ stroke?: string | ResponsiveValue<string>;
24
+ strokeWidth?: number | string | ResponsiveValue<number | string>;
25
+ width?: number | string | ResponsiveValue<number | string>;
26
+ height?: number | string | ResponsiveValue<number | string>;
27
+ size?: number | string | ResponsiveValue<number | string>;
28
+ transform?: string;
29
+ rotate?: number | string;
30
+ scale?: number | string;
31
+ translateX?: number | string;
32
+ translateY?: number | string;
33
+ opacity?: number | ResponsiveValue<number>;
34
+ filter?: string;
35
+ clipPath?: string;
36
+ mask?: string;
37
+ animation?: string;
38
+ transition?: string;
39
+ hover?: Partial<SVGStyleOptions>;
40
+ focus?: Partial<SVGStyleOptions>;
41
+ active?: Partial<SVGStyleOptions>;
42
+ disabled?: Partial<SVGStyleOptions>;
43
+ theme?: string | StyleTheme;
44
+ responsive?: boolean;
45
+ css?: Record<string, string | number>;
46
+ className?: string;
47
+ 'aria-label'?: string;
48
+ 'aria-hidden'?: boolean;
49
+ title?: string;
50
+ role?: string;
51
+ }
52
+ export interface CompiledStyles {
53
+ inline: Record<string, string | number>;
54
+ classes: string[];
55
+ cssRules: string[];
56
+ mediaQueries: string[];
57
+ }
58
+ export declare class SVGStyleCompiler {
59
+ private static instance;
60
+ private themes;
61
+ private globalCSS;
62
+ private constructor();
63
+ static getInstance(): SVGStyleCompiler;
64
+ /**
65
+ * Compile SVG styling options into CSS
66
+ */
67
+ compileStyles(options: SVGStyleOptions, componentName: string): CompiledStyles;
68
+ /**
69
+ * Register a custom theme
70
+ */
71
+ registerTheme(theme: StyleTheme): void;
72
+ /**
73
+ * Generate CSS for a component with all styling options
74
+ */
75
+ generateComponentCSS(componentName: string, options: SVGStyleOptions): string;
76
+ /**
77
+ * Generate enhanced React component template with full styling support
78
+ */
79
+ generateStyledComponent(componentName: string, svgContent: string, options?: SVGStyleOptions): string;
80
+ private loadDefaultThemes;
81
+ private resolveTheme;
82
+ private compileBaseStyles;
83
+ private compileResponsiveStyles;
84
+ private compileInteractionStates;
85
+ private isResponsiveValue;
86
+ private camelToKebab;
87
+ }
88
+ export declare const styleCompiler: SVGStyleCompiler;