@vladimirdukelic/revolutionary-ui-factory
Version:
Revolutionary UI Factory System v2 - Generate ANY UI component for ANY framework with 60-95% code reduction
116 lines (115 loc) • 2.94 kB
TypeScript
/**
* Component Generator for Revolutionary UI Factory
* Generates framework-specific components with massive code reduction
*/
export interface ComponentOptions {
name: string;
type: ComponentType;
framework?: Framework;
styling?: StylingSystem;
typescript?: boolean;
outputDir?: string;
props?: Record<string, any>;
features?: string[];
}
export type ComponentType = 'button' | 'form' | 'table' | 'card' | 'modal' | 'dashboard' | 'kanban' | 'calendar' | 'chart' | 'list' | 'grid' | 'tabs' | 'accordion' | 'menu' | 'navbar' | 'sidebar' | 'footer' | 'hero' | 'pricing';
export type Framework = 'react' | 'vue' | 'angular' | 'svelte' | 'solid' | 'preact' | 'alpine' | 'lit' | 'qwik' | 'astro';
export type StylingSystem = 'tailwind' | 'css-modules' | 'styled-components' | 'emotion' | 'css' | 'scss' | 'sass';
export declare class ComponentGenerator {
private templates;
constructor();
/**
* Generate a component based on options
*/
generate(options: ComponentOptions): Promise<GenerationResult>;
/**
* Save generated files to disk
*/
saveFiles(result: GenerationResult, baseDir: string): Promise<void>;
/**
* Initialize component templates
*/
private initializeTemplates;
/**
* Generate code using template
*/
private generateCode;
/**
* React Button Generator
*/
private generateReactButton;
/**
* React Form Generator
*/
private generateReactForm;
/**
* React Table Generator
*/
private generateReactTable;
/**
* React Dashboard Generator
*/
private generateReactDashboard;
/**
* Vue Button Generator
*/
private generateVueButton;
/**
* Vue Form Generator
*/
private generateVueForm;
/**
* Generic Button Generator
*/
private generateGenericButton;
/**
* Validate component options
*/
private validateOptions;
/**
* Get filename for component
*/
private getFilename;
/**
* Get style filename
*/
private getStyleFilename;
/**
* Get test filename
*/
private getTestFilename;
/**
* Get story filename
*/
private getStoryFilename;
/**
* Get file extension based on framework and typescript
*/
private getExtension;
/**
* Calculate code reduction metrics
*/
private calculateMetrics;
/**
* Get usage instructions
*/
private getUsageInstructions;
}
interface GeneratedFile {
filename: string;
content: string;
type: 'component' | 'styles' | 'test' | 'story';
}
interface GenerationResult {
files: GeneratedFile[];
metrics: ComponentMetrics;
preview: string;
instructions: string[];
}
interface ComponentMetrics {
linesGenerated: number;
linesTraditional: number;
codeReduction: string;
timesSaved: string;
}
export {};