UNPKG

dynamate-design-to-code

Version:

A powerful tool for converting Figma designs into high-quality, production-ready code with built-in best practices and customizable rulesets

40 lines (39 loc) 1.11 kB
import { ComponentNode } from './figma'; export interface GeneratorConfig { openaiApiKey: string; model?: string; temperature?: number; framework?: 'react' | 'vue' | 'svelte' | 'solid' | 'angular' | 'custom'; customFramework?: string; styling?: 'css' | 'tailwind' | 'css-modules' | 'styled-components' | 'custom'; customStyling?: string; features?: { typescript?: boolean; storybook?: boolean; tests?: boolean; accessibility?: boolean; }; } export interface GeneratedComponent { code: string; styles: string; dependencies: string[]; types?: string; stories?: string; tests?: string; documentation?: string; } export declare class CodeGenerator { private openai; private model; private temperature; private framework; private styling; private features; constructor(config: GeneratorConfig); generateComponent(component: ComponentNode): Promise<GeneratedComponent>; private getSystemPrompt; private buildPrompt; private parseGeneratedCode; private extractDependencies; }